@everymatrix/lottery-tipping-latest-result 1.83.5 → 1.83.7

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.
@@ -1,5 +1,58 @@
1
1
  import { r as registerInstance, h } from './index-32d8a144.js';
2
2
 
3
+ // This icon file is generated automatically.
4
+ 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" };
5
+ const LeftOutlined$1 = LeftOutlined;
6
+
7
+ // This icon file is generated automatically.
8
+ 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" };
9
+ const RightOutlined$1 = RightOutlined;
10
+
11
+ var __assign = (undefined && undefined.__assign) || function () {
12
+ __assign = Object.assign || function(t) {
13
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
14
+ s = arguments[i];
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
16
+ t[p] = s[p];
17
+ }
18
+ return t;
19
+ };
20
+ return __assign.apply(this, arguments);
21
+ };
22
+ var defaultColors = {
23
+ primaryColor: '#333',
24
+ secondaryColor: '#E6E6E6'
25
+ };
26
+ function renderIconDefinitionToSVGElement(icond, options) {
27
+ if (options === void 0) { options = {}; }
28
+ if (typeof icond.icon === 'function') {
29
+ // two-tone
30
+ var placeholders = options.placeholders || defaultColors;
31
+ return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
32
+ }
33
+ // fill, outline
34
+ return renderAbstractNodeToSVGElement(icond.icon, options);
35
+ }
36
+ function renderAbstractNodeToSVGElement(node, options) {
37
+ var targetAttrs = node.tag === 'svg'
38
+ ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
39
+ var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
40
+ var key = nextKey;
41
+ var value = targetAttrs[key];
42
+ var token = "".concat(key, "=\"").concat(value, "\"");
43
+ acc.push(token);
44
+ return acc;
45
+ }, []);
46
+ var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
47
+ var children = (node.children || [])
48
+ .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
49
+ .join('');
50
+ if (children && children.length) {
51
+ return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
52
+ }
53
+ return "<".concat(node.tag).concat(attrsToken, " />");
54
+ }
55
+
3
56
  /**
4
57
  * @name setClientStyling
5
58
  * @description Method used to create and append to the passed element of the widget a style element with the content received
@@ -57,59 +110,168 @@ function setStreamStyling(stylingContainer, domain, subscription) {
57
110
  }
58
111
  }
59
112
 
60
- // This icon file is generated automatically.
61
- 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" };
62
- const LeftOutlined$1 = LeftOutlined;
113
+ function _typeof(o) {
114
+ "@babel/helpers - typeof";
63
115
 
64
- // This icon file is generated automatically.
65
- 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" };
66
- const RightOutlined$1 = RightOutlined;
116
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
117
+ return typeof o;
118
+ } : function (o) {
119
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
120
+ }, _typeof(o);
121
+ }
67
122
 
68
- var __assign = (undefined && undefined.__assign) || function () {
69
- __assign = Object.assign || function(t) {
70
- for (var s, i = 1, n = arguments.length; i < n; i++) {
71
- s = arguments[i];
72
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
73
- t[p] = s[p];
74
- }
75
- return t;
76
- };
77
- return __assign.apply(this, arguments);
78
- };
79
- var defaultColors = {
80
- primaryColor: '#333',
81
- secondaryColor: '#E6E6E6'
82
- };
83
- function renderIconDefinitionToSVGElement(icond, options) {
84
- if (options === void 0) { options = {}; }
85
- if (typeof icond.icon === 'function') {
86
- // two-tone
87
- var placeholders = options.placeholders || defaultColors;
88
- return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
89
- }
90
- // fill, outline
91
- return renderAbstractNodeToSVGElement(icond.icon, options);
123
+ function requiredArgs(required, args) {
124
+ if (args.length < required) {
125
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
126
+ }
92
127
  }
93
- function renderAbstractNodeToSVGElement(node, options) {
94
- var targetAttrs = node.tag === 'svg'
95
- ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
96
- var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
97
- var key = nextKey;
98
- var value = targetAttrs[key];
99
- var token = "".concat(key, "=\"").concat(value, "\"");
100
- acc.push(token);
101
- return acc;
102
- }, []);
103
- var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
104
- var children = (node.children || [])
105
- .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
106
- .join('');
107
- if (children && children.length) {
108
- return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
128
+
129
+ /**
130
+ * @name toDate
131
+ * @category Common Helpers
132
+ * @summary Convert the given argument to an instance of Date.
133
+ *
134
+ * @description
135
+ * Convert the given argument to an instance of Date.
136
+ *
137
+ * If the argument is an instance of Date, the function returns its clone.
138
+ *
139
+ * If the argument is a number, it is treated as a timestamp.
140
+ *
141
+ * If the argument is none of the above, the function returns Invalid Date.
142
+ *
143
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
144
+ *
145
+ * @param {Date|Number} argument - the value to convert
146
+ * @returns {Date} the parsed date in the local time zone
147
+ * @throws {TypeError} 1 argument required
148
+ *
149
+ * @example
150
+ * // Clone the date:
151
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
152
+ * //=> Tue Feb 11 2014 11:30:30
153
+ *
154
+ * @example
155
+ * // Convert the timestamp to date:
156
+ * const result = toDate(1392098430000)
157
+ * //=> Tue Feb 11 2014 11:30:30
158
+ */
159
+ function toDate(argument) {
160
+ requiredArgs(1, arguments);
161
+ var argStr = Object.prototype.toString.call(argument);
162
+
163
+ // Clone the date
164
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
165
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
166
+ return new Date(argument.getTime());
167
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
168
+ return new Date(argument);
169
+ } else {
170
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
171
+ // eslint-disable-next-line no-console
172
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
173
+ // eslint-disable-next-line no-console
174
+ console.warn(new Error().stack);
109
175
  }
110
- return "<".concat(node.tag).concat(attrsToken, " />");
176
+ return new Date(NaN);
177
+ }
178
+ }
179
+
180
+ /**
181
+ * @name differenceInMilliseconds
182
+ * @category Millisecond Helpers
183
+ * @summary Get the number of milliseconds between the given dates.
184
+ *
185
+ * @description
186
+ * Get the number of milliseconds between the given dates.
187
+ *
188
+ * @param {Date|Number} dateLeft - the later date
189
+ * @param {Date|Number} dateRight - the earlier date
190
+ * @returns {Number} the number of milliseconds
191
+ * @throws {TypeError} 2 arguments required
192
+ *
193
+ * @example
194
+ * // How many milliseconds are between
195
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
196
+ * const result = differenceInMilliseconds(
197
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
198
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
199
+ * )
200
+ * //=> 1100
201
+ */
202
+ function differenceInMilliseconds(dateLeft, dateRight) {
203
+ requiredArgs(2, arguments);
204
+ return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
111
205
  }
112
206
 
207
+ const DEFAULT_LANGUAGE = 'en';
208
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
209
+ const TRANSLATIONS = {
210
+ en: {
211
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
212
+ bettingType: 'Betting Type:',
213
+ prizeAllocation: 'Prize Allocation (Turnover: €{turnover})',
214
+ prizes: 'Prizes',
215
+ numberOfWinners: 'Number of Winners',
216
+ prizeMoney: 'Prize Money',
217
+ noLatestResult: 'No latest result.',
218
+ loading: 'Loading....'
219
+ },
220
+ ro: {
221
+ bettingType: 'Tip de pariu:',
222
+ prizeAllocation: 'Alocarea premiilor (Cifră de afaceri: €{turnover})',
223
+ prizes: 'Premii',
224
+ numberOfWinners: 'Număr de câștigători',
225
+ prizeMoney: 'Bani de premiu',
226
+ noLatestResult: 'Niciun rezultat recent.',
227
+ loading: 'Se încarcă....'
228
+ },
229
+ fr: {
230
+ bettingType: 'Type de pari:',
231
+ prizeAllocation: "Répartition des prix (Chiffre d'affaires: € {turnover})",
232
+ prizes: 'Prix',
233
+ numberOfWinners: 'Nombre de gagnants',
234
+ prizeMoney: 'Prix en argent',
235
+ noLatestResult: 'Aucun résultat récent.',
236
+ loading: 'Chargement....'
237
+ },
238
+ ar: {
239
+ bettingType: 'نوع الرهان:',
240
+ prizeAllocation: 'تخصيص الجائزة (دوران: € {turnover})',
241
+ prizes: 'الجوائز',
242
+ numberOfWinners: 'عدد الفائزين',
243
+ prizeMoney: 'أموال الجائزة',
244
+ noLatestResult: 'لا يوجد أحدث نتيجة.',
245
+ loading: 'جار التحميل....'
246
+ },
247
+ hr: {
248
+ bettingType: 'Vrsta oklade:',
249
+ prizeAllocation: 'Raspodjela nagrada (Promet: € {turnover})',
250
+ prizes: 'Nagrade',
251
+ numberOfWinners: 'Broj pobjednika',
252
+ prizeMoney: 'Novčana nagrada',
253
+ noLatestResult: 'Nema najnovijih rezultata.',
254
+ loading: 'Učitavanje....'
255
+ }
256
+ };
257
+ const translate = (key, customLang, replacements) => {
258
+ const lang = customLang;
259
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
260
+ if (replacements) {
261
+ Object.keys(replacements).forEach((placeholder) => {
262
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
263
+ });
264
+ }
265
+ return translation;
266
+ };
267
+ const getTranslations = (data) => {
268
+ Object.keys(data).forEach((item) => {
269
+ for (let key in data[item]) {
270
+ TRANSLATIONS[item][key] = data[item][key];
271
+ }
272
+ });
273
+ };
274
+
113
275
  const generateUUID = () => {
114
276
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
115
277
  var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
@@ -256,6 +418,12 @@ function thousandSeperator(value) {
256
418
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
257
419
  return parts.join('.');
258
420
  }
421
+ function formattedTurnover(turnover) {
422
+ if (turnover === null || turnover === undefined)
423
+ return '';
424
+ const unit = '€';
425
+ return `${unit}${turnover ? thousandSeperator(turnover) : 0}`;
426
+ }
259
427
  async function fetchGameInfo(endpoint, gameId) {
260
428
  try {
261
429
  const response = await fetchRequest(`${endpoint}/games/${gameId}`, 'GET', {});
@@ -267,168 +435,6 @@ async function fetchGameInfo(endpoint, gameId) {
267
435
  }
268
436
  }
269
437
 
270
- function _typeof(o) {
271
- "@babel/helpers - typeof";
272
-
273
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
274
- return typeof o;
275
- } : function (o) {
276
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
277
- }, _typeof(o);
278
- }
279
-
280
- function requiredArgs(required, args) {
281
- if (args.length < required) {
282
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
283
- }
284
- }
285
-
286
- /**
287
- * @name toDate
288
- * @category Common Helpers
289
- * @summary Convert the given argument to an instance of Date.
290
- *
291
- * @description
292
- * Convert the given argument to an instance of Date.
293
- *
294
- * If the argument is an instance of Date, the function returns its clone.
295
- *
296
- * If the argument is a number, it is treated as a timestamp.
297
- *
298
- * If the argument is none of the above, the function returns Invalid Date.
299
- *
300
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
301
- *
302
- * @param {Date|Number} argument - the value to convert
303
- * @returns {Date} the parsed date in the local time zone
304
- * @throws {TypeError} 1 argument required
305
- *
306
- * @example
307
- * // Clone the date:
308
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
309
- * //=> Tue Feb 11 2014 11:30:30
310
- *
311
- * @example
312
- * // Convert the timestamp to date:
313
- * const result = toDate(1392098430000)
314
- * //=> Tue Feb 11 2014 11:30:30
315
- */
316
- function toDate(argument) {
317
- requiredArgs(1, arguments);
318
- var argStr = Object.prototype.toString.call(argument);
319
-
320
- // Clone the date
321
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
322
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
323
- return new Date(argument.getTime());
324
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
325
- return new Date(argument);
326
- } else {
327
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
328
- // eslint-disable-next-line no-console
329
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
330
- // eslint-disable-next-line no-console
331
- console.warn(new Error().stack);
332
- }
333
- return new Date(NaN);
334
- }
335
- }
336
-
337
- /**
338
- * @name differenceInMilliseconds
339
- * @category Millisecond Helpers
340
- * @summary Get the number of milliseconds between the given dates.
341
- *
342
- * @description
343
- * Get the number of milliseconds between the given dates.
344
- *
345
- * @param {Date|Number} dateLeft - the later date
346
- * @param {Date|Number} dateRight - the earlier date
347
- * @returns {Number} the number of milliseconds
348
- * @throws {TypeError} 2 arguments required
349
- *
350
- * @example
351
- * // How many milliseconds are between
352
- * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
353
- * const result = differenceInMilliseconds(
354
- * new Date(2014, 6, 2, 12, 30, 21, 700),
355
- * new Date(2014, 6, 2, 12, 30, 20, 600)
356
- * )
357
- * //=> 1100
358
- */
359
- function differenceInMilliseconds(dateLeft, dateRight) {
360
- requiredArgs(2, arguments);
361
- return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
362
- }
363
-
364
- const DEFAULT_LANGUAGE = 'en';
365
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
366
- const TRANSLATIONS = {
367
- en: {
368
- weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
369
- bettingType: 'Betting Type:',
370
- prizeAllocation: 'Prize Allocation (Turnover: € {turnover})',
371
- prizes: 'Prizes',
372
- numberOfWinners: 'Number of Winners',
373
- prizeMoney: 'Prize Money',
374
- noLatestResult: 'No latest result.',
375
- loading: 'Loading....'
376
- },
377
- ro: {
378
- bettingType: 'Tip de pariu:',
379
- prizeAllocation: 'Alocarea premiilor (Cifră de afaceri: € {turnover})',
380
- prizes: 'Premii',
381
- numberOfWinners: 'Număr de câștigători',
382
- prizeMoney: 'Bani de premiu',
383
- noLatestResult: 'Niciun rezultat recent.',
384
- loading: 'Se încarcă....'
385
- },
386
- fr: {
387
- bettingType: 'Type de pari:',
388
- prizeAllocation: "Répartition des prix (Chiffre d'affaires: € {turnover})",
389
- prizes: 'Prix',
390
- numberOfWinners: 'Nombre de gagnants',
391
- prizeMoney: 'Prix en argent',
392
- noLatestResult: 'Aucun résultat récent.',
393
- loading: 'Chargement....'
394
- },
395
- ar: {
396
- bettingType: 'نوع الرهان:',
397
- prizeAllocation: 'تخصيص الجائزة (دوران: € {turnover})',
398
- prizes: 'الجوائز',
399
- numberOfWinners: 'عدد الفائزين',
400
- prizeMoney: 'أموال الجائزة',
401
- noLatestResult: 'لا يوجد أحدث نتيجة.',
402
- loading: 'جار التحميل....'
403
- },
404
- hr: {
405
- bettingType: 'Vrsta oklade:',
406
- prizeAllocation: 'Raspodjela nagrada (Promet: € {turnover})',
407
- prizes: 'Nagrade',
408
- numberOfWinners: 'Broj pobjednika',
409
- prizeMoney: 'Novčana nagrada',
410
- noLatestResult: 'Nema najnovijih rezultata.',
411
- loading: 'Učitavanje....'
412
- }
413
- };
414
- const translate = (key, customLang, replacements) => {
415
- const lang = customLang;
416
- let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
417
- if (replacements) {
418
- Object.keys(replacements).forEach((placeholder) => {
419
- translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
420
- });
421
- }
422
- return translation;
423
- };
424
- const getTranslations = (data) => {
425
- Object.keys(data).forEach((item) => {
426
- for (let key in data[item]) {
427
- TRANSLATIONS[item][key] = data[item][key];
428
- }
429
- });
430
- };
431
-
432
438
  const lotteryTippingLatestResultCss = ".lottery-tipping-latest-result {\n padding: 16px;\n container-type: inline-size;\n background-color: var(--emw--color-background, #fff);\n}\n.lottery-tipping-latest-result .date-selection {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 24px;\n width: 400px;\n}\n.lottery-tipping-latest-result .date-selection-leftIcon, .lottery-tipping-latest-result .date-selection-rightIcon {\n cursor: pointer;\n}\n\n.LotteryTippingTicketController__segmented-control {\n height: 2.2rem;\n display: inline-flex;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 2rem;\n padding: 0.2rem;\n}\n.LotteryTippingTicketController__segment {\n background-color: transparent;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n transition: background-color 0.25s ease, color 0.25s ease;\n white-space: nowrap;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketController__segment--active {\n background-color: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n}\n.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.betting-type {\n margin-bottom: 16px;\n display: flex;\n align-items: center;\n gap: 20px;\n}\n.betting-type-title {\n font-weight: 600;\n font-size: 16px;\n color: var(--emw--color-typography-secondary, #333);\n}\n.betting-type-text {\n font-size: 16px;\n}\n\n.result-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 60%;\n margin: 0 auto;\n}\n.result-wrapper .winning-result {\n width: 100%;\n margin-top: 20px;\n}\n.result-wrapper .prize-result {\n width: 100%;\n margin-top: 20px;\n}\n.result-wrapper .prize-result-title {\n font-size: 16px;\n font-weight: 600;\n margin-bottom: 12px;\n color: var(--emw--color-typography-secondary, #333);\n}\n.result-wrapper .prize-result-table {\n width: 100%;\n}\n.result-wrapper .prize-result-table-row {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n}\n.result-wrapper .prize-result-table-column {\n text-align: left;\n padding: 12px 14px;\n width: 160px;\n font-size: 14px;\n width: calc((100% - 2px) / 3);\n color: var(--emw--color-typography, #000);\n}\n.result-wrapper .prize-result-table-header {\n width: 100%;\n background-color: var(--emw--color-background-secondary, #e6e6e6);\n border-radius: 4px;\n}\n.result-wrapper .prize-result-table-body {\n background-color: var(--emw--color-background-tertiary, #fff);\n}\n.result-wrapper .prize-result-table .prize-result-table-header .prize-result-table-column {\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n border-right: 1px solid var(--emw--color-background, #fff);\n}\n.result-wrapper .prize-result-table .prize-result-table-body .prize-result-table-row:hover {\n color: var(--emw--color-typography, #000);\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n@container (max-width: 980px) and (min-width: 780px) {\n .result-wrapper {\n width: 84%;\n }\n}\n@container (max-width: 780px) and (min-width: 480px) {\n .result-wrapper {\n width: 100%;\n }\n}\n@container (max-width: 480px) {\n .result-wrapper {\n width: 100%;\n }\n .result-wrapper .winning-result {\n width: 100%;\n margin-top: 14px;\n }\n .result-wrapper .prize-result {\n width: 100%;\n }\n .result-wrapper .prize-result-table-column {\n padding: 6px;\n width: 100px;\n }\n}";
433
439
  const LotteryTippingLatestResultStyle0 = lotteryTippingLatestResultCss;
434
440
 
@@ -574,6 +580,17 @@ const LotteryTippingLatestResult = class {
574
580
  this.isLoading = false;
575
581
  }
576
582
  }
583
+ get displayedPrizes() {
584
+ const correctItems = this.curPrizes
585
+ .filter((item) => item.divisionDisplayName.includes('Correct'))
586
+ .sort((a, b) => {
587
+ const numA = Number(a.divisionDisplayName.match(/\d+/)[0]);
588
+ const numB = Number(b === null || b === void 0 ? void 0 : b.divisionDisplayName.match(/\d+/)[0]);
589
+ return numB - numA;
590
+ });
591
+ const bonusItems = this.curPrizes.filter((item) => item.divisionDisplayName === 'Bonus');
592
+ return [...correctItems, ...bonusItems];
593
+ }
577
594
  changeCurDateItem(idx) {
578
595
  this.lastestDate = this.hasDrawDates[idx];
579
596
  this.curDrawItemIdx = idx;
@@ -615,6 +632,7 @@ const LotteryTippingLatestResult = class {
615
632
  this.curDrawSelectionBettingType = bettingType;
616
633
  this.curDrawSelection = this.curDrawSelectionMap[this.curDrawSelectionBettingType];
617
634
  this.curPrizes = this.curPrizeMap[this.curDrawSelectionBettingType];
635
+ console.log('this.curPrizes', this.curPrizes);
618
636
  this.curTurnOver = this.curPrizes.reduce((acc, cur) => acc + Number(cur.totalAmount.value), 0);
619
637
  }
620
638
  getBettingTypeName(bettingType) {
@@ -623,10 +641,10 @@ const LotteryTippingLatestResult = class {
623
641
  return name !== null && name !== void 0 ? name : bettingType;
624
642
  }
625
643
  render() {
626
- return (h("div", { key: 'e745605e51cfb92c4503b5e96e0142c8c6b4a8d0', class: "lottery-tipping-latest-result", ref: (el) => (this.stylingContainer = el) }, this.curDrawSelection && this.curDrawSelection.length > 0 && (h("div", { key: 'ae825710096f1ec467379bd8c62ee57a7ed472e5', class: "result-wrapper" }, h("div", { key: '1bb57f7cce3985f991eecc95546d2716b7960b17', class: "date-selection" }, h("div", { key: '9798fd769521260bf8c8e264a6eda272fb4b2841', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: this.preDraw.bind(this) }), h("div", { key: '8ba6a02c69cc4c3b943a8995deaa9d9ceeb2544a', class: "date-selection-calendar" }, h("lottery-tipping-calendar", { key: '21952e766dc6277a7b894bb98bc608431a418bf3', date: this.lastestDate, highLightDates: this.hasDrawDates, language: this.language, "mb-source": this.mbSource, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl })), h("div", { key: 'ba4cf48d9233ff3c2d3cc869c08ec4ec4c6b5d94', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: this.nextDraw.bind(this) })), h("div", { key: 'f7dff45466ead7e98665e9feeb490d3814511a5c', class: "winning-result" }, h("div", { key: '323148d834a1857ee356724f999f295a4b89692e', class: "betting-type" }, h("div", { key: '45ec8ea6fdd52a566f718d17b9d11c3417e4ce6f', class: "betting-type-title" }, translate('bettingType', this.language)), h("div", { key: 'e61f4334b41095ec94c61a62d671985686120c72', class: "betting-type-text" }, h("div", { key: '683f2f04744b484cadcb1ad11118356359eba91c', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
644
+ return (h("div", { key: '896146c7c069e71fe6f652527c0086d942a23aa7', class: "lottery-tipping-latest-result", ref: (el) => (this.stylingContainer = el) }, this.curDrawSelection && this.curDrawSelection.length > 0 && (h("div", { key: '7098b4ad44e5ef8ca1b9c3df95dfccdb375a9867', class: "result-wrapper" }, h("div", { key: '14254a04b639a9ae0d8e7ee6fd8abb1938dc1c36', class: "date-selection" }, h("div", { key: '0f70418f699fa6884cd910ce46affd62e332267b', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: this.preDraw.bind(this) }), h("div", { key: 'eb75d194c50a888a4ce2b57719da3d91b1718ea0', class: "date-selection-calendar" }, h("lottery-tipping-calendar", { key: 'feee855ed9c8e7afa3138c0bf92b821f6ab36421', date: this.lastestDate, highLightDates: this.hasDrawDates, language: this.language, "mb-source": this.mbSource, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl })), h("div", { key: '65c44ad37658cc2a523db08419ba7ea1d383840f', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: this.nextDraw.bind(this) })), h("div", { key: '829ccba627f01454dc8eb307a6377c893bdea8c5', class: "winning-result" }, h("div", { key: '20952759d278b8727b4013e41f6227127a776ac7', class: "betting-type" }, h("div", { key: '802989e535ebdb2059681740587b476c812e35b4', class: "betting-type-title" }, translate('bettingType', this.language)), h("div", { key: 'aa69117cbb91fb269a66e2aab97309b06dfecd57', class: "betting-type-text" }, h("div", { key: '708ec51e5d307b1e27ff3ad4a2f0e43195e4a944', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
627
645
  LotteryTippingTicketController__segment: true,
628
646
  'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
629
- }, onClick: this.handleDrawBettingTypeChange.bind(this, bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: 'e6754f5ad0f7a26625731a34c823db145f98cce8', "session-id": this.sessionId, endpoint: this.endpoint, "game-id": this.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "mb-source": this.mbSource, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl })), h("div", { key: '8ba16a8c5472176ccf6402fa37149a4aef36a7d4', class: "prize-result" }, h("div", { key: '222fdca860622286275a1eca6fea94ae1aa5630e', class: "prize-result-title" }, translate('prizeAllocation', this.language, { turnover: thousandSeperator(this.curTurnOver) })), h("div", { key: 'c059684d4b8cfdb361224e031de3b72d83b25b47', class: "prize-result-table" }, h("div", { key: '617e627a32793cec2f18a51a3ec34821e413e539', class: "prize-result-table-header" }, h("div", { key: 'f43417f07f2a05e0438505a90217cc2dfea733f7', class: "prize-result-table-row" }, h("div", { key: '28a80707e4e1e4baacf7dcf347e4cdd68e5f336b', class: "prize-result-table-column" }, translate('prizes', this.language)), h("div", { key: '7213294fcbb792c5901b60ccc5f7a706ec37e05b', class: "prize-result-table-column" }, translate('numberOfWinners', this.language)), h("div", { key: 'dcad0d120a7eb92dfe9000f4e78221acb8c680ca', class: "prize-result-table-column" }, translate('prizeMoney', this.language)))), h("div", { key: 'f761e6d328b6f66333349b3fe85304d7f7b17ae2', class: "prize-result-table-body" }, this.curPrizes.map((prize) => (h("div", { class: "prize-result-table-row" }, h("div", { class: "prize-result-table-column" }, prize.divisionDisplayName), h("div", { class: "prize-result-table-column" }, prize.tickets), h("div", { class: "prize-result-table-column" }, thousandSeperator(prize.totalAmount.value)))))))))), this.curDrawSelection.length == 0 && !this.isLoading && (h("div", { key: '40a63a7af5886c646eae8803bc67766b94d7f5a3' }, translate('noLatestResult', this.language))), this.isLoading && h("div", { key: '879160955606bbc2e0c75adf6983abc960b5ccb2', class: "loading-wrap" }, translate('loading', this.language))));
647
+ }, onClick: this.handleDrawBettingTypeChange.bind(this, bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: '8ee998390f5f9965d8a927231ab2f99ad552c5ba', "session-id": this.sessionId, endpoint: this.endpoint, "game-id": this.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "mb-source": this.mbSource, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl })), h("div", { key: '10bdd643b69be187783ce4e2c50568ad1851be53', class: "prize-result" }, h("div", { key: '5c7466e02f8d0920dd7146d99f9360b66c6ee737', class: "prize-result-title" }, translate('prizeAllocation', this.language, { turnover: formattedTurnover(this.curTurnOver) })), h("div", { key: 'd37344089ddf988ea5093131c1ab3f56ff41fa5d', class: "prize-result-table" }, h("div", { key: '26f21fa18cc30e1981bd4d0c23ddfca123b65404', class: "prize-result-table-header" }, h("div", { key: 'f2f7fe64694c2a82bf5aec287a3349cd68221f07', class: "prize-result-table-row" }, h("div", { key: '7e6cf967655516f71d1a28209ddc3cc10ab0b246', class: "prize-result-table-column" }, translate('prizes', this.language)), h("div", { key: '420087a0cbf9ed50b764d8d05526f3f219539649', class: "prize-result-table-column" }, translate('numberOfWinners', this.language)), h("div", { key: 'df5fce05e03f48709ecd7f2f6f90e4408c4aa694', class: "prize-result-table-column" }, translate('prizeMoney', this.language)))), h("div", { key: '5ca663cc2a2d69124205158b90b82c2a299a45b3', class: "prize-result-table-body" }, this.displayedPrizes.map((prize) => (h("div", { class: "prize-result-table-row" }, h("div", { class: "prize-result-table-column" }, prize.divisionDisplayName), h("div", { class: "prize-result-table-column" }, prize.players), h("div", { class: "prize-result-table-column" }, thousandSeperator(prize.totalAmount.value)))))))))), this.curDrawSelection.length == 0 && !this.isLoading && (h("div", { key: '3efeea6a27837d8d4ea9c4a93bd225294a116ca6' }, translate('noLatestResult', this.language))), this.isLoading && h("div", { key: '6dbcdda8e4d044476f125fbf51dc6179b2eae8f1', class: "loading-wrap" }, translate('loading', this.language))));
630
648
  }
631
649
  static get watchers() { return {
632
650
  "clientStyling": ["handleClientStylingChange"],
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["general-tooltip_6",[[1,"lottery-tipping-latest-result",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"endpointTicket":[513,"endpoint-ticket"],"gameId":[1537,"game-id"],"playerId":[1538,"player-id"],"sessionId":[1537,"session-id"],"hasDrawDates":[32],"lastestDate":[32],"drawList":[32],"curDrawItem":[32],"curDrawItemIdx":[32],"curDrawSelection":[32],"curDrawSelectionBettingType":[32],"curDrawSelectionMap":[32],"curPrizes":[32],"curPrizeMap":[32],"curTurnOver":[32],"isLoading":[32],"playTypes":[32],"bettingTypes":[32],"vendorGameId":[32]},[[0,"changeDate","handleChangeDate"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-ticket-bet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"sessionId":[513,"session-id"],"endpoint":[513],"gameId":[513,"game-id"],"drawId":[513,"draw-id"],"totalPages":[1538,"total-pages"],"minTotalPages":[514,"min-total-pages"],"maxTotalPages":[514,"max-total-pages"],"mode":[513],"readPretty":[516,"read-pretty"],"defaultBulletConfigLineGroup":[513,"default-bullet-config-line-group"],"translationData":[32],"clientStylingUrlContent":[32],"bulletConfigLineGroup":[32],"currentPage":[32],"isLoading":[32],"hasErrors":[32],"dialogConfig":[32],"ticketDataSource":[32],"resetBulletConfig":[64],"getData":[64]},[[0,"lotteryTippingBulletGroupToggle","lotteryTippingBulletGroupSelectionHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"gameId":["fetchMatchData"],"sessionId":["fetchMatchData"],"drawId":["fetchMatchData"],"currentPage":["handleCurrentPageChange"]}],[1,"lottery-tipping-calendar",{"date":[1],"highLightDates":[16],"language":[513],"translationUrl":[520,"translation-url"],"weeks":[32],"days":[32],"alterDate":[32],"curDate":[32],"recordInfo":[32],"showCalendar":[32]},null,{"date":["handleDateChange"]}],[1,"lottery-tipping-bullet-group",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[513,"position-idx"],"theme":[513],"mode":[513],"bulletConfigContent":[513,"bullet-config-content"]},[[0,"lotteryTippingBulletToggle","lotteryTippingBulletSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"general-tooltip",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"position":[1],"delay":[2],"isVisible":[32],"_tooltipId":[32]},[[1,"mouseenter","handleMouseEnterOrFocus"],[0,"focusin","handleMouseEnterOrFocus"],[1,"mouseleave","handleMouseLeaveOrBlur"],[0,"focusout","handleMouseLeaveOrBlur"],[0,"keydown","handleKeyDown"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[514,"position-idx"],"theme":[513],"value":[513],"disabled":[516],"isSelected":[516,"is-selected"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
19
+ return bootstrapLazy([["general-tooltip_6",[[1,"lottery-tipping-latest-result",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"endpointTicket":[513,"endpoint-ticket"],"gameId":[1537,"game-id"],"playerId":[1538,"player-id"],"sessionId":[1537,"session-id"],"hasDrawDates":[32],"lastestDate":[32],"drawList":[32],"curDrawItem":[32],"curDrawItemIdx":[32],"curDrawSelection":[32],"curDrawSelectionBettingType":[32],"curDrawSelectionMap":[32],"curPrizes":[32],"curPrizeMap":[32],"curTurnOver":[32],"isLoading":[32],"playTypes":[32],"bettingTypes":[32],"vendorGameId":[32]},[[0,"changeDate","handleChangeDate"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-ticket-bet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"sessionId":[513,"session-id"],"endpoint":[513],"gameId":[513,"game-id"],"drawId":[513,"draw-id"],"totalPages":[1538,"total-pages"],"minTotalPages":[514,"min-total-pages"],"maxTotalPages":[514,"max-total-pages"],"mode":[513],"readPretty":[516,"read-pretty"],"defaultBulletConfigLineGroup":[513,"default-bullet-config-line-group"],"translationData":[32],"clientStylingUrlContent":[32],"bulletConfigLineGroup":[32],"currentPage":[32],"isLoading":[32],"hasErrors":[32],"dialogConfig":[32],"ticketDataSource":[32],"resetBulletConfig":[64],"getData":[64]},[[0,"lotteryTippingBulletGroupToggle","lotteryTippingBulletGroupSelectionHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"gameId":["fetchMatchData"],"sessionId":["fetchMatchData"],"drawId":["fetchMatchData"],"defaultBulletConfigLineGroup":["fetchMatchData"],"currentPage":["handleCurrentPageChange"]}],[1,"lottery-tipping-calendar",{"date":[1],"highLightDates":[16],"language":[513],"translationUrl":[520,"translation-url"],"weeks":[32],"days":[32],"alterDate":[32],"curDate":[32],"recordInfo":[32],"showCalendar":[32]},null,{"date":["handleDateChange"]}],[1,"lottery-tipping-bullet-group",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[513,"position-idx"],"theme":[513],"mode":[513],"bulletConfigContent":[513,"bullet-config-content"]},[[0,"lotteryTippingBulletToggle","lotteryTippingBulletSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"general-tooltip",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"position":[1],"delay":[2],"isVisible":[32],"_tooltipId":[32]},[[1,"mouseenter","handleMouseEnterOrFocus"],[0,"focusin","handleMouseEnterOrFocus"],[1,"mouseleave","handleMouseLeaveOrBlur"],[0,"focusout","handleMouseLeaveOrBlur"],[0,"keydown","handleKeyDown"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[514,"position-idx"],"theme":[513],"value":[513],"disabled":[516],"isSelected":[516,"is-selected"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
20
20
  });