@everymatrix/promoting-banners 1.55.0 → 1.56.2

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.
@@ -21,10 +21,10 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'promoting-banners';
24
- const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, 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: false, propMutable: false, propNumber: false, 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: true, vdomText: true, vdomXlink: false, watchCallback: true };
24
+ const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, 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: false, 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: false, propMutable: false, propNumber: false, 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: true, vdomText: true, vdomXlink: false, watchCallback: true };
25
25
 
26
26
  /*
27
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
27
+ Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
28
28
  */
29
29
  var __defProp = Object.defineProperty;
30
30
  var __export = (target, all) => {
@@ -343,31 +343,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
343
343
  if (nonce != null) {
344
344
  styleElm.setAttribute("nonce", nonce);
345
345
  }
346
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
347
- if (styleContainerNode.nodeName === "HEAD") {
348
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
349
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
350
- styleContainerNode.insertBefore(styleElm, referenceNode2);
351
- } else if ("host" in styleContainerNode) {
352
- if (supportsConstructableStylesheets) {
353
- const stylesheet = new CSSStyleSheet();
354
- stylesheet.replaceSync(style);
355
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
356
- } else {
357
- const existingStyleContainer = styleContainerNode.querySelector("style");
358
- if (existingStyleContainer) {
359
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
360
- } else {
361
- styleContainerNode.prepend(styleElm);
362
- }
363
- }
364
- } else {
365
- styleContainerNode.append(styleElm);
366
- }
367
- }
368
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
369
- styleContainerNode.insertBefore(styleElm, null);
370
- }
346
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
371
347
  }
372
348
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
373
349
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -390,7 +366,7 @@ var attachStyles = (hostRef) => {
390
366
  const scopeId2 = addStyle(
391
367
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
392
368
  cmpMeta);
393
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
369
+ if (flags & 10 /* needsScopedEncapsulation */) {
394
370
  elm["s-sc"] = scopeId2;
395
371
  elm.classList.add(scopeId2 + "-h");
396
372
  }
@@ -459,11 +435,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
459
435
  if (memberName === "list") {
460
436
  isProp = false;
461
437
  } else if (oldValue == null || elm[memberName] != n) {
462
- if (typeof elm.__lookupSetter__(memberName) === "function") {
463
- elm[memberName] = n;
464
- } else {
465
- elm.setAttribute(memberName, n);
466
- }
438
+ elm[memberName] = n;
467
439
  }
468
440
  } else {
469
441
  elm[memberName] = newValue;
@@ -536,9 +508,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
536
508
  {
537
509
  updateElement(null, newVNode2, isSvgMode);
538
510
  }
539
- const rootNode = elm.getRootNode();
540
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
541
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
511
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
542
512
  elm.classList.add(elm["s-si"] = scopeId);
543
513
  }
544
514
  if (newVNode2.$children$) {
@@ -692,10 +662,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
692
662
  elm.textContent = "";
693
663
  }
694
664
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
695
- } else if (
696
- // don't do this on initial render as it can cause non-hydrated content to be removed
697
- !isInitialRender && BUILD.updatable && oldChildren !== null
698
- ) {
665
+ } else if (oldChildren !== null) {
699
666
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
700
667
  }
701
668
  } else if (oldVNode.$text$ !== text) {
@@ -838,12 +805,16 @@ var postUpdateComponent = (hostRef) => {
838
805
  const tagName = hostRef.$cmpMeta$.$tagName$;
839
806
  const elm = hostRef.$hostElement$;
840
807
  const endPostUpdate = createTime("postUpdate", tagName);
808
+ const instance = hostRef.$lazyInstance$ ;
841
809
  const ancestorComponent = hostRef.$ancestorComponent$;
842
810
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
843
811
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
844
812
  {
845
813
  addHydratedFlag(elm);
846
814
  }
815
+ {
816
+ safeCall(instance, "componentDidLoad");
817
+ }
847
818
  endPostUpdate();
848
819
  {
849
820
  hostRef.$onReadyResolve$(elm);
@@ -956,8 +927,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
956
927
  if (this.hasOwnProperty(propName)) {
957
928
  newValue = this[propName];
958
929
  delete this[propName];
959
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
960
- this[propName] == newValue) {
930
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
961
931
  return;
962
932
  } else if (propName == null) {
963
933
  const hostRef = getHostRef(this);
@@ -1109,12 +1079,17 @@ var connectedCallback = (elm) => {
1109
1079
  }
1110
1080
  };
1111
1081
  var disconnectInstance = (instance) => {
1082
+ {
1083
+ safeCall(instance, "disconnectedCallback");
1084
+ }
1112
1085
  };
1113
1086
  var disconnectedCallback = async (elm) => {
1114
1087
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1115
1088
  const hostRef = getHostRef(elm);
1116
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1117
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1089
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1090
+ disconnectInstance(hostRef.$lazyInstance$);
1091
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1092
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1118
1093
  }
1119
1094
  }
1120
1095
  };
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const promotingBanners = require('./promoting-banners-d707e229.js');
6
- require('./index-40277d4b.js');
5
+ const promotingBanners = require('./promoting-banners-570e15dc.js');
6
+ require('./index-cb64c2ca.js');
7
7
 
8
8
 
9
9
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-40277d4b.js');
5
+ const index = require('./index-cb64c2ca.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([["promoting-banners.cjs",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
11
+ return index.bootstrapLazy([["promoting-banners.cjs",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-40277d4b.js');
3
+ const index = require('./index-cb64c2ca.js');
4
4
 
5
5
  const getDevice = () => {
6
6
  let userAgent = window.navigator.userAgent;
@@ -79,41 +79,73 @@ const getTranslations = (url) => {
79
79
  });
80
80
  };
81
81
 
82
+ /**
83
+ * @name setClientStyling
84
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
85
+ * @param {HTMLElement} stylingContainer The reference element of the widget
86
+ * @param {string} clientStyling The style content
87
+ */
88
+ function setClientStyling(stylingContainer, clientStyling) {
89
+ if (stylingContainer) {
90
+ const sheet = document.createElement('style');
91
+ sheet.innerHTML = clientStyling;
92
+ stylingContainer.appendChild(sheet);
93
+ }
94
+ }
95
+
96
+ /**
97
+ * @name setClientStylingURL
98
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
99
+ * @param {HTMLElement} stylingContainer The reference element of the widget
100
+ * @param {string} clientStylingUrl The URL of the style content
101
+ */
102
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
103
+ const url = new URL(clientStylingUrl);
104
+
105
+ fetch(url.href)
106
+ .then((res) => res.text())
107
+ .then((data) => {
108
+ const cssFile = document.createElement('style');
109
+ cssFile.innerHTML = data;
110
+ if (stylingContainer) {
111
+ stylingContainer.appendChild(cssFile);
112
+ }
113
+ })
114
+ .catch((err) => {
115
+ console.error('There was an error while trying to load client styling from URL', err);
116
+ });
117
+ }
118
+
119
+ /**
120
+ * @name setStreamLibrary
121
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
122
+ * @param {HTMLElement} stylingContainer The highest element of the widget
123
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
124
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
125
+ */
126
+ function setStreamStyling(stylingContainer, domain, subscription) {
127
+ if (window.emMessageBus) {
128
+ const sheet = document.createElement('style');
129
+
130
+ window.emMessageBus.subscribe(domain, (data) => {
131
+ sheet.innerHTML = data;
132
+ if (stylingContainer) {
133
+ stylingContainer.appendChild(sheet);
134
+ }
135
+ });
136
+ }
137
+ }
138
+
82
139
  const promotingBannersCss = ".PromotingBannersIconContainer img{width:50px;height:50px;border-radius:var(--emw--border-radius-image, 50%);background-size:contain;margin:10px}.PromotingBannersSection{padding:10px;border-radius:var(--emw--border-radius-small, 5px);background-color:var(--emw--promo-color-background, var(--emw--color-background, #2f2f2f));background-repeat:no-repeat;background-position:center;color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff));font-family:var(--emw--font-family-primary, \"Montserrat\", sans-serif);overflow:hidden;position:relative}.PromotingBannersGrid{display:grid;grid-gap:30px;background-size:contain;background-repeat:no-repeat;padding:10px;width:100%;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));box-sizing:border-box}.PromotingBannersContent{color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff))}.PromotingBannersContent p{display:block;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.PromotingBannersHeader{display:flex;justify-content:center;flex-direction:column;align-items:center}.PromotingBannersHeader p{text-align:center}.PromotingBannersBox{min-width:200px;display:flex;justify-content:flex-start;overflow:hidden;flex-direction:row;gap:20px;text-decoration:none;color:inherit;background-size:cover;background-position:center;border-radius:var(--emw--border-radius-small, 5px)}.PromotingBannersSectionTitle,.PromotingBannersSectionSubtitle{margin:10px auto;background:transparent}.PromotingBannersTextContainer{margin:5px;overflow:hidden;position:relative;padding-bottom:30px}.PromotingBannersTitle{margin:5px auto}.PromotingBannersButton{cursor:pointer;color:inherit;text-decoration:none;position:absolute;bottom:5px;border:0;background:transparent}.ButtonDisabled{cursor:not-allowed}.PromotionalBannersTextContainer{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AboutUsError .ErrorInfo{color:var(--emw--promo-color-error, var(--emw--color-error, #ed0909))}.SkeletonGrid{display:grid}.Skeleton{animation:skeleton-loading 0.6s linear infinite alternate}@keyframes skeleton-loading{0%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.2) 0%, rgba(0, 61, 93, 0.2) 100%)}12%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.225) 0%, rgba(0, 61, 93, 0.225) 100%)}25%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.25) 0%, rgba(0, 61, 93, 0.25) 100%)}33%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.275) 0%, rgba(0, 61, 93, 0.275) 100%)}50%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.3) 0%, rgba(0, 61, 93, 0.3) 100%)}63%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.325) 0%, rgba(0, 61, 93, 0.325) 100%)}75%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.35) 0%, rgba(0, 61, 93, 0.35) 100%)}88%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.375) 0%, rgba(0, 61, 93, 0.375) 100%)}100%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.4) 0%, rgba(0, 61, 93, 0.4) 100%)}}.SkeletonItem{opacity:0.5;margin:0 15px;width:125px;height:150px;border-radius:var(--emw--border-radius-medium, 15px);margin:20px}";
83
140
  const PromotingBannersStyle0 = promotingBannersCss;
84
141
 
85
142
  const PromotingBanners = class {
86
143
  constructor(hostRef) {
87
144
  index.registerInstance(this, hostRef);
88
- this.setClientStyling = () => {
89
- let sheet = document.createElement('style');
90
- sheet.innerHTML = this.clientStyling;
91
- this.stylingContainer.prepend(sheet);
92
- };
93
- this.setClientStylingURL = () => {
94
- let url = new URL(this.clientStylingUrl);
95
- let cssFile = document.createElement('style');
96
- fetch(url.href)
97
- .then((res) => res.text())
98
- .then((data) => {
99
- cssFile.innerHTML = data;
100
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
101
- })
102
- .catch((err) => {
103
- console.log('error ', err);
104
- });
105
- };
106
- this.componentDidLoad = () => {
107
- if (this.stylingContainer) {
108
- if (this.clientStyling)
109
- this.setClientStyling();
110
- if (this.clientStylingUrl)
111
- this.setClientStylingURL();
112
- }
113
- };
114
145
  this.cmsEndpoint = '';
115
146
  this.language = 'en';
116
147
  this.cmsEnv = '';
148
+ this.mbSource = undefined;
117
149
  this.clientStyling = '';
118
150
  this.clientStylingUrl = '';
119
151
  this.translationUrl = '';
@@ -122,9 +154,16 @@ const PromotingBanners = class {
122
154
  this.isLoading = true;
123
155
  this.translationData = undefined;
124
156
  }
125
- handleStylingChange(newValue, oldValue) {
126
- if (newValue !== oldValue)
127
- this.setClientStyling();
157
+ handleClientStylingChange(newValue, oldValue) {
158
+ if (newValue != oldValue) {
159
+ setClientStyling(this.stylingContainer, this.clientStyling);
160
+ }
161
+ }
162
+ handleClientStylingChangeURL(newValue, oldValue) {
163
+ if (newValue != oldValue) {
164
+ if (this.clientStylingUrl)
165
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
166
+ }
128
167
  }
129
168
  handleNewTranslations() {
130
169
  this.isLoading = true;
@@ -137,6 +176,22 @@ const PromotingBanners = class {
137
176
  this.getPromotingBanners();
138
177
  }
139
178
  }
179
+ componentDidLoad() {
180
+ if (this.stylingContainer) {
181
+ if (window.emMessageBus != undefined) {
182
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
183
+ }
184
+ else {
185
+ if (this.clientStyling)
186
+ setClientStyling(this.stylingContainer, this.clientStyling);
187
+ if (this.clientStylingUrl)
188
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
189
+ }
190
+ }
191
+ }
192
+ disconnectedCallback() {
193
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
194
+ }
140
195
  getPromotingBanners() {
141
196
  const url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
142
197
  const params = new URLSearchParams();
@@ -192,12 +247,12 @@ const PromotingBanners = class {
192
247
  }
193
248
  render() {
194
249
  var _a, _b, _c, _d;
195
- return (index.h("div", { key: '80f15f2a7a49290bfd0fb80c6ccfb02b9fe3a0a9', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && index.h("div", { key: '392ef0a6910a457d17efc41a3a2443afc8be4a61', class: "AboutUsError" }, index.h("div", { key: 'c19eb8a49a8c8a422bd47557a7815e0252667005', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && index.h("div", { key: '28fc923e41227b8ca1529e8e2815ebd70678e50c', class: "SkeletonGrid" }, new Array(4).fill(null).map((index$1) => (index.h("div", { key: index$1, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
196
- index.h("div", { key: 'aff2d67a139ede5bdcc3c1ad240806594ab5fae7', class: "PromotingBannersWrapper" }, index.h("div", { key: '7d8caf2fee017407a618960ea37fff9d809e3eaa', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && index.h("h1", { key: 'd947b41266fdfda8762ebc654c7a1c3516a08be5', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && index.h("h5", { key: '72127f002e53c9e2d7430e222494c4470aca23e9', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), index.h("div", { key: '50c4fb4ae455f363d128993908016b0245c2bd50', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
250
+ return (index.h("div", { key: '7b5d4fb98c2e5f281e88ee55796acbdbccea9b18', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && index.h("div", { key: 'a94b12073ffc5f31c16869980a788958c3cd094d', class: "AboutUsError" }, index.h("div", { key: '01b900b7b20a509fdfe5b42fd922498b9c401dd1', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && index.h("div", { key: 'a3154cc38eb0ff53ac4a95e8d7637b0d827d3703', class: "SkeletonGrid" }, new Array(4).fill(null).map((index$1) => (index.h("div", { key: index$1, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
251
+ index.h("div", { key: '2482f3de75009242aaf9017a5143d54ad4215454', class: "PromotingBannersWrapper" }, index.h("div", { key: '03a427cd483369db58e4167336b36b7e84a84abf', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && index.h("h1", { key: '3506a22eef9b94146424307dcdde934e21c2b348', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && index.h("h5", { key: '36783744584e48a83a629be83de187f552668c8b', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), index.h("div", { key: '4fd616bb2759411e226c3e912f0a9096f64703d0', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
197
252
  }
198
253
  static get watchers() { return {
199
- "clientStyling": ["handleStylingChange"],
200
- "clientStylingUrl": ["handleStylingChange"],
254
+ "clientStyling": ["handleClientStylingChange"],
255
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
201
256
  "translationUrl": ["handleNewTranslations"]
202
257
  }; }
203
258
  };
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const promotingBanners = require('./promoting-banners-d707e229.js');
6
- require('./index-40277d4b.js');
5
+ const promotingBanners = require('./promoting-banners-570e15dc.js');
6
+ require('./index-cb64c2ca.js');
7
7
 
8
8
 
9
9
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-40277d4b.js');
5
+ const index = require('./index-cb64c2ca.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
9
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
9
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
10
10
  */
11
11
  var patchBrowser = () => {
12
12
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('promoting-banners.cjs.js', document.baseURI).href));
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["promoting-banners.cjs",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
22
+ return index.bootstrapLazy([["promoting-banners.cjs",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -4,8 +4,8 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.22.3",
8
- "typescriptVersion": "5.5.4"
7
+ "version": "4.19.2",
8
+ "typescriptVersion": "5.4.5"
9
9
  },
10
10
  "collections": [],
11
11
  "bundles": []
@@ -1,37 +1,13 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { getDevice, getDevicePlatform } from "../../utils/utils";
3
3
  import { translate, getTranslations } from "../../utils/locale.utils";
4
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
5
  export class PromotingBanners {
5
6
  constructor() {
6
- this.setClientStyling = () => {
7
- let sheet = document.createElement('style');
8
- sheet.innerHTML = this.clientStyling;
9
- this.stylingContainer.prepend(sheet);
10
- };
11
- this.setClientStylingURL = () => {
12
- let url = new URL(this.clientStylingUrl);
13
- let cssFile = document.createElement('style');
14
- fetch(url.href)
15
- .then((res) => res.text())
16
- .then((data) => {
17
- cssFile.innerHTML = data;
18
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
19
- })
20
- .catch((err) => {
21
- console.log('error ', err);
22
- });
23
- };
24
- this.componentDidLoad = () => {
25
- if (this.stylingContainer) {
26
- if (this.clientStyling)
27
- this.setClientStyling();
28
- if (this.clientStylingUrl)
29
- this.setClientStylingURL();
30
- }
31
- };
32
7
  this.cmsEndpoint = '';
33
8
  this.language = 'en';
34
9
  this.cmsEnv = '';
10
+ this.mbSource = undefined;
35
11
  this.clientStyling = '';
36
12
  this.clientStylingUrl = '';
37
13
  this.translationUrl = '';
@@ -40,9 +16,16 @@ export class PromotingBanners {
40
16
  this.isLoading = true;
41
17
  this.translationData = undefined;
42
18
  }
43
- handleStylingChange(newValue, oldValue) {
44
- if (newValue !== oldValue)
45
- this.setClientStyling();
19
+ handleClientStylingChange(newValue, oldValue) {
20
+ if (newValue != oldValue) {
21
+ setClientStyling(this.stylingContainer, this.clientStyling);
22
+ }
23
+ }
24
+ handleClientStylingChangeURL(newValue, oldValue) {
25
+ if (newValue != oldValue) {
26
+ if (this.clientStylingUrl)
27
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
28
+ }
46
29
  }
47
30
  handleNewTranslations() {
48
31
  this.isLoading = true;
@@ -55,6 +38,22 @@ export class PromotingBanners {
55
38
  this.getPromotingBanners();
56
39
  }
57
40
  }
41
+ componentDidLoad() {
42
+ if (this.stylingContainer) {
43
+ if (window.emMessageBus != undefined) {
44
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
45
+ }
46
+ else {
47
+ if (this.clientStyling)
48
+ setClientStyling(this.stylingContainer, this.clientStyling);
49
+ if (this.clientStylingUrl)
50
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
51
+ }
52
+ }
53
+ }
54
+ disconnectedCallback() {
55
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
56
+ }
58
57
  getPromotingBanners() {
59
58
  const url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
60
59
  const params = new URLSearchParams();
@@ -110,8 +109,8 @@ export class PromotingBanners {
110
109
  }
111
110
  render() {
112
111
  var _a, _b, _c, _d;
113
- return (h("div", { key: '80f15f2a7a49290bfd0fb80c6ccfb02b9fe3a0a9', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && h("div", { key: '392ef0a6910a457d17efc41a3a2443afc8be4a61', class: "AboutUsError" }, h("div", { key: 'c19eb8a49a8c8a422bd47557a7815e0252667005', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && h("div", { key: '28fc923e41227b8ca1529e8e2815ebd70678e50c', class: "SkeletonGrid" }, new Array(4).fill(null).map((index) => (h("div", { key: index, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
114
- h("div", { key: 'aff2d67a139ede5bdcc3c1ad240806594ab5fae7', class: "PromotingBannersWrapper" }, h("div", { key: '7d8caf2fee017407a618960ea37fff9d809e3eaa', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && h("h1", { key: 'd947b41266fdfda8762ebc654c7a1c3516a08be5', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && h("h5", { key: '72127f002e53c9e2d7430e222494c4470aca23e9', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), h("div", { key: '50c4fb4ae455f363d128993908016b0245c2bd50', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
112
+ return (h("div", { key: '7b5d4fb98c2e5f281e88ee55796acbdbccea9b18', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && h("div", { key: 'a94b12073ffc5f31c16869980a788958c3cd094d', class: "AboutUsError" }, h("div", { key: '01b900b7b20a509fdfe5b42fd922498b9c401dd1', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && h("div", { key: 'a3154cc38eb0ff53ac4a95e8d7637b0d827d3703', class: "SkeletonGrid" }, new Array(4).fill(null).map((index) => (h("div", { key: index, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
113
+ h("div", { key: '2482f3de75009242aaf9017a5143d54ad4215454', class: "PromotingBannersWrapper" }, h("div", { key: '03a427cd483369db58e4167336b36b7e84a84abf', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && h("h1", { key: '3506a22eef9b94146424307dcdde934e21c2b348', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && h("h5", { key: '36783744584e48a83a629be83de187f552668c8b', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), h("div", { key: '4fd616bb2759411e226c3e912f0a9096f64703d0', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
115
114
  }
116
115
  static get is() { return "promoting-banners"; }
117
116
  static get encapsulation() { return "shadow"; }
@@ -181,6 +180,23 @@ export class PromotingBanners {
181
180
  "reflect": true,
182
181
  "defaultValue": "''"
183
182
  },
183
+ "mbSource": {
184
+ "type": "string",
185
+ "mutable": false,
186
+ "complexType": {
187
+ "original": "string",
188
+ "resolved": "string",
189
+ "references": {}
190
+ },
191
+ "required": false,
192
+ "optional": false,
193
+ "docs": {
194
+ "tags": [],
195
+ "text": "Client custom styling via streamStyling"
196
+ },
197
+ "attribute": "mb-source",
198
+ "reflect": false
199
+ },
184
200
  "clientStyling": {
185
201
  "type": "string",
186
202
  "mutable": false,
@@ -248,10 +264,10 @@ export class PromotingBanners {
248
264
  static get watchers() {
249
265
  return [{
250
266
  "propName": "clientStyling",
251
- "methodName": "handleStylingChange"
267
+ "methodName": "handleClientStylingChange"
252
268
  }, {
253
269
  "propName": "clientStylingUrl",
254
- "methodName": "handleStylingChange"
270
+ "methodName": "handleClientStylingChangeURL"
255
271
  }, {
256
272
  "propName": "translationUrl",
257
273
  "methodName": "handleNewTranslations"
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'promoting-banners';
2
- const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, 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: false, propMutable: false, propNumber: false, 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: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, 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: false, 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: false, propMutable: false, propNumber: false, 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: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
@@ -321,31 +321,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
321
321
  if (nonce != null) {
322
322
  styleElm.setAttribute("nonce", nonce);
323
323
  }
324
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
325
- if (styleContainerNode.nodeName === "HEAD") {
326
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
327
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
328
- styleContainerNode.insertBefore(styleElm, referenceNode2);
329
- } else if ("host" in styleContainerNode) {
330
- if (supportsConstructableStylesheets) {
331
- const stylesheet = new CSSStyleSheet();
332
- stylesheet.replaceSync(style);
333
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
334
- } else {
335
- const existingStyleContainer = styleContainerNode.querySelector("style");
336
- if (existingStyleContainer) {
337
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
338
- } else {
339
- styleContainerNode.prepend(styleElm);
340
- }
341
- }
342
- } else {
343
- styleContainerNode.append(styleElm);
344
- }
345
- }
346
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
347
- styleContainerNode.insertBefore(styleElm, null);
348
- }
324
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
349
325
  }
350
326
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
351
327
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -368,7 +344,7 @@ var attachStyles = (hostRef) => {
368
344
  const scopeId2 = addStyle(
369
345
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
370
346
  cmpMeta);
371
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
347
+ if (flags & 10 /* needsScopedEncapsulation */) {
372
348
  elm["s-sc"] = scopeId2;
373
349
  elm.classList.add(scopeId2 + "-h");
374
350
  }
@@ -437,11 +413,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
437
413
  if (memberName === "list") {
438
414
  isProp = false;
439
415
  } else if (oldValue == null || elm[memberName] != n) {
440
- if (typeof elm.__lookupSetter__(memberName) === "function") {
441
- elm[memberName] = n;
442
- } else {
443
- elm.setAttribute(memberName, n);
444
- }
416
+ elm[memberName] = n;
445
417
  }
446
418
  } else {
447
419
  elm[memberName] = newValue;
@@ -514,9 +486,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
514
486
  {
515
487
  updateElement(null, newVNode2, isSvgMode);
516
488
  }
517
- const rootNode = elm.getRootNode();
518
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
519
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
489
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
520
490
  elm.classList.add(elm["s-si"] = scopeId);
521
491
  }
522
492
  if (newVNode2.$children$) {
@@ -670,10 +640,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
670
640
  elm.textContent = "";
671
641
  }
672
642
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
673
- } else if (
674
- // don't do this on initial render as it can cause non-hydrated content to be removed
675
- !isInitialRender && BUILD.updatable && oldChildren !== null
676
- ) {
643
+ } else if (oldChildren !== null) {
677
644
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
678
645
  }
679
646
  } else if (oldVNode.$text$ !== text) {
@@ -816,12 +783,16 @@ var postUpdateComponent = (hostRef) => {
816
783
  const tagName = hostRef.$cmpMeta$.$tagName$;
817
784
  const elm = hostRef.$hostElement$;
818
785
  const endPostUpdate = createTime("postUpdate", tagName);
786
+ const instance = hostRef.$lazyInstance$ ;
819
787
  const ancestorComponent = hostRef.$ancestorComponent$;
820
788
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
821
789
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
822
790
  {
823
791
  addHydratedFlag(elm);
824
792
  }
793
+ {
794
+ safeCall(instance, "componentDidLoad");
795
+ }
825
796
  endPostUpdate();
826
797
  {
827
798
  hostRef.$onReadyResolve$(elm);
@@ -934,8 +905,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
934
905
  if (this.hasOwnProperty(propName)) {
935
906
  newValue = this[propName];
936
907
  delete this[propName];
937
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
938
- this[propName] == newValue) {
908
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
939
909
  return;
940
910
  } else if (propName == null) {
941
911
  const hostRef = getHostRef(this);
@@ -1087,12 +1057,17 @@ var connectedCallback = (elm) => {
1087
1057
  }
1088
1058
  };
1089
1059
  var disconnectInstance = (instance) => {
1060
+ {
1061
+ safeCall(instance, "disconnectedCallback");
1062
+ }
1090
1063
  };
1091
1064
  var disconnectedCallback = async (elm) => {
1092
1065
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1093
1066
  const hostRef = getHostRef(elm);
1094
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1095
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1067
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1068
+ disconnectInstance(hostRef.$lazyInstance$);
1069
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1070
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1096
1071
  }
1097
1072
  }
1098
1073
  };
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PromotingBanners } from './promoting-banners-10e80966.js';
2
- import './index-936cf61c.js';
1
+ export { P as PromotingBanners } from './promoting-banners-79d679c1.js';
2
+ import './index-43b1379d.js';
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-936cf61c.js';
2
- export { s as setNonce } from './index-936cf61c.js';
1
+ import { b as bootstrapLazy } from './index-43b1379d.js';
2
+ export { s as setNonce } from './index-43b1379d.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["promoting-banners",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
8
+ return bootstrapLazy([["promoting-banners",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-936cf61c.js';
1
+ import { r as registerInstance, h } from './index-43b1379d.js';
2
2
 
3
3
  const getDevice = () => {
4
4
  let userAgent = window.navigator.userAgent;
@@ -77,41 +77,73 @@ const getTranslations = (url) => {
77
77
  });
78
78
  };
79
79
 
80
+ /**
81
+ * @name setClientStyling
82
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
83
+ * @param {HTMLElement} stylingContainer The reference element of the widget
84
+ * @param {string} clientStyling The style content
85
+ */
86
+ function setClientStyling(stylingContainer, clientStyling) {
87
+ if (stylingContainer) {
88
+ const sheet = document.createElement('style');
89
+ sheet.innerHTML = clientStyling;
90
+ stylingContainer.appendChild(sheet);
91
+ }
92
+ }
93
+
94
+ /**
95
+ * @name setClientStylingURL
96
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
97
+ * @param {HTMLElement} stylingContainer The reference element of the widget
98
+ * @param {string} clientStylingUrl The URL of the style content
99
+ */
100
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
101
+ const url = new URL(clientStylingUrl);
102
+
103
+ fetch(url.href)
104
+ .then((res) => res.text())
105
+ .then((data) => {
106
+ const cssFile = document.createElement('style');
107
+ cssFile.innerHTML = data;
108
+ if (stylingContainer) {
109
+ stylingContainer.appendChild(cssFile);
110
+ }
111
+ })
112
+ .catch((err) => {
113
+ console.error('There was an error while trying to load client styling from URL', err);
114
+ });
115
+ }
116
+
117
+ /**
118
+ * @name setStreamLibrary
119
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
120
+ * @param {HTMLElement} stylingContainer The highest element of the widget
121
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
122
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
123
+ */
124
+ function setStreamStyling(stylingContainer, domain, subscription) {
125
+ if (window.emMessageBus) {
126
+ const sheet = document.createElement('style');
127
+
128
+ window.emMessageBus.subscribe(domain, (data) => {
129
+ sheet.innerHTML = data;
130
+ if (stylingContainer) {
131
+ stylingContainer.appendChild(sheet);
132
+ }
133
+ });
134
+ }
135
+ }
136
+
80
137
  const promotingBannersCss = ".PromotingBannersIconContainer img{width:50px;height:50px;border-radius:var(--emw--border-radius-image, 50%);background-size:contain;margin:10px}.PromotingBannersSection{padding:10px;border-radius:var(--emw--border-radius-small, 5px);background-color:var(--emw--promo-color-background, var(--emw--color-background, #2f2f2f));background-repeat:no-repeat;background-position:center;color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff));font-family:var(--emw--font-family-primary, \"Montserrat\", sans-serif);overflow:hidden;position:relative}.PromotingBannersGrid{display:grid;grid-gap:30px;background-size:contain;background-repeat:no-repeat;padding:10px;width:100%;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));box-sizing:border-box}.PromotingBannersContent{color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff))}.PromotingBannersContent p{display:block;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.PromotingBannersHeader{display:flex;justify-content:center;flex-direction:column;align-items:center}.PromotingBannersHeader p{text-align:center}.PromotingBannersBox{min-width:200px;display:flex;justify-content:flex-start;overflow:hidden;flex-direction:row;gap:20px;text-decoration:none;color:inherit;background-size:cover;background-position:center;border-radius:var(--emw--border-radius-small, 5px)}.PromotingBannersSectionTitle,.PromotingBannersSectionSubtitle{margin:10px auto;background:transparent}.PromotingBannersTextContainer{margin:5px;overflow:hidden;position:relative;padding-bottom:30px}.PromotingBannersTitle{margin:5px auto}.PromotingBannersButton{cursor:pointer;color:inherit;text-decoration:none;position:absolute;bottom:5px;border:0;background:transparent}.ButtonDisabled{cursor:not-allowed}.PromotionalBannersTextContainer{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AboutUsError .ErrorInfo{color:var(--emw--promo-color-error, var(--emw--color-error, #ed0909))}.SkeletonGrid{display:grid}.Skeleton{animation:skeleton-loading 0.6s linear infinite alternate}@keyframes skeleton-loading{0%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.2) 0%, rgba(0, 61, 93, 0.2) 100%)}12%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.225) 0%, rgba(0, 61, 93, 0.225) 100%)}25%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.25) 0%, rgba(0, 61, 93, 0.25) 100%)}33%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.275) 0%, rgba(0, 61, 93, 0.275) 100%)}50%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.3) 0%, rgba(0, 61, 93, 0.3) 100%)}63%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.325) 0%, rgba(0, 61, 93, 0.325) 100%)}75%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.35) 0%, rgba(0, 61, 93, 0.35) 100%)}88%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.375) 0%, rgba(0, 61, 93, 0.375) 100%)}100%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.4) 0%, rgba(0, 61, 93, 0.4) 100%)}}.SkeletonItem{opacity:0.5;margin:0 15px;width:125px;height:150px;border-radius:var(--emw--border-radius-medium, 15px);margin:20px}";
81
138
  const PromotingBannersStyle0 = promotingBannersCss;
82
139
 
83
140
  const PromotingBanners = class {
84
141
  constructor(hostRef) {
85
142
  registerInstance(this, hostRef);
86
- this.setClientStyling = () => {
87
- let sheet = document.createElement('style');
88
- sheet.innerHTML = this.clientStyling;
89
- this.stylingContainer.prepend(sheet);
90
- };
91
- this.setClientStylingURL = () => {
92
- let url = new URL(this.clientStylingUrl);
93
- let cssFile = document.createElement('style');
94
- fetch(url.href)
95
- .then((res) => res.text())
96
- .then((data) => {
97
- cssFile.innerHTML = data;
98
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
99
- })
100
- .catch((err) => {
101
- console.log('error ', err);
102
- });
103
- };
104
- this.componentDidLoad = () => {
105
- if (this.stylingContainer) {
106
- if (this.clientStyling)
107
- this.setClientStyling();
108
- if (this.clientStylingUrl)
109
- this.setClientStylingURL();
110
- }
111
- };
112
143
  this.cmsEndpoint = '';
113
144
  this.language = 'en';
114
145
  this.cmsEnv = '';
146
+ this.mbSource = undefined;
115
147
  this.clientStyling = '';
116
148
  this.clientStylingUrl = '';
117
149
  this.translationUrl = '';
@@ -120,9 +152,16 @@ const PromotingBanners = class {
120
152
  this.isLoading = true;
121
153
  this.translationData = undefined;
122
154
  }
123
- handleStylingChange(newValue, oldValue) {
124
- if (newValue !== oldValue)
125
- this.setClientStyling();
155
+ handleClientStylingChange(newValue, oldValue) {
156
+ if (newValue != oldValue) {
157
+ setClientStyling(this.stylingContainer, this.clientStyling);
158
+ }
159
+ }
160
+ handleClientStylingChangeURL(newValue, oldValue) {
161
+ if (newValue != oldValue) {
162
+ if (this.clientStylingUrl)
163
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
164
+ }
126
165
  }
127
166
  handleNewTranslations() {
128
167
  this.isLoading = true;
@@ -135,6 +174,22 @@ const PromotingBanners = class {
135
174
  this.getPromotingBanners();
136
175
  }
137
176
  }
177
+ componentDidLoad() {
178
+ if (this.stylingContainer) {
179
+ if (window.emMessageBus != undefined) {
180
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
181
+ }
182
+ else {
183
+ if (this.clientStyling)
184
+ setClientStyling(this.stylingContainer, this.clientStyling);
185
+ if (this.clientStylingUrl)
186
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
187
+ }
188
+ }
189
+ }
190
+ disconnectedCallback() {
191
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
192
+ }
138
193
  getPromotingBanners() {
139
194
  const url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
140
195
  const params = new URLSearchParams();
@@ -190,12 +245,12 @@ const PromotingBanners = class {
190
245
  }
191
246
  render() {
192
247
  var _a, _b, _c, _d;
193
- return (h("div", { key: '80f15f2a7a49290bfd0fb80c6ccfb02b9fe3a0a9', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && h("div", { key: '392ef0a6910a457d17efc41a3a2443afc8be4a61', class: "AboutUsError" }, h("div", { key: 'c19eb8a49a8c8a422bd47557a7815e0252667005', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && h("div", { key: '28fc923e41227b8ca1529e8e2815ebd70678e50c', class: "SkeletonGrid" }, new Array(4).fill(null).map((index) => (h("div", { key: index, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
194
- h("div", { key: 'aff2d67a139ede5bdcc3c1ad240806594ab5fae7', class: "PromotingBannersWrapper" }, h("div", { key: '7d8caf2fee017407a618960ea37fff9d809e3eaa', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && h("h1", { key: 'd947b41266fdfda8762ebc654c7a1c3516a08be5', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && h("h5", { key: '72127f002e53c9e2d7430e222494c4470aca23e9', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), h("div", { key: '50c4fb4ae455f363d128993908016b0245c2bd50', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
248
+ return (h("div", { key: '7b5d4fb98c2e5f281e88ee55796acbdbccea9b18', class: "PromotingBannersSection", ref: el => this.stylingContainer = el }, this.hasErrors && h("div", { key: 'a94b12073ffc5f31c16869980a788958c3cd094d', class: "AboutUsError" }, h("div", { key: '01b900b7b20a509fdfe5b42fd922498b9c401dd1', class: "ErrorInfo" }, translate('error', this.language))), this.isLoading && h("div", { key: 'a3154cc38eb0ff53ac4a95e8d7637b0d827d3703', class: "SkeletonGrid" }, new Array(4).fill(null).map((index) => (h("div", { key: index, class: "Skeleton SkeletonItem" })))), !this.isLoading &&
249
+ h("div", { key: '2482f3de75009242aaf9017a5143d54ad4215454', class: "PromotingBannersWrapper" }, h("div", { key: '03a427cd483369db58e4167336b36b7e84a84abf', class: getDevice() === 'PC' ? 'PromotingBannersHeader' : 'PromotingBannersHeader PromotingBannersHeaderMobile' }, ((_a = this.promotingBannersArray) === null || _a === void 0 ? void 0 : _a.title) && h("h1", { key: '3506a22eef9b94146424307dcdde934e21c2b348', class: "PromotingBannersSectionTitle" }, (_b = this.promotingBannersArray) === null || _b === void 0 ? void 0 : _b.title), ((_c = this.promotingBannersArray) === null || _c === void 0 ? void 0 : _c.description) && h("h5", { key: '36783744584e48a83a629be83de187f552668c8b', class: "PromotingBannersSectionSubtitle", style: { 'display': `${getDevice() !== 'PC' ? 'inline-block' : 'none'}` }, innerHTML: (_d = this.promotingBannersArray) === null || _d === void 0 ? void 0 : _d.description })), h("div", { key: '4fd616bb2759411e226c3e912f0a9096f64703d0', class: "PromotingBannersGrid" }, this.promotingBannersArray.map(banner => (this.renderBannersGrid(banner)))))));
195
250
  }
196
251
  static get watchers() { return {
197
- "clientStyling": ["handleStylingChange"],
198
- "clientStylingUrl": ["handleStylingChange"],
252
+ "clientStyling": ["handleClientStylingChange"],
253
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
199
254
  "translationUrl": ["handleNewTranslations"]
200
255
  }; }
201
256
  };
@@ -1,2 +1,2 @@
1
- export { P as promoting_banners } from './promoting-banners-10e80966.js';
2
- import './index-936cf61c.js';
1
+ export { P as promoting_banners } from './promoting-banners-79d679c1.js';
2
+ import './index-43b1379d.js';
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-936cf61c.js';
2
- export { s as setNonce } from './index-936cf61c.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-43b1379d.js';
2
+ export { s as setNonce } from './index-43b1379d.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["promoting-banners",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
19
+ return bootstrapLazy([["promoting-banners",[[1,"promoting-banners",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"promotingBannersArray":[32],"hasErrors":[32],"isLoading":[32],"translationData":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["handleNewTranslations"]}]]]], options);
20
20
  });
@@ -1 +1 @@
1
- export{P as PromotingBanners}from"./p-53a1c74c.js";import"./p-a3d905a8.js";
1
+ export{P as PromotingBanners}from"./p-5c9ce269.js";import"./p-53cf2adf.js";
@@ -0,0 +1 @@
1
+ export{P as promoting_banners}from"./p-5c9ce269.js";import"./p-53cf2adf.js";
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),p=!1,m=[],y=[],$=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&f.l?v(b):f.raf(b))},w=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{w(m),w(y),(p=m.length>0)&&f.raf(b)},v=e=>h().then(e),g=$(y,!0),S={},k=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>C,map:()=>E,ok:()=>O,unwrap:()=>P,unwrapErr:()=>L});var O=e=>({isOk:!0,isErr:!1,value:e}),C=e=>({isOk:!1,isErr:!0,value:e});function E(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return C(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},L=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!k(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=o,u},T=(e,t)=>({l:0,m:e,i:t,$:null,h:null,u:null,p:null}),A={},N=new WeakMap,U=e=>"sc-"+e.v,W=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=F(n),s=F(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=k(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(H);t=t.replace(q,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},D=/\s/,F=e=>e?e.split(D):[],H="Capture",q=RegExp(H+"$"),G=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of V(Object.keys(o)))e in s||W(l,e,o[e],void 0,n,t.l);for(const e of V(Object.keys(s)))W(l,e,o[e],s[e],n,t.l)};function V(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var _=!1,z=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.m),G(null,l,_),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=z(e,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},B=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=z(null,n,o),r&&(l[o].$=r,X(i,r,t)))},I=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Q(t),e&&e.remove()}}},J=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),K=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(G(e,t,_),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],p=l.length-1,m=l[0],y=l[p];for(;i<=f&&c<=p;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==m)m=l[++c];else if(null==y)y=l[--p];else if(J(h,m,o))K(h,m,o),h=t[++i],m=l[++c];else if(J(d,y,o))K(d,y,o),d=t[--f],y=l[--p];else if(J(h,y,o))K(h,y,o),X(e,h.$,d.$.nextSibling),h=t[++i],y=l[--p];else if(J(d,m,o))K(d,m,o),X(e,d.$,h.$),d=t[--f],m=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(r=t[u],r.m!==m.m?s=z(t&&t[c],n,u):(K(r,m,o),t[u]=void 0,s=r.$),m=l[++c]):(s=z(t&&t[c],n,c),m=l[++c]),s&&X(h.$.parentNode,s,h.$)}i>f?B(e,null==l[p+1]?null:l[p+1].$,n,l,c,p):c>p&&I(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),B(l,null,t,s,0,s.length-1)):null!==o&&I(o,0,o.length-1)):e.i!==r&&(l.data=r)},Q=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Q)},X=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Y=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Z=(e,t)=>{if(e.l|=16,!(4&e.l))return Y(e,e.k),g((()=>ee(e,t)));e.l|=512},ee=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ie(n,"componentWillLoad")),te(l,(()=>le(e,n,t)))},te=(e,t)=>ne(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ne=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,le=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.j,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=U(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=N.get(e=e.head||e);if(r||N.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:j(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);oe(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>se(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},oe=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.j,s=e.C||T(null,null),r=(e=>e&&e.m===A)(t)?t:R(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.m=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],K(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},se=e=>{const t=e.$hostElement$,n=e.t,l=e.k;64&e.l||(e.l|=64,ce(t),ie(n,"componentDidLoad"),e.P(t),l||re()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>Z(e,!1))),e.l&=-517},re=()=>{ce(a.documentElement),v((()=>(e=>{const t=f.ce("appload",{detail:{namespace:"promoting-banners"}});return e.dispatchEvent(t),t})(u)))},ie=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ce=e=>e.classList.add("hydrated"),ue=(e,t,l)=>{var o,r;const i=e.prototype;if(t.L||t.R||e.watchers){e.watchers&&!t.R&&(t.R=e.watchers);const c=Object.entries(null!=(o=t.L)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||k(e)?e:1&t?e+"":e)(l,o.L[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.R&&128&u){const e=o.R[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&Z(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.R)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.R)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},ae=e=>{ie(e,"connectedCallback")},fe=e=>{ie(e,"disconnectedCallback")},he=(e,l={})=>{var o;const h=[],p=l.exclude||[],m=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),w=a.createElement("style"),b=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],L:l[2],A:l[3]};4&c.l&&(S=!0),c.L=l[2],c.M=[],c.R=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,j:n,T:new Map};l.N=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?b.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.j,o=()=>{};if(1&t.l)(null==t?void 0:t.t)?ae(t.t):(null==t?void 0:t.N)&&t.N.then((()=>ae(t.t)));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Y(t,t.k=n);break}}l.L&&Object.entries(l.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.U){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.U;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.W}" was not found`);l.isProxied||(n.R=l.watchers,ue(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o(),ae(t.t)}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=U(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.k,c=()=>Z(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?fe(e.t):(null==e?void 0:e.N)&&e.N.then((()=>fe(e.t)))}})()))}componentOnReady(){return n(this).N}};c.U=e[0],p.includes(u)||m.get(u)||(h.push(u),m.define(u,ue(a,c,1)))}))})),h.length>0&&(S&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const e=null!=(o=f.O)?o:j(a);null!=e&&w.setAttribute("nonce",e),y.insertBefore(w,$?$.nextSibling:y.firstChild)}g=!1,b.length?b.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(re,30)))},de=e=>f.O=e;export{he as b,R as h,h as p,l as r,de as s}
@@ -0,0 +1 @@
1
+ import{r as e,h as n}from"./p-53cf2adf.js";const r=()=>{let e=window.navigator.userAgent;return e.toLowerCase().match(/android/i)?"Android":e.toLowerCase().match(/iphone/i)?"iPhone":e.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"},o={en:{error:"Error",noResults:"Loading, please wait ..."},hu:{error:"Error",noResults:"Loading, please wait ..."},ro:{error:"Eroare",noResults:"Loading, please wait ..."},fr:{error:"Error",noResults:"Loading, please wait ..."},ar:{error:"خطأ",noResults:"Loading, please wait ..."},hr:{error:"Greška",noResults:"Učitavanje, molimo pričekajte ..."}},i=e=>new Promise(((n,r)=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((n=>{for(let r in e[n])o[n][r]=e[n][r]})),n(o)})).catch((e=>{r(e)}))}));function t(e,n){if(e){const r=document.createElement("style");r.innerHTML=n,e.appendChild(r)}}function a(e,n){const r=new URL(n);fetch(r.href).then((e=>e.text())).then((n=>{const r=document.createElement("style");r.innerHTML=n,e&&e.appendChild(r)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const s=class{constructor(n){e(this,n),this.cmsEndpoint="",this.language="en",this.cmsEnv="",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.promotingBannersArray=[],this.hasErrors=!1,this.isLoading=!0,this.translationData=void 0}handleClientStylingChange(e,n){e!=n&&t(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(e,n){e!=n&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}handleNewTranslations(){this.isLoading=!0,i(this.translationUrl).then((()=>{this.isLoading=!1}))}connectedCallback(){this.cmsEndpoint&&this.language&&this.getPromotingBanners()}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(e,n){if(window.emMessageBus){const r=document.createElement("style");window.emMessageBus.subscribe(n,(n=>{r.innerHTML=n,e&&e.appendChild(r)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&t(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}getPromotingBanners(){const e=new URL(`${this.cmsEndpoint}/${this.language}/homepage`),n=new URLSearchParams;n.append("language",this.language),n.append("env",this.cmsEnv),n.append("device",(()=>{const e=r();if(e)return"PC"===e?"dk":"mtWeb"})()),e.search=n.toString();let o={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}};return new Promise(((n,r)=>{this.isLoading=!0,fetch(e.href,o).then((e=>e.json())).then((e=>{const{promotingBanners:r}=e;this.promotingBannersArray=r,n(r)})).catch((e=>{console.error("Error fetching data:",e),this.hasErrors=!0,r(e)})).finally((()=>{this.isLoading=!1}))}))}sendOpenLink(e,n,r){window.postMessage({type:"NavigateTo",path:e,target:r||null,externalLink:n||!1},window.location.href)}async componentWillLoad(){const e=[];if(this.translationUrl){const n=i(this.translationUrl).then((e=>{this.translationData=JSON.stringify(e)})).catch((e=>{console.log(e)}));e.push(n)}return Promise.all(e)}renderBannersGrid(e){var o,i,t;return n("a",{class:"PromotingBannersBox",href:null==e?void 0:e.url,target:e.targetType,style:{backgroundImage:`url(${null==e?void 0:e.backgroundImage})`}},n("div",{class:"PromotingBannersIconContainer"},n("img",{src:"Android"===r()||"iPhone"===r()?null===(o=e.icon)||void 0===o?void 0:o.mobile:"iPad"===r()?null===(i=e.image)||void 0===i?void 0:i.srcTablet:null===(t=e.icon)||void 0===t?void 0:t.desktop,alt:"Banner image"})),n("div",{class:"PromotingBannersTextContainer"},n("h3",{class:"PromotingBannersTitle"},null==e?void 0:e.title),n("div",{class:"PromotingBannersContent",innerHTML:null==e?void 0:e.description}),e.button&&n("button",{class:"PromotingBannersButton "+((null==e?void 0:e.button.text)?"":"ButtonDisabled"),innerHTML:null==e?void 0:e.button.text,onClick:this.sendOpenLink.bind(this,null==e?void 0:e.button.url,null==e?void 0:e.button.externalLink,null==e?void 0:e.button.target)})))}render(){var e,i,t,a,s;return n("div",{key:"7b5d4fb98c2e5f281e88ee55796acbdbccea9b18",class:"PromotingBannersSection",ref:e=>this.stylingContainer=e},this.hasErrors&&n("div",{key:"a94b12073ffc5f31c16869980a788958c3cd094d",class:"AboutUsError"},n("div",{key:"01b900b7b20a509fdfe5b42fd922498b9c401dd1",class:"ErrorInfo"},o[void 0!==(s=this.language)&&s in o?s:"en"].error)),this.isLoading&&n("div",{key:"a3154cc38eb0ff53ac4a95e8d7637b0d827d3703",class:"SkeletonGrid"},new Array(4).fill(null).map((e=>n("div",{key:e,class:"Skeleton SkeletonItem"})))),!this.isLoading&&n("div",{key:"2482f3de75009242aaf9017a5143d54ad4215454",class:"PromotingBannersWrapper"},n("div",{key:"03a427cd483369db58e4167336b36b7e84a84abf",class:"PC"===r()?"PromotingBannersHeader":"PromotingBannersHeader PromotingBannersHeaderMobile"},(null===(e=this.promotingBannersArray)||void 0===e?void 0:e.title)&&n("h1",{key:"3506a22eef9b94146424307dcdde934e21c2b348",class:"PromotingBannersSectionTitle"},null===(i=this.promotingBannersArray)||void 0===i?void 0:i.title),(null===(t=this.promotingBannersArray)||void 0===t?void 0:t.description)&&n("h5",{key:"36783744584e48a83a629be83de187f552668c8b",class:"PromotingBannersSectionSubtitle",style:{display:"PC"!==r()?"inline-block":"none"},innerHTML:null===(a=this.promotingBannersArray)||void 0===a?void 0:a.description})),n("div",{key:"4fd616bb2759411e226c3e912f0a9096f64703d0",class:"PromotingBannersGrid"},this.promotingBannersArray.map((e=>this.renderBannersGrid(e))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}}};s.style='.PromotingBannersIconContainer img{width:50px;height:50px;border-radius:var(--emw--border-radius-image, 50%);background-size:contain;margin:10px}.PromotingBannersSection{padding:10px;border-radius:var(--emw--border-radius-small, 5px);background-color:var(--emw--promo-color-background, var(--emw--color-background, #2f2f2f));background-repeat:no-repeat;background-position:center;color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff));font-family:var(--emw--font-family-primary, "Montserrat", sans-serif);overflow:hidden;position:relative}.PromotingBannersGrid{display:grid;grid-gap:30px;background-size:contain;background-repeat:no-repeat;padding:10px;width:100%;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));box-sizing:border-box}.PromotingBannersContent{color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff))}.PromotingBannersContent p{display:block;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.PromotingBannersHeader{display:flex;justify-content:center;flex-direction:column;align-items:center}.PromotingBannersHeader p{text-align:center}.PromotingBannersBox{min-width:200px;display:flex;justify-content:flex-start;overflow:hidden;flex-direction:row;gap:20px;text-decoration:none;color:inherit;background-size:cover;background-position:center;border-radius:var(--emw--border-radius-small, 5px)}.PromotingBannersSectionTitle,.PromotingBannersSectionSubtitle{margin:10px auto;background:transparent}.PromotingBannersTextContainer{margin:5px;overflow:hidden;position:relative;padding-bottom:30px}.PromotingBannersTitle{margin:5px auto}.PromotingBannersButton{cursor:pointer;color:inherit;text-decoration:none;position:absolute;bottom:5px;border:0;background:transparent}.ButtonDisabled{cursor:not-allowed}.PromotionalBannersTextContainer{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AboutUsError .ErrorInfo{color:var(--emw--promo-color-error, var(--emw--color-error, #ed0909))}.SkeletonGrid{display:grid}.Skeleton{animation:skeleton-loading 0.6s linear infinite alternate}@keyframes skeleton-loading{0%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.2) 0%, rgba(0, 61, 93, 0.2) 100%)}12%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.225) 0%, rgba(0, 61, 93, 0.225) 100%)}25%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.25) 0%, rgba(0, 61, 93, 0.25) 100%)}33%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.275) 0%, rgba(0, 61, 93, 0.275) 100%)}50%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.3) 0%, rgba(0, 61, 93, 0.3) 100%)}63%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.325) 0%, rgba(0, 61, 93, 0.325) 100%)}75%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.35) 0%, rgba(0, 61, 93, 0.35) 100%)}88%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.375) 0%, rgba(0, 61, 93, 0.375) 100%)}100%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.4) 0%, rgba(0, 61, 93, 0.4) 100%)}}.SkeletonItem{opacity:0.5;margin:0 15px;width:125px;height:150px;border-radius:var(--emw--border-radius-medium, 15px);margin:20px}';export{s as P}
@@ -1 +1 @@
1
- import{p as n,b as a}from"./p-a3d905a8.js";export{s as setNonce}from"./p-a3d905a8.js";import{g as t}from"./p-e1255160.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),n(t)})().then((async n=>(await t(),a([["p-7f9296a7",[[1,"promoting-banners",{cmsEndpoint:[513,"cms-endpoint"],language:[513],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],promotingBannersArray:[32],hasErrors:[32],isLoading:[32],translationData:[32]},null,{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingChange"],translationUrl:["handleNewTranslations"]}]]]],n))));
1
+ import{p as n,b as t}from"./p-53cf2adf.js";export{s as setNonce}from"./p-53cf2adf.js";import{g as a}from"./p-e1255160.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),n(a)})().then((async n=>(await a(),t([["p-33973aec",[[1,"promoting-banners",{cmsEndpoint:[513,"cms-endpoint"],language:[513],cmsEnv:[513,"cms-env"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],promotingBannersArray:[32],hasErrors:[32],isLoading:[32],translationData:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["handleNewTranslations"]}]]]],n))));
@@ -11,6 +11,10 @@ export declare class PromotingBanners {
11
11
  * The CMS environment
12
12
  */
13
13
  cmsEnv: string;
14
+ /**
15
+ * Client custom styling via streamStyling
16
+ */
17
+ mbSource: string;
14
18
  /**
15
19
  * Client custom styling via inline style
16
20
  */
@@ -28,12 +32,13 @@ export declare class PromotingBanners {
28
32
  private isLoading;
29
33
  translationData: any;
30
34
  private stylingContainer;
31
- handleStylingChange(newValue: string, oldValue: string): void;
35
+ private stylingSubscription;
36
+ handleClientStylingChange(newValue: any, oldValue: any): void;
37
+ handleClientStylingChangeURL(newValue: any, oldValue: any): void;
32
38
  handleNewTranslations(): void;
33
39
  connectedCallback(): void;
34
- setClientStyling: () => void;
35
- setClientStylingURL: () => void;
36
- componentDidLoad: () => void;
40
+ componentDidLoad(): void;
41
+ disconnectedCallback(): void;
37
42
  getPromotingBanners(): Promise<void>;
38
43
  sendOpenLink(url: string, isExternal: boolean, target: string): void;
39
44
  componentWillLoad(): Promise<any>;
@@ -27,6 +27,10 @@ export namespace Components {
27
27
  * The language
28
28
  */
29
29
  "language": string;
30
+ /**
31
+ * Client custom styling via streamStyling
32
+ */
33
+ "mbSource": string;
30
34
  /**
31
35
  * Translations via URL
32
36
  */
@@ -66,6 +70,10 @@ declare namespace LocalJSX {
66
70
  * The language
67
71
  */
68
72
  "language"?: string;
73
+ /**
74
+ * Client custom styling via streamStyling
75
+ */
76
+ "mbSource"?: string;
69
77
  /**
70
78
  * Translations via URL
71
79
  */
@@ -1015,8 +1015,6 @@ export declare namespace JSXBase {
1015
1015
  autoPlay?: boolean;
1016
1016
  autoplay?: boolean | string;
1017
1017
  controls?: boolean;
1018
- controlslist?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
1019
- controlsList?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
1020
1018
  crossOrigin?: string;
1021
1019
  crossorigin?: string;
1022
1020
  loop?: boolean;
@@ -1566,10 +1564,6 @@ export declare namespace JSXBase {
1566
1564
  onSubmitCapture?: (event: Event) => void;
1567
1565
  onInvalid?: (event: Event) => void;
1568
1566
  onInvalidCapture?: (event: Event) => void;
1569
- onBeforeToggle?: (event: Event) => void;
1570
- onBeforeToggleCapture?: (event: Event) => void;
1571
- onToggle?: (event: Event) => void;
1572
- onToggleCapture?: (event: Event) => void;
1573
1567
  onLoad?: (event: Event) => void;
1574
1568
  onLoadCapture?: (event: Event) => void;
1575
1569
  onError?: (event: Event) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/promoting-banners",
3
- "version": "1.55.0",
3
+ "version": "1.56.2",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,h as r}from"./p-a3d905a8.js";const n=()=>{let e=window.navigator.userAgent;return e.toLowerCase().match(/android/i)?"Android":e.toLowerCase().match(/iphone/i)?"iPhone":e.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"},o={en:{error:"Error",noResults:"Loading, please wait ..."},hu:{error:"Error",noResults:"Loading, please wait ..."},ro:{error:"Eroare",noResults:"Loading, please wait ..."},fr:{error:"Error",noResults:"Loading, please wait ..."},ar:{error:"خطأ",noResults:"Loading, please wait ..."},hr:{error:"Greška",noResults:"Učitavanje, molimo pričekajte ..."}},i=e=>new Promise(((r,n)=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((r=>{for(let n in e[r])o[r][n]=e[r][n]})),r(o)})).catch((e=>{n(e)}))})),a=class{constructor(r){e(this,r),this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.stylingContainer.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),r=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{r.innerHTML=e,setTimeout((()=>{this.stylingContainer.prepend(r)}),1)})).catch((e=>{console.log("error ",e)}))},this.componentDidLoad=()=>{this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL())},this.cmsEndpoint="",this.language="en",this.cmsEnv="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.promotingBannersArray=[],this.hasErrors=!1,this.isLoading=!0,this.translationData=void 0}handleStylingChange(e,r){e!==r&&this.setClientStyling()}handleNewTranslations(){this.isLoading=!0,i(this.translationUrl).then((()=>{this.isLoading=!1}))}connectedCallback(){this.cmsEndpoint&&this.language&&this.getPromotingBanners()}getPromotingBanners(){const e=new URL(`${this.cmsEndpoint}/${this.language}/homepage`),r=new URLSearchParams;r.append("language",this.language),r.append("env",this.cmsEnv),r.append("device",(()=>{const e=n();if(e)return"PC"===e?"dk":"mtWeb"})()),e.search=r.toString();let o={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}};return new Promise(((r,n)=>{this.isLoading=!0,fetch(e.href,o).then((e=>e.json())).then((e=>{const{promotingBanners:n}=e;this.promotingBannersArray=n,r(n)})).catch((e=>{console.error("Error fetching data:",e),this.hasErrors=!0,n(e)})).finally((()=>{this.isLoading=!1}))}))}sendOpenLink(e,r,n){window.postMessage({type:"NavigateTo",path:e,target:n||null,externalLink:r||!1},window.location.href)}async componentWillLoad(){const e=[];if(this.translationUrl){const r=i(this.translationUrl).then((e=>{this.translationData=JSON.stringify(e)})).catch((e=>{console.log(e)}));e.push(r)}return Promise.all(e)}renderBannersGrid(e){var o,i,a;return r("a",{class:"PromotingBannersBox",href:null==e?void 0:e.url,target:e.targetType,style:{backgroundImage:`url(${null==e?void 0:e.backgroundImage})`}},r("div",{class:"PromotingBannersIconContainer"},r("img",{src:"Android"===n()||"iPhone"===n()?null===(o=e.icon)||void 0===o?void 0:o.mobile:"iPad"===n()?null===(i=e.image)||void 0===i?void 0:i.srcTablet:null===(a=e.icon)||void 0===a?void 0:a.desktop,alt:"Banner image"})),r("div",{class:"PromotingBannersTextContainer"},r("h3",{class:"PromotingBannersTitle"},null==e?void 0:e.title),r("div",{class:"PromotingBannersContent",innerHTML:null==e?void 0:e.description}),e.button&&r("button",{class:"PromotingBannersButton "+((null==e?void 0:e.button.text)?"":"ButtonDisabled"),innerHTML:null==e?void 0:e.button.text,onClick:this.sendOpenLink.bind(this,null==e?void 0:e.button.url,null==e?void 0:e.button.externalLink,null==e?void 0:e.button.target)})))}render(){var e,i,a,t,s;return r("div",{key:"80f15f2a7a49290bfd0fb80c6ccfb02b9fe3a0a9",class:"PromotingBannersSection",ref:e=>this.stylingContainer=e},this.hasErrors&&r("div",{key:"392ef0a6910a457d17efc41a3a2443afc8be4a61",class:"AboutUsError"},r("div",{key:"c19eb8a49a8c8a422bd47557a7815e0252667005",class:"ErrorInfo"},o[void 0!==(s=this.language)&&s in o?s:"en"].error)),this.isLoading&&r("div",{key:"28fc923e41227b8ca1529e8e2815ebd70678e50c",class:"SkeletonGrid"},new Array(4).fill(null).map((e=>r("div",{key:e,class:"Skeleton SkeletonItem"})))),!this.isLoading&&r("div",{key:"aff2d67a139ede5bdcc3c1ad240806594ab5fae7",class:"PromotingBannersWrapper"},r("div",{key:"7d8caf2fee017407a618960ea37fff9d809e3eaa",class:"PC"===n()?"PromotingBannersHeader":"PromotingBannersHeader PromotingBannersHeaderMobile"},(null===(e=this.promotingBannersArray)||void 0===e?void 0:e.title)&&r("h1",{key:"d947b41266fdfda8762ebc654c7a1c3516a08be5",class:"PromotingBannersSectionTitle"},null===(i=this.promotingBannersArray)||void 0===i?void 0:i.title),(null===(a=this.promotingBannersArray)||void 0===a?void 0:a.description)&&r("h5",{key:"72127f002e53c9e2d7430e222494c4470aca23e9",class:"PromotingBannersSectionSubtitle",style:{display:"PC"!==n()?"inline-block":"none"},innerHTML:null===(t=this.promotingBannersArray)||void 0===t?void 0:t.description})),r("div",{key:"50c4fb4ae455f363d128993908016b0245c2bd50",class:"PromotingBannersGrid"},this.promotingBannersArray.map((e=>this.renderBannersGrid(e))))))}static get watchers(){return{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingChange"],translationUrl:["handleNewTranslations"]}}};a.style='.PromotingBannersIconContainer img{width:50px;height:50px;border-radius:var(--emw--border-radius-image, 50%);background-size:contain;margin:10px}.PromotingBannersSection{padding:10px;border-radius:var(--emw--border-radius-small, 5px);background-color:var(--emw--promo-color-background, var(--emw--color-background, #2f2f2f));background-repeat:no-repeat;background-position:center;color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff));font-family:var(--emw--font-family-primary, "Montserrat", sans-serif);overflow:hidden;position:relative}.PromotingBannersGrid{display:grid;grid-gap:30px;background-size:contain;background-repeat:no-repeat;padding:10px;width:100%;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));box-sizing:border-box}.PromotingBannersContent{color:var(--emw--promo-color-primary, var(--emw--color-primary, #fff))}.PromotingBannersContent p{display:block;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.PromotingBannersHeader{display:flex;justify-content:center;flex-direction:column;align-items:center}.PromotingBannersHeader p{text-align:center}.PromotingBannersBox{min-width:200px;display:flex;justify-content:flex-start;overflow:hidden;flex-direction:row;gap:20px;text-decoration:none;color:inherit;background-size:cover;background-position:center;border-radius:var(--emw--border-radius-small, 5px)}.PromotingBannersSectionTitle,.PromotingBannersSectionSubtitle{margin:10px auto;background:transparent}.PromotingBannersTextContainer{margin:5px;overflow:hidden;position:relative;padding-bottom:30px}.PromotingBannersTitle{margin:5px auto}.PromotingBannersButton{cursor:pointer;color:inherit;text-decoration:none;position:absolute;bottom:5px;border:0;background:transparent}.ButtonDisabled{cursor:not-allowed}.PromotionalBannersTextContainer{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AboutUsError .ErrorInfo{color:var(--emw--promo-color-error, var(--emw--color-error, #ed0909))}.SkeletonGrid{display:grid}.Skeleton{animation:skeleton-loading 0.6s linear infinite alternate}@keyframes skeleton-loading{0%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.2) 0%, rgba(0, 61, 93, 0.2) 100%)}12%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.225) 0%, rgba(0, 61, 93, 0.225) 100%)}25%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.25) 0%, rgba(0, 61, 93, 0.25) 100%)}33%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.275) 0%, rgba(0, 61, 93, 0.275) 100%)}50%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.3) 0%, rgba(0, 61, 93, 0.3) 100%)}63%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.325) 0%, rgba(0, 61, 93, 0.325) 100%)}75%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.35) 0%, rgba(0, 61, 93, 0.35) 100%)}88%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.375) 0%, rgba(0, 61, 93, 0.375) 100%)}100%{background:linear-gradient(90deg, rgba(35, 178, 78, 0.4) 0%, rgba(0, 61, 93, 0.4) 100%)}}.SkeletonItem{opacity:0.5;margin:0 15px;width:125px;height:150px;border-radius:var(--emw--border-radius-medium, 15px);margin:20px}';export{a as P}
@@ -1 +0,0 @@
1
- export{P as promoting_banners}from"./p-53a1c74c.js";import"./p-a3d905a8.js";
@@ -1,2 +0,0 @@
1
- var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,d=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(b):f.raf(b))},w=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{w(d),w(y),(m=d.length>0)&&f.raf(b)},v=e=>h().then(e),S=$(y,!0),g={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>E(e))):E(n)}if(e.isErr)return O(e.value);throw"should never get here"}var M,x=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},A=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?H(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=H(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=o,u},H=(e,t)=>({l:0,m:e,i:t,$:null,h:null,u:null,p:null}),R={},T=new WeakMap,D=e=>"sc-"+e.v,L=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=U(n),s=U(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||("function"==typeof e.__lookupSetter__(t)?e[t]=o:e.setAttribute(t,o))}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(W);t=t.replace(F,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},N=/\s/,U=e=>e?e.split(N):[],W="Capture",F=RegExp(W+"$"),q=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||g,s=t.u||g;for(const e of G(Object.keys(o)))e in s||L(l,e,o[e],void 0,n,t.l);for(const e of G(Object.keys(s)))L(l,e,o[e],s[e],n,t.l)};function G(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var V=!1,_=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.m),q(null,l,V),o.getRootNode().querySelector("body"),l.h)for(r=0;r<l.h.length;++r)s=_(e,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},z=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=_(null,n,o),r&&(l[o].$=r,Q(i,r,t)))},B=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;K(t),e&&e.remove()}}},I=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),J=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(q(e,t,V),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],p=t[f],m=l.length-1,d=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==p)p=t[--f];else if(null==d)d=l[++c];else if(null==y)y=l[--m];else if(I(h,d,o))J(h,d,o),h=t[++i],d=l[++c];else if(I(p,y,o))J(p,y,o),p=t[--f],y=l[--m];else if(I(h,y,o))J(h,y,o),Q(e,h.$,p.$.nextSibling),h=t[++i],y=l[--m];else if(I(p,d,o))J(p,d,o),Q(e,p.$,h.$),p=t[--f],d=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===d.p){u=a;break}u>=0?(r=t[u],r.m!==d.m?s=_(t&&t[c],n,u):(J(r,d,o),t[u]=void 0,s=r.$),d=l[++c]):(s=_(t&&t[c],n,c),d=l[++c]),s&&Q(h.$.parentNode,s,h.$)}i>f?z(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&B(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),z(l,null,t,s,0,s.length-1)):!n&&null!==o&&B(o,0,o.length-1)):e.i!==r&&(l.data=r)},K=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(K)},Q=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),X=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Y=(e,t)=>{if(e.l|=16,!(4&e.l))return X(e,e.j),S((()=>Z(e,t)));e.l|=512},Z=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=re(n,"componentWillLoad")),ee(l,(()=>ne(e,n,t)))},ee=(e,t)=>te(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),te=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,ne=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=D(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=T.get(e=e.head||e);if(r||T.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const l=null!=(n=f.O)?n:k(a);if(null!=l&&s.setAttribute("nonce",l),!(1&t.l))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(s,n)}else if("host"in e)if(p){const t=new CSSStyleSheet;t.replaceSync(o),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.innerHTML=o+t.innerHTML:e.prepend(s)}else e.append(s);1&t.l&&"HEAD"!==e.nodeName&&e.insertBefore(s,null)}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&2&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);le(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>oe(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},le=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.k,s=e.C||H(null,null),r=(e=>e&&e.m===R)(t)?t:A(null,null,t);if(M=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.m=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,J(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},oe=e=>{const t=e.$hostElement$,n=e.j;64&e.l||(e.l|=64,ie(t),e.P(t),n||se()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>Y(e,!1))),e.l&=-517},se=()=>{ie(a.documentElement),v((()=>(e=>{const t=f.ce("appload",{detail:{namespace:"promoting-banners"}});return e.dispatchEvent(t),t})(u)))},re=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ie=e=>e.classList.add("hydrated"),ce=(e,t,l)=>{var o,r;const i=e.prototype;if(t.A||t.H||e.watchers){e.watchers&&!t.H&&(t.H=e.watchers);const c=Object.entries(null!=(o=t.A)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).R.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.R.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||j(e)?e:1&t?e+"":e)(l,o.A[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.R.set(t,l),a)){if(o.H&&128&u){const e=o.H[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&Y(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.H)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.H)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},ue=e=>{re(e,"connectedCallback")},ae=(e,l={})=>{var o;const h=[],m=l.exclude||[],d=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),w=a.createElement("style"),b=[];let v,S=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],A:l[2],T:l[3]};4&c.l&&(g=!0),c.A=l[2],c.M=[],c.H=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,R:new Map};l.D=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),S?b.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)?ue(t.t):(null==t?void 0:t.D)&&t.D.then((()=>ue(t.t)));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(t,t.j=n);break}}l.A&&Object.entries(l.A).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.L){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.L;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.N}" was not found`);l.isProxied||(n.H=l.watchers,ce(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o(),ue(t.t)}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=D(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);p&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>Y(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.D)&&e.D.then((()=>{}))}})()))}componentOnReady(){return n(this).D}};c.L=e[0],m.includes(u)||d.get(u)||(h.push(u),d.define(u,ce(a,c,1)))}))})),h.length>0&&(g&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&w.setAttribute("nonce",e),y.insertBefore(w,$?$.nextSibling:y.firstChild)}S=!1,b.length?b.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(se,30)))},fe=e=>f.O=e;export{ae as b,A as h,h as p,l as r,fe as s}