@everymatrix/general-preview-social-posts 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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a7767d7.js');
5
+ const index = require('./index-e03f08c0.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  let TRANSLATIONS = {
@@ -105,6 +105,63 @@ const getDevicePlatform = () => {
105
105
  }
106
106
  };
107
107
 
108
+ /**
109
+ * @name setClientStyling
110
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
111
+ * @param {HTMLElement} stylingContainer The reference element of the widget
112
+ * @param {string} clientStyling The style content
113
+ */
114
+ function setClientStyling(stylingContainer, clientStyling) {
115
+ if (stylingContainer) {
116
+ const sheet = document.createElement('style');
117
+ sheet.innerHTML = clientStyling;
118
+ stylingContainer.appendChild(sheet);
119
+ }
120
+ }
121
+
122
+ /**
123
+ * @name setClientStylingURL
124
+ * @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
125
+ * @param {HTMLElement} stylingContainer The reference element of the widget
126
+ * @param {string} clientStylingUrl The URL of the style content
127
+ */
128
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
129
+ const url = new URL(clientStylingUrl);
130
+
131
+ fetch(url.href)
132
+ .then((res) => res.text())
133
+ .then((data) => {
134
+ const cssFile = document.createElement('style');
135
+ cssFile.innerHTML = data;
136
+ if (stylingContainer) {
137
+ stylingContainer.appendChild(cssFile);
138
+ }
139
+ })
140
+ .catch((err) => {
141
+ console.error('There was an error while trying to load client styling from URL', err);
142
+ });
143
+ }
144
+
145
+ /**
146
+ * @name setStreamLibrary
147
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
148
+ * @param {HTMLElement} stylingContainer The highest element of the widget
149
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
150
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
151
+ */
152
+ function setStreamStyling(stylingContainer, domain, subscription) {
153
+ if (window.emMessageBus) {
154
+ const sheet = document.createElement('style');
155
+
156
+ window.emMessageBus.subscribe(domain, (data) => {
157
+ sheet.innerHTML = data;
158
+ if (stylingContainer) {
159
+ stylingContainer.appendChild(sheet);
160
+ }
161
+ });
162
+ }
163
+ }
164
+
108
165
  const generalPreviewSocialPostsCss = ":host {\n font-family: \"Roboto\", sans-serif;\n display: block;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.sliderWidget {\n display: block;\n max-width: 780px;\n margin: 0 auto;\n padding: 16px;\n max-height: 500px;\n}\n.sliderWidget h2 {\n font-size: 20px;\n}\n.sliderWidget .headerHontainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.sliderWidget .headerHontainer .viewAllButton {\n cursor: pointer;\n font-weight: bold;\n color: rgb(142, 142, 142);\n}\n.sliderWidget .postSlider {\n display: flex;\n overflow-x: auto;\n scroll-snap-type: x mandatory;\n gap: 24px;\n}\n.sliderWidget .postSlider .postCard {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-snap-align: start;\n padding: 20px;\n border-radius: 6px;\n min-width: 360px;\n background-color: rgb(244, 244, 244);\n}\n.sliderWidget .postSlider .postCard .Description {\n display: -webkit-box;\n -webkit-line-clamp: 5;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin-bottom: 14px;\n}\n.sliderWidget .postSlider .postCard .imageTitle {\n display: flex;\n justify-content: flex-start;\n gap: 20px;\n}\n.sliderWidget .postSlider .postCard .imageTitle img {\n height: 120px;\n width: 120px;\n border-radius: 6px;\n}\n.sliderWidget .postSlider .postCard .imageTitle .titleSubtitle {\n display: flex;\n flex-direction: column;\n}\n.sliderWidget .postSlider .postCard .buttons {\n display: flex;\n justify-content: center;\n gap: 12px;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton, .sliderWidget .postSlider .postCard .buttons .playNowButton {\n width: 172px;\n display: block;\n padding: 8px 16px;\n border: 3px solid #63B250;\n border-radius: 6px;\n cursor: pointer;\n font-weight: bold;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton {\n background-color: rgb(244, 244, 244);\n color: #63B250;\n}\n.sliderWidget .postSlider .postCard .buttons .playNowButton {\n background-color: #63B250;\n color: #fff;\n}\n\nh3, h4 {\n font-size: 18px;\n}\n\np {\n font-size: 14px;\n color: rgb(91, 91, 91);\n}\n\n@container (max-width: 480px) {\n .sliderWidget h2 {\n font-size: 18px;\n }\n .sliderWidget .postSlider .postCard {\n min-width: 250px;\n }\n h3, h4 {\n font-size: 16px;\n }\n p {\n font-size: 12px;\n }\n}";
109
166
  const GeneralPreviewSocialPostsStyle0 = generalPreviewSocialPostsCss;
110
167
 
@@ -115,24 +172,6 @@ const GeneralPreviewSocialPosts = class {
115
172
  this.playNow = index.createEvent(this, "playNow", 7);
116
173
  this.viewAll = index.createEvent(this, "viewAll", 7);
117
174
  this.platform = getDevicePlatform();
118
- this.setClientStyling = () => {
119
- let sheet = document.createElement('style');
120
- sheet.innerHTML = this.clientStyling;
121
- this.stylingContainer.prepend(sheet);
122
- };
123
- this.setClientStylingURL = () => {
124
- let url = new URL(this.clientStylingUrl);
125
- let cssFile = document.createElement('style');
126
- fetch(url.href)
127
- .then((res) => res.text())
128
- .then((data) => {
129
- cssFile.innerHTML = data;
130
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
131
- })
132
- .catch((err) => {
133
- console.log('error ', err);
134
- });
135
- };
136
175
  this.userId = '';
137
176
  this.session = '';
138
177
  this.postsTitle = '';
@@ -143,12 +182,12 @@ const GeneralPreviewSocialPosts = class {
143
182
  this.cmsEndpoint = '';
144
183
  this.userRoles = '';
145
184
  this.translationUrl = '';
185
+ this.mbSource = undefined;
146
186
  this.clientStyling = '';
147
187
  this.clientStylingUrl = '';
148
188
  this.cmsEnv = 'stage';
149
189
  this.pageName = 'casino';
150
190
  this.posts = [];
151
- this.stylingAppends = false;
152
191
  this.isLoading = false;
153
192
  this.isLoggedIn = false;
154
193
  this.dataImages = [];
@@ -160,6 +199,17 @@ const GeneralPreviewSocialPosts = class {
160
199
  this.isLoading = false;
161
200
  });
162
201
  }
202
+ handleClientStylingChange(newValue, oldValue) {
203
+ if (newValue != oldValue) {
204
+ setClientStyling(this.stylingContainer, this.clientStyling);
205
+ }
206
+ }
207
+ handleClientStylingChangeURL(newValue, oldValue) {
208
+ if (newValue != oldValue) {
209
+ if (this.clientStylingUrl)
210
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
211
+ }
212
+ }
163
213
  async componentWillLoad() {
164
214
  if (this.translationUrl.length > 2) {
165
215
  await getTranslations(this.translationUrl);
@@ -175,17 +225,6 @@ const GeneralPreviewSocialPosts = class {
175
225
  this.isLoggedIn = true;
176
226
  }
177
227
  }
178
- componentDidRender() {
179
- // start custom styling area
180
- if (!this.stylingAppends && this.stylingContainer) {
181
- if (this.clientStyling)
182
- this.setClientStyling();
183
- if (this.clientStylingUrl)
184
- this.setClientStylingURL();
185
- this.stylingAppends = true;
186
- }
187
- // end custom styling area
188
- }
189
228
  getDataImage(ids) {
190
229
  try {
191
230
  let url = new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);
@@ -229,6 +268,17 @@ const GeneralPreviewSocialPosts = class {
229
268
  }
230
269
  }
231
270
  async componentDidLoad() {
271
+ if (this.stylingContainer) {
272
+ if (window.emMessageBus != undefined) {
273
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
274
+ }
275
+ else {
276
+ if (this.clientStyling)
277
+ setClientStyling(this.stylingContainer, this.clientStyling);
278
+ if (this.clientStylingUrl)
279
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
280
+ }
281
+ }
232
282
  try {
233
283
  let url = new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);
234
284
  url.searchParams.append("device", this.platform);
@@ -275,6 +325,9 @@ const GeneralPreviewSocialPosts = class {
275
325
  console.error('Error fetching verification types:', error);
276
326
  }
277
327
  }
328
+ disconnectedCallback() {
329
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
330
+ }
278
331
  hasUndefinedValues(obj) {
279
332
  return Object.values(obj).some((value) => value === undefined);
280
333
  }
@@ -308,6 +361,8 @@ const GeneralPreviewSocialPosts = class {
308
361
  }
309
362
  static get watchers() { return {
310
363
  "translationUrl": ["handleNewTranslations"],
364
+ "clientStyling": ["handleClientStylingChange"],
365
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
311
366
  "session": ["watchSession"]
312
367
  }; }
313
368
  };
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a7767d7.js');
5
+ const index = require('./index-e03f08c0.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('general-preview-social-posts.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([["general-preview-social-posts.cjs",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"stylingAppends":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"session":["watchSession"]}]]]], options);
22
+ return index.bootstrapLazy([["general-preview-social-posts.cjs",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"session":["watchSession"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -21,10 +21,10 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'general-preview-social-posts';
24
- const BUILD = /* general-preview-social-posts */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
24
+ const BUILD = /* general-preview-social-posts */ { 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: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, 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) => {
@@ -349,31 +349,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
349
349
  if (nonce != null) {
350
350
  styleElm.setAttribute("nonce", nonce);
351
351
  }
352
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
353
- if (styleContainerNode.nodeName === "HEAD") {
354
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
355
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
356
- styleContainerNode.insertBefore(styleElm, referenceNode2);
357
- } else if ("host" in styleContainerNode) {
358
- if (supportsConstructableStylesheets) {
359
- const stylesheet = new CSSStyleSheet();
360
- stylesheet.replaceSync(style);
361
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
362
- } else {
363
- const existingStyleContainer = styleContainerNode.querySelector("style");
364
- if (existingStyleContainer) {
365
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
366
- } else {
367
- styleContainerNode.prepend(styleElm);
368
- }
369
- }
370
- } else {
371
- styleContainerNode.append(styleElm);
372
- }
373
- }
374
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
375
- styleContainerNode.insertBefore(styleElm, null);
376
- }
352
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
377
353
  }
378
354
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
379
355
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -396,7 +372,7 @@ var attachStyles = (hostRef) => {
396
372
  const scopeId2 = addStyle(
397
373
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
398
374
  cmpMeta);
399
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
375
+ if (flags & 10 /* needsScopedEncapsulation */) {
400
376
  elm["s-sc"] = scopeId2;
401
377
  elm.classList.add(scopeId2 + "-h");
402
378
  }
@@ -444,11 +420,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
444
420
  if (memberName === "list") {
445
421
  isProp = false;
446
422
  } else if (oldValue == null || elm[memberName] != n) {
447
- if (typeof elm.__lookupSetter__(memberName) === "function") {
448
- elm[memberName] = n;
449
- } else {
450
- elm.setAttribute(memberName, n);
451
- }
423
+ elm[memberName] = n;
452
424
  }
453
425
  } else {
454
426
  elm[memberName] = newValue;
@@ -521,9 +493,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
521
493
  {
522
494
  updateElement(null, newVNode2, isSvgMode);
523
495
  }
524
- const rootNode = elm.getRootNode();
525
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
526
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
496
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
527
497
  elm.classList.add(elm["s-si"] = scopeId);
528
498
  }
529
499
  if (newVNode2.$children$) {
@@ -652,10 +622,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
652
622
  elm.textContent = "";
653
623
  }
654
624
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
655
- } else if (
656
- // don't do this on initial render as it can cause non-hydrated content to be removed
657
- !isInitialRender && BUILD.updatable && oldChildren !== null
658
- ) {
625
+ } else if (oldChildren !== null) {
659
626
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
660
627
  }
661
628
  } else if (oldVNode.$text$ !== text) {
@@ -800,9 +767,6 @@ var postUpdateComponent = (hostRef) => {
800
767
  const endPostUpdate = createTime("postUpdate", tagName);
801
768
  const instance = hostRef.$lazyInstance$ ;
802
769
  const ancestorComponent = hostRef.$ancestorComponent$;
803
- {
804
- safeCall(instance, "componentDidRender");
805
- }
806
770
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
807
771
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
808
772
  {
@@ -923,8 +887,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
923
887
  if (this.hasOwnProperty(propName)) {
924
888
  newValue = this[propName];
925
889
  delete this[propName];
926
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
927
- this[propName] == newValue) {
890
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
928
891
  return;
929
892
  } else if (propName == null) {
930
893
  const hostRef = getHostRef(this);
@@ -1076,12 +1039,17 @@ var connectedCallback = (elm) => {
1076
1039
  }
1077
1040
  };
1078
1041
  var disconnectInstance = (instance) => {
1042
+ {
1043
+ safeCall(instance, "disconnectedCallback");
1044
+ }
1079
1045
  };
1080
1046
  var disconnectedCallback = async (elm) => {
1081
1047
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1082
1048
  const hostRef = getHostRef(elm);
1083
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1084
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1049
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1050
+ disconnectInstance(hostRef.$lazyInstance$);
1051
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1052
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1085
1053
  }
1086
1054
  }
1087
1055
  };
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a7767d7.js');
5
+ const index = require('./index-e03f08c0.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([["general-preview-social-posts.cjs",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"stylingAppends":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"session":["watchSession"]}]]]], options);
11
+ return index.bootstrapLazy([["general-preview-social-posts.cjs",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"session":["watchSession"]}]]]], options);
12
12
  };
13
13
 
14
14
  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,27 +1,10 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { getTranslations, translate } from "../../utils/locale.utils";
3
3
  import { getDevicePlatform } from "../../utils/utils";
4
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
5
  export class GeneralPreviewSocialPosts {
5
6
  constructor() {
6
7
  this.platform = getDevicePlatform();
7
- this.setClientStyling = () => {
8
- let sheet = document.createElement('style');
9
- sheet.innerHTML = this.clientStyling;
10
- this.stylingContainer.prepend(sheet);
11
- };
12
- this.setClientStylingURL = () => {
13
- let url = new URL(this.clientStylingUrl);
14
- let cssFile = document.createElement('style');
15
- fetch(url.href)
16
- .then((res) => res.text())
17
- .then((data) => {
18
- cssFile.innerHTML = data;
19
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
20
- })
21
- .catch((err) => {
22
- console.log('error ', err);
23
- });
24
- };
25
8
  this.userId = '';
26
9
  this.session = '';
27
10
  this.postsTitle = '';
@@ -32,12 +15,12 @@ export class GeneralPreviewSocialPosts {
32
15
  this.cmsEndpoint = '';
33
16
  this.userRoles = '';
34
17
  this.translationUrl = '';
18
+ this.mbSource = undefined;
35
19
  this.clientStyling = '';
36
20
  this.clientStylingUrl = '';
37
21
  this.cmsEnv = 'stage';
38
22
  this.pageName = 'casino';
39
23
  this.posts = [];
40
- this.stylingAppends = false;
41
24
  this.isLoading = false;
42
25
  this.isLoggedIn = false;
43
26
  this.dataImages = [];
@@ -49,6 +32,17 @@ export class GeneralPreviewSocialPosts {
49
32
  this.isLoading = false;
50
33
  });
51
34
  }
35
+ handleClientStylingChange(newValue, oldValue) {
36
+ if (newValue != oldValue) {
37
+ setClientStyling(this.stylingContainer, this.clientStyling);
38
+ }
39
+ }
40
+ handleClientStylingChangeURL(newValue, oldValue) {
41
+ if (newValue != oldValue) {
42
+ if (this.clientStylingUrl)
43
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
44
+ }
45
+ }
52
46
  async componentWillLoad() {
53
47
  if (this.translationUrl.length > 2) {
54
48
  await getTranslations(this.translationUrl);
@@ -64,17 +58,6 @@ export class GeneralPreviewSocialPosts {
64
58
  this.isLoggedIn = true;
65
59
  }
66
60
  }
67
- componentDidRender() {
68
- // start custom styling area
69
- if (!this.stylingAppends && this.stylingContainer) {
70
- if (this.clientStyling)
71
- this.setClientStyling();
72
- if (this.clientStylingUrl)
73
- this.setClientStylingURL();
74
- this.stylingAppends = true;
75
- }
76
- // end custom styling area
77
- }
78
61
  getDataImage(ids) {
79
62
  try {
80
63
  let url = new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);
@@ -118,6 +101,17 @@ export class GeneralPreviewSocialPosts {
118
101
  }
119
102
  }
120
103
  async componentDidLoad() {
104
+ if (this.stylingContainer) {
105
+ if (window.emMessageBus != undefined) {
106
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
107
+ }
108
+ else {
109
+ if (this.clientStyling)
110
+ setClientStyling(this.stylingContainer, this.clientStyling);
111
+ if (this.clientStylingUrl)
112
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
113
+ }
114
+ }
121
115
  try {
122
116
  let url = new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);
123
117
  url.searchParams.append("device", this.platform);
@@ -164,6 +158,9 @@ export class GeneralPreviewSocialPosts {
164
158
  console.error('Error fetching verification types:', error);
165
159
  }
166
160
  }
161
+ disconnectedCallback() {
162
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
163
+ }
167
164
  hasUndefinedValues(obj) {
168
165
  return Object.values(obj).some((value) => value === undefined);
169
166
  }
@@ -389,6 +386,23 @@ export class GeneralPreviewSocialPosts {
389
386
  "reflect": true,
390
387
  "defaultValue": "''"
391
388
  },
389
+ "mbSource": {
390
+ "type": "string",
391
+ "mutable": false,
392
+ "complexType": {
393
+ "original": "string",
394
+ "resolved": "string",
395
+ "references": {}
396
+ },
397
+ "required": false,
398
+ "optional": false,
399
+ "docs": {
400
+ "tags": [],
401
+ "text": "Client custom styling via streamStyling"
402
+ },
403
+ "attribute": "mb-source",
404
+ "reflect": false
405
+ },
392
406
  "clientStyling": {
393
407
  "type": "string",
394
408
  "mutable": false,
@@ -466,7 +480,6 @@ export class GeneralPreviewSocialPosts {
466
480
  static get states() {
467
481
  return {
468
482
  "posts": {},
469
- "stylingAppends": {},
470
483
  "isLoading": {},
471
484
  "isLoggedIn": {},
472
485
  "dataImages": {},
@@ -525,6 +538,12 @@ export class GeneralPreviewSocialPosts {
525
538
  return [{
526
539
  "propName": "translationUrl",
527
540
  "methodName": "handleNewTranslations"
541
+ }, {
542
+ "propName": "clientStyling",
543
+ "methodName": "handleClientStylingChange"
544
+ }, {
545
+ "propName": "clientStylingUrl",
546
+ "methodName": "handleClientStylingChangeURL"
528
547
  }, {
529
548
  "propName": "session",
530
549
  "methodName": "watchSession"
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-25628404.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-d101355b.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  let TRANSLATIONS = {
@@ -101,6 +101,63 @@ const getDevicePlatform = () => {
101
101
  }
102
102
  };
103
103
 
104
+ /**
105
+ * @name setClientStyling
106
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
107
+ * @param {HTMLElement} stylingContainer The reference element of the widget
108
+ * @param {string} clientStyling The style content
109
+ */
110
+ function setClientStyling(stylingContainer, clientStyling) {
111
+ if (stylingContainer) {
112
+ const sheet = document.createElement('style');
113
+ sheet.innerHTML = clientStyling;
114
+ stylingContainer.appendChild(sheet);
115
+ }
116
+ }
117
+
118
+ /**
119
+ * @name setClientStylingURL
120
+ * @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
121
+ * @param {HTMLElement} stylingContainer The reference element of the widget
122
+ * @param {string} clientStylingUrl The URL of the style content
123
+ */
124
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
125
+ const url = new URL(clientStylingUrl);
126
+
127
+ fetch(url.href)
128
+ .then((res) => res.text())
129
+ .then((data) => {
130
+ const cssFile = document.createElement('style');
131
+ cssFile.innerHTML = data;
132
+ if (stylingContainer) {
133
+ stylingContainer.appendChild(cssFile);
134
+ }
135
+ })
136
+ .catch((err) => {
137
+ console.error('There was an error while trying to load client styling from URL', err);
138
+ });
139
+ }
140
+
141
+ /**
142
+ * @name setStreamLibrary
143
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
144
+ * @param {HTMLElement} stylingContainer The highest element of the widget
145
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
146
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
147
+ */
148
+ function setStreamStyling(stylingContainer, domain, subscription) {
149
+ if (window.emMessageBus) {
150
+ const sheet = document.createElement('style');
151
+
152
+ window.emMessageBus.subscribe(domain, (data) => {
153
+ sheet.innerHTML = data;
154
+ if (stylingContainer) {
155
+ stylingContainer.appendChild(sheet);
156
+ }
157
+ });
158
+ }
159
+ }
160
+
104
161
  const generalPreviewSocialPostsCss = ":host {\n font-family: \"Roboto\", sans-serif;\n display: block;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.sliderWidget {\n display: block;\n max-width: 780px;\n margin: 0 auto;\n padding: 16px;\n max-height: 500px;\n}\n.sliderWidget h2 {\n font-size: 20px;\n}\n.sliderWidget .headerHontainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.sliderWidget .headerHontainer .viewAllButton {\n cursor: pointer;\n font-weight: bold;\n color: rgb(142, 142, 142);\n}\n.sliderWidget .postSlider {\n display: flex;\n overflow-x: auto;\n scroll-snap-type: x mandatory;\n gap: 24px;\n}\n.sliderWidget .postSlider .postCard {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-snap-align: start;\n padding: 20px;\n border-radius: 6px;\n min-width: 360px;\n background-color: rgb(244, 244, 244);\n}\n.sliderWidget .postSlider .postCard .Description {\n display: -webkit-box;\n -webkit-line-clamp: 5;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin-bottom: 14px;\n}\n.sliderWidget .postSlider .postCard .imageTitle {\n display: flex;\n justify-content: flex-start;\n gap: 20px;\n}\n.sliderWidget .postSlider .postCard .imageTitle img {\n height: 120px;\n width: 120px;\n border-radius: 6px;\n}\n.sliderWidget .postSlider .postCard .imageTitle .titleSubtitle {\n display: flex;\n flex-direction: column;\n}\n.sliderWidget .postSlider .postCard .buttons {\n display: flex;\n justify-content: center;\n gap: 12px;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton, .sliderWidget .postSlider .postCard .buttons .playNowButton {\n width: 172px;\n display: block;\n padding: 8px 16px;\n border: 3px solid #63B250;\n border-radius: 6px;\n cursor: pointer;\n font-weight: bold;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton {\n background-color: rgb(244, 244, 244);\n color: #63B250;\n}\n.sliderWidget .postSlider .postCard .buttons .playNowButton {\n background-color: #63B250;\n color: #fff;\n}\n\nh3, h4 {\n font-size: 18px;\n}\n\np {\n font-size: 14px;\n color: rgb(91, 91, 91);\n}\n\n@container (max-width: 480px) {\n .sliderWidget h2 {\n font-size: 18px;\n }\n .sliderWidget .postSlider .postCard {\n min-width: 250px;\n }\n h3, h4 {\n font-size: 16px;\n }\n p {\n font-size: 12px;\n }\n}";
105
162
  const GeneralPreviewSocialPostsStyle0 = generalPreviewSocialPostsCss;
106
163
 
@@ -111,24 +168,6 @@ const GeneralPreviewSocialPosts = class {
111
168
  this.playNow = createEvent(this, "playNow", 7);
112
169
  this.viewAll = createEvent(this, "viewAll", 7);
113
170
  this.platform = getDevicePlatform();
114
- this.setClientStyling = () => {
115
- let sheet = document.createElement('style');
116
- sheet.innerHTML = this.clientStyling;
117
- this.stylingContainer.prepend(sheet);
118
- };
119
- this.setClientStylingURL = () => {
120
- let url = new URL(this.clientStylingUrl);
121
- let cssFile = document.createElement('style');
122
- fetch(url.href)
123
- .then((res) => res.text())
124
- .then((data) => {
125
- cssFile.innerHTML = data;
126
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
127
- })
128
- .catch((err) => {
129
- console.log('error ', err);
130
- });
131
- };
132
171
  this.userId = '';
133
172
  this.session = '';
134
173
  this.postsTitle = '';
@@ -139,12 +178,12 @@ const GeneralPreviewSocialPosts = class {
139
178
  this.cmsEndpoint = '';
140
179
  this.userRoles = '';
141
180
  this.translationUrl = '';
181
+ this.mbSource = undefined;
142
182
  this.clientStyling = '';
143
183
  this.clientStylingUrl = '';
144
184
  this.cmsEnv = 'stage';
145
185
  this.pageName = 'casino';
146
186
  this.posts = [];
147
- this.stylingAppends = false;
148
187
  this.isLoading = false;
149
188
  this.isLoggedIn = false;
150
189
  this.dataImages = [];
@@ -156,6 +195,17 @@ const GeneralPreviewSocialPosts = class {
156
195
  this.isLoading = false;
157
196
  });
158
197
  }
198
+ handleClientStylingChange(newValue, oldValue) {
199
+ if (newValue != oldValue) {
200
+ setClientStyling(this.stylingContainer, this.clientStyling);
201
+ }
202
+ }
203
+ handleClientStylingChangeURL(newValue, oldValue) {
204
+ if (newValue != oldValue) {
205
+ if (this.clientStylingUrl)
206
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
207
+ }
208
+ }
159
209
  async componentWillLoad() {
160
210
  if (this.translationUrl.length > 2) {
161
211
  await getTranslations(this.translationUrl);
@@ -171,17 +221,6 @@ const GeneralPreviewSocialPosts = class {
171
221
  this.isLoggedIn = true;
172
222
  }
173
223
  }
174
- componentDidRender() {
175
- // start custom styling area
176
- if (!this.stylingAppends && this.stylingContainer) {
177
- if (this.clientStyling)
178
- this.setClientStyling();
179
- if (this.clientStylingUrl)
180
- this.setClientStylingURL();
181
- this.stylingAppends = true;
182
- }
183
- // end custom styling area
184
- }
185
224
  getDataImage(ids) {
186
225
  try {
187
226
  let url = new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);
@@ -225,6 +264,17 @@ const GeneralPreviewSocialPosts = class {
225
264
  }
226
265
  }
227
266
  async componentDidLoad() {
267
+ if (this.stylingContainer) {
268
+ if (window.emMessageBus != undefined) {
269
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
270
+ }
271
+ else {
272
+ if (this.clientStyling)
273
+ setClientStyling(this.stylingContainer, this.clientStyling);
274
+ if (this.clientStylingUrl)
275
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
276
+ }
277
+ }
228
278
  try {
229
279
  let url = new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);
230
280
  url.searchParams.append("device", this.platform);
@@ -271,6 +321,9 @@ const GeneralPreviewSocialPosts = class {
271
321
  console.error('Error fetching verification types:', error);
272
322
  }
273
323
  }
324
+ disconnectedCallback() {
325
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
326
+ }
274
327
  hasUndefinedValues(obj) {
275
328
  return Object.values(obj).some((value) => value === undefined);
276
329
  }
@@ -304,6 +357,8 @@ const GeneralPreviewSocialPosts = class {
304
357
  }
305
358
  static get watchers() { return {
306
359
  "translationUrl": ["handleNewTranslations"],
360
+ "clientStyling": ["handleClientStylingChange"],
361
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
307
362
  "session": ["watchSession"]
308
363
  }; }
309
364
  };
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-25628404.js';
2
- export { s as setNonce } from './index-25628404.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-d101355b.js';
2
+ export { s as setNonce } from './index-d101355b.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([["general-preview-social-posts",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"stylingAppends":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"session":["watchSession"]}]]]], options);
19
+ return bootstrapLazy([["general-preview-social-posts",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"session":["watchSession"]}]]]], options);
20
20
  });
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'general-preview-social-posts';
2
- const BUILD = /* general-preview-social-posts */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* general-preview-social-posts */ { 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: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, 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) => {
@@ -327,31 +327,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
327
327
  if (nonce != null) {
328
328
  styleElm.setAttribute("nonce", nonce);
329
329
  }
330
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
331
- if (styleContainerNode.nodeName === "HEAD") {
332
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
333
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
334
- styleContainerNode.insertBefore(styleElm, referenceNode2);
335
- } else if ("host" in styleContainerNode) {
336
- if (supportsConstructableStylesheets) {
337
- const stylesheet = new CSSStyleSheet();
338
- stylesheet.replaceSync(style);
339
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
340
- } else {
341
- const existingStyleContainer = styleContainerNode.querySelector("style");
342
- if (existingStyleContainer) {
343
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
344
- } else {
345
- styleContainerNode.prepend(styleElm);
346
- }
347
- }
348
- } else {
349
- styleContainerNode.append(styleElm);
350
- }
351
- }
352
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
353
- styleContainerNode.insertBefore(styleElm, null);
354
- }
330
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
355
331
  }
356
332
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
357
333
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -374,7 +350,7 @@ var attachStyles = (hostRef) => {
374
350
  const scopeId2 = addStyle(
375
351
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
376
352
  cmpMeta);
377
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
353
+ if (flags & 10 /* needsScopedEncapsulation */) {
378
354
  elm["s-sc"] = scopeId2;
379
355
  elm.classList.add(scopeId2 + "-h");
380
356
  }
@@ -422,11 +398,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
422
398
  if (memberName === "list") {
423
399
  isProp = false;
424
400
  } else if (oldValue == null || elm[memberName] != n) {
425
- if (typeof elm.__lookupSetter__(memberName) === "function") {
426
- elm[memberName] = n;
427
- } else {
428
- elm.setAttribute(memberName, n);
429
- }
401
+ elm[memberName] = n;
430
402
  }
431
403
  } else {
432
404
  elm[memberName] = newValue;
@@ -499,9 +471,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
499
471
  {
500
472
  updateElement(null, newVNode2, isSvgMode);
501
473
  }
502
- const rootNode = elm.getRootNode();
503
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
504
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
474
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
505
475
  elm.classList.add(elm["s-si"] = scopeId);
506
476
  }
507
477
  if (newVNode2.$children$) {
@@ -630,10 +600,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
630
600
  elm.textContent = "";
631
601
  }
632
602
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
633
- } else if (
634
- // don't do this on initial render as it can cause non-hydrated content to be removed
635
- !isInitialRender && BUILD.updatable && oldChildren !== null
636
- ) {
603
+ } else if (oldChildren !== null) {
637
604
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
638
605
  }
639
606
  } else if (oldVNode.$text$ !== text) {
@@ -778,9 +745,6 @@ var postUpdateComponent = (hostRef) => {
778
745
  const endPostUpdate = createTime("postUpdate", tagName);
779
746
  const instance = hostRef.$lazyInstance$ ;
780
747
  const ancestorComponent = hostRef.$ancestorComponent$;
781
- {
782
- safeCall(instance, "componentDidRender");
783
- }
784
748
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
785
749
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
786
750
  {
@@ -901,8 +865,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
901
865
  if (this.hasOwnProperty(propName)) {
902
866
  newValue = this[propName];
903
867
  delete this[propName];
904
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
905
- this[propName] == newValue) {
868
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
906
869
  return;
907
870
  } else if (propName == null) {
908
871
  const hostRef = getHostRef(this);
@@ -1054,12 +1017,17 @@ var connectedCallback = (elm) => {
1054
1017
  }
1055
1018
  };
1056
1019
  var disconnectInstance = (instance) => {
1020
+ {
1021
+ safeCall(instance, "disconnectedCallback");
1022
+ }
1057
1023
  };
1058
1024
  var disconnectedCallback = async (elm) => {
1059
1025
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1060
1026
  const hostRef = getHostRef(elm);
1061
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1062
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1027
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1028
+ disconnectInstance(hostRef.$lazyInstance$);
1029
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1030
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1063
1031
  }
1064
1032
  }
1065
1033
  };
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-25628404.js';
2
- export { s as setNonce } from './index-25628404.js';
1
+ import { b as bootstrapLazy } from './index-d101355b.js';
2
+ export { s as setNonce } from './index-d101355b.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([["general-preview-social-posts",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"stylingAppends":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"session":["watchSession"]}]]]], options);
8
+ return bootstrapLazy([["general-preview-social-posts",[[1,"general-preview-social-posts",{"userId":[513,"user-id"],"session":[513],"postsTitle":[513,"posts-title"],"maxCards":[513,"max-cards"],"language":[513],"datasource":[513],"endpoint":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"translationUrl":[513,"translation-url"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"cmsEnv":[513,"cms-env"],"pageName":[513,"page-name"],"posts":[32],"isLoading":[32],"isLoggedIn":[32],"dataImages":[32],"gameIds":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"session":["watchSession"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -1 +1 @@
1
- import{p as e,b as n}from"./p-ffbcefe1.js";export{s as setNonce}from"./p-ffbcefe1.js";import{g as t}from"./p-e1255160.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),e(n)})().then((async s=>(await t(),n([["p-2d1b20fd",[[1,"general-preview-social-posts",{userId:[513,"user-id"],session:[513],postsTitle:[513,"posts-title"],maxCards:[513,"max-cards"],language:[513],datasource:[513],endpoint:[513],cmsEndpoint:[513,"cms-endpoint"],userRoles:[513,"user-roles"],translationUrl:[513,"translation-url"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],cmsEnv:[513,"cms-env"],pageName:[513,"page-name"],posts:[32],stylingAppends:[32],isLoading:[32],isLoggedIn:[32],dataImages:[32],gameIds:[32]},null,{translationUrl:["handleNewTranslations"],session:["watchSession"]}]]]],s))));
1
+ import{p as e,b as n}from"./p-fe0126be.js";export{s as setNonce}from"./p-fe0126be.js";import{g as t}from"./p-e1255160.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),e(n)})().then((async e=>(await t(),n([["p-636881b7",[[1,"general-preview-social-posts",{userId:[513,"user-id"],session:[513],postsTitle:[513,"posts-title"],maxCards:[513,"max-cards"],language:[513],datasource:[513],endpoint:[513],cmsEndpoint:[513,"cms-endpoint"],userRoles:[513,"user-roles"],translationUrl:[513,"translation-url"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],cmsEnv:[513,"cms-env"],pageName:[513,"page-name"],posts:[32],isLoading:[32],isLoggedIn:[32],dataImages:[32],gameIds:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],session:["watchSession"]}]]]],e))));
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as n}from"./p-fe0126be.js";let e={en:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},de:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},ro:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},fr:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},ar:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},hr:{loading:"Učitavanje…",viewAll:"Pogledaj sve …",moreInfo:"VIŠE INFORMACIJA",playNow:"IGRAJ SADA"}};const o=i=>new Promise((t=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((t=>{e[t]||(e[t]={});for(let n in i[t])e[t][n]=i[t][n]})),t(!0)}))})),s=(i,t)=>e[void 0!==t&&t in e?t:"en"][i];function l(i,t){if(i){const n=document.createElement("style");n.innerHTML=t,i.appendChild(n)}}function a(i,t){const n=new URL(t);fetch(n.href).then((i=>i.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,i&&i.appendChild(n)})).catch((i=>{console.error("There was an error while trying to load client styling from URL",i)}))}const r=class{constructor(n){i(this,n),this.moreInfo=t(this,"moreInfo",7),this.playNow=t(this,"playNow",7),this.viewAll=t(this,"viewAll",7),this.platform=(()=>{const i=(()=>{let i=window.navigator.userAgent;return i.toLowerCase().match(/android/i)?"Android":i.toLocaleLowerCase().match(/customnative:ios/)?"nativeIOS":i.toLowerCase().match(/iphone/i)?"iPhone":i.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(i)return"PC"===i?"dk":"nativeIOS"==i?"ios":"mtWeb"})(),this.userId="",this.session="",this.postsTitle="",this.maxCards="",this.language="en",this.datasource="",this.endpoint="",this.cmsEndpoint="",this.userRoles="",this.translationUrl="",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.cmsEnv="stage",this.pageName="casino",this.posts=[],this.isLoading=!1,this.isLoggedIn=!1,this.dataImages=[],this.gameIds=""}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}handleClientStylingChange(i,t){i!=t&&l(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(i,t){i!=t&&this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl)}watchSession(i,t){i!==t&&(this.isLoggedIn=""!==i)}connectedCallback(){this.session&&(this.isLoggedIn=!0)}getDataImage(i){try{let t=new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);t.searchParams.append("language",this.language),t.searchParams.append("expand","games"),t.searchParams.append("fields","games(id,thumbnail,launchUrl)"),t.searchParams.append("filter",i),t.searchParams.append("device",this.platform),fetch(t.href,{method:"GET","Content-Type":"application/json"}).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{i.items.forEach((i=>{i.games.items.forEach((i=>{let{id:t,launchUrl:n,thumbnail:e}=i;this.dataImages=[{id:t,launchUrl:n,thumbnail:e}];let o=this.posts.findIndex((i=>i.gameId===t));-1!==o&&(this.posts[o].images=this.dataImages)}))}))})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}async componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(i,t){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{n.innerHTML=t,i&&i.appendChild(n)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&l(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl)));try{let i=new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);i.searchParams.append("device",this.platform),i.searchParams.append("page",this.pageName),i.searchParams.append("language",this.language),i.searchParams.append("userRoles",this.userRoles),i.searchParams.append("env",this.cmsEnv),fetch(i.href,{method:"GET","Content-Type":"application/json"}).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{i.forEach((i=>{var t;const n=i.slug,e=i.id,{gameId:o,title:s,description:l,subtitle:a}=null!==(t=i.previewCard)&&void 0!==t?t:{};o&&(this.gameIds+=`games(id=${o}),`),this.posts.push({postId:e,gameId:o,title:s,description:l,subtitle:a,slug:n})})),this.gameIds.length>0&&(this.gameIds=this.gameIds.slice(0,-1),this.gameIds="$or("+this.gameIds+")"),this.getDataImage(this.gameIds)})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}hasUndefinedValues(i){return Object.values(i).some((i=>void 0===i))}render(){return this.isLoading?n("div",null,n("p",null,s("loading",this.language))):n("div",{class:"ModalContainer",ref:i=>this.stylingContainer=i},n("div",{class:"sliderWidget"},n("div",{class:"headerHontainer"},this.postsTitle&&n("h2",null,this.postsTitle),n("div",{class:"viewAllButton",onClick:()=>this.onViewAllClick()},s("viewAll",this.language))),n("div",{class:"postSlider"},this.posts.filter((i=>!this.hasUndefinedValues(i))).slice(0,+(this.maxCards||this.posts.length)).map((i=>{var t,e,o,l;return n("div",{class:"postCard"},n("div",{class:"imageTitle"},(null==i?void 0:i.images)?n("a",{href:(null===(e=null===(t=i.images)||void 0===t?void 0:t[0])||void 0===e?void 0:e.launchUrl)||"",target:"_blank",rel:"noopener noreferrer"},n("img",{src:(null===(l=null===(o=i.images)||void 0===o?void 0:o[0])||void 0===l?void 0:l.thumbnail)||"",alt:"Game Image"})):null,n("div",{class:"titleSubtitle"},i.title&&n("h3",null,i.title),i.subtitle&&n("p",{innerHTML:i.subtitle}))),i.description&&n("div",{class:"Description"},n("p",{innerHTML:i.description})),n("div",{class:"buttons"},n("button",{class:"moreInfoButton",onClick:()=>this.onMoreInfoClick(i.gameId,i.postId,i.title,i.slug)},s("moreInfo",this.language)),this.isLoggedIn&&i.gameId&&n("button",{class:"playNowButton",onClick:()=>this.onPlayNowClick(i.gameId)},s("playNow",this.language))))})))))}onViewAllClick(){this.viewAll.emit(),window.postMessage({type:"viewAllSocialPosts"},window.location.href)}onMoreInfoClick(i,t,n,e){this.moreInfo.emit(),window.postMessage({type:"moreInfoSocialPost",gameId:i,postId:t,postTitle:n,slug:e},window.location.href)}onPlayNowClick(i){this.playNow.emit(i),window.postMessage({type:"playNowSocialPost",gameId:i},window.location.href)}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],session:["watchSession"]}}};r.style=':host {\n font-family: "Roboto", sans-serif;\n display: block;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.sliderWidget {\n display: block;\n max-width: 780px;\n margin: 0 auto;\n padding: 16px;\n max-height: 500px;\n}\n.sliderWidget h2 {\n font-size: 20px;\n}\n.sliderWidget .headerHontainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.sliderWidget .headerHontainer .viewAllButton {\n cursor: pointer;\n font-weight: bold;\n color: rgb(142, 142, 142);\n}\n.sliderWidget .postSlider {\n display: flex;\n overflow-x: auto;\n scroll-snap-type: x mandatory;\n gap: 24px;\n}\n.sliderWidget .postSlider .postCard {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-snap-align: start;\n padding: 20px;\n border-radius: 6px;\n min-width: 360px;\n background-color: rgb(244, 244, 244);\n}\n.sliderWidget .postSlider .postCard .Description {\n display: -webkit-box;\n -webkit-line-clamp: 5;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin-bottom: 14px;\n}\n.sliderWidget .postSlider .postCard .imageTitle {\n display: flex;\n justify-content: flex-start;\n gap: 20px;\n}\n.sliderWidget .postSlider .postCard .imageTitle img {\n height: 120px;\n width: 120px;\n border-radius: 6px;\n}\n.sliderWidget .postSlider .postCard .imageTitle .titleSubtitle {\n display: flex;\n flex-direction: column;\n}\n.sliderWidget .postSlider .postCard .buttons {\n display: flex;\n justify-content: center;\n gap: 12px;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton, .sliderWidget .postSlider .postCard .buttons .playNowButton {\n width: 172px;\n display: block;\n padding: 8px 16px;\n border: 3px solid #63B250;\n border-radius: 6px;\n cursor: pointer;\n font-weight: bold;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton {\n background-color: rgb(244, 244, 244);\n color: #63B250;\n}\n.sliderWidget .postSlider .postCard .buttons .playNowButton {\n background-color: #63B250;\n color: #fff;\n}\n\nh3, h4 {\n font-size: 18px;\n}\n\np {\n font-size: 14px;\n color: rgb(91, 91, 91);\n}\n\n@container (max-width: 480px) {\n .sliderWidget h2 {\n font-size: 18px;\n }\n .sliderWidget .postSlider .postCard {\n min-width: 250px;\n }\n h3, h4 {\n font-size: 16px;\n }\n p {\n font-size: 12px;\n }\n}';export{r as general_preview_social_posts}
@@ -0,0 +1,2 @@
1
+ var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),l=(t,n)=>e.set(n.t=t,n),o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),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:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),d=!1,m=[],y=[],$=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.l?v(w):f.raf(w))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},w=()=>{b(m),b(y),(d=m.length>0)&&f.raf(w)},v=t=>h().then(t),g=$(y,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function k(t){var e,n,l;return null!=(l=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((e,n)=>{for(var l in n)t(e,l,{get:n[l],enumerable:!0})})({},{err:()=>C,map:()=>E,ok:()=>O,unwrap:()=>P,unwrapErr:()=>L});var O=t=>({isOk:!0,isErr:!1,value:t}),C=t=>({isOk:!1,isErr:!0,value:t});function E(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>O(t))):O(n)}if(t.isErr)return C(t.value);throw"should never get here"}var M,x,P=t=>{if(t.isOk)return t.value;throw t.value},L=t=>{if(t.isErr)return t.value;throw t.value},R=(t,e,...n)=>{let l=null,o=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!j(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?T(null,l):l),s=o)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const c=T(t,null);return c.u=e,r.length>0&&(c.h=r),c},T=(t,e)=>({l:0,p:t,i:e,m:null,h:null,u:null}),A={},N=(t,e,l)=>{const o=(t=>n(t).$hostElement$)(t);return{emit:t=>U(o,e,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:t})}},U=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},W=new WeakMap,D=t=>"sc-"+t.$,F=(t,e,n,l,s,r)=>{if(n!==l){let i=o(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,o=q(n),s=q(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("ref"===e)l&&l(t);else if(i||"o"!==e[0]||"n"!==e[1]){const o=j(l);if((i||o&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]=l;else{const o=null==l?"":l;"list"===e?i=!1:null!=n&&t[e]==o||(t[e]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&r||s)&&!o&&t.setAttribute(e,l=!0===l?"":l)}else if(e="-"===e[2]?e.slice(3):o(u,c)?c.slice(2):c[2]+e.slice(3),n||l){const o=e.endsWith(G);e=e.replace(V,""),n&&f.rel(t,e,n,o),l&&f.ael(t,e,l,o)}}},H=/\s/,q=t=>t?t.split(H):[],G="Capture",V=RegExp(G+"$"),_=(t,e,n)=>{const l=11===e.m.nodeType&&e.m.host?e.m.host:e.m,o=t&&t.u||S,s=e.u||S;for(const t of z(Object.keys(o)))t in s||F(l,t,o[t],void 0,n,e.l);for(const t of z(Object.keys(s)))F(l,t,o[t],s[t],n,e.l)};function z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var B=!1,I=(t,e,n)=>{const l=e.h[n];let o,s,r=0;if(null!==l.i)o=l.m=a.createTextNode(l.i);else if(o=l.m=a.createElement(l.p),_(null,l,B),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=I(t,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},J=(t,e,n,l,o,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].m=r,Z(i,r,e)))},K=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.m;Y(e),t&&t.remove()}}},Q=(t,e)=>t.p===e.p,X=(t,e,n=!1)=>{const l=e.m=t.m,o=t.h,s=e.h,r=e.i;null===r?(_(t,e,B),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=l.length-1,h=l[0],p=l[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=l[++i]:null==p?p=l[--f]:Q(u,h)?(X(u,h,o),u=e[++r],h=l[++i]):Q(a,p)?(X(a,p,o),a=e[--c],p=l[--f]):Q(u,p)?(X(u,p,o),Z(t,u.m,a.m.nextSibling),u=e[++r],p=l[--f]):Q(a,h)?(X(a,h,o),Z(t,a.m,u.m),a=e[--c],h=l[++i]):(s=I(e&&e[i],n,i),h=l[++i],s&&Z(u.m.parentNode,s,u.m));r>c?J(t,null==l[f+1]?null:l[f+1].m,n,l,i,f):i>f&&K(e,r,c)})(l,o,e,s,n):null!==s?(null!==t.i&&(l.textContent=""),J(l,null,e,s,0,s.length-1)):null!==o&&K(o,0,o.length-1)):t.i!==r&&(l.data=r)},Y=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(Y)},Z=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),tt=(t,e)=>{e&&!t.v&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.v=e)))},et=(t,e)=>{if(t.l|=16,!(4&t.l))return tt(t,t.S),g((()=>nt(t,e)));t.l|=512},nt=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$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 e&&(l=ut(n,"componentWillLoad")),lt(l,(()=>st(t,n,e)))},lt=(t,e)=>ot(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),ot=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,st=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.j,n=t.$hostElement$,l=e.l,o=((t,e)=>{var n;const l=D(e),o=i.get(l);if(t=11===t.nodeType?t:a,o)if("string"==typeof o){let s,r=W.get(t=t.head||t);if(r||W.set(t,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const e=null!=(n=f.k)?n:k(a);null!=e&&s.setAttribute("nonce",e),t.insertBefore(s,t.querySelector("link"))}4&e.l&&(s.innerHTML+=c),r&&r.add(l)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);rt(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>it(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},rt=(t,e,n,l)=>{try{e=e.render(),t.l&=-17,t.l|=2,((t,e,n=!1)=>{const l=t.$hostElement$,o=t.j,s=t.O||T(null,null),r=(t=>t&&t.p===A)(e)?e:R(null,null,e);if(x=l.tagName,o.C&&(r.u=r.u||{},o.C.map((([t,e])=>r.u[e]=l[t]))),n&&r.u)for(const t of Object.keys(r.u))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=l[t]);r.p=null,r.l|=4,t.O=r,r.m=s.m=l.shadowRoot||l,M=l["s-sc"],X(s,r,n)})(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},it=t=>{const e=t.$hostElement$,n=t.t,l=t.S;64&t.l||(t.l|=64,at(e),ut(n,"componentDidLoad"),t.M(e),l||ct()),t.v&&(t.v(),t.v=void 0),512&t.l&&v((()=>et(t,!1))),t.l&=-517},ct=()=>{at(a.documentElement),v((()=>U(u,"appload",{detail:{namespace:"general-preview-social-posts"}})))},ut=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t)}},at=t=>t.classList.add("hydrated"),ft=(t,e,l)=>{var o,r;const i=t.prototype;if(e.P||e.L||t.watchers){t.watchers&&!e.L&&(e.L=t.watchers);const c=Object.entries(null!=(o=e.P)?o:{});if(c.map((([t,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).R.get(e))(0,t)},set(l){((t,e,l,o)=>{const r=n(t);if(!r)throw Error(`Couldn't find host element for "${o.$}" 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(e),u=r.l,a=r.t;if(l=((t,e)=>null==t||j(t)?t:1&e?t+"":t)(l,o.P[e][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.R.set(e,l),a)){if(o.L&&128&u){const t=o.L[e];t&&t.map((t=>{try{a[t](l,c,e)}catch(t){s(t,i)}}))}2==(18&u)&&et(r,!1)}})(this,t,l,e)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(t,o,s){f.jmp((()=>{var r;const c=l.get(t);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=e.L)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,o,t)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.L)?r:{}),...c.filter((([t,e])=>15&e[0])).map((([t,n])=>{var o;const s=n[1]||t;return l.set(s,t),512&n[0]&&(null==(o=e.C)||o.push([t,s])),s}))]))}}return t},ht=t=>{ut(t,"connectedCallback")},pt=t=>{ut(t,"disconnectedCallback")},dt=(t,l={})=>{var o;const h=[],d=l.exclude||[],m=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((l=>{var o;const c={l:l[0],$:l[1],P:l[2],T:l[3]};4&c.l&&(S=!0),c.P=l[2],c.C=[],c.L=null!=(o=l[4])?o:{};const u=c.$,a=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const l={l:0,$hostElement$:t,j:n,R:new Map};l.A=new Promise((t=>l.M=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,l)})(t=this,c),1&c.l)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.$}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(t=>{if(!(1&f.l)){const e=n(t),l=e.j,o=()=>{};if(1&e.l)(null==e?void 0:e.t)?ht(e.t):(null==e?void 0:e.A)&&e.A.then((()=>ht(e.t)));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){tt(e,e.S=n);break}}l.P&&Object.entries(l.P).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;if(!(32&e.l)){if(e.l|=32,n.N){const t=(t=>{const e=t.$.replace(/-/g,"_"),n=t.N;if(!n)return;const l=r.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(r.set(n,t),t[e])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};l=await t,e()}else l=t;if(!l)throw Error(`Constructor for "${n.$}#${e.U}" was not found`);l.isProxied||(n.L=l.watchers,ft(l,n,2),l.isProxied=!0);const o=()=>{};e.l|=8;try{new l(e)}catch(t){s(t)}e.l&=-9,e.l|=128,o(),ht(e.t)}else l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128));if(l&&l.style){let t;"string"==typeof l.style&&(t=l.style);const e=D(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);p&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.l)),l()}}}const o=e.S,c=()=>et(e,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(t,e,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const t=n(this);(null==t?void 0:t.t)?pt(t.t):(null==t?void 0:t.A)&&t.A.then((()=>pt(t.t)))}})()))}componentOnReady(){return n(this).A}};c.N=t[0],d.includes(u)||m.get(u)||(h.push(u),m.define(u,ft(a,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const t=null!=(o=f.k)?o:k(a);null!=t&&b.setAttribute("nonce",t),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((t=>t.connectedCallback())):f.jmp((()=>v=setTimeout(ct,30)))},mt=t=>f.k=t;export{dt as b,N as c,R as h,h as p,l as r,mt as s}
@@ -41,8 +41,12 @@ export declare class GeneralPreviewSocialPosts {
41
41
  */
42
42
  translationUrl: string;
43
43
  /**
44
- * Client custom styling via string
45
- */
44
+ * Client custom styling via streamStyling
45
+ */
46
+ mbSource: string;
47
+ /**
48
+ * Client custom styling via string
49
+ */
46
50
  clientStyling: string;
47
51
  /**
48
52
  * Client custom styling via url content
@@ -57,25 +61,25 @@ export declare class GeneralPreviewSocialPosts {
57
61
  */
58
62
  pageName: string;
59
63
  posts: Array<any>;
60
- private stylingAppends;
61
64
  private isLoading;
62
65
  private isLoggedIn;
63
66
  dataImages: Array<any>;
64
67
  gameIds: string;
65
68
  private platform;
66
69
  private stylingContainer;
70
+ private stylingSubscription;
67
71
  moreInfo: EventEmitter;
68
72
  playNow: EventEmitter;
69
73
  viewAll: EventEmitter;
70
74
  handleNewTranslations(): void;
75
+ handleClientStylingChange(newValue: any, oldValue: any): void;
76
+ handleClientStylingChangeURL(newValue: any, oldValue: any): void;
71
77
  componentWillLoad(): Promise<void>;
72
78
  watchSession(newValue: string, oldValue: string): void;
73
79
  connectedCallback(): void;
74
- componentDidRender(): void;
75
- setClientStyling: () => void;
76
- setClientStylingURL: () => void;
77
80
  getDataImage(ids: string): void;
78
81
  componentDidLoad(): Promise<void>;
82
+ disconnectedCallback(): void;
79
83
  hasUndefinedValues(obj: object): boolean;
80
84
  render(): any;
81
85
  onViewAllClick(): void;
@@ -39,6 +39,10 @@ export namespace Components {
39
39
  * The max cards displayed
40
40
  */
41
41
  "maxCards": string;
42
+ /**
43
+ * Client custom styling via streamStyling
44
+ */
45
+ "mbSource": string;
42
46
  /**
43
47
  * The page parameter for the cms call
44
48
  */
@@ -127,6 +131,10 @@ declare namespace LocalJSX {
127
131
  * The max cards displayed
128
132
  */
129
133
  "maxCards"?: string;
134
+ /**
135
+ * Client custom styling via streamStyling
136
+ */
137
+ "mbSource"?: string;
130
138
  "onMoreInfo"?: (event: GeneralPreviewSocialPostsCustomEvent<any>) => void;
131
139
  "onPlayNow"?: (event: GeneralPreviewSocialPostsCustomEvent<any>) => void;
132
140
  "onViewAll"?: (event: GeneralPreviewSocialPostsCustomEvent<any>) => void;
@@ -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/general-preview-social-posts",
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 i,c as t,h as n}from"./p-ffbcefe1.js";let e={en:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},de:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},ro:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},fr:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},ar:{loading:"loading...",viewAll:"View All ...",moreInfo:"MORE INFO",playNow:"PLAY NOW"},hr:{loading:"Učitavanje…",viewAll:"Pogledaj sve …",moreInfo:"VIŠE INFORMACIJA",playNow:"IGRAJ SADA"}};const s=i=>new Promise((t=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((t=>{e[t]||(e[t]={});for(let n in i[t])e[t][n]=i[t][n]})),t(!0)}))})),o=(i,t)=>e[void 0!==t&&t in e?t:"en"][i],l=class{constructor(n){i(this,n),this.moreInfo=t(this,"moreInfo",7),this.playNow=t(this,"playNow",7),this.viewAll=t(this,"viewAll",7),this.platform=(()=>{const i=(()=>{let i=window.navigator.userAgent;return i.toLowerCase().match(/android/i)?"Android":i.toLocaleLowerCase().match(/customnative:ios/)?"nativeIOS":i.toLowerCase().match(/iphone/i)?"iPhone":i.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(i)return"PC"===i?"dk":"nativeIOS"==i?"ios":"mtWeb"})(),this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{t.innerHTML=i,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((i=>{console.log("error ",i)}))},this.userId="",this.session="",this.postsTitle="",this.maxCards="",this.language="en",this.datasource="",this.endpoint="",this.cmsEndpoint="",this.userRoles="",this.translationUrl="",this.clientStyling="",this.clientStylingUrl="",this.cmsEnv="stage",this.pageName="casino",this.posts=[],this.stylingAppends=!1,this.isLoading=!1,this.isLoggedIn=!1,this.dataImages=[],this.gameIds=""}handleNewTranslations(){this.isLoading=!0,s(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}watchSession(i,t){i!==t&&(this.isLoggedIn=""!==i)}connectedCallback(){this.session&&(this.isLoggedIn=!0)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}getDataImage(i){try{let t=new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);t.searchParams.append("language",this.language),t.searchParams.append("expand","games"),t.searchParams.append("fields","games(id,thumbnail,launchUrl)"),t.searchParams.append("filter",i),t.searchParams.append("device",this.platform),fetch(t.href,{method:"GET","Content-Type":"application/json"}).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{i.items.forEach((i=>{i.games.items.forEach((i=>{let{id:t,launchUrl:n,thumbnail:e}=i;this.dataImages=[{id:t,launchUrl:n,thumbnail:e}];let s=this.posts.findIndex((i=>i.gameId===t));-1!==s&&(this.posts[s].images=this.dataImages)}))}))})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}async componentDidLoad(){try{let i=new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);i.searchParams.append("device",this.platform),i.searchParams.append("page",this.pageName),i.searchParams.append("language",this.language),i.searchParams.append("userRoles",this.userRoles),i.searchParams.append("env",this.cmsEnv),fetch(i.href,{method:"GET","Content-Type":"application/json"}).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{i.forEach((i=>{var t;const n=i.slug,e=i.id,{gameId:s,title:o,description:l,subtitle:r}=null!==(t=i.previewCard)&&void 0!==t?t:{};s&&(this.gameIds+=`games(id=${s}),`),this.posts.push({postId:e,gameId:s,title:o,description:l,subtitle:r,slug:n})})),this.gameIds.length>0&&(this.gameIds=this.gameIds.slice(0,-1),this.gameIds="$or("+this.gameIds+")"),this.getDataImage(this.gameIds)})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}hasUndefinedValues(i){return Object.values(i).some((i=>void 0===i))}render(){return this.isLoading?n("div",null,n("p",null,o("loading",this.language))):n("div",{class:"ModalContainer",ref:i=>this.stylingContainer=i},n("div",{class:"sliderWidget"},n("div",{class:"headerHontainer"},this.postsTitle&&n("h2",null,this.postsTitle),n("div",{class:"viewAllButton",onClick:()=>this.onViewAllClick()},o("viewAll",this.language))),n("div",{class:"postSlider"},this.posts.filter((i=>!this.hasUndefinedValues(i))).slice(0,+(this.maxCards||this.posts.length)).map((i=>{var t,e,s,l;return n("div",{class:"postCard"},n("div",{class:"imageTitle"},(null==i?void 0:i.images)?n("a",{href:(null===(e=null===(t=i.images)||void 0===t?void 0:t[0])||void 0===e?void 0:e.launchUrl)||"",target:"_blank",rel:"noopener noreferrer"},n("img",{src:(null===(l=null===(s=i.images)||void 0===s?void 0:s[0])||void 0===l?void 0:l.thumbnail)||"",alt:"Game Image"})):null,n("div",{class:"titleSubtitle"},i.title&&n("h3",null,i.title),i.subtitle&&n("p",{innerHTML:i.subtitle}))),i.description&&n("div",{class:"Description"},n("p",{innerHTML:i.description})),n("div",{class:"buttons"},n("button",{class:"moreInfoButton",onClick:()=>this.onMoreInfoClick(i.gameId,i.postId,i.title,i.slug)},o("moreInfo",this.language)),this.isLoggedIn&&i.gameId&&n("button",{class:"playNowButton",onClick:()=>this.onPlayNowClick(i.gameId)},o("playNow",this.language))))})))))}onViewAllClick(){this.viewAll.emit(),window.postMessage({type:"viewAllSocialPosts"},window.location.href)}onMoreInfoClick(i,t,n,e){this.moreInfo.emit(),window.postMessage({type:"moreInfoSocialPost",gameId:i,postId:t,postTitle:n,slug:e},window.location.href)}onPlayNowClick(i){this.playNow.emit(i),window.postMessage({type:"playNowSocialPost",gameId:i},window.location.href)}static get watchers(){return{translationUrl:["handleNewTranslations"],session:["watchSession"]}}};l.style=':host {\n font-family: "Roboto", sans-serif;\n display: block;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.sliderWidget {\n display: block;\n max-width: 780px;\n margin: 0 auto;\n padding: 16px;\n max-height: 500px;\n}\n.sliderWidget h2 {\n font-size: 20px;\n}\n.sliderWidget .headerHontainer {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.sliderWidget .headerHontainer .viewAllButton {\n cursor: pointer;\n font-weight: bold;\n color: rgb(142, 142, 142);\n}\n.sliderWidget .postSlider {\n display: flex;\n overflow-x: auto;\n scroll-snap-type: x mandatory;\n gap: 24px;\n}\n.sliderWidget .postSlider .postCard {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-snap-align: start;\n padding: 20px;\n border-radius: 6px;\n min-width: 360px;\n background-color: rgb(244, 244, 244);\n}\n.sliderWidget .postSlider .postCard .Description {\n display: -webkit-box;\n -webkit-line-clamp: 5;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin-bottom: 14px;\n}\n.sliderWidget .postSlider .postCard .imageTitle {\n display: flex;\n justify-content: flex-start;\n gap: 20px;\n}\n.sliderWidget .postSlider .postCard .imageTitle img {\n height: 120px;\n width: 120px;\n border-radius: 6px;\n}\n.sliderWidget .postSlider .postCard .imageTitle .titleSubtitle {\n display: flex;\n flex-direction: column;\n}\n.sliderWidget .postSlider .postCard .buttons {\n display: flex;\n justify-content: center;\n gap: 12px;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton, .sliderWidget .postSlider .postCard .buttons .playNowButton {\n width: 172px;\n display: block;\n padding: 8px 16px;\n border: 3px solid #63B250;\n border-radius: 6px;\n cursor: pointer;\n font-weight: bold;\n}\n.sliderWidget .postSlider .postCard .buttons .moreInfoButton {\n background-color: rgb(244, 244, 244);\n color: #63B250;\n}\n.sliderWidget .postSlider .postCard .buttons .playNowButton {\n background-color: #63B250;\n color: #fff;\n}\n\nh3, h4 {\n font-size: 18px;\n}\n\np {\n font-size: 14px;\n color: rgb(91, 91, 91);\n}\n\n@container (max-width: 480px) {\n .sliderWidget h2 {\n font-size: 18px;\n }\n .sliderWidget .postSlider .postCard {\n min-width: 250px;\n }\n h3, h4 {\n font-size: 16px;\n }\n p {\n font-size: 12px;\n }\n}';export{l as general_preview_social_posts}
@@ -1,2 +0,0 @@
1
- var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),o=(e,n)=>t.set(n.t=e,n),l=(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={o:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),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})(),d=!1,m=[],y=[],w=(e,t)=>n=>{e.push(n),d||(d=!0,t&&4&f.o?v(b):f.raf(b))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},b=()=>{$(m),$(y),(d=m.length>0)&&f.raf(b)},v=e=>h().then(e),S=w(y,!0),g={},j=e=>"object"==(e=typeof e)||"function"===e;function E(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{err:()=>O,map:()=>C,ok:()=>k,unwrap:()=>x,unwrapErr:()=>P});var k=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=>k(e))):k(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 o=null,l=!1,s=!1;const r=[],i=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof e&&!j(o))&&(o+=""),l&&s?r[r.length-1].i+=o:r.push(l?D(null,o):o),s=l)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=D(e,null);return c.u=t,r.length>0&&(c.h=r),c},D=(e,t)=>({o:0,p:e,i:t,m:null,h:null,u:null}),R={},H=(e,t,o)=>{const l=(e=>n(e).$hostElement$)(e);return{emit:e=>L(l,t,{bubbles:!!(4&o),composed:!!(2&o),cancelable:!!(1&o),detail:e})}},L=(e,t,n)=>{const o=f.ce(t,n);return e.dispatchEvent(o),o},T=new WeakMap,N=e=>"sc-"+e.$,U=(e,t,n,o,s,r)=>{if(n!==o){let i=l(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,l=F(n),s=F(o);t.remove(...l.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!l.includes(e))))}else if("ref"===t)o&&o(e);else if(i||"o"!==t[0]||"n"!==t[1]){const l=j(o);if((i||l&&null!==o)&&!s)try{if(e.tagName.includes("-"))e[t]=o;else{const l=null==o?"":o;"list"===t?i=!1:null!=n&&e[t]==l||("function"==typeof e.__lookupSetter__(t)?e[t]=l:e.setAttribute(t,l))}}catch(e){}null==o||!1===o?!1===o&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!l&&e.setAttribute(t,o=!0===o?"":o)}else if(t="-"===t[2]?t.slice(3):l(u,c)?c.slice(2):c[2]+t.slice(3),n||o){const l=t.endsWith(q);t=t.replace(G,""),n&&f.rel(e,t,n,l),o&&f.ael(e,t,o,l)}}},W=/\s/,F=e=>e?e.split(W):[],q="Capture",G=RegExp(q+"$"),V=(e,t,n)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,l=e&&e.u||g,s=t.u||g;for(const e of _(Object.keys(l)))e in s||U(o,e,l[e],void 0,n,t.o);for(const e of _(Object.keys(s)))U(o,e,l[e],s[e],n,t.o)};function _(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var z=!1,B=(e,t,n)=>{const o=t.h[n];let l,s,r=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else if(l=o.m=a.createElement(o.p),V(null,o,z),l.getRootNode().querySelector("body"),o.h)for(r=0;r<o.h.length;++r)s=B(e,o,r),s&&l.appendChild(s);return l["s-hn"]=M,l},I=(e,t,n,o,l,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=B(null,n,l),r&&(o[l].m=r,Y(i,r,t)))},J=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.m;X(t),e&&e.remove()}}},K=(e,t)=>e.p===t.p,Q=(e,t,n=!1)=>{const o=t.m=e.m,l=e.h,s=t.h,r=t.i;null===r?(V(e,t,z),null!==l&&null!==s?((e,t,n,o,l=!1)=>{let s,r=0,i=0,c=t.length-1,u=t[0],a=t[c],f=o.length-1,h=o[0],p=o[f];for(;r<=c&&i<=f;)null==u?u=t[++r]:null==a?a=t[--c]:null==h?h=o[++i]:null==p?p=o[--f]:K(u,h)?(Q(u,h,l),u=t[++r],h=o[++i]):K(a,p)?(Q(a,p,l),a=t[--c],p=o[--f]):K(u,p)?(Q(u,p,l),Y(e,u.m,a.m.nextSibling),u=t[++r],p=o[--f]):K(a,h)?(Q(a,h,l),Y(e,a.m,u.m),a=t[--c],h=o[++i]):(s=B(t&&t[i],n,i),h=o[++i],s&&Y(u.m.parentNode,s,u.m));r>c?I(e,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&J(t,r,c)})(o,l,t,s,n):null!==s?(null!==e.i&&(o.textContent=""),I(o,null,t,s,0,s.length-1)):!n&&null!==l&&J(l,0,l.length-1)):e.i!==r&&(o.data=r)},X=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(X)},Y=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Z=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},ee=(e,t)=>{if(e.o|=16,!(4&e.o))return Z(e,e.S),S((()=>te(e,t)));e.o|=512},te=(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 o;return t&&(o=ce(n,"componentWillLoad")),ne(o,(()=>le(e,n,t)))},ne=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,le=async(e,t,n)=>{var o;const l=e.$hostElement$,s=l["s-rc"];n&&(e=>{const t=e.j,n=e.$hostElement$,o=t.o,l=((e,t)=>{var n;const o=N(t),l=i.get(o);if(e=11===e.nodeType?e:a,l)if("string"==typeof l){let s,r=T.get(e=e.head||e);if(r||T.set(e,r=new Set),!r.has(o)){{s=a.createElement("style"),s.innerHTML=l;const o=null!=(n=f.k)?n:E(a);if(null!=o&&s.setAttribute("nonce",o),!(1&t.o))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(l),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.innerHTML=l+t.innerHTML:e.prepend(s)}else e.append(s);1&t.o&&"HEAD"!==e.nodeName&&e.insertBefore(s,null)}4&t.o&&(s.innerHTML+=c),r&&r.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(e);se(e,t,l,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>re(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},se=(e,t,n,o)=>{try{t=t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{const o=e.$hostElement$,l=e.j,s=e.O||D(null,null),r=(e=>e&&e.p===R)(t)?t:A(null,null,t);if(M=o.tagName,l.C&&(r.u=r.u||{},l.C.map((([e,t])=>r.u[t]=o[e]))),n&&r.u)for(const e of Object.keys(r.u))o.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=o[e]);r.p=null,r.o|=4,e.O=r,r.m=s.m=o.shadowRoot||o,Q(s,r,n)})(e,t,o)}catch(t){s(t,e.$hostElement$)}return null},re=e=>{const t=e.$hostElement$,n=e.t,o=e.S;ce(n,"componentDidRender"),64&e.o||(e.o|=64,ue(t),ce(n,"componentDidLoad"),e.M(t),o||ie()),e.v&&(e.v(),e.v=void 0),512&e.o&&v((()=>ee(e,!1))),e.o&=-517},ie=()=>{ue(a.documentElement),v((()=>L(u,"appload",{detail:{namespace:"general-preview-social-posts"}})))},ce=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ue=e=>e.classList.add("hydrated"),ae=(e,t,o)=>{var l,r;const i=e.prototype;if(t.P||t.A||e.watchers){e.watchers&&!t.A&&(t.A=e.watchers);const c=Object.entries(null!=(l=t.P)?l:{});if(c.map((([e,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).D.get(t))(0,e)},set(o){((e,t,o,l)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${l.$}" 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.D.get(t),u=r.o,a=r.t;if(o=((e,t)=>null==e||j(e)?e:1&t?e+"":e)(o,l.P[t][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(r.D.set(t,o),a)){if(l.A&&128&u){const e=l.A[t];e&&e.map((e=>{try{a[e](o,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&ee(r,!1)}})(this,e,o,t)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var r;const c=o.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 o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&s!==l){const n=o.t,i=null==(r=t.A)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,l,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.A)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var l;const s=n[1]||e;return o.set(s,e),512&n[0]&&(null==(l=t.C)||l.push([e,s])),s}))]))}}return e},fe=e=>{ce(e,"connectedCallback")},he=(e,o={})=>{var l;const h=[],d=o.exclude||[],m=u.customElements,y=a.head,w=y.querySelector("meta[charset]"),$=a.createElement("style"),b=[];let v,S=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((o=>{var l;const c={o:o[0],$:o[1],P:o[2],R:o[3]};4&c.o&&(g=!0),c.P=o[2],c.C=[],c.A=null!=(l=o[4])?l:{};const u=c.$,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const o={o:0,$hostElement$:e,j:n,D:new Map};o.H=new Promise((e=>o.M=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,o)})(e=this,c),1&c.o)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.$}! 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.o)){const t=n(e),o=t.j,l=()=>{};if(1&t.o)(null==t?void 0:t.t)?fe(t.t):(null==t?void 0:t.H)&&t.H.then((()=>fe(t.t)));else{t.o|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(t,t.S=n);break}}o.P&&Object.entries(o.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let o;if(!(32&t.o)){if(t.o|=32,n.L){const e=(e=>{const t=e.$.replace(/-/g,"_"),n=e.L;if(!n)return;const o=r.get(n);return o?o[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=()=>{};o=await e,t()}else o=e;if(!o)throw Error(`Constructor for "${n.$}#${t.T}" was not found`);o.isProxied||(n.A=o.watchers,ae(o,n,2),o.isProxied=!0);const l=()=>{};t.o|=8;try{new o(t)}catch(e){s(e)}t.o&=-9,t.o|=128,l(),fe(t.t)}else o=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128));if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const t=N(n);if(!i.has(t)){const o=()=>{};((e,t,n)=>{let o=i.get(e);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,i.set(e,o)})(t,e,!!(1&n.o)),o()}}}const l=t.S,c=()=>ee(t,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(e,t,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.H)&&e.H.then((()=>{}))}})()))}componentOnReady(){return n(this).H}};c.L=e[0],d.includes(u)||m.get(u)||(h.push(u),m.define(u,ae(a,c,1)))}))})),h.length>0&&(g&&($.textContent+=c),$.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const e=null!=(l=f.k)?l:E(a);null!=e&&$.setAttribute("nonce",e),y.insertBefore($,w?w.nextSibling:y.firstChild)}S=!1,b.length?b.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ie,30)))},pe=e=>f.k=e;export{he as b,H as c,A as h,h as p,o as r,pe as s}