@everymatrix/casino-challenges-list 0.0.3 → 0.0.4

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 (26) hide show
  1. package/dist/casino-challenges-list/casino-challenge-card_3.entry.js +1 -0
  2. package/dist/casino-challenges-list/casino-challenges-list-f8cb576c.js +1 -0
  3. package/dist/casino-challenges-list/casino-challenges-list.esm.js +1 -1
  4. package/dist/casino-challenges-list/index-72daee0c.js +2 -0
  5. package/dist/casino-challenges-list/index.esm.js +1 -1
  6. package/dist/cjs/casino-challenge-card_3.cjs.entry.js +408 -0
  7. package/dist/cjs/{casino-challenges-list-4da62aa7.js → casino-challenges-list-46cdc97e.js} +4 -2
  8. package/dist/cjs/casino-challenges-list.cjs.js +2 -2
  9. package/dist/cjs/{index-75e73570.js → index-2a526238.js} +37 -6
  10. package/dist/cjs/index.cjs.js +2 -3
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +6 -0
  13. package/dist/collection/components/casino-challenges-list/casino-challenges-list.js +1 -1
  14. package/dist/esm/casino-challenge-card_3.entry.js +403 -0
  15. package/dist/esm/{casino-challenges-list-d8eefa92.js → casino-challenges-list-f8cb576c.js} +2 -3
  16. package/dist/esm/casino-challenges-list.js +3 -3
  17. package/dist/esm/{index-e9d014fd.js → index-72daee0c.js} +37 -6
  18. package/dist/esm/index.js +2 -3
  19. package/dist/esm/loader.js +3 -3
  20. package/dist/types/components/casino-challenges-list/casino-challenges-list.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/dist/casino-challenges-list/casino-challenges-list-d8eefa92.js +0 -1
  23. package/dist/casino-challenges-list/casino-challenges-list_2.entry.js +0 -1
  24. package/dist/casino-challenges-list/index-e9d014fd.js +0 -2
  25. package/dist/cjs/casino-challenges-list_2.cjs.entry.js +0 -184
  26. package/dist/esm/casino-challenges-list_2.entry.js +0 -179
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'casino-challenges-list';
24
- const BUILD = /* casino-challenges-list */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
24
+ const BUILD = /* casino-challenges-list */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
25
25
 
26
26
  /*
27
27
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -71,10 +71,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
71
71
  }
72
72
  switch(bundleId) {
73
73
 
74
- case 'casino-challenges-list_2.cjs':
74
+ case 'casino-challenge-card_3.cjs':
75
75
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
76
76
  /* webpackMode: "lazy" */
77
- './casino-challenges-list_2.cjs.entry.js')); }).then(processMod, consoleError);
77
+ './casino-challenge-card_3.cjs.entry.js')); }).then(processMod, consoleError);
78
78
  }
79
79
  }
80
80
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
@@ -398,7 +398,7 @@ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
398
398
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
399
399
  if (oldValue !== newValue) {
400
400
  let isProp = isMemberInElement(elm, memberName);
401
- memberName.toLowerCase();
401
+ let ln = memberName.toLowerCase();
402
402
  if (memberName === "class") {
403
403
  const classList = elm.classList;
404
404
  const oldClasses = parseClassList(oldValue);
@@ -409,6 +409,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
409
409
  if (newValue) {
410
410
  newValue(elm);
411
411
  }
412
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
413
+ if (memberName[2] === "-") {
414
+ memberName = memberName.slice(3);
415
+ } else if (isMemberInElement(win, ln)) {
416
+ memberName = ln.slice(2);
417
+ } else {
418
+ memberName = ln[2] + memberName.slice(3);
419
+ }
420
+ if (oldValue || newValue) {
421
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
422
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
423
+ if (oldValue) {
424
+ plt.rel(elm, memberName, oldValue, capture);
425
+ }
426
+ if (newValue) {
427
+ plt.ael(elm, memberName, newValue, capture);
428
+ }
429
+ }
412
430
  } else {
413
431
  const isComplex = isComplexType(newValue);
414
432
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
@@ -443,6 +461,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
443
461
  };
444
462
  var parseClassListRegex = /\s/;
445
463
  var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
464
+ var CAPTURE_EVENT_SUFFIX = "Capture";
465
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
446
466
 
447
467
  // src/runtime/vdom/update-element.ts
448
468
  var updateElement = (oldVnode, newVnode, isSvgMode2) => {
@@ -718,6 +738,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
718
738
  );
719
739
  }
720
740
  let maybePromise;
741
+ if (isInitialLoad) {
742
+ {
743
+ maybePromise = safeCall(instance, "componentWillLoad");
744
+ }
745
+ }
721
746
  endSchedule();
722
747
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
723
748
  };
@@ -985,6 +1010,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
985
1010
  hostRef.$flags$ |= 128 /* isWatchReady */;
986
1011
  }
987
1012
  endNewInstance();
1013
+ fireConnectedCallback(hostRef.$lazyInstance$);
988
1014
  } else {
989
1015
  Cstr = elm.constructor;
990
1016
  const cmpTag = elm.localName;
@@ -1012,6 +1038,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1012
1038
  }
1013
1039
  };
1014
1040
  var fireConnectedCallback = (instance) => {
1041
+ {
1042
+ safeCall(instance, "connectedCallback");
1043
+ }
1015
1044
  };
1016
1045
 
1017
1046
  // src/runtime/connected-callback.ts
@@ -1044,8 +1073,10 @@ var connectedCallback = (elm) => {
1044
1073
  initializeComponent(elm, hostRef, cmpMeta);
1045
1074
  }
1046
1075
  } else {
1047
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1048
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1076
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1077
+ fireConnectedCallback(hostRef.$lazyInstance$);
1078
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1079
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1049
1080
  }
1050
1081
  }
1051
1082
  endConnected();
@@ -2,9 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoChallengesList = require('./casino-challenges-list-4da62aa7.js');
6
- require('./index-75e73570.js');
7
- require('@everymatrix/casino-challenge-card');
5
+ const casinoChallengesList = require('./casino-challenges-list-46cdc97e.js');
6
+ require('./index-2a526238.js');
8
7
 
9
8
 
10
9
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-75e73570.js');
5
+ const index = require('./index-2a526238.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["casino-challenges-list_2.cjs",[[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
11
+ return index.bootstrapLazy([["casino-challenge-card_3.cjs",[[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -8,6 +8,12 @@
8
8
  "typescriptVersion": "5.4.5"
9
9
  },
10
10
  "collections": [
11
+ {
12
+ "name": "@everymatrix/casino-challenge-card",
13
+ "tags": [
14
+ "casino-challenge-card"
15
+ ]
16
+ },
11
17
  {
12
18
  "name": "@everymatrix/ui-skeleton",
13
19
  "tags": [
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
3
3
  import "../../../../../ui-skeleton/dist/types/index";
4
- import "@everymatrix/casino-challenge-card";
4
+ import "../../../../../casino-challenge-card/dist/types/index";
5
5
  const skeletons = [0, 1, 2, 3, 4, 5];
6
6
  export class CasinoChallengeList {
7
7
  constructor() {
@@ -0,0 +1,403 @@
1
+ import { r as registerInstance, h, H as Host } from './index-72daee0c.js';
2
+ import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-list-f8cb576c.js';
3
+ export { C as casino_challenges_list } from './casino-challenges-list-f8cb576c.js';
4
+
5
+ const DEFAULT_LANGUAGE = 'en';
6
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
7
+ const TRANSLATIONS = {
8
+ en: {
9
+ totalLevels: 'Total levels:',
10
+ level1: 'Level 1:',
11
+ get: 'Get:',
12
+ endsIn: 'Ends In',
13
+ expired: 'Expired',
14
+ viewDetails: 'View details',
15
+ placeBetsOf: 'Place bets of',
16
+ place: 'Place',
17
+ bet: 'bet',
18
+ bets: 'bets'
19
+ },
20
+ ro: {
21
+ totalLevels: 'Niveluri totale:',
22
+ level1: 'Nivel 1:',
23
+ get: 'Obține:',
24
+ endsIn: 'Se termină în',
25
+ expired: 'Expirat',
26
+ viewDetails: 'Vezi detalii',
27
+ placeBetsOf: 'Plasează pariuri de',
28
+ place: 'Plasare',
29
+ bet: 'pariu',
30
+ bets: 'pariuri'
31
+ },
32
+ fr: {
33
+ totalLevels: 'Niveaux totaux :',
34
+ level1: 'Niveau 1 :',
35
+ get: 'Obtenir :',
36
+ endsIn: 'Se termine dans',
37
+ expired: 'Expiré',
38
+ viewDetails: 'Voir les détails',
39
+ placeBetsOf: 'Placez des paris de',
40
+ place: 'Placer',
41
+ bet: 'pari',
42
+ bets: 'paris'
43
+ },
44
+ ar: {
45
+ totalLevels: 'إجمالي المستويات:',
46
+ level1: 'المستوى 1:',
47
+ get: 'احصل على:',
48
+ endsIn: 'ينتهي في',
49
+ expired: 'منتهي الصلاحية',
50
+ viewDetails: 'عرض التفاصيل',
51
+ placeBetsOf: 'قم بوضع رهانات بقيمة',
52
+ place: 'ضع',
53
+ bet: 'رهان',
54
+ bets: 'رهانات'
55
+ },
56
+ hr: {
57
+ totalLevels: 'Ukupno razina:',
58
+ level1: 'Razina 1:',
59
+ get: 'Dobiti:',
60
+ endsIn: 'Završava za',
61
+ expired: 'Isteklo',
62
+ viewDetails: 'Pogledaj detalje',
63
+ placeBetsOf: 'Postavite oklade od',
64
+ place: 'Postavi',
65
+ bet: 'kladnja',
66
+ bets: 'kladnje'
67
+ }
68
+ };
69
+ const translate = (key, customLang) => {
70
+ const lang = customLang;
71
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
72
+ };
73
+ const getTranslations = (data) => {
74
+ Object.keys(data).forEach((item) => {
75
+ for (let key in data[item]) {
76
+ TRANSLATIONS[item][key] = data[item][key];
77
+ }
78
+ });
79
+ };
80
+ const resolveTranslationUrl = async (translationUrl) => {
81
+ if (translationUrl) {
82
+ try {
83
+ const response = await fetch(translationUrl);
84
+ if (!response.ok) {
85
+ throw new Error(`HTTP error! status: ${response.status}`);
86
+ }
87
+ const translations = await response.json();
88
+ getTranslations(translations);
89
+ }
90
+ catch (error) {
91
+ console.error('Failed to fetch or parse translations from URL:', error);
92
+ }
93
+ }
94
+ };
95
+
96
+ function getTimeLeft(endTime) {
97
+ const now = new Date();
98
+ const end = new Date(endTime);
99
+ let diff = end.getTime() - now.getTime();
100
+ if (diff <= 0) {
101
+ return;
102
+ }
103
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
104
+ diff -= days * (1000 * 60 * 60 * 24);
105
+ const hours = Math.floor(diff / (1000 * 60 * 60));
106
+ diff -= hours * (1000 * 60 * 60);
107
+ const minutes = Math.floor(diff / (1000 * 60));
108
+ diff -= minutes * (1000 * 60);
109
+ const seconds = Math.floor(diff / 1000);
110
+ const pad = (n) => n.toString().padStart(2, '0');
111
+ return `${pad(days)} : ${pad(hours)} : ${pad(minutes)} : ${pad(seconds)}`;
112
+ }
113
+
114
+ const casinoChallengeCardCss = ".card {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenge-list (max-width: 576px) {\n .card {\n width: 100%;\n }\n}\n.card:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.card__image {\n width: 100%;\n height: 200px;\n border-radius: 16px 16px 0 0;\n}\n@container challenge-list (max-width: 576px) {\n .card__image {\n height: 224px;\n }\n}\n.card__title {\n color: var(--emw--color-white, #FFFFFF);\n font-size: var(--emw--font-size-medium, 16px);\n margin: 0 0 10px;\n}\n.card__content {\n padding: 20px;\n}\n.card__button {\n margin-top: 20px;\n width: 100%;\n height: 34px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #727672);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-secondary, #e9931e);\n}\n.card__button:hover {\n border-color: var(--emw--color-secondary, #e9931e);\n cursor: pointer;\n}\n.card__badge {\n position: absolute;\n background: white;\n top: 6px;\n right: 6px;\n border-radius: 30px;\n padding: 2px 12px;\n line-height: 22px;\n font-weight: var(--emw--font-weight-medium, 500);\n font-size: var(--emw--font-size-x-small, 12px);\n box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);\n backdrop-filter: blur(20px);\n}\n.card__badge span {\n font-weight: var(--emw--font-weight-bold, 700);\n}\n\n.info-item {\n line-height: 24px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-primary, #1dbf51);\n}\n@container challenge-list (min-width: 576px) {\n .info-item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom;\n }\n}\n.info-item__label {\n font-weight: var(--emw--font-weight-medium, 500);\n margin-right: 3px;\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.info-item__tooltip {\n position: absolute;\n line-height: 22px;\n padding: 8px 12px;\n border-radius: 8px;\n opacity: 1;\n z-index: 200;\n white-space: nowrap;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--color-background-secondary, #1B1C2B);\n}\n.info-item__tooltip::before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid var(--emw--color-background-secondary, #1B1C2B);\n width: 0;\n height: 0;\n z-index: 201;\n}";
115
+ const CasinoChallengeCardStyle0 = casinoChallengeCardCss;
116
+
117
+ const CasinoChallengeCard = class {
118
+ constructor(hostRef) {
119
+ registerInstance(this, hostRef);
120
+ this.defaultLanguage = 'en';
121
+ this.onMouseEnterHandler = (index, el) => {
122
+ if (el.scrollWidth > el.clientWidth) {
123
+ this.tooltipIndex = index;
124
+ }
125
+ };
126
+ this.onMouseLeaveHandler = () => {
127
+ this.tooltipIndex = null;
128
+ };
129
+ this.mbSource = undefined;
130
+ this.clientStyling = undefined;
131
+ this.clientStylingUrl = undefined;
132
+ this.translationUrl = '';
133
+ this.language = 'en';
134
+ this.challenge = undefined;
135
+ this.tooltipIndex = null;
136
+ this.timeLeft = undefined;
137
+ }
138
+ get infoItems() {
139
+ const level1 = this.challenge.ChallengeLevels[0];
140
+ const target = level1.Target;
141
+ const targetValue = target.TargetType === 0
142
+ ? `${translate('placeBetsOf', this.language)} ${target.Turnover}`
143
+ : target.TargetType === 1
144
+ ? `${translate('place', this.language)} ${target.Turnover} ${translate('bet', this.language)}`
145
+ : `${translate('place', this.language)} ${target.BetCount} ${translate('bets', this.language)}`;
146
+ const rewardValue = level1.Rewards.map((r) => r.RewardDescription).join(' + ');
147
+ return [
148
+ {
149
+ lable: translate('totalLevels', this.language),
150
+ value: this.challenge.ChallengeLevels.length
151
+ },
152
+ {
153
+ lable: translate('level1', this.language),
154
+ value: targetValue
155
+ },
156
+ {
157
+ lable: translate('get', this.language),
158
+ value: rewardValue
159
+ }
160
+ ];
161
+ }
162
+ handleClientStylingChange(newValue, oldValue) {
163
+ if (newValue != oldValue) {
164
+ setClientStyling(this.stylingContainer, this.clientStyling);
165
+ }
166
+ }
167
+ handleClientStylingUrlChange(newValue, oldValue) {
168
+ if (newValue != oldValue) {
169
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
170
+ }
171
+ }
172
+ handleMbSourceChange(newValue, oldValue) {
173
+ if (newValue != oldValue) {
174
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
175
+ }
176
+ }
177
+ connectedCallback() {
178
+ this.timerId = setInterval(() => {
179
+ this.updateTime();
180
+ }, 1000);
181
+ }
182
+ componentWillLoad() {
183
+ if (this.translationUrl) {
184
+ resolveTranslationUrl(this.translationUrl);
185
+ }
186
+ this.updateTime();
187
+ }
188
+ componentDidLoad() {
189
+ if (this.stylingContainer) {
190
+ if (this.mbSource)
191
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
192
+ if (this.clientStyling)
193
+ setClientStyling(this.stylingContainer, this.clientStyling);
194
+ if (this.clientStylingUrl)
195
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
196
+ }
197
+ }
198
+ disconnectedCallback() {
199
+ if (this.stylingSubscription) {
200
+ this.stylingSubscription.unsubscribe();
201
+ }
202
+ clearInterval(this.timerId);
203
+ }
204
+ updateTime() {
205
+ var _a;
206
+ this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengeEndTime);
207
+ }
208
+ renderInfoItem(item, index) {
209
+ return (h("div", { class: "info-item", onMouseEnter: (e) => this.onMouseEnterHandler(index, e.currentTarget), onMouseLeave: this.onMouseLeaveHandler }, h("span", { class: "info-item__label" }, item.lable), item.value, this.tooltipIndex === index && h("div", { class: "info-item__tooltip" }, item.value)));
210
+ }
211
+ renderCardBadge() {
212
+ return (h("div", { class: "card__badge" }, this.timeLeft
213
+ ? [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft)]
214
+ : translate('expired', this.language)));
215
+ }
216
+ render() {
217
+ return (h("div", { key: 'ddbd3e0d20b4d75ed70120798c45d7c03715b7df', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '3ca0c4b6ad25b4f60077b894bf73c9686f67a677', class: "card" }, h("img", { key: '1712546c27e75e04bde5832c521038bfd418e57f', class: "card__image", src: this.challenge.ChallengePresentations[this.language].Url ||
218
+ this.challenge.ChallengePresentations[this.defaultLanguage].Url }), this.renderCardBadge(), h("div", { key: '238041db616391c2594bef46778649b8b6282097', class: "card__content" }, h("h1", { key: 'd377b99c7758460df8b1a6e8e39059959347430f', class: "card__title" }, this.challenge.ChallengePresentations[this.language].PresentationName ||
219
+ this.challenge.ChallengePresentations[this.defaultLanguage].PresentationName), this.infoItems.map((x, index) => this.renderInfoItem(x, index)), h("button", { key: 'b53707ce7881cbf16321e3d3728a0e769af6589a', class: "card__button" }, translate('viewDetails', this.language))))));
220
+ }
221
+ static get watchers() { return {
222
+ "clientStyling": ["handleClientStylingChange"],
223
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
224
+ "mbSource": ["handleMbSourceChange"]
225
+ }; }
226
+ };
227
+ CasinoChallengeCard.style = CasinoChallengeCardStyle0;
228
+
229
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{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)}.Circle{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%}.Text{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)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{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)}.Image{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)}.Logo{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)}}";
230
+ const UiSkeletonStyle0 = uiSkeletonCss;
231
+
232
+ const UiSkeleton = class {
233
+ constructor(hostRef) {
234
+ registerInstance(this, hostRef);
235
+ this.stylingValue = {
236
+ width: this.handleStylingProps(this.width),
237
+ height: this.handleStylingProps(this.height),
238
+ borderRadius: this.handleStylingProps(this.borderRadius),
239
+ marginBottom: this.handleStylingProps(this.marginBottom),
240
+ marginTop: this.handleStylingProps(this.marginTop),
241
+ marginLeft: this.handleStylingProps(this.marginLeft),
242
+ marginRight: this.handleStylingProps(this.marginRight),
243
+ size: this.handleStylingProps(this.size)
244
+ };
245
+ this.structure = undefined;
246
+ this.width = 'unset';
247
+ this.height = 'unset';
248
+ this.borderRadius = 'unset';
249
+ this.marginBottom = 'unset';
250
+ this.marginTop = 'unset';
251
+ this.marginLeft = 'unset';
252
+ this.marginRight = 'unset';
253
+ this.animation = true;
254
+ this.rows = 0;
255
+ this.size = '100%';
256
+ }
257
+ handleStructureChange(newValue, oldValue) {
258
+ if (oldValue !== newValue) {
259
+ this.handleStructure(newValue);
260
+ }
261
+ }
262
+ handleStylingProps(value) {
263
+ switch (typeof value) {
264
+ case 'number':
265
+ return value === 0 ? 0 : `${value}px`;
266
+ case 'undefined':
267
+ return 'unset';
268
+ case 'string':
269
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
270
+ value.endsWith('px') ||
271
+ value.endsWith('%')) {
272
+ return value;
273
+ }
274
+ else {
275
+ return 'unset';
276
+ }
277
+ default:
278
+ return 'unset';
279
+ }
280
+ }
281
+ handleStructure(structure) {
282
+ switch (structure) {
283
+ case 'logo':
284
+ return this.renderLogo();
285
+ case 'image':
286
+ return this.renderImage();
287
+ case 'title':
288
+ return this.renderTitle();
289
+ case 'text':
290
+ return this.renderText();
291
+ case 'rectangle':
292
+ return this.renderRectangle();
293
+ case 'circle':
294
+ return this.renderCircle();
295
+ default:
296
+ return null;
297
+ }
298
+ }
299
+ renderLogo() {
300
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Logo ' + (this.animation ? 'Skeleton' : '') })));
301
+ }
302
+ renderImage() {
303
+ return h("div", { class: 'Image ' + (this.animation ? 'Skeleton' : '') });
304
+ }
305
+ renderTitle() {
306
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Title ' + (this.animation ? 'Skeleton' : '') })));
307
+ }
308
+ renderText() {
309
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'Text ' + (this.animation ? 'Skeleton' : '') })))));
310
+ }
311
+ renderRectangle() {
312
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Rectangle ' + (this.animation ? 'Skeleton' : '') })));
313
+ }
314
+ renderCircle() {
315
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Circle ' + (this.animation ? 'Skeleton' : '') })));
316
+ }
317
+ render() {
318
+ let styleBlock = '';
319
+ switch (this.structure) {
320
+ case 'logo':
321
+ styleBlock = `
322
+ :host {
323
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
324
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
325
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
326
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
327
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
328
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
329
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
330
+ }
331
+ `;
332
+ break;
333
+ case 'image':
334
+ styleBlock = `
335
+ :host {
336
+ --emw-skeleton-image-width: ${this.stylingValue.width};
337
+ --emw-skeleton-image-height: ${this.stylingValue.height};
338
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
339
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
340
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
341
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
342
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
343
+ }
344
+ `;
345
+ break;
346
+ case 'title':
347
+ styleBlock = `
348
+ :host {
349
+ --emw-skeleton-title-width: ${this.stylingValue.width};
350
+ --emw-skeleton-title-height: ${this.stylingValue.height};
351
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
352
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
353
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
354
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
355
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
356
+ }
357
+ `;
358
+ break;
359
+ case 'text':
360
+ styleBlock = `
361
+ :host {
362
+ --emw-skeleton-text-width: ${this.stylingValue.width};
363
+ --emw-skeleton-text-height: ${this.stylingValue.height};
364
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
365
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
366
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
367
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
368
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
369
+ }
370
+ `;
371
+ break;
372
+ case 'rectangle':
373
+ styleBlock = `
374
+ :host {
375
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
376
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
377
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
378
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
379
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
380
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
381
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
382
+ }
383
+ `;
384
+ break;
385
+ case 'circle':
386
+ styleBlock = `
387
+ :host {
388
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
389
+ }
390
+ `;
391
+ break;
392
+ default:
393
+ styleBlock = '';
394
+ }
395
+ return (h(Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
396
+ }
397
+ static get watchers() { return {
398
+ "structure": ["handleStructureChange"]
399
+ }; }
400
+ };
401
+ UiSkeleton.style = UiSkeletonStyle0;
402
+
403
+ export { CasinoChallengeCard as casino_challenge_card, UiSkeleton as ui_skeleton };
@@ -1,5 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-e9d014fd.js';
2
- import '@everymatrix/casino-challenge-card';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-72daee0c.js';
3
2
 
4
3
  /**
5
4
  * @name setClientStyling
@@ -150,4 +149,4 @@ const CasinoChallengeList = class {
150
149
  };
151
150
  CasinoChallengeList.style = CasinoChallengesListStyle0;
152
151
 
153
- export { CasinoChallengeList as C };
152
+ export { CasinoChallengeList as C, setClientStylingURL as a, setStreamStyling as b, setClientStyling as s };
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-e9d014fd.js';
2
- export { s as setNonce } from './index-e9d014fd.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-72daee0c.js';
2
+ export { s as setNonce } from './index-72daee0c.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["casino-challenges-list_2",[[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
19
+ return bootstrapLazy([["casino-challenge-card_3",[[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
20
20
  });