import{g as te,r as u,ao as k,cg as y,n as xe,a3 as ye,ar as Ae,h as O,E as J,ch as pe,aw as S,ci as h,H as Te}from"./CJgu5QJ3.js";/**
 * Vue 3 Carousel 0.3.3
 * (c) 2024
 * @license MIT
 */const d={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,i18n:{ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"}},me={itemsToShow:{default:d.itemsToShow,type:Number},itemsToScroll:{default:d.itemsToScroll,type:Number},wrapAround:{default:d.wrapAround,type:Boolean},throttle:{default:d.throttle,type:Number},snapAlign:{default:d.snapAlign,validator(e){return["start","end","center","center-even","center-odd"].includes(e)}},transition:{default:d.transition,type:Number},breakpoints:{default:d.breakpoints,type:Object},autoplay:{default:d.autoplay,type:Number},pauseAutoplayOnHover:{default:d.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:d.mouseDrag,type:Boolean},touchDrag:{default:d.touchDrag,type:Boolean},dir:{default:d.dir,validator(e){return["rtl","ltr"].includes(e)}},i18n:{default:d.i18n,type:Object},settings:{default(){return{}},type:Object}};function _e({config:e,slidesCount:a}){const{snapAlign:t,wrapAround:r,itemsToShow:l=1}=e;if(r)return Math.max(a-1,0);let o;switch(t){case"start":o=a-l;break;case"end":o=a-1;break;case"center":case"center-odd":o=a-Math.ceil((l-.5)/2);break;case"center-even":o=a-Math.ceil(l/2);break;default:o=0;break}return Math.max(o,0)}function Ce({config:e,slidesCount:a}){const{wrapAround:t,snapAlign:r,itemsToShow:l=1}=e;let o=0;if(t||l>a)return o;switch(r){case"start":o=0;break;case"end":o=l-1;break;case"center":case"center-odd":o=Math.floor((l-1)/2);break;case"center-even":o=Math.floor((l-2)/2);break;default:o=0;break}return o}function K({val:e,max:a,min:t}){return a<t?e:Math.min(Math.max(e,t),a)}function ke({config:e,currentSlide:a,slidesCount:t}){const{snapAlign:r,wrapAround:l,itemsToShow:o=1}=e;let g=a;switch(r){case"center":case"center-odd":g-=(o-1)/2;break;case"center-even":g-=(o-2)/2;break;case"end":g-=o-1;break}return l?g:K({val:g,max:t-o,min:0})}function he(e){return e?e.reduce((a,t)=>{var r;return t.type===Te?[...a,...he(t.children)]:((r=t.type)===null||r===void 0?void 0:r.name)==="CarouselSlide"?[...a,t]:a},[]):[]}function Q({val:e,max:a,min:t=0}){return e>a?Q({val:e-(a+1),max:a,min:t}):e<t?Q({val:e+(a+1),max:a,min:t}):e}function Me(e,a){let t;return a?function(...r){const l=this;t||(e.apply(l,r),t=!0,setTimeout(()=>t=!1,a))}:e}function Ne(e,a){let t;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{e(...r),t=null},a)}}function Oe(e="",a={}){return Object.entries(a).reduce((t,[r,l])=>t.replace(`{${r}}`,String(l)),e)}var je=te({name:"ARIA",setup(){const e=h("config",k(Object.assign({},d))),a=h("currentSlide",u(0)),t=h("slidesCount",u(0));return()=>S("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},Oe(e.i18n.itemXofY,{currentSlide:a.value+1,slidesCount:t.value}))}}),De=te({name:"Carousel",props:me,setup(e,{slots:a,emit:t,expose:r}){var l;const o=u(null),g=u([]),p=u(0),v=u(0),i=k(Object.assign({},d));let m=Object.assign({},d),b;const s=u((l=e.modelValue)!==null&&l!==void 0?l:0),M=u(0),I=u(0),A=u(0),j=u(0);let N,$;y("config",i),y("slidesCount",v),y("currentSlide",s),y("maxSlide",A),y("minSlide",j),y("slideWidth",p);function z(){b=Object.assign({},e.breakpoints),m=Object.assign(Object.assign(Object.assign({},m),e),{i18n:Object.assign(Object.assign({},m.i18n),e.i18n),breakpoints:void 0}),ne(m)}function D(){if(!b||!Object.keys(b).length)return;const n=Object.keys(b).map(c=>Number(c)).sort((c,x)=>+x-+c);let f=Object.assign({},m);n.some(c=>{const x=window.matchMedia(`(min-width: ${c}px)`).matches;return x&&(f=Object.assign(Object.assign({},f),b[c])),x}),ne(f)}function ne(n){Object.entries(n).forEach(([f,c])=>i[f]=c)}const ae=Ne(()=>{D(),R(),E()},16);function E(){if(!o.value)return;const n=o.value.getBoundingClientRect();p.value=n.width/i.itemsToShow}function R(){v.value<=0||(I.value=Math.ceil((v.value-1)/2),A.value=_e({config:i,slidesCount:v.value}),j.value=Ce({config:i,slidesCount:v.value}),i.wrapAround||(s.value=K({val:s.value,max:A.value,min:j.value})))}xe(()=>{ye(()=>E()),setTimeout(()=>E(),1e3),D(),le(),window.addEventListener("resize",ae,{passive:!0}),t("init")}),Ae(()=>{$&&clearTimeout($),N&&clearInterval(N),window.removeEventListener("resize",ae,{passive:!0})});let w=!1;const P={x:0,y:0},B={x:0,y:0},T=k({x:0,y:0}),V=u(!1),U=u(!1),Se=()=>{V.value=!0},we=()=>{V.value=!1};function ie(n){["INPUT","TEXTAREA","SELECT"].includes(n.target.tagName)||(w=n.type==="touchstart",w||n.preventDefault(),!(!w&&n.button!==0||_.value)&&(P.x=w?n.touches[0].clientX:n.clientX,P.y=w?n.touches[0].clientY:n.clientY,document.addEventListener(w?"touchmove":"mousemove",oe,!0),document.addEventListener(w?"touchend":"mouseup",re,!0)))}const oe=Me(n=>{U.value=!0,B.x=w?n.touches[0].clientX:n.clientX,B.y=w?n.touches[0].clientY:n.clientY;const f=B.x-P.x,c=B.y-P.y;T.y=c,T.x=f},i.throttle);function re(){const n=i.dir==="rtl"?-1:1,f=Math.sign(T.x)*.4,c=Math.round(T.x/p.value+f)*n;if(c&&!w){const x=ge=>{window.removeEventListener("click",x,!0)};window.addEventListener("click",x,!0)}C(s.value-c),T.x=0,T.y=0,U.value=!1,document.removeEventListener(w?"touchmove":"mousemove",oe,!0),document.removeEventListener(w?"touchend":"mouseup",re,!0)}function le(){!i.autoplay||i.autoplay<=0||(N=setInterval(()=>{i.pauseAutoplayOnHover&&V.value||X()},i.autoplay))}function se(){N&&(clearInterval(N),N=null),le()}const _=u(!1);function C(n){const f=i.wrapAround?n:K({val:n,max:A.value,min:j.value});s.value===f||_.value||(t("slide-start",{slidingToIndex:n,currentSlideIndex:s.value,prevSlideIndex:M.value,slidesCount:v.value}),_.value=!0,M.value=s.value,s.value=f,$=setTimeout(()=>{if(i.wrapAround){const c=Q({val:f,max:A.value,min:0});c!==s.value&&(s.value=c,t("loop",{currentSlideIndex:s.value,slidingToIndex:n}))}t("update:modelValue",s.value),t("slide-end",{currentSlideIndex:s.value,prevSlideIndex:M.value,slidesCount:v.value}),_.value=!1,se()},i.transition))}function X(){C(s.value+i.itemsToScroll)}function Y(){C(s.value-i.itemsToScroll)}const ue={slideTo:C,next:X,prev:Y};y("nav",ue),y("isSliding",_);const ce=O(()=>ke({config:i,currentSlide:s.value,slidesCount:v.value}));y("slidesToScroll",ce);const be=O(()=>{const n=i.dir==="rtl"?-1:1,f=ce.value*p.value*n;return{transform:`translateX(${T.x-f}px)`,transition:`${_.value?i.transition:0}ms`,margin:i.wrapAround?`0 -${v.value*p.value}px`:"",width:"100%"}});function de(){z(),D(),R(),E(),se()}Object.keys(me).forEach(n=>{["modelValue"].includes(n)||J(()=>e[n],de)}),J(()=>e.modelValue,n=>{n!==s.value&&C(Number(n))}),J(v,R),t("before-init"),z();const ve={config:i,slidesCount:v,slideWidth:p,next:X,prev:Y,slideTo:C,currentSlide:s,maxSlide:A,minSlide:j,middleSlide:I};r({updateBreakpointsConfigs:D,updateSlidesData:R,updateSlideWidth:E,initDefaultConfigs:z,restartCarousel:de,slideTo:C,next:X,prev:Y,nav:ue,data:ve});const H=a.default||a.slides,W=a.addons,fe=k(ve);return()=>{const n=he(H==null?void 0:H(fe)),f=(W==null?void 0:W(fe))||[];n.forEach((G,F)=>G.props.index=F);let c=n;if(i.wrapAround){const G=n.map((q,L)=>pe(q,{index:-n.length+L,isClone:!0,key:`clone-before-${L}`})),F=n.map((q,L)=>pe(q,{index:n.length+L,isClone:!0,key:`clone-after-${L}`}));c=[...G,...n,...F]}g.value=n,v.value=Math.max(n.length,1);const x=S("ol",{class:"carousel__track",style:be.value,onMousedownCapture:i.mouseDrag?ie:null,onTouchstartPassiveCapture:i.touchDrag?ie:null},c),ge=S("div",{class:"carousel__viewport"},x);return S("section",{ref:o,class:{carousel:!0,"is-sliding":_.value,"is-dragging":U.value,"is-hover":V.value,"carousel--rtl":i.dir==="rtl"},dir:i.dir,"aria-label":i.i18n.ariaGallery,tabindex:"0",onMouseenter:Se,onMouseleave:we},[ge,f,S(je)])}}}),Z;(function(e){e.arrowUp="arrowUp",e.arrowDown="arrowDown",e.arrowRight="arrowRight",e.arrowLeft="arrowLeft"})(Z||(Z={}));const Ee={arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z",arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"};function Le(e){return e in Z}const ee=e=>{const a=h("config",k(Object.assign({},d))),t=String(e.name),r=`icon${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!t||typeof t!="string"||!Le(t))return;const l=Ee[t],o=S("path",{d:l}),g=a.i18n[r]||e.title||t,p=S("title",g);return S("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":g},[p,o])};ee.props={name:String,title:String};const Re=(e,{slots:a,attrs:t})=>{const{next:r,prev:l}=a||{},o=h("config",k(Object.assign({},d))),g=h("maxSlide",u(1)),p=h("minSlide",u(1)),v=h("currentSlide",u(1)),i=h("nav",{}),{dir:m,wrapAround:b,i18n:s}=o,M=m==="rtl",I=S("button",{type:"button",class:["carousel__prev",!b&&v.value<=p.value&&"carousel__prev--disabled",t==null?void 0:t.class],"aria-label":s.ariaPreviousSlide,onClick:i.prev},(l==null?void 0:l())||S(ee,{name:M?"arrowRight":"arrowLeft"})),A=S("button",{type:"button",class:["carousel__next",!b&&v.value>=g.value&&"carousel__next--disabled",t==null?void 0:t.class],"aria-label":s.ariaNextSlide,onClick:i.next},(r==null?void 0:r())||S(ee,{name:M?"arrowLeft":"arrowRight"}));return[I,A]};var Pe=te({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:a}){const t=h("config",k(Object.assign({},d))),r=h("currentSlide",u(0)),l=h("slidesToScroll",u(0)),o=h("isSliding",u(!1)),g=O(()=>e.index===r.value),p=O(()=>e.index===r.value-1),v=O(()=>e.index===r.value+1),i=O(()=>{const m=Math.floor(l.value),b=Math.ceil(l.value+t.itemsToShow-1);return e.index>=m&&e.index<=b});return()=>{var m;return S("li",{style:{width:`${100/t.itemsToShow}%`},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":i.value,"carousel__slide--active":g.value,"carousel__slide--prev":p.value,"carousel__slide--next":v.value,"carousel__slide--sliding":o.value},"aria-hidden":!i.value},(m=a.default)===null||m===void 0?void 0:m.call(a,{isActive:g.value,isClone:e.isClone,isPrev:p.value,isNext:v.value,isSliding:o.value,isVisible:i.value}))}}});export{De as C,Re as N,Pe as S};