=0;i-=1)i>this.slideSlots&&e[i].remove()}}render(){if(this.rendered)return;this.calcSlideSlots();let e=this.cssStyles();this.slideSlots>0&&(e=e.replace(/::slotted\(([a-z-0-9.]*)\)/g,"$1")),e.length&&addStyle(this.shadowRoot,e),this.cssLinks().forEach((e=>{if(this.shadowRoot.querySelector(`link[href="${e}"]`))return;const i=document.createElement("link");i.rel="stylesheet",i.href=e,this.shadowRoot.appendChild(i)}));const i=document.createElement("div");i.classList.add("swiper"),i.part="container",i.innerHTML=`\n \n \n \n ${Array.from({length:this.slideSlots}).map(((e,i)=>`\n \n \n \n `)).join("")}\n
\n \n ${needsNavigation(this.passedParams)?`\n ${this.constructor.prevButtonSvg}
\n ${this.constructor.nextButtonSvg}
\n `:""}\n ${needsPagination(this.passedParams)?'\n \n ':""}\n ${needsScrollbar(this.passedParams)?'\n \n ':""}\n `,this.shadowRoot.appendChild(i),this.rendered=!0}initialize(){var e=this;if(this.initialized)return;this.initialized=!0;const{params:i,passedParams:t}=getParams(this);this.swiperParams=i,this.passedParams=t,delete this.swiperParams.init,this.render(),this.swiper=new Swiper(this.shadowRoot.querySelector(".swiper"),{...i.virtual?{}:{observer:!0,observeSlideChildren:this.slideSlots>0},...i,touchEventsTarget:"container",onAny:function(t){"observerUpdate"===t&&e.calcSlideSlots();const s=i.eventsPrefix?`${i.eventsPrefix}${t.toLowerCase()}`:t.toLowerCase();for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;oe.includes("_"))).map((e=>e.replace(/[A-Z]/g,(e=>`-${e}`)).replace("_","").toLowerCase()))}}paramsList.forEach((e=>{"init"!==e&&(e=e.replace("_",""),Object.defineProperty(SwiperContainer.prototype,e,{configurable:!0,get(){return(this.passedParams||{})[e]},set(i){this.passedParams||(this.passedParams={}),this.passedParams[e]=i,this.initialized&&this.updateSwiperOnPropChange(e,i)}}))}));class SwiperSlide extends ClassToExtend{constructor(){super(),this.attachShadow({mode:"open"})}render(){const e=this.lazy||""===this.getAttribute("lazy")||"true"===this.getAttribute("lazy");if(addStyle(this.shadowRoot,SwiperSlideCSS),this.shadowRoot.appendChild(document.createElement("slot")),e){const e=document.createElement("div");e.classList.add("swiper-lazy-preloader"),e.part.add("preloader"),this.shadowRoot.appendChild(e)}}initialize(){this.render()}connectedCallback(){this.initialize()}}const register=()=>{"undefined"!=typeof window&&(window.customElements.get("swiper-container")||window.customElements.define("swiper-container",SwiperContainer),window.customElements.get("swiper-slide")||window.customElements.define("swiper-slide",SwiperSlide))};"undefined"!=typeof window&&(window.SwiperElementRegisterParams=e=>{paramsList.push(...e)});export{SwiperContainer,SwiperSlide,register};
//# sourceMappingURL=swiper-element-bundle.min.mjs.map