@everymatrix/blog-article-details 1.44.0 → 1.45.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.
- package/dist/blog-article-details/blog-article-details.esm.js +1 -1
- package/dist/blog-article-details/p-0783b0ba.js +2 -0
- package/dist/blog-article-details/p-e1255160.js +1 -0
- package/dist/blog-article-details/p-f02359f3.entry.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/blog-article-details.cjs.entry.js +223 -248
- package/dist/cjs/blog-article-details.cjs.js +17 -11
- package/dist/cjs/index-ade27b33.js +1254 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/blog-article-details/blog-article-details.js +463 -485
- package/dist/collection/components/blog-article-details/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +23 -23
- package/dist/collection/utils/utils.js +48 -48
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/blog-article-details.entry.js +223 -248
- package/dist/esm/blog-article-details.js +14 -11
- package/dist/esm/index-9d94198d.js +1228 -0
- package/dist/esm/loader.js +7 -13
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- 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
- 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
- package/dist/types/components/blog-article-details/blog-article-details.d.ts +78 -78
- package/dist/types/components/blog-article-details/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -6
- package/dist/blog-article-details/p-68e0210a.js +0 -1
- package/dist/blog-article-details/p-b8c9de45.entry.js +0 -1
- package/dist/cjs/index-d983d0f8.js +0 -1255
- package/dist/components/blog-article-details.d.ts +0 -11
- package/dist/components/blog-article-details.js +0 -317
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-a6d43dfd.js +0 -1230
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/blog-article-details/.stencil/packages/blog-article-details/stencil.config.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,b as e}from"./p-
|
|
1
|
+
import{p as t,b as n}from"./p-0783b0ba.js";export{s as setNonce}from"./p-0783b0ba.js";import{g as e}from"./p-e1255160.js";(()=>{const n=import.meta.url,s={};return""!==n&&(s.resourcesUrl=new URL(".",n).href),t(s)})().then((async t=>(await e(),n([["p-f02359f3",[[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))));
|
|
@@ -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,r=new Map,i="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?w($):a.raf($))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},$=()=>{v(p),v(m),(d=p.length>0)&&a.raf($)},w=t=>f().then(t),b=y(m,!0),S={},g=t=>"object"==(t=typeof t)||"function"===t;function j(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:()=>E,ok:()=>k,unwrap:()=>M,unwrapErr:()=>P});var k=t=>({isOk:!0,isErr:!1,value:t}),O=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=>k(t))):k(n)}if(t.isErr)return O(t.value);throw"should never get here"}var C,M=t=>{if(t.isOk)return t.value;throw t.value},P=t=>{if(t.isErr)return t.value;throw t.value},x=(t,e,...n)=>{let o=null,l=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!g(o))&&(o+=""),l&&s?r[r.length-1].i+=o:r.push(l?A(null,o):o),s=l)};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=A(t,null);return c.u=e,r.length>0&&(c.h=r),c},A=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),D={},R=new WeakMap,T=t=>"sc-"+t.v,F=(t,e,n,o,l,s)=>{if(n!==o){let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,l=L(n),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 i=g(o);if((r||i&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||l)&&!i&&t.setAttribute(e,o=!0===o?"":o)}}},H=/\s/,L=t=>t?t.split(H):[],N=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,s=e.u||S;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 W=!1,q=(t,e,n)=>{const o=e.h[n];let l,s,r=0;if(null!==o.i)l=o.m=u.createTextNode(o.i);else if(l=o.m=u.createElement(o.p),N(null,o,W),l.getRootNode().querySelector("body"),o.h)for(r=0;r<o.h.length;++r)s=q(t,o,r),s&&l.appendChild(s);return l["s-hn"]=C,l},G=(t,e,n,o,l,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===C&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=q(null,n,l),r&&(o[l].m=r,I(i,r,e)))},V=(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)=>t.p===e.p,z=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,r=e.i;null===r?(N(t,e,W),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],d=o[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=o[++i]:null==d?d=o[--f]:_(u,h)?(z(u,h,l),u=e[++r],h=o[++i]):_(a,d)?(z(a,d,l),a=e[--c],d=o[--f]):_(u,d)?(z(u,d,l),I(t,u.m,a.m.nextSibling),u=e[++r],d=o[--f]):_(a,h)?(z(a,h,l),I(t,a.m,u.m),a=e[--c],h=o[++i]):(s=q(e&&e[i],n,i),h=o[++i],s&&I(u.m.parentNode,s,u.m));r>c?G(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&V(e,r,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),G(o,null,e,s,0,s.length-1)):!n&&null!==l&&V(l,0,l.length-1)):t.i!==r&&(o.data=r)},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)=>{e&&!t.$&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.$=e)))},K=(t,e)=>{if(t.o|=16,!(4&t.o))return J(t,t.S),b((()=>Q(t,e)));t.o|=512},Q=(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`);return e&&(t.o|=256,t.j&&(t.j.map((([t,e])=>ot(n,t,e))),t.j=void 0)),X(void 0,(()=>Z(t,n,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=T(e),l=r.get(o);if(t=11===t.nodeType?t:u,l)if("string"==typeof l){let s,r=R.get(t=t.head||t);if(r||R.set(t,r=new Set),!r.has(o)){{s=u.createElement("style"),s.innerHTML=l;const o=null!=(n=a.O)?n:j(u);null!=o&&s.setAttribute("nonce",o),(!(1&e.o)||1&e.o&&"HEAD"!==t.nodeName)&&t.insertBefore(s,t.querySelector("link"))}4&e.o&&(s.innerHTML+=i),r&&r.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&&(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.C||A(null,null),r=(t=>t&&t.p===D)(e)?e:x(null,null,e);if(C=o.tagName,l.M&&(r.u=r.u||{},l.M.map((([t,e])=>r.u[e]=o[t]))),n&&r.u)for(const t of Object.keys(r.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=o[t]);r.p=null,r.o|=4,t.C=r,r.m=s.m=o.shadowRoot||o,z(s,r,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},et=t=>{const e=t.$hostElement$,n=t.t,o=t.S;ot(n,"componentDidRender"),64&t.o||(t.o|=64,lt(e),ot(n,"componentDidLoad"),t.P(e),o||nt()),t.$&&(t.$(),t.$=void 0),512&t.o&&w((()=>K(t,!1))),t.o&=-517},nt=()=>{lt(u.documentElement),w((()=>(t=>{const e=a.ce("appload",{detail:{namespace:"blog-article-details"}});return t.dispatchEvent(e),e})(c)))},ot=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t)}},lt=t=>t.classList.add("hydrated"),st=(t,e,o)=>{var s,r;const i=t.prototype;if(e.A||e.D||t.watchers){t.watchers&&!e.D&&(e.D=t.watchers);const c=Object.entries(null!=(s=e.A)?s:{});if(c.map((([t,[s]])=>{(31&s||2&o&&32&s)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).R.get(e))(0,t)},set(o){((t,e,o,s)=>{const r=n(t);if(!r)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 i=r.$hostElement$,c=r.R.get(e),u=r.o,a=r.t;if(o=((t,e)=>null==t||g(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(o,s.A[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(r.R.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,i)}}))}2==(18&u)&&K(r,!1)}})(this,t,o,e)},configurable:!0,enumerable:!0})})),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}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.D)?r:{}),...c.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.M)||l.push([t,s])),s}))]))}}return t},rt=t=>{ot(t,"connectedCallback")},it=(t,o={})=>{var f;const d=[],p=o.exclude||[],m=c.customElements,y=u.head,v=y.querySelector("meta[charset]"),$=u.createElement("style"),w=[];let b,S=!0;Object.assign(a,o),a.l=new URL(o.resourcesUrl||"./",u.baseURI).href;let g=!1;if(t.map((t=>{t[1].map((o=>{var i;const c={o:o[0],v:o[1],A:o[2],T:o[3]};4&c.o&&(g=!0),c.A=o[2],c.T=o[3],c.M=[],c.D=null!=(i=o[4])?i:{};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,R:new Map};o.F=new Promise((t=>o.P=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,ct(this,t,c.T)),b&&(clearTimeout(b),b=null),S?w.push(this):a.jmp((()=>(t=>{if(!(1&a.o)){const e=n(t),o=e.k,i=()=>{};if(1&e.o)ct(t,e,o.T),(null==e?void 0:e.t)?rt(e.t):(null==e?void 0:e.F)&&e.F.then((()=>rt(e.t)));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(e,e.S=n);break}}o.A&&Object.entries(o.A).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.H){const t=(t=>{const e=t.v.replace(/-/g,"_"),n=t.H;if(!n)return;const o=s.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(s.set(n,t),t[e])),l)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.v}#${e.L}" was not found`);o.isProxied||(n.D=o.watchers,st(o,n,2),o.isProxied=!0);const r=()=>{};e.o|=8;try{new o(e)}catch(t){l(t)}e.o&=-9,e.o|=128,r(),rt(e.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=T(n);if(!r.has(e)){const o=()=>{};((t,e,n)=>{let o=r.get(t);h&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,r.set(t,o)})(e,t,!!(1&n.o)),o()}}}const i=e.S,c=()=>K(e,!0);i&&i["s-rc"]?i["s-rc"].push(c):c()})(t,e,o)}i()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.o)){const t=n(this);t.N&&(t.N.map((t=>t())),t.N=void 0),(null==t?void 0:t.t)||(null==t?void 0:t.F)&&t.F.then((()=>{}))}})()))}componentOnReady(){return n(this).F}};c.H=t[0],p.includes(u)||m.get(u)||(d.push(u),m.define(u,st(f,c,1)))}))})),d.length>0&&(g&&($.textContent+=i),$.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const t=null!=(f=a.O)?f:j(u);null!=t&&$.setAttribute("nonce",t),y.insertBefore($,v?v.nextSibling:y.firstChild)}S=!1,w.length?w.map((t=>t.connectedCallback())):a.jmp((()=>b=setTimeout(nt,30)))},ct=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=at(t,n),r=ut(e,l),i=ft(n);a.ael(s,o,r,i),(e.N=e.N||[]).push((()=>a.rel(s,o,r,i)))}))},ut=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.j=t.j||[]).push([e,n])}catch(t){l(t)}},at=(t,e)=>8&e?c:t,ft=t=>({passive:!!(1&t),capture:!!(2&t)}),ht=t=>a.O=t;export{it as b,x as h,f as p,o as r,ht as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i}from"./p-0783b0ba.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"}};const e=class{constructor(n){t(this,n),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},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},this.cmsEndpoint=void 0,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.postId=void 0,this.postSlug=void 0,this.postCustomPath=void 0,this.intlDateTimeFormat="",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.bannerMatrixReady=!1,this.device=""}handleBannerReady(){this.bannerMatrixReady=!0}watchEndpoint(t,i){t&&t!=i&&this.cmsEndpoint&&this.language&&(this.postCustomPath||this.postSlug||this.postId)&&this.getBlogArticleDetails()}handleStylingChange(t,i){t!==i&&this.setClientStyling()}handleStylingUrlChange(t,i){t!==i&&this.setClientStylingURL()}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))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidLoad(){this.detectAndAlertDeviceType()}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,h;return this.hasErrors?i("div",{class:"BlogArticleDetails"},i("div",{class:"Title"},n[void 0!==(h=this.language)&&h in n?h:"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:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}}};e.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{e as blog_article_details}
|
|
@@ -2,282 +2,257 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ade27b33.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const TRANSLATIONS = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
en: {
|
|
10
|
+
error: 'Error',
|
|
11
|
+
},
|
|
12
|
+
ro: {
|
|
13
|
+
error: 'Eroare',
|
|
14
|
+
},
|
|
15
|
+
fr: {
|
|
16
|
+
error: 'Error',
|
|
17
|
+
},
|
|
18
|
+
ar: {
|
|
19
|
+
error: 'خطأ',
|
|
20
|
+
},
|
|
21
|
+
hr: {
|
|
22
|
+
error: 'Greška',
|
|
23
|
+
},
|
|
24
|
+
'pt-br': {
|
|
25
|
+
error: 'Erro'
|
|
26
|
+
},
|
|
27
|
+
'es-mx': {
|
|
28
|
+
error: 'Error'
|
|
29
|
+
}
|
|
30
30
|
};
|
|
31
31
|
const translate = (key, customLang) => {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const lang = customLang;
|
|
33
|
+
return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const getDevice = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
let userAgent = window.navigator.userAgent;
|
|
38
|
+
if (userAgent.toLowerCase().match(/android/i)) {
|
|
39
|
+
return 'Android';
|
|
40
|
+
}
|
|
41
|
+
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
42
|
+
return 'iPhone';
|
|
43
|
+
}
|
|
44
|
+
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
45
|
+
return 'iPad';
|
|
46
|
+
}
|
|
47
|
+
return 'PC';
|
|
48
48
|
};
|
|
49
49
|
function checkCustomDeviceWidth() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
const width = screen.availWidth;
|
|
51
|
+
if (width < 600) {
|
|
52
|
+
return 'mobile';
|
|
53
|
+
}
|
|
54
|
+
else if (width >= 600 && width < 1100) {
|
|
55
|
+
return 'tablet';
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
function getDeviceCustom() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
60
|
+
let source = '';
|
|
61
|
+
source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop';
|
|
62
|
+
return source;
|
|
63
63
|
}
|
|
64
64
|
const getDevicePlatform = () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
const device = getDevice();
|
|
66
|
+
if (device) {
|
|
67
|
+
if (device === 'PC') {
|
|
68
|
+
return 'dk';
|
|
69
|
+
}
|
|
70
|
+
else if (device === 'iPad' || device === 'iPhone') {
|
|
71
|
+
return 'mtWeb';
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return 'mtWeb';
|
|
75
|
+
}
|
|
75
76
|
}
|
|
76
|
-
}
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const blogArticleDetailsCss = ":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}";
|
|
80
|
+
const BlogArticleDetailsStyle0 = blogArticleDetailsCss;
|
|
80
81
|
|
|
81
82
|
const BlogArticleDetails = class {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.
|
|
139
|
-
.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
};
|
|
147
|
-
this.renderContentConditionally = (content) => {
|
|
148
|
-
const hasBanner = (content === null || content === void 0 ? void 0 : content.indexOf('<bannermatrix-banner')) !== -1;
|
|
149
|
-
if (!hasBanner) {
|
|
150
|
-
return index.h("div", { class: "BlogContent", innerHTML: content });
|
|
151
|
-
}
|
|
152
|
-
if (this.bannerMatrixReady) {
|
|
153
|
-
return index.h("div", { class: "BlogContent", innerHTML: content });
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
};
|
|
157
|
-
this.setImage = (image) => {
|
|
158
|
-
let source = '';
|
|
159
|
-
switch (this.device) {
|
|
160
|
-
case 'mobile':
|
|
161
|
-
source = image.sources[0].pictureSource;
|
|
162
|
-
break;
|
|
163
|
-
case 'tablet':
|
|
164
|
-
source = image.sources[1].pictureSource;
|
|
165
|
-
break;
|
|
166
|
-
case 'desktop':
|
|
167
|
-
source = image.sources[2].pictureSource;
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
return source;
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// Rerender when bannermatrix has finished loaded. Issue when bannermatrix passed as content from CMS.
|
|
174
|
-
handleBannerReady() {
|
|
175
|
-
this.bannerMatrixReady = true;
|
|
176
|
-
}
|
|
177
|
-
watchEndpoint(newValue, oldValue) {
|
|
178
|
-
if (newValue && newValue != oldValue && this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
|
|
179
|
-
this.getBlogArticleDetails();
|
|
83
|
+
constructor(hostRef) {
|
|
84
|
+
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
|
+
};
|
|
103
|
+
this.renderContentConditionally = (content) => {
|
|
104
|
+
const hasBanner = (content === null || content === void 0 ? void 0 : content.indexOf('<bannermatrix-banner')) !== -1;
|
|
105
|
+
if (!hasBanner) {
|
|
106
|
+
return index.h("div", { class: "BlogContent", innerHTML: content });
|
|
107
|
+
}
|
|
108
|
+
if (this.bannerMatrixReady) {
|
|
109
|
+
return index.h("div", { class: "BlogContent", innerHTML: content });
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
113
|
+
this.setImage = (image) => {
|
|
114
|
+
let source = '';
|
|
115
|
+
switch (this.device) {
|
|
116
|
+
case 'mobile':
|
|
117
|
+
source = image.sources[0].pictureSource;
|
|
118
|
+
break;
|
|
119
|
+
case 'tablet':
|
|
120
|
+
source = image.sources[1].pictureSource;
|
|
121
|
+
break;
|
|
122
|
+
case 'desktop':
|
|
123
|
+
source = image.sources[2].pictureSource;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return source;
|
|
127
|
+
};
|
|
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 = '';
|
|
180
147
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this.setClientStyling();
|
|
185
|
-
}
|
|
186
|
-
handleStylingUrlChange(newValue, oldValue) {
|
|
187
|
-
if (newValue !== oldValue)
|
|
188
|
-
this.setClientStylingURL();
|
|
189
|
-
}
|
|
190
|
-
connectedCallback() {
|
|
191
|
-
if (this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
|
|
192
|
-
this.getBlogArticleDetails();
|
|
148
|
+
// Rerender when bannermatrix has finished loaded. Issue when bannermatrix passed as content from CMS.
|
|
149
|
+
handleBannerReady() {
|
|
150
|
+
this.bannerMatrixReady = true;
|
|
193
151
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
152
|
+
watchEndpoint(newValue, oldValue) {
|
|
153
|
+
if (newValue && newValue != oldValue && this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
|
|
154
|
+
this.getBlogArticleDetails();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
handleStylingChange(newValue, oldValue) {
|
|
158
|
+
if (newValue !== oldValue)
|
|
159
|
+
this.setClientStyling();
|
|
160
|
+
}
|
|
161
|
+
handleStylingUrlChange(newValue, oldValue) {
|
|
162
|
+
if (newValue !== oldValue)
|
|
163
|
+
this.setClientStylingURL();
|
|
199
164
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
url.searchParams.append('device', getDevicePlatform());
|
|
205
|
-
if (this.postCustomPath) {
|
|
206
|
-
url.searchParams.append('customURL', this.postCustomPath);
|
|
165
|
+
connectedCallback() {
|
|
166
|
+
if (this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
|
|
167
|
+
this.getBlogArticleDetails();
|
|
168
|
+
}
|
|
207
169
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
for (let i = 1; i < blogContent.items.length; i++) {
|
|
221
|
-
const blogDate = new Date(blogContent.items[i].publishingDate);
|
|
222
|
-
if (firstBlogPublishDate.getTime() < blogDate.getTime()) {
|
|
223
|
-
firstBlogPublishDate = blogDate;
|
|
224
|
-
indexOfLatestPublished = i;
|
|
225
|
-
}
|
|
170
|
+
getBlogArticleDetails() {
|
|
171
|
+
if (!this.postId && !this.postSlug && !this.postCustomPath) {
|
|
172
|
+
this.hasErrors = true;
|
|
173
|
+
throw new Error('postId, postSlug or postCustomPath parameter has to be provided!');
|
|
174
|
+
}
|
|
175
|
+
this.isLoading = true;
|
|
176
|
+
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts${this.postCustomPath ? '' : '/' + this.postSlug || '/' + this.postId}`);
|
|
177
|
+
url.searchParams.append('env', this.cmsEnv);
|
|
178
|
+
url.searchParams.append('userRoles', this.userRoles);
|
|
179
|
+
url.searchParams.append('device', getDevicePlatform());
|
|
180
|
+
if (this.postCustomPath) {
|
|
181
|
+
url.searchParams.append('customURL', this.postCustomPath);
|
|
226
182
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
183
|
+
fetch(url.href)
|
|
184
|
+
.then((res) => {
|
|
185
|
+
if (res.status >= 300) {
|
|
186
|
+
this.hasErrors = true;
|
|
187
|
+
throw new Error('There was an error while fetching the data');
|
|
188
|
+
}
|
|
189
|
+
return res.json();
|
|
190
|
+
})
|
|
191
|
+
.then((blogContent) => {
|
|
192
|
+
if (blogContent.count >= 1 && this.postCustomPath) {
|
|
193
|
+
let firstBlogPublishDate = new Date(blogContent.items[0].publishingDate);
|
|
194
|
+
let indexOfLatestPublished = 0;
|
|
195
|
+
for (let i = 1; i < blogContent.items.length; i++) {
|
|
196
|
+
const blogDate = new Date(blogContent.items[i].publishingDate);
|
|
197
|
+
if (firstBlogPublishDate.getTime() < blogDate.getTime()) {
|
|
198
|
+
firstBlogPublishDate = blogDate;
|
|
199
|
+
indexOfLatestPublished = i;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
this.blogData = blogContent.items[indexOfLatestPublished];
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
this.blogData = blogContent;
|
|
206
|
+
}
|
|
207
|
+
this.isLoading = false;
|
|
208
|
+
})
|
|
209
|
+
.catch((err) => {
|
|
210
|
+
this.hasErrors = true;
|
|
211
|
+
console.log('Error', err);
|
|
212
|
+
})
|
|
213
|
+
.finally(() => this.isLoading = false);
|
|
248
214
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
render() {
|
|
261
|
-
var _a, _b, _c, _d, _e;
|
|
262
|
-
if (this.hasErrors) {
|
|
263
|
-
return (index.h("div", { class: "BlogArticleDetails" }, index.h("div", { class: "Title" }, translate('error', this.language))));
|
|
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
|
|
264
225
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
226
|
+
componentDidLoad() {
|
|
227
|
+
this.detectAndAlertDeviceType();
|
|
228
|
+
}
|
|
229
|
+
detectAndAlertDeviceType() {
|
|
230
|
+
this.device = getDeviceCustom();
|
|
231
|
+
}
|
|
232
|
+
formatDate(dateString) {
|
|
233
|
+
return new Intl.DateTimeFormat(this.intlDateTimeFormat || 'en-GB').format(new Date(dateString));
|
|
234
|
+
}
|
|
235
|
+
render() {
|
|
236
|
+
var _a, _b, _c, _d, _e;
|
|
237
|
+
if (this.hasErrors) {
|
|
238
|
+
return (index.h("div", { class: "BlogArticleDetails" }, index.h("div", { class: "Title" }, translate('error', this.language))));
|
|
239
|
+
}
|
|
240
|
+
if (!this.isLoading) {
|
|
241
|
+
return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "DetailsContainer" }, index.h("div", { class: "DetailsHeadWrapper" }, this.showPublishingDate && this.blogData.publishingDate &&
|
|
242
|
+
index.h("div", { class: "BlogDate" }, this.formatDate((_a = this.blogData) === null || _a === void 0 ? void 0 : _a.publishingDate)), this.showImage && (index.h("div", { class: "BlogBanner" }, ((_b = this.blogData.image) === null || _b === void 0 ? void 0 : _b.src) ? (index.h("div", { style: { background: `url(${this.setImage(this.blogData.image)}) no-repeat center center / cover` } })) : (((_c = this.blogData.video) === null || _c === void 0 ? void 0 : _c.sources[this.device]) ? (index.h("video", { src: this.blogData.video.sources[this.device], controls: true })) : (index.h("h1", { style: { color: "white" } }, "No Image")))))), index.h("div", { class: "DetailsBodyWrapper" }, this.showTitle &&
|
|
243
|
+
index.h("div", { class: "BlogTitle" }, (_d = this.blogData) === null || _d === void 0 ? void 0 : _d.title), this.showContent && this.renderContentConditionally((_e = this.blogData) === null || _e === void 0 ? void 0 : _e.content)))));
|
|
244
|
+
}
|
|
269
245
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}; }
|
|
246
|
+
static get watchers() { return {
|
|
247
|
+
"postId": ["watchEndpoint"],
|
|
248
|
+
"postSlug": ["watchEndpoint"],
|
|
249
|
+
"postCustomPath": ["watchEndpoint"],
|
|
250
|
+
"cmsEndpoint": ["watchEndpoint"],
|
|
251
|
+
"language": ["watchEndpoint"],
|
|
252
|
+
"clientStyling": ["handleStylingChange"],
|
|
253
|
+
"clientStylingUrl": ["handleStylingUrlChange"]
|
|
254
|
+
}; }
|
|
280
255
|
};
|
|
281
|
-
BlogArticleDetails.style =
|
|
256
|
+
BlogArticleDetails.style = BlogArticleDetailsStyle0;
|
|
282
257
|
|
|
283
258
|
exports.blog_article_details = BlogArticleDetails;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ade27b33.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
4
7
|
|
|
5
8
|
/*
|
|
6
|
-
Stencil Client Patch Browser
|
|
9
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var patchBrowser = () => {
|
|
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));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
patchBrowser().then(options => {
|
|
18
|
-
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
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);
|
|
19
23
|
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|