const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D8gWJXbr.js","assets/vendor-3e8OGtgt.js","assets/vendor-DXOeSP1F.css","assets/index-D7GD6xz2.css"])))=>i.map(i=>d[i]);
import{F as E,aL as W,P as m,Q as i,R as s,T as v,_ as c,W as u,X as V,a0 as r,a6 as q,a7 as z,a1 as S,a2 as C,e as p,Z as O,aQ as x,ag as F,r as N,m as f,aw as G,bW as H,as as Q,az as X,ad as Y}from"./vendor-3e8OGtgt.js";import{g as j,q as J,H as T,j as Z,I as ee,U as te,J as se,K as b}from"./index-D8gWJXbr.js";import{u as ae}from"./useBreadcrumbs-BxQi8Ezg.js";import{N as ne,i as oe}from"./index-Pcib4pjH.js";async function le(_){const{storeId:d,cultureName:l}=j,{data:w}=await J.query({query:ne,variables:{storeId:d,languageCode:l,..._}});return w.newsArticle}const ce={class:"news-article-content"},re={class:"news-article-content__title"},ie={class:"news-article-content__tags"},ue={key:1,class:"news-article-content__citation"},_e={key:0,class:"news-article-content__citation-author"},de={key:1,class:"news-article-content__citation-publish-date"},ve=E({__name:"news-article-content",props:{newsArticle:{}},emits:["tag:click","author:click"],setup(_,{emit:d}){const l=d,e=W(_,"newsArticle");return(t,a)=>{const k=m("VcChip"),g=m("VcImage");return s(),i("div",ce,[v("div",re,r(e.value.title),1),v("div",ie,[(s(!0),i(q,null,z(e.value.tags,n=>(s(),c(k,{key:n,color:"secondary",variant:"outline-dark",class:"news-article-content__tag",clickable:"",onClick:y=>l("tag:click",n)},{default:S(()=>[C(r(n),1)]),_:2},1032,["onClick"]))),128))]),e.value.contentPreview?(s(),c(p(T),{key:0,class:O(p(oe)(e.value.contentPreview)?"news-article-content__preview-image":"news-article-content__preview"),src:e.value.contentPreview},null,8,["class","src"])):u("",!0),e.value.author||e.value.publishDate?(s(),i("div",ue,[e.value.author?(s(),i("div",_e,[e.value.author.iconUrl?(s(),c(g,{key:0,src:e.value.author.iconUrl,lazy:"",class:"news-article-content__citation-author-image"},null,8,["src"])):u("",!0),v("span",null,[C(r(t.$t("news.details.written-by"))+" ",1),v("button",{class:"news-article-content__citation-author-name",type:"button",onClick:a[0]||(a[0]=n=>l("author:click",e.value.author.id)),onKeyup:a[1]||(a[1]=x(n=>l("author:click",e.value.author.id),["enter"]))},r(e.value.author.name),33)])])):u("",!0),a[2]||(a[2]=v("div",null,null,-1)),e.value.publishDate?(s(),i("div",de,r(t.$t("news.details.last-updated"))+" "+r(t.$d(e.value.publishDate,"short")),1)):u("",!0)])):u("",!0),V(p(T),{src:e.value.content??"",class:"news-article-content__content"},null,8,["src"])])}}}),me={class:"news-article"},fe=E({__name:"news-article",props:{articleId:{}},setup(_){const d=_,l=X(()=>Y(()=>import("./index-D8gWJXbr.js").then(o=>o.dr),__vite__mapDeps([0,1,2,3]))),{t:w}=F(),e=N(!1),t=N(),{getSettingValue:a}=Z(ee),k=a(te),g=f(()=>t.value?.seoInfo?.pageTitle||t.value?.title),{title:n}=se(g),y=f(()=>t.value?.seoInfo?.metaDescription),$=f(()=>t.value?.seoInfo?.metaKeywords),U=f(()=>t.value?.seoInfo?.semanticUrl?k?`${window.location.host}/${b.LINK_SEGMENT}/${t.value?.seoInfo?.semanticUrl}`:`${window.location.host}/${t.value?.seoInfo?.semanticUrl}`:window.location.toString()),D=ae(()=>[{title:w("news.details.breadcrumbs.news"),route:"/news"},{title:g.value??""}]),A=G();function B(o){A.push({name:b.ARTICLES_BY_TAG.NAME,params:{tag:o}})}function L(o){A.push({name:b.ARTICLES_BY_AUTHOR.NAME,params:{authorId:o}})}const P=async()=>{e.value=!0;const o=await le({id:d.articleId});t.value=o,e.value=!1};return H({title:()=>n.value,keywords:()=>$.value,description:()=>y.value,ogUrl:()=>U.value,ogTitle:()=>n.value,ogDescription:()=>y.value,ogType:()=>"website"}),Q(P),(o,h)=>{const R=m("VcBreadcrumbs"),K=m("VcWidgetSkeleton"),M=m("VcContainer");return s(),i("div",me,[!e.value&&!t.value?(s(),c(p(l),{key:0})):(s(),c(M,{key:1},{default:S(()=>[V(R,{class:"news-article__breadcrumbs",items:p(D)},null,8,["items"]),e.value?(s(),c(K,{key:0,head:"",size:"lg"})):t.value?(s(),c(ve,{key:1,"news-article":t.value,"onTag:click":h[0]||(h[0]=I=>B(I)),"onAuthor:click":h[1]||(h[1]=I=>L(I))},null,8,["news-article"])):u("",!0)]),_:1}))])}}});export{fe as default};
//# sourceMappingURL=news-article-8zlMAolv.js.map
