@everymatrix/lottery-tipping-ticket-controller 1.80.11 → 1.80.13

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-3e1fe885.js');
6
- const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-15f47527.js');
6
+ const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-3cf6738b.js');
7
7
 
8
8
  /**
9
9
  * @name startOfDay
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-15f47527.js');
5
+ const lotteryTippingTicketController = require('./lottery-tipping-ticket-controller-3cf6738b.js');
6
6
  require('./index-3e1fe885.js');
7
7
 
8
8
 
@@ -2650,13 +2650,37 @@ const formatDate = ({ date, type = 'date', format: format$1 }) => {
2650
2650
  return '';
2651
2651
  }
2652
2652
  };
2653
- const fetcher = (url) => fetch(url, {
2654
- method: 'GET',
2655
- headers: {
2656
- 'x-scheme': 'application/json',
2657
- Accept: 'application/json'
2658
- }
2659
- }).then((r) => r.json());
2653
+ const generateUUID = () => {
2654
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2655
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2656
+ return v.toString(16);
2657
+ });
2658
+ };
2659
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2660
+ return new Promise((resolve, reject) => {
2661
+ const uuid = generateUUID();
2662
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2663
+ if (method !== 'GET' && method !== 'HEAD') {
2664
+ headersOrigin['X-Idempotency-Key'] = uuid;
2665
+ }
2666
+ const options = {
2667
+ method,
2668
+ headers: headersOrigin
2669
+ };
2670
+ if (body && method !== 'GET' && method !== 'HEAD') {
2671
+ options.body = JSON.stringify(body);
2672
+ }
2673
+ fetch(url, options)
2674
+ .then((response) => {
2675
+ if (!response.ok) {
2676
+ throw new Error(`HTTP error! Status: ${response.status}`);
2677
+ }
2678
+ return response.json();
2679
+ })
2680
+ .then((data) => resolve(data))
2681
+ .catch((error) => reject(error));
2682
+ });
2683
+ }
2660
2684
  const showNotification = ({ message, theme = 'success' }) => {
2661
2685
  window.postMessage({
2662
2686
  type: 'ShowNotificationToast',
@@ -2676,12 +2700,6 @@ const thousandSeparator = (value) => {
2676
2700
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
2677
2701
  return parts.join('.');
2678
2702
  };
2679
- const generateUUID = () => {
2680
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2681
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2682
- return v.toString(16);
2683
- });
2684
- };
2685
2703
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
2686
2704
  // format results to winning numbers
2687
2705
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -3004,7 +3022,7 @@ const LotteryTippingTicketController = class {
3004
3022
  const fetchData = () => {
3005
3023
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3006
3024
  this.isLoading = true;
3007
- fetcher(url.href)
3025
+ fetchRequest(url.href, 'GET')
3008
3026
  .then((res) => {
3009
3027
  var _a, _b, _c, _d, _e, _f, _g;
3010
3028
  this.rawData = res;
@@ -3111,7 +3129,7 @@ const LotteryTippingTicketController = class {
3111
3129
  }
3112
3130
  render() {
3113
3131
  var _a, _b, _c, _d, _e, _f, _g;
3114
- return (index.h("div", { key: '6b7aee4aacf53744bed1b3f3064b3a8357806ce5', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, index.h("lottery-tipping-ticket-banner", { key: '59907469fbee5440485938631bf311476d2649df', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), index.h("div", { key: '891700a5bb16ce5ddb4be8a0c48c824a97710edd', class: "flex flex-wrap LotteryTippingTicketController__main" }, index.h("div", { key: 'bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9', class: "LotteryTippingTicketController__main--left" }, index.h("lottery-tipping-ticket-bet", { key: '8fbfdf48b51ac3aa8faf51da106131d25ed99992', 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 && (index.h("vaadin-confirm-dialog", { key: 'a93fcec56f649438c6f0d3668d322885dd4da7dc', 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))));
3132
+ return (index.h("div", { key: '337388f1cf75297195a88c3728b865e74f613849', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, index.h("lottery-tipping-ticket-banner", { key: '2cd069a119c2a29773d217d0ad40f985fe05fb14', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), index.h("div", { key: '1ab326849e99b9558d1d6bc94985a4c48d74ab4a', class: "flex flex-wrap LotteryTippingTicketController__main" }, index.h("div", { key: 'abfb225ed18d7325555e2cdebd93348e82ae773e', class: "LotteryTippingTicketController__main--left" }, index.h("lottery-tipping-ticket-bet", { key: '19237e4c08ae390801898dd38796a6622255cd94', 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 && (index.h("vaadin-confirm-dialog", { key: 'fa596e199dfc64d23768c739981a4c494c93010c', 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))));
3115
3133
  }
3116
3134
  static get assetsDirs() { return ["../static"]; }
3117
3135
  static get watchers() { return {
@@ -3,7 +3,7 @@ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../.
3
3
  import "../../../../../lottery-tipping-ticket-bet/dist/types/index";
4
4
  import { BettingTypeEnum, PlayModeEnum } from "../../models";
5
5
  import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
6
- import { calculatePlayingModeOptions, doSubmitTicket, fetcher, formatResultsToWinningNumbers, getCheckedCountForEachLineAndEachMatch, getDefaultType, getEnableOptions, getPlayTypeConfig, showNotification, thousandSeparator, TICKET_INVALID_TOKEN } from "../../utils/utils";
6
+ import { calculatePlayingModeOptions, doSubmitTicket, fetchRequest, formatResultsToWinningNumbers, getCheckedCountForEachLineAndEachMatch, getDefaultType, getEnableOptions, getPlayTypeConfig, showNotification, thousandSeparator, TICKET_INVALID_TOKEN } from "../../utils/utils";
7
7
  import { EllipsisOutlined } from "@ant-design/icons-svg";
8
8
  import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
9
9
  const loadingImagePath = renderIconDefinitionToSVGElement(EllipsisOutlined, {
@@ -202,7 +202,7 @@ export class LotteryTippingTicketController {
202
202
  const fetchData = () => {
203
203
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
204
204
  this.isLoading = true;
205
- fetcher(url.href)
205
+ fetchRequest(url.href, 'GET')
206
206
  .then((res) => {
207
207
  var _a, _b, _c, _d, _e, _f, _g;
208
208
  this.rawData = res;
@@ -309,7 +309,7 @@ export class LotteryTippingTicketController {
309
309
  }
310
310
  render() {
311
311
  var _a, _b, _c, _d, _e, _f, _g;
312
- return (h("div", { key: '6b7aee4aacf53744bed1b3f3064b3a8357806ce5', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '59907469fbee5440485938631bf311476d2649df', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '891700a5bb16ce5ddb4be8a0c48c824a97710edd', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '8fbfdf48b51ac3aa8faf51da106131d25ed99992', 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: 'a93fcec56f649438c6f0d3668d322885dd4da7dc', 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))));
312
+ return (h("div", { key: '337388f1cf75297195a88c3728b865e74f613849', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '2cd069a119c2a29773d217d0ad40f985fe05fb14', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '1ab326849e99b9558d1d6bc94985a4c48d74ab4a', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'abfb225ed18d7325555e2cdebd93348e82ae773e', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '19237e4c08ae390801898dd38796a6622255cd94', 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: 'fa596e199dfc64d23768c739981a4c494c93010c', 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))));
313
313
  }
314
314
  static get is() { return "lottery-tipping-ticket-controller"; }
315
315
  static get encapsulation() { return "shadow"; }
@@ -24,13 +24,37 @@ export const formatDate = ({ date, type = 'date', format }) => {
24
24
  return '';
25
25
  }
26
26
  };
27
- export const fetcher = (url) => fetch(url, {
28
- method: 'GET',
29
- headers: {
30
- 'x-scheme': 'application/json',
31
- Accept: 'application/json'
32
- }
33
- }).then((r) => r.json());
27
+ export const generateUUID = () => {
28
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
29
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
30
+ return v.toString(16);
31
+ });
32
+ };
33
+ export function fetchRequest(url, method = 'GET', body = null, headers = {}) {
34
+ return new Promise((resolve, reject) => {
35
+ const uuid = generateUUID();
36
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
37
+ if (method !== 'GET' && method !== 'HEAD') {
38
+ headersOrigin['X-Idempotency-Key'] = uuid;
39
+ }
40
+ const options = {
41
+ method,
42
+ headers: headersOrigin
43
+ };
44
+ if (body && method !== 'GET' && method !== 'HEAD') {
45
+ options.body = JSON.stringify(body);
46
+ }
47
+ fetch(url, options)
48
+ .then((response) => {
49
+ if (!response.ok) {
50
+ throw new Error(`HTTP error! Status: ${response.status}`);
51
+ }
52
+ return response.json();
53
+ })
54
+ .then((data) => resolve(data))
55
+ .catch((error) => reject(error));
56
+ });
57
+ }
34
58
  export const showNotification = ({ message, theme = 'success' }) => {
35
59
  window.postMessage({
36
60
  type: 'ShowNotificationToast',
@@ -50,12 +74,6 @@ export const thousandSeparator = (value) => {
50
74
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
51
75
  return parts.join('.');
52
76
  };
53
- export const generateUUID = () => {
54
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
55
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
56
- return v.toString(16);
57
- });
58
- };
59
77
  export const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
60
78
  // format results to winning numbers
61
79
  export const formatResultsToWinningNumbers = (rawResults) => {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, g as getElement, c as createEvent } from './index-e3ec645c.js';
2
- import { r as requiredArgs, t as toDate, s as setClientStyling, a as setClientStylingURL, b as setStreamStyling, f as formatDate$1, c as resolveTranslationUrl, p as parseISO, d as format, e as renderIconDefinitionToSVGElement } from './lottery-tipping-ticket-controller-cdb985e7.js';
3
- export { L as lottery_tipping_ticket_controller } from './lottery-tipping-ticket-controller-cdb985e7.js';
2
+ import { r as requiredArgs, t as toDate, s as setClientStyling, a as setClientStylingURL, b as setStreamStyling, f as formatDate$1, c as resolveTranslationUrl, p as parseISO, d as format, e as renderIconDefinitionToSVGElement } from './lottery-tipping-ticket-controller-6e3bdd52.js';
3
+ export { L as lottery_tipping_ticket_controller } from './lottery-tipping-ticket-controller-6e3bdd52.js';
4
4
 
5
5
  /**
6
6
  * @name startOfDay
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { L as LotteryTippingTicketController } from './lottery-tipping-ticket-controller-cdb985e7.js';
1
+ export { L as LotteryTippingTicketController } from './lottery-tipping-ticket-controller-6e3bdd52.js';
2
2
  import './index-e3ec645c.js';
@@ -2648,13 +2648,37 @@ const formatDate = ({ date, type = 'date', format: format$1 }) => {
2648
2648
  return '';
2649
2649
  }
2650
2650
  };
2651
- const fetcher = (url) => fetch(url, {
2652
- method: 'GET',
2653
- headers: {
2654
- 'x-scheme': 'application/json',
2655
- Accept: 'application/json'
2656
- }
2657
- }).then((r) => r.json());
2651
+ const generateUUID = () => {
2652
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2653
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2654
+ return v.toString(16);
2655
+ });
2656
+ };
2657
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2658
+ return new Promise((resolve, reject) => {
2659
+ const uuid = generateUUID();
2660
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2661
+ if (method !== 'GET' && method !== 'HEAD') {
2662
+ headersOrigin['X-Idempotency-Key'] = uuid;
2663
+ }
2664
+ const options = {
2665
+ method,
2666
+ headers: headersOrigin
2667
+ };
2668
+ if (body && method !== 'GET' && method !== 'HEAD') {
2669
+ options.body = JSON.stringify(body);
2670
+ }
2671
+ fetch(url, options)
2672
+ .then((response) => {
2673
+ if (!response.ok) {
2674
+ throw new Error(`HTTP error! Status: ${response.status}`);
2675
+ }
2676
+ return response.json();
2677
+ })
2678
+ .then((data) => resolve(data))
2679
+ .catch((error) => reject(error));
2680
+ });
2681
+ }
2658
2682
  const showNotification = ({ message, theme = 'success' }) => {
2659
2683
  window.postMessage({
2660
2684
  type: 'ShowNotificationToast',
@@ -2674,12 +2698,6 @@ const thousandSeparator = (value) => {
2674
2698
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
2675
2699
  return parts.join('.');
2676
2700
  };
2677
- const generateUUID = () => {
2678
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2679
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2680
- return v.toString(16);
2681
- });
2682
- };
2683
2701
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
2684
2702
  // format results to winning numbers
2685
2703
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -3002,7 +3020,7 @@ const LotteryTippingTicketController = class {
3002
3020
  const fetchData = () => {
3003
3021
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3004
3022
  this.isLoading = true;
3005
- fetcher(url.href)
3023
+ fetchRequest(url.href, 'GET')
3006
3024
  .then((res) => {
3007
3025
  var _a, _b, _c, _d, _e, _f, _g;
3008
3026
  this.rawData = res;
@@ -3109,7 +3127,7 @@ const LotteryTippingTicketController = class {
3109
3127
  }
3110
3128
  render() {
3111
3129
  var _a, _b, _c, _d, _e, _f, _g;
3112
- return (h("div", { key: '6b7aee4aacf53744bed1b3f3064b3a8357806ce5', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '59907469fbee5440485938631bf311476d2649df', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '891700a5bb16ce5ddb4be8a0c48c824a97710edd', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '8fbfdf48b51ac3aa8faf51da106131d25ed99992', 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: 'a93fcec56f649438c6f0d3668d322885dd4da7dc', 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))));
3130
+ return (h("div", { key: '337388f1cf75297195a88c3728b865e74f613849', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '2cd069a119c2a29773d217d0ad40f985fe05fb14', "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, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '1ab326849e99b9558d1d6bc94985a4c48d74ab4a', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'abfb225ed18d7325555e2cdebd93348e82ae773e', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '19237e4c08ae390801898dd38796a6622255cd94', 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: 'fa596e199dfc64d23768c739981a4c494c93010c', 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))));
3113
3131
  }
3114
3132
  static get assetsDirs() { return ["../static"]; }
3115
3133
  static get watchers() { return {
@@ -1,4 +1,4 @@
1
- import{r as t,h as e,g as i,c as s}from"./index-e3ec645c.js";import{r as o,t as r,s as n,a,b as l,f as h,c,p as d,d as u,e as p}from"./lottery-tipping-ticket-controller-cdb985e7.js";export{L as lottery_tipping_ticket_controller}from"./lottery-tipping-ticket-controller-cdb985e7.js";function m(t){o(1,arguments);var e=r(t);return e.setHours(0,0,0,0),e}const v=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.position="top",this.delay=200,this.isVisible=!1,this._tooltipId=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this._tooltipId=`general-tooltip-${Math.random().toString(36).substring(2,9)}`}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}handleMouseEnterOrFocus(){clearTimeout(this.hideTimeout),this.showTimeout&&clearTimeout(this.showTimeout),this.showTimeout=setTimeout((()=>{this.isVisible=!0}),this.delay)}handleMouseLeaveOrBlur(){this.showTimeout&&clearTimeout(this.showTimeout),this.hideTimeout=setTimeout((()=>{this.isVisible=!1}),100)}handleKeyDown(t){"Escape"===t.key&&this.isVisible&&(this.isVisible=!1)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}render(){const t={"general-tooltip-popup":!0,visible:this.isVisible,[`general-tooltip-${this.position}`]:!0};return e("div",{key:"c0d52518e1e196e0d022789f7c6b7e64173b2c7d",class:"general-tooltip-wrapper"},e("slot",{key:"a935e103e16b0b619a024706e8224f4a937de6b9",name:"trigger"}),e("div",{key:"35c60e35ce3f8d5c2c42cd333fe64a3b289d34d4",class:"general-tooltip-container",role:"tooltip",ref:t=>this.stylingContainer=t},e("div",{key:"9d3fd9f142c1e3bd263dee289a2c1a9e4eebfddc",id:this._tooltipId,class:t,role:"tooltip"},e("slot",{key:"31344f0d4d4139f913d1819cc4f42a39f5113d8a",name:"content"}),e("div",{key:"f5cdd93060baec37b2a2879056efe2d66c5a553a",class:"general-tooltip-arrow"}))))}get hostElement(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};v.style=".general-tooltip-wrapper{display:inline-block;position:relative;line-height:0}.general-tooltip-container{display:contents;}.general-tooltip-popup{position:absolute;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background-inverse, #000);padding:8px 12px;border-radius:4px;font-size:0.875em;line-height:1.4;z-index:1000;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;white-space:nowrap;pointer-events:none;}.general-tooltip-popup.visible{opacity:1;visibility:visible}.general-tooltip-arrow{position:absolute;width:0;height:0;border-style:solid}.general-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:8px;}.general-tooltip-top .general-tooltip-arrow{top:100%;left:50%;transform:translateX(-50%);border-width:6px 6px 0 6px;border-color:var(--emw--color-gray-300, #333) transparent transparent transparent}.general-tooltip-bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:8px;}.general-tooltip-bottom .general-tooltip-arrow{bottom:100%;left:50%;transform:translateX(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--emw--color-gray-300, #333) transparent}.general-tooltip-left{right:100%;top:50%;transform:translateY(-50%);margin-right:8px;}.general-tooltip-left .general-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--emw--color-gray-300, #333)}.general-tooltip-right{left:100%;top:50%;transform:translateY(-50%);margin-left:8px;}.general-tooltip-right .general-tooltip-arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--emw--color-gray-300, #333) transparent transparent}";const f=class{constructor(e){t(this,e),this.lotteryTippingBulletToggleEvent=s(this,"lotteryTippingBulletToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.value="",this.disabled=!1,this.isSelected=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}handleClick(){this.disabled||this.lotteryTippingBulletToggleEvent.emit({positionIdx:this.positionIdx})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ef0fee38ed62adb7809b5a60668af6a499ebe5a6",ref:t=>this.stylingContainer=t},"text"===this.theme?e("div",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--text":!0}},this.value):e("button",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--disabled":this.disabled,"LotteryTippingBullet__segment--active":this.isSelected},onClick:this.handleClick.bind(this)},this.isSelected?"X":this.value))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};f.style=".LotteryTippingBullet__segment{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:16px;line-height:1;font-weight:500;color:var(--emw--color-typography, #000);background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;cursor:pointer;transition:all 0.2s ease;user-select:none}.LotteryTippingBullet__segment:not(.LotteryTippingBullet__segment--disabled):hover{cursor:pointer;animation:jelly 0.3s ease-in-out;transform:scale(1.02)}.LotteryTippingBullet__segment--text{border:none;color:var(--emw--color-typography, #000);background:transparent;font-weight:400}.LotteryTippingBullet__segment--text:hover{cursor:not-allowed !important}.LotteryTippingBullet__segment--active{font-weight:600;background-color:var(--emw--color-background-inverse, #000);color:var(--emw--color-primary, #fed275)}.LotteryTippingBullet__segment--disabled:not(.LotteryTippingBullet__segment--active){background-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-gray-150, #6f6f6f);border-color:var(--emw--color-gray-100, #e6e6e6)}.LotteryTippingBullet__segment--disabled:hover{cursor:not-allowed}@keyframes jelly{0%{transform:translate(0, 0)}20%{transform:translate(-0.5px, -0.5px)}40%{transform:translate(0.5px, 0.5px)}60%{transform:translate(-0.25px, -0.25px)}80%{transform:translate(0.25px, 0.25px)}100%{transform:translate(0, 0)}}";const g=class{constructor(e){t(this,e),this.lotteryTippingBulletGroupToggleEvent=s(this,"lotteryTippingBulletGroupToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.mode="single",this.bulletConfigContent=""}get bulletConfigArr(){const t=[{value:"1"},{value:"X"},{value:"2"}];if("string"!=typeof this.bulletConfigContent||!this.bulletConfigContent)return t;try{return JSON.parse(this.bulletConfigContent)}catch(e){return console.error("Error parsing bulletConfigContent:",e),t}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryTippingBulletSelectionHandler(t){const{positionIdx:e}=t.detail;this.handleToggle(e)}handleToggle(t){let e=[...this.bulletConfigArr];"single"===this.mode?(e=e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1}))),e[t].isSelected=!0):(e=e.map((t=>Object.assign({},t))),e[t].isSelected=!e[t].isSelected),this.lotteryTippingBulletGroupToggleEvent.emit({bulletConfigArr:e,positionIdx:this.positionIdx+"-"+t})}render(){var t;return e("div",{ref:t=>this.stylingContainer=t,key:this.positionIdx},e("div",{key:"68223022eed831932c571378164be913206d98e9",style:{display:"flex",flexDirection:"row",gap:"10px"}},null===(t=this.bulletConfigArr)||void 0===t?void 0:t.map(((t,i)=>e("div",{key:i},e("lottery-tipping-bullet",{value:t.value,isSelected:t.isSelected,"position-idx":i,disabled:t.disabled,theme:this.theme,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};g.style="";const b=["ro","en","fr","ar","hr"],y={en:{stop:"Stop",at:"at"},ro:{stop:"Oprește",at:"la"},fr:{stop:"Arrêtez",at:"à"},ar:{stop:"توقف",at:"في"},hr:{stop:"Stop",at:"u"}},_=(t,e)=>{const i=e;return y[void 0!==i&&b.includes(i)?i:"en"][t]},w=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.logoUrl=void 0,this.stopTime="",this.period=void 0}get formattedStopTime(){let t="";return this.stopTime?(t=h({date:this.stopTime,format:"dd/MM/yyyy HH:mm"}),function(t){return o(1,arguments),function(t,e){o(2,arguments);var i=m(t),s=m(e);return i.getTime()===s.getTime()}(t,Date.now())}(new Date(this.stopTime))&&(t=h({date:this.stopTime,format:"HH:mm"})),t):t}get formattedPeriod(){let t="";return t=h({date:this.period,format:"EEEE"}),"wednesday"===t.toLowerCase()&&(t="MIDWEEK"),t.toUpperCase()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}async componentWillLoad(){this.translationUrl&&c(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"8b8b9d66021090e8a4f566e11908341fb6a65bad",ref:t=>this.stylingContainer=t,class:"lottery-tipping-ticket-banner__container"},e("section",{key:"37d23ad6aca6c4a02283a78e6011d0c6e4f81dff",class:"banner"},e("div",{key:"919a9f7535468d5d75fa21e5c48c56c6c994aea7",class:"left"},this.logoUrl&&e("img",{key:"1d8e9f3e9ed7eaec36b604401c0a4045d735c209",alt:"Betting",src:this.logoUrl,class:"logo"})),e("div",{key:"3cdc189bcab34d964e6a17339c60e449ba4883d7",class:"mid period"},this.formattedPeriod),e("div",{key:"526f90497ed8a14ba03d04cffbbe7c263b0bd23c",class:"right"},e("span",{key:"00676d5b0fae7ad7b4d2cf549572ae7b3d3091c1",class:"pill"},e("strong",{key:"dde2bac5a9316cf97d34a19a433e6bcb74d50750"},_("stop",this.language))," ",_("at",this.language)," ",this.formattedStopTime))))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};w.style=".lottery-tipping-ticket-banner__container {\n font-family: system-ui, sans-serif;\n font-size: 14px;\n container-type: inline-size;\n}\n\n.banner {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: 0 1rem;\n background: var(--emw--color-primary, #fed275);\n border-top: 2px solid var(--emw--color-primary, #fed275);\n border-bottom: 2px solid var(--emw--color-primary, #fed275);\n gap: 0.5rem;\n white-space: nowrap;\n position: relative;\n height: 46px;\n}\n\n.left {\n flex: 1;\n gap: 0.4rem;\n}\n.left .logo {\n width: 216px;\n position: absolute;\n top: -7px;\n}\n\n.brand {\n font-weight: 700;\n color: var(--emw--color-typography, #000);\n}\n\n.mid {\n flex: 1;\n font-size: 1.5rem;\n font-weight: 800;\n font-style: italic;\n letter-spacing: 0.04em;\n color: var(--emw--color-typography, #000);\n text-align: center;\n}\n\n.right {\n flex: 1;\n display: flex;\n gap: 0.4rem;\n flex-wrap: wrap;\n justify-content: flex-end;\n}\n\n@container (max-width: 420px) {\n .mid {\n text-align: right;\n }\n .right {\n justify-content: center;\n }\n}\n.pill {\n padding: 0.25rem 0.7rem;\n font-size: 0.9rem;\n color: var(--emw--color-gray-400, #000);\n display: inline-flex;\n align-items: baseline;\n}\n\n.pill > strong {\n font-weight: 700;\n}";const x=["ro","en","fr","ar","hr"],k={en:{homeTeam:"Home team:",awayTeam:"Away team:",selectionCleared:"Your selection has been cleared.",selectionOnLineCleared:"Your selection on this line will be cleared.",loading:"Loading...",error:"Error!",noData:"No data available.",lineInfo:"Line {currentPage} of {totalPages}",clearAll:"Clear All",cancel:"Cancel",confirm:"Confirm"},ro:{homeTeam:"Echipa gazdă:",awayTeam:"Echipa oaspete:",selectionCleared:"Selecția dvs. a fost ștearsă.",selectionOnLineCleared:"Selecția dvs. de pe această linie va fi ștearsă.",loading:"Se încarcă...',n error: 'Eroare!",noData:"Nu sunt date disponibile.",lineInfo:"Linia {currentPage} din {totalPages}",clearAll:"Șterge tot",cancel:"Anulează",confirm:"Confirmă"},fr:{homeTeam:"Équipe à domicile:",awayTeam:"Équipe à l'extérieur:",selectionCleared:"Votre sélection a été effacée.",selectionOnLineCleared:"Votre sélection sur cette ligne sera effacée.",loading:"Chargement...',n error: 'Erreur!",noData:"Aucune donnée disponible.",lineInfo:"Ligne {currentPage} sur {totalPages}",clearAll:"Tout effacer",cancel:"Annuler",confirm:"Confirmer"},ar:{homeTeam:"الفريق المضيف:",awayTeam:"الفريق الضيف:",selectionCleared:"تم مسح اختيارك.",selectionOnLineCleared:"سيتم مسح اختيارك في هذا السطر.",loading:"جار التحميل...',n error: 'خطأ!",noData:"لا توجد بيانات متاحة.",lineInfo:"السطر {currentPage} من {totalPages}",clearAll:"مسح الكل",cancel:"إلغاء",confirm:"تأكيد"},hr:{homeTeam:"Domaći tim:",awayTeam:"Gostujući tim:",selectionCleared:"Vaš odabir je obrisan.",selectionOnLineCleared:"Vaš odabir na ovoj liniji bit će obrisan.",loading:"Učitavanje...',n error: 'Greška!",noData:"Nema dostupnih podataka.",lineInfo:"Linija {currentPage} od {totalPages}",clearAll:"Očisti sve",cancel:"Odustani",confirm:"Potvrdi"}},C=(t,e,i)=>{const s=e;let o=k[void 0!==s&&x.includes(s)?s:"en"][t];return i&&Object.keys(i).forEach((t=>{o=o.replace(`{${t}}`,i[t])})),o},A=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])k[e][i]=t[e][i]}))},S=[{value:"1"},{value:"X"},{value:"2"}];var z=Object.defineProperty,T=Object.defineProperties,I=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,P=(t,e,i)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,B=(t,e)=>{for(var i in e||(e={}))D.call(e,i)&&P(t,i,e[i]);if(O)for(var i of O(e))E.call(e,i)&&P(t,i,e[i]);return t},M=(t,e)=>T(t,I(e)),N=(t,e,i)=>(P(t,"symbol"!=typeof e?e+"":e,i),i),j=(t,e,i)=>new Promise(((s,o)=>{var r=t=>{try{a(i.next(t))}catch(t){o(t)}},n=t=>{try{a(i.throw(t))}catch(t){o(t)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);a((i=i.apply(t,e)).next())}))
1
+ import{r as t,h as e,g as i,c as s}from"./index-e3ec645c.js";import{r as o,t as r,s as n,a,b as l,f as h,c,p as d,d as u,e as p}from"./lottery-tipping-ticket-controller-6e3bdd52.js";export{L as lottery_tipping_ticket_controller}from"./lottery-tipping-ticket-controller-6e3bdd52.js";function m(t){o(1,arguments);var e=r(t);return e.setHours(0,0,0,0),e}const v=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.position="top",this.delay=200,this.isVisible=!1,this._tooltipId=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this._tooltipId=`general-tooltip-${Math.random().toString(36).substring(2,9)}`}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}handleMouseEnterOrFocus(){clearTimeout(this.hideTimeout),this.showTimeout&&clearTimeout(this.showTimeout),this.showTimeout=setTimeout((()=>{this.isVisible=!0}),this.delay)}handleMouseLeaveOrBlur(){this.showTimeout&&clearTimeout(this.showTimeout),this.hideTimeout=setTimeout((()=>{this.isVisible=!1}),100)}handleKeyDown(t){"Escape"===t.key&&this.isVisible&&(this.isVisible=!1)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}render(){const t={"general-tooltip-popup":!0,visible:this.isVisible,[`general-tooltip-${this.position}`]:!0};return e("div",{key:"c0d52518e1e196e0d022789f7c6b7e64173b2c7d",class:"general-tooltip-wrapper"},e("slot",{key:"a935e103e16b0b619a024706e8224f4a937de6b9",name:"trigger"}),e("div",{key:"35c60e35ce3f8d5c2c42cd333fe64a3b289d34d4",class:"general-tooltip-container",role:"tooltip",ref:t=>this.stylingContainer=t},e("div",{key:"9d3fd9f142c1e3bd263dee289a2c1a9e4eebfddc",id:this._tooltipId,class:t,role:"tooltip"},e("slot",{key:"31344f0d4d4139f913d1819cc4f42a39f5113d8a",name:"content"}),e("div",{key:"f5cdd93060baec37b2a2879056efe2d66c5a553a",class:"general-tooltip-arrow"}))))}get hostElement(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};v.style=".general-tooltip-wrapper{display:inline-block;position:relative;line-height:0}.general-tooltip-container{display:contents;}.general-tooltip-popup{position:absolute;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background-inverse, #000);padding:8px 12px;border-radius:4px;font-size:0.875em;line-height:1.4;z-index:1000;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;white-space:nowrap;pointer-events:none;}.general-tooltip-popup.visible{opacity:1;visibility:visible}.general-tooltip-arrow{position:absolute;width:0;height:0;border-style:solid}.general-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:8px;}.general-tooltip-top .general-tooltip-arrow{top:100%;left:50%;transform:translateX(-50%);border-width:6px 6px 0 6px;border-color:var(--emw--color-gray-300, #333) transparent transparent transparent}.general-tooltip-bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:8px;}.general-tooltip-bottom .general-tooltip-arrow{bottom:100%;left:50%;transform:translateX(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--emw--color-gray-300, #333) transparent}.general-tooltip-left{right:100%;top:50%;transform:translateY(-50%);margin-right:8px;}.general-tooltip-left .general-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--emw--color-gray-300, #333)}.general-tooltip-right{left:100%;top:50%;transform:translateY(-50%);margin-left:8px;}.general-tooltip-right .general-tooltip-arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--emw--color-gray-300, #333) transparent transparent}";const f=class{constructor(e){t(this,e),this.lotteryTippingBulletToggleEvent=s(this,"lotteryTippingBulletToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.value="",this.disabled=!1,this.isSelected=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}handleClick(){this.disabled||this.lotteryTippingBulletToggleEvent.emit({positionIdx:this.positionIdx})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"ef0fee38ed62adb7809b5a60668af6a499ebe5a6",ref:t=>this.stylingContainer=t},"text"===this.theme?e("div",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--text":!0}},this.value):e("button",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--disabled":this.disabled,"LotteryTippingBullet__segment--active":this.isSelected},onClick:this.handleClick.bind(this)},this.isSelected?"X":this.value))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};f.style=".LotteryTippingBullet__segment{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:16px;line-height:1;font-weight:500;color:var(--emw--color-typography, #000);background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;cursor:pointer;transition:all 0.2s ease;user-select:none}.LotteryTippingBullet__segment:not(.LotteryTippingBullet__segment--disabled):hover{cursor:pointer;animation:jelly 0.3s ease-in-out;transform:scale(1.02)}.LotteryTippingBullet__segment--text{border:none;color:var(--emw--color-typography, #000);background:transparent;font-weight:400}.LotteryTippingBullet__segment--text:hover{cursor:not-allowed !important}.LotteryTippingBullet__segment--active{font-weight:600;background-color:var(--emw--color-background-inverse, #000);color:var(--emw--color-primary, #fed275)}.LotteryTippingBullet__segment--disabled:not(.LotteryTippingBullet__segment--active){background-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-gray-150, #6f6f6f);border-color:var(--emw--color-gray-100, #e6e6e6)}.LotteryTippingBullet__segment--disabled:hover{cursor:not-allowed}@keyframes jelly{0%{transform:translate(0, 0)}20%{transform:translate(-0.5px, -0.5px)}40%{transform:translate(0.5px, 0.5px)}60%{transform:translate(-0.25px, -0.25px)}80%{transform:translate(0.25px, 0.25px)}100%{transform:translate(0, 0)}}";const g=class{constructor(e){t(this,e),this.lotteryTippingBulletGroupToggleEvent=s(this,"lotteryTippingBulletGroupToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.mode="single",this.bulletConfigContent=""}get bulletConfigArr(){const t=[{value:"1"},{value:"X"},{value:"2"}];if("string"!=typeof this.bulletConfigContent||!this.bulletConfigContent)return t;try{return JSON.parse(this.bulletConfigContent)}catch(e){return console.error("Error parsing bulletConfigContent:",e),t}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryTippingBulletSelectionHandler(t){const{positionIdx:e}=t.detail;this.handleToggle(e)}handleToggle(t){let e=[...this.bulletConfigArr];"single"===this.mode?(e=e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1}))),e[t].isSelected=!0):(e=e.map((t=>Object.assign({},t))),e[t].isSelected=!e[t].isSelected),this.lotteryTippingBulletGroupToggleEvent.emit({bulletConfigArr:e,positionIdx:this.positionIdx+"-"+t})}render(){var t;return e("div",{ref:t=>this.stylingContainer=t,key:this.positionIdx},e("div",{key:"68223022eed831932c571378164be913206d98e9",style:{display:"flex",flexDirection:"row",gap:"10px"}},null===(t=this.bulletConfigArr)||void 0===t?void 0:t.map(((t,i)=>e("div",{key:i},e("lottery-tipping-bullet",{value:t.value,isSelected:t.isSelected,"position-idx":i,disabled:t.disabled,theme:this.theme,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};g.style="";const b=["ro","en","fr","ar","hr"],y={en:{stop:"Stop",at:"at"},ro:{stop:"Oprește",at:"la"},fr:{stop:"Arrêtez",at:"à"},ar:{stop:"توقف",at:"في"},hr:{stop:"Stop",at:"u"}},_=(t,e)=>{const i=e;return y[void 0!==i&&b.includes(i)?i:"en"][t]},w=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.logoUrl=void 0,this.stopTime="",this.period=void 0}get formattedStopTime(){let t="";return this.stopTime?(t=h({date:this.stopTime,format:"dd/MM/yyyy HH:mm"}),function(t){return o(1,arguments),function(t,e){o(2,arguments);var i=m(t),s=m(e);return i.getTime()===s.getTime()}(t,Date.now())}(new Date(this.stopTime))&&(t=h({date:this.stopTime,format:"HH:mm"})),t):t}get formattedPeriod(){let t="";return t=h({date:this.period,format:"EEEE"}),"wednesday"===t.toLowerCase()&&(t="MIDWEEK"),t.toUpperCase()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&l(this.stylingContainer,`${this.mbSource}.Style`)}async componentWillLoad(){this.translationUrl&&c(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&l(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return e("div",{key:"8b8b9d66021090e8a4f566e11908341fb6a65bad",ref:t=>this.stylingContainer=t,class:"lottery-tipping-ticket-banner__container"},e("section",{key:"37d23ad6aca6c4a02283a78e6011d0c6e4f81dff",class:"banner"},e("div",{key:"919a9f7535468d5d75fa21e5c48c56c6c994aea7",class:"left"},this.logoUrl&&e("img",{key:"1d8e9f3e9ed7eaec36b604401c0a4045d735c209",alt:"Betting",src:this.logoUrl,class:"logo"})),e("div",{key:"3cdc189bcab34d964e6a17339c60e449ba4883d7",class:"mid period"},this.formattedPeriod),e("div",{key:"526f90497ed8a14ba03d04cffbbe7c263b0bd23c",class:"right"},e("span",{key:"00676d5b0fae7ad7b4d2cf549572ae7b3d3091c1",class:"pill"},e("strong",{key:"dde2bac5a9316cf97d34a19a433e6bcb74d50750"},_("stop",this.language))," ",_("at",this.language)," ",this.formattedStopTime))))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};w.style=".lottery-tipping-ticket-banner__container {\n font-family: system-ui, sans-serif;\n font-size: 14px;\n container-type: inline-size;\n}\n\n.banner {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: 0 1rem;\n background: var(--emw--color-primary, #fed275);\n border-top: 2px solid var(--emw--color-primary, #fed275);\n border-bottom: 2px solid var(--emw--color-primary, #fed275);\n gap: 0.5rem;\n white-space: nowrap;\n position: relative;\n height: 46px;\n}\n\n.left {\n flex: 1;\n gap: 0.4rem;\n}\n.left .logo {\n width: 216px;\n position: absolute;\n top: -7px;\n}\n\n.brand {\n font-weight: 700;\n color: var(--emw--color-typography, #000);\n}\n\n.mid {\n flex: 1;\n font-size: 1.5rem;\n font-weight: 800;\n font-style: italic;\n letter-spacing: 0.04em;\n color: var(--emw--color-typography, #000);\n text-align: center;\n}\n\n.right {\n flex: 1;\n display: flex;\n gap: 0.4rem;\n flex-wrap: wrap;\n justify-content: flex-end;\n}\n\n@container (max-width: 420px) {\n .mid {\n text-align: right;\n }\n .right {\n justify-content: center;\n }\n}\n.pill {\n padding: 0.25rem 0.7rem;\n font-size: 0.9rem;\n color: var(--emw--color-gray-400, #000);\n display: inline-flex;\n align-items: baseline;\n}\n\n.pill > strong {\n font-weight: 700;\n}";const x=["ro","en","fr","ar","hr"],k={en:{homeTeam:"Home team:",awayTeam:"Away team:",selectionCleared:"Your selection has been cleared.",selectionOnLineCleared:"Your selection on this line will be cleared.",loading:"Loading...",error:"Error!",noData:"No data available.",lineInfo:"Line {currentPage} of {totalPages}",clearAll:"Clear All",cancel:"Cancel",confirm:"Confirm"},ro:{homeTeam:"Echipa gazdă:",awayTeam:"Echipa oaspete:",selectionCleared:"Selecția dvs. a fost ștearsă.",selectionOnLineCleared:"Selecția dvs. de pe această linie va fi ștearsă.",loading:"Se încarcă...',n error: 'Eroare!",noData:"Nu sunt date disponibile.",lineInfo:"Linia {currentPage} din {totalPages}",clearAll:"Șterge tot",cancel:"Anulează",confirm:"Confirmă"},fr:{homeTeam:"Équipe à domicile:",awayTeam:"Équipe à l'extérieur:",selectionCleared:"Votre sélection a été effacée.",selectionOnLineCleared:"Votre sélection sur cette ligne sera effacée.",loading:"Chargement...',n error: 'Erreur!",noData:"Aucune donnée disponible.",lineInfo:"Ligne {currentPage} sur {totalPages}",clearAll:"Tout effacer",cancel:"Annuler",confirm:"Confirmer"},ar:{homeTeam:"الفريق المضيف:",awayTeam:"الفريق الضيف:",selectionCleared:"تم مسح اختيارك.",selectionOnLineCleared:"سيتم مسح اختيارك في هذا السطر.",loading:"جار التحميل...',n error: 'خطأ!",noData:"لا توجد بيانات متاحة.",lineInfo:"السطر {currentPage} من {totalPages}",clearAll:"مسح الكل",cancel:"إلغاء",confirm:"تأكيد"},hr:{homeTeam:"Domaći tim:",awayTeam:"Gostujući tim:",selectionCleared:"Vaš odabir je obrisan.",selectionOnLineCleared:"Vaš odabir na ovoj liniji bit će obrisan.",loading:"Učitavanje...',n error: 'Greška!",noData:"Nema dostupnih podataka.",lineInfo:"Linija {currentPage} od {totalPages}",clearAll:"Očisti sve",cancel:"Odustani",confirm:"Potvrdi"}},C=(t,e,i)=>{const s=e;let o=k[void 0!==s&&x.includes(s)?s:"en"][t];return i&&Object.keys(i).forEach((t=>{o=o.replace(`{${t}}`,i[t])})),o},A=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])k[e][i]=t[e][i]}))},S=[{value:"1"},{value:"X"},{value:"2"}];var z=Object.defineProperty,T=Object.defineProperties,I=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,P=(t,e,i)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,B=(t,e)=>{for(var i in e||(e={}))D.call(e,i)&&P(t,i,e[i]);if(O)for(var i of O(e))E.call(e,i)&&P(t,i,e[i]);return t},M=(t,e)=>T(t,I(e)),N=(t,e,i)=>(P(t,"symbol"!=typeof e?e+"":e,i),i),j=(t,e,i)=>new Promise(((s,o)=>{var r=t=>{try{a(i.next(t))}catch(t){o(t)}},n=t=>{try{a(i.throw(t))}catch(t){o(t)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);a((i=i.apply(t,e)).next())}))
2
2
  /**
3
3
  * @license
4
4
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
@@ -1 +1 @@
1
- export{L as LotteryTippingTicketController}from"./lottery-tipping-ticket-controller-cdb985e7.js";import"./index-e3ec645c.js";
1
+ export{L as LotteryTippingTicketController}from"./lottery-tipping-ticket-controller-6e3bdd52.js";import"./index-e3ec645c.js";
@@ -1 +1 @@
1
- import{r as t,c as e,h as n}from"./index-e3ec645c.js";function r(t,e){if(t){const n=document.createElement("style");n.innerHTML=e,t.appendChild(n)}}function i(t,e){const n=new URL(e);fetch(n.href).then((t=>t.text())).then((e=>{const n=document.createElement("style");n.innerHTML=e,t&&t.appendChild(n)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function o(t,e){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{n.innerHTML=e,t&&t.appendChild(n)}))}}var a,s;!function(t){t.SingleBet="SingleBet",t.SystemBet="SystemBet"}(a||(a={})),function(t){t.FullTime="FullTime",t.HalfTime="HalfTime",t.Both="Both"}(s||(s={}));const u=["ro","en","fr","ar","hr"],l={en:{selectionCleared:"Your selection will be cleared.",ticketSubmitted:"Ticket submitted successfully.",ticketFailed:"Failed to purchase the ticket. Please try again.",lines:"Lines",line:"Line",bettingType:"Betting Type",playingMode:"Playing Mode",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Tickets",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",cancel:"Cancel",confirm:"Confirm"},ro:{selectionCleared:"Selecția dvs. va fi ștearsă.",ticketSubmitted:"Bilet trimis cu succes.",ticketFailed:"Nu s-a putut achiziționa biletul. Vă rugăm să încercați din nou.",lines:"Linii",line:"Linie",bettingType:"Tip de pariu",playingMode:"Mod de joc",orderSummaryTitle:"Sumar comandă",orderSummaryTickets:"Bilete",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",cancel:"Anulează",confirm:"Confirmă"},fr:{selectionCleared:"Votre sélection sera effacée.",ticketSubmitted:"Billet soumis avec succès.",ticketFailed:"Échec de l'achat du billet. Veuillez réessayer.",lines:"Lignes",line:"Ligne",bettingType:"Type de pari",playingMode:"Mode de jeu",orderSummaryTitle:"Résumé de la commande",orderSummaryTickets:"Billets",orderSummaryTotal:"Total",orderSummarySubmit:"Soumettre",cancel:"Annuler",confirm:"Confirmer"},ar:{selectionCleared:"سيتم مسح اختيارك.",ticketSubmitted:"تم إرسال التذكرة بنجاح.",ticketFailed:"فشل شراء التذكرة. يرجى المحاولة مرة أخرى.",lines:"خطوط",line:"خط",bettingType:"نوع الرهان",playingMode:"وضع اللعب",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"التذاكر",orderSummaryTotal:"المجموع",orderSummarySubmit:"إرسال",cancel:"إلغاء",confirm:"تأكيد"},hr:{selectionCleared:"Vaš odabir bit će obrisan.",ticketSubmitted:"Listić je uspješno predan.",ticketFailed:"Kupnja listića nije uspjela. Molimo pokušajte ponovo.",lines:"Linije",line:"Linija",bettingType:"Vrsta oklade",playingMode:"Način igranja",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listići",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Pošalji",cancel:"Odustani",confirm:"Potvrdi"}},d=(t,e)=>{const n=e;return l[void 0!==n&&u.includes(n)?n:"en"][t]},c=async t=>{if(t)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();e=r,Object.keys(e).forEach((t=>{for(let n in e[t])l[t][n]=e[t][n]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function h(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function v(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===m(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var g={};function y(){return g}var p=36e5;function w(t){f(1,arguments);var e=v(t),n=e.getUTCDay(),r=(n<1?7:0)+n-1;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function b(t){f(1,arguments);var e=v(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=w(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=w(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function T(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=y(),c=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(u=d.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=v(t),g=m.getUTCDay(),p=(g<c?7:0)+g-c;return m.setUTCDate(m.getUTCDate()-p),m.setUTCHours(0,0,0,0),m}function x(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=v(t),c=d.getUTCFullYear(),m=y(),g=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:m.firstWeekContainsDate)&&void 0!==r?r:null===(u=m.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(c+1,0,g),p.setUTCHours(0,0,0,0);var w=T(p,e),b=new Date(0);b.setUTCFullYear(c,0,g),b.setUTCHours(0,0,0,0);var x=T(b,e);return d.getTime()>=w.getTime()?c+1:d.getTime()>=x.getTime()?c:c-1}function k(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}const _=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return k("yy"===e?r%100:r,e.length)},S=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):k(n+1,2)},M=function(t,e){return k(t.getUTCDate(),e.length)},C=function(t,e){return k(t.getUTCHours()%12||12,e.length)},L=function(t,e){return k(t.getUTCHours(),e.length)},D=function(t,e){return k(t.getUTCMinutes(),e.length)},N=function(t,e){return k(t.getUTCSeconds(),e.length)},P=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return k(Math.floor(r*Math.pow(10,n-3)),e.length)};var j={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _(t,e)},Y:function(t,e,n,r){var i=x(t,r),o=i>0?i:1-i;return"YY"===e?k(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):k(o,e.length)},R:function(t,e){return k(b(t),e.length)},u:function(t,e){return k(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return k(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return k(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return S(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return k(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=function(t,e){f(1,arguments);var n=v(t),r=T(n,e).getTime()-function(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=y(),c=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(u=d.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1),m=x(t,e),v=new Date(0);return v.setUTCFullYear(m,0,c),v.setUTCHours(0,0,0,0),T(v,e)}(n,e).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):k(i,e.length)},I:function(t,e,n){var r=function(t){f(1,arguments);var e=v(t),n=w(e).getTime()-function(t){f(1,arguments);var e=b(t),n=new Date(0);return n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),w(n)}(e).getTime();return Math.round(n/6048e5)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):k(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):M(t,e)},D:function(t,e,n){var r=function(t){f(1,arguments);var e=v(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime();return Math.floor((n-r)/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):k(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return k(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return k(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return k(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return C(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):L(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):D(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):N(t,e)},S:function(t,e){return P(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return B(i);case"XXXX":case"XX":return O(i);default:return O(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return B(i);case"xxxx":case"xx":return O(i);default:return O(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+E(i,":");default:return"GMT"+O(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+E(i,":");default:return"GMT"+O(i,":")}},t:function(t,e,n,r){return k(Math.floor((r._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,n,r){return k((r._originalDate||t).getTime(),e.length)}};function E(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+k(o,2)}function B(t,e){return t%60==0?(t>0?"-":"+")+k(Math.abs(t)/60,2):O(t,e)}function O(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+k(Math.floor(i/60),2)+n+k(i%60,2)}const W=j;var R=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Y=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},z={p:Y,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return R(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",R(i,e)).replace("{{time}}",Y(o,e))}};const q=z;var I=["D","DD"],A=["YY","YYYY"];function F(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var G={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Q(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var $,X={date:Q({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Q({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Q({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function H(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function J(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=e.match(r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth]);if(!i)return null;var o,a=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(a))return e}(s):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(a))return e}(s);return o=t.valueCallback?t.valueCallback(u):u,{value:o=n.valueCallback?n.valueCallback(o):o,rest:e.slice(a.length)}}}const V={code:"en-US",formatDistance:function(t,e,n){var r,i=G[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:X,formatRelative:function(t){return U[t]},localize:{ordinalNumber:function(t){var e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:H({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:H({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:H({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:H({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:H({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match($.matchPattern);if(!n)return null;var r=n[0],i=t.match($.parsePattern);if(!i)return null;var o=$.valueCallback?$.valueCallback(i[0]):i[0];return{value:o=e.valueCallback?e.valueCallback(o):o,rest:t.slice(r.length)}}),era:J({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:J({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:J({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tt=/^'([^]*?)'?$/,et=/''/g,nt=/[a-zA-Z]/;function rt(t,e,n){var r,i,o,a,s,u,l,d,c,g,p,w,b,T,x,k,_,S;f(2,arguments);var M=String(e),C=y(),L=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:C.locale)&&void 0!==r?r:V,D=h(null!==(o=null!==(a=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(d=l.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==s?s:C.firstWeekContainsDate)&&void 0!==a?a:null===(c=C.locale)||void 0===c||null===(g=c.options)||void 0===g?void 0:g.firstWeekContainsDate)&&void 0!==o?o:1);if(!(D>=1&&D<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=h(null!==(p=null!==(w=null!==(b=null!==(T=null==n?void 0:n.weekStartsOn)&&void 0!==T?T:null==n||null===(x=n.locale)||void 0===x||null===(k=x.options)||void 0===k?void 0:k.weekStartsOn)&&void 0!==b?b:C.weekStartsOn)&&void 0!==w?w:null===(_=C.locale)||void 0===_||null===(S=_.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==p?p:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!L.localize)throw new RangeError("locale must contain localize property");if(!L.formatLong)throw new RangeError("locale must contain formatLong property");var P=v(t);if(!function(t){if(f(1,arguments),!function(t){return f(1,arguments),t instanceof Date||"object"===m(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=v(t);return!isNaN(Number(e))}(P))throw new RangeError("Invalid time value");var j=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(P),E=function(t,e){return f(2,arguments),function(t,e){f(2,arguments);var n=v(t).getTime(),r=h(e);return new Date(n+r)}(t,-h(e))}(P,j),B={firstWeekContainsDate:D,weekStartsOn:N,locale:L,_originalDate:P};return M.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,q[e])(t,L.formatLong):t})).join("").match(K).map((function(r){if("''"===r)return"'";var i,o,a=r[0];if("'"===a)return(o=(i=r).match(tt))?o[1].replace(et,"'"):i;var s=W[a];if(s)return null!=n&&n.useAdditionalWeekYearTokens||-1===A.indexOf(r)||F(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!(-1!==I.indexOf(r))||F(r,e,String(t)),s(E,r,L.localize,B);if(a.match(nt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("")}function it(t,e){var n;f(1,arguments);var r=h(null!==(n=null==e?void 0:e.additionalDigits)&&void 0!==n?n:2);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var i,o=function(t){var e,n={},r=t.split(ot.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?e=r[0]:(n.date=r[0],e=r[1],ot.timeZoneDelimiter.test(n.date)&&(n.date=t.split(ot.timeZoneDelimiter)[0],e=t.substr(n.date.length,t.length))),e){var i=ot.timezone.exec(e);i?(n.time=e.replace(i[1],""),n.timezone=i[1]):n.time=e}return n}(t);if(o.date){var a=function(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:t.slice((r[1]||r[2]).length)}}(o.date,r);i=function(t,e){if(null===e)return new Date(NaN);var n=t.match(at);if(!n)return new Date(NaN);var r=!!n[4],i=lt(n[1]),o=lt(n[2])-1,a=lt(n[3]),s=lt(n[4]),u=lt(n[5])-1;if(r)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,u)?function(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=7*(e-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}(e,s,u):new Date(NaN);var l=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(ct[e]||(mt(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(mt(t)?366:365)}(e,i)?(l.setUTCFullYear(e,o,Math.max(i,a)),l):new Date(NaN)}(a.restDateString,a.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var s,u=i.getTime(),l=0;if(o.time&&(l=function(t){var e=t.match(st);if(!e)return NaN;var n=dt(e[1]),r=dt(e[2]),i=dt(e[3]);return function(t,e,n){return 24===t?0===e&&0===n:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,r,i)?n*p+6e4*r+1e3*i:NaN}(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(t){if("Z"===t)return 0;var e=t.match(ut);if(!e)return 0;var n="+"===e[1]?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,i)?n*(r*p+6e4*i):NaN}(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var ot={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},at=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,st=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ut=/^([+-])(\d{2})(?::?(\d{2}))?$/;function lt(t){return t?parseInt(t):1}function dt(t){return t&&parseFloat(t.replace(",","."))||0}var ct=[31,null,31,30,31,30,31,31,30,31,30,31];function mt(t){return t%400==0||t%4==0&&t%100!=0}const ht=({date:t,type:e="date",format:n})=>{try{const r=it(t);if(isNaN(r.getTime()))throw new Error(`Invalid date: ${t}`);if(n)return rt(r,n);let i="dd/MM/yyyy";return"time"===e?i="dd/MM/yyyy HH:mm:ss":"week"===e&&(i="ccc dd/MM/yyyy HH:mm:ss"),rt(r,i)}catch(t){return console.error("Error formatting date:",t.message),""}},ft=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},vt=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(".")},gt="TICKET_INVALID_TOKEN",yt=(t=[])=>t.filter((t=>t.enabled)),pt=({rawData:t,selectedBettingType:e,selectedPlayingMode:n})=>{var r,i,o,a,s,u;const l=null===(a=null===(o=null===(i=null===(r=null==t?void 0:t.rules)||void 0===r?void 0:r.poolGame)||void 0===i?void 0:i.playTypes)||void 0===o?void 0:o.find((t=>t.bettingType===e&&t.playMode===n)))||void 0===a?void 0:a.betTypeId,d=null===(u=null===(s=null==t?void 0:t.rules)||void 0===s?void 0:s.betTypes)||void 0===u?void 0:u.find((t=>t.id===l));return{betTypeId:l,betType:d}};var wt=function(){return wt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},wt.apply(this,arguments)},bt={primaryColor:"#333",secondaryColor:"#E6E6E6"};function Tt(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var n=e.placeholders||bt;return xt(t.icon(n.primaryColor,n.secondaryColor),e)}return xt(t.icon,e)}function xt(t,e){var n="svg"===t.tag?wt(wt({},t.attrs),e.extraSVGAttrs||{}):t.attrs,r=Object.keys(n).reduce((function(t,e){var r=n[e],i="".concat(e,'="').concat(r,'"');return t.push(i),t}),[]),i=r.length?" "+r.join(" "):"",o=(t.children||[]).map((function(t){return xt(t,e)})).join("");return o&&o.length?"<".concat(t.tag).concat(i,">").concat(o,"</").concat(t.tag,">"):"<".concat(t.tag).concat(i," />")}const kt=Tt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},{extraSVGAttrs:{height:"20px",width:"20px",fill:"currentColor"}}),_t=class{constructor(n){t(this,n),this.logoutEventHandler=e(this,"logout",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.endpoint="",this.endpointTicket=void 0,this.sessionId=void 0,this.gameId=void 0,this.playerId="",this.drawId=void 0,this.isLoading=!0,this.bettingTypeOptions=[],this.playingModeOptions=[],this.selectedBettingType=void 0,this.selectedPlayingMode=void 0,this.hasSelectBullet=void 0,this.hasSelectAllBullet=void 0,this.totalLineCombination=0,this.submitLoading=void 0,this.rawData={},this.dialogConfig={visible:!1}}async getLotteryTippingBulletResults(){return await this.childRef.getData()}get lineNumberRange(){const{betType:t}=pt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),e=(null==t?void 0:t.boardsAllowed)||[0],[n,r]=[Math.min(...e),Math.max(...e)];return{minLineNumber:n,maxLineNumber:r,defaultBoards:(null==t?void 0:t.defaultBoards)||n}}get playTypeConfig(){var t,e,n;return null===(n=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===n?void 0:n.playTypes}get betTypeConfig(){var t,e;return null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.betTypes}get isBothBettingType(){return this.selectedBettingType===s.Both}get currentStake(){var t,e,n;return null===(n=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.stakes)||void 0===n?void 0:n[0]}handleBettingTypeChange(t){var e,n,r,i;if(t===this.selectedBettingType)return;this.selectedBettingType=t;const o=(({bettingType:t,playTypeConfig:e,betTypeConfig:n,enabledPlayingModeOptions:r})=>{const i=n.filter((t=>t.enabled)).map((t=>t.id)),o=e.filter((t=>i.includes(t.betTypeId))).filter((e=>e.bettingType===t)).map((t=>t.playMode));return r.filter((t=>o.includes(t.code)))})({bettingType:this.selectedBettingType,playTypeConfig:this.playTypeConfig,betTypeConfig:this.betTypeConfig,enabledPlayingModeOptions:yt((null===(r=null===(n=null===(e=this.rawData)||void 0===e?void 0:e.rules)||void 0===n?void 0:n.poolGame)||void 0===r?void 0:r.playModes)||[])});this.playingModeOptions=o,o.length?o.map((t=>t.code)).includes(this.selectedPlayingMode)||(this.hasSelectBullet=!1,this.handlePlayingModeChange(null===(i=o[0])||void 0===i?void 0:i.code)):this.selectedPlayingMode=void 0,this.clearBulletConfig()}async clearBulletConfig(){return await this.childRef.resetBulletConfig(this.lineNumberRange)}handlePlayingModeChange(t){if(t===this.selectedPlayingMode)return;const e=e=>{this.selectedPlayingMode=t,this.clearBulletConfig().then((()=>{null==e||e()}))};if(this.hasSelectBullet){const t=()=>{this.dialogConfig={visible:!1}},n=()=>{e(t)};this.dialogConfig={visible:!0,content:d("selectionCleared",this.language),onConfirm:n,onCancel:t}}else e()}lotteryTippingBulletGroupSelectionHandler(t){var e;const n=null===(e=t.detail)||void 0===e?void 0:e.hasSelectBullet;void 0!==n&&(this.hasSelectBullet=n),this.bulletBetSelectChecker()}calculateCombinationInLine(t){return t.reduce(((t,e)=>t*e),1)}calculateTotalAmount(){const t=this.currentStake;return t?t.value*this.totalLineCombination:0}get totalAmountFormatted(){var t;const e=this.calculateTotalAmount();return vt(e)+" "+(null===(t=this.currentStake)||void 0===t?void 0:t.currency)||""}get currentStakeFormatted(){const{value:t="",currency:e=""}=this.currentStake||{};return`${t} ${e}`}bulletBetSelectChecker(){(async()=>{const t=await this.getLotteryTippingBulletResults();this.hasSelectAllBullet=!(({rawResults:t})=>{const e=(({rawResults:t})=>{const e=t=>t.filter((t=>t.isSelected)).length;return t.map((t=>t.length>0?t.map(e):[0]))})({rawResults:t});this.totalLineCombination=e.reduce(((t,e)=>t+this.calculateCombinationInLine(e)),0);const{combinations:n=1,maxCombinations:r=1}=pt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}).betType||{};return e.some((t=>{const e=this.calculateCombinationInLine(t);return e<n||e>r}))})({rawResults:t})})()}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&o(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&c(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){(()=>{let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isLoading=!0,(t=>fetch(t,{method:"GET",headers:{"x-scheme":"application/json",Accept:"application/json"}}).then((t=>t.json())))(t.href).then((t=>{var e,n,r,i,o,a,s;this.rawData=t,this.bettingTypeOptions=yt((null===(n=null===(e=null==t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===n?void 0:n.bettingTypes)||[]),this.playingModeOptions=yt((null===(i=null===(r=null==t?void 0:t.rules)||void 0===r?void 0:r.poolGame)||void 0===i?void 0:i.playModes)||[]);const{bettingType:u,playMode:l}=(({playTypeConfig:t=[],betTypeConfig:e=[],enabledBettingTypeOptions:n=[],enabledPlayingModeOptions:r=[]})=>{const i=e.filter((t=>t.enabled));for(const e of i){const{bettingType:i,playMode:o}=null==t?void 0:t.find((t=>t.betTypeId===e.id));if(n.map((t=>t.code)).includes(i)&&r.map((t=>t.code)).includes(o))return{bettingType:i,playMode:o}}return{}})({playTypeConfig:null===(a=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===a?void 0:a.playTypes,betTypeConfig:null===(s=null==t?void 0:t.rules)||void 0===s?void 0:s.betTypes,enabledBettingTypeOptions:this.bettingTypeOptions,enabledPlayingModeOptions:this.playingModeOptions});this.handleBettingTypeChange(u),this.selectedPlayingMode=l})).catch((t=>{console.error("Error!",t)})).finally((()=>{this.isLoading=!1}))})()}async handleSubmit(){const t=await this.getLotteryTippingBulletResults(),{betTypeId:e,betType:n}=pt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),r=new URL(`${this.endpointTicket}/tickets`),i=(()=>{var r,i;const o={playerId:this.playerId,tickets:[]},a=(t=>{const e=t=>t.map((t=>t.isSelected?1:0)),n=t.map((t=>t.map(e))),r=[];for(let t=0;t<n.length;t++){const e=n[t];for(let n=0;n<e.length;n++){const i=e[n];for(let e=0;e<i.length;e++)r[t]||(r[t]=[]),i[e]&&r[t].push(e,n)}}return r})(t),s=this.currentStake||{};return o.tickets.push({startingDrawId:null===(i=null===(r=this.rawData)||void 0===r?void 0:r.currentDraw)||void 0===i?void 0:i.id,amount:this.calculateTotalAmount().toString(),gameId:this.gameId,gameName:this.rawData.name,currency:s.currency,selection:a.map((t=>({betType:e,stake:+s.value,selections:t,quickPick:!1,betName:n.name}))),multiplier:!1,drawCount:1,quickPick:!1}),o})();this.submitLoading=!0,(({body:t,sessionId:e,url:n})=>{const r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":"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)}))},body:JSON.stringify(t)};return fetch(n,r).then((t=>{if(401===t.status)throw new Error(gt);if(t.status>300)throw new Error(t.statusText);return t.json()}))})({body:i,sessionId:this.sessionId,url:r.href}).then((()=>{ft({message:d("ticketSubmitted",this.language)}),this.clearBulletConfig()})).catch((t=>{if(t.message===gt)return this.logoutEventHandler.emit(),void ft({message:gt,theme:"error"});ft({message:d("ticketFailed",this.language),theme:"error"})})).finally((()=>{this.submitLoading=!1}))}get lineCountRender(){const t=vt(this.totalLineCombination);let e=d("lines",this.language);return[0,1].includes(+t)&&(e=d("line",this.language)),t+" "+e}renderBettingControls(){const t=()=>n("div",{class:"skeleton-content"},n("div",{class:"skeleton-item skeleton-animated"}));return n("div",{class:"LotteryTippingTicketController__top"},n("div",{class:"LotteryTippingTicketController__row"},n("div",{class:"LotteryTippingTicketController__section"},n("span",{class:"LotteryTippingTicketController__label"},d("bettingType",this.language)),this.bettingTypeOptions.length?(()=>n("div",{class:"LotteryTippingTicketController__segmented-control"},this.bettingTypeOptions.map((t=>n("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedBettingType===t.code},onClick:this.handleBettingTypeChange.bind(this,t.code)},t.name)))))():t()),n("div",{class:"LotteryTippingTicketController__section"},n("span",{class:"LotteryTippingTicketController__label"},d("playingMode",this.language)),this.playingModeOptions.length?(()=>n("div",{class:"LotteryTippingTicketController__segmented-control"},this.playingModeOptions.map((t=>n("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedPlayingMode===t.code},onClick:this.handlePlayingModeChange.bind(this,t.code)},t.name)))))():t())))}renderOrderSummary(){return n("div",{class:"LotteryTippingTicketController__main--right order-summary"},n("h3",{class:"order-summary__title"},d("orderSummaryTitle",this.language)),n("div",{class:"order-summary__ticket-info"},n("div",{class:"order-summary__ticket"},d("orderSummaryTickets",this.language),":"),n("div",{class:"order-summary__details"},n("span",{class:"order-summary__line-count"},this.lineCountRender),n("div",null,this.currentStake&&n("span",{class:"order-summary__multiplier"},"x"),n("span",{class:"order-summary__stake"},this.currentStakeFormatted)),this.isBothBettingType&&n("div",null,n("span",{class:"order-summary__multiplier"},"x"),n("span",{class:"order-summary__stake"},"2")))),n("hr",{class:"order-summary__divider"}),n("div",{class:"order-summary__ticket-info"},n("div",{class:"order-summary__ticket"},d("orderSummaryTotal",this.language),":"),n("span",{class:"order-summary__details"},this.totalAmountFormatted)),n("div",{class:"order-summary__button-wrapper"},n("button",{class:{"order-summary__button":!0,"order-summary__button--disabled":!this.hasSelectAllBullet,"order-summary__button--loading":this.submitLoading},onClick:this.handleSubmit.bind(this),disabled:!this.hasSelectAllBullet||this.submitLoading},n("span",{class:"order-summary__button--text"},d("orderSummarySubmit",this.language)),this.submitLoading&&n("span",{class:"loading-icon scale",innerHTML:kt}))))}render(){var t,e,r,i,o,s,u;return n("div",{key:"6b7aee4aacf53744bed1b3f3064b3a8357806ce5",class:"lottery-tipping-ticket-controller__container",ref:t=>this.stylingContainer=t},n("lottery-tipping-ticket-banner",{key:"59907469fbee5440485938631bf311476d2649df","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,stopTime:null===(e=null===(t=this.rawData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.wagerCloseTime,period:null===(i=null===(r=this.rawData)||void 0===r?void 0:r.currentDraw)||void 0===i?void 0:i.date,language:this.language,"translation-url":this.translationUrl,"logo-url":this.logoUrl}),this.renderBettingControls(),n("div",{key:"891700a5bb16ce5ddb4be8a0c48c824a97710edd",class:"flex flex-wrap LotteryTippingTicketController__main"},n("div",{key:"bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9",class:"LotteryTippingTicketController__main--left"},n("lottery-tipping-ticket-bet",{key:"8fbfdf48b51ac3aa8faf51da106131d25ed99992",ref:t=>this.childRef=t,endpoint:this.endpoint,"session-id":this.sessionId,"game-id":null===(o=this.rawData)||void 0===o?void 0:o.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===a.SingleBet?"single":"multi","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl})),this.renderOrderSummary()),this.dialogConfig.visible&&n("vaadin-confirm-dialog",{key:"a93fcec56f649438c6f0d3668d322885dd4da7dc",rejectButtonVisible:!0,rejectText:d("cancel",this.language),confirmText:d("confirm",this.language),opened:null===(s=this.dialogConfig)||void 0===s?void 0:s.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(u=this.dialogConfig)||void 0===u?void 0:u.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};_t.style=".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}";export{_t as L,i as a,o as b,c,rt as d,Tt as e,ht as f,it as p,f as r,r as s,v as t}
1
+ import{r as t,c as e,h as n}from"./index-e3ec645c.js";function r(t,e){if(t){const n=document.createElement("style");n.innerHTML=e,t.appendChild(n)}}function i(t,e){const n=new URL(e);fetch(n.href).then((t=>t.text())).then((e=>{const n=document.createElement("style");n.innerHTML=e,t&&t.appendChild(n)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function o(t,e){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{n.innerHTML=e,t&&t.appendChild(n)}))}}var a,s;!function(t){t.SingleBet="SingleBet",t.SystemBet="SystemBet"}(a||(a={})),function(t){t.FullTime="FullTime",t.HalfTime="HalfTime",t.Both="Both"}(s||(s={}));const u=["ro","en","fr","ar","hr"],l={en:{selectionCleared:"Your selection will be cleared.",ticketSubmitted:"Ticket submitted successfully.",ticketFailed:"Failed to purchase the ticket. Please try again.",lines:"Lines",line:"Line",bettingType:"Betting Type",playingMode:"Playing Mode",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Tickets",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",cancel:"Cancel",confirm:"Confirm"},ro:{selectionCleared:"Selecția dvs. va fi ștearsă.",ticketSubmitted:"Bilet trimis cu succes.",ticketFailed:"Nu s-a putut achiziționa biletul. Vă rugăm să încercați din nou.",lines:"Linii",line:"Linie",bettingType:"Tip de pariu",playingMode:"Mod de joc",orderSummaryTitle:"Sumar comandă",orderSummaryTickets:"Bilete",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",cancel:"Anulează",confirm:"Confirmă"},fr:{selectionCleared:"Votre sélection sera effacée.",ticketSubmitted:"Billet soumis avec succès.",ticketFailed:"Échec de l'achat du billet. Veuillez réessayer.",lines:"Lignes",line:"Ligne",bettingType:"Type de pari",playingMode:"Mode de jeu",orderSummaryTitle:"Résumé de la commande",orderSummaryTickets:"Billets",orderSummaryTotal:"Total",orderSummarySubmit:"Soumettre",cancel:"Annuler",confirm:"Confirmer"},ar:{selectionCleared:"سيتم مسح اختيارك.",ticketSubmitted:"تم إرسال التذكرة بنجاح.",ticketFailed:"فشل شراء التذكرة. يرجى المحاولة مرة أخرى.",lines:"خطوط",line:"خط",bettingType:"نوع الرهان",playingMode:"وضع اللعب",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"التذاكر",orderSummaryTotal:"المجموع",orderSummarySubmit:"إرسال",cancel:"إلغاء",confirm:"تأكيد"},hr:{selectionCleared:"Vaš odabir bit će obrisan.",ticketSubmitted:"Listić je uspješno predan.",ticketFailed:"Kupnja listića nije uspjela. Molimo pokušajte ponovo.",lines:"Linije",line:"Linija",bettingType:"Vrsta oklade",playingMode:"Način igranja",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listići",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Pošalji",cancel:"Odustani",confirm:"Potvrdi"}},d=(t,e)=>{const n=e;return l[void 0!==n&&u.includes(n)?n:"en"][t]},c=async t=>{if(t)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();e=r,Object.keys(e).forEach((t=>{for(let n in e[t])l[t][n]=e[t][n]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function h(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function v(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===m(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var g={};function y(){return g}var p=36e5;function w(t){f(1,arguments);var e=v(t),n=e.getUTCDay(),r=(n<1?7:0)+n-1;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function b(t){f(1,arguments);var e=v(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=w(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=w(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function T(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=y(),c=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(u=d.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=v(t),g=m.getUTCDay(),p=(g<c?7:0)+g-c;return m.setUTCDate(m.getUTCDate()-p),m.setUTCHours(0,0,0,0),m}function x(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=v(t),c=d.getUTCFullYear(),m=y(),g=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:m.firstWeekContainsDate)&&void 0!==r?r:null===(u=m.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(c+1,0,g),p.setUTCHours(0,0,0,0);var w=T(p,e),b=new Date(0);b.setUTCFullYear(c,0,g),b.setUTCHours(0,0,0,0);var x=T(b,e);return d.getTime()>=w.getTime()?c+1:d.getTime()>=x.getTime()?c:c-1}function k(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}const _=function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return k("yy"===e?r%100:r,e.length)},S=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):k(n+1,2)},M=function(t,e){return k(t.getUTCDate(),e.length)},C=function(t,e){return k(t.getUTCHours()%12||12,e.length)},D=function(t,e){return k(t.getUTCHours(),e.length)},L=function(t,e){return k(t.getUTCMinutes(),e.length)},N=function(t,e){return k(t.getUTCSeconds(),e.length)},P=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return k(Math.floor(r*Math.pow(10,n-3)),e.length)};var E={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _(t,e)},Y:function(t,e,n,r){var i=x(t,r),o=i>0?i:1-i;return"YY"===e?k(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):k(o,e.length)},R:function(t,e){return k(b(t),e.length)},u:function(t,e){return k(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return k(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return k(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return S(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return k(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=function(t,e){f(1,arguments);var n=v(t),r=T(n,e).getTime()-function(t,e){var n,r,i,o,a,s,u,l;f(1,arguments);var d=y(),c=h(null!==(n=null!==(r=null!==(i=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(u=d.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1),m=x(t,e),v=new Date(0);return v.setUTCFullYear(m,0,c),v.setUTCHours(0,0,0,0),T(v,e)}(n,e).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):k(i,e.length)},I:function(t,e,n){var r=function(t){f(1,arguments);var e=v(t),n=w(e).getTime()-function(t){f(1,arguments);var e=b(t),n=new Date(0);return n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),w(n)}(e).getTime();return Math.round(n/6048e5)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):k(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):M(t,e)},D:function(t,e,n){var r=function(t){f(1,arguments);var e=v(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime();return Math.floor((n-r)/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):k(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return k(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return k(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return k(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return C(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):D(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):L(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):N(t,e)},S:function(t,e){return P(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return B(i);case"XXXX":case"XX":return O(i);default:return O(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return B(i);case"xxxx":case"xx":return O(i);default:return O(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+j(i,":");default:return"GMT"+O(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+j(i,":");default:return"GMT"+O(i,":")}},t:function(t,e,n,r){return k(Math.floor((r._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,n,r){return k((r._originalDate||t).getTime(),e.length)}};function j(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+k(o,2)}function B(t,e){return t%60==0?(t>0?"-":"+")+k(Math.abs(t)/60,2):O(t,e)}function O(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+k(Math.floor(i/60),2)+n+k(i%60,2)}const W=E;var R=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Y=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},z={p:Y,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return R(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",R(i,e)).replace("{{time}}",Y(o,e))}};const q=z;var A=["D","DD"],I=["YY","YYYY"];function G(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var F={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var Q,X={date:$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},H={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function U(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function J(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=e.match(r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth]);if(!i)return null;var o,a=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(a))return e}(s):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(a))return e}(s);return o=t.valueCallback?t.valueCallback(u):u,{value:o=n.valueCallback?n.valueCallback(o):o,rest:e.slice(a.length)}}}const V={code:"en-US",formatDistance:function(t,e,n){var r,i=F[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:X,formatRelative:function(t){return H[t]},localize:{ordinalNumber:function(t){var e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:U({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:U({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:U({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:U({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:U({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Q={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(Q.matchPattern);if(!n)return null;var r=n[0],i=t.match(Q.parsePattern);if(!i)return null;var o=Q.valueCallback?Q.valueCallback(i[0]):i[0];return{value:o=e.valueCallback?e.valueCallback(o):o,rest:t.slice(r.length)}}),era:J({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:J({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:J({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tt=/^'([^]*?)'?$/,et=/''/g,nt=/[a-zA-Z]/;function rt(t,e,n){var r,i,o,a,s,u,l,d,c,g,p,w,b,T,x,k,_,S;f(2,arguments);var M=String(e),C=y(),D=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:C.locale)&&void 0!==r?r:V,L=h(null!==(o=null!==(a=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(d=l.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==s?s:C.firstWeekContainsDate)&&void 0!==a?a:null===(c=C.locale)||void 0===c||null===(g=c.options)||void 0===g?void 0:g.firstWeekContainsDate)&&void 0!==o?o:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=h(null!==(p=null!==(w=null!==(b=null!==(T=null==n?void 0:n.weekStartsOn)&&void 0!==T?T:null==n||null===(x=n.locale)||void 0===x||null===(k=x.options)||void 0===k?void 0:k.weekStartsOn)&&void 0!==b?b:C.weekStartsOn)&&void 0!==w?w:null===(_=C.locale)||void 0===_||null===(S=_.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==p?p:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!D.localize)throw new RangeError("locale must contain localize property");if(!D.formatLong)throw new RangeError("locale must contain formatLong property");var P=v(t);if(!function(t){if(f(1,arguments),!function(t){return f(1,arguments),t instanceof Date||"object"===m(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=v(t);return!isNaN(Number(e))}(P))throw new RangeError("Invalid time value");var E=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(P),j=function(t,e){return f(2,arguments),function(t,e){f(2,arguments);var n=v(t).getTime(),r=h(e);return new Date(n+r)}(t,-h(e))}(P,E),B={firstWeekContainsDate:L,weekStartsOn:N,locale:D,_originalDate:P};return M.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,q[e])(t,D.formatLong):t})).join("").match(K).map((function(r){if("''"===r)return"'";var i,o,a=r[0];if("'"===a)return(o=(i=r).match(tt))?o[1].replace(et,"'"):i;var s=W[a];if(s)return null!=n&&n.useAdditionalWeekYearTokens||-1===I.indexOf(r)||G(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!(-1!==A.indexOf(r))||G(r,e,String(t)),s(j,r,D.localize,B);if(a.match(nt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("")}function it(t,e){var n;f(1,arguments);var r=h(null!==(n=null==e?void 0:e.additionalDigits)&&void 0!==n?n:2);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var i,o=function(t){var e,n={},r=t.split(ot.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?e=r[0]:(n.date=r[0],e=r[1],ot.timeZoneDelimiter.test(n.date)&&(n.date=t.split(ot.timeZoneDelimiter)[0],e=t.substr(n.date.length,t.length))),e){var i=ot.timezone.exec(e);i?(n.time=e.replace(i[1],""),n.timezone=i[1]):n.time=e}return n}(t);if(o.date){var a=function(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:t.slice((r[1]||r[2]).length)}}(o.date,r);i=function(t,e){if(null===e)return new Date(NaN);var n=t.match(at);if(!n)return new Date(NaN);var r=!!n[4],i=lt(n[1]),o=lt(n[2])-1,a=lt(n[3]),s=lt(n[4]),u=lt(n[5])-1;if(r)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,u)?function(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=7*(e-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}(e,s,u):new Date(NaN);var l=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(ct[e]||(mt(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(mt(t)?366:365)}(e,i)?(l.setUTCFullYear(e,o,Math.max(i,a)),l):new Date(NaN)}(a.restDateString,a.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var s,u=i.getTime(),l=0;if(o.time&&(l=function(t){var e=t.match(st);if(!e)return NaN;var n=dt(e[1]),r=dt(e[2]),i=dt(e[3]);return function(t,e,n){return 24===t?0===e&&0===n:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,r,i)?n*p+6e4*r+1e3*i:NaN}(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(t){if("Z"===t)return 0;var e=t.match(ut);if(!e)return 0;var n="+"===e[1]?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,i)?n*(r*p+6e4*i):NaN}(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var ot={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},at=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,st=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ut=/^([+-])(\d{2})(?::?(\d{2}))?$/;function lt(t){return t?parseInt(t):1}function dt(t){return t&&parseFloat(t.replace(",","."))||0}var ct=[31,null,31,30,31,30,31,31,30,31,30,31];function mt(t){return t%400==0||t%4==0&&t%100!=0}const ht=({date:t,type:e="date",format:n})=>{try{const r=it(t);if(isNaN(r.getTime()))throw new Error(`Invalid date: ${t}`);if(n)return rt(r,n);let i="dd/MM/yyyy";return"time"===e?i="dd/MM/yyyy HH:mm:ss":"week"===e&&(i="ccc dd/MM/yyyy HH:mm:ss"),rt(r,i)}catch(t){return console.error("Error formatting date:",t.message),""}},ft=()=>"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)})),vt=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},gt=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(".")},yt="TICKET_INVALID_TOKEN",pt=(t=[])=>t.filter((t=>t.enabled)),wt=({rawData:t,selectedBettingType:e,selectedPlayingMode:n})=>{var r,i,o,a,s,u;const l=null===(a=null===(o=null===(i=null===(r=null==t?void 0:t.rules)||void 0===r?void 0:r.poolGame)||void 0===i?void 0:i.playTypes)||void 0===o?void 0:o.find((t=>t.bettingType===e&&t.playMode===n)))||void 0===a?void 0:a.betTypeId,d=null===(u=null===(s=null==t?void 0:t.rules)||void 0===s?void 0:s.betTypes)||void 0===u?void 0:u.find((t=>t.id===l));return{betTypeId:l,betType:d}};var bt=function(){return bt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},bt.apply(this,arguments)},Tt={primaryColor:"#333",secondaryColor:"#E6E6E6"};function xt(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var n=e.placeholders||Tt;return kt(t.icon(n.primaryColor,n.secondaryColor),e)}return kt(t.icon,e)}function kt(t,e){var n="svg"===t.tag?bt(bt({},t.attrs),e.extraSVGAttrs||{}):t.attrs,r=Object.keys(n).reduce((function(t,e){var r=n[e],i="".concat(e,'="').concat(r,'"');return t.push(i),t}),[]),i=r.length?" "+r.join(" "):"",o=(t.children||[]).map((function(t){return kt(t,e)})).join("");return o&&o.length?"<".concat(t.tag).concat(i,">").concat(o,"</").concat(t.tag,">"):"<".concat(t.tag).concat(i," />")}const _t=xt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},{extraSVGAttrs:{height:"20px",width:"20px",fill:"currentColor"}}),St=class{constructor(n){t(this,n),this.logoutEventHandler=e(this,"logout",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.endpoint="",this.endpointTicket=void 0,this.sessionId=void 0,this.gameId=void 0,this.playerId="",this.drawId=void 0,this.isLoading=!0,this.bettingTypeOptions=[],this.playingModeOptions=[],this.selectedBettingType=void 0,this.selectedPlayingMode=void 0,this.hasSelectBullet=void 0,this.hasSelectAllBullet=void 0,this.totalLineCombination=0,this.submitLoading=void 0,this.rawData={},this.dialogConfig={visible:!1}}async getLotteryTippingBulletResults(){return await this.childRef.getData()}get lineNumberRange(){const{betType:t}=wt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),e=(null==t?void 0:t.boardsAllowed)||[0],[n,r]=[Math.min(...e),Math.max(...e)];return{minLineNumber:n,maxLineNumber:r,defaultBoards:(null==t?void 0:t.defaultBoards)||n}}get playTypeConfig(){var t,e,n;return null===(n=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===n?void 0:n.playTypes}get betTypeConfig(){var t,e;return null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.betTypes}get isBothBettingType(){return this.selectedBettingType===s.Both}get currentStake(){var t,e,n;return null===(n=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.stakes)||void 0===n?void 0:n[0]}handleBettingTypeChange(t){var e,n,r,i;if(t===this.selectedBettingType)return;this.selectedBettingType=t;const o=(({bettingType:t,playTypeConfig:e,betTypeConfig:n,enabledPlayingModeOptions:r})=>{const i=n.filter((t=>t.enabled)).map((t=>t.id)),o=e.filter((t=>i.includes(t.betTypeId))).filter((e=>e.bettingType===t)).map((t=>t.playMode));return r.filter((t=>o.includes(t.code)))})({bettingType:this.selectedBettingType,playTypeConfig:this.playTypeConfig,betTypeConfig:this.betTypeConfig,enabledPlayingModeOptions:pt((null===(r=null===(n=null===(e=this.rawData)||void 0===e?void 0:e.rules)||void 0===n?void 0:n.poolGame)||void 0===r?void 0:r.playModes)||[])});this.playingModeOptions=o,o.length?o.map((t=>t.code)).includes(this.selectedPlayingMode)||(this.hasSelectBullet=!1,this.handlePlayingModeChange(null===(i=o[0])||void 0===i?void 0:i.code)):this.selectedPlayingMode=void 0,this.clearBulletConfig()}async clearBulletConfig(){return await this.childRef.resetBulletConfig(this.lineNumberRange)}handlePlayingModeChange(t){if(t===this.selectedPlayingMode)return;const e=e=>{this.selectedPlayingMode=t,this.clearBulletConfig().then((()=>{null==e||e()}))};if(this.hasSelectBullet){const t=()=>{this.dialogConfig={visible:!1}},n=()=>{e(t)};this.dialogConfig={visible:!0,content:d("selectionCleared",this.language),onConfirm:n,onCancel:t}}else e()}lotteryTippingBulletGroupSelectionHandler(t){var e;const n=null===(e=t.detail)||void 0===e?void 0:e.hasSelectBullet;void 0!==n&&(this.hasSelectBullet=n),this.bulletBetSelectChecker()}calculateCombinationInLine(t){return t.reduce(((t,e)=>t*e),1)}calculateTotalAmount(){const t=this.currentStake;return t?t.value*this.totalLineCombination:0}get totalAmountFormatted(){var t;const e=this.calculateTotalAmount();return gt(e)+" "+(null===(t=this.currentStake)||void 0===t?void 0:t.currency)||""}get currentStakeFormatted(){const{value:t="",currency:e=""}=this.currentStake||{};return`${t} ${e}`}bulletBetSelectChecker(){(async()=>{const t=await this.getLotteryTippingBulletResults();this.hasSelectAllBullet=!(({rawResults:t})=>{const e=(({rawResults:t})=>{const e=t=>t.filter((t=>t.isSelected)).length;return t.map((t=>t.length>0?t.map(e):[0]))})({rawResults:t});this.totalLineCombination=e.reduce(((t,e)=>t+this.calculateCombinationInLine(e)),0);const{combinations:n=1,maxCombinations:r=1}=wt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}).betType||{};return e.some((t=>{const e=this.calculateCombinationInLine(t);return e<n||e>r}))})({rawResults:t})})()}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&i(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&o(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&c(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&i(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){(()=>{let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isLoading=!0,function(t,e="GET",n=null,r={}){return new Promise(((i,o)=>{const a=ft(),s=Object.assign({"Content-Type":"application/json"},r);"GET"!==e&&"HEAD"!==e&&(s["X-Idempotency-Key"]=a);const u={method:e,headers:s};n&&"GET"!==e&&"HEAD"!==e&&(u.body=JSON.stringify(n)),fetch(t,u).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>i(t))).catch((t=>o(t)))}))}(t.href,"GET").then((t=>{var e,n,r,i,o,a,s;this.rawData=t,this.bettingTypeOptions=pt((null===(n=null===(e=null==t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===n?void 0:n.bettingTypes)||[]),this.playingModeOptions=pt((null===(i=null===(r=null==t?void 0:t.rules)||void 0===r?void 0:r.poolGame)||void 0===i?void 0:i.playModes)||[]);const{bettingType:u,playMode:l}=(({playTypeConfig:t=[],betTypeConfig:e=[],enabledBettingTypeOptions:n=[],enabledPlayingModeOptions:r=[]})=>{const i=e.filter((t=>t.enabled));for(const e of i){const{bettingType:i,playMode:o}=null==t?void 0:t.find((t=>t.betTypeId===e.id));if(n.map((t=>t.code)).includes(i)&&r.map((t=>t.code)).includes(o))return{bettingType:i,playMode:o}}return{}})({playTypeConfig:null===(a=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===a?void 0:a.playTypes,betTypeConfig:null===(s=null==t?void 0:t.rules)||void 0===s?void 0:s.betTypes,enabledBettingTypeOptions:this.bettingTypeOptions,enabledPlayingModeOptions:this.playingModeOptions});this.handleBettingTypeChange(u),this.selectedPlayingMode=l})).catch((t=>{console.error("Error!",t)})).finally((()=>{this.isLoading=!1}))})()}async handleSubmit(){const t=await this.getLotteryTippingBulletResults(),{betTypeId:e,betType:n}=wt({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),r=new URL(`${this.endpointTicket}/tickets`),i=(()=>{var r,i;const o={playerId:this.playerId,tickets:[]},a=(t=>{const e=t=>t.map((t=>t.isSelected?1:0)),n=t.map((t=>t.map(e))),r=[];for(let t=0;t<n.length;t++){const e=n[t];for(let n=0;n<e.length;n++){const i=e[n];for(let e=0;e<i.length;e++)r[t]||(r[t]=[]),i[e]&&r[t].push(e,n)}}return r})(t),s=this.currentStake||{};return o.tickets.push({startingDrawId:null===(i=null===(r=this.rawData)||void 0===r?void 0:r.currentDraw)||void 0===i?void 0:i.id,amount:this.calculateTotalAmount().toString(),gameId:this.gameId,gameName:this.rawData.name,currency:s.currency,selection:a.map((t=>({betType:e,stake:+s.value,selections:t,quickPick:!1,betName:n.name}))),multiplier:!1,drawCount:1,quickPick:!1}),o})();this.submitLoading=!0,(({body:t,sessionId:e,url:n})=>{const r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":ft()},body:JSON.stringify(t)};return fetch(n,r).then((t=>{if(401===t.status)throw new Error(yt);if(t.status>300)throw new Error(t.statusText);return t.json()}))})({body:i,sessionId:this.sessionId,url:r.href}).then((()=>{vt({message:d("ticketSubmitted",this.language)}),this.clearBulletConfig()})).catch((t=>{if(t.message===yt)return this.logoutEventHandler.emit(),void vt({message:yt,theme:"error"});vt({message:d("ticketFailed",this.language),theme:"error"})})).finally((()=>{this.submitLoading=!1}))}get lineCountRender(){const t=gt(this.totalLineCombination);let e=d("lines",this.language);return[0,1].includes(+t)&&(e=d("line",this.language)),t+" "+e}renderBettingControls(){const t=()=>n("div",{class:"skeleton-content"},n("div",{class:"skeleton-item skeleton-animated"}));return n("div",{class:"LotteryTippingTicketController__top"},n("div",{class:"LotteryTippingTicketController__row"},n("div",{class:"LotteryTippingTicketController__section"},n("span",{class:"LotteryTippingTicketController__label"},d("bettingType",this.language)),this.bettingTypeOptions.length?(()=>n("div",{class:"LotteryTippingTicketController__segmented-control"},this.bettingTypeOptions.map((t=>n("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedBettingType===t.code},onClick:this.handleBettingTypeChange.bind(this,t.code)},t.name)))))():t()),n("div",{class:"LotteryTippingTicketController__section"},n("span",{class:"LotteryTippingTicketController__label"},d("playingMode",this.language)),this.playingModeOptions.length?(()=>n("div",{class:"LotteryTippingTicketController__segmented-control"},this.playingModeOptions.map((t=>n("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedPlayingMode===t.code},onClick:this.handlePlayingModeChange.bind(this,t.code)},t.name)))))():t())))}renderOrderSummary(){return n("div",{class:"LotteryTippingTicketController__main--right order-summary"},n("h3",{class:"order-summary__title"},d("orderSummaryTitle",this.language)),n("div",{class:"order-summary__ticket-info"},n("div",{class:"order-summary__ticket"},d("orderSummaryTickets",this.language),":"),n("div",{class:"order-summary__details"},n("span",{class:"order-summary__line-count"},this.lineCountRender),n("div",null,this.currentStake&&n("span",{class:"order-summary__multiplier"},"x"),n("span",{class:"order-summary__stake"},this.currentStakeFormatted)),this.isBothBettingType&&n("div",null,n("span",{class:"order-summary__multiplier"},"x"),n("span",{class:"order-summary__stake"},"2")))),n("hr",{class:"order-summary__divider"}),n("div",{class:"order-summary__ticket-info"},n("div",{class:"order-summary__ticket"},d("orderSummaryTotal",this.language),":"),n("span",{class:"order-summary__details"},this.totalAmountFormatted)),n("div",{class:"order-summary__button-wrapper"},n("button",{class:{"order-summary__button":!0,"order-summary__button--disabled":!this.hasSelectAllBullet,"order-summary__button--loading":this.submitLoading},onClick:this.handleSubmit.bind(this),disabled:!this.hasSelectAllBullet||this.submitLoading},n("span",{class:"order-summary__button--text"},d("orderSummarySubmit",this.language)),this.submitLoading&&n("span",{class:"loading-icon scale",innerHTML:_t}))))}render(){var t,e,r,i,o,s,u;return n("div",{key:"337388f1cf75297195a88c3728b865e74f613849",class:"lottery-tipping-ticket-controller__container",ref:t=>this.stylingContainer=t},n("lottery-tipping-ticket-banner",{key:"2cd069a119c2a29773d217d0ad40f985fe05fb14","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,stopTime:null===(e=null===(t=this.rawData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.wagerCloseTime,period:null===(i=null===(r=this.rawData)||void 0===r?void 0:r.currentDraw)||void 0===i?void 0:i.date,language:this.language,"translation-url":this.translationUrl,"logo-url":this.logoUrl}),this.renderBettingControls(),n("div",{key:"1ab326849e99b9558d1d6bc94985a4c48d74ab4a",class:"flex flex-wrap LotteryTippingTicketController__main"},n("div",{key:"abfb225ed18d7325555e2cdebd93348e82ae773e",class:"LotteryTippingTicketController__main--left"},n("lottery-tipping-ticket-bet",{key:"19237e4c08ae390801898dd38796a6622255cd94",ref:t=>this.childRef=t,endpoint:this.endpoint,"session-id":this.sessionId,"game-id":null===(o=this.rawData)||void 0===o?void 0:o.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===a.SingleBet?"single":"multi","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl})),this.renderOrderSummary()),this.dialogConfig.visible&&n("vaadin-confirm-dialog",{key:"fa596e199dfc64d23768c739981a4c494c93010c",rejectButtonVisible:!0,rejectText:d("cancel",this.language),confirmText:d("confirm",this.language),opened:null===(s=this.dialogConfig)||void 0===s?void 0:s.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(u=this.dialogConfig)||void 0===u?void 0:u.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};St.style=".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}";export{St as L,i as a,o as b,c,rt as d,xt as e,ht as f,it as p,f as r,r as s,v as t}
@@ -4,13 +4,13 @@ export declare const formatDate: ({ date, type, format }: {
4
4
  type?: 'time' | 'date' | 'week';
5
5
  format?: string;
6
6
  }) => string;
7
- export declare const fetcher: (url: string) => Promise<any>;
7
+ export declare const generateUUID: () => string;
8
+ export declare function fetchRequest(url: string, method?: string, body?: any, headers?: {}): Promise<any>;
8
9
  export declare const showNotification: ({ message, theme }: {
9
10
  message: string;
10
11
  theme?: 'success' | 'warning' | 'error' | 'info';
11
12
  }) => void;
12
13
  export declare const thousandSeparator: (value: number | string) => string;
13
- export declare const generateUUID: () => string;
14
14
  export declare const TICKET_INVALID_TOKEN = "TICKET_INVALID_TOKEN";
15
15
  export declare const formatResultsToWinningNumbers: (rawResults: any) => number[][];
16
16
  export declare const doSubmitTicket: ({ body, sessionId, url }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-tipping-ticket-controller",
3
- "version": "1.80.11",
3
+ "version": "1.80.13",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",