import"./swiper-bundle-D10wXgdm.js";import{S as z}from"./swiper-core-BbUUCioi.js";import{d as C,r as f,l as _,ae as E,D as m,w as L,c as l,h as y,o as d,b as t,n as r,F as W,p as F,A as g}from"./app-DJb_CRLj.js";const H=["id"],V={class:"row"},$={class:"col-12 swiper-container"},D={class:"swiper-wrapper"},I=["href"],M=["src","alt"],x=C({__name:"SliderType4",props:{status:{},component_id:{},data:{}},setup(b){const n=b,u=f(typeof window<"u"?window.innerWidth:1024),p=()=>{u.value=window.innerWidth};_(()=>{p(),window.addEventListener("resize",p)}),E(()=>{window.removeEventListener("resize",p)});const k=m(()=>{const e=n.data.style;if(!e)return"400px";const s=e.desktop_height??400,i=e.mobile_height??115;return u.value<=768?`${i}px`:`${s}px`}),o=m(()=>{const e=u.value<=768;return n.data.slider.filter(s=>e?s.show_on_mobile??!0:s.show_on_desktop??!0)}),S=m(()=>n.data.slider.every(e=>e.show_on_desktop===void 0&&e.show_on_mobile===void 0)),v=f(!1);let c=null;const w=()=>{c&&c.destroy(!0,!0),c=new z(".swiper-main-slider-"+n.component_id,{slidesPerView:1,effect:"fade",loop:o.value.length>1,fadeEffect:{crossFade:!0},spaceBetween:10,autoplay:{delay:7e3},pagination:{el:".swiper-pagination",type:"bullets",clickable:!0,dynamicBullets:!1},observer:!0,observeParents:!0,observeSlideChildren:!0,on:{init:()=>v.value=!0}})};return _(()=>{w()}),L(o,()=>{setTimeout(()=>w(),50)}),(e,s)=>{var i,h;return o.value.length>0||S.value?(d(),l("div",{key:0,id:"component-"+e.component_id,class:r({"full-slider container overflow-hidden":!0,readonly:e.status==="dev"}),style:g("margin-top:"+(((i=e.data.style)==null?void 0:i.margin.top)??0)+"px; margin-bottom:"+(((h=e.data.style)==null?void 0:h.margin.bottom)??20)+"px;")},[t("div",V,[t("div",$,[t("div",{class:r("swiper br-0 swiper-main-slider swiper-main-slider-"+n.component_id)},[t("div",D,[(d(!0),l(W,null,F(o.value,(a,B)=>(d(),l("div",{key:B,class:r({"swiper-slide":!0,readonly:e.status==="dev"})},[t("a",{href:a.link},null,8,I),t("div",{class:r({"image br-0":!0,"sk sk-super-dark":!v.value}),style:g({backgroundImage:`url(${a.src})`,height:k.value+" !important"})},null,6),t("img",{src:a.src,alt:a.alt,class:"d-none"},null,8,M)],2))),128)),o.value.length===0?(d(),l("div",{key:0,class:r({"swiper-slide":!0,readonly:e.status==="dev"})},s[0]||(s[0]=[t("div",{class:"image br-0"},null,-1)]),2)):y("",!0)]),s[1]||(s[1]=t("div",{class:"swiper-pagination"},null,-1))],2)])])],14,H)):y("",!0)}}});export{x as default};
