1import{f as B,a as E,D as p,E as w,F as I,G as N,H as V,$,P as u,K as x,V as j,I as M,r as l}from"./vendor-a0789617.js";import"./axios-bb6ee5b8.js";import"./lodash-86ed0c75.js";/*! @license Third-party license notices: /dist/velux-marketing/client/THIRD_PARTY_NOTICES.txt */const q={class:"vlx-carousel col-span-5 relative"},D={key:0,class:"flex w-14 justify-between absolute top-2 left-2"},O=["disabled"],R=["disabled"],G={__name:"CarouselItem",props:{tag:{type:String,default:"ul"},imageCount:{type:Number,required:!0}},setup(g){const n=l(!0),m=l(!1),s=l([]),i=l(0),c=l(0),d=l(0),y=l(0),o=l(0),a=l(null),b=B(()=>n.value?"cursor-not-allowed":"cursor-pointer"),C=()=>{a.value&&(k(),L(),f())},W=()=>{a.value&&f()},k=()=>{i.value=a.value.scrollWidth,c.value=a.value.offsetWidth},L=()=>{const e=[...a.value.children];s.value=e.map(t=>({offsetLeft:t.offsetLeft,width:t.offsetWidth}))},r=(e,t,v)=>Math.abs(e-t)<=v,P=()=>r(o.value+c.value,i.value,5)?s.value.length-1:s.value.findIndex(e=>r(e.offsetLeft,o.value,5)),f=e=>{const t=e!==void 0?e:P();t<0||(y.value=d.value,d.value=t>0?t:0)},S=()=>{const e=r(o.value,0,5),t=r(i.value-c.value,o.value,5);n.value=e,m.value=t},h=e=>{W(),_(d.value+e)},_=e=>{s.value[e]&&(a.value.scrollTo({left:s.value[e].offsetLeft,behavior:"smooth"}),o.value=s.value[e].offsetLeft,S(),f(e))};return E(()=>{C()}),(e,t)=>(p(),w("div",q,[(p(),I($(g.tag),{ref_key:"carouselWrapper",ref:a,class:"flex overflow-hidden snap-mandatory snap-x"},{default:N(()=>[V(e.$slots,"default")]),_:3},512)),g.imageCount>1?(p(),w("div",D,[u("button",{type:"button",disabled:n.value,class:x([b.value,"border-old_velux-black border-2 rounded-full h-[25px] w-[25px] flex items-center justify-center text-12"]),onClick:t[0]||(t[0]=v=>h(-1))},[...t[2]||(t[2]=[u("i",{class:"fa-regular fa-arrow-left"},null,-1)])],10,O),u("button",{type:"button",disabled:m.value,class:x([b.value,"border-old_velux-black border-2 rounded-full h-[25px] w-[25px] flex items-center justify-center text-12"]),onClick:t[1]||(t[1]=j(v=>h(1),["prevent"]))},[...t[3]||(t[3]=[u("i",{class:"fa-regular fa-arrow-right"},null,-1)])],10,R)])):M("",!0)]))}};export{G 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.