import{S as b}from"./swiper-BZ695VVi.js";import{P as B}from"./pagination-OSZsCRiB.js";import"./create-element-if-not-defined-UydgxO9n.js";function R(x){let{swiper:e,extendParams:C,on:h}=x;C({grid:{rows:1,fill:"column"}});let c,w,u,m;const M=()=>{let t=e.params.spaceBetween;return typeof t=="string"&&t.indexOf("%")>=0?t=parseFloat(t.replace("%",""))/100*e.size:typeof t=="string"&&(t=parseFloat(t)),t},L=t=>{const{slidesPerView:i}=e.params,{rows:s,fill:a}=e.params.grid,r=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:t.length;u=Math.floor(r/s),Math.floor(r/s)===r/s?c=r:c=Math.ceil(r/s)*s,i!=="auto"&&a==="row"&&(c=Math.max(c,i*s)),w=c/s},y=()=>{e.slides&&e.slides.forEach(t=>{t.swiperSlideGridSet&&(t.style.height="",t.style[e.getDirectionLabel("margin-top")]="")})},$=(t,i,s)=>{const{slidesPerGroup:a}=e.params,r=M(),{rows:o,fill:f}=e.params.grid,d=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:s.length;let p,n,l;if(f==="row"&&a>1){const g=Math.floor(t/(a*o)),S=t-o*a*g,v=g===0?a:Math.min(Math.ceil((d-g*o*a)/o),a);l=Math.floor(S/v),n=S-l*v+g*a,p=n+l*c/o,i.style.order=p}else f==="column"?(n=Math.floor(t/o),l=t-n*o,(n>u||n===u&&l===o-1)&&(l+=1,l>=o&&(l=0,n+=1))):(l=Math.floor(t/w),n=t-l*w);i.row=l,i.column=n,i.style.height=`calc((100% - ${(o-1)*r}px) / ${o})`,i.style[e.getDirectionLabel("margin-top")]=l!==0?r&&`${r}px`:"",i.swiperSlideGridSet=!0},z=(t,i)=>{const{centeredSlides:s,roundLengths:a}=e.params,r=M(),{rows:o}=e.params.grid;if(e.virtualSize=(t+r)*c,e.virtualSize=Math.ceil(e.virtualSize/o)-r,e.params.cssMode||(e.wrapperEl.style[e.getDirectionLabel("width")]=`${e.virtualSize+r}px`),s){const f=[];for(let d=0;d<i.length;d+=1){let p=i[d];a&&(p=Math.floor(p)),i[d]<e.virtualSize+i[0]&&f.push(p)}i.splice(0,i.length),i.push(...f)}},I=()=>{m=e.params.grid&&e.params.grid.rows>1},P=()=>{const{params:t,el:i}=e,s=t.grid&&t.grid.rows>1;m&&!s?(i.classList.remove(`${t.containerModifierClass}grid`,`${t.containerModifierClass}grid-column`),u=1,e.emitContainerClasses()):!m&&s&&(i.classList.add(`${t.containerModifierClass}grid`),t.grid.fill==="column"&&i.classList.add(`${t.containerModifierClass}grid-column`),e.emitContainerClasses()),m=s};h("init",I),h("update",P),e.grid={initSlides:L,unsetSlides:y,updateSlide:$,updateWrapperSize:z}}new b(".portfolio-swiper",{slidesPerView:1,spaceBetween:32,pagination:{el:".portfolio-swiper .swiper-pagination"},modules:[B,R]});
