1import{s as K,B as x,W as B,Y as c,A as _,i as Q,N as Se,H as be,Q as ye,aj as G,h as ve,F as xe,S as h}from"./BR6L9CYU.js";const f={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,snapAlign:"center",wrapAround:!1,throttle:16,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,dir:"ltr",breakpoints:void 0},fe={itemsToShow:{default:f.itemsToShow,type:Number},itemsToScroll:{default:f.itemsToScroll,type:Number},wrapAround:{default:f.wrapAround,type:Boolean},throttle:{default:f.throttle,type:Number},snapAlign:{default:f.snapAlign,validator(t){return["start","end","center","center-even","center-odd"].includes(t)}},transition:{default:f.transition,type:Number},breakpoints:{default:f.breakpoints,type:Object},autoplay:{default:f.autoplay,type:Number},pauseAutoplayOnHover:{default:f.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:f.mouseDrag,type:Boolean},touchDrag:{default:f.touchDrag,type:Boolean},dir:{default:f.dir,validator(t){return["rtl","ltr"].includes(t)}},settings:{default(){return{}},type:Object}};function we({config:t,slidesCount:n}){const{snapAlign:a,wrapAround:i,itemsToShow:s=1}=t;if(i)return Math.max(n-1,0);let r;switch(a){case"start":r=n-s;break;case"end":r=n-1;break;case"center":case"center-odd":r=n-Math.ceil((s-.5)/2);break;case"center-even":r=n-Math.ceil(s/2);break;default:r=0;break}return Math.max(r,0)}function Te({config:t,slidesCount:n}){const{wrapAround:a,snapAlign:i,itemsToShow:s=1}=t;let r=0;if(a||s>n)return r;switch(i){case"start":r=0;break;case"end":r=s-1;break;case"center":case"center-odd":r=Math.floor((s-1)/2);break;case"center-even":r=Math.floor((s-2)/2);break;default:r=0;break}return r}function q({val:t,max:n,min:a}){return n<a?t:Math.min(Math.max(t,a),n)}function Ae({config:t,currentSlide:n,slidesCount:a}){const{snapAlign:i,wrapAround:s,itemsToShow:r=1}=t;let p=n;switch(i){case"center":case"center-odd":p-=(r-1)/2;break;case"center-even":p-=(r-2)/2;break;case"end":p-=r-1;break}return s?p:q({val:p,max:a-r,min:0})}function me(t){return t?t.reduce((n,a)=>{var i;return a.type===xe?[...n,...me(a.children)]:((i=a.type)===null||i===void 0?void 0:i.name)==="CarouselSlide"?[...n,a]:n},[]):[]}function J({val:t,max:n,min:a=0}){return t>n?J({val:t-(n+1),max:n,min:a}):t<a?J({val:t+(n+1),max:n,min:a}):t}function ke(t,n){let a;return n?function(...i){const s=this;a||(t.apply(s,i),a=!0,setTimeout(()=>a=!1,n))}:t}function Ce(t,n){let a;return function(...i){a&&clearTimeout(a),a=setTimeout(()=>{t(...i),a=null},n)}}var _e=K({name:"ARIA",setup(){const t=x("currentSlide",c(0)),n=x("slidesCount",c(0));return()=>_("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},`Item ${t.value+1} of ${n.value}`)}}),Ee=K({name:"Carousel",props:fe,setup(t,{slots:n,emit:a,expose:i}){var s;const r=c(null),p=c([]),g=c(0),v=c(0);let w=c({}),T=Object.assign({},f);const l=B(Object.assign({},T)),o=c((s=t.modelValue)!==null&&s!==void 0?s:0),M=c(0),Z=c(0),A=c(0),E=c(0);let k,P;h("config",l),h("slidesCount",v),h("currentSlide",o),h("maxSlide",A),h("minSlide",E),h("slideWidth",g);function $(){const e=Object.assign(Object.assign({},t),t.settings);w=c(Object.assign({},e.breakpoints)),T=Object.assign(Object.assign({},e),{settings:void 0,breakpoints:void 0}),ee(T)}function j(){if(!Object.keys(w.value).length)return;const e=Object.keys(w.value).map(u=>Number(u)).sort((u,y)=>+y-+u);let d=Object.assign({},T);e.some(u=>window.matchMedia(`(min-width: ${u}px)`).matches?(d=Object.assign(Object.assign({},d),w.value[u]),!0):!1),ee(d)}function ee(e){Object.entries(e).forEach(([d,u])=>l[d]=u)}const te=Ce(()=>{j(),O(),N()},16);function N(){if(!r.value)return;const e=r.value.getBoundingClientRect();g.value=e.width/l.itemsToShow}function O(){v.value<=0||(Z.value=Math.ceil((v.value-1)/2),A.value=we({config:l,slidesCount:v.value}),E.value=Te({config:l,slidesCount:v.value}),l.wrapAround||(o.value=q({val:o.value,max:A.value,min:E.value})))}Se(()=>{be(()=>setTimeout(()=>{j(),O(),N(),a("init")},16)),re(),window.addEventListener("resize",te,{passive:!0})}),ye(()=>{P&&clearTimeout(P),k&&clearInterval(k),window.removeEventListener("resize",te,{passive:!0})});let m=!1;const D={x:0,y:0},L={x:0,y:0},S=B({x:0,y:0}),R=c(!1),pe=()=>{R.value=!0},he=()=>{R.value=!1};function ne(e){["INPUT","TEXTAREA","SELECT"].includes(e.target.tagName)||(m=e.type==="touchstart",m||e.preventDefault(),!(!m&&e.button!==0||C.value)&&(D.x=m?e.touches[0].clientX:e.clientX,D.y=m?e.touches[0].clientY:e.clientY,document.addEventListener(m?"touchmove":"mousemove",ae,!0),document.addEventListener(m?"touchend":"mou
1seup",le,!0)))}const ae=ke(e=>{L.x=m?e.touches[0].clientX:e.clientX,L.y=m?e.touches[0].clientY:e.clientY;const d=L.x-D.x,u=L.y-D.y;S.y=u,S.x=d},l.throttle);function le(){const e=l.dir==="rtl"?-1:1,d=Math.sign(S.x)*.4,u=Math.round(S.x/g.value+d)*e;if(u&&!m){const y=Y=>{Y.stopPropagation(),window.removeEventListener("click",y,!0)};window.addEventListener("click",y,!0)}b(o.value-u),S.x=0,S.y=0,document.removeEventListener(m?"touchmove":"mousemove",ae,!0),document.removeEventListener(m?"touchend":"mouseup",le,!0)}function re(){!l.autoplay||l.autoplay<=0||(k=setInterval(()=>{l.pauseAutoplayOnHover&&R.value||V()},l.autoplay))}function oe(){k&&(clearInterval(k),k=null),re()}const C=c(!1);function b(e){const d=l.wrapAround?e:q({val:e,max:A.value,min:E.value});o.value===d||C.value||(a("slide-start",{slidingToIndex:e,currentSlideIndex:o.value,prevSlideIndex:M.value,slidesCount:v.value}),C.value=!0,M.value=o.value,o.value=d,P=setTimeout(()=>{if(l.wrapAround){const u=J({val:d,max:A.value,min:0});u!==o.value&&(o.value=u,a("loop",{currentSlideIndex:o.value,slidingToIndex:e}))}a("update:modelValue",o.value),a("slide-end",{currentSlideIndex:o.value,prevSlideIndex:M.value,slidesCount:v.value}),C.value=!1,oe()},l.transition))}function V(){b(o.value+l.itemsToScroll)}function W(){b(o.value-l.itemsToScroll)}const ie={slideTo:b,next:V,prev:W};h("nav",ie),h("isSliding",C);const se=Q(()=>Ae({config:l,currentSlide:o.value,slidesCount:v.value}));h("slidesToScroll",se);const ge=Q(()=>{const e=l.dir==="rtl"?-1:1,d=se.value*g.value*e;return{transform:`translateX(${S.x-d}px)`,transition:`${C.value?l.transition:0}ms`,margin:l.wrapAround?`0 -${v.value*g.value}px`:"",width:"100%"}});function ue(){$(),j(),O(),N(),oe()}Object.keys(fe).forEach(e=>{["modelValue"].includes(e)||G(()=>t[e],ue)}),G(()=>t.modelValue,e=>{e!==o.value&&b(Number(e))}),G(v,O),$();const ce={config:l,slidesCount:v,slideWidth:g,next:V,prev:W,slideTo:b,currentSlide:o,maxSlide:A,minSlide:E,middleSlide:Z};i({updateBreakpointsConfigs:j,updateSlidesData:O,updateSlideWidth:N,initDefaultConfigs:$,restartCarousel:ue,slideTo:b,next:V,prev:W,nav:ie,data:ce});const X=n.default||n.slides,H=n.addons,de=B(ce);return()=>{const e=me(X?.(de)),d=H?.(de)||[];e.forEach((z,F)=>z.props.index=F);let u=e;if(l.wrapAround){const z=e.map((U,I)=>ve(U,{index:-e.length+I,isClone:!0,key:`clone-before-${I}`})),F=e.map((U,I)=>ve(U,{index:e.length+I,isClone:!0,key:`clone-after-${I}`}));u=[...z,...e,...F]}p.value=e,v.value=Math.max(e.length,1);const y=_("ol",{class:"carousel__track",style:ge.value,onMousedownCapture:l.mouseDrag?ne:null,onTouchstartPassiveCapture:l.touchDrag?ne:null},u),Y=_("div",{class:"carousel__viewport"},y);return _("section",{ref:r,class:{carousel:!0,"carousel--rtl":l.dir==="rtl"},dir:l.dir,"aria-label":"Gallery",tabindex:"0",onMouseenter:pe,onMouseleave:he},[Y,d,_(_e)])}}}),Oe=K({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(t,{slots:n}){const a=x("config",B(Object.assign({},f))),i=x("currentSlide",c(0)),s=x("slidesToScroll",c(0)),r=x("slideWidth",c(0)),p=x("isSliding",c(!1)),g=Q(()=>({width:r.value?`${r.value}px`:"100%"})),v=()=>t.index===i.value,w=()=>t.index===i.value-1,T=()=>t.index===i.value+1,l=()=>{const o=Math.floor(s.value),M=Math.ceil(s.value+a.itemsToShow-1);return t.index>=o&&t.index<=M};return()=>{var o;return _("li",{style:g.value,class:{carousel__slide:!0,"carousel_slide--clone":t.isClone,"carousel__slide--visible":l(),"carousel__slide--active":v(),"carousel__slide--prev":w(),"carousel__slide--next":T(),"carousel__slide--sliding":p.value},"aria-hidden":!l()},(o=n.default)===null||o===void 0?void 0:o.call(n))}}});export{Ee as C,Oe as S};
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.