import{e as E,a as w}from"./effect-target-CicQ8Gyi.js";import{f as g,h as T}from"./swiper-core-KMhvhzce.js";function h(l){let{swiper:e,duration:f,transformElements:n,allSlides:d}=l;const{activeIndex:c}=e,r=a=>a.parentElement?a.parentElement:e.slides.filter(t=>t.shadowRoot&&t.shadowRoot===a.parentNode)[0];if(e.params.virtualTranslate&&f!==0){let a=!1,s;d?s=n:s=n.filter(t=>{const i=t.classList.contains("swiper-slide-transform")?r(t):t;return e.getSlideIndex(i)===c}),s.forEach(t=>{g(t,()=>{if(a||!e||e.destroyed)return;a=!0,e.animating=!1;const i=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(i)})})}}function y(l){let{swiper:e,extendParams:f,on:n}=l;f({fadeEffect:{crossFade:!1}}),E({effect:"fade",swiper:e,on:n,setTranslate:()=>{const{slides:r}=e,a=e.params.fadeEffect;for(let s=0;s<r.length;s+=1){const t=e.slides[s];let o=-t.swiperSlideOffset;e.params.virtualTranslate||(o-=e.translate);let p=0;e.isHorizontal()||(p=o,o=0);const u=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(t.progress),0):1+Math.min(Math.max(t.progress,-1),0),m=w(a,t);m.style.opacity=u,m.style.transform=`translate3d(${o}px, ${p}px, 0px)`}},setTransition:r=>{const a=e.slides.map(s=>T(s));a.forEach(s=>{s.style.transitionDuration=`${r}ms`}),h({swiper:e,duration:r,transformElements:a,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}export{y as E};