@everymatrix/lottery-oddsbom-latest-result 0.0.1

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 (61) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-1c32912a.js +1265 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/lottery-oddsbom-bullet_4.cjs.entry.js +3153 -0
  6. package/dist/cjs/lottery-oddsbom-latest-result-04622cbf.js +634 -0
  7. package/dist/cjs/lottery-oddsbom-latest-result.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +31 -0
  9. package/dist/collection/components/lottery-oddsbom-latest-result/index.js +1 -0
  10. package/dist/collection/components/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result.css +100 -0
  11. package/dist/collection/components/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result.js +470 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/models/index.js +1 -0
  14. package/dist/collection/utils/api.js +36 -0
  15. package/dist/collection/utils/locale.utils.js +49 -0
  16. package/dist/collection/utils/utils.js +191 -0
  17. package/dist/esm/app-globals-0f993ce5.js +3 -0
  18. package/dist/esm/index-0068c174.js +1237 -0
  19. package/dist/esm/index.js +2 -0
  20. package/dist/esm/loader.js +11 -0
  21. package/dist/esm/lottery-oddsbom-bullet_4.entry.js +3147 -0
  22. package/dist/esm/lottery-oddsbom-latest-result-825abc49.js +626 -0
  23. package/dist/esm/lottery-oddsbom-latest-result.js +20 -0
  24. package/dist/index.cjs.js +1 -0
  25. package/dist/index.js +1 -0
  26. package/dist/lottery-oddsbom-latest-result/app-globals-0f993ce5.js +1 -0
  27. package/dist/lottery-oddsbom-latest-result/index-0068c174.js +2 -0
  28. package/dist/lottery-oddsbom-latest-result/index.esm.js +1 -0
  29. package/dist/lottery-oddsbom-latest-result/lottery-oddsbom-bullet_4.entry.js +1 -0
  30. package/dist/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result-825abc49.js +1 -0
  31. package/dist/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result.esm.js +1 -0
  32. package/dist/stencil.config.dev.js +19 -0
  33. package/dist/stencil.config.js +19 -0
  34. package/dist/storybook/main.js +43 -0
  35. package/dist/storybook/preview.js +9 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/packages/stencil/lottery-oddsbom-latest-result/stencil.config.d.ts +2 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/packages/stencil/lottery-oddsbom-latest-result/stencil.config.dev.d.ts +2 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/packages/stencil/lottery-oddsbom-latest-result/storybook/main.d.ts +3 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/packages/stencil/lottery-oddsbom-latest-result/storybook/preview.d.ts +70 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/tools/plugins/index.d.ts +4 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-latest-result/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  46. package/dist/types/components/lottery-oddsbom-latest-result/index.d.ts +1 -0
  47. package/dist/types/components/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result.d.ts +67 -0
  48. package/dist/types/components.d.ts +115 -0
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/models/index.d.ts +172 -0
  51. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  52. package/dist/types/utils/api.d.ts +14 -0
  53. package/dist/types/utils/locale.utils.d.ts +3 -0
  54. package/dist/types/utils/utils.d.ts +8 -0
  55. package/loader/cdn.js +1 -0
  56. package/loader/index.cjs.js +1 -0
  57. package/loader/index.d.ts +24 -0
  58. package/loader/index.es2017.js +1 -0
  59. package/loader/index.js +2 -0
  60. package/loader/package.json +11 -0
  61. package/package.json +27 -0
@@ -0,0 +1,31 @@
1
+ {
2
+ "entries": [
3
+ "components/lottery-oddsbom-latest-result/lottery-oddsbom-latest-result.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.19.2",
8
+ "typescriptVersion": "5.4.5"
9
+ },
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/lottery-oddsbom-bullet",
13
+ "tags": [
14
+ "lottery-oddsbom-bullet"
15
+ ]
16
+ },
17
+ {
18
+ "name": "@everymatrix/lottery-oddsbom-ticket-result",
19
+ "tags": [
20
+ "lottery-oddsbom-ticket-result"
21
+ ]
22
+ },
23
+ {
24
+ "name": "@everymatrix/ui-skeleton",
25
+ "tags": [
26
+ "ui-skeleton"
27
+ ]
28
+ }
29
+ ],
30
+ "bundles": []
31
+ }
@@ -0,0 +1 @@
1
+ export { LotteryOddsbomLatestResult } from './lottery-oddsbom-latest-result';
@@ -0,0 +1,100 @@
1
+ .lottery-tipping-latest-result {
2
+ container-type: inline-size;
3
+ background: var(--emw--color-background, #fff);
4
+ color: var(--emw--color-typography, #000);
5
+ }
6
+ .lottery-tipping-latest-result .header-section {
7
+ display: flex;
8
+ justify-content: center;
9
+ align-items: center;
10
+ }
11
+ .lottery-tipping-latest-result .match-info-section {
12
+ justify-content: space-between;
13
+ padding: 15px 0px;
14
+ height: 18px;
15
+ }
16
+ .lottery-tipping-latest-result .match-details,
17
+ .lottery-tipping-latest-result .prize-details {
18
+ font-weight: 600;
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+ .lottery-tipping-latest-result .match-details .title-icon {
23
+ margin-right: 8px;
24
+ display: flex;
25
+ }
26
+ .lottery-tipping-latest-result .match-details .title-text__extra {
27
+ margin-left: 5px;
28
+ }
29
+ .lottery-tipping-latest-result .prize-details .winners-count {
30
+ margin-right: 5px;
31
+ }
32
+
33
+ .loading-wrap {
34
+ margin: 20px 0;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ min-height: 100px;
39
+ }
40
+ .loading-wrap .dots-container {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ height: 100%;
45
+ width: 100%;
46
+ }
47
+ .loading-wrap .dot {
48
+ height: 14px;
49
+ width: 14px;
50
+ margin-right: 14px;
51
+ border-radius: 14px;
52
+ background-color: var(--emw--color-gray-300, #333);
53
+ animation: pulse 1.5s infinite ease-in-out;
54
+ }
55
+ .loading-wrap .dot:last-child {
56
+ margin-right: 0;
57
+ }
58
+ .loading-wrap .dot:nth-child(1) {
59
+ animation-delay: -0.3s;
60
+ }
61
+ .loading-wrap .dot:nth-child(2) {
62
+ animation-delay: -0.1s;
63
+ }
64
+ .loading-wrap .dot:nth-child(3) {
65
+ animation-delay: 0.1s;
66
+ }
67
+ @keyframes pulse {
68
+ 0% {
69
+ transform: scale(0.8);
70
+ background-color: var(--emw--color-gray-300, #333);
71
+ }
72
+ 50% {
73
+ transform: scale(1.2);
74
+ background-color: var(--emw--color-gray-100, #e6e6e6);
75
+ }
76
+ 100% {
77
+ transform: scale(0.8);
78
+ background-color: var(--emw--color-gray-150, #6f6f6f);
79
+ }
80
+ }
81
+
82
+ .latest-result-wrapper {
83
+ background: var(--emw--color-background, #fff);
84
+ }
85
+ .latest-result-wrapper.game-wrapper {
86
+ border: 1px solid var(--emw--color-background-tertiary, #ccc);
87
+ border-radius: 8px;
88
+ box-shadow: 0 2px 4px var(--emw--color-background-tertiary, #ccc);
89
+ overflow-x: auto;
90
+ transition: box-shadow 0.3s ease;
91
+ padding: 20px;
92
+ }
93
+ .latest-result-wrapper.game-wrapper:hover {
94
+ box-shadow: 0 4px 12px var(--emw--color-background-tertiary, #ccc);
95
+ }
96
+
97
+ .loading-turnOver {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ }
@@ -0,0 +1,470 @@
1
+ import "../../../../../lottery-oddsbom-ticket-result/dist/types/index";
2
+ import { h } from "@stencil/core";
3
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
+ import { fetchDrawsInfo, fetchGameInfo, fetchSaleStatistics } from "../../utils/api";
5
+ import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
6
+ import { changeCurDrawItemByDate, findLatestDateIdx, thousandSeparator } from "../../utils/utils";
7
+ import "../../../../../ui-skeleton/dist/types/index";
8
+ const BombIcons = {
9
+ ['Football']: (h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.063 19.072l-.81-.97-.117.083.385-2.43.136-.211 2.23-3.464.037-.057h1.075a9.964 9.964 0 01-2.936 7.049zM4.769 5.112l2.8.877-.072 3.246-2.427 2.95-1.561-.153L2.39 9.26a9.977 9.977 0 012.378-4.148zm7.745-3.086l-.72 1.645-3.798 1.404-2.395-.75A9.953 9.953 0 0112 2c.174 0 .343.017.514.026zm7.346 3.812l-1.128 1.29-3.402-.755-.033-.008-2.446-2.241.057.016.862-1.973a9.996 9.996 0 016.09 3.67zm-1.87 8.894l-3.385-.493-1.358-4.067 2.173-2.755 3.144.698 1.347 3.634-1.921 2.983zm-4.64 5.787l4.304-1.486.62.742a9.945 9.945 0 01-5.878 2.205l.954-1.461zm-6.314-2.84l3.91.873-.001.003 1.509 1.507-1.24 1.898a9.946 9.946 0 01-5.908-2.553l1.73-1.728zm1.16-7.72l4.168.725 1.302 3.9-2.552 2.98-3.97-.885-1.412-3.724L8.196 9.96zM2 12c0-.31.019-.615.047-.92l.485 1.203-.454.907A9.934 9.934 0 012 11.999zM12 1C5.934 1 1 5.935 1 12c0 6.067 4.935 11 11 11 6.066 0 11-4.933 11-11 0-6.065-4.934-11-11-11z", fill: "currentColor" })))
10
+ };
11
+ export class LotteryOddsbomLatestResult {
12
+ constructor() {
13
+ this.mbSource = undefined;
14
+ this.clientStyling = undefined;
15
+ this.clientStylingUrl = undefined;
16
+ this.translationUrl = '';
17
+ this.language = 'en';
18
+ this.endpoint = undefined;
19
+ this.gameId = undefined;
20
+ this.curDate = undefined;
21
+ this.showLoading = true;
22
+ this.hideWrapperEmpty = false;
23
+ this.isPassingData = false;
24
+ this.drawResults = '';
25
+ this.isEmpty = true;
26
+ this._curDate = undefined;
27
+ this.drawResultsList = [];
28
+ this.curDrawItem = {};
29
+ this.curTurnOver = 0;
30
+ this.isLoadingTurnover = false;
31
+ this.vendorGameId = undefined;
32
+ this.gameName = undefined;
33
+ this.isLoading = false;
34
+ }
35
+ handleClientStylingChange(newValue, oldValue) {
36
+ if (newValue != oldValue) {
37
+ setClientStyling(this.stylingContainer, this.clientStyling);
38
+ }
39
+ }
40
+ handleClientStylingUrlChange(newValue, oldValue) {
41
+ if (newValue != oldValue) {
42
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
43
+ }
44
+ }
45
+ handleMbSourceChange(newValue, oldValue) {
46
+ if (newValue != oldValue) {
47
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
48
+ }
49
+ }
50
+ async handleDateChange(n, o) {
51
+ if (n !== o) {
52
+ await this.setCurItem(n);
53
+ if (this.curDrawItem && this.curDrawItem.drawId) {
54
+ this.getTurnOver();
55
+ }
56
+ }
57
+ }
58
+ async handleDrawResultsChange(n, o) {
59
+ if (n !== o) {
60
+ await this.setDrawResults();
61
+ }
62
+ }
63
+ async getTurnOver() {
64
+ var _a, _b;
65
+ try {
66
+ this.isLoadingTurnover = true;
67
+ const res = await fetchSaleStatistics({
68
+ endpoint: this.endpoint,
69
+ gameId: this.vendorGameId,
70
+ drawId: this.curDrawItem.drawId
71
+ });
72
+ this.curTurnOver = (_b = (_a = res === null || res === void 0 ? void 0 : res.wagerSegment) === null || _a === void 0 ? void 0 : _a.totalSalesCrossDraw) !== null && _b !== void 0 ? _b : 0;
73
+ }
74
+ catch (e) {
75
+ console.error(e);
76
+ }
77
+ finally {
78
+ this.isLoadingTurnover = false;
79
+ }
80
+ }
81
+ get formattedTurnover() {
82
+ const turnover = this.curTurnOver;
83
+ const unit = '€';
84
+ if (turnover === null || turnover === undefined)
85
+ return '';
86
+ return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
87
+ }
88
+ async setCurItem(curDate) {
89
+ var _a;
90
+ try {
91
+ if (curDate && ((_a = this.drawResultsList) === null || _a === void 0 ? void 0 : _a.length)) {
92
+ this.curDrawItem = await changeCurDrawItemByDate(curDate, this.drawResultsList);
93
+ this.isEmpty = false;
94
+ }
95
+ else {
96
+ this.isEmpty = true;
97
+ }
98
+ }
99
+ catch (_b) {
100
+ this.isEmpty = true;
101
+ }
102
+ }
103
+ async setDrawResults() {
104
+ try {
105
+ if (this.drawResults) {
106
+ this.drawResultsList = JSON.parse(this.drawResults);
107
+ await this.setCurItem(this.curDate);
108
+ }
109
+ }
110
+ catch (err) {
111
+ console.error(err);
112
+ }
113
+ }
114
+ componentDidLoad() {
115
+ if (this.stylingContainer) {
116
+ if (this.mbSource)
117
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
118
+ if (this.clientStyling)
119
+ setClientStyling(this.stylingContainer, this.clientStyling);
120
+ if (this.clientStylingUrl)
121
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
122
+ }
123
+ }
124
+ disconnectedCallback() {
125
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
126
+ }
127
+ async getDrawData() {
128
+ if (this.isPassingData) {
129
+ this.setDrawResults();
130
+ }
131
+ else {
132
+ this.fetchData();
133
+ }
134
+ }
135
+ async getGameInfo() {
136
+ return fetchGameInfo({ endpoint: this.endpoint, gameId: this.gameId }).then(({ vendorGameId, gameName }) => {
137
+ this.vendorGameId = vendorGameId;
138
+ this.gameName = gameName;
139
+ });
140
+ }
141
+ async componentWillLoad() {
142
+ resolveTranslationUrl(this.translationUrl);
143
+ await Promise.all([this.getDrawData(), this.getGameInfo()]);
144
+ if (this.curDrawItem && this.curDrawItem.drawId) {
145
+ this.getTurnOver();
146
+ }
147
+ }
148
+ async fetchData() {
149
+ this.isLoading = true;
150
+ try {
151
+ const res = await fetchDrawsInfo({ endpoint: this.endpoint, gameId: this.gameId });
152
+ this.getGameDrawInfoEvent.emit({
153
+ drawDatesOptions: res.drawDatesOptions,
154
+ gameId: this.gameId
155
+ });
156
+ this.drawResultsList = res.drawResultsList;
157
+ this._curDate = res.drawDatesOptions[findLatestDateIdx(res.drawDatesOptions)];
158
+ await this.setCurItem(this._curDate);
159
+ }
160
+ catch (error) {
161
+ this.getGameDrawInfoEvent.emit({
162
+ drawDatesOptions: [],
163
+ gameId: this.gameId
164
+ });
165
+ }
166
+ finally {
167
+ this.isLoading = false;
168
+ }
169
+ }
170
+ renderLoading() {
171
+ return (h("div", { class: "loading-wrap" }, h("section", { class: "dots-container" }, h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }))));
172
+ }
173
+ renderEmpty() {
174
+ return null;
175
+ }
176
+ renderMainContent() {
177
+ var _a, _b, _c, _d, _e, _f;
178
+ if (!(this.curDate || this._curDate) || this.isEmpty) {
179
+ return this.renderEmpty();
180
+ }
181
+ return (h("div", { class: "lottery-tipping-latest-result" }, h("div", { class: "header-section match-info-section" }, h("div", { class: "match-details" }, h("span", { class: "title-icon" }, BombIcons.Football), h("span", { class: "title-text" }, this.gameName, ' ', this.isLoadingTurnover ? (h("div", { class: "loading-turnOver" }, h("ui-skeleton", { structure: "rectangle", width: "100px", height: "16px" }))) : (h("span", { class: "title-text__extra" }, "(", translate('turnover', this.language) + ' ' + this.formattedTurnover || 0, ")")))), h("div", { class: "prize-details" }, h("span", { class: "winners-count" }, (((_a = this.curDrawItem) === null || _a === void 0 ? void 0 : _a.winNumber) || 0) + ' ' + translate('winners', this.language)), h("span", { class: "prize-amount" }, translate('prize', this.language) + ' ' + (((_b = this.curDrawItem) === null || _b === void 0 ? void 0 : _b.formattedWinTurnOver) || 0)))), !!(((_c = this.curDrawItem) === null || _c === void 0 ? void 0 : _c.drawId) || (((_d = this.curDrawItem) === null || _d === void 0 ? void 0 : _d.results) || []).length) && (h("lottery-oddsbom-ticket-result", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, endpoint: this.endpoint, "game-id": this.vendorGameId, "draw-id": (_e = this.curDrawItem) === null || _e === void 0 ? void 0 : _e.drawId, "default-results": JSON.stringify(((_f = this.curDrawItem) === null || _f === void 0 ? void 0 : _f.results) || []), "split-view": false }))));
182
+ }
183
+ render() {
184
+ return (h("div", { key: '08c7308433c4d55f4cec1540002a03596155fe98', ref: (el) => (this.stylingContainer = el), class: {
185
+ 'latest-result-wrapper': true,
186
+ 'game-wrapper': !(this.hideWrapperEmpty && this.isEmpty)
187
+ } }, this.isLoading && this.showLoading ? this.renderLoading() : this.renderMainContent()));
188
+ }
189
+ static get is() { return "lottery-oddsbom-latest-result"; }
190
+ static get encapsulation() { return "shadow"; }
191
+ static get originalStyleUrls() {
192
+ return {
193
+ "$": ["lottery-oddsbom-latest-result.scss"]
194
+ };
195
+ }
196
+ static get styleUrls() {
197
+ return {
198
+ "$": ["lottery-oddsbom-latest-result.css"]
199
+ };
200
+ }
201
+ static get properties() {
202
+ return {
203
+ "mbSource": {
204
+ "type": "string",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "string",
208
+ "resolved": "string",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": false,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": "Client custom styling via message bus"
216
+ },
217
+ "attribute": "mb-source",
218
+ "reflect": true
219
+ },
220
+ "clientStyling": {
221
+ "type": "string",
222
+ "mutable": false,
223
+ "complexType": {
224
+ "original": "string",
225
+ "resolved": "string",
226
+ "references": {}
227
+ },
228
+ "required": false,
229
+ "optional": false,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": "Client custom styling via string"
233
+ },
234
+ "attribute": "client-styling",
235
+ "reflect": true
236
+ },
237
+ "clientStylingUrl": {
238
+ "type": "string",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "string",
242
+ "resolved": "string",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": "Client custom styling via css file url"
250
+ },
251
+ "attribute": "client-styling-url",
252
+ "reflect": true
253
+ },
254
+ "translationUrl": {
255
+ "type": "string",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "string",
259
+ "resolved": "string",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": "Client custom translation via json file url"
267
+ },
268
+ "attribute": "translation-url",
269
+ "reflect": true,
270
+ "defaultValue": "''"
271
+ },
272
+ "language": {
273
+ "type": "string",
274
+ "mutable": false,
275
+ "complexType": {
276
+ "original": "string",
277
+ "resolved": "string",
278
+ "references": {}
279
+ },
280
+ "required": false,
281
+ "optional": false,
282
+ "docs": {
283
+ "tags": [],
284
+ "text": "Client custom language for translation"
285
+ },
286
+ "attribute": "language",
287
+ "reflect": true,
288
+ "defaultValue": "'en'"
289
+ },
290
+ "endpoint": {
291
+ "type": "string",
292
+ "mutable": false,
293
+ "complexType": {
294
+ "original": "string",
295
+ "resolved": "string",
296
+ "references": {}
297
+ },
298
+ "required": false,
299
+ "optional": false,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": ""
303
+ },
304
+ "attribute": "endpoint",
305
+ "reflect": true
306
+ },
307
+ "gameId": {
308
+ "type": "string",
309
+ "mutable": false,
310
+ "complexType": {
311
+ "original": "string",
312
+ "resolved": "string",
313
+ "references": {}
314
+ },
315
+ "required": false,
316
+ "optional": false,
317
+ "docs": {
318
+ "tags": [],
319
+ "text": "GameID of the game"
320
+ },
321
+ "attribute": "game-id",
322
+ "reflect": true
323
+ },
324
+ "curDate": {
325
+ "type": "string",
326
+ "mutable": false,
327
+ "complexType": {
328
+ "original": "string",
329
+ "resolved": "string",
330
+ "references": {}
331
+ },
332
+ "required": false,
333
+ "optional": false,
334
+ "docs": {
335
+ "tags": [],
336
+ "text": ""
337
+ },
338
+ "attribute": "cur-date",
339
+ "reflect": true
340
+ },
341
+ "showLoading": {
342
+ "type": "boolean",
343
+ "mutable": false,
344
+ "complexType": {
345
+ "original": "boolean",
346
+ "resolved": "boolean",
347
+ "references": {}
348
+ },
349
+ "required": false,
350
+ "optional": false,
351
+ "docs": {
352
+ "tags": [],
353
+ "text": ""
354
+ },
355
+ "attribute": "show-loading",
356
+ "reflect": true,
357
+ "defaultValue": "true"
358
+ },
359
+ "hideWrapperEmpty": {
360
+ "type": "boolean",
361
+ "mutable": false,
362
+ "complexType": {
363
+ "original": "boolean",
364
+ "resolved": "boolean",
365
+ "references": {}
366
+ },
367
+ "required": false,
368
+ "optional": false,
369
+ "docs": {
370
+ "tags": [],
371
+ "text": ""
372
+ },
373
+ "attribute": "hide-wrapper-empty",
374
+ "reflect": true,
375
+ "defaultValue": "false"
376
+ },
377
+ "isPassingData": {
378
+ "type": "boolean",
379
+ "mutable": false,
380
+ "complexType": {
381
+ "original": "boolean",
382
+ "resolved": "boolean",
383
+ "references": {}
384
+ },
385
+ "required": false,
386
+ "optional": false,
387
+ "docs": {
388
+ "tags": [],
389
+ "text": ""
390
+ },
391
+ "attribute": "is-passing-data",
392
+ "reflect": true,
393
+ "defaultValue": "false"
394
+ },
395
+ "drawResults": {
396
+ "type": "string",
397
+ "mutable": false,
398
+ "complexType": {
399
+ "original": "string",
400
+ "resolved": "string",
401
+ "references": {}
402
+ },
403
+ "required": false,
404
+ "optional": false,
405
+ "docs": {
406
+ "tags": [],
407
+ "text": ""
408
+ },
409
+ "attribute": "draw-results",
410
+ "reflect": true,
411
+ "defaultValue": "''"
412
+ }
413
+ };
414
+ }
415
+ static get states() {
416
+ return {
417
+ "isEmpty": {},
418
+ "_curDate": {},
419
+ "drawResultsList": {},
420
+ "curDrawItem": {},
421
+ "curTurnOver": {},
422
+ "isLoadingTurnover": {},
423
+ "vendorGameId": {},
424
+ "gameName": {},
425
+ "isLoading": {}
426
+ };
427
+ }
428
+ static get events() {
429
+ return [{
430
+ "method": "getGameDrawInfoEvent",
431
+ "name": "getGameDrawInfo",
432
+ "bubbles": true,
433
+ "cancelable": true,
434
+ "composed": true,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": ""
438
+ },
439
+ "complexType": {
440
+ "original": "GetGameDrawInfo",
441
+ "resolved": "GetGameDrawInfo",
442
+ "references": {
443
+ "GetGameDrawInfo": {
444
+ "location": "import",
445
+ "path": "../../models",
446
+ "id": "../../../../packages/stencil/lottery-oddsbom-latest-result/src/models/index.ts::GetGameDrawInfo"
447
+ }
448
+ }
449
+ }
450
+ }];
451
+ }
452
+ static get watchers() {
453
+ return [{
454
+ "propName": "clientStyling",
455
+ "methodName": "handleClientStylingChange"
456
+ }, {
457
+ "propName": "clientStylingUrl",
458
+ "methodName": "handleClientStylingUrlChange"
459
+ }, {
460
+ "propName": "mbSource",
461
+ "methodName": "handleMbSourceChange"
462
+ }, {
463
+ "propName": "curDate",
464
+ "methodName": "handleDateChange"
465
+ }, {
466
+ "propName": "drawResults",
467
+ "methodName": "handleDrawResultsChange"
468
+ }];
469
+ }
470
+ }
@@ -0,0 +1 @@
1
+ export * from './components/lottery-oddsbom-latest-result';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import { fetchRequest, toQueryParams } from "./utils";
2
+ export async function fetchGameInfo({ endpoint, gameId }) {
3
+ if (!(endpoint && gameId))
4
+ return;
5
+ const gameInfo = await fetchRequest(`${endpoint}/games/${gameId}`, 'GET', {});
6
+ return {
7
+ vendorGameId: gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.type,
8
+ gameName: gameInfo.name
9
+ };
10
+ }
11
+ export async function fetchDrawsInfo({ endpoint, gameId }) {
12
+ if (!(endpoint && gameId))
13
+ return;
14
+ const GAME_DRAW_LIMIT = 9999;
15
+ const filterData = { status: 'PAYABLE', limit: GAME_DRAW_LIMIT };
16
+ const { items: drawList } = await fetchRequest(`${endpoint}/games/${gameId}/draws${toQueryParams(filterData)}`);
17
+ if (!drawList || drawList.length === 0)
18
+ return {};
19
+ const settledDrawList = drawList
20
+ .filter((item) => item.winningNumbers.length > 0)
21
+ .sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
22
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
23
+ return {
24
+ drawDatesOptions,
25
+ drawResultsList: settledDrawList
26
+ };
27
+ }
28
+ export async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
29
+ try {
30
+ const res = await fetchRequest(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
31
+ return res;
32
+ }
33
+ catch (error) {
34
+ return Promise.reject(error);
35
+ }
36
+ }