import{defineComponent as k,ref as $,computed as a,watchEffect as E,createVNode as f}from"vue";import v from"../_util/classNames.mjs";import{withInstall as I,booleanType as e,stringType as n,functionType as c}from"../_util/type.mjs";import m from"../_util/vue-types/index.mjs";import M from"../_util/warning.mjs";import O from"../config-provider/hooks/useConfigInject.mjs";import G from"../vc-slick/slider.mjs";import H from"./style/index.mjs";const R=()=>({effect:n(),dots:e(!0),vertical:e(),autoplay:e(),easing:String,beforeChange:c(),afterChange:c(),prefixCls:String,accessibility:e(),nextArrow:m.any,prevArrow:m.any,pauseOnHover:e(),adaptiveHeight:e(),arrows:e(!1),autoplaySpeed:Number,centerMode:e(),centerPadding:String,cssEase:String,dotsClass:String,draggable:e(!1),fade:e(),focusOnSelect:e(),infinite:e(),initialSlide:Number,lazyLoad:n(),rtl:e(),slide:String,slidesToShow:Number,slidesToScroll:Number,speed:Number,swipe:e(),swipeToSlide:e(),swipeEvent:c(),touchMove:e(),touchThreshold:Number,variableWidth:e(),useCSS:e(),slickGoTo:Number,responsive:Array,dotPosition:n(),verticalSwiping:e(!1)}),j=k({compatConfig:{MODE:3},name:"ACarousel",inheritAttrs:!1,props:R(),setup(t,{slots:g,attrs:S,expose:p}){const o=$();p({goTo:(r,l=!1)=>{o.value?.slickGoTo(r,l)},autoplay:r=>{o.value?.innerSlider?.handleAutoPlay(r)},prev:()=>{o.value?.slickPrev()},next:()=>{o.value?.slickNext()},innerSlider:a(()=>o.value?.innerSlider)}),E(()=>{M(t.vertical===void 0)});const{prefixCls:s,direction:h}=O("carousel",t),[b,y]=H(s),i=a(()=>t.dotPosition?t.dotPosition:t.vertical!==void 0&&t.vertical?"right":"bottom"),u=a(()=>i.value==="left"||i.value==="right"),C=a(()=>{const r="slick-dots";return v({[r]:!0,[`${r}-${i.value}`]:!0,[`${t.dotsClass}`]:!!t.dotsClass})});return()=>{const{dots:r,arrows:l,draggable:w,effect:T}=t,{class:d,style:N,...P}=S,x=T==="fade"?!0:t.fade,A=v(s.value,{[`${s.value}-rtl`]:h.value==="rtl",[`${s.value}-vertical`]:u.value,[`${d}`]:!!d},y.value);return b(f("div",{class:A,style:N},[f(G,{ref:o,...t,...P,dots:!!r,dotsClass:C.value,arrows:l,draggable:w,fade:x,vertical:u.value},g)]))}}}),K=I(j);export{R as carouselProps,K as default};
