@everymatrix/lottery-oddsbom-entrance 0.3.21 → 0.3.23

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 (23) hide show
  1. package/dist/cjs/{lottery-oddsbom-bomb_2.cjs.entry.js → helper-date-navigator_8.cjs.entry.js} +1867 -20
  2. package/dist/cjs/{index-b0be9007.js → index-4e91c0c2.js} +36 -3
  3. package/dist/cjs/index.cjs.js +2 -3
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{lottery-oddsbom-entrance-fde5744a.js → lottery-oddsbom-entrance-43e12a01.js} +1 -2
  6. package/dist/cjs/lottery-oddsbom-entrance.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +36 -0
  8. package/dist/collection/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.js +1 -1
  9. package/dist/esm/{lottery-oddsbom-bomb_2.entry.js → helper-date-navigator_8.entry.js} +1863 -22
  10. package/dist/esm/{index-275ec96c.js → index-068e610e.js} +36 -4
  11. package/dist/esm/index.js +2 -3
  12. package/dist/esm/loader.js +3 -3
  13. package/dist/esm/{lottery-oddsbom-entrance-6d1d6ae1.js → lottery-oddsbom-entrance-cfee08e8.js} +1 -2
  14. package/dist/esm/lottery-oddsbom-entrance.js +3 -3
  15. package/dist/lottery-oddsbom-entrance/helper-date-navigator_8.entry.js +1 -0
  16. package/dist/lottery-oddsbom-entrance/index-068e610e.js +2 -0
  17. package/dist/lottery-oddsbom-entrance/index.esm.js +1 -1
  18. package/dist/lottery-oddsbom-entrance/{lottery-oddsbom-entrance-6d1d6ae1.js → lottery-oddsbom-entrance-cfee08e8.js} +1 -1
  19. package/dist/lottery-oddsbom-entrance/lottery-oddsbom-entrance.esm.js +1 -1
  20. package/dist/types/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/dist/lottery-oddsbom-entrance/index-275ec96c.js +0 -2
  23. package/dist/lottery-oddsbom-entrance/lottery-oddsbom-bomb_2.entry.js +0 -1
@@ -1,7 +1,356 @@
1
- import { h, r as registerInstance, c as createEvent, g as getAssetPath } from './index-275ec96c.js';
2
- import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-oddsbom-entrance-6d1d6ae1.js';
3
- export { L as lottery_oddsbom_entrance } from './lottery-oddsbom-entrance-6d1d6ae1.js';
4
- import '@everymatrix/lottery-oddsbom-latest-result-group';
1
+ import { r as registerInstance, c as createEvent, h, g as getAssetPath, H as Host } from './index-068e610e.js';
2
+ import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-oddsbom-entrance-cfee08e8.js';
3
+ export { L as lottery_oddsbom_entrance } from './lottery-oddsbom-entrance-cfee08e8.js';
4
+
5
+ // This icon file is generated automatically.
6
+ var CalendarOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, "name": "calendar", "theme": "outlined" };
7
+ const CalendarOutlined$1 = CalendarOutlined;
8
+
9
+ // This icon file is generated automatically.
10
+ var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
11
+ const DeleteFilled$1 = DeleteFilled;
12
+
13
+ // This icon file is generated automatically.
14
+ var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
15
+ const LeftOutlined$1 = LeftOutlined;
16
+
17
+ // This icon file is generated automatically.
18
+ var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
19
+ const RightOutlined$1 = RightOutlined;
20
+
21
+ var __assign = (undefined && undefined.__assign) || function () {
22
+ __assign = Object.assign || function(t) {
23
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
24
+ s = arguments[i];
25
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26
+ t[p] = s[p];
27
+ }
28
+ return t;
29
+ };
30
+ return __assign.apply(this, arguments);
31
+ };
32
+ var defaultColors = {
33
+ primaryColor: '#333',
34
+ secondaryColor: '#E6E6E6'
35
+ };
36
+ function renderIconDefinitionToSVGElement(icond, options) {
37
+ if (options === void 0) { options = {}; }
38
+ if (typeof icond.icon === 'function') {
39
+ // two-tone
40
+ var placeholders = options.placeholders || defaultColors;
41
+ return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
42
+ }
43
+ // fill, outline
44
+ return renderAbstractNodeToSVGElement(icond.icon, options);
45
+ }
46
+ function renderAbstractNodeToSVGElement(node, options) {
47
+ var targetAttrs = node.tag === 'svg'
48
+ ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
49
+ var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
50
+ var key = nextKey;
51
+ var value = targetAttrs[key];
52
+ var token = "".concat(key, "=\"").concat(value, "\"");
53
+ acc.push(token);
54
+ return acc;
55
+ }, []);
56
+ var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
57
+ var children = (node.children || [])
58
+ .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
59
+ .join('');
60
+ if (children && children.length) {
61
+ return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
62
+ }
63
+ return "<".concat(node.tag).concat(attrsToken, " />");
64
+ }
65
+
66
+ const DEFAULT_LANGUAGE$3 = 'en';
67
+ const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
68
+ const TRANSLATIONS$3 = {
69
+ en: {
70
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
71
+ },
72
+ };
73
+ const translate$3 = (key, customLang, replacements) => {
74
+ const lang = customLang;
75
+ let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
76
+ if (replacements) {
77
+ Object.keys(replacements).forEach((placeholder) => {
78
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
79
+ });
80
+ }
81
+ return translation;
82
+ };
83
+ const getTranslations$2 = (data) => {
84
+ Object.keys(data).forEach((item) => {
85
+ for (let key in data[item]) {
86
+ TRANSLATIONS$3[item][key] = data[item][key];
87
+ }
88
+ });
89
+ };
90
+ const resolveTranslationUrl$2 = async (translationUrl) => {
91
+ if (translationUrl) {
92
+ try {
93
+ const response = await fetch(translationUrl);
94
+ if (!response.ok) {
95
+ throw new Error(`HTTP error! status: ${response.status}`);
96
+ }
97
+ const translations = await response.json();
98
+ getTranslations$2(translations);
99
+ }
100
+ catch (error) {
101
+ console.error('Failed to fetch or parse translations from URL:', error);
102
+ }
103
+ }
104
+ };
105
+
106
+ const helperDateNavigatorCss = ".lottery-tipping-calendar{position:relative;display:inline-block}.calendar-visible{opacity:1;visibility:visible}.calendar-leave{opacity:0;visibility:hidden}.calendar{position:absolute;top:40px;left:-50%;background:var(--emw--color-background, #fff);color:var(--emw--color-typography-secondary, #6f6f6f);padding:16px;width:fit-content;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.1);cursor:pointer;transition:opacity 0.2s ease, visibility 0.2s ease;z-index:99}.calendar-header{display:flex;align-items:center}.calendar-header .date-picker{display:flex;margin:0 18px;align-items:center}.calendar-header .date-picker-delimiter{font-size:16px;margin:auto 4px}.calendar-header .month-plus,.calendar-header .month-minus,.calendar-header .year-plus,.calendar-header .year-minus{cursor:pointer;font-size:14px}.calendar-header .month-plus:hover,.calendar-header .month-minus:hover,.calendar-header .year-plus:hover,.calendar-header .year-minus:hover{color:var(--emw-pool-game-acition-active, #005fdb);transition:color 0.2s}.calendar-header .year-minus,.calendar-header .month-plus{margin-right:6px}.calendar-content{padding:3px;width:fit-content}.calendar-content .day-item{text-align:center;line-height:40px;cursor:not-allowed;position:relative;pointer-events:none}.calendar-content .day-item:hover{background-color:var(--emw--color-background-secondary, #f5f5f5)}.calendar-content .day-item.isCurDay{border-radius:4px;background:var(--emw--color-secondary, #fff3b9);background-size:50%;color:var(--emw--color-typography-secondary, #6f6f6f);font-weight:600;box-shadow:2px 2px 2px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight{cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight::after{content:\"\";position:absolute;left:calc(50% - 4px);bottom:0;width:6px;height:6px;border-radius:50%;background-color:var(--emw--color-error, red)}.calendar-content-week{display:grid;grid-template-columns:repeat(7, 40px);grid-template-rows:repeat(1, 36px);justify-items:center;align-items:center;border-bottom:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-typography-secondary, #6f6f6f)}.calendar-content-day{margin-top:4px;display:grid;grid-template-rows:repeat(6, 40px);grid-template-columns:repeat(7, 40px)}.calling-input{height:36px;width:160px;display:flex;align-items:center;justify-content:space-between;padding:0px 4px;background-color:var(--emw--color-background, #f5f5f5);border-radius:var(--emw--border-radius-small, 4px);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));cursor:pointer}.calling-input .input{color:var(--emw--color-typography, #000)}.calling-input-text{color:var(--emw--color-typography, #000)}.date-selection{display:flex;align-items:center;justify-content:center;gap:24px}.date-selection-leftIcon,.date-selection-rightIcon{cursor:pointer;color:var(--emw--color-typography, #000)}";
107
+ const HelperDateNavigatorStyle0 = helperDateNavigatorCss;
108
+
109
+ const leftArrowIcon = renderIconDefinitionToSVGElement(LeftOutlined$1, {
110
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
111
+ });
112
+ const rightArrowIcon = renderIconDefinitionToSVGElement(RightOutlined$1, {
113
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
114
+ });
115
+ const calendarIcon = renderIconDefinitionToSVGElement(CalendarOutlined$1, {
116
+ extraSVGAttrs: { width: '18px', height: '18px', fill: 'var(--emw--color-primary-variant, #1367e7)' }
117
+ });
118
+ const HelperDateNavigator = class {
119
+ constructor(hostRef) {
120
+ registerInstance(this, hostRef);
121
+ this.changeDate = createEvent(this, "changeDate", 7);
122
+ this.handleNext = createEvent(this, "next", 7);
123
+ this.handlePrev = createEvent(this, "prev", 7);
124
+ this.handleOutsideClick = (event) => {
125
+ if (!this.showCalendar)
126
+ return;
127
+ const path = event.composedPath ? event.composedPath() : [];
128
+ // check if clicked on calendar
129
+ const isCalendarClick = path.includes(this.calendarRef);
130
+ // check if click select option
131
+ const isSelectOption = path.some((el) => {
132
+ var _a, _b;
133
+ return el instanceof HTMLElement &&
134
+ (((_a = el.getAttribute('part')) === null || _a === void 0 ? void 0 : _a.includes('item')) || ((_b = el.getAttribute('part')) === null || _b === void 0 ? void 0 : _b.includes('overlay')));
135
+ });
136
+ if (!isCalendarClick && !isSelectOption) {
137
+ this.showCalendar = false;
138
+ }
139
+ };
140
+ this.onYearMinus = () => {
141
+ const years = this.yearOptions.map((item) => Number(item.value));
142
+ if (this.alterDate.year - 1 < Math.min(...years))
143
+ return;
144
+ this.alterDate.year--;
145
+ this.loadRecords();
146
+ };
147
+ this.onYearPlus = () => {
148
+ const years = this.yearOptions.map((item) => Number(item.value));
149
+ if (this.alterDate.year + 1 > Math.max(...years))
150
+ return;
151
+ this.alterDate.year++;
152
+ this.loadRecords();
153
+ };
154
+ this.onMonthMinus = () => {
155
+ if (this.alterDate.month === 0) {
156
+ this.onYearMinus();
157
+ this.alterDate.month = 11;
158
+ }
159
+ else {
160
+ this.alterDate.month--;
161
+ this.loadRecords();
162
+ }
163
+ };
164
+ this.onMonthPlus = () => {
165
+ if (this.alterDate.month === 11) {
166
+ this.onYearPlus();
167
+ this.alterDate.month = 0;
168
+ }
169
+ else {
170
+ this.alterDate.month++;
171
+ this.loadRecords();
172
+ }
173
+ };
174
+ this.onYearChange = (e) => {
175
+ this.alterDate.year = parseInt(e.detail.value);
176
+ this.loadRecords();
177
+ };
178
+ this.onMonthChange = (e) => {
179
+ this.alterDate.month = parseInt(e.detail.value) - 1;
180
+ this.loadRecords();
181
+ };
182
+ this.mbSource = undefined;
183
+ this.clientStyling = undefined;
184
+ this.clientStylingUrl = undefined;
185
+ this.translationUrl = '';
186
+ this.language = 'en';
187
+ this.date = '';
188
+ this.defaultHighlightDates = undefined;
189
+ this.highlightDates = [];
190
+ this.weeks = undefined;
191
+ this.days = [];
192
+ this.alterDate = { year: 0, month: 0, day: 0 };
193
+ this.curDate = { year: 0, month: 0, day: 0 };
194
+ this.recordInfo = [];
195
+ this.showCalendar = false;
196
+ }
197
+ handleClientStylingChange(newValue, oldValue) {
198
+ if (newValue != oldValue) {
199
+ setClientStyling(this.stylingContainer, this.clientStyling);
200
+ }
201
+ }
202
+ handleClientStylingUrlChange(newValue, oldValue) {
203
+ if (newValue != oldValue) {
204
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
205
+ }
206
+ }
207
+ handleMbSourceChange(newValue, oldValue) {
208
+ if (newValue != oldValue) {
209
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
210
+ }
211
+ }
212
+ handleGameIdStringChange(newValue, oldValue) {
213
+ if (newValue != oldValue) {
214
+ this.setHighlightDates();
215
+ }
216
+ }
217
+ componentWillLoad() {
218
+ resolveTranslationUrl$2(this.translationUrl);
219
+ this.weeks = translate$3('weeks', this.language);
220
+ const d = this.date ? new Date(this.date) : new Date();
221
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
222
+ this.curDate = Object.assign({}, this.alterDate);
223
+ this.loadRecords();
224
+ }
225
+ handleDateChange() {
226
+ const d = this.date ? new Date(this.date) : new Date();
227
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
228
+ this.curDate = Object.assign({}, this.alterDate);
229
+ this.loadRecords();
230
+ }
231
+ setHighlightDates() {
232
+ if (this.defaultHighlightDates) {
233
+ try {
234
+ this.highlightDates = JSON.parse(this.defaultHighlightDates);
235
+ }
236
+ catch (_a) {
237
+ this.highlightDates = [];
238
+ }
239
+ }
240
+ }
241
+ componentDidLoad() {
242
+ if (this.stylingContainer) {
243
+ if (this.mbSource)
244
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
245
+ if (this.clientStyling)
246
+ setClientStyling(this.stylingContainer, this.clientStyling);
247
+ if (this.clientStylingUrl)
248
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
249
+ }
250
+ this.setHighlightDates();
251
+ document.addEventListener('click', this.handleOutsideClick);
252
+ }
253
+ disconnectedCallback() {
254
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
255
+ document.removeEventListener('click', this.handleOutsideClick);
256
+ }
257
+ get yearOptions() {
258
+ const years = Array.from({ length: 101 }, (_, i) => this.alterDate.year - 50 + i);
259
+ return years.map((item) => {
260
+ return {
261
+ label: String(item),
262
+ value: String(item)
263
+ };
264
+ });
265
+ }
266
+ get monthOptions() {
267
+ const months = Array.from({ length: 12 }, (_, i) => i + 1);
268
+ return months.map((item) => {
269
+ return {
270
+ label: String(item),
271
+ value: String(item)
272
+ };
273
+ });
274
+ }
275
+ loadRecords() {
276
+ const { year, month } = this.alterDate;
277
+ this.setDays(year, month);
278
+ }
279
+ setDays(year, month) {
280
+ this.days = [];
281
+ const firstDayOfMonth = new Date(year, month, 1);
282
+ const firstDayWeek = firstDayOfMonth.getDay();
283
+ const startDate = new Date(year, month, 1 - firstDayWeek);
284
+ for (let i = 0; i < 42; i++) {
285
+ const temp = new Date(startDate);
286
+ temp.setDate(startDate.getDate() + i);
287
+ const day = {
288
+ date: temp.getDate(),
289
+ month: temp.getMonth(),
290
+ year: temp.getFullYear()
291
+ };
292
+ this.days.push(day);
293
+ }
294
+ }
295
+ getFullDayOfMonth(year, month) {
296
+ return new Date(year, month, 0).getDate();
297
+ }
298
+ showFormatedDate(date) {
299
+ return `${date.day}/${date.month + 1}/${date.year}`;
300
+ }
301
+ handleSelectDate(curDay, curMonth, curYear) {
302
+ this.alterDate.day = curDay;
303
+ this.curDate = Object.assign({}, this.alterDate);
304
+ this.showCalendar = false;
305
+ const formattedHighLightArr = this.highlightDates.map((date) => {
306
+ const d = new Date(date);
307
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
308
+ });
309
+ const idx = formattedHighLightArr.findIndex((obj) => {
310
+ const { year, month, day } = obj;
311
+ return curMonth === month && curYear === year && curDay === day;
312
+ });
313
+ if (idx > -1) {
314
+ this.changeDate.emit(idx);
315
+ }
316
+ }
317
+ tellIsCurDay(curDay, curMonth, curYear) {
318
+ return this.curDate.day === curDay && this.curDate.month === curMonth && this.curDate.year === curYear;
319
+ }
320
+ tellIsHighLight(curDay, curMonth, curYear) {
321
+ if (!this.highlightDates || !this.highlightDates.length)
322
+ return false;
323
+ const formattedHighLightArr = this.highlightDates.map((date) => {
324
+ const d = new Date(date);
325
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
326
+ });
327
+ return formattedHighLightArr.some((obj) => {
328
+ const { year, month, day } = obj;
329
+ return curMonth === month && curYear === year && curDay === day;
330
+ });
331
+ }
332
+ renderInner() {
333
+ const calendarClass = ['calendar', this.showCalendar ? 'calendar-visible' : 'calendar-leave'];
334
+ return (h("div", { class: "lottery-tipping-calendar", ref: (el) => (this.calendarRef = el) }, h("div", { class: "calling-input", onClick: () => {
335
+ this.showCalendar = true;
336
+ } }, h("div", { class: "calling-input-text" }, this.showFormatedDate(this.curDate)), h("div", { class: "calling-input-icon", innerHTML: calendarIcon })), h("div", { class: calendarClass.join(' ') }, h("div", { class: "calendar-header" }, h("div", { class: "date-controller year-minus", onClick: this.onYearMinus }, "<"), h("div", { class: "date-controller month-minus", onClick: this.onMonthMinus }, "<"), h("div", { class: "date-picker" }, h("div", { class: "date-picker-year" }, h("vaadin-select", { items: this.yearOptions, value: this.alterDate.year, style: { '--vaadin-field-default-width': '90px' }, "on-value-changed": this.onYearChange.bind(this) })), h("div", { class: "date-picker-delimiter" }, "-"), h("div", { class: "date-picker-month" }, h("vaadin-select", { items: this.monthOptions, value: this.alterDate.month + 1, style: { '--vaadin-field-default-width': '64px' }, "on-value-changed": this.onMonthChange.bind(this) })), h("div", { class: "date-picker-delimiter" }, "-"), h("div", { class: "date-picker-day" }, this.alterDate.day)), h("div", { class: "date-controller month-plus", onClick: this.onMonthPlus }, ">"), h("div", { class: "date-controller year-plus", onClick: this.onYearPlus }, ">")), h("div", { class: "calendar-content" }, h("div", { class: "calendar-content-week" }, this.weeks.map((week) => (h("div", { class: "week-item" }, week)))), h("div", { class: "calendar-content-day" }, this.days.map((item) => (h("div", { class: {
337
+ 'day-item': true,
338
+ isCurDay: this.tellIsCurDay(item.date, item.month, item.year),
339
+ isHighLight: this.tellIsHighLight(item.date, item.month, item.year)
340
+ }, onClick: () => this.handleSelectDate(item.date, item.month, item.year) }, item.date))))))));
341
+ }
342
+ render() {
343
+ return (h("div", { key: 'da34c4c86cac49411fb15ab8bceda89e379befc6', class: "date-selection" }, h("div", { key: '29f06ef7a5df466018ae6561b54fcbdfbab9f23b', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: () => this.handlePrev.emit() }), h("div", { key: 'c6d75d873c2683752c37d4083c57761c4f7e523b', class: "date-selection-calendar" }, this.renderInner()), h("div", { key: '8b16b3e0761dd4c877f169aea84d028aaf193b69', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: () => this.handleNext.emit() })));
344
+ }
345
+ static get watchers() { return {
346
+ "clientStyling": ["handleClientStylingChange"],
347
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
348
+ "mbSource": ["handleMbSourceChange"],
349
+ "defaultHighlightDates": ["handleGameIdStringChange"],
350
+ "date": ["handleDateChange"]
351
+ }; }
352
+ };
353
+ HelperDateNavigator.style = HelperDateNavigatorStyle0;
5
354
 
6
355
  var Bomb;
7
356
  (function (Bomb) {
@@ -334,6 +683,33 @@ function isValid(dirtyDate) {
334
683
  return !isNaN(Number(date));
335
684
  }
336
685
 
686
+ /**
687
+ * @name differenceInMilliseconds
688
+ * @category Millisecond Helpers
689
+ * @summary Get the number of milliseconds between the given dates.
690
+ *
691
+ * @description
692
+ * Get the number of milliseconds between the given dates.
693
+ *
694
+ * @param {Date|Number} dateLeft - the later date
695
+ * @param {Date|Number} dateRight - the earlier date
696
+ * @returns {Number} the number of milliseconds
697
+ * @throws {TypeError} 2 arguments required
698
+ *
699
+ * @example
700
+ * // How many milliseconds are between
701
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
702
+ * const result = differenceInMilliseconds(
703
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
704
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
705
+ * )
706
+ * //=> 1100
707
+ */
708
+ function differenceInMilliseconds(dateLeft, dateRight) {
709
+ requiredArgs(2, arguments);
710
+ return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
711
+ }
712
+
337
713
  /**
338
714
  * @name subMilliseconds
339
715
  * @category Millisecond Helpers
@@ -2606,7 +2982,7 @@ function validateTimezone(_hours, minutes) {
2606
2982
  return minutes >= 0 && minutes <= 59;
2607
2983
  }
2608
2984
 
2609
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2985
+ function fetchRequest$3(url, method = 'GET', body = null, headers = {}) {
2610
2986
  return new Promise((resolve, reject) => {
2611
2987
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2612
2988
  const options = {
@@ -2662,7 +3038,7 @@ function formattedTime(date) {
2662
3038
  const weekday = format(parsedDate, 'EEEE');
2663
3039
  return `${weekday} at ${hhmm}`;
2664
3040
  }
2665
- function toQueryParams(params) {
3041
+ function toQueryParams$2(params) {
2666
3042
  const finalParams = {};
2667
3043
  Object.entries(params).forEach(([key, value]) => {
2668
3044
  if (!isEmptyValue(value, true)) {
@@ -2730,7 +3106,7 @@ function isEmptyValueOfObject(obj) {
2730
3106
  return false;
2731
3107
  }
2732
3108
  const DEFAULT_ALL_BOMB = { name: 'All', code: 'All' };
2733
- function thousandSeparator(value) {
3109
+ function thousandSeparator$1(value) {
2734
3110
  if (value === 0) {
2735
3111
  return '0';
2736
3112
  }
@@ -2745,7 +3121,7 @@ function thousandSeparator(value) {
2745
3121
 
2746
3122
  async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2747
3123
  try {
2748
- const res = await fetchRequest(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams(params)}`);
3124
+ const res = await fetchRequest$3(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams$2(params)}`);
2749
3125
  return res;
2750
3126
  }
2751
3127
  catch (error) {
@@ -2753,16 +3129,16 @@ async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2753
3129
  return {};
2754
3130
  }
2755
3131
  }
2756
- async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3132
+ async function fetchSaleStatistics$1({ endpoint, gameId, drawId }) {
2757
3133
  try {
2758
- const res = await fetchRequest(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3134
+ const res = await fetchRequest$3(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
2759
3135
  return res;
2760
3136
  }
2761
3137
  catch (error) {
2762
3138
  return Promise.reject(error);
2763
3139
  }
2764
3140
  }
2765
- async function fetchData({ endpoint, groupId, params }) {
3141
+ async function fetchData$1({ endpoint, groupId, params }) {
2766
3142
  try {
2767
3143
  const { sportTags = [], liveDraws = [] } = await fetchLiveDrawsByGroupId({
2768
3144
  endpoint,
@@ -2794,7 +3170,7 @@ async function getTurnoverForAll({ endpoint, configs }) {
2794
3170
  const fallback = { turnover: formattedTurnover(null) };
2795
3171
  const promises = configs.map(async ({ gameId, drawId }) => {
2796
3172
  var _a;
2797
- const res = await fetchSaleStatistics({
3173
+ const res = await fetchSaleStatistics$1({
2798
3174
  endpoint: endpoint,
2799
3175
  gameId,
2800
3176
  drawId
@@ -2807,12 +3183,12 @@ async function getTurnoverForAll({ endpoint, configs }) {
2807
3183
  function formattedTurnover(turnover, unit = '€') {
2808
3184
  if (turnover === null)
2809
3185
  return '';
2810
- return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3186
+ return `${unit}${turnover ? thousandSeparator$1(turnover) : 0}`;
2811
3187
  }
2812
3188
 
2813
- const DEFAULT_LANGUAGE = 'en';
2814
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
2815
- const TRANSLATIONS = {
3189
+ const DEFAULT_LANGUAGE$2 = 'en';
3190
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
3191
+ const TRANSLATIONS$2 = {
2816
3192
  en: {
2817
3193
  logout: 'Log out',
2818
3194
  draws: 'DRAWS',
@@ -2865,15 +3241,15 @@ const TRANSLATIONS = {
2865
3241
  instructionContent: 'Sadržaj uputa ide ovdje.'
2866
3242
  }
2867
3243
  };
2868
- const translate = (key, customLang) => {
3244
+ const translate$2 = (key, customLang) => {
2869
3245
  const lang = customLang;
2870
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
3246
+ return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
2871
3247
  };
2872
3248
 
2873
3249
  const lotteryOddsbomBombCss = "/* --- Component: Bomb Card Grid --- */\n.lottery-oddsbom-bomb-wrapper {\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n height: 100%;\n}\n\n.bomb-grid-container {\n width: 100%;\n display: flex;\n justify-content: center;\n container-type: inline-size;\n container-name: bomb-grid;\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n /* --- Component: Bomb Card --- */\n}\n.bomb-grid-container .bomb-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 0.75rem;\n place-items: center;\n}\n.bomb-grid-container .bomb-card-wrapper {\n width: 100%;\n max-width: 30rem;\n height: 100%;\n box-sizing: border-box;\n border-radius: 8px;\n padding: 1rem;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n.bomb-grid-container .bomb-card {\n height: 100%;\n min-width: 24rem;\n transition: transform 0.3s;\n}\n.bomb-grid-container .bomb-card:hover {\n transform: scale(1.02);\n cursor: pointer;\n}\n.bomb-grid-container .card-header {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 0.8rem;\n}\n.bomb-grid-container .card-icon {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.bomb-grid-container .card-icon svg {\n width: 28px;\n height: 28px;\n}\n.bomb-grid-container .card-title {\n flex-grow: 1;\n word-break: break-all;\n}\n.bomb-grid-container .card-title h2 {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 700;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-title p {\n margin: 0;\n color: var(--emw--color-typography-secondary, #333);\n font-size: 0.9rem;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-info {\n display: flex;\n gap: 0.75rem;\n margin-bottom: 0.8rem;\n flex-wrap: wrap;\n}\n.bomb-grid-container .card-tag {\n background-color: var(--emw--color-tertiary, #e3f2fd);\n padding: 0.3rem 0.75rem;\n border-radius: 4px;\n font-size: 0.85rem;\n font-weight: 500;\n max-width: 120px;\n}\n.bomb-grid-container .card-matches {\n max-height: 6.8rem;\n overflow-y: auto;\n}\n.bomb-grid-container .card-matches ol {\n margin: 0;\n padding-left: 1.25rem;\n font-size: 0.85rem;\n line-height: 1.6;\n}\n.bomb-grid-container .card-matches li {\n padding-left: 0.2rem;\n word-wrap: break-word;\n}\n\n/* --- CONTAINER QUERIES FOR RESPONSIVENESS --- */\n@container bomb-grid (max-width: 768px) {\n .bomb-grid-container .bomb-grid {\n /* On smaller containers, switch to a single column */\n grid-template-columns: 1fr;\n }\n .bomb-card-wrapper .bomb-card {\n min-width: 200px;\n }\n}\n/* --- Component: Filter Controls --- */\n.OddsbomEntranceController__section {\n margin: 1.5rem 0;\n display: flex;\n gap: 12px;\n color: var(--emw--color-typography, #000);\n container-type: inline-size;\n container-name: controller;\n justify-content: center;\n}\n.OddsbomEntranceController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n line-height: 2.2rem;\n}\n.OddsbomEntranceController__segmented-control {\n display: inline-flex;\n gap: 1rem;\n flex-wrap: wrap;\n}\n.OddsbomEntranceController__segment {\n height: 2.2rem;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n white-space: nowrap;\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n}\n.OddsbomEntranceController__segment--active {\n background-color: var(--emw--color-primary-variant, #1367e7);\n color: var(--emw--color-typography-reverse, #fff);\n font-weight: 600;\n}\n.OddsbomEntranceController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.OddsbomEntranceController__segment:not(.OddsbomEntranceController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}\n@container controller (max-width: 500px) {\n .OddsbomEntranceController__segmented-control {\n gap: 0rem;\n }\n .OddsbomEntranceController__segment {\n padding: 0.2rem 0.6rem;\n }\n .OddsbomEntranceController__label,\n .OddsbomEntranceController____segment {\n line-height: 1.8rem;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}\n\n.empty-draw-wrap {\n padding-top: 100px;\n}\n.empty-draw-wrap .empty-draw {\n width: 240px;\n height: 160px;\n padding: 18px 12px 12px 12px;\n background: var(--emw--color-secondary-variant, #e3f2fd);\n position: relative;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n border-radius: 12px;\n}\n.empty-draw-wrap .empty-draw img {\n position: absolute;\n top: -64%;\n left: 50%;\n transform: translateX(-50%);\n width: 200px;\n}\n.empty-draw-wrap .empty-draw-content {\n display: flex;\n gap: 4px;\n}\n.empty-draw-wrap .empty-draw-text {\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n}";
2874
3250
  const LotteryOddsbomBombStyle0 = lotteryOddsbomBombCss;
2875
3251
 
2876
- const BombIcons = {
3252
+ const BombIcons$1 = {
2877
3253
  [Bomb.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" })))
2878
3254
  };
2879
3255
  const LotteryOddsbomBomb = class {
@@ -2927,7 +3303,7 @@ const LotteryOddsbomBomb = class {
2927
3303
  async doFetchData(params = {}) {
2928
3304
  try {
2929
3305
  this.isLoading = true;
2930
- this.liveDrawsInfoByGroupId = await fetchData({
3306
+ this.liveDrawsInfoByGroupId = await fetchData$1({
2931
3307
  endpoint: this.endpoint,
2932
3308
  groupId: this.groupId,
2933
3309
  params
@@ -2978,7 +3354,7 @@ const LotteryOddsbomBomb = class {
2978
3354
  return this.renderEmpty();
2979
3355
  return (h("div", { class: "bomb-grid" }, this.gameList.map(({ title, subTitle, icon, date, turnover, matchList, drawId, gameId }) => (h("div", { class: "bomb-card-wrapper" }, h("div", { class: "bomb-card", onClick: () => {
2980
3356
  this.handleBombItemClick.emit({ drawId, gameId });
2981
- } }, h("div", { class: "card-header" }, BombIcons[icon] && h("div", { class: "card-icon football" }, BombIcons[icon]), h("div", { class: "card-title" }, h("h2", null, title), h("p", null, subTitle)), h("div", { class: "card-jackpot" })), h("div", { class: "card-info" }, h("span", { class: "card-tag" }, date), h("span", { class: "card-tag" }, translate('turnover', this.language) + turnover)), h("div", { class: "card-matches" }, h("ol", null, matchList.map((item) => (h("li", null, item)))))))))));
3357
+ } }, h("div", { class: "card-header" }, BombIcons$1[icon] && h("div", { class: "card-icon football" }, BombIcons$1[icon]), h("div", { class: "card-title" }, h("h2", null, title), h("p", null, subTitle)), h("div", { class: "card-jackpot" })), h("div", { class: "card-info" }, h("span", { class: "card-tag" }, date), h("span", { class: "card-tag" }, translate$2('turnover', this.language) + turnover)), h("div", { class: "card-matches" }, h("ol", null, matchList.map((item) => (h("li", null, item)))))))))));
2982
3358
  }
2983
3359
  render() {
2984
3360
  return (h("div", { key: 'ae8252d8cb1374af9bb8189bcd9edac313c7bc6a', ref: (el) => (this.stylingContainer = el), class: "lottery-oddsbom-bomb-wrapper" }, this.renderFilter(), h("div", { key: '3f673f335248057370e7e57076cc387a86dc4099', class: "bomb-grid-container" }, this.isLoading ? this.renderLoading() : this.renderMain())));
@@ -2992,4 +3368,1469 @@ const LotteryOddsbomBomb = class {
2992
3368
  };
2993
3369
  LotteryOddsbomBomb.style = LotteryOddsbomBombStyle0;
2994
3370
 
2995
- export { LotteryOddsbomBomb as lottery_oddsbom_bomb };
3371
+ const lotteryOddsbomBulletCss = ".OddsbomBullet .OddsbomBulletBtn__normal{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #0d196e);border-radius:var(--emw--border-radius-medium, 8px);color:var(--emw--color-typography, #000);font-weight:bold;cursor:pointer;transition:transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease, background-color 0.3s;user-select:none;position:relative}.OddsbomBullet .OddsbomBulletBtn__normal:hover{transform:scale(1.15) rotate(-5deg);box-shadow:var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15)) 7px 6px 6px}.OddsbomBullet .OddsbomBulletBtn__normal .OddsbomBullet--deleteIcon{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover{background-color:var(--emw--color-background, #fff)}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--text{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--deleteIcon{display:inline;fill:var(--emw--color-typography, #000)}.OddsbomBullet .OddsbomBulletBtn__normal.isCallDialogBtn:hover{transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__selected{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff);transform:scale(1.05);box-shadow:0 5px 10px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled{background-color:var(--emw--color-gray-50, #f5f5f5);border-color:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-150, #6f6f6f);cursor:not-allowed;transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled:hover{transform:none;box-shadow:none}";
3372
+ const LotteryOddsbomBulletStyle0 = lotteryOddsbomBulletCss;
3373
+
3374
+ const DeleteFilledIcon = renderIconDefinitionToSVGElement(DeleteFilled$1, {
3375
+ extraSVGAttrs: { width: '18px', height: '18px', fill: '' }
3376
+ });
3377
+ const LotteryOddsbomBullet = class {
3378
+ constructor(hostRef) {
3379
+ registerInstance(this, hostRef);
3380
+ this.oddsbomBulletToggleEvent = createEvent(this, "oddsbomBulletToggle", 7);
3381
+ this.oddsbomBulletDeleteEvent = createEvent(this, "oddsbomBulletDelete", 7);
3382
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent = createEvent(this, "oddsbomBulletAddedByMoreBtnDelete", 7);
3383
+ this.oddsbomBulletCallDialogEvent = createEvent(this, "oddsbomBulletCallDialog", 7);
3384
+ this.isSelected = undefined;
3385
+ this.disabled = undefined;
3386
+ this.text = undefined;
3387
+ this.idx = undefined;
3388
+ this.isReading = undefined;
3389
+ this.isDeleteByIcon = undefined;
3390
+ this.isCallDialogBtn = undefined;
3391
+ this.isAddedByMoreBtn = undefined;
3392
+ this.mbSource = undefined;
3393
+ this.clientStyling = undefined;
3394
+ this.clientStylingUrl = undefined;
3395
+ }
3396
+ handleClientStylingChange(newValue, oldValue) {
3397
+ if (newValue != oldValue) {
3398
+ setClientStyling(this.stylingContainer, this.clientStyling);
3399
+ }
3400
+ }
3401
+ handleClientStylingUrlChange(newValue, oldValue) {
3402
+ if (newValue != oldValue) {
3403
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3404
+ }
3405
+ }
3406
+ handleMbSourceChange(newValue, oldValue) {
3407
+ if (newValue != oldValue) {
3408
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3409
+ }
3410
+ }
3411
+ componentDidLoad() {
3412
+ if (this.stylingContainer) {
3413
+ if (this.mbSource)
3414
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3415
+ if (this.clientStyling)
3416
+ setClientStyling(this.stylingContainer, this.clientStyling);
3417
+ if (this.clientStylingUrl)
3418
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3419
+ }
3420
+ }
3421
+ disconnectedCallback() {
3422
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3423
+ }
3424
+ handleClick() {
3425
+ if (this.isCallDialogBtn) {
3426
+ this.oddsbomBulletCallDialogEvent.emit();
3427
+ return;
3428
+ }
3429
+ if (this.isDeleteByIcon) {
3430
+ if (this.isAddedByMoreBtn) {
3431
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent.emit(this.text);
3432
+ }
3433
+ else {
3434
+ this.oddsbomBulletDeleteEvent.emit(this.idx);
3435
+ }
3436
+ return;
3437
+ }
3438
+ if (!this.disabled) {
3439
+ this.oddsbomBulletToggleEvent.emit(this.idx);
3440
+ }
3441
+ }
3442
+ render() {
3443
+ return (h("div", { key: 'e21cf46108e35dcbf7d65e8c6a5f12f5d5ae49cb', class: "OddsbomBullet", ref: (el) => (this.stylingContainer = el) }, h("button", { key: '4edf5cd481d8283bd71f6806b6f93949e1308095', class: {
3444
+ OddsbomBulletBtn__normal: true,
3445
+ OddsbomBulletBtn__selected: this.isSelected,
3446
+ OddsbomBulletBtn__disabled: this.disabled,
3447
+ isDeleteByIcon: this.isDeleteByIcon,
3448
+ isCallDialogBtn: this.isCallDialogBtn || this.isReading
3449
+ }, onClick: this.handleClick.bind(this), disabled: this.disabled }, h("span", { key: 'fa1aed0293dc004808e6992c069d6992317b0788', class: "OddsbomBullet--deleteIcon", innerHTML: DeleteFilledIcon }), h("span", { key: '53ed96f2c2b833d21488049f987b6131718d563e', class: "OddsbomBullet--text" }, this.text))));
3450
+ }
3451
+ static get watchers() { return {
3452
+ "clientStyling": ["handleClientStylingChange"],
3453
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3454
+ "mbSource": ["handleMbSourceChange"]
3455
+ }; }
3456
+ };
3457
+ LotteryOddsbomBullet.style = LotteryOddsbomBulletStyle0;
3458
+
3459
+ const generateUUID$1 = () => {
3460
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3461
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
3462
+ return v.toString(16);
3463
+ });
3464
+ };
3465
+ function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
3466
+ return new Promise((resolve, reject) => {
3467
+ const uuid = generateUUID$1();
3468
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
3469
+ if (method !== 'GET' && method !== 'HEAD') {
3470
+ headersOrigin['X-Idempotency-Key'] = uuid;
3471
+ }
3472
+ const options = {
3473
+ method,
3474
+ headers: headersOrigin,
3475
+ body: null
3476
+ };
3477
+ if (body && method !== 'GET' && method !== 'HEAD') {
3478
+ options.body = JSON.stringify(body);
3479
+ }
3480
+ else {
3481
+ delete options.body;
3482
+ }
3483
+ fetch(url, options)
3484
+ .then((response) => {
3485
+ if (!response.ok) {
3486
+ reject(`HTTP error! Status: ${response.status}`);
3487
+ throw new Error(`HTTP error! Status: ${response.status}`);
3488
+ }
3489
+ return response.json();
3490
+ })
3491
+ .then((data) => resolve(data))
3492
+ .catch((error) => reject(error));
3493
+ });
3494
+ }
3495
+ function toQueryParams$1(params) {
3496
+ function isEmptyValueOfArray(arr) {
3497
+ if (arr.length === 0) {
3498
+ return true;
3499
+ }
3500
+ const len = arr.length;
3501
+ let count = 0;
3502
+ for (let i = 0; i < len; i++) {
3503
+ if (isEmptyValue(arr[i])) {
3504
+ count++;
3505
+ }
3506
+ else {
3507
+ return false;
3508
+ }
3509
+ }
3510
+ if (count === len) {
3511
+ return true;
3512
+ }
3513
+ return false;
3514
+ }
3515
+ function isEmptyValueOfObject(obj) {
3516
+ if (Object.keys(obj).length === 0) {
3517
+ return true;
3518
+ }
3519
+ const len = Object.keys(obj).length;
3520
+ let count = 0;
3521
+ for (const val of Object.values(obj)) {
3522
+ if (isEmptyValue(val)) {
3523
+ count++;
3524
+ }
3525
+ else {
3526
+ return false;
3527
+ }
3528
+ }
3529
+ if (count === len) {
3530
+ return true;
3531
+ }
3532
+ return false;
3533
+ }
3534
+ function isEmptyValue(value, allowZero) {
3535
+ if (value === null || value === undefined || value === '') {
3536
+ return true;
3537
+ }
3538
+ else if (value === 0 && allowZero) {
3539
+ return false;
3540
+ }
3541
+ else if (Array.isArray(value)) {
3542
+ return isEmptyValueOfArray(value);
3543
+ }
3544
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
3545
+ return isEmptyValueOfObject(value);
3546
+ }
3547
+ else {
3548
+ return !value;
3549
+ }
3550
+ }
3551
+ const finalParams = {};
3552
+ Object.entries(params).forEach(([key, value]) => {
3553
+ if (!isEmptyValue(value, true)) {
3554
+ finalParams[key] = value;
3555
+ }
3556
+ });
3557
+ const queryString = Object.entries(finalParams)
3558
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
3559
+ .join('&');
3560
+ return queryString ? `?${queryString}` : '';
3561
+ }
3562
+ function transformResults(results) {
3563
+ if (results && results.length > 0) {
3564
+ return results.map((i) => i === null || i === void 0 ? void 0 : i[0]);
3565
+ }
3566
+ return [[]];
3567
+ }
3568
+ function thousandSeparator(value) {
3569
+ if (value === 0) {
3570
+ return '0';
3571
+ }
3572
+ if (!value) {
3573
+ return '';
3574
+ }
3575
+ value = value.toString();
3576
+ const parts = value.split('.');
3577
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
3578
+ return parts.join('.');
3579
+ }
3580
+ function changeCurDrawItemByDate(date, drawList) {
3581
+ var _a, _b, _c;
3582
+ const curDrawItem = drawList.find((i) => i.date === date);
3583
+ if (!curDrawItem) {
3584
+ // NO DATA
3585
+ return Promise.reject();
3586
+ }
3587
+ const curDrawSelectionBettingType = curDrawItem.winningNumbers[0].winning_type;
3588
+ const curDrawSelectionMap = {};
3589
+ curDrawItem.winningNumbers.forEach((item) => {
3590
+ curDrawSelectionMap[item.winning_type] = transformResults(item.poolGameOutcomes);
3591
+ });
3592
+ const results = curDrawSelectionMap[curDrawSelectionBettingType];
3593
+ const curPrizeMap = {};
3594
+ curDrawItem.prizes.forEach((prize) => {
3595
+ const winningType = prize.winningType;
3596
+ if (!curPrizeMap[winningType]) {
3597
+ curPrizeMap[winningType] = [prize];
3598
+ }
3599
+ else {
3600
+ curPrizeMap[winningType].push(prize);
3601
+ curPrizeMap[winningType].sort((a, b) => { var _a; return ((_a = b.totalAmount) === null || _a === void 0 ? void 0 : _a.value) - (a === null || a === void 0 ? void 0 : a.totalAmount.value); });
3602
+ }
3603
+ });
3604
+ const prizes = (((_a = Object.values(curPrizeMap)) === null || _a === void 0 ? void 0 : _a[0]) || []);
3605
+ const currency = ((_c = (_b = prizes[0]) === null || _b === void 0 ? void 0 : _b.totalAmount) === null || _c === void 0 ? void 0 : _c.currency) || '';
3606
+ const { turnOver, winNumber, winTurnOver } = prizes.reduce((pre, cur) => {
3607
+ var _a;
3608
+ const { turnOver: _turnOver, winNumber: _winNumber, winTurnOver: _winTurnOver } = pre;
3609
+ // FIXME: no turnover
3610
+ const turnOver = 0;
3611
+ const winNumber = _winNumber + Number(cur === null || cur === void 0 ? void 0 : cur.players);
3612
+ const winTurnOver = _turnOver + Number((_a = cur === null || cur === void 0 ? void 0 : cur.totalAmount) === null || _a === void 0 ? void 0 : _a.value);
3613
+ return {
3614
+ turnOver,
3615
+ winNumber,
3616
+ winTurnOver
3617
+ };
3618
+ }, {
3619
+ turnOver: 0,
3620
+ winNumber: 0,
3621
+ winTurnOver: 0
3622
+ });
3623
+ return Promise.resolve({
3624
+ date,
3625
+ formattedTurnOver: currency + ' ' + thousandSeparator(turnOver),
3626
+ winNumber,
3627
+ formattedWinTurnOver: currency + ' ' + thousandSeparator(winTurnOver),
3628
+ drawId: curDrawItem.id,
3629
+ results
3630
+ });
3631
+ }
3632
+ function findLatestDateIdx$1(dateArr) {
3633
+ const currentDate = new Date();
3634
+ let closestIndex = 0;
3635
+ let minDiff = Infinity;
3636
+ dateArr.forEach((dateStr, index) => {
3637
+ const date = new Date(dateStr);
3638
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
3639
+ if (diff < minDiff) {
3640
+ minDiff = diff;
3641
+ closestIndex = index;
3642
+ }
3643
+ });
3644
+ return closestIndex;
3645
+ }
3646
+
3647
+ async function fetchGameInfo({ endpoint, gameId }) {
3648
+ if (!(endpoint && gameId))
3649
+ return;
3650
+ const gameInfo = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
3651
+ return {
3652
+ vendorGameId: gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.type,
3653
+ gameName: gameInfo.name
3654
+ };
3655
+ }
3656
+ async function fetchDrawsInfo$1({ endpoint, gameId }) {
3657
+ if (!(endpoint && gameId))
3658
+ return;
3659
+ const GAME_DRAW_LIMIT = 9999;
3660
+ const filterData = { status: 'CLOSED', limit: GAME_DRAW_LIMIT };
3661
+ const { items: drawList } = await fetchRequest$2(`${endpoint}/games/${gameId}/draws${toQueryParams$1(filterData)}`);
3662
+ if (!drawList || drawList.length === 0)
3663
+ return {};
3664
+ const settledDrawList = drawList
3665
+ .filter((item) => item.winningNumbers.length > 0)
3666
+ .sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
3667
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
3668
+ return {
3669
+ drawDatesOptions,
3670
+ drawResultsList: settledDrawList
3671
+ };
3672
+ }
3673
+ async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3674
+ try {
3675
+ const res = await fetchRequest$2(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3676
+ return res;
3677
+ }
3678
+ catch (error) {
3679
+ return Promise.reject(error);
3680
+ }
3681
+ }
3682
+
3683
+ const DEFAULT_LANGUAGE$1 = 'en';
3684
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'fr', 'ar', 'hr'];
3685
+ const TRANSLATIONS$1 = {
3686
+ en: {
3687
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
3688
+ bettingType: 'Betting Type:',
3689
+ prizeAllocation: 'Prize Allocation (Turnover: €{turnover})',
3690
+ prizes: 'Prizes',
3691
+ numberOfWinners: 'Number of Winners',
3692
+ prizeMoney: 'Prize Money',
3693
+ noLatestResult: 'No latest result.',
3694
+ loading: 'Loading....',
3695
+ turnover: 'Turnover:',
3696
+ winners: 'winners,',
3697
+ prize: 'Prize:',
3698
+ },
3699
+ };
3700
+ const translate$1 = (key, customLang, replacements) => {
3701
+ const lang = customLang;
3702
+ let translation = TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
3703
+ if (replacements) {
3704
+ Object.keys(replacements).forEach((placeholder) => {
3705
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
3706
+ });
3707
+ }
3708
+ return translation;
3709
+ };
3710
+ const getTranslations$1 = (data) => {
3711
+ Object.keys(data).forEach((item) => {
3712
+ for (let key in data[item]) {
3713
+ TRANSLATIONS$1[item][key] = data[item][key];
3714
+ }
3715
+ });
3716
+ };
3717
+ const resolveTranslationUrl$1 = async (translationUrl) => {
3718
+ if (translationUrl) {
3719
+ try {
3720
+ const response = await fetch(translationUrl);
3721
+ if (!response.ok) {
3722
+ throw new Error(`HTTP error! status: ${response.status}`);
3723
+ }
3724
+ const translations = await response.json();
3725
+ getTranslations$1(translations);
3726
+ }
3727
+ catch (error) {
3728
+ console.error('Failed to fetch or parse translations from URL:', error);
3729
+ }
3730
+ }
3731
+ };
3732
+
3733
+ const lotteryOddsbomLatestResultCss = ".lottery-tipping-latest-result{container-type:inline-size;background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.lottery-tipping-latest-result .header-section{display:flex;justify-content:center;align-items:center}.lottery-tipping-latest-result .match-info-section{justify-content:space-between;padding:15px 0px;height:18px}.lottery-tipping-latest-result .match-details,.lottery-tipping-latest-result .prize-details{font-weight:600;display:flex;align-items:center}.lottery-tipping-latest-result .match-details .title-icon{margin-right:8px;display:flex}.lottery-tipping-latest-result .match-details .title-text__extra{margin-left:5px}.lottery-tipping-latest-result .prize-details .winners-count{margin-right:5px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}.latest-result-wrapper{background:var(--emw--color-background, #fff)}.latest-result-wrapper.game-wrapper{border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:8px;box-shadow:0 2px 4px var(--emw--color-background-tertiary, #ccc);overflow-x:auto;transition:box-shadow 0.3s ease;padding:20px}.latest-result-wrapper.game-wrapper:hover{box-shadow:0 4px 12px var(--emw--color-background-tertiary, #ccc)}.loading-turnOver{display:inline-flex;align-items:center}";
3734
+ const LotteryOddsbomLatestResultStyle0 = lotteryOddsbomLatestResultCss;
3735
+
3736
+ const BombIcons = {
3737
+ ['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" })))
3738
+ };
3739
+ const LotteryOddsbomLatestResult = class {
3740
+ constructor(hostRef) {
3741
+ registerInstance(this, hostRef);
3742
+ this.getGameDrawInfoEvent = createEvent(this, "getGameDrawInfo", 7);
3743
+ this.mbSource = undefined;
3744
+ this.clientStyling = undefined;
3745
+ this.clientStylingUrl = undefined;
3746
+ this.translationUrl = '';
3747
+ this.language = 'en';
3748
+ this.endpoint = undefined;
3749
+ this.gameId = undefined;
3750
+ this.curDate = undefined;
3751
+ this.showLoading = true;
3752
+ this.hideWrapperEmpty = false;
3753
+ this.isPassingData = false;
3754
+ this.drawResults = '';
3755
+ this.isEmpty = true;
3756
+ this._curDate = undefined;
3757
+ this.drawResultsList = [];
3758
+ this.curDrawItem = {};
3759
+ this.curTurnOver = 0;
3760
+ this.isLoadingTurnover = false;
3761
+ this.vendorGameId = undefined;
3762
+ this.gameName = undefined;
3763
+ this.isLoading = false;
3764
+ }
3765
+ handleClientStylingChange(newValue, oldValue) {
3766
+ if (newValue != oldValue) {
3767
+ setClientStyling(this.stylingContainer, this.clientStyling);
3768
+ }
3769
+ }
3770
+ handleClientStylingUrlChange(newValue, oldValue) {
3771
+ if (newValue != oldValue) {
3772
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3773
+ }
3774
+ }
3775
+ handleMbSourceChange(newValue, oldValue) {
3776
+ if (newValue != oldValue) {
3777
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3778
+ }
3779
+ }
3780
+ async handleDateChange(n, o) {
3781
+ if (n !== o) {
3782
+ await this.setCurItem(n);
3783
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3784
+ this.getTurnOver();
3785
+ }
3786
+ }
3787
+ }
3788
+ async handleDrawResultsChange(n, o) {
3789
+ if (n !== o) {
3790
+ await this.setDrawResults();
3791
+ }
3792
+ }
3793
+ async getTurnOver() {
3794
+ var _a, _b;
3795
+ try {
3796
+ this.isLoadingTurnover = true;
3797
+ const res = await fetchSaleStatistics({
3798
+ endpoint: this.endpoint,
3799
+ gameId: this.vendorGameId,
3800
+ drawId: this.curDrawItem.drawId
3801
+ });
3802
+ 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;
3803
+ }
3804
+ catch (e) {
3805
+ console.error(e);
3806
+ }
3807
+ finally {
3808
+ this.isLoadingTurnover = false;
3809
+ }
3810
+ }
3811
+ get formattedTurnover() {
3812
+ const turnover = this.curTurnOver;
3813
+ const unit = '€';
3814
+ if (turnover === null || turnover === undefined)
3815
+ return '';
3816
+ return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3817
+ }
3818
+ async setCurItem(curDate) {
3819
+ var _a;
3820
+ try {
3821
+ if (curDate && ((_a = this.drawResultsList) === null || _a === void 0 ? void 0 : _a.length)) {
3822
+ this.curDrawItem = await changeCurDrawItemByDate(curDate, this.drawResultsList);
3823
+ this.isEmpty = false;
3824
+ }
3825
+ else {
3826
+ this.isEmpty = true;
3827
+ }
3828
+ }
3829
+ catch (_b) {
3830
+ this.isEmpty = true;
3831
+ }
3832
+ }
3833
+ async setDrawResults() {
3834
+ try {
3835
+ if (this.drawResults) {
3836
+ this.drawResultsList = JSON.parse(this.drawResults);
3837
+ await this.setCurItem(this.curDate);
3838
+ }
3839
+ }
3840
+ catch (err) {
3841
+ console.error(err);
3842
+ }
3843
+ }
3844
+ componentDidLoad() {
3845
+ if (this.stylingContainer) {
3846
+ if (this.mbSource)
3847
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3848
+ if (this.clientStyling)
3849
+ setClientStyling(this.stylingContainer, this.clientStyling);
3850
+ if (this.clientStylingUrl)
3851
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3852
+ }
3853
+ }
3854
+ disconnectedCallback() {
3855
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3856
+ }
3857
+ async getDrawData() {
3858
+ if (this.isPassingData) {
3859
+ this.setDrawResults();
3860
+ }
3861
+ else {
3862
+ this.fetchData();
3863
+ }
3864
+ }
3865
+ async getGameInfo() {
3866
+ return fetchGameInfo({ endpoint: this.endpoint, gameId: this.gameId }).then(({ vendorGameId, gameName }) => {
3867
+ this.vendorGameId = vendorGameId;
3868
+ this.gameName = gameName;
3869
+ });
3870
+ }
3871
+ async componentWillLoad() {
3872
+ resolveTranslationUrl$1(this.translationUrl);
3873
+ await Promise.all([this.getDrawData(), this.getGameInfo()]);
3874
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3875
+ this.getTurnOver();
3876
+ }
3877
+ }
3878
+ async fetchData() {
3879
+ this.isLoading = true;
3880
+ try {
3881
+ const res = await fetchDrawsInfo$1({ endpoint: this.endpoint, gameId: this.gameId });
3882
+ this.getGameDrawInfoEvent.emit({
3883
+ drawDatesOptions: res.drawDatesOptions,
3884
+ gameId: this.gameId
3885
+ });
3886
+ this.drawResultsList = res.drawResultsList;
3887
+ this._curDate = res.drawDatesOptions[findLatestDateIdx$1(res.drawDatesOptions)];
3888
+ await this.setCurItem(this._curDate);
3889
+ }
3890
+ catch (error) {
3891
+ this.getGameDrawInfoEvent.emit({
3892
+ drawDatesOptions: [],
3893
+ gameId: this.gameId
3894
+ });
3895
+ }
3896
+ finally {
3897
+ this.isLoading = false;
3898
+ }
3899
+ }
3900
+ renderLoading() {
3901
+ 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" }))));
3902
+ }
3903
+ renderEmpty() {
3904
+ return null;
3905
+ }
3906
+ renderMainContent() {
3907
+ var _a, _b, _c, _d, _e, _f;
3908
+ if (!(this.curDate || this._curDate) || this.isEmpty) {
3909
+ return this.renderEmpty();
3910
+ }
3911
+ 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$1('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$1('winners', this.language)), h("span", { class: "prize-amount" }, translate$1('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 }))));
3912
+ }
3913
+ render() {
3914
+ return (h("div", { key: '08c7308433c4d55f4cec1540002a03596155fe98', ref: (el) => (this.stylingContainer = el), class: {
3915
+ 'latest-result-wrapper': true,
3916
+ 'game-wrapper': !(this.hideWrapperEmpty && this.isEmpty)
3917
+ } }, this.isLoading && this.showLoading ? this.renderLoading() : this.renderMainContent()));
3918
+ }
3919
+ static get watchers() { return {
3920
+ "clientStyling": ["handleClientStylingChange"],
3921
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3922
+ "mbSource": ["handleMbSourceChange"],
3923
+ "curDate": ["handleDateChange"],
3924
+ "drawResults": ["handleDrawResultsChange"]
3925
+ }; }
3926
+ };
3927
+ LotteryOddsbomLatestResult.style = LotteryOddsbomLatestResultStyle0;
3928
+
3929
+ const generateUUID = () => {
3930
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3931
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
3932
+ return v.toString(16);
3933
+ });
3934
+ };
3935
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
3936
+ return new Promise((resolve, reject) => {
3937
+ const uuid = generateUUID();
3938
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
3939
+ if (method !== 'GET' && method !== 'HEAD') {
3940
+ headersOrigin['X-Idempotency-Key'] = uuid;
3941
+ }
3942
+ const options = {
3943
+ method,
3944
+ headers: headersOrigin,
3945
+ body: null
3946
+ };
3947
+ if (body && method !== 'GET' && method !== 'HEAD') {
3948
+ options.body = JSON.stringify(body);
3949
+ }
3950
+ else {
3951
+ delete options.body;
3952
+ }
3953
+ fetch(url, options)
3954
+ .then((response) => {
3955
+ if (!response.ok) {
3956
+ reject(`HTTP error! Status: ${response.status}`);
3957
+ throw new Error(`HTTP error! Status: ${response.status}`);
3958
+ }
3959
+ return response.json();
3960
+ })
3961
+ .then((data) => resolve(data))
3962
+ .catch((error) => reject(error));
3963
+ });
3964
+ }
3965
+ function toQueryParams(params) {
3966
+ function isEmptyValueOfArray(arr) {
3967
+ if (arr.length === 0) {
3968
+ return true;
3969
+ }
3970
+ const len = arr.length;
3971
+ let count = 0;
3972
+ for (let i = 0; i < len; i++) {
3973
+ if (isEmptyValue(arr[i])) {
3974
+ count++;
3975
+ }
3976
+ else {
3977
+ return false;
3978
+ }
3979
+ }
3980
+ if (count === len) {
3981
+ return true;
3982
+ }
3983
+ return false;
3984
+ }
3985
+ function isEmptyValueOfObject(obj) {
3986
+ if (Object.keys(obj).length === 0) {
3987
+ return true;
3988
+ }
3989
+ const len = Object.keys(obj).length;
3990
+ let count = 0;
3991
+ for (const val of Object.values(obj)) {
3992
+ if (isEmptyValue(val)) {
3993
+ count++;
3994
+ }
3995
+ else {
3996
+ return false;
3997
+ }
3998
+ }
3999
+ if (count === len) {
4000
+ return true;
4001
+ }
4002
+ return false;
4003
+ }
4004
+ function isEmptyValue(value, allowZero) {
4005
+ if (value === null || value === undefined || value === '') {
4006
+ return true;
4007
+ }
4008
+ else if (value === 0 && allowZero) {
4009
+ return false;
4010
+ }
4011
+ else if (Array.isArray(value)) {
4012
+ return isEmptyValueOfArray(value);
4013
+ }
4014
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
4015
+ return isEmptyValueOfObject(value);
4016
+ }
4017
+ else {
4018
+ return !value;
4019
+ }
4020
+ }
4021
+ const finalParams = {};
4022
+ Object.entries(params).forEach(([key, value]) => {
4023
+ if (!isEmptyValue(value, true)) {
4024
+ finalParams[key] = value;
4025
+ }
4026
+ });
4027
+ const queryString = Object.entries(finalParams)
4028
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
4029
+ .join('&');
4030
+ return queryString ? `?${queryString}` : '';
4031
+ }
4032
+ function findLatestDateIdx(dateArr) {
4033
+ const currentDate = new Date();
4034
+ let closestIndex = 0;
4035
+ let minDiff = Infinity;
4036
+ dateArr.forEach((dateStr, index) => {
4037
+ const date = new Date(dateStr);
4038
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
4039
+ if (diff < minDiff) {
4040
+ minDiff = diff;
4041
+ closestIndex = index;
4042
+ }
4043
+ });
4044
+ return closestIndex;
4045
+ }
4046
+ function getUniqueDatesOptions(preDates = [], dates = []) {
4047
+ const dateSet = new Set();
4048
+ dates.forEach((date) => {
4049
+ if (!dateSet.has(date)) {
4050
+ dateSet.add(date);
4051
+ preDates.push(date);
4052
+ }
4053
+ });
4054
+ return preDates.length ? [...sortDates(preDates)] : [];
4055
+ }
4056
+ function sortDates(dateArray) {
4057
+ return dateArray.slice().sort((a, b) => a.localeCompare(b));
4058
+ }
4059
+
4060
+ async function fetchDrawsInfo({ endpoint, gameId }) {
4061
+ if (!(endpoint && gameId))
4062
+ return;
4063
+ const GAME_DRAW_LIMIT = 9999;
4064
+ const filterData = { status: 'CLOSED', limit: GAME_DRAW_LIMIT };
4065
+ const { items: drawList } = await fetchRequest$1(`${endpoint}/games/${gameId}/draws${toQueryParams(filterData)}`);
4066
+ if (!drawList || drawList.length === 0)
4067
+ return {};
4068
+ const settledDrawList = drawList.sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
4069
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
4070
+ return {
4071
+ drawDatesOptions,
4072
+ drawResultsList: settledDrawList
4073
+ };
4074
+ }
4075
+ function fetchData({ endpoint, gameIds }) {
4076
+ if (!(endpoint && gameIds))
4077
+ return;
4078
+ return Promise.allSettled(gameIds.map((gameId) => fetchDrawsInfo({ endpoint, gameId })
4079
+ .then((res) => {
4080
+ return { gameId, drawResultsList: res.drawResultsList, drawDatesOptions: res.drawDatesOptions };
4081
+ })
4082
+ .catch((error) => {
4083
+ console.error(`Failed to fetch data for gameId: ${gameId}`, error);
4084
+ return { gameId, drawResultsList: [], drawDatesOptions: [] };
4085
+ }))).then((results) => {
4086
+ return results.reduce((pre, cur) => {
4087
+ if (cur.status === 'fulfilled') {
4088
+ const { gameId, drawResultsList, drawDatesOptions } = cur.value;
4089
+ pre[gameId] = {
4090
+ drawResultsList,
4091
+ drawDatesOptions
4092
+ };
4093
+ return pre;
4094
+ }
4095
+ }, {});
4096
+ });
4097
+ }
4098
+
4099
+ const lotteryOddsbomLatestResultGroupCss = ".lottery-tipping-latest-result-group{container-type:inline-size;padding:16px;background-color:var(--emw--color-background, #fff);height:100%}.games-container{display:flex;flex-direction:column;gap:24px;max-width:800px;margin:0 auto;margin-top:24px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}";
4100
+ const LotteryOddsbomLatestResultGroupStyle0 = lotteryOddsbomLatestResultGroupCss;
4101
+
4102
+ const LotteryOddsbomLatestResultGroup = class {
4103
+ constructor(hostRef) {
4104
+ registerInstance(this, hostRef);
4105
+ this.mbSource = undefined;
4106
+ this.clientStyling = undefined;
4107
+ this.clientStylingUrl = undefined;
4108
+ this.translationUrl = '';
4109
+ this.language = 'en';
4110
+ this.endpoint = undefined;
4111
+ this.sessionId = undefined;
4112
+ this.playerId = '';
4113
+ this.gameIds = undefined;
4114
+ this.gameIdArr = [];
4115
+ this.drawDatesOptions = [];
4116
+ this.curDate = undefined;
4117
+ this.isLoading = false;
4118
+ this.drawResultsObj = {};
4119
+ }
4120
+ handleClientStylingChange(newValue, oldValue) {
4121
+ if (newValue != oldValue) {
4122
+ setClientStyling(this.stylingContainer, this.clientStyling);
4123
+ }
4124
+ }
4125
+ handleClientStylingUrlChange(newValue, oldValue) {
4126
+ if (newValue != oldValue) {
4127
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4128
+ }
4129
+ }
4130
+ handleMbSourceChange(newValue, oldValue) {
4131
+ if (newValue != oldValue) {
4132
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4133
+ }
4134
+ }
4135
+ handleGameIdStringChange(newValue, oldValue) {
4136
+ var _a;
4137
+ if (newValue != oldValue) {
4138
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4139
+ this.getData();
4140
+ }
4141
+ }
4142
+ componentDidLoad() {
4143
+ var _a;
4144
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4145
+ this.getData();
4146
+ if (this.stylingContainer) {
4147
+ if (this.mbSource)
4148
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4149
+ if (this.clientStyling)
4150
+ setClientStyling(this.stylingContainer, this.clientStyling);
4151
+ if (this.clientStylingUrl)
4152
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4153
+ }
4154
+ }
4155
+ disconnectedCallback() {
4156
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4157
+ }
4158
+ getData() {
4159
+ this.isLoading = true;
4160
+ fetchData({ endpoint: this.endpoint, gameIds: this.gameIdArr })
4161
+ .then((res) => {
4162
+ this.drawResultsObj = res;
4163
+ const dates = Object.values(res)
4164
+ .map((i) => i.drawDatesOptions)
4165
+ .filter(Boolean)
4166
+ .flat();
4167
+ this.drawDatesOptions = getUniqueDatesOptions([], dates);
4168
+ this.curDate = this.drawDatesOptions[findLatestDateIdx(this.drawDatesOptions)];
4169
+ })
4170
+ .finally(() => {
4171
+ this.isLoading = false;
4172
+ });
4173
+ }
4174
+ handleChange(e) {
4175
+ const idx = e.detail;
4176
+ this.curDate = this.drawDatesOptions[idx];
4177
+ }
4178
+ handleNext() {
4179
+ if (this.curDate) {
4180
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4181
+ if (idx < this.drawDatesOptions.length - 1) {
4182
+ this.curDate = this.drawDatesOptions[idx + 1];
4183
+ }
4184
+ }
4185
+ }
4186
+ handlePrev() {
4187
+ if (this.curDate) {
4188
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4189
+ if (idx > 0) {
4190
+ this.curDate = this.drawDatesOptions[idx - 1];
4191
+ }
4192
+ }
4193
+ }
4194
+ renderLoading() {
4195
+ 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" }))));
4196
+ }
4197
+ renderMainContent() {
4198
+ return (h("div", null, this.curDate && (h("helper-date-navigator", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, date: this.curDate, "default-highlight-dates": JSON.stringify(this.drawDatesOptions || []), onNext: this.handleNext.bind(this), onPrev: this.handlePrev.bind(this), onChangeDate: this.handleChange.bind(this) })), h("div", { class: "games-container" }, this.gameIdArr.map((gameId) => {
4199
+ var _a, _b;
4200
+ return (h("lottery-oddsbom-latest-result", { endpoint: this.endpoint, "game-id": gameId, "cur-date": this.curDate, drawResults: JSON.stringify((_b = (_a = this.drawResultsObj) === null || _a === void 0 ? void 0 : _a[gameId]) === null || _b === void 0 ? void 0 : _b.drawResultsList), "is-passing-data": true, "show-loading": false, "hide-wrapper-empty": true, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "session-id": this.sessionId, "player-id": this.playerId }));
4201
+ }))));
4202
+ }
4203
+ render() {
4204
+ return (h("div", { key: 'e576645b260f4a713cce833aae814ce7edad137e', ref: (el) => (this.stylingContainer = el), class: "lottery-tipping-latest-result-group" }, this.isLoading ? this.renderLoading() : this.renderMainContent()));
4205
+ }
4206
+ static get watchers() { return {
4207
+ "clientStyling": ["handleClientStylingChange"],
4208
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4209
+ "mbSource": ["handleMbSourceChange"],
4210
+ "gameIds": ["handleGameIdStringChange"]
4211
+ }; }
4212
+ };
4213
+ LotteryOddsbomLatestResultGroup.style = LotteryOddsbomLatestResultGroupStyle0;
4214
+
4215
+ const formatDate = ({ date, type = 'date', format: format$1 }) => {
4216
+ try {
4217
+ const parsedDate = parseISO(date);
4218
+ if (isNaN(parsedDate.getTime())) {
4219
+ throw new Error(`Invalid date: ${date}`);
4220
+ }
4221
+ if (format$1)
4222
+ return format(parsedDate, format$1);
4223
+ let formatStr = 'dd/MM/yyyy';
4224
+ if (type === 'time') {
4225
+ formatStr = 'dd/MM/yyyy HH:mm:ss';
4226
+ }
4227
+ else if (type === 'week') {
4228
+ formatStr = 'ccc dd/MM/yyyy HH:mm:ss';
4229
+ }
4230
+ return format(parsedDate, formatStr);
4231
+ }
4232
+ catch (error) {
4233
+ console.error('Error formatting date:', error.message);
4234
+ return '';
4235
+ }
4236
+ };
4237
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
4238
+ return new Promise((resolve, reject) => {
4239
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
4240
+ const options = {
4241
+ method,
4242
+ headers: headersOrigin,
4243
+ body: null
4244
+ };
4245
+ if (body && method !== 'GET' && method !== 'HEAD') {
4246
+ options.body = JSON.stringify(body);
4247
+ }
4248
+ else {
4249
+ delete options.body;
4250
+ }
4251
+ fetch(url, options)
4252
+ .then((response) => {
4253
+ if (!response.ok) {
4254
+ return response.json().then((errorData) => {
4255
+ const error = {
4256
+ status: response.status,
4257
+ statusText: response.statusText,
4258
+ code: errorData.code || 'UNKNOWN_ERROR',
4259
+ message: errorData.message || 'An unknown error occurred',
4260
+ data: errorData.data || null
4261
+ };
4262
+ reject(error);
4263
+ }, () => reject({
4264
+ status: response.status,
4265
+ statusText: response.statusText,
4266
+ code: 'PARSE_ERROR',
4267
+ message: 'Failed to parse error response'
4268
+ }));
4269
+ }
4270
+ else {
4271
+ return response.json();
4272
+ }
4273
+ })
4274
+ .then((data) => resolve(data), (error) => reject(error));
4275
+ });
4276
+ }
4277
+
4278
+ async function fetchTicketMatch({ endpoint, gameId, drawId }) {
4279
+ try {
4280
+ const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
4281
+ return res || [];
4282
+ }
4283
+ catch (e) {
4284
+ console.log(e);
4285
+ }
4286
+ }
4287
+ function getTeamsFromEventName(eventName) {
4288
+ if (!eventName)
4289
+ return '';
4290
+ return eventName.split('vs').map((i) => i.trim());
4291
+ }
4292
+ function resolveSelections(resInMatch) {
4293
+ const mySet1 = new Set();
4294
+ const mySet2 = new Set();
4295
+ for (const resInLine of resInMatch) {
4296
+ const [team1Score, team2Score] = resInLine.split(':');
4297
+ if (!mySet1.has(team1Score))
4298
+ mySet1.add(team1Score);
4299
+ if (!mySet2.has(team2Score))
4300
+ mySet2.add(team2Score);
4301
+ }
4302
+ return [Array.from(mySet1), Array.from(mySet2)];
4303
+ }
4304
+ async function buildTicketBetDataSource({ endpoint, gameId, drawId, results, splitView = false }) {
4305
+ const res = await fetchTicketMatch({ endpoint, gameId, drawId });
4306
+ if (splitView) {
4307
+ return (res.reduce((pre, item, index) => {
4308
+ const [team1Name, team2Name] = getTeamsFromEventName(item.eventName);
4309
+ const [team1Res, team2Res] = resolveSelections(results[index] || []);
4310
+ pre === null || pre === void 0 ? void 0 : pre.push({
4311
+ index: index + 1,
4312
+ teamName: team1Name,
4313
+ startTime: item.startTime,
4314
+ results: team1Res
4315
+ });
4316
+ pre === null || pre === void 0 ? void 0 : pre.push({
4317
+ index: index + 1,
4318
+ teamName: team2Name,
4319
+ startTime: item.startTime,
4320
+ results: team2Res
4321
+ });
4322
+ return pre;
4323
+ }, []) || []);
4324
+ }
4325
+ return res.map((item, index) => ({
4326
+ index: index + 1,
4327
+ eventName: item.eventName,
4328
+ startTime: item.startTime,
4329
+ results: results[index] || []
4330
+ }));
4331
+ }
4332
+
4333
+ const DEFAULT_LANGUAGE = 'en';
4334
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
4335
+ const TRANSLATIONS = {
4336
+ en: {
4337
+ filter: 'Filter',
4338
+ clear: 'Clear',
4339
+ searchByTicketId: 'Search by Ticket ID',
4340
+ enterTicketId: 'Enter Ticket ID',
4341
+ searchByTicketType: 'Search by Ticket Type',
4342
+ selectTicketType: 'Select Ticket Type',
4343
+ searchByDate: 'Search by Date',
4344
+ from: 'From',
4345
+ to: 'To',
4346
+ normal: 'Normal',
4347
+ subscription: 'Subscription',
4348
+ ticketsHistory: 'Tickets History',
4349
+ settled: 'Settled',
4350
+ purchased: 'Purchased',
4351
+ canceled: 'Canceled',
4352
+ noData: 'No data Avaliable.',
4353
+ ticketId: 'Ticket ID:',
4354
+ ticketType: 'Ticket Type:',
4355
+ ticketAmount: 'Ticket Amount:',
4356
+ lineDetail: 'Line Detail:',
4357
+ seeDetails: 'See Details',
4358
+ numberOfDraw: 'Number of Draw:',
4359
+ ticketResult: 'Ticket Result:',
4360
+ drawId: 'Draw ID:',
4361
+ drawDate: 'Draw Date:',
4362
+ result: 'Result:',
4363
+ prize: 'Prize:',
4364
+ bettingType: 'Betting Type:'
4365
+ },
4366
+ ro: {
4367
+ ticketsHistory: 'Istoric bilete',
4368
+ settled: 'Decontat',
4369
+ purchased: 'Achiziționat',
4370
+ canceled: 'Anulat',
4371
+ noData: 'Nu sunt date disponibile.',
4372
+ ticketId: 'ID bilet:',
4373
+ ticketType: 'Tip bilet:',
4374
+ ticketAmount: 'Suma biletului:',
4375
+ lineDetail: 'Detaliu linie:',
4376
+ seeDetails: 'Vezi detalii',
4377
+ numberOfDraw: 'Număr de extrageri:',
4378
+ ticketResult: 'Rezultat bilet:',
4379
+ drawId: 'ID extragere:',
4380
+ drawDate: 'Data extragerii:',
4381
+ result: 'Rezultat:',
4382
+ prize: 'Premiu:',
4383
+ bettingType: 'Tip de pariu:'
4384
+ },
4385
+ fr: {
4386
+ ticketsHistory: 'Historique des billets',
4387
+ settled: 'Réglé',
4388
+ purchased: 'Acheté',
4389
+ canceled: 'Annulé',
4390
+ noData: 'Aucune donnée disponible.',
4391
+ ticketId: 'ID du billet:',
4392
+ ticketType: 'Type de billet:',
4393
+ ticketAmount: 'Montant du billet:',
4394
+ lineDetail: 'Détail de la ligne:',
4395
+ seeDetails: 'Voir les détails',
4396
+ numberOfDraw: 'Nombre de tirages:',
4397
+ ticketResult: 'Résultat du billet:',
4398
+ drawId: 'ID du tirage:',
4399
+ drawDate: 'Date du tirage:',
4400
+ result: 'Résultat:',
4401
+ prize: 'Prix:',
4402
+ bettingType: 'Type de pari:'
4403
+ },
4404
+ ar: {
4405
+ ticketsHistory: 'سجل التذاكر',
4406
+ settled: 'تمت التسوية',
4407
+ purchased: 'تم شراؤها',
4408
+ canceled: 'تم الإلغاء',
4409
+ noData: 'لا توجد بيانات متاحة.',
4410
+ ticketId: 'معرف التذكرة:',
4411
+ ticketType: 'نوع التذكرة:',
4412
+ ticketAmount: 'مبلغ التذكرة:',
4413
+ lineDetail: 'تفاصيل الخط:',
4414
+ seeDetails: 'انظر التفاصيل',
4415
+ numberOfDraw: 'عدد السحوبات:',
4416
+ ticketResult: 'نتيجة التذكرة:',
4417
+ drawId: 'معرف السحب:',
4418
+ drawDate: 'تاريخ السحب:',
4419
+ result: 'النتيجة:',
4420
+ prize: 'الجائزة:',
4421
+ bettingType: 'نوع الرهان:'
4422
+ },
4423
+ hr: {
4424
+ ticketsHistory: 'Povijest listića',
4425
+ settled: 'Riješeno',
4426
+ purchased: 'Kupljeno',
4427
+ canceled: 'Otkazano',
4428
+ noData: 'Nema dostupnih podataka.',
4429
+ ticketId: 'ID listića:',
4430
+ ticketType: 'Vrsta listića:',
4431
+ ticketAmount: 'Iznos listića:',
4432
+ lineDetail: 'Detalji linije:',
4433
+ seeDetails: 'Vidi detalje',
4434
+ numberOfDraw: 'Broj izvlačenja:',
4435
+ ticketResult: 'Rezultat listića:',
4436
+ drawId: 'ID izvlačenja:',
4437
+ drawDate: 'Datum izvlačenja:',
4438
+ result: 'Rezultat:',
4439
+ prize: 'Nagrada:',
4440
+ bettingType: 'Vrsta oklade:'
4441
+ }
4442
+ };
4443
+ const translate = (key, customLang, replacements) => {
4444
+ const lang = customLang;
4445
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
4446
+ if (replacements) {
4447
+ Object.keys(replacements).forEach((placeholder) => {
4448
+ translation = translation === null || translation === void 0 ? void 0 : translation.replace(`{${placeholder}}`, replacements[placeholder]);
4449
+ });
4450
+ }
4451
+ return translation;
4452
+ };
4453
+ const getTranslations = (data) => {
4454
+ Object.keys(data).forEach((item) => {
4455
+ for (let key in data[item]) {
4456
+ TRANSLATIONS[item][key] = data[item][key];
4457
+ }
4458
+ });
4459
+ };
4460
+ const resolveTranslationUrl = async (translationUrl) => {
4461
+ if (translationUrl) {
4462
+ try {
4463
+ const response = await fetch(translationUrl);
4464
+ if (!response.ok) {
4465
+ throw new Error(`HTTP error! status: ${response.status}`);
4466
+ }
4467
+ const translations = await response.json();
4468
+ getTranslations(translations);
4469
+ }
4470
+ catch (error) {
4471
+ console.error('Failed to fetch or parse translations from URL:', error);
4472
+ }
4473
+ }
4474
+ };
4475
+
4476
+ const lotteryOddsbomTicketResultCss = ".LotteryTippingTicketBet__container {\n display: block; /* Or inline-block, depending on desired layout flow */\n font-size: 14px;\n line-height: 1.5715;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n overflow: hidden;\n min-width: 300px;\n container-type: inline-size;\n}\n@container (max-width: 375px) {\n .LotteryTippingTicketBet__container {\n font-size: 12px;\n }\n}\n\n.my-table-component {\n width: 100%;\n border-collapse: collapse; /* Important for borders */\n text-align: left;\n border-radius: 0.1rem; /* Ant Design like subtle rounding */\n border-spacing: 0;\n}\n\n/* Header */\n.my-table-component th {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n padding: 0.4rem 0.5rem;\n transition: background 0.3s ease;\n}\n\n/* Cells */\n.my-table-component td {\n padding: 0.4rem 0.5rem;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n transition: background 0.3s;\n}\n@container (max-width: 400px) {\n .my-table-component td {\n padding: 0.3rem 0.3rem;\n }\n}\n\n.my-table-component.bordered th,\n.my-table-component.bordered td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Bordered style */\n.my-table-component.grid th,\n.my-table-component.grid td {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid th {\n border-bottom-width: 1px; /* Ensure bottom border is consistent */\n}\n\n.my-table-component.grid {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6); /* Outer border */\n border-right-width: 0;\n border-bottom-width: 0;\n}\n\n.my-table-component.grid th:last-child,\n.my-table-component.grid td:last-child {\n border-right: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid tr:last-child td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Striped style */\n.my-table-component.striped tbody tr:nth-child(even) td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n/* Hover (optional, but nice) */\n.my-table-component tbody tr:hover td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.flex {\n display: flex;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 0.5rem;\n}\n\n.match-info-item {\n display: flex;\n}\n\n.match-info-item-label {\n margin-right: 6px;\n}\n\n.info-icon:hover {\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__empty p {\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n\n.no-wrap {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.eventNameContainer__item {\n line-height: 1rem;\n}\n.eventNameContainer__item--title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 300px;\n}\n@container (max-width: 600px) {\n .eventNameContainer__item--title {\n max-width: 180px;\n }\n}\n@container (max-width: 500px) {\n .eventNameContainer__item--title {\n max-width: 150px;\n }\n}\n@container (max-width: 400px) {\n .eventNameContainer__item--title {\n max-width: 100px;\n }\n}\n@container (max-width: 330px) {\n .eventNameContainer__item--title {\n max-width: 70px;\n }\n}\n\n.LotteryTippingTicketBet__main {\n perspective: 800px;\n will-change: transform, opacity;\n backface-visibility: hidden;\n}\n\n@container (max-width: 520px) {\n .LotteryTippingTicketBet__main {\n flex-wrap: wrap;\n justify-content: center;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}";
4477
+ const LotteryOddsbomTicketResultStyle0 = lotteryOddsbomTicketResultCss;
4478
+
4479
+ const LotteryOddsbomTicketResult = class {
4480
+ constructor(hostRef) {
4481
+ registerInstance(this, hostRef);
4482
+ this.latestRequestId = 0;
4483
+ this.mbSource = undefined;
4484
+ this.clientStyling = undefined;
4485
+ this.clientStylingUrl = undefined;
4486
+ this.translationUrl = '';
4487
+ this.language = 'en';
4488
+ this.sessionId = undefined;
4489
+ this.endpoint = '';
4490
+ this.gameId = undefined;
4491
+ this.drawId = undefined;
4492
+ this.defaultResults = undefined;
4493
+ this.splitView = false;
4494
+ this.allResults = undefined;
4495
+ this.ticketBetDataSource = [];
4496
+ this.isLoading = false;
4497
+ }
4498
+ handleClientStylingChange(newValue, oldValue) {
4499
+ if (newValue !== oldValue) {
4500
+ setClientStyling(this.stylingContainer, this.clientStyling);
4501
+ }
4502
+ }
4503
+ handleClientStylingUrlChange(newValue, oldValue) {
4504
+ if (newValue !== oldValue) {
4505
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4506
+ }
4507
+ }
4508
+ handleMbSourceChange(newValue, oldValue) {
4509
+ if (newValue !== oldValue) {
4510
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4511
+ }
4512
+ }
4513
+ componentDidLoad() {
4514
+ if (this.stylingContainer) {
4515
+ if (this.mbSource)
4516
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4517
+ if (this.clientStyling)
4518
+ setClientStyling(this.stylingContainer, this.clientStyling);
4519
+ if (this.clientStylingUrl)
4520
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4521
+ }
4522
+ }
4523
+ disconnectedCallback() {
4524
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4525
+ }
4526
+ componentWillLoad() {
4527
+ resolveTranslationUrl(this.translationUrl);
4528
+ this.fetchMatchData();
4529
+ }
4530
+ async fetchMatchData() {
4531
+ const currentId = ++this.latestRequestId;
4532
+ if (!this.gameId || !this.drawId) {
4533
+ return;
4534
+ }
4535
+ try {
4536
+ if (this.defaultResults)
4537
+ this.allResults = JSON.parse(this.defaultResults);
4538
+ this.isLoading = true;
4539
+ const res = await buildTicketBetDataSource({
4540
+ endpoint: this.endpoint,
4541
+ gameId: this.gameId,
4542
+ drawId: this.drawId,
4543
+ results: this.allResults || [[]],
4544
+ splitView: this.splitView
4545
+ });
4546
+ if (currentId === this.latestRequestId) {
4547
+ this.ticketBetDataSource = res;
4548
+ }
4549
+ }
4550
+ finally {
4551
+ if (currentId === this.latestRequestId) {
4552
+ this.isLoading = false;
4553
+ }
4554
+ }
4555
+ }
4556
+ get columns() {
4557
+ const dateRender = (_, value) => formatDate({ date: value, format: 'ccc dd/MM HH:mm' });
4558
+ if (this.splitView) {
4559
+ return [
4560
+ {
4561
+ title: 'No.',
4562
+ value: 'index',
4563
+ width: 5,
4564
+ rowSpan: 2
4565
+ },
4566
+ {
4567
+ title: 'Date',
4568
+ value: 'startTime',
4569
+ width: 25,
4570
+ rowSpan: 2,
4571
+ nowrap: true,
4572
+ render: dateRender
4573
+ },
4574
+ {
4575
+ title: 'Team',
4576
+ value: 'teamName',
4577
+ width: 30
4578
+ },
4579
+ {
4580
+ title: 'Scores',
4581
+ value: 'results',
4582
+ width: 45,
4583
+ render: (_, value) => (h("div", { class: "flex gap-1" }, value.map((i) => (h("lottery-oddsbom-bullet", { text: i, "is-reading": true, "is-selected": true })))))
4584
+ }
4585
+ ];
4586
+ }
4587
+ const eventNameRender = (_, value) => (h("div", { class: "flex gap-1 eventNameContainer__item" }, h("span", { class: "eventNameContainer__item--title" }, value)));
4588
+ return [
4589
+ {
4590
+ title: 'Match',
4591
+ value: 'eventName',
4592
+ width: 50,
4593
+ render: eventNameRender
4594
+ },
4595
+ {
4596
+ title: 'Date',
4597
+ value: 'startTime',
4598
+ width: 25,
4599
+ nowrap: true,
4600
+ render: dateRender
4601
+ },
4602
+ {
4603
+ title: 'Match Result',
4604
+ value: 'results',
4605
+ width: 25,
4606
+ render: (_, value) => h("div", null, value === null || value === void 0 ? void 0 : value[0])
4607
+ }
4608
+ ];
4609
+ }
4610
+ renderLoading() {
4611
+ 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" }))));
4612
+ }
4613
+ renderEmpty() {
4614
+ return (h("div", { class: "LotteryTippingTicketBet__empty" }, h("p", null, translate('noData', this.language))));
4615
+ }
4616
+ renderTable({ columns, dataSource, hideHead = false, grid = true, bordered = true }) {
4617
+ const skipMap = {};
4618
+ return (h("table", { class: { bordered: bordered, grid: grid, 'my-table-component': true } }, !hideHead && (h("thead", null, h("tr", null, columns.map((column) => {
4619
+ var _a;
4620
+ return (h("th", { key: column.value, style: { width: column.width + '%', textAlign: column.align } }, typeof column.title === 'string' ? column.title : (_a = column.title) === null || _a === void 0 ? void 0 : _a.call(column)));
4621
+ })))), h("tbody", null, dataSource.map((row, index) => (h("tr", { key: index }, columns.map((column) => {
4622
+ if (skipMap[column.value] && skipMap[column.value] > 0) {
4623
+ skipMap[column.value]--;
4624
+ return null;
4625
+ }
4626
+ const span = column.rowSpan;
4627
+ if (span && span > 1) {
4628
+ skipMap[column.value] = span - 1;
4629
+ }
4630
+ return (h("td", { key: column.value, rowSpan: span, style: { width: column.width + '%', textAlign: column.align }, class: { 'no-wrap': column.nowrap } }, column.render ? column.render(row, row[column.value], index) : row[column.value]));
4631
+ })))))));
4632
+ }
4633
+ renderContent() {
4634
+ if (this.isLoading) {
4635
+ return this.renderLoading();
4636
+ }
4637
+ if (!this.ticketBetDataSource || this.ticketBetDataSource.length === 0) {
4638
+ return this.renderEmpty();
4639
+ }
4640
+ return (h("div", { class: "flex align-center LotteryTippingTicketBet__main" }, this.renderTable({
4641
+ columns: this.columns,
4642
+ dataSource: this.ticketBetDataSource || [],
4643
+ hideHead: false,
4644
+ grid: false,
4645
+ bordered: false
4646
+ })));
4647
+ }
4648
+ render() {
4649
+ return (h("div", { key: '9932926b2958b13636d617cc20a0c77a76a36ebe', ref: (el) => (this.stylingContainer = el), class: "LotteryTippingTicketBet__container" }, this.renderContent()));
4650
+ }
4651
+ static get watchers() { return {
4652
+ "clientStyling": ["handleClientStylingChange"],
4653
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4654
+ "mbSource": ["handleMbSourceChange"],
4655
+ "gameId": ["fetchMatchData"],
4656
+ "drawId": ["fetchMatchData"],
4657
+ "defaultResults": ["fetchMatchData"]
4658
+ }; }
4659
+ };
4660
+ LotteryOddsbomTicketResult.style = LotteryOddsbomTicketResultStyle0;
4661
+
4662
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
4663
+ const UiSkeletonStyle0 = uiSkeletonCss;
4664
+
4665
+ const UiSkeleton = class {
4666
+ constructor(hostRef) {
4667
+ registerInstance(this, hostRef);
4668
+ this.stylingValue = {
4669
+ width: this.handleStylingProps(this.width),
4670
+ height: this.handleStylingProps(this.height),
4671
+ borderRadius: this.handleStylingProps(this.borderRadius),
4672
+ marginBottom: this.handleStylingProps(this.marginBottom),
4673
+ marginTop: this.handleStylingProps(this.marginTop),
4674
+ marginLeft: this.handleStylingProps(this.marginLeft),
4675
+ marginRight: this.handleStylingProps(this.marginRight),
4676
+ size: this.handleStylingProps(this.size),
4677
+ };
4678
+ this.structure = undefined;
4679
+ this.width = 'unset';
4680
+ this.height = 'unset';
4681
+ this.borderRadius = 'unset';
4682
+ this.marginBottom = 'unset';
4683
+ this.marginTop = 'unset';
4684
+ this.marginLeft = 'unset';
4685
+ this.marginRight = 'unset';
4686
+ this.animation = true;
4687
+ this.rows = 0;
4688
+ this.size = '100%';
4689
+ }
4690
+ handleStructureChange(newValue, oldValue) {
4691
+ if (oldValue !== newValue) {
4692
+ this.handleStructure(newValue);
4693
+ }
4694
+ }
4695
+ handleStylingProps(value) {
4696
+ switch (typeof value) {
4697
+ case 'number':
4698
+ return value === 0 ? 0 : `${value}px`;
4699
+ case 'undefined':
4700
+ return 'unset';
4701
+ case 'string':
4702
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
4703
+ value.endsWith('px') ||
4704
+ value.endsWith('%')) {
4705
+ return value;
4706
+ }
4707
+ else {
4708
+ return 'unset';
4709
+ }
4710
+ default:
4711
+ return 'unset';
4712
+ }
4713
+ }
4714
+ handleStructure(structure) {
4715
+ switch (structure) {
4716
+ case 'logo':
4717
+ return this.renderLogo();
4718
+ case 'image':
4719
+ return this.renderImage();
4720
+ case 'title':
4721
+ return this.renderTitle();
4722
+ case 'text':
4723
+ return this.renderText();
4724
+ case 'rectangle':
4725
+ return this.renderRectangle();
4726
+ case 'circle':
4727
+ return this.renderCircle();
4728
+ default:
4729
+ return null;
4730
+ }
4731
+ }
4732
+ renderLogo() {
4733
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonLogo ' + (this.animation ? 'Skeleton' : '') })));
4734
+ }
4735
+ renderImage() {
4736
+ return h("div", { class: 'SkeletonImage ' + (this.animation ? 'Skeleton' : '') });
4737
+ }
4738
+ renderTitle() {
4739
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonTitle ' + (this.animation ? 'Skeleton' : '') })));
4740
+ }
4741
+ renderText() {
4742
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'SkeletonText ' + (this.animation ? 'Skeleton' : '') })))));
4743
+ }
4744
+ renderRectangle() {
4745
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonRectangle ' + (this.animation ? 'Skeleton' : '') })));
4746
+ }
4747
+ renderCircle() {
4748
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonCircle ' + (this.animation ? 'Skeleton' : '') })));
4749
+ }
4750
+ render() {
4751
+ let styleBlock = '';
4752
+ switch (this.structure) {
4753
+ case 'logo':
4754
+ styleBlock = `
4755
+ :host {
4756
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
4757
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
4758
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
4759
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
4760
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
4761
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
4762
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
4763
+ }
4764
+ `;
4765
+ break;
4766
+ case 'image':
4767
+ styleBlock = `
4768
+ :host {
4769
+ --emw-skeleton-image-width: ${this.stylingValue.width};
4770
+ --emw-skeleton-image-height: ${this.stylingValue.height};
4771
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
4772
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
4773
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
4774
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
4775
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
4776
+ }
4777
+ `;
4778
+ break;
4779
+ case 'title':
4780
+ styleBlock = `
4781
+ :host {
4782
+ --emw-skeleton-title-width: ${this.stylingValue.width};
4783
+ --emw-skeleton-title-height: ${this.stylingValue.height};
4784
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
4785
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
4786
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
4787
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
4788
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
4789
+ }
4790
+ `;
4791
+ break;
4792
+ case 'text':
4793
+ styleBlock = `
4794
+ :host {
4795
+ --emw-skeleton-text-width: ${this.stylingValue.width};
4796
+ --emw-skeleton-text-height: ${this.stylingValue.height};
4797
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
4798
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
4799
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
4800
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
4801
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
4802
+ }
4803
+ `;
4804
+ break;
4805
+ case 'rectangle':
4806
+ styleBlock = `
4807
+ :host {
4808
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
4809
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
4810
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
4811
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
4812
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
4813
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
4814
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
4815
+ }
4816
+ `;
4817
+ break;
4818
+ case 'circle':
4819
+ styleBlock = `
4820
+ :host {
4821
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
4822
+ }
4823
+ `;
4824
+ break;
4825
+ default:
4826
+ styleBlock = '';
4827
+ }
4828
+ return (h(Host, { key: 'c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8' }, h("style", { key: '9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19' }, styleBlock), this.handleStructure(this.structure)));
4829
+ }
4830
+ static get watchers() { return {
4831
+ "structure": ["handleStructureChange"]
4832
+ }; }
4833
+ };
4834
+ UiSkeleton.style = UiSkeletonStyle0;
4835
+
4836
+ export { HelperDateNavigator as helper_date_navigator, LotteryOddsbomBomb as lottery_oddsbom_bomb, LotteryOddsbomBullet as lottery_oddsbom_bullet, LotteryOddsbomLatestResult as lottery_oddsbom_latest_result, LotteryOddsbomLatestResultGroup as lottery_oddsbom_latest_result_group, LotteryOddsbomTicketResult as lottery_oddsbom_ticket_result, UiSkeleton as ui_skeleton };