@everymatrix/blog-article-details 1.55.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/blog-article-details/blog-article-details.esm.js +1 -1
  2. package/dist/blog-article-details/p-07a89a2b.entry.js +1 -0
  3. package/dist/blog-article-details/p-e2a67b22.js +2 -0
  4. package/dist/cjs/blog-article-details.cjs.entry.js +127 -57
  5. package/dist/cjs/blog-article-details.cjs.js +3 -3
  6. package/dist/cjs/{index-fb71f202.js → index-1b8538a7.js} +179 -76
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/components/blog-article-details/blog-article-details.js +117 -57
  10. package/dist/esm/blog-article-details.entry.js +127 -57
  11. package/dist/esm/blog-article-details.js +4 -4
  12. package/dist/esm/{index-7ef6b24c.js → index-c385b930.js} +179 -76
  13. package/dist/esm/loader.js +3 -3
  14. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/blog-article-details/.stencil/packages/stencil/blog-article-details/stencil.config.d.ts +2 -0
  15. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/blog-article-details/.stencil/packages/stencil/blog-article-details/stencil.config.dev.d.ts +2 -0
  16. package/dist/types/components/blog-article-details/blog-article-details.d.ts +8 -6
  17. package/dist/types/components.d.ts +8 -0
  18. package/package.json +1 -1
  19. package/dist/blog-article-details/p-7184e790.entry.js +0 -1
  20. package/dist/blog-article-details/p-aaa8e218.js +0 -2
  21. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/blog-article-details/.stencil/packages/stencil/blog-article-details/stencil.config.d.ts +0 -2
  22. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/blog-article-details/.stencil/packages/stencil/blog-article-details/stencil.config.dev.d.ts +0 -2
  23. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/blog-article-details/.stencil/tools/plugins/index.d.ts +0 -0
  24. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/blog-article-details/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  25. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/blog-article-details/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  26. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/blog-article-details/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1 +1 @@
1
- import{p as t,b as n}from"./p-aaa8e218.js";export{s as setNonce}from"./p-aaa8e218.js";import{g as e}from"./p-e1255160.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((async t=>(await e(),n([["p-7184e790",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postId:[514,"post-id"],postSlug:[513,"post-slug"],postCustomPath:[513,"post-custom-path"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{postId:["watchEndpoint"],postSlug:["watchEndpoint"],postCustomPath:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}]]]],t))));
1
+ import{p as t,b as n}from"./p-e2a67b22.js";export{s as setNonce}from"./p-e2a67b22.js";import{g as e}from"./p-e1255160.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((async t=>(await e(),n([["p-07a89a2b",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postId:[514,"post-id"],postSlug:[513,"post-slug"],postCustomPath:[513,"post-custom-path"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{postId:["watchEndpoint"],postSlug:["watchEndpoint"],postCustomPath:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}]]]],t))));
@@ -0,0 +1 @@
1
+ import{r as t,h as i}from"./p-e2a67b22.js";const n={en:{error:"Error"},ro:{error:"Eroare"},fr:{error:"Error"},ar:{error:"خطأ"},hr:{error:"Greška"},"pt-br":{error:"Erro"},"es-mx":{error:"Error"}};function e(t,i){if(t){const n=document.createElement("style");n.innerHTML=i,t.appendChild(n)}}function s(t,i){const n=new URL(i);fetch(n.href).then((t=>t.text())).then((i=>{const n=document.createElement("style");n.innerHTML=i,t&&t.appendChild(n)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}const o=class{constructor(n){t(this,n),this.language="en",this.userRoles="everyone",this.cmsEnv="stage",this.clientStyling="",this.clientStylingUrl="",this.showPublishingDate=!0,this.showImage=!0,this.showTitle=!0,this.showContent=!0,this.intlDateTimeFormat="",this.hasErrors=!1,this.isLoading=!0,this.bannerMatrixReady=!1,this.device="",this.renderContentConditionally=t=>-1!==(null==t?void 0:t.indexOf("<bannermatrix-banner"))?this.bannerMatrixReady?i("div",{class:"BlogContent",innerHTML:t}):null:i("div",{class:"BlogContent",innerHTML:t}),this.setImage=t=>{let i="";switch(this.device){case"mobile":i=t.sources[0].pictureSource;break;case"tablet":i=t.sources[1].pictureSource;break;case"desktop":i=t.sources[2].pictureSource}return i}}handleBannerReady(){this.bannerMatrixReady=!0}watchEndpoint(t,i){t&&t!=i&&this.cmsEndpoint&&this.language&&(this.postCustomPath||this.postSlug||this.postId)&&this.getBlogArticleDetails()}handleClientStylingChange(t,i){t!=i&&e(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(t,i){t!=i&&this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)}connectedCallback(){this.cmsEndpoint&&this.language&&(this.postCustomPath||this.postSlug||this.postId)&&this.getBlogArticleDetails()}getBlogArticleDetails(){if(!this.postId&&!this.postSlug&&!this.postCustomPath)throw this.hasErrors=!0,new Error("postId, postSlug or postCustomPath parameter has to be provided!");this.isLoading=!0;let t=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts${this.postCustomPath?"":"/"+this.postSlug||"/"+this.postId}`);t.searchParams.append("env",this.cmsEnv),t.searchParams.append("userRoles",this.userRoles),t.searchParams.append("device",(()=>{const t=(()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(t)return"PC"===t?"dk":"mtWeb"})()),this.postCustomPath&&t.searchParams.append("customURL",this.postCustomPath),fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{if(t.count>=1&&this.postCustomPath){let i=new Date(t.items[0].publishingDate),n=0;for(let e=1;e<t.items.length;e++){const s=new Date(t.items[e].publishingDate);i.getTime()<s.getTime()&&(i=s,n=e)}this.blogData=t.items[n]}else this.blogData=t;this.isLoading=!1})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>this.isLoading=!1))}componentDidLoad(){this.detectAndAlertDeviceType(),this.stylingContainer&&(null!=window.emMessageBus?function(t,i){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(i,(i=>{n.innerHTML=i,t&&t.appendChild(n)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&e(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}detectAndAlertDeviceType(){this.device=function(){const t=navigator.userAgent.toLowerCase();let i="";return i=t.includes("android")||t.includes("iphone")||t.includes("ipad")?function(){const t=screen.availWidth;return t<600?"mobile":t>=600&&t<1100?"tablet":void 0}():"desktop",i}()}formatDate(t){return new Intl.DateTimeFormat(this.intlDateTimeFormat||"en-GB").format(new Date(t))}render(){var t,e,s,o,r,a;return this.hasErrors?i("div",{class:"BlogArticleDetails"},i("div",{class:"Title"},n[void 0!==(a=this.language)&&a in n?a:"en"].error)):this.isLoading?void 0:i("div",{ref:t=>this.stylingContainer=t},i("div",{class:"DetailsContainer"},i("div",{class:"DetailsHeadWrapper"},this.showPublishingDate&&this.blogData.publishingDate&&i("div",{class:"BlogDate"},this.formatDate(null===(t=this.blogData)||void 0===t?void 0:t.publishingDate)),this.showImage&&i("div",{class:"BlogBanner"},(null===(e=this.blogData.image)||void 0===e?void 0:e.src)?i("div",{style:{background:`url(${this.setImage(this.blogData.image)}) no-repeat center center / cover`}}):(null===(s=this.blogData.video)||void 0===s?void 0:s.sources[this.device])?i("video",{src:this.blogData.video.sources[this.device],controls:!0}):i("h1",{style:{color:"white"}},"No Image"))),i("div",{class:"DetailsBodyWrapper"},this.showTitle&&i("div",{class:"BlogTitle"},null===(o=this.blogData)||void 0===o?void 0:o.title),this.showContent&&this.renderContentConditionally(null===(r=this.blogData)||void 0===r?void 0:r.content))))}static get watchers(){return{postId:["watchEndpoint"],postSlug:["watchEndpoint"],postCustomPath:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};o.style=":host {\n display: block;\n}\n\n.DetailsContainer {\n background-color: #07072A;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n.DetailsContainer .BlogBanner div {\n height: 400px;\n}\n.DetailsContainer .DetailsHeadWrapper {\n position: relative;\n}\n.DetailsContainer .DetailsBodyWrapper {\n padding: 30px;\n}\n.DetailsContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n background-color: #0D0D4D;\n z-index: 1;\n text-wrap: nowrap;\n position: absolute;\n bottom: 0;\n left: 30px;\n}\n.DetailsContainer .BlogTitle {\n font-size: 24px;\n}\n.DetailsContainer .BlogContent {\n font-size: 14px;\n}\n.DetailsContainer .BlogContent p:last-child {\n margin-bottom: 0;\n}\n\n@container (max-width: 475px) {\n .DetailsContainer {\n font-size: 12px;\n }\n}";export{o as blog_article_details}
@@ -0,0 +1,2 @@
1
+ var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>{e.set(n.t=t,n)},l=(t,e)=>(0,console.error)(t,e),s=new Map,i=new Map,r="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},f=t=>Promise.resolve(t),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),d=!1,p=[],m=[],y=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&a.o?$(b):a.raf(b))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},b=()=>{v(p),v(m),(d=p.length>0)&&a.raf(b)},$=t=>f().then(t),w=y(m,!0),S=t=>"object"==(t=typeof t)||"function"===t;function g(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>O,map:()=>k,ok:()=>j,unwrap:()=>E,unwrapErr:()=>M});var j=t=>({isOk:!0,isErr:!1,value:t}),O=t=>({isOk:!1,isErr:!0,value:t});function k(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>j(t))):j(n)}if(t.isErr)return O(t.value);throw"should never get here"}var C,E=t=>{if(t.isOk)return t.value;throw t.value},M=t=>{if(t.isErr)return t.value;throw t.value},P=(t,e,...n)=>{let o=null,l=!1,s=!1;const i=[],r=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?r(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!S(o))&&(o+=""),l&&s?i[i.length-1].i+=o:i.push(l?x(null,o):o),s=l)};if(r(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=x(t,null);return c.u=e,i.length>0&&(c.h=i),c},x=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),A={},N=(t,e)=>null==t||S(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t,T=new WeakMap,D=t=>"sc-"+t.v,F=(t,e,n,o,l,s)=>{if(n!==o){let i=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,l=L(n);let s=L(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("ref"===e)o&&o(t);else{const r=S(o);if((i||r&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&s||l)&&!r&&t.setAttribute(e,o=!0===o?"":o)}}},H=/\s/,L=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(H):[]),R=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||{},s=e.u||{};for(const t of U(Object.keys(l)))t in s||F(o,t,l[t],void 0,n,e.o);for(const t of U(Object.keys(s)))F(o,t,l[t],s[t],n,e.o)};function U(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,W=(t,e,n)=>{const o=e.h[n];let l,s,i=0;if(null!==o.i)l=o.m=u.createTextNode(o.i);else if(l=o.m=u.createElement(o.p),R(null,o,V),o.h)for(i=0;i<o.h.length;++i)s=W(t,o,i),s&&l.appendChild(s);return l["s-hn"]=C,l},q=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===C&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=W(null,n,l),i&&(o[l].m=i,I(r,i,e)))},G=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;B(e),t&&t.remove()}}},_=(t,e,n=!1)=>t.p===e.p&&(n&&!t.$&&e.$&&(t.$=e.$),!0),z=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,i=e.i;null===i?(R(t,e,V),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i=0,r=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],d=o[f];for(;i<=c&&r<=f;)null==u?u=e[++i]:null==a?a=e[--c]:null==h?h=o[++r]:null==d?d=o[--f]:_(u,h,l)?(z(u,h,l),u=e[++i],h=o[++r]):_(a,d,l)?(z(a,d,l),a=e[--c],d=o[--f]):_(u,d,l)?(z(u,d,l),I(t,u.m,a.m.nextSibling),u=e[++i],d=o[--f]):_(a,h,l)?(z(a,h,l),I(t,a.m,u.m),a=e[--c],h=o[++r]):(s=W(e&&e[r],n,r),h=o[++r],s&&I(u.m.parentNode,s,u.m));i>c?q(t,null==o[f+1]?null:o[f+1].m,n,o,r,f):r>f&&G(e,i,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),q(o,null,e,s,0,s.length-1)):!n&&null!==l&&G(l,0,l.length-1)):t.i!==i&&(o.data=i)},B=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(B)},I=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),J=(t,e)=>{if(e&&!t.S&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.S=()=>{e["s-p"].splice(n-1,1),o()})))}},K=(t,e)=>{if(t.o|=16,!(4&t.o))return J(t,t.j),w((()=>Q(t,e)));t.o|=512},Q=(t,e)=>{const n=t.$hostElement$,o=t.t;if(!o)throw Error(`Can't render component <${n.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`);return e&&(t.o|=256,t.O&&(t.O.map((([t,e])=>ot(o,t,e,n))),t.O=void 0)),X(void 0,(()=>Z(t,o,e)))},X=(t,e)=>Y(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Y=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Z=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.k,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=D(e),l=i.get(o);if(t=11===t.nodeType?t:u,l)if("string"==typeof l){let s,i=T.get(t=t.head||t);if(i||T.set(t,i=new Set),!i.has(o)){{s=document.querySelector(`[sty-id="${o}"]`)||u.createElement("style"),s.innerHTML=l;const i=null!=(n=a.C)?n:g(u);if(null!=i&&s.setAttribute("nonce",i),!(1&e.o))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(h){const e=new CSSStyleSheet;e.replaceSync(l),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=l+e.innerHTML:t.prepend(s)}else t.append(s);1&e.o&&t.insertBefore(s,null)}4&e.o&&(s.innerHTML+=r),i&&i.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);(10&o&&2&o||128&o)&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);tt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>et(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},tt=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.k,s=t.M||x(null,null),i=(t=>t&&t.p===A)(e)?e:P(null,null,e);if(C=o.tagName,l.P&&(i.u=i.u||{},l.P.map((([t,e])=>i.u[e]=o[t]))),n&&i.u)for(const t of Object.keys(i.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.u[t]=o[t]);i.p=null,i.o|=4,t.M=i,i.m=s.m=o.shadowRoot||o,z(s,i,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},et=t=>{const e=t.$hostElement$,n=t.t,o=t.j;64&t.o||(t.o|=64,lt(e),ot(n,"componentDidLoad",void 0,e),t.A(e),o||nt()),t.S&&(t.S(),t.S=void 0),512&t.o&&$((()=>K(t,!1))),t.o&=-517},nt=()=>{$((()=>(t=>{const e=a.ce("appload",{detail:{namespace:"blog-article-details"}});return t.dispatchEvent(e),e})(c)))},ot=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},lt=t=>t.classList.add("hydrated"),st=(t,e,o,s)=>{const i=n(t);if(!i)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=i.$hostElement$,c=i.N.get(e),u=i.o,a=i.t;if(o=N(o,s.T[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(i.N.set(e,o),a)){if(s.D&&128&u){const t=s.D[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){l(t,r)}}))}2==(18&u)&&K(i,!1)}},it=(t,e,o)=>{var l,s;const i=t.prototype;if(e.T||e.D||t.watchers){t.watchers&&!e.D&&(e.D=t.watchers);const r=Object.entries(null!=(l=e.T)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:s,set:r}=Object.getOwnPropertyDescriptor(i,t)||{};s&&(e.T[t][0]|=2048),r&&(e.T[t][0]|=4096),(1&o||!s)&&Object.defineProperty(i,t,{get(){{if(!(2048&e.T[t][0]))return((t,e)=>n(this).N.get(e))(0,t);const o=n(this),l=o?o.t:i;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(s){const i=n(this);if(r){const n=32&l?this[t]:i.$hostElement$[t];return void 0===n&&i.N.get(t)?s=i.N.get(t):!i.N.get(t)&&n&&i.N.set(t,n),r.call(this,N(s,l)),void st(this,t,s=32&l?this[t]:i.$hostElement$[t],e)}{if(!(1&o&&4096&e.T[t][0]))return st(this,t,s,e),void(1&o&&!i.t&&i.F.then((()=>{4096&e.T[t][0]&&i.t[t]!==i.N.get(t)&&(i.t[t]=s)})));const n=()=>{const n=i.t[t];!i.N.get(t)&&n&&i.N.set(t,n),i.t[t]=N(s,l),st(this,t,i.t[t],e)};i.t?n():i.F.then((()=>n()))}}})}})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,s){a.jmp((()=>{var r;const c=o.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 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=e.D)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,l,t)}))}return}}const u=Object.getOwnPropertyDescriptor(i,c);(s=(null!==s||"boolean"!=typeof this[c])&&s)===this[c]||u.get&&!u.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.D)?s:{}),...r.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const s=n[1]||t;return o.set(s,t),512&n[0]&&(null==(l=e.P)||l.push([t,s])),s}))]))}}return t},rt=(t,e)=>{ot(t,"connectedCallback",void 0,e)},ct=(t,e)=>{ot(t,"disconnectedCallback",void 0,e||t)},ut=(t,o={})=>{var f;const d=[],p=o.exclude||[],m=c.customElements,y=u.head,v=y.querySelector("meta[charset]"),b=u.createElement("style"),$=[];let w,S=!0;Object.assign(a,o),a.l=new URL(o.resourcesUrl||"./",u.baseURI).href;let j=!1;if(t.map((t=>{t[1].map((o=>{var r;const c={o:o[0],v:o[1],T:o[2],H:o[3]};4&c.o&&(j=!0),c.T=o[2],c.H=o[3],c.P=[],c.D=null!=(r=o[4])?r:{};const u=c.v,f=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,k:n,N:new Map};o.F=new Promise((t=>o.A=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,c),1&c.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,at(this,t,c.H)),w&&(clearTimeout(w),w=null),S?$.push(this):a.jmp((()=>(t=>{if(!(1&a.o)){const e=n(t),o=e.k,r=()=>{};if(1&e.o)at(t,e,o.H),(null==e?void 0:e.t)?rt(e.t,t):(null==e?void 0:e.F)&&e.F.then((()=>rt(e.t,t)));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(e,e.j=n);break}}o.T&&Object.entries(o.T).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.L){const i=((t,e)=>{const n=t.v.replace(/-/g,"_"),o=t.L;if(!o)return;const i=s.get(o);return i?i[n]:import(`./${o}.entry.js`).then((t=>(s.set(o,t),t[n])),(t=>{l(t,e.$hostElement$)}))
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(i&&"then"in i){const t=()=>{};o=await i,t()}else o=i;if(!o)throw Error(`Constructor for "${n.v}#${e.R}" was not found`);o.isProxied||(n.D=o.watchers,it(o,n,2),o.isProxied=!0);const r=()=>{};e.o|=8;try{new o(e)}catch(e){l(e,t)}e.o&=-9,e.o|=128,r(),rt(e.t,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=D(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);h&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const r=e.j,c=()=>K(e,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(t,e,o)}r()}})(this)))}disconnectedCallback(){a.jmp((()=>(async t=>{if(!(1&a.o)){const e=n(t);e.U&&(e.U.map((t=>t())),e.U=void 0),(null==e?void 0:e.t)?ct(e.t,t):(null==e?void 0:e.F)&&e.F.then((()=>ct(e.t,t)))}T.has(t)&&T.delete(t),t.shadowRoot&&T.has(t.shadowRoot)&&T.delete(t.shadowRoot)})(this))),a.raf((()=>{var t;const e=n(this),o=$.findIndex((t=>t===this));o>-1&&$.splice(o,1),(null==(t=null==e?void 0:e.M)?void 0:t.m)instanceof Node&&!e.M.m.isConnected&&delete e.M.m}))}componentOnReady(){return n(this).F}};c.L=t[0],p.includes(u)||m.get(u)||(d.push(u),m.define(u,it(f,c,1)))}))})),d.length>0&&(j&&(b.textContent+=r),b.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const t=null!=(f=a.C)?f:g(u);null!=t&&b.setAttribute("nonce",t),y.insertBefore(b,v?v.nextSibling:y.firstChild)}S=!1,$.length?$.map((t=>t.connectedCallback())):a.jmp((()=>w=setTimeout(nt,30)))},at=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=ht(t,n),i=ft(e,l),r=dt(n);a.ael(s,o,i,r),(e.U=e.U||[]).push((()=>a.rel(s,o,i,r)))}))},ft=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.O=t.O||[]).push([e,n])}catch(e){l(e,t.$hostElement$)}},ht=(t,e)=>8&e?c:t,dt=t=>({passive:!!(1&t),capture:!!(2&t)}),pt=t=>a.C=t;export{ut as b,P as h,f as p,o as r,pt as s}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fb71f202.js');
5
+ const index = require('./index-1b8538a7.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const TRANSLATIONS = {
@@ -33,6 +33,63 @@ const translate = (key, customLang) => {
33
33
  return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
34
34
  };
35
35
 
36
+ /**
37
+ * @name setClientStyling
38
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
39
+ * @param {HTMLElement} stylingContainer The reference element of the widget
40
+ * @param {string} clientStyling The style content
41
+ */
42
+ function setClientStyling(stylingContainer, clientStyling) {
43
+ if (stylingContainer) {
44
+ const sheet = document.createElement('style');
45
+ sheet.innerHTML = clientStyling;
46
+ stylingContainer.appendChild(sheet);
47
+ }
48
+ }
49
+
50
+ /**
51
+ * @name setClientStylingURL
52
+ * @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
53
+ * @param {HTMLElement} stylingContainer The reference element of the widget
54
+ * @param {string} clientStylingUrl The URL of the style content
55
+ */
56
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
57
+ const url = new URL(clientStylingUrl);
58
+
59
+ fetch(url.href)
60
+ .then((res) => res.text())
61
+ .then((data) => {
62
+ const cssFile = document.createElement('style');
63
+ cssFile.innerHTML = data;
64
+ if (stylingContainer) {
65
+ stylingContainer.appendChild(cssFile);
66
+ }
67
+ })
68
+ .catch((err) => {
69
+ console.error('There was an error while trying to load client styling from URL', err);
70
+ });
71
+ }
72
+
73
+ /**
74
+ * @name setStreamLibrary
75
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
76
+ * @param {HTMLElement} stylingContainer The highest element of the widget
77
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
78
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
79
+ */
80
+ function setStreamStyling(stylingContainer, domain, subscription) {
81
+ if (window.emMessageBus) {
82
+ const sheet = document.createElement('style');
83
+
84
+ window.emMessageBus.subscribe(domain, (data) => {
85
+ sheet.innerHTML = data;
86
+ if (stylingContainer) {
87
+ stylingContainer.appendChild(sheet);
88
+ }
89
+ });
90
+ }
91
+ }
92
+
36
93
  const getDevice = () => {
37
94
  let userAgent = window.navigator.userAgent;
38
95
  if (userAgent.toLowerCase().match(/android/i)) {
@@ -82,24 +139,50 @@ const BlogArticleDetailsStyle0 = blogArticleDetailsCss;
82
139
  const BlogArticleDetails = class {
83
140
  constructor(hostRef) {
84
141
  index.registerInstance(this, hostRef);
85
- this.setClientStyling = () => {
86
- let sheet = document.createElement('style');
87
- sheet.innerHTML = this.clientStyling;
88
- this.stylingContainer.prepend(sheet);
89
- };
90
- this.setClientStylingURL = () => {
91
- let url = new URL(this.clientStylingUrl);
92
- let cssFile = document.createElement('style');
93
- fetch(url.href)
94
- .then((res) => res.text())
95
- .then((data) => {
96
- cssFile.innerHTML = data;
97
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
98
- })
99
- .catch((err) => {
100
- console.log('Error ', err);
101
- });
102
- };
142
+ /**
143
+ * Language of the widget
144
+ */
145
+ this.language = 'en';
146
+ /**
147
+ * User roles
148
+ */
149
+ this.userRoles = 'everyone';
150
+ /**
151
+ * CMS Endpoint stage
152
+ */
153
+ this.cmsEnv = 'stage';
154
+ /**
155
+ * Client custom styling via string
156
+ */
157
+ this.clientStyling = '';
158
+ /**
159
+ * Client custom styling via url
160
+ */
161
+ this.clientStylingUrl = '';
162
+ /**
163
+ * Property used to display the publishing date
164
+ */
165
+ this.showPublishingDate = true;
166
+ /**
167
+ * Property used to display the image
168
+ */
169
+ this.showImage = true;
170
+ /**
171
+ * Property used to display the image
172
+ */
173
+ this.showTitle = true;
174
+ /**
175
+ * Property used to display the description
176
+ */
177
+ this.showContent = true;
178
+ /**
179
+ * Intl date format
180
+ */
181
+ this.intlDateTimeFormat = '';
182
+ this.hasErrors = false;
183
+ this.isLoading = true;
184
+ this.bannerMatrixReady = false;
185
+ this.device = '';
103
186
  this.renderContentConditionally = (content) => {
104
187
  const hasBanner = (content === null || content === void 0 ? void 0 : content.indexOf('<bannermatrix-banner')) !== -1;
105
188
  if (!hasBanner) {
@@ -125,25 +208,6 @@ const BlogArticleDetails = class {
125
208
  }
126
209
  return source;
127
210
  };
128
- this.cmsEndpoint = undefined;
129
- this.language = 'en';
130
- this.userRoles = 'everyone';
131
- this.cmsEnv = 'stage';
132
- this.clientStyling = '';
133
- this.clientStylingUrl = '';
134
- this.showPublishingDate = true;
135
- this.showImage = true;
136
- this.showTitle = true;
137
- this.showContent = true;
138
- this.postId = undefined;
139
- this.postSlug = undefined;
140
- this.postCustomPath = undefined;
141
- this.intlDateTimeFormat = '';
142
- this.hasErrors = false;
143
- this.limitStylingAppends = false;
144
- this.isLoading = true;
145
- this.bannerMatrixReady = false;
146
- this.device = '';
147
211
  }
148
212
  // Rerender when bannermatrix has finished loaded. Issue when bannermatrix passed as content from CMS.
149
213
  handleBannerReady() {
@@ -154,13 +218,16 @@ const BlogArticleDetails = class {
154
218
  this.getBlogArticleDetails();
155
219
  }
156
220
  }
157
- handleStylingChange(newValue, oldValue) {
158
- if (newValue !== oldValue)
159
- this.setClientStyling();
221
+ handleClientStylingChange(newValue, oldValue) {
222
+ if (newValue != oldValue) {
223
+ setClientStyling(this.stylingContainer, this.clientStyling);
224
+ }
160
225
  }
161
- handleStylingUrlChange(newValue, oldValue) {
162
- if (newValue !== oldValue)
163
- this.setClientStylingURL();
226
+ handleClientStylingChangeURL(newValue, oldValue) {
227
+ if (newValue != oldValue) {
228
+ if (this.clientStylingUrl)
229
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
230
+ }
164
231
  }
165
232
  connectedCallback() {
166
233
  if (this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
@@ -212,19 +279,22 @@ const BlogArticleDetails = class {
212
279
  })
213
280
  .finally(() => this.isLoading = false);
214
281
  }
215
- componentDidRender() {
216
- // start custom styling area
217
- if (!this.limitStylingAppends && this.stylingContainer) {
218
- if (this.clientStyling)
219
- this.setClientStyling();
220
- if (this.clientStylingUrl)
221
- this.setClientStylingURL();
222
- this.limitStylingAppends = true;
223
- }
224
- // end custom styling area
225
- }
226
282
  componentDidLoad() {
227
283
  this.detectAndAlertDeviceType();
284
+ if (this.stylingContainer) {
285
+ if (window.emMessageBus != undefined) {
286
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
287
+ }
288
+ else {
289
+ if (this.clientStyling)
290
+ setClientStyling(this.stylingContainer, this.clientStyling);
291
+ if (this.clientStylingUrl)
292
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
293
+ }
294
+ }
295
+ }
296
+ disconnectedCallback() {
297
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
228
298
  }
229
299
  detectAndAlertDeviceType() {
230
300
  this.device = getDeviceCustom();
@@ -249,8 +319,8 @@ const BlogArticleDetails = class {
249
319
  "postCustomPath": ["watchEndpoint"],
250
320
  "cmsEndpoint": ["watchEndpoint"],
251
321
  "language": ["watchEndpoint"],
252
- "clientStyling": ["handleStylingChange"],
253
- "clientStylingUrl": ["handleStylingUrlChange"]
322
+ "clientStyling": ["handleClientStylingChange"],
323
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
254
324
  }; }
255
325
  };
256
326
  BlogArticleDetails.style = BlogArticleDetailsStyle0;
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-fb71f202.js');
5
+ const index = require('./index-1b8538a7.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.26.0 | 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('blog-article-details.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([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}]]]], options);
22
+ return index.bootstrapLazy([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;