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