@everymatrix/lottery-tipping-page 1.80.12 → 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.
@@ -9959,7 +9959,7 @@ const generateUUID$1 = () => {
9959
9959
  return v.toString(16);
9960
9960
  });
9961
9961
  };
9962
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
9962
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
9963
9963
  return new Promise((resolve, reject) => {
9964
9964
  const uuid = generateUUID$1();
9965
9965
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -9980,36 +9980,14 @@ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
9980
9980
  fetch(url, options)
9981
9981
  .then((response) => {
9982
9982
  if (!response.ok) {
9983
- return response.json().then((errorData) => {
9984
- const error = {
9985
- status: response.status,
9986
- statusText: response.statusText,
9987
- code: errorData.code || 'UNKNOWN_ERROR',
9988
- message: errorData.message || 'An unknown error occurred',
9989
- data: errorData.data || null
9990
- };
9991
- reject(error);
9992
- }, () => reject({
9993
- status: response.status,
9994
- statusText: response.statusText,
9995
- code: 'PARSE_ERROR',
9996
- message: 'Failed to parse error response'
9997
- }));
9998
- }
9999
- else {
10000
- return response.json();
9983
+ throw new Error(`HTTP error! Status: ${response.status}`);
10001
9984
  }
9985
+ return response.json();
10002
9986
  })
10003
- .then((data) => resolve(data), (error) => reject(error));
9987
+ .then((data) => resolve(data))
9988
+ .catch((error) => reject(error));
10004
9989
  });
10005
9990
  }
10006
- const fetcher$2 = (url) => fetch(url, {
10007
- method: 'GET',
10008
- headers: {
10009
- 'x-scheme': 'application/json',
10010
- Accept: 'application/json'
10011
- }
10012
- }).then((r) => r.json());
10013
9991
  function isEmptyValueOfArray(arr) {
10014
9992
  if (arr.length === 0) {
10015
9993
  return true;
@@ -10530,13 +10508,37 @@ const formatDate$1 = ({ date, type = 'date', format: format$1 }) => {
10530
10508
  return '';
10531
10509
  }
10532
10510
  };
10533
- const fetcher$1 = (url) => fetch(url, {
10534
- method: 'GET',
10535
- headers: {
10536
- 'x-scheme': 'application/json',
10537
- Accept: 'application/json'
10538
- }
10539
- }).then((r) => r.json());
10511
+ const generateUUID = () => {
10512
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
10513
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
10514
+ return v.toString(16);
10515
+ });
10516
+ };
10517
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
10518
+ return new Promise((resolve, reject) => {
10519
+ const uuid = generateUUID();
10520
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
10521
+ if (method !== 'GET' && method !== 'HEAD') {
10522
+ headersOrigin['X-Idempotency-Key'] = uuid;
10523
+ }
10524
+ const options = {
10525
+ method,
10526
+ headers: headersOrigin
10527
+ };
10528
+ if (body && method !== 'GET' && method !== 'HEAD') {
10529
+ options.body = JSON.stringify(body);
10530
+ }
10531
+ fetch(url, options)
10532
+ .then((response) => {
10533
+ if (!response.ok) {
10534
+ throw new Error(`HTTP error! Status: ${response.status}`);
10535
+ }
10536
+ return response.json();
10537
+ })
10538
+ .then((data) => resolve(data))
10539
+ .catch((error) => reject(error));
10540
+ });
10541
+ }
10540
10542
  const showNotification$1 = ({ message, theme = 'success' }) => {
10541
10543
  window.postMessage({
10542
10544
  type: 'ShowNotificationToast',
@@ -10556,12 +10558,6 @@ const thousandSeparator = (value) => {
10556
10558
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
10557
10559
  return parts.join('.');
10558
10560
  };
10559
- const generateUUID = () => {
10560
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
10561
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
10562
- return v.toString(16);
10563
- });
10564
- };
10565
10561
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
10566
10562
  // format results to winning numbers
10567
10563
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -11419,7 +11415,7 @@ const LotteryTippingTicketController = class {
11419
11415
  const fetchData = () => {
11420
11416
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
11421
11417
  this.isLoading = true;
11422
- fetcher$1(url.href)
11418
+ fetchRequest(url.href, 'GET')
11423
11419
  .then((res) => {
11424
11420
  var _a, _b, _c, _d, _e, _f, _g;
11425
11421
  this.rawData = res;
@@ -11526,7 +11522,7 @@ const LotteryTippingTicketController = class {
11526
11522
  }
11527
11523
  render() {
11528
11524
  var _a, _b, _c, _d, _e, _f, _g;
11529
- 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$2('cancel', this.language), confirmText: translate$2('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))));
11525
+ 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$2('cancel', this.language), confirmText: translate$2('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))));
11530
11526
  }
11531
11527
  static get assetsDirs() { return ["../static"]; }
11532
11528
  static get watchers() { return {
@@ -11654,7 +11650,7 @@ const LotteryTippingTicketHistory = class {
11654
11650
  try {
11655
11651
  this.isLoading = true;
11656
11652
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
11657
- const res = await fetcher$2(url.href);
11653
+ const res = await fetchRequest$1(url.href, 'GET');
11658
11654
  this.rawData = res;
11659
11655
  }
11660
11656
  catch (e) {
@@ -11695,7 +11691,7 @@ const LotteryTippingTicketHistory = class {
11695
11691
  async fetchTicketList() {
11696
11692
  this.isLoading = true;
11697
11693
  try {
11698
- const { items, total } = await fetchRequest(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
11694
+ const { items, total } = await fetchRequest$1(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
11699
11695
  Authorization: `Bearer ${this.sessionId}`
11700
11696
  });
11701
11697
  this.ticketHistory = items;
@@ -11717,7 +11713,7 @@ const LotteryTippingTicketHistory = class {
11717
11713
  }
11718
11714
  async fetchDrwaResult(gameId, drawId) {
11719
11715
  try {
11720
- const res = await fetchRequest(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
11716
+ const res = await fetchRequest$1(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
11721
11717
  return res;
11722
11718
  }
11723
11719
  catch (e) {
@@ -11876,15 +11872,15 @@ const LotteryTippingTicketHistory = class {
11876
11872
  return name !== null && name !== void 0 ? name : bettingType;
11877
11873
  }
11878
11874
  render() {
11879
- return (index.h("div", { key: '9dbed4dca8e568a334c63748d1768ace33922270', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '4149c4c6f067be28f1334a8642790d9886d219ef', class: "ticket-history-title" }, translate$3('ticketsHistory', this.language)), index.h("div", { key: '185ac4ad602e6e8bb0ec025a5cc2c4a9b8418444', class: "filter-wrap" }, index.h("div", { key: 'd136c367780b696403f075b261f2009cc94edc5d', class: "filter-status" }, this.statusOptions.map((status) => (index.h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), index.h("div", { key: 'e6a30ef0f8c957813a7b13238353709cfb9e2dd9', class: "filter-operation" }, index.h("lottery-tipping-filter", { key: '4e1e0ba0eeafd7e64344c2b8e4e7d0c0f097127b', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (index.h("div", { key: 'f572e1bd9cbf97948b9a9bda34f34c1407a8007e', class: "loading-wrap" }, index.h("section", { key: '9198457f400b175e4c9721449e49a987090860d9', class: "dots-container" }, index.h("div", { key: '0b1196e3ad2b05ef91965b2a52728e5386578e4b', class: "dot" }), index.h("div", { key: '19a5b0bc39fd931455a7972d66b640ca36685ea9', class: "dot" }), index.h("div", { key: '8bf3a43540d38c98d27cb7bf61d7595123a4739c', class: "dot" }), index.h("div", { key: '5ed33ee21018c3b2aae97a6b1345fdec2072fefe', class: "dot" }), index.h("div", { key: '2d4404c8e0d39dc82bb25554c242d27e091a9932', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (index.h("div", { key: '4b731612e57d8bde341da7d639dec6f245c7156d', class: "empty-wrap" }, translate$3('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (index.h("div", { key: 'c9a17cc74f32ae9277d069a8633f38a8478e642c', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (index.h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, index.h("div", { class: "panel-content", slot: "content" }, index.h("div", { class: "ticket-info" }, index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketId', this.language)), index.h("div", { class: "ticket-info-val" }, item.id, " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketType', this.language)), index.h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketAmount', this.language)), index.h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('lineDetail', this.language)), index.h("div", { class: "ticket-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$3('seeDetails', this.language)))), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('numberOfDraw', this.language)), index.h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
11880
- item.drawResults.map((drawResultItem) => (index.h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (index.h("div", { class: "draw-info" }, index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('ticketResult', this.language)), index.h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('drawId', this.language)), index.h("div", { class: "draw-info-val" }, drawResultItem.drawId)), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('drawDate', this.language)), index.h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('result', this.language)), index.h("div", { class: "draw-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$3('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('prize', this.language)), index.h("div", { class: "draw-info-val1" }, index.h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (index.h("span", null, index.h("div", null, index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), index.h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (index.h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (index.h("div", { class: "skeleton-line" })))))))))))))), index.h("lottery-tipping-dialog", { key: '4ef7d281084bc6441e6a3e666ac52a7df3dfd28c', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11875
+ return (index.h("div", { key: '0a8574ec1ba181a07043ec0451dfca73f8aaaf9d', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'f6f0f989a7b4e598e2d9c3d18c83d4f8b4595d84', class: "ticket-history-title" }, translate$3('ticketsHistory', this.language)), index.h("div", { key: 'e80a9d6e39d899fe6a210837853aacfea21a6cb3', class: "filter-wrap" }, index.h("div", { key: 'edeaca1e9062a0b9ef264151113bc6130f358017', class: "filter-status" }, this.statusOptions.map((status) => (index.h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), index.h("div", { key: 'fdae8b8a796d62827530955449baf85152b4bd49', class: "filter-operation" }, index.h("lottery-tipping-filter", { key: '004a977ff4460be8e1fbffd22fb6a742401b6597', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (index.h("div", { key: '4142baea434e611b871f7b8712a8ed03961bf929', class: "loading-wrap" }, index.h("section", { key: 'd412ab2648dc168e76d13957b9d654522d0211e4', class: "dots-container" }, index.h("div", { key: '81cca835dff7b6708354d79ecdb804fd768dfdf5', class: "dot" }), index.h("div", { key: '4fd405a231c5560b014bc9dc34e8847daf197ab1', class: "dot" }), index.h("div", { key: 'b89f42119dc855255ffb27b7d12d525dca40ab20', class: "dot" }), index.h("div", { key: 'c9ce133fe12b41639719558922ab0651ed82f605', class: "dot" }), index.h("div", { key: '8a18cbe9892de938f731045c0d8a01a6f58ab19d', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (index.h("div", { key: 'c806d553da2223941f0e1a28a12f96088e0bd45d', class: "empty-wrap" }, translate$3('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (index.h("div", { key: '4ac929f08ef09e5f18cfcb0424c489f8d513bc9b', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (index.h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, index.h("div", { class: "panel-content", slot: "content" }, index.h("div", { class: "ticket-info" }, index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketId', this.language)), index.h("div", { class: "ticket-info-val" }, item.id, " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketType', this.language)), index.h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('ticketAmount', this.language)), index.h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('lineDetail', this.language)), index.h("div", { class: "ticket-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$3('seeDetails', this.language)))), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$3('numberOfDraw', this.language)), index.h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
11876
+ item.drawResults.map((drawResultItem) => (index.h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (index.h("div", { class: "draw-info" }, index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('ticketResult', this.language)), index.h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('drawId', this.language)), index.h("div", { class: "draw-info-val" }, drawResultItem.drawId)), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('drawDate', this.language)), index.h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('result', this.language)), index.h("div", { class: "draw-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$3('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$3('prize', this.language)), index.h("div", { class: "draw-info-val1" }, index.h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (index.h("span", null, index.h("div", null, index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), index.h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (index.h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (index.h("div", { class: "skeleton-line" })))))))))))))), index.h("lottery-tipping-dialog", { key: 'ef4cff5d933545372cef4f6eb4e7dcd1a8f6f111', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11881
11877
  this.showCurrentTicketLine = false;
11882
- }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (index.h("div", { key: '0fe7ae0f7deceb8b3c939a401efafe70124411dd' }, index.h("div", { key: '5418df176032a83dbd05ee545fffc255694413a2', class: "betting-type" }, index.h("div", { key: '8fb74f2041677fe8876a54773451d00f53abe0df', class: "betting-type-title" }, translate$3('bettingType', this.language)), index.h("div", { key: 'b9bc169c4df854a59606d0ddf330707677720263', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), index.h("lottery-tipping-ticket-bet", { key: 'e76e8c1a24b22668d82f54bfed708afb676f23c9', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("lottery-tipping-dialog", { key: 'cf4220d7b9ef7a174ab059574e1d758096cf6f6c', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11878
+ }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (index.h("div", { key: '817ee1fe2541a4ed62b944b58b7abb1eda7afdbe' }, index.h("div", { key: '68672db719f3cc643d6b17769c0a786b3c931a42', class: "betting-type" }, index.h("div", { key: 'af264555814c9e3262b64722438ecd449f451ceb', class: "betting-type-title" }, translate$3('bettingType', this.language)), index.h("div", { key: '25b9bff20eb5a221bed6d345412dd48964890ae7', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), index.h("lottery-tipping-ticket-bet", { key: '4a01e6f1734e5165b06713d3dbb7484463cc1bf4', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("lottery-tipping-dialog", { key: '06fd83f481eb08a4601a96353557a925b1205b66', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11883
11879
  this.showCurrentDrawResult = false;
11884
- }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (index.h("div", { key: '61214e66f20708cf92fa12d9b3afa3feee2e4335' }, index.h("div", { key: '589010058422524a0b3478cee60fa13703d921e9', class: "betting-type" }, index.h("div", { key: '657e2cede56274839d1e56784e7f85e61c5b3a42', class: "betting-type-title" }, translate$3('bettingType', this.language)), index.h("div", { key: 'b2b77770d0d439d7a2d062943c1cb114a7e54574', class: "betting-type-text" }, index.h("div", { key: '8a9e0821b8165a9cc04c5be4b3eb7286bdcef21f', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (index.h("button", { class: {
11880
+ }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (index.h("div", { key: 'c9161334967e9e5abaae4a3d1df922ee7d8d7945' }, index.h("div", { key: 'c7a3ac60084056b899a2b59a6205cddbc8d4e7fc', class: "betting-type" }, index.h("div", { key: '97aa9e8c9048bb57f70d4230f29f8fde3aa4454a', class: "betting-type-title" }, translate$3('bettingType', this.language)), index.h("div", { key: '64332b20eabf75e9273bb6f16c16436e90b28346', class: "betting-type-text" }, index.h("div", { key: 'cbd1ec9e723c6a369a98141077e4648d802c76ad', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (index.h("button", { class: {
11885
11881
  LotteryTippingTicketController__segment: true,
11886
11882
  'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
11887
- }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), index.h("lottery-tipping-ticket-bet", { key: '313e81c7d8181316896a2a46211d12ede72b5353', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("div", { key: '374d4a579f634ae631392b9e16a3a9acd0cf029c', class: "pagination-wrap" }, index.h("lottery-tipping-pagination", { key: '0a22fb6a1d59c391f2db3a2e20774a1b19491739', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
11883
+ }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), index.h("lottery-tipping-ticket-bet", { key: '8b352410c87858e5629a5524e70134ccc2e1b116', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("div", { key: 'e730c86100cb47c4c63051174cd9b33dbb8e6ce4', class: "pagination-wrap" }, index.h("lottery-tipping-pagination", { key: 'dce4d6e9a18e783339d0ff545d1bd47bf1b2a33d', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
11888
11884
  }
11889
11885
  static get watchers() { return {
11890
11886
  "clientStyling": ["handleClientStylingChange"],
@@ -9956,7 +9956,7 @@ const generateUUID$1 = () => {
9956
9956
  return v.toString(16);
9957
9957
  });
9958
9958
  };
9959
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
9959
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
9960
9960
  return new Promise((resolve, reject) => {
9961
9961
  const uuid = generateUUID$1();
9962
9962
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -9977,36 +9977,14 @@ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
9977
9977
  fetch(url, options)
9978
9978
  .then((response) => {
9979
9979
  if (!response.ok) {
9980
- return response.json().then((errorData) => {
9981
- const error = {
9982
- status: response.status,
9983
- statusText: response.statusText,
9984
- code: errorData.code || 'UNKNOWN_ERROR',
9985
- message: errorData.message || 'An unknown error occurred',
9986
- data: errorData.data || null
9987
- };
9988
- reject(error);
9989
- }, () => reject({
9990
- status: response.status,
9991
- statusText: response.statusText,
9992
- code: 'PARSE_ERROR',
9993
- message: 'Failed to parse error response'
9994
- }));
9995
- }
9996
- else {
9997
- return response.json();
9980
+ throw new Error(`HTTP error! Status: ${response.status}`);
9998
9981
  }
9982
+ return response.json();
9999
9983
  })
10000
- .then((data) => resolve(data), (error) => reject(error));
9984
+ .then((data) => resolve(data))
9985
+ .catch((error) => reject(error));
10001
9986
  });
10002
9987
  }
10003
- const fetcher$2 = (url) => fetch(url, {
10004
- method: 'GET',
10005
- headers: {
10006
- 'x-scheme': 'application/json',
10007
- Accept: 'application/json'
10008
- }
10009
- }).then((r) => r.json());
10010
9988
  function isEmptyValueOfArray(arr) {
10011
9989
  if (arr.length === 0) {
10012
9990
  return true;
@@ -10527,13 +10505,37 @@ const formatDate$1 = ({ date, type = 'date', format: format$1 }) => {
10527
10505
  return '';
10528
10506
  }
10529
10507
  };
10530
- const fetcher$1 = (url) => fetch(url, {
10531
- method: 'GET',
10532
- headers: {
10533
- 'x-scheme': 'application/json',
10534
- Accept: 'application/json'
10535
- }
10536
- }).then((r) => r.json());
10508
+ const generateUUID = () => {
10509
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
10510
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
10511
+ return v.toString(16);
10512
+ });
10513
+ };
10514
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
10515
+ return new Promise((resolve, reject) => {
10516
+ const uuid = generateUUID();
10517
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
10518
+ if (method !== 'GET' && method !== 'HEAD') {
10519
+ headersOrigin['X-Idempotency-Key'] = uuid;
10520
+ }
10521
+ const options = {
10522
+ method,
10523
+ headers: headersOrigin
10524
+ };
10525
+ if (body && method !== 'GET' && method !== 'HEAD') {
10526
+ options.body = JSON.stringify(body);
10527
+ }
10528
+ fetch(url, options)
10529
+ .then((response) => {
10530
+ if (!response.ok) {
10531
+ throw new Error(`HTTP error! Status: ${response.status}`);
10532
+ }
10533
+ return response.json();
10534
+ })
10535
+ .then((data) => resolve(data))
10536
+ .catch((error) => reject(error));
10537
+ });
10538
+ }
10537
10539
  const showNotification$1 = ({ message, theme = 'success' }) => {
10538
10540
  window.postMessage({
10539
10541
  type: 'ShowNotificationToast',
@@ -10553,12 +10555,6 @@ const thousandSeparator = (value) => {
10553
10555
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
10554
10556
  return parts.join('.');
10555
10557
  };
10556
- const generateUUID = () => {
10557
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
10558
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
10559
- return v.toString(16);
10560
- });
10561
- };
10562
10558
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
10563
10559
  // format results to winning numbers
10564
10560
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -11416,7 +11412,7 @@ const LotteryTippingTicketController = class {
11416
11412
  const fetchData = () => {
11417
11413
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
11418
11414
  this.isLoading = true;
11419
- fetcher$1(url.href)
11415
+ fetchRequest(url.href, 'GET')
11420
11416
  .then((res) => {
11421
11417
  var _a, _b, _c, _d, _e, _f, _g;
11422
11418
  this.rawData = res;
@@ -11523,7 +11519,7 @@ const LotteryTippingTicketController = class {
11523
11519
  }
11524
11520
  render() {
11525
11521
  var _a, _b, _c, _d, _e, _f, _g;
11526
- 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$2('cancel', this.language), confirmText: translate$2('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))));
11522
+ 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$2('cancel', this.language), confirmText: translate$2('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))));
11527
11523
  }
11528
11524
  static get assetsDirs() { return ["../static"]; }
11529
11525
  static get watchers() { return {
@@ -11651,7 +11647,7 @@ const LotteryTippingTicketHistory = class {
11651
11647
  try {
11652
11648
  this.isLoading = true;
11653
11649
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
11654
- const res = await fetcher$2(url.href);
11650
+ const res = await fetchRequest$1(url.href, 'GET');
11655
11651
  this.rawData = res;
11656
11652
  }
11657
11653
  catch (e) {
@@ -11692,7 +11688,7 @@ const LotteryTippingTicketHistory = class {
11692
11688
  async fetchTicketList() {
11693
11689
  this.isLoading = true;
11694
11690
  try {
11695
- const { items, total } = await fetchRequest(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
11691
+ const { items, total } = await fetchRequest$1(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
11696
11692
  Authorization: `Bearer ${this.sessionId}`
11697
11693
  });
11698
11694
  this.ticketHistory = items;
@@ -11714,7 +11710,7 @@ const LotteryTippingTicketHistory = class {
11714
11710
  }
11715
11711
  async fetchDrwaResult(gameId, drawId) {
11716
11712
  try {
11717
- const res = await fetchRequest(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
11713
+ const res = await fetchRequest$1(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
11718
11714
  return res;
11719
11715
  }
11720
11716
  catch (e) {
@@ -11873,15 +11869,15 @@ const LotteryTippingTicketHistory = class {
11873
11869
  return name !== null && name !== void 0 ? name : bettingType;
11874
11870
  }
11875
11871
  render() {
11876
- return (h("div", { key: '9dbed4dca8e568a334c63748d1768ace33922270', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, h("div", { key: '4149c4c6f067be28f1334a8642790d9886d219ef', class: "ticket-history-title" }, translate$3('ticketsHistory', this.language)), h("div", { key: '185ac4ad602e6e8bb0ec025a5cc2c4a9b8418444', class: "filter-wrap" }, h("div", { key: 'd136c367780b696403f075b261f2009cc94edc5d', class: "filter-status" }, this.statusOptions.map((status) => (h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), h("div", { key: 'e6a30ef0f8c957813a7b13238353709cfb9e2dd9', class: "filter-operation" }, h("lottery-tipping-filter", { key: '4e1e0ba0eeafd7e64344c2b8e4e7d0c0f097127b', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (h("div", { key: 'f572e1bd9cbf97948b9a9bda34f34c1407a8007e', class: "loading-wrap" }, h("section", { key: '9198457f400b175e4c9721449e49a987090860d9', class: "dots-container" }, h("div", { key: '0b1196e3ad2b05ef91965b2a52728e5386578e4b', class: "dot" }), h("div", { key: '19a5b0bc39fd931455a7972d66b640ca36685ea9', class: "dot" }), h("div", { key: '8bf3a43540d38c98d27cb7bf61d7595123a4739c', class: "dot" }), h("div", { key: '5ed33ee21018c3b2aae97a6b1345fdec2072fefe', class: "dot" }), h("div", { key: '2d4404c8e0d39dc82bb25554c242d27e091a9932', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (h("div", { key: '4b731612e57d8bde341da7d639dec6f245c7156d', class: "empty-wrap" }, translate$3('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (h("div", { key: 'c9a17cc74f32ae9277d069a8633f38a8478e642c', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, h("div", { class: "panel-content", slot: "content" }, h("div", { class: "ticket-info" }, h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketId', this.language)), h("div", { class: "ticket-info-val" }, item.id, " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketType', this.language)), h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketAmount', this.language)), h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('lineDetail', this.language)), h("div", { class: "ticket-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$3('seeDetails', this.language)))), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('numberOfDraw', this.language)), h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
11877
- item.drawResults.map((drawResultItem) => (h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (h("div", { class: "draw-info" }, h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('ticketResult', this.language)), h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('drawId', this.language)), h("div", { class: "draw-info-val" }, drawResultItem.drawId)), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('drawDate', this.language)), h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('result', this.language)), h("div", { class: "draw-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$3('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('prize', this.language)), h("div", { class: "draw-info-val1" }, h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (h("span", null, h("div", null, h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (h("div", { class: "skeleton-line" })))))))))))))), h("lottery-tipping-dialog", { key: '4ef7d281084bc6441e6a3e666ac52a7df3dfd28c', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11872
+ return (h("div", { key: '0a8574ec1ba181a07043ec0451dfca73f8aaaf9d', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'f6f0f989a7b4e598e2d9c3d18c83d4f8b4595d84', class: "ticket-history-title" }, translate$3('ticketsHistory', this.language)), h("div", { key: 'e80a9d6e39d899fe6a210837853aacfea21a6cb3', class: "filter-wrap" }, h("div", { key: 'edeaca1e9062a0b9ef264151113bc6130f358017', class: "filter-status" }, this.statusOptions.map((status) => (h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), h("div", { key: 'fdae8b8a796d62827530955449baf85152b4bd49', class: "filter-operation" }, h("lottery-tipping-filter", { key: '004a977ff4460be8e1fbffd22fb6a742401b6597', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (h("div", { key: '4142baea434e611b871f7b8712a8ed03961bf929', class: "loading-wrap" }, h("section", { key: 'd412ab2648dc168e76d13957b9d654522d0211e4', class: "dots-container" }, h("div", { key: '81cca835dff7b6708354d79ecdb804fd768dfdf5', class: "dot" }), h("div", { key: '4fd405a231c5560b014bc9dc34e8847daf197ab1', class: "dot" }), h("div", { key: 'b89f42119dc855255ffb27b7d12d525dca40ab20', class: "dot" }), h("div", { key: 'c9ce133fe12b41639719558922ab0651ed82f605', class: "dot" }), h("div", { key: '8a18cbe9892de938f731045c0d8a01a6f58ab19d', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (h("div", { key: 'c806d553da2223941f0e1a28a12f96088e0bd45d', class: "empty-wrap" }, translate$3('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (h("div", { key: '4ac929f08ef09e5f18cfcb0424c489f8d513bc9b', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, h("div", { class: "panel-content", slot: "content" }, h("div", { class: "ticket-info" }, h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketId', this.language)), h("div", { class: "ticket-info-val" }, item.id, " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketType', this.language)), h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('ticketAmount', this.language)), h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('lineDetail', this.language)), h("div", { class: "ticket-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$3('seeDetails', this.language)))), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$3('numberOfDraw', this.language)), h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
11873
+ item.drawResults.map((drawResultItem) => (h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (h("div", { class: "draw-info" }, h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('ticketResult', this.language)), h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('drawId', this.language)), h("div", { class: "draw-info-val" }, drawResultItem.drawId)), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('drawDate', this.language)), h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('result', this.language)), h("div", { class: "draw-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$3('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$3('prize', this.language)), h("div", { class: "draw-info-val1" }, h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (h("span", null, h("div", null, h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (h("div", { class: "skeleton-line" })))))))))))))), h("lottery-tipping-dialog", { key: 'ef4cff5d933545372cef4f6eb4e7dcd1a8f6f111', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11878
11874
  this.showCurrentTicketLine = false;
11879
- }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (h("div", { key: '0fe7ae0f7deceb8b3c939a401efafe70124411dd' }, h("div", { key: '5418df176032a83dbd05ee545fffc255694413a2', class: "betting-type" }, h("div", { key: '8fb74f2041677fe8876a54773451d00f53abe0df', class: "betting-type-title" }, translate$3('bettingType', this.language)), h("div", { key: 'b9bc169c4df854a59606d0ddf330707677720263', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), h("lottery-tipping-ticket-bet", { key: 'e76e8c1a24b22668d82f54bfed708afb676f23c9', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("lottery-tipping-dialog", { key: 'cf4220d7b9ef7a174ab059574e1d758096cf6f6c', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11875
+ }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (h("div", { key: '817ee1fe2541a4ed62b944b58b7abb1eda7afdbe' }, h("div", { key: '68672db719f3cc643d6b17769c0a786b3c931a42', class: "betting-type" }, h("div", { key: 'af264555814c9e3262b64722438ecd449f451ceb', class: "betting-type-title" }, translate$3('bettingType', this.language)), h("div", { key: '25b9bff20eb5a221bed6d345412dd48964890ae7', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), h("lottery-tipping-ticket-bet", { key: '4a01e6f1734e5165b06713d3dbb7484463cc1bf4', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("lottery-tipping-dialog", { key: '06fd83f481eb08a4601a96353557a925b1205b66', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
11880
11876
  this.showCurrentDrawResult = false;
11881
- }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (h("div", { key: '61214e66f20708cf92fa12d9b3afa3feee2e4335' }, h("div", { key: '589010058422524a0b3478cee60fa13703d921e9', class: "betting-type" }, h("div", { key: '657e2cede56274839d1e56784e7f85e61c5b3a42', class: "betting-type-title" }, translate$3('bettingType', this.language)), h("div", { key: 'b2b77770d0d439d7a2d062943c1cb114a7e54574', class: "betting-type-text" }, h("div", { key: '8a9e0821b8165a9cc04c5be4b3eb7286bdcef21f', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
11877
+ }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (h("div", { key: 'c9161334967e9e5abaae4a3d1df922ee7d8d7945' }, h("div", { key: 'c7a3ac60084056b899a2b59a6205cddbc8d4e7fc', class: "betting-type" }, h("div", { key: '97aa9e8c9048bb57f70d4230f29f8fde3aa4454a', class: "betting-type-title" }, translate$3('bettingType', this.language)), h("div", { key: '64332b20eabf75e9273bb6f16c16436e90b28346', class: "betting-type-text" }, h("div", { key: 'cbd1ec9e723c6a369a98141077e4648d802c76ad', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
11882
11878
  LotteryTippingTicketController__segment: true,
11883
11879
  'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
11884
- }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: '313e81c7d8181316896a2a46211d12ede72b5353', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("div", { key: '374d4a579f634ae631392b9e16a3a9acd0cf029c', class: "pagination-wrap" }, h("lottery-tipping-pagination", { key: '0a22fb6a1d59c391f2db3a2e20774a1b19491739', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
11880
+ }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: '8b352410c87858e5629a5524e70134ccc2e1b116', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("div", { key: 'e730c86100cb47c4c63051174cd9b33dbb8e6ce4', class: "pagination-wrap" }, h("lottery-tipping-pagination", { key: 'dce4d6e9a18e783339d0ff545d1bd47bf1b2a33d', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
11885
11881
  }
11886
11882
  static get watchers() { return {
11887
11883
  "clientStyling": ["handleClientStylingChange"],