1import{_ as E}from"./DhiENar-.js";import{_ as b}from"./DOVfzyYL.js";import{gsap as m}from"./DRhTDw2I.js";import{d as x,g as v,h as y,i as k,L as B,K as C,a as H,o as I,e as a,v as u,t as f}from"./TvATKHO3.js";import"./D3NKxllR.js";const S={class:"image-compare"},$={class:"image-compare__after"},M={class:"image-compare__slider-handle"},R=x({__name:"ImageCompare",props:{before:{},after:{}},setup(w){const p=w,l=v(null),o=v(null),_=v(null);let s=null;y(()=>{o.value?.addEventListener("mousedown",n),o.value?.addEventListener("touchstart",n)}),k(()=>{o.value?.removeEventListener("mousedown",n),o.value?.removeEventListener("touchstart",n)});const n=()=>{o.value.classList.add("grabbed"),s=_.value?.getBoundingClientRect()||null,window.addEventListener("mousemove",r),window.addEventListener("touchmove",r),window.addEventListener("mouseup",d),window.addEventListener("touchend",d)},r=e=>{const t=("changedTouches"in e?e.changedTouches[0]:e).pageX-(s?.left||0)-window.scrollX,c=t/(s?.width||1)*100;t<4||t>s.width-4?o.value.classList.add("collapsed"):o.value.classList.remove("collapsed"),i(Math.min(Math.max(c,0),100))},i=e=>{o.value&&l.value&&(o.value.style.left=e+"%",l.value.style.clipPath=`rect(0 ${e}% 100% 0)`)},d=()=>{o.value.classList.remove("grabbed"),window.removeEventListener("mousemove",r),window.removeEventListener("touchmove",r),window.removeEventListener("mouseup",d),window.removeEventListener("touchend",d)},h=()=>{setTimeout(()=>{const e={x:50};m.to(e,{x:45,duration:.3,ease:"power2.inOut",onUpdate:()=>i(e.x)}),m.to(e,{x:55,duration:.6,delay:.3,ease:"power2.inOut",onUpdate:()=>i(e.x)}),m.to(e,{x:50,duration:.5,delay:.9,ease:"power2.inOut",onUpdate:()=>i(e.x)})},700)};return(e,L)=>{const t=E,c=b,g=B("intersect");return C((I(),H("div",S,[a("div",{ref_key:"imagesWrapper",ref:_,class:"image-compare__images"},[a("div",$,[u(t,{media:p.after,size:"md"},null,8,["media"]),a("span",null,f(e.$t("images.after")),1)]),a("div",{ref_key:"beforeImg",ref:l,class:"image-compare__before"}
1,[u(t,{media:p.before,size:"md"},null,8,["media"]),a("span",null,f(e.$t("images.before")),1)],512)],512),a("div",{ref_key:"slider",ref:o,class:"image-compare__slider"},[a("div",M,[u(c,{name:"arrow-range"})])],512)])),[[g,{onChange:h,observerOptions:{threshold:.5}}]])}}});export{R as default}; 2//# sourceMappingURL=DM4_kouz.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.