1import{g as I}from"./lodash-de8cc594.js";import{_ as V}from"./ArticleCard.vue_vue_type_script_setup_true_lang-4b4f34e4.js";import{a0 as w,ag as D,f as F,D as l,E as _,J as m,G as C,u as t,b2 as N,aC as U,b3 as P,P as R,S as T,U as j,F as S,Z as G,az as H,I as J,r as p}from"./vendor-0404560d.js";import{k as O,l as Q,m as Z,u as q,i as K,a as W}from"./index-afea52c0.js";import"./axios-c3c6769d.js";import"./BaseTags.vue_vue_type_script_setup_true_lang-b27991b9.js";import"./vee-validate-378e8b8c.js";import"./swiper-0a0ef14b.js";/*! @license Third-party license notices: /dist/velux-marketing/client/THIRD_PARTY_NOTICES.txt */const X=12;function Y(){const c=O(),{logErrorMessage:s}=Q(),a={articlesAndStories:`${c.apiHost}/api/velux/magazine/GetArticlesAndStories`};return{getArticlesAndStories:async(n=[],d={page:0,contextItemId:""})=>{const{page:u,contextItemId:o}=d,g=o?`&contextItemId=${encodeURIComponent(o)}`:"";try{const{data:r}=await Z(`${a.articlesAndStories}?${n.length?`tags=${n}&`:""}page=${u}${g}`);return r}catch{s({message:"Error during fetching articles and stories",componentName:"ArticlesAndStoriesList"})}}}}const ee=["data-section-name"],te={class:"vlx-grid-24 gap-y-12 sm:gap-y-10 md:gap-y-16"},ue=w({__name:"ArticlesAndStoriesList",props:{rendering:{},fields:{default:()=>({articles:{value:[]},headline:{value:""},description:{value:""},hideAuthor:{value:!1},parentCategory:{id:null}})}},setup(c){const s=q(),a=c,{getArticlesAndStories:f}=Y(),{isMobile:n}=K(),{t:d}=D(),{renderingIndex:u}=W(),o=F(()=>a.rendering?.uid||""),{articles:g,headline:r,description:b,hideAuthor:k}=a.fields,i=p(g||[]),h=p(0),v=p(!0),L=a?.fields?.parentCategory?.id||null,$=I(s,"routeData.fields.Category.id",null),z=I(s,"routeData.itemId",""),B=[$,L].filter(e=>e),E=e=>n.value&&e%3===0,M=async()=>{h.value+=1;const e=await f(B,{page:h.value,contextItemId:z})||[];A(e.length),i.value=[...i.value,...e]},A=e=>{e<X&&(v.value=!1)};return A(i.value.length),(e,ae)=>(l(),_("div",{"data-section-name":t(u)(o.value).id,class:"px-6 sm:px-10 lg:px-9 lg:pb-30 md:pb-25 pb-16 grid gap-y-12 md:gap-y-20"},[m(t(P),{"show-line":"","data-test":"heading-and-body-container"},{heading:C(()=>[m(t(N),{field:t(r)?.value,size:"m"},null,8,["field"])]),body:C(()=>[m(t(U),{field:t(b)?.value,size:"s","data-as-attribute":"content"},null,8,["field"])]),_:1}),R("div",te,[(l(!0),_(T,null,j(i.value,(y,x)=>(l(),S(V,G({key:y.id},{ref_for:!0},y,{"is-single-column":E(x),"hide-author":t(k)?.value,"data-test-id":`article-card-${x}`,class:"sm:col-span-4 md:col-span-6","tags-custom-classes":"flex-wrap gap-y-2"}),null,16,["is-single-column","hide-author","data-test-id"]))),128))]),v.value?(l(),S(t(H),{key:0,class:"mx-auto",variant:"secondary","data-test-id":"load-more",text:t(d)("Feature/Magazine/Article List/Load more"),onHandleClick:M},null,8,["text"])):J("",!0)],8,ee))}});export{ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.