import{r,j as t}from"./app-C417rstp.js";import{p as w,n as v}from"./index-C9OncgsG.js";import{A as y}from"./index-CIV8c8cT.js";import{m as i}from"./proxy-Bepa3l_N.js";function C({images:l=[],gradient:p=GRADIENT_PS}){const c=l.length||1,[s,d]=r.useState(0),h=r.useRef(0),[u,m]=r.useState(0),o=e=>{m(e),d(a=>(a+e+c)%c)},x=e=>{m(e>s?1:-1),d(e)},g=e=>h.current=e.touches[0].clientX,b=e=>{const a=e.changedTouches[0].clientX-h.current;Math.abs(a)>40&&o(a<0?1:-1)},f={enter:e=>({x:e>0?1e3:-1e3,opacity:0,scale:.95}),center:{x:0,opacity:1,scale:1},exit:e=>({x:e<0?1e3:-1e3,opacity:0,scale:.95})},n=l;return t.jsx("div",{className:"relative group",children:t.jsxs("div",{className:"relative overflow-hidden rounded-2xl",style:{aspectRatio:"16 / 9"},onTouchStart:g,onTouchEnd:b,children:[t.jsx("div",{className:classNames("absolute inset-0 bg-gradient-to-br opacity-20",p)}),t.jsx(y,{initial:!1,custom:u,mode:"wait",children:t.jsx(i.img,{src:n[s]||PLACEHOLDER,alt:`Imagen ${s+1}`,custom:u,variants:f,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.25},scale:{duration:.25}},className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"},s)}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent pointer-events-none"}),n.length>1&&t.jsxs(t.Fragment,{children:[t.jsx(i.button,{whileHover:{scale:1.1,x:-5},whileTap:{scale:.9},"aria-label":"Anterior",onClick:()=>o(-1),className:`absolute left-4 top-1/2 -translate-y-1/2 grid place-items-center h-12 w-12 rounded-full
                         bg-white/90 backdrop-blur-sm shadow-xl opacity-0 group-hover:opacity-100
                         transition-opacity duration-300 hover:bg-white z-10`,children:t.jsx(w,{className:"text-xl text-gray-800"})}),t.jsx(i.button,{whileHover:{scale:1.1,x:5},whileTap:{scale:.9},"aria-label":"Siguiente",onClick:()=>o(1),className:`absolute right-4 top-1/2 -translate-y-1/2 grid place-items-center h-12 w-12 rounded-full
                         bg-white/90 backdrop-blur-sm shadow-xl opacity-0 group-hover:opacity-100
                         transition-opacity duration-300 hover:bg-white z-10`,children:t.jsx(v,{className:"text-xl text-gray-800"})}),t.jsx("div",{className:"absolute bottom-4 left-0 right-0 flex items-center justify-center gap-2",children:n.map((e,a)=>t.jsx(i.button,{whileHover:{scale:1.3},whileTap:{scale:.9},"aria-label":`Ir a la imagen ${a+1}`,onClick:()=>x(a),className:classNames("h-2 rounded-full transition-all duration-300",a===s?"w-8 bg-white shadow-lg":"w-2 bg-white/60 hover:bg-white/80")},a))})]})]})})}export{C as default};
