1import{_ as H,B as k,G as m,i as P,x as B,H as b,Y as x,s as q,a9 as T,o as W,c as y,a as s,P as C,aa as _,M as S,F as M,j as D,J as z,p as R,f as F}from"./entry.DS3bpOot.js";const A={name:"GallerySlider",props:{contentData:{required:!1,type:Object},contentImages:{required:!1}},setup(t){const c=k(()=>{var i,n,l;return(l=(n=(i=t==null?void 0:t.contentData)==null?void 0:i.conf)==null?void 0:n.conf)==null?void 0:l.includes("paddingTop")}),h=k(()=>{var i,n,l,o;return((o=(l=(n=(i=t==null?void 0:t.contentData)==null?void 0:i.data)==null?void 0:n.list)==null?void 0:l[0])==null?void 0:o.image)||t.contentImages}),e=m({containerEl:null,sliderEl:null,sliderElWidth:0,slidesContainerWrapperEl:null,slidesContainerWrapperElWidth:0,slidesContainerEl:null,slidesContainerElWidth:0,slides:null,sliderHandleEl:null,sliderHandleElWidth:0,singleSlideWidth:0,activeSlideIndex:0,activeSlidePosition:0,sliderHandleElPosition:0,singleSlideMargin:40,showSlider:!1,showToolbar:!1,showClones:!1});P(h,i=>{g(i.value)},{deep:!0}),B(async()=>{e.containerEl=document.querySelector(".secondary-slider-container"),e.containerEl&&(e.sliderEl=e.containerEl.querySelector(".secondary-slider"),e.sliderElWidth=a(e.sliderEl),e.slidesContainerWrapperEl=e.containerEl.querySelector(".slide-container-wrapper"),e.slidesContainerEl=e.slidesContainerWrapperEl.querySelector(".slides-container"),e.slides=e.slidesContainerEl.children,e.sliderHandleEl=e.containerEl.querySelector(".secondary-slider-handle"),g(h.value),window==null||window.addEventListener("resize",d))}),b(()=>{window==null||window.removeEventListener("resize",d)});function g(i){(i==null?void 0:i.length)>0&&(e.showSlider=!0,(i==null?void 0:i.length)>1&&(e.showToolbar=!0,e.showClones=!0),I(e.containerEl),x(()=>{e.sliderElWidth=a(e.sliderEl),e.slidesContainerElWidth=e.sliderElWidth*(i==null?void 0:i.length)+40*((i==null?void 0:i.length)-1),e.slidesContainerWrapperElWidth=a(e.slidesContainerWrapperEl),u(),x(()=>{e.singleSlideWidth=a(e.slides.item(0)),r()})}))}async function I(i){await q(()=>import("./hammer.Dhm3JO1K.js").then(l=>l.h),__vite__mapDeps([0,1,2]),import.meta.url);var n="";i&&(n=new Hammer(i),n.on("swipeleft swiperight",function(l){E(l.type)}),n.on("tap",function(l){var o;if(l.target.classList.contains("single-secondary-slide")){let f=null;l.target.classList.contains("clone")&&l.target.classList.contains("first")?f=((o=e.slides)==null?void 0:o.length)-1:l.target.classList.contains("clone")&&l.target.classList.contains("last")&&(f=0),p(l,f)}}))}function a(i){const n=getComputedStyle(i),l=i.clientWidth,o=parseFloat(n.paddingLeft),f=parseFloat(n.paddingRight);return l-o-f}function u(){e.sliderHandleElWidth=Math.round(e.sliderElWidth/(e.slidesContainerElWidth/100)*100)/100}function r(){var n,l;e.activeSlideIndex>((n=e.slides)==null?void 0:n.length)-1?e.activeSlideIndex=0:e.activeSlideIndex<0&&(e.activeSlideIndex=((l=e.slides)==null?void 0:l.length)-1);let i=e.slides.item(e.activeSlideIndex);e.activeSlidePosition=i.offsetLeft;for(const o of e.slides)o.classList.remove("active");i.classList.add("active"),e.slidesContainerWrapperEl.style.left=-e.activeSlidePosition+"px",w()}function p(i,n=null){if(e.activeSlideIndex=n,e.activeSlideIndex===null){let l=i.target;e.activeSlideIndex=Array.prototype.indexOf.call(l.parentNode.children,l)}r()}function E(i){i==="swiperight"?e.activeSlideIndex--:i==="swipeleft"&&e.activeSlideIndex++,r()}function v(){const i=event.target.closest(".slider-btn");i.classList.contains("left")?e.activeSlideIndex--:i.classList.contains("right")&&e.activeSlideIndex++,r()}function w(){e.sliderHandleElPosition=(e.activeSlidePosition-e.singleSlideWidth-e.singleSlideMargin)/(e.slidesContainerElWidth/100),e.sliderHandleElPosition<0&&(e.sliderHandleElPosition=0),e.sliderHandleEl.style.left=e.sliderHandleElPosition+"%"}function d(){e.sliderElWidth=a(e.sliderEl),e.slidesContainerElWidth=a(e.slidesContainerEl),e.slidesContainerWrapperElWidth=a(e.slidesContainerWrapperEl),e.singleSlideWidth=a(e.slides.item(0)),u()}return{images:h,paddingTop:c,handleBtnClick:v,...T(e)}},components:{}},L=t=>(R("data-v-e360dd88"),t=t(),F(),t),G=["id"],O={class:"secondary-slider"},j={class:"slide-container-wrapper"},J={class:"slides-container"},N={class:"slider-control-wrapper"},V={class:"secondary-slider-handle-container"}
1,$={class:"slider-controls"},U=L(()=>s("svg",{width:"14",height:"8",viewBox:"0 0 14 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s("path",{opacity:"0.9",d:"M2 2L7 6L12 2",stroke:"white","stroke-width":"2","stroke-linecap":"square"})],-1)),Y=[U],K=L(()=>s("svg",{width:"14",height:"8",viewBox:"0 0 14 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s("path",{opacity:"0.9",d:"M2 2L7 6L12 2",stroke:"white","stroke-width":"2","stroke-linecap":"square"})],-1)),Q=[K];function X(t,c,h,e,g,I){var a,u,r,p,E,v,w;return W(),y("div",{id:(u=(a=h.contentData)==null?void 0:a.conf)==null?void 0:u.hashTag,class:z(["secondary-slider-container",{paddingTop:e.paddingTop}]),name:"gallerySlider"},[s("div",O,[s("div",j,[C(s("div",{style:S({backgroundImage:`url(${(E=(p=e.images)==null?void 0:p[((r=e.images)==null?void 0:r.length)-1])==null?void 0:E.url})`,width:`${t.sliderElWidth}px`}),class:"single-secondary-slide clone first"},null,4),[[_,t.showClones]]),s("div",J,[(W(!0),y(M,null,D(e.images,d=>(W(),y("div",{key:`image_${d==null?void 0:d.id}`,style:S({backgroundImage:`url(${d==null?void 0:d.url})`,width:`${t.sliderElWidth}px`}),class:"single-secondary-slide"},null,4))),128))]),C(s("div",{style:S({backgroundImage:`url(${(w=(v=e.images)==null?void 0:v[0])==null?void 0:w.url})`,width:`${t.sliderElWidth}px`}),class:"single-secondary-slide clone last"},null,4),[[_,t.showClones]])])]),C(s("div",N,[s("div",V,[s("div",{class:"secondary-slider-handle",style:S({width:`${t.sliderHandleElWidth}%`})},null,4)]),s("div",$,[s("div",{class:"slider-btn left",onClick:c[0]||(c[0]=(...d)=>e.handleBtnClick&&e.handleBtnClick(...d))},Y),s("div",{class:"slider-btn right",onClick:c[1]||(c[1]=(...d)=>e.handleBtnClick&&e.handleBtnClick(...d))},Q)])],512),[[_,t.showToolbar]])],10,G)}const ee=H(A,[["render",X],["__scopeId","data-v-e360dd88"]]);export{ee as default}; 2function __vite__mapDeps(indexes) { 3 if (!__vite__mapDeps.viteFileDeps) { 4 __vite__mapDeps.viteFileDeps = ["./hammer.Dhm3JO1K.js","./entry.DS3bpOot.js","./entry.C_lhqnaR.css"] 5 } 6 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 7}
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.