PageSourceSearch

https://wooltariusa.com/cdn/shop/t/324/assets/multi-collection-hero.Bji-Jwh2.min.js

js wooltariusa.com collected 2026-10-04 20:14:54 UTC 4,887 bytes, 2 lines download raw bytes

1import"./swiper-bundle.esm.C3AY9Wqy.min.js";import{j as d}from"./vendor-swiper.1cv5fAy7.min.js";const a=2,p=150,h=2440;function u(i){const e=[...i];for(let t=e.length-1;t>0;t--){const s=Math.floor(Math.random()*(t+1));[e[t],e[s]]=[e[s],e[t]]}return e}function w(i,e){const t=i<10?`0${i}`:String(i),s=e<10?`0${e}`:String(e);return`<div class="number-paging"><span class="hidden">현재 컬렉션</span><span class="swiper-pagination-current">${t}</span><span class="swiper-pagination-separator"> / </span><span class="hidden">전체 컬렉션</span><span class="swiper-pagination-total">${s}</span></div>`}class S extends window.HTMLElement{connectedCallback(){var e;this.sectionId=this.getAttribute("id"),this.carousel=this.querySelector(".multi-collection-carousel"),this.carousel&&(this.swiperEl=this.carousel.querySelector(".swiper"),this.wrapperEl=(e=this.swiperEl)==null?void 0:e.querySelector(".swiper-wrapper"),this.template=this.carousel.querySelector('[id^="collection-slides-template"]'),!(!this.swiperEl||!this.wrapperEl||!this.template)&&(this.swiperInstance=null,this.debounceId=null,this.mode=null,this.populateSlides(),this.bindEvents(),requestAnimationFrame(()=>{requestAnimationFrame(()=>this.updateMode())})))}disconnectedCallback(){this.unbindEvents(),this.destroySwiper()}populateSlides(){const e=Array.from(this.template.content.querySelectorAll(".swiper-slide"));u(e).forEach(t=>{this.wrapperEl.appendChild(t.cloneNode(!0))})}bindEvents(){this.onResize=()=>this.scheduleUpdate(),this.onSectionLoad=e=>{var s;const t=(s=e.detail)==null?void 0:s.sectionId;t&&String(t)!==String(this.sectionId)||this.scheduleUpdate()},window.addEventListener("resize",this.onResize),document.addEventListener("shopify:section:load",this.onSectionLoad),this.resizeObserver=new ResizeObserver(()=>this.scheduleUpdate()),this.resizeObserver.observe(this.carousel.querySelector(".carousel-container")||this.swiperEl),this.wrapperEl.querySelectorAll("img").forEach(e=>{e.complete||e.addEventListener("load",this.onResize,{once:!0})})}unbindEvents(){var e;window.removeEventListener("resize",this.onResize),document.removeEventListener("shopify:section:load",this.onSectionLoad),(e=this.resizeObserver)==null||e.disconnect(),clearTimeout(this.debounceId)}scheduleUpdate(){clearTimeout(this.debounceId),this.debounceId=setTimeout(()=>this.updateMode(),p)}isWideStaticLayout(){return window.innerWidth>=h}isDesktopLayout(){return window.innerWidth>=1024}getSlideCount(){return this.wrapperEl.querySelectorAll(".swiper-slide:not(.swiper-slide-duplicate)").length}needsSwiper(){if(this.isWideStaticLayout())return!1;if(this.swiperInstance&&!this.swiperInstance.destroyed){const t=this.wrapperEl.querySelectorAll(".swiper-slide:not(.swiper-slide-duplicate)"),s=this.swiperInstance.params.spaceBetween||0;let r=0;return t.forEach((n,o)=>{r+=n.offsetWidth,o<t.length-1&&(r+=s)}),r-this.swiperEl.clientWidth>a}this.swiperEl.classList.add("static-mode");const e=this.wrapperEl.scrollWidth-this.swiperEl.clientWidth>a;return this.swiperEl.classList.remove("static-mode"),e}updateMode(){if(this.getSlideCount()<2||this.isWideStaticLayout()||!this.needsSwiper()){this.setMode("static");return}this.setMode("swiper")}setMode(e){if(this.isWideStaticLayout()&&(e="static"),this.mode===e){e==="swiper"&&!this.swiperInstance?this.enableSwiper():e==="static"&&this.applyStaticLayout();return}this.mode=e,e==="swiper"?(this.swiperEl.classList.remove("static-mode","wide-static-mode"),this.carousel.classList.add("is-swiper-active"),this.enableSwiper()):(this.destroySwiper(),this.carousel.classList.remove("is-swiper-active"),this.applyStaticLayout())}applyStaticLayout(){this.swiperEl.classList.add("static-mode"),this.swiperEl.classList.toggle("wide-static-mode",this.isWideStaticLayout())}destroySwiper(){this.swiperInstance&&!this.swiperInstance.destroyed&&(this.swiperInstance.destroy(!0,!0),this.swiperInstance=null)}enableSwiper(e){if(this.swiperInstance||this.isWideStaticLayout())return;const t=this.getSlideCount();if(t<2)return;const s=`#shopify-section-${this.sectionId} .multi-collection-carousel`,r=this.isDesktopLayout(),n=e??Math.floor(t/2);this.swiperInstance=new d(this.swiperEl,{slidesPerView:"auto",slidesPerGroup:1,spaceBetween:r?12:8,centeredSlides:!r,loop:!0,loopAdditionalSlides:2,grabCursor:!0,simulateTouch:!0,allowTouchMove:!0,touchEventsTarget:"container",touchStartPreventDefault:!1,touchRatio:1,threshold:5,initialSlide:n,observer:!0,observeParents:!0,preventClicks:!0,preventClicksPropagation:!1,navigation:{nextEl:`${s} .swiper-button-next`,prevEl:`${s} .swiper-button-prev`},pagination:{el:`${s} .swiper-pagination`,type:"custom",renderCustom:(o,l,c)=>w(l,c)},breakpoints:{1024:{slidesPerView:"auto",slidesPerGroup:1,spaceBetween:12,centeredSlides:!1}}})}}window.customElements.define("multi-collection-hero",S);
2//# sourceMappingURL=multi-collection-hero.Bji-Jwh2.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.