"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./common/styles.js");require("@gem-sdk/swiper/element/bundle").register(),exports.Swiper=function(s){let i=r.useRef(null),{children:n,totalSlides:u,onSwiperReset:c,onSwiperReady:p,sliderClass:l,sliderOrder:w,thumbsSwiper:a,...f}=s,d=JSON.stringify(f),o=r.useMemo(()=>a?{"thumbs-swiper":a}:{},[a]),m=t.getStyleSwiperContainer(),y=()=>{i.current?.swiper&&i.current.swiper.wrapperEl.style.setProperty("width",`${i.current.swiper.width}px`)};return r.useEffect(()=>{let e=i.current;if(e)return Object.assign(e,f),e.initialize?.(),p?.(e.swiper),y(),e.addEventListener("swiperresize",y),()=>{e.removeEventListener("swiperresize",y),c()}},[]),r.useEffect(()=>{let e=i.current,r=e?.swiper;e&&r&&!r.destroyed&&(Object.assign(e,f),r.update(),y())},[d]),r.useEffect(()=>{c()},[w,c]),e.jsx("swiper-container",{init:!1,ref:i,class:l,style:{...m},...o,children:n})};
