import{R as L,r as l,C as te,s as c,x as T,J as Re,a1 as Ee,a2 as Me,a3 as We,a4 as ke,v as me,w as De,Z as ze,$ as Fe}from"./index.6254441a.js";var ee=globalThis&&globalThis.__assign||function(){return ee=Object.assign||function(e){for(var a,r=1,n=arguments.length;r0)&&!(t=n.next()).done;)d.push(t.value)}catch(x){u={error:x}}finally{try{t&&!t.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return d},qe=3e3,Be={animation:"slide",indicatorType:"dot",indicatorPosition:"bottom",direction:"horizontal",showArrow:"always",trigger:"click",moveSpeed:500,timingFunc:"cubic-bezier(0.34, 0.69, 0.1, 1)"};function Ge(e,a){var r,n,t=l.exports.useContext(te),d=t.getPrefixCls,u=t.componentConfig,x=t.rtl,i=De(e,Be,u==null?void 0:u.Carousel),N=i.style,p=i.className,w=i.children,C=i.currentIndex,g=i.animation,E=i.trigger,M=i.direction,_=i.moveSpeed,y=i.timingFunc,W=i.indicatorType,k=i.indicatorPosition,A=i.indicatorClassName,U=i.showArrow,P=i.miniRender,J=i.arrowClassName,q=i.carousel,V=i.icons,D=i.onChange,he=Je(i,["style","className","children","currentIndex","animation","trigger","direction","moveSpeed","timingFunc","indicatorType","indicatorPosition","indicatorClassName","showArrow","miniRender","arrowClassName","carousel","icons","onChange"]),h=i.autoPlay;h&&i.autoPlaySpeed&&(h={interval:i.autoPlaySpeed});var ae=L.Children.toArray(w).filter(function(o){return L.isValidElement(o)}),z=ae.length,ne=l.exports.useRef(null),H=l.exports.useRef(null),K=l.exports.useRef(null),ie=F(l.exports.useState(typeof C=="number"?$(C):0),2),B=ie[0],be=ie[1],oe=F(l.exports.useState(B),2),xe=oe[0],we=oe[1],se=F(l.exports.useState(!1),2),Ce=se[0],le=se[1],ce=F(l.exports.useState(!1),2),G=ce[0],ue=ce[1],ve=F(l.exports.useState(null),2),Q=ve[0],Ie=ve[1],de=F(l.exports.useState({sliderWrapper:null,indicatorWrapper:null}),2),fe=de[0],pe=de[1],I=typeof C=="number"?$(C):B,X=$(I-1),Z=$(I+1),Ne=typeof h=="object"&&h.interval?h.interval:qe;l.exports.useEffect(function(){return function(){return K.current&&clearTimeout(K.current)}},[]),l.exports.useEffect(function(){O({targetIndex:I})},[I]);var _e=Ye(function(){O({targetIndex:Z})},h&&!Ce&&z>1?Ne:null);l.exports.useImperativeHandle(q,function(){return{dom:ne.current,goto:function(o){var s=o.index,v=o.isNegative,m=o.isManual,b=o.resetAutoPlayInterval;O({targetIndex:$(s),isNegative:v,isManual:m,resetAutoPlayInterval:b})}}});function $(o){var s=+o;return typeof s=="number"&&!isNaN(s)?(s+z)%z:o}function O(o){var s=o.targetIndex,v=o.isNegative,m=v===void 0?!1:v,b=o.isManual,S=b===void 0?!1:b,j=o.resetAutoPlayInterval,R=j===void 0?!1:j;!G&&s!==I&&(ue(!0),be(s),we(B),Ie(m?"negative":"positive"),D&&D(s,I,S),h&&R&&_e(),K.current=setTimeout(function(){ue(!1),K.current=null},_))}function Pe(){if(g==="card"){if(H.current){var o=H.current.children[0];if(!o)return;var s=H.current.clientWidth,v=o.clientWidth,m=(s-v)/2,b=200,S=s/2,j=v,R=S+50>=j?b*4:b*S/(j-S);pe({sliderWrapper:{perspective:R},indicatorWrapper:{width:"auto",left:m,right:m}})}}else pe({sliderWrapper:null,indicatorWrapper:null})}var f=d("carousel"),Se=T(f,f+"-indicator-position-"+k,(r={},r[f+"-rtl"]=x,r),p),Te=Object.assign({},h&&(typeof h!="object"||h.hoverToPause!==!1)?{onMouseEnter:function(){return le(!0)},onMouseLeave:function(){return le(!1)}}:null);return c(ze,{onResize:Pe,children:me("div",{...re({ref:function(o){a=o,ne.current=a},className:Se,style:N},Fe(he,["autoplay","autoPlaySpeed"]),Te),children:[c("div",{ref:H,style:fe.sliderWrapper,className:T(f+"-"+g,f+"-"+M,(n={},n[f+"-negative"]=Q==="negative",n)),children:ae.map(function(o,s){var v,m=s===I,b=s===X,S=s===Z,j=!P||m||b||S;if(!j)return null;var R=o.props,Ae=R.style,Oe=R.className,ge=R.onClick;return L.cloneElement(o,{"aria-hidden":!m,style:Object.assign({transitionTimingFunction:y,transitionDuration:_+"ms",animationTimingFunction:y,animationDuration:_+"ms"},Ae),className:T(Oe,(v={},v[f+"-item-prev"]=b,v[f+"-item-next"]=S,v[f+"-item-current"]=m,v[f+"-item-slide-in"]=g==="slide"&&Q&&G&&m,v[f+"-item-slide-out"]=g==="slide"&&Q&&G&&s===xe,v)),onClick:function(je){ge&&ge(je),O({targetIndex:s,isNegative:s===X,isManual:!0})}})})}),W!=="never"&&z>1&&c("div",{style:fe.indicatorWrapper,className:T(f+"-indicator-wrapper",f+"-indicator-wrapper-"+k),children:c(Ue,{className:A,type:W,count:z,activeIndex:I,position:k,trigger:E,onSelectIndex:function(o){return O({targetIndex:o,isNegative:o1&&c(Ke,{className:J,direction:M,showArrow:U,icons:V,prev:function(){return O({targetIndex:X,isNegative:!0,isManual:!0})},next:function(){return O({targetIndex:Z,isManual:!0})}})]})})}var ye=L.forwardRef(Ge);ye.displayName="Carousel";var Qe=ye;const Xe=["//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/f7e8fc1e09c42e30682526252365be1c.jpg~tplv-uwbnlip3yd-webp.webp","//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/94e8dd2d6dc4efb2c8cfd82c0ff02a2c.jpg~tplv-uwbnlip3yd-webp.webp","//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/ec447228c59ae1ebe185bab6cd776ca4.jpg~tplv-uwbnlip3yd-webp.webp","//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/1d1580d2a5a1e27415ff594c756eabd8.jpg~tplv-uwbnlip3yd-webp.webp"];function er(){return c(Qe,{indicatorType:"slider",showArrow:"never",autoPlay:!0,style:{width:"100%",height:160},children:Xe.map((e,a)=>c("div",{children:c("img",{src:e,style:{width:280,transform:"translateY(-30px)"}})},a))})}export{er as default};