@everymatrix/casino-game-thumb-view 1.43.4 → 1.45.0

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.
Files changed (131) hide show
  1. package/dist/casino-game-thumb-view/casino-game-thumb-view.esm.js +1 -1
  2. package/dist/casino-game-thumb-view/p-2207062c.entry.js +1 -0
  3. package/dist/casino-game-thumb-view/p-39684b4a.entry.js +1 -0
  4. package/dist/casino-game-thumb-view/p-af0284b5.entry.js +1 -0
  5. package/dist/casino-game-thumb-view/p-b73b7a18.entry.js +1 -0
  6. package/dist/casino-game-thumb-view/p-bd016895.entry.js +7 -0
  7. package/dist/casino-game-thumb-view/p-d2580653.js +8 -0
  8. package/dist/casino-game-thumb-view/p-d48c3566.entry.js +1 -0
  9. package/dist/casino-game-thumb-view/p-e1255160.js +1 -0
  10. package/dist/casino-game-thumb-view/p-eef6f908.js +2 -0
  11. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  12. package/dist/cjs/casino-extrainfo-baccarat.cjs.entry.js +327 -322
  13. package/dist/cjs/casino-extrainfo-blackjack.cjs.entry.js +45 -45
  14. package/dist/cjs/casino-extrainfo-roulette.cjs.entry.js +35 -34
  15. package/dist/cjs/casino-game-thumb-view.cjs.js +17 -11
  16. package/dist/cjs/casino-game-thumb-view_2.cjs.entry.js +469 -519
  17. package/dist/cjs/casino-game-thumbnail-betlimit_2.cjs.entry.js +258 -251
  18. package/dist/cjs/casino-normal-game-thumbnail.cjs.entry.js +14 -12
  19. package/dist/cjs/game-thumbnail-5a34c727.js +78 -0
  20. package/dist/cjs/index-48d13981.js +1709 -0
  21. package/dist/cjs/loader.cjs.js +7 -13
  22. package/dist/cjs/locale.utils-53bf703a.js +132 -0
  23. package/dist/cjs/{utils-a0afc0a9.js → utils-c4ed3adc.js} +407 -404
  24. package/dist/collection/collection-manifest.json +10 -10
  25. package/dist/collection/components/casino-extrainfo-baccarat/casino-extrainfo-baccarat.js +251 -230
  26. package/dist/collection/components/casino-extrainfo-blackjack/casino-extrainfo-blackjack.js +136 -114
  27. package/dist/collection/components/casino-extrainfo-roulette/casino-extrainfo-roulette.js +126 -119
  28. package/dist/collection/components/casino-game-thumb-view/casino-game-thumb-view.css +1 -1
  29. package/dist/collection/components/casino-game-thumb-view/casino-game-thumb-view.js +1023 -1027
  30. package/dist/collection/components/casino-game-thumb-view/index.js +1 -0
  31. package/dist/collection/components/casino-game-thumbnail-betlimit/casino-game-thumbnail-betlimit.js +78 -80
  32. package/dist/collection/components/casino-game-thumbnail-extrainfo/casino-game-thumbnail-extrainfo.js +153 -150
  33. package/dist/collection/components/casino-game-thumbnail-overlay/casino-game-thumbnail-overlay.js +201 -206
  34. package/dist/collection/components/casino-normal-game-thumbnail/casino-normal-game-thumbnail.js +71 -58
  35. package/dist/collection/constants/game-thumbnail.js +66 -66
  36. package/dist/collection/models/casino-game-thumb-view.js +6 -6
  37. package/dist/collection/models/currency-symbols.js +170 -170
  38. package/dist/collection/utils/baccarat-board-svg.js +225 -225
  39. package/dist/collection/utils/locale.utils.js +122 -122
  40. package/dist/collection/utils/utils.js +41 -41
  41. package/dist/esm/app-globals-0f993ce5.js +3 -0
  42. package/dist/esm/casino-extrainfo-baccarat.entry.js +327 -322
  43. package/dist/esm/casino-extrainfo-blackjack.entry.js +45 -45
  44. package/dist/esm/casino-extrainfo-roulette.entry.js +35 -34
  45. package/dist/esm/casino-game-thumb-view.js +14 -11
  46. package/dist/esm/casino-game-thumb-view_2.entry.js +469 -519
  47. package/dist/esm/casino-game-thumbnail-betlimit_2.entry.js +258 -251
  48. package/dist/esm/casino-normal-game-thumbnail.entry.js +14 -12
  49. package/dist/esm/game-thumbnail-035e97e2.js +72 -0
  50. package/dist/esm/index-8c9a8030.js +1681 -0
  51. package/dist/esm/loader.js +7 -13
  52. package/dist/esm/locale.utils-0c514ca8.js +130 -0
  53. package/dist/{components/utils.js → esm/utils-090ac2e9.js} +407 -404
  54. package/dist/stencil.config.dev.js +17 -0
  55. package/dist/stencil.config.js +12 -35
  56. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-game-thumb-view/.stencil/packages/stencil/casino-game-thumb-view/stencil.config.d.ts +2 -0
  57. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-game-thumb-view/.stencil/packages/stencil/casino-game-thumb-view/stencil.config.dev.d.ts +2 -0
  58. package/dist/types/components/casino-extrainfo-baccarat/casino-extrainfo-baccarat.d.ts +36 -36
  59. package/dist/types/components/casino-extrainfo-blackjack/casino-extrainfo-blackjack.d.ts +33 -33
  60. package/dist/types/components/casino-extrainfo-roulette/casino-extrainfo-roulette.d.ts +18 -18
  61. package/dist/types/components/casino-game-thumb-view/casino-game-thumb-view.d.ts +213 -213
  62. package/dist/types/components/casino-game-thumb-view/index.d.ts +1 -0
  63. package/dist/types/components/casino-game-thumbnail-betlimit/casino-game-thumbnail-betlimit.d.ts +14 -14
  64. package/dist/types/components/casino-game-thumbnail-extrainfo/casino-game-thumbnail-extrainfo.d.ts +13 -13
  65. package/dist/types/components/casino-game-thumbnail-overlay/casino-game-thumbnail-overlay.d.ts +28 -28
  66. package/dist/types/components/casino-normal-game-thumbnail/casino-normal-game-thumbnail.d.ts +4 -4
  67. package/dist/types/components.d.ts +33 -2
  68. package/dist/types/constants/game-thumbnail.d.ts +66 -66
  69. package/dist/types/models/casino-game-thumb-view.d.ts +107 -107
  70. package/dist/types/models/currency-symbols.d.ts +170 -170
  71. package/dist/types/stencil-public-runtime.d.ts +142 -33
  72. package/dist/types/utils/baccarat-board-svg.d.ts +29 -29
  73. package/loader/cdn.js +1 -3
  74. package/loader/index.cjs.js +1 -3
  75. package/loader/index.d.ts +13 -1
  76. package/loader/index.es2017.js +1 -3
  77. package/loader/index.js +1 -3
  78. package/loader/package.json +1 -0
  79. package/package.json +8 -8
  80. package/dist/assets/baccarat.svg +0 -43
  81. package/dist/assets/fav.svg +0 -9
  82. package/dist/assets/favorite.svg +0 -12
  83. package/dist/assets/seat.svg +0 -6
  84. package/dist/assets/unfav.svg +0 -20
  85. package/dist/casino-game-thumb-view/p-1bbf4b70.entry.js +0 -1
  86. package/dist/casino-game-thumb-view/p-42bf2034.entry.js +0 -1
  87. package/dist/casino-game-thumb-view/p-46dbb1cb.js +0 -1
  88. package/dist/casino-game-thumb-view/p-6a6b2a78.js +0 -8
  89. package/dist/casino-game-thumb-view/p-7ae107ed.entry.js +0 -1
  90. package/dist/casino-game-thumb-view/p-9cbfffbc.entry.js +0 -1
  91. package/dist/casino-game-thumb-view/p-d961aec4.entry.js +0 -1
  92. package/dist/casino-game-thumb-view/p-db43bb56.entry.js +0 -7
  93. package/dist/cjs/game-thumbnail-31d518f0.js +0 -78
  94. package/dist/cjs/index-65a1d768.js +0 -1796
  95. package/dist/cjs/locale.utils-aa160787.js +0 -132
  96. package/dist/components/casino-extrainfo-baccarat.d.ts +0 -11
  97. package/dist/components/casino-extrainfo-baccarat.js +0 -400
  98. package/dist/components/casino-extrainfo-blackjack.d.ts +0 -11
  99. package/dist/components/casino-extrainfo-blackjack.js +0 -92
  100. package/dist/components/casino-extrainfo-roulette.d.ts +0 -11
  101. package/dist/components/casino-extrainfo-roulette.js +0 -78
  102. package/dist/components/casino-game-thumb-view.d.ts +0 -11
  103. package/dist/components/casino-game-thumb-view.js +0 -1625
  104. package/dist/components/casino-game-thumbnail-betlimit.d.ts +0 -11
  105. package/dist/components/casino-game-thumbnail-betlimit.js +0 -6
  106. package/dist/components/casino-game-thumbnail-betlimit2.js +0 -227
  107. package/dist/components/casino-game-thumbnail-extrainfo.d.ts +0 -11
  108. package/dist/components/casino-game-thumbnail-extrainfo.js +0 -6
  109. package/dist/components/casino-game-thumbnail-extrainfo2.js +0 -96
  110. package/dist/components/casino-game-thumbnail-overlay.d.ts +0 -11
  111. package/dist/components/casino-game-thumbnail-overlay.js +0 -6
  112. package/dist/components/casino-game-thumbnail-overlay2.js +0 -69
  113. package/dist/components/casino-normal-game-thumbnail.d.ts +0 -11
  114. package/dist/components/casino-normal-game-thumbnail.js +0 -52
  115. package/dist/components/game-thumbnail.js +0 -72
  116. package/dist/components/index.d.ts +0 -26
  117. package/dist/components/index.js +0 -1
  118. package/dist/components/locale.utils.js +0 -130
  119. package/dist/esm/game-thumbnail-0a56ee03.js +0 -72
  120. package/dist/esm/index-1e44dd9f.js +0 -1769
  121. package/dist/esm/locale.utils-e0cf897e.js +0 -130
  122. package/dist/esm/polyfills/core-js.js +0 -11
  123. package/dist/esm/polyfills/css-shim.js +0 -1
  124. package/dist/esm/polyfills/dom.js +0 -79
  125. package/dist/esm/polyfills/es5-html-element.js +0 -1
  126. package/dist/esm/polyfills/index.js +0 -34
  127. package/dist/esm/polyfills/system.js +0 -6
  128. package/dist/esm/utils-e9314132.js +0 -5739
  129. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-game-thumb-view/.stencil/packages/casino-game-thumb-view/stencil.config.d.ts +0 -2
  130. /package/dist/casino-game-thumb-view/{p-2d5f59fe.js → p-2d02adb1.js} +0 -0
  131. /package/dist/casino-game-thumb-view/{p-1e63a1ab.js → p-59ceeaaa.js} +0 -0
@@ -1,17 +1,17 @@
1
- import { r as registerInstance, h, H as Host } from './index-1e44dd9f.js';
2
- import { b as WINNER_COLOR } from './game-thumbnail-0a56ee03.js';
1
+ import { r as registerInstance, h, H as Host } from './index-8c9a8030.js';
2
+ import { b as WINNER_COLOR } from './game-thumbnail-035e97e2.js';
3
3
 
4
4
  var CasinoGameCategory;
5
5
  (function (CasinoGameCategory) {
6
- CasinoGameCategory["ROULETTE"] = "ROULETTE";
7
- CasinoGameCategory["POKER"] = "POKER";
8
- CasinoGameCategory["BLACKJACK"] = "BLACKJACK";
6
+ CasinoGameCategory["ROULETTE"] = "ROULETTE";
7
+ CasinoGameCategory["POKER"] = "POKER";
8
+ CasinoGameCategory["BLACKJACK"] = "BLACKJACK";
9
9
  })(CasinoGameCategory || (CasinoGameCategory = {}));
10
10
  var BaccaratWinner;
11
11
  (function (BaccaratWinner) {
12
- BaccaratWinner["PLAYER"] = "Player";
13
- BaccaratWinner["WINNER"] = "Banker";
14
- BaccaratWinner["TIE"] = "Tie";
12
+ BaccaratWinner["PLAYER"] = "Player";
13
+ BaccaratWinner["WINNER"] = "Banker";
14
+ BaccaratWinner["TIE"] = "Tie";
15
15
  })(BaccaratWinner || (BaccaratWinner = {}));
16
16
 
17
17
  const BACCARAT_ROW = 6;
@@ -19,344 +19,349 @@ const BACCARTAT_COLUMN = 40;
19
19
  const TIE_ANGLE = 135;
20
20
  const PLAYER_ANGLE = 45;
21
21
  class BaccaratSvg {
22
- constructor() {
23
- this.svgNS = 'http://www.w3.org/2000/svg';
24
- this.svgVersion = '1.1';
25
- this.markGroupExtraClass = {
26
- name: '',
27
- strokeWidth: 1.8,
28
- cellPadding: 6
29
- };
30
- }
31
- resetSvg() {
32
- this.svgGroupObj.innerHTML = '';
33
- }
34
- createTag(tag, attrs) {
35
- let oTag = document.createElementNS(this.svgNS, tag);
36
- Object.keys(attrs).forEach((attr) => {
37
- oTag.setAttribute(attr, attrs[attr]);
38
- });
39
- return oTag;
40
- }
41
- ;
42
- //Y1 = Y2, X1=0;
43
- createHLine(lineIdx) {
44
- return this.createTag('line', {
45
- 'x1': 0,
46
- 'x2': this.svgWidth,
47
- 'y1': lineIdx * this.cellHeight,
48
- 'y2': lineIdx * this.cellHeight
49
- });
50
- }
51
- createVLine(lineIdx) {
52
- return this.createTag('line', {
53
- 'x1': lineIdx * this.cellWidth,
54
- 'x2': lineIdx * this.cellWidth,
55
- 'y1': 0,
56
- 'y2': this.svgHeight
57
- });
58
- }
59
- createBaccaratBoard(parentEle) {
60
- this.parentEle = parentEle;
61
- this.svgWidth = parentEle.clientWidth;
62
- this.cellWidth = this.svgWidth / BACCARTAT_COLUMN;
63
- this.cellHeight = this.cellWidth;
64
- this.svgHeight = this.cellHeight * BACCARAT_ROW;
65
- let dynamicStyles = {};
66
- if (this.svgWidth < 300) {
67
- dynamicStyles = {
68
- name: 'Min',
69
- strokeWidth: 0.8,
70
- cellPadding: 2
71
- };
22
+ constructor() {
23
+ this.svgNS = 'http://www.w3.org/2000/svg';
24
+ this.svgVersion = '1.1';
25
+ this.markGroupExtraClass = {
26
+ name: '',
27
+ strokeWidth: 1.8,
28
+ cellPadding: 6
29
+ };
72
30
  }
73
- else if (this.svgWidth >= 300 && this.svgWidth < 500) {
74
- dynamicStyles = {
75
- name: 'Mid',
76
- strokeWidth: 1.5,
77
- cellPadding: 3.8
78
- };
31
+ resetSvg() {
32
+ this.svgGroupObj.innerHTML = '';
79
33
  }
80
- this.markGroupExtraClass = Object.assign(Object.assign({}, this.markGroupExtraClass), dynamicStyles);
81
- this.markGroupExtraClass.fontSize = this.cellWidth - this.markGroupExtraClass.cellPadding * 0.8;
82
- this.markGroupExtraClass.pairDotR = this.markGroupExtraClass.strokeWidth / 2;
83
- this.markGroupExtraClass.pairBackDotR = this.markGroupExtraClass.pairDotR + 0.4;
84
- let svgObj = this.createTag('svg', { 'xmlns': this.svgNS, 'version': this.svgVersion, 'width': '100%' });
85
- let svgGroup = this.createTag('g', {
86
- 'style': 'cursor: pointer',
87
- 'stroke': '#a1acb696',
88
- 'stroke-width': '0.6px',
89
- 'fill': 'transparent'
90
- });
91
- let markGroup = this.createTag('g', {
92
- 'style': 'cursor: pointer', 'class': `BoardRoundsGroup ${this.markGroupExtraClass.name}`,
93
- 'stroke-width': this.markGroupExtraClass.strokeWidth, 'fill': 'transparent'
94
- });
95
- for (let i = 0; i < BACCARAT_ROW + 1; i++) {
96
- svgGroup.appendChild(this.createHLine(i));
34
+ createTag(tag, attrs) {
35
+ let oTag = document.createElementNS(this.svgNS, tag);
36
+ Object.keys(attrs).forEach((attr) => {
37
+ oTag.setAttribute(attr, attrs[attr]);
38
+ });
39
+ return oTag;
97
40
  }
98
- for (let i = 0; i < BACCARTAT_COLUMN + 1; i++) {
99
- svgGroup.appendChild(this.createVLine(i));
41
+ ;
42
+ //Y1 = Y2, X1=0;
43
+ createHLine(lineIdx) {
44
+ return this.createTag('line', {
45
+ 'x1': 0,
46
+ 'x2': this.svgWidth,
47
+ 'y1': lineIdx * this.cellHeight,
48
+ 'y2': lineIdx * this.cellHeight
49
+ });
100
50
  }
101
- parentEle.setAttribute('style', `height: ${this.svgHeight}px`);
102
- svgObj.appendChild(svgGroup);
103
- svgObj.appendChild(markGroup);
104
- parentEle.replaceChildren(svgObj);
105
- this.svgGroupObj = markGroup;
106
- }
107
- getRadius() {
108
- return (this.cellHeight - this.markGroupExtraClass.cellPadding) / 2;
109
- }
110
- addAnimate(objToAddAnimate) {
111
- let animate = this.createTag('animate', {
112
- 'attributeName': 'opacity', attributeType: 'XML', 'from': '0', to: 0.8, repeatCount: '5',
113
- begin: '0s', dur: '1.5s', 'calcMode': 'spline', keySplines: "0.1 0.8 0.9 0.1", fill: 'freeze'
114
- });
115
- objToAddAnimate.appendChild(animate);
116
- }
117
- markNewRound(x, y, options, markNew = false) {
118
- let centre = this.getCenterPoint(x, y);
119
- let svgG = this.createTag('g', {
120
- 'class': `Round ${markNew ? 'NewRound' : ''} ${options.winner === BaccaratWinner.TIE ? 'Tie' : ''}`,
121
- 'part': `Round ${markNew ? 'NewRound' : ''}`, 'opacity': markNew ? 0.1 : 1
122
- });
123
- //RoundWinner: TIE
124
- if (options.winner === BaccaratWinner.TIE) {
125
- svgG.appendChild(this.createTieSvg(x, y));
126
- this.svgGroupObj.appendChild(svgG);
127
- if (options.ties && options.ties > 1) {
128
- let text = this.createTag('text', {
129
- 'x': centre.cx - 1.5,
130
- 'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
131
- 'fill': '#12153d',
132
- 'class': 'TieNumber',
133
- 'font-size': `${this.markGroupExtraClass.fontSize}px`,
134
- 'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
51
+ createVLine(lineIdx) {
52
+ return this.createTag('line', {
53
+ 'x1': lineIdx * this.cellWidth,
54
+ 'x2': lineIdx * this.cellWidth,
55
+ 'y1': 0,
56
+ 'y2': this.svgHeight
135
57
  });
136
- text.innerHTML = options.ties;
137
- svgG.appendChild(text);
138
- }
139
- this.svgGroupObj.appendChild(svgG);
140
- return;
141
58
  }
142
- svgG.appendChild(this.createTag('circle', {
143
- r: this.getRadius(),
144
- 'class': 'Round',
145
- 'stroke': options.color,
146
- 'cx': x * this.cellHeight + (this.cellHeight) / 2,
147
- 'cy': y * this.cellHeight + (this.cellHeight) / 2
148
- }));
149
- if (options.ties) {
150
- svgG.appendChild(this.createTieSvg(x, y));
151
- if (options.ties > 1) {
152
- let text = this.createTag('text', {
153
- 'x': centre.cx - 1.5,
154
- 'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
155
- 'fill': '#12153d',
156
- 'class': 'TieNumber',
157
- 'font-size': `${this.markGroupExtraClass.fontSize}px`,
158
- 'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
59
+ createBaccaratBoard(parentEle) {
60
+ this.parentEle = parentEle;
61
+ this.svgWidth = parentEle.clientWidth;
62
+ this.cellWidth = this.svgWidth / BACCARTAT_COLUMN;
63
+ this.cellHeight = this.cellWidth;
64
+ this.svgHeight = this.cellHeight * BACCARAT_ROW;
65
+ let dynamicStyles = {};
66
+ if (this.svgWidth < 300) {
67
+ dynamicStyles = {
68
+ name: 'Min',
69
+ strokeWidth: 0.8,
70
+ cellPadding: 2
71
+ };
72
+ }
73
+ else if (this.svgWidth >= 300 && this.svgWidth < 500) {
74
+ dynamicStyles = {
75
+ name: 'Mid',
76
+ strokeWidth: 1.5,
77
+ cellPadding: 3.8
78
+ };
79
+ }
80
+ this.markGroupExtraClass = Object.assign(Object.assign({}, this.markGroupExtraClass), dynamicStyles);
81
+ this.markGroupExtraClass.fontSize = this.cellWidth - this.markGroupExtraClass.cellPadding * 0.8;
82
+ this.markGroupExtraClass.pairDotR = this.markGroupExtraClass.strokeWidth / 2;
83
+ this.markGroupExtraClass.pairBackDotR = this.markGroupExtraClass.pairDotR + 0.4;
84
+ let svgObj = this.createTag('svg', { 'xmlns': this.svgNS, 'version': this.svgVersion, 'width': '100%' });
85
+ let svgGroup = this.createTag('g', {
86
+ 'style': 'cursor: pointer',
87
+ 'stroke': '#a1acb696',
88
+ 'stroke-width': '0.6px',
89
+ 'fill': 'transparent'
90
+ });
91
+ let markGroup = this.createTag('g', {
92
+ 'style': 'cursor: pointer', 'class': `BoardRoundsGroup ${this.markGroupExtraClass.name}`,
93
+ 'stroke-width': this.markGroupExtraClass.strokeWidth, 'fill': 'transparent'
159
94
  });
160
- text.innerHTML = options.ties;
161
- svgG.appendChild(text);
162
- }
163
- this.svgGroupObj.appendChild(svgG);
95
+ for (let i = 0; i < BACCARAT_ROW + 1; i++) {
96
+ svgGroup.appendChild(this.createHLine(i));
97
+ }
98
+ for (let i = 0; i < BACCARTAT_COLUMN + 1; i++) {
99
+ svgGroup.appendChild(this.createVLine(i));
100
+ }
101
+ parentEle.setAttribute('style', `height: ${this.svgHeight}px`);
102
+ svgObj.appendChild(svgGroup);
103
+ svgObj.appendChild(markGroup);
104
+ parentEle.replaceChildren(svgObj);
105
+ this.svgGroupObj = markGroup;
164
106
  }
165
- if (options.bankerPair) {
166
- let dots = this.createPairDot(x, y, options.pairColor.banker, PLAYER_ANGLE + 180);
167
- dots.forEach(dot => svgG.appendChild(dot));
107
+ getRadius() {
108
+ return (this.cellHeight - this.markGroupExtraClass.cellPadding) / 2;
168
109
  }
169
- if (options.playerPair) {
170
- let dots = this.createPairDot(x, y, options.pairColor.player, PLAYER_ANGLE);
171
- dots.forEach(dot => svgG.appendChild(dot));
110
+ addAnimate(objToAddAnimate) {
111
+ let animate = this.createTag('animate', {
112
+ 'attributeName': 'opacity', attributeType: 'XML', 'from': '0', to: 0.8, repeatCount: '5',
113
+ begin: '0s', dur: '1.5s', 'calcMode': 'spline', keySplines: "0.1 0.8 0.9 0.1", fill: 'freeze'
114
+ });
115
+ objToAddAnimate.appendChild(animate);
172
116
  }
173
- if (options.includeAnimate) {
174
- this.addAnimate(svgG);
117
+ markNewRound(x, y, options, markNew = false) {
118
+ let centre = this.getCenterPoint(x, y);
119
+ let svgG = this.createTag('g', {
120
+ 'class': `Round ${markNew ? 'NewRound' : ''} ${options.winner === BaccaratWinner.TIE ? 'Tie' : ''}`,
121
+ 'part': `Round ${markNew ? 'NewRound' : ''}`, 'opacity': markNew ? 0.1 : 1
122
+ });
123
+ //RoundWinner: TIE
124
+ if (options.winner === BaccaratWinner.TIE) {
125
+ svgG.appendChild(this.createTieSvg(x, y));
126
+ this.svgGroupObj.appendChild(svgG);
127
+ if (options.ties && options.ties > 1) {
128
+ let text = this.createTag('text', {
129
+ 'x': centre.cx - 1.5,
130
+ 'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
131
+ 'fill': '#12153d',
132
+ 'class': 'TieNumber',
133
+ 'font-size': `${this.markGroupExtraClass.fontSize}px`,
134
+ 'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
135
+ });
136
+ text.innerHTML = options.ties;
137
+ svgG.appendChild(text);
138
+ }
139
+ this.svgGroupObj.appendChild(svgG);
140
+ return;
141
+ }
142
+ svgG.appendChild(this.createTag('circle', {
143
+ r: this.getRadius(),
144
+ 'class': 'Round',
145
+ 'stroke': options.color,
146
+ 'cx': x * this.cellHeight + (this.cellHeight) / 2,
147
+ 'cy': y * this.cellHeight + (this.cellHeight) / 2
148
+ }));
149
+ if (options.ties) {
150
+ svgG.appendChild(this.createTieSvg(x, y));
151
+ if (options.ties > 1) {
152
+ let text = this.createTag('text', {
153
+ 'x': centre.cx - 1.5,
154
+ 'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
155
+ 'fill': '#12153d',
156
+ 'class': 'TieNumber',
157
+ 'font-size': `${this.markGroupExtraClass.fontSize}px`,
158
+ 'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
159
+ });
160
+ text.innerHTML = options.ties;
161
+ svgG.appendChild(text);
162
+ }
163
+ this.svgGroupObj.appendChild(svgG);
164
+ }
165
+ if (options.bankerPair) {
166
+ let dots = this.createPairDot(x, y, options.pairColor.banker, PLAYER_ANGLE + 180);
167
+ dots.forEach(dot => svgG.appendChild(dot));
168
+ }
169
+ if (options.playerPair) {
170
+ let dots = this.createPairDot(x, y, options.pairColor.player, PLAYER_ANGLE);
171
+ dots.forEach(dot => svgG.appendChild(dot));
172
+ }
173
+ if (options.includeAnimate) {
174
+ this.addAnimate(svgG);
175
+ }
176
+ this.svgGroupObj.appendChild(svgG);
175
177
  }
176
- this.svgGroupObj.appendChild(svgG);
177
- }
178
- markRound(x, y, color, includeAnimate = false) {
179
- let circleSvg = this.createTag('circle', {
180
- r: this.getRadius(),
181
- 'class': 'Round',
182
- 'stroke': color,
183
- 'cx': x * this.cellHeight + (this.cellHeight) / 2,
184
- 'cy': y * this.cellHeight + (this.cellHeight) / 2
185
- });
186
- if (includeAnimate) {
187
- this.addAnimate(circleSvg);
178
+ markRound(x, y, color, includeAnimate = false) {
179
+ let circleSvg = this.createTag('circle', {
180
+ r: this.getRadius(),
181
+ 'class': 'Round',
182
+ 'stroke': color,
183
+ 'cx': x * this.cellHeight + (this.cellHeight) / 2,
184
+ 'cy': y * this.cellHeight + (this.cellHeight) / 2
185
+ });
186
+ if (includeAnimate) {
187
+ this.addAnimate(circleSvg);
188
+ }
189
+ this.svgGroupObj.appendChild(circleSvg);
188
190
  }
189
- this.svgGroupObj.appendChild(circleSvg);
190
- }
191
- getCenterPoint(x, y) {
192
- return {
193
- 'cx': x * this.cellHeight + (this.cellHeight) / 2,
194
- 'cy': y * this.cellHeight + (this.cellHeight) / 2
195
- };
196
- }
197
- createTieSvg(x, y) {
198
- let centerXY = this.getCenterPoint(x, y), angle = TIE_ANGLE, r = (this.cellHeight) / 2;
199
- const x1 = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
200
- const y1 = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
201
- const x2 = centerXY.cx + r * Math.cos((angle + 180) * Math.PI / 180);
202
- const y2 = centerXY.cy + r * Math.sin((angle + 180) * Math.PI / 180);
203
- return this.createTag('line', {
204
- x1, y1, x2, y2, 'class': 'Tie',
205
- 'stroke': 'green', 'opacity': '0.8', 'stroke-width': '1.8px'
206
- });
207
- }
208
- createPairDot(x, y, pairColor, angle) {
209
- let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
210
- const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
211
- const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
212
- return [
213
- this.createTag('circle', {
214
- cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
215
- 'stroke': '#fff'
216
- }),
217
- this.createTag('circle', {
218
- cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
219
- 'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
220
- })
221
- ];
222
- }
223
- markTie(x, y, includeAnimate = false) {
224
- let line = this.createTieSvg(x, y);
225
- if (includeAnimate) {
226
- this.addAnimate(line);
191
+ getCenterPoint(x, y) {
192
+ return {
193
+ 'cx': x * this.cellHeight + (this.cellHeight) / 2,
194
+ 'cy': y * this.cellHeight + (this.cellHeight) / 2
195
+ };
196
+ }
197
+ createTieSvg(x, y) {
198
+ let centerXY = this.getCenterPoint(x, y), angle = TIE_ANGLE, r = (this.cellHeight) / 2;
199
+ const x1 = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
200
+ const y1 = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
201
+ const x2 = centerXY.cx + r * Math.cos((angle + 180) * Math.PI / 180);
202
+ const y2 = centerXY.cy + r * Math.sin((angle + 180) * Math.PI / 180);
203
+ return this.createTag('line', {
204
+ x1, y1, x2, y2, 'class': 'Tie',
205
+ 'stroke': 'green', 'opacity': '0.8', 'stroke-width': '1.8px'
206
+ });
207
+ }
208
+ createPairDot(x, y, pairColor, angle) {
209
+ let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
210
+ const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
211
+ const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
212
+ return [
213
+ this.createTag('circle', {
214
+ cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
215
+ 'stroke': '#fff'
216
+ }),
217
+ this.createTag('circle', {
218
+ cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
219
+ 'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
220
+ })
221
+ ];
222
+ }
223
+ markTie(x, y, includeAnimate = false) {
224
+ let line = this.createTieSvg(x, y);
225
+ if (includeAnimate) {
226
+ this.addAnimate(line);
227
+ }
228
+ this.svgGroupObj.appendChild(line);
229
+ }
230
+ markPair(x, y, pairColor, angle) {
231
+ let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
232
+ const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
233
+ const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
234
+ this.svgGroupObj.appendChild(this.createTag('circle', {
235
+ cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
236
+ 'stroke': '#fff'
237
+ }));
238
+ this.svgGroupObj.appendChild(this.createTag('circle', {
239
+ cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
240
+ 'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
241
+ }));
242
+ }
243
+ markBankerPair(x, y, pairColor) {
244
+ this.markPair(x, y, pairColor, 225);
245
+ }
246
+ markPlayerPair(x, y, pairColor) {
247
+ this.markPair(x, y, pairColor, 45);
227
248
  }
228
- this.svgGroupObj.appendChild(line);
229
- }
230
- markPair(x, y, pairColor, angle) {
231
- let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
232
- const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
233
- const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
234
- this.svgGroupObj.appendChild(this.createTag('circle', {
235
- cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
236
- 'stroke': '#fff'
237
- }));
238
- this.svgGroupObj.appendChild(this.createTag('circle', {
239
- cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
240
- 'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
241
- }));
242
- }
243
- markBankerPair(x, y, pairColor) {
244
- this.markPair(x, y, pairColor, 225);
245
- }
246
- markPlayerPair(x, y, pairColor) {
247
- this.markPair(x, y, pairColor, 45);
248
- }
249
249
  }
250
250
 
251
251
  const casinoExtrainfoBaccaratCss = ":host {\n display: block;\n}\n\n.BaccaratBoard {\n container-type: inline-size;\n min-height: 30px;\n width: 100%;\n}\n.BaccaratBoard svg {\n background: #fff;\n opacity: 0.99;\n height: 100%;\n}\n\n.LiveProps.BaccaratProps div.LiveIcons {\n margin-bottom: 0px;\n padding: 0px;\n width: 100%;\n}\n\nsvg circle {\n transition: stroke-dashoffset 0s ease 2s;\n}\n\ng.BoardRoundsGroup {\n stroke-width: 1.8px;\n}\n\n@container (max-width: 300px) {\n g.BoardRoundsGroup {\n stroke-width: 0.9px;\n }\n}\nsvg .Round.NewRound {\n opacity: 1;\n -webkit-animation-name: fadeInFromNone;\n animation-name: fadeInFromNone;\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n\n@-webkit-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@-moz-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@-o-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 30% {\n display: block;\n opacity: 1;\n }\n 60% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 30% {\n display: block;\n opacity: 1;\n }\n 60% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}";
252
+ const CasinoExtrainfoBaccaratStyle0 = casinoExtrainfoBaccaratCss;
252
253
 
253
254
  const CasinoExtrainfoBaccarat = class {
254
- constructor(hostRef) {
255
- registerInstance(this, hostRef);
256
- this.baccaratSvg = new BaccaratSvg();
257
- this.isBoardInited = false;
258
- this.filledCells = [];
259
- }
260
- gameDetailsHandler(newVal, oldVal) {
261
- if (newVal.isOpen && (!oldVal || !oldVal.isOpen)) {
262
- if (this.showRoundBoard) {
263
- setTimeout(() => {
264
- this.initBaccaratRoundsBoard();
265
- }, 100);
266
- }
255
+ constructor(hostRef) {
256
+ registerInstance(this, hostRef);
257
+ this.baccaratSvg = new BaccaratSvg();
258
+ this.isBoardInited = false;
259
+ this.filledCells = [];
260
+ this.language = undefined;
261
+ this.showRoundBoard = undefined;
262
+ this.gameInfo = undefined;
263
+ this.gameDetails = undefined;
267
264
  }
268
- }
269
- async onGameLoaded(gameInfo) {
270
- var _a;
271
- this.gameInfo = gameInfo;
272
- this.gameDetails = this.gameInfo.details;
273
- (_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameLoaded(this.gameInfo);
274
- }
275
- /**
276
- * Called when received update from updater
277
- * @param details
278
- */
279
- async onGameDetailUpdated(details) {
280
- var _a;
281
- this.gameInfo.details = this.gameDetails = details;
282
- this.gameDetails = Object.assign({}, this.gameDetails);
283
- (_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameDetailUpdated(details);
284
- // init board when the svg board init finished
285
- setTimeout(() => {
286
- this.isBoardInited = true;
287
- }, 200);
288
- }
289
- async onBaccaratResultChanged(result) {
290
- if (!result || !this.baccaratRef || this.isResetingRoundBoard) {
291
- return;
265
+ gameDetailsHandler(newVal, oldVal) {
266
+ if (newVal.isOpen && (!oldVal || !oldVal.isOpen)) {
267
+ if (this.showRoundBoard) {
268
+ setTimeout(() => {
269
+ this.initBaccaratRoundsBoard();
270
+ }, 100);
271
+ }
272
+ }
273
+ }
274
+ async onGameLoaded(gameInfo) {
275
+ var _a;
276
+ this.gameInfo = gameInfo;
277
+ this.gameDetails = this.gameInfo.details;
278
+ (_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameLoaded(this.gameInfo);
292
279
  }
293
- // For Tie round to mark, latestRound
294
- let latestRound, resetRoundBoardCells = () => {
295
- console.log('Reset Baccarat Board.');
296
- this.filledCells = [];
297
- this.baccaratSvg.resetSvg();
298
- latestRound = null;
299
- };
300
- // Reset round board to avoid the reset(result==[]) update come earlier than last round,
301
- // Ignore if the result.length == 0 for temporary
302
- if (this.isBoardInited &&
303
- (result.length == 0 ||
304
- (result.length == 1 &&
305
- (result[0].winner == BaccaratWinner.TIE ||
306
- (result[0].location.column == 0 && result[0].location.row == 0))))) {
307
- this.isResetingRoundBoard = true;
308
- resetRoundBoardCells();
309
- setTimeout(() => {
310
- this.isResetingRoundBoard = false;
311
- }, 1000);
280
+ /**
281
+ * Called when received update from updater
282
+ * @param details
283
+ */
284
+ async onGameDetailUpdated(details) {
285
+ var _a;
286
+ this.gameInfo.details = this.gameDetails = details;
287
+ this.gameDetails = Object.assign({}, this.gameDetails);
288
+ (_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameDetailUpdated(details);
289
+ // init board when the svg board init finished
290
+ setTimeout(() => {
291
+ this.isBoardInited = true;
292
+ }, 200);
312
293
  }
313
- result.forEach((item, i) => {
314
- //Mark the Tie when Tie round is the first cell(0,0)
315
- if (item.winner == BaccaratWinner.TIE) {
316
- if (i == result.length - 1 &&
317
- (!latestRound ||
318
- (latestRound &&
319
- latestRound.location.column == 0 &&
320
- latestRound.location.row == 0))) {
321
- let firstTieCellKey = '0-0-T';
322
- if (this.filledCells.indexOf(firstTieCellKey) == -1) {
323
- this.baccaratSvg.markNewRound(0, 0, Object.assign(Object.assign({}, item), { pairColor: WINNER_COLOR }), this.isBoardInited);
324
- this.filledCells.push(firstTieCellKey);
325
- }
294
+ async onBaccaratResultChanged(result) {
295
+ if (!result || !this.baccaratRef || this.isResetingRoundBoard) {
296
+ return;
297
+ }
298
+ // For Tie round to mark, latestRound
299
+ let latestRound, resetRoundBoardCells = () => {
300
+ console.log('Reset Baccarat Board.');
301
+ this.filledCells = [];
302
+ this.baccaratSvg.resetSvg();
303
+ latestRound = null;
304
+ };
305
+ // Reset round board to avoid the reset(result==[]) update come earlier than last round,
306
+ // Ignore if the result.length == 0 for temporary
307
+ if (this.isBoardInited &&
308
+ (result.length == 0 ||
309
+ (result.length == 1 &&
310
+ (result[0].winner == BaccaratWinner.TIE ||
311
+ (result[0].location.column == 0 && result[0].location.row == 0))))) {
312
+ this.isResetingRoundBoard = true;
313
+ resetRoundBoardCells();
314
+ setTimeout(() => {
315
+ this.isResetingRoundBoard = false;
316
+ }, 1000);
326
317
  }
318
+ result.forEach((item, i) => {
319
+ //Mark the Tie when Tie round is the first cell(0,0)
320
+ if (item.winner == BaccaratWinner.TIE) {
321
+ if (i == result.length - 1 &&
322
+ (!latestRound ||
323
+ (latestRound &&
324
+ latestRound.location.column == 0 &&
325
+ latestRound.location.row == 0))) {
326
+ let firstTieCellKey = '0-0-T';
327
+ if (this.filledCells.indexOf(firstTieCellKey) == -1) {
328
+ this.baccaratSvg.markNewRound(0, 0, Object.assign(Object.assign({}, item), { pairColor: WINNER_COLOR }), this.isBoardInited);
329
+ this.filledCells.push(firstTieCellKey);
330
+ }
331
+ }
332
+ return;
333
+ }
334
+ //cellKey to mark if a round has been marked
335
+ const cellKey = `${item.location.column}-${item.location.row}`;
336
+ const tCellKey = `${cellKey}-T`;
337
+ if (item.ties > 0 && this.filledCells.indexOf(tCellKey) == -1) {
338
+ this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { winner: BaccaratWinner.TIE }), this.isBoardInited);
339
+ this.filledCells.push(tCellKey);
340
+ }
341
+ latestRound = item;
342
+ //If current cell has been filled,duplicated data
343
+ if (this.filledCells.indexOf(cellKey) == -1) {
344
+ this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { pairColor: WINNER_COLOR }), this.isBoardInited);
345
+ this.filledCells.push(cellKey);
346
+ }
347
+ });
327
348
  return;
328
- }
329
- //cellKey to mark if a round has been marked
330
- const cellKey = `${item.location.column}-${item.location.row}`;
331
- const tCellKey = `${cellKey}-T`;
332
- if (item.ties > 0 && this.filledCells.indexOf(tCellKey) == -1) {
333
- this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { winner: BaccaratWinner.TIE }), this.isBoardInited);
334
- this.filledCells.push(tCellKey);
335
- }
336
- latestRound = item;
337
- //If current cell has been filled,duplicated data
338
- if (this.filledCells.indexOf(cellKey) == -1) {
339
- this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { pairColor: WINNER_COLOR }), this.isBoardInited);
340
- this.filledCells.push(cellKey);
341
- }
342
- });
343
- return;
344
- }
345
- initBaccaratRoundsBoard() {
346
- var _a;
347
- this.baccaratSvg.createBaccaratBoard(this.baccaratRef);
348
- if (((_a = this.gameDetails.results) === null || _a === void 0 ? void 0 : _a.length) > 0) {
349
- this.onBaccaratResultChanged(this.gameDetails.results);
350
349
  }
351
- }
352
- render() {
353
- var _a;
354
- return (h(Host, null, h("casino-game-thumbnail-extrainfo", { ref: (el) => (this.infoWrapperRef = el), language: this.language }, ((_a = this.gameDetails) === null || _a === void 0 ? void 0 : _a.isOpen) && this.showRoundBoard && (h("div", { slot: "category-details", class: "LiveIcons", part: "LiveIcons" }, h("div", { id: "boardContainer", part: "BaccaratBoard", class: "BaccaratBoard", ref: (el) => (this.baccaratRef = el) }))))));
355
- }
356
- static get watchers() { return {
357
- "gameDetails": ["gameDetailsHandler"]
358
- }; }
350
+ initBaccaratRoundsBoard() {
351
+ var _a;
352
+ this.baccaratSvg.createBaccaratBoard(this.baccaratRef);
353
+ if (((_a = this.gameDetails.results) === null || _a === void 0 ? void 0 : _a.length) > 0) {
354
+ this.onBaccaratResultChanged(this.gameDetails.results);
355
+ }
356
+ }
357
+ render() {
358
+ var _a;
359
+ return (h(Host, { key: '88be397ce6762f3a57c76c84b40f48dc2ba23db7' }, h("casino-game-thumbnail-extrainfo", { key: '177c57f40ef84d7dfa0f458336e558e195aa9ac6', ref: (el) => (this.infoWrapperRef = el), language: this.language }, ((_a = this.gameDetails) === null || _a === void 0 ? void 0 : _a.isOpen) && this.showRoundBoard && (h("div", { key: '7b2db6ad68e6d9bcac9b97785b2c05b05d146836', slot: "category-details", class: "LiveIcons", part: "LiveIcons" }, h("div", { key: '004301f9c4f9bb574757e4eace077bd9fac57472', id: "boardContainer", part: "BaccaratBoard", class: "BaccaratBoard", ref: (el) => (this.baccaratRef = el) }))))));
360
+ }
361
+ static get watchers() { return {
362
+ "gameDetails": ["gameDetailsHandler"]
363
+ }; }
359
364
  };
360
- CasinoExtrainfoBaccarat.style = casinoExtrainfoBaccaratCss;
365
+ CasinoExtrainfoBaccarat.style = CasinoExtrainfoBaccaratStyle0;
361
366
 
362
367
  export { CasinoExtrainfoBaccarat as casino_extrainfo_baccarat };