1import{g as x}from"./DLwfy_0O.js";function S(f,m){for(var d=0;d<m.length;d++){const s=m[d];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in f)){const n=Object.getOwnPropertyDescriptor(s,o);n&&Object.defineProperty(f,o,n.get?n:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var g={},b;function E(){return b||(b=1,(()=>{var f={792:(s,o,n)=>{n.d(o,{Z:()=>c});var a=n(609),l=n.n(a)()((function(u){return u[1]}));l.push([s.id,':host{--divider-width: 1px;--divider-color: #fff;--divider-shadow: none;--default-handle-width: 50px;--default-handle-color: #fff;--default-handle-opacity: 1;--default-handle-shadow: none;--handle-position-start: 50%;position:relative;display:inline-block;overflow:hidden;line-height:0;direction:ltr}@media screen and (-webkit-min-device-pixel-ratio: 0)and (min-resolution: 0.001dpcm){:host{outline-offset:1px}}:host(:focus){outline:2px solid -webkit-focus-ring-color}::slotted(*){-webkit-user-drag:none;-khtml-user-drag:none;-moz-user-drag:none;-o-user-drag:none;user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.first{position:absolute;left:0;top:0;right:0;line-height:normal;font-size:100%;max-height:100%;height:100%;width:100%;--exposure: 50%;--keyboard-transition-time: 0ms;--default-transition-time: 0ms;--transition-time: var(--default-transition-time)}.first .first-overlay-container{position:relative;clip-path:inset(0 var(--exposure) 0 0);transition:clip-path var(--transition-time);height:100%}.first .first-overlay{overflow:hidden;height:100%}.first.focused{will-change:clip-path}.first.focused .first-overlay-container{will-change:clip-path}.second{position:relative}.handle-container{transform:translateX(50%);position:absolute;top:0;right:var(--exposure);height:100%;transition:right var(--transition-time),bottom var(--transition-time)}.focused .handle-container{will-change:right}.divider{position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.divider:after{content:" ";display:block;height:100%;border-left-width:var(--divider-width);border-left-style:solid;border-left-color:var(--divider-color);box-shadow:var(--divider-shadow)}.handle{position:absolute;top:var(--handle-position-start);pointer-events:none;box-sizing:border-box;margin-left:1px;transform:translate(calc(-50% - 0.5px), -50%);line-height:0}.default-handle{width:var(--default-handle-width);opacity:var(--default-handle-opacity);transition:all 1s;filter:drop-shadow(var(--default-handle-shadow))}.default-handle path{stroke:var(--default-handle-color)}.vertical .first-overlay-container{clip-path:inset(0 0 var(--exposure) 0)}.vertical .handle-container{transform:translateY(50%);height:auto;top:unset;bottom:var(--exposure);width:100%;left:0;flex-direction:row}.vertical .divider:after{height:1px;width:100%;border-top-width:var(--divider-width);border-top-style:solid;border-top-color:var(--divider-color);border-left:0}.vertical .handle{top:auto;left:var(--handle-position-start);transform:translate(calc(-50% - 0.5px), -50%) rotate(90deg)}',""]);const c=l},609:s=>{s.exports=function(o){var n=[];return n.toString=function(){return this.map((function(a){var l=o(a);return a[2]?"@media ".concat(a[2]," {").concat(l,"}"):l})).join("")},n.i=function(a,l,c){typeof a=="string"&&(a=[[null,a,""]]);var u={};if(c)for(var v=0;v<this.length;v++){var p=this[v][0];p!=null&&(u[p]=!0)}for(var e=0;e<a.length;e++){var t=[].concat(a[e]);c&&u[t[0]]||(l&&(t[2]?t[2]="".concat(l," and ").concat(t[2]):t[2]=l),n.push(t))}},n}}},m={};function d(s){var o=m[s];if(o!==void 0)return o.exports;var n=m[s]={id:s,exports:{}};return f[s](n,n.exports,d),n.exports}d.n=s=>{var o=s&&s.__esModule?()=>s.default:()=>s;return d.d(o,{a:o}),o},d.d=(s,o)=>{for(var n in o)d.o(o,n)&&!d.o(s,n)&&Object.defineProperty(s,n,{enumerable:!0,get:o[n]})},d.o=(s,o)=>Object.prototype.hasOwnProperty.call(s,o),(()=>{var s=d(792);const o="rendered",n=(e,t)=>{const i=e.getBoundingClientRect();let r,h;return t.type==="mousedown"?(r=t.clientX,h=t.clientY):(r=t.touches[0].clientX,h=t.touches[0].clientY),r>=i.x&&r<=i.x+i.width&&h>=i.y&&h<=i.y+i.height};let a;const l={ArrowLeft:-1,ArrowRight:1},c=["horizontal","vertical"],u=e=>({x:e.touches[0].pageX,y:e.touches[0].pageY}),v=e=>({x:e.pageX,y:e.pageY}),p=typeof window<"u"&&window?.HTMLElement;typeof window<"u"&&(window.document&&(a=document.createElement("template"),a.innerHTML='<div class="second" id="second"> <slot name="second"><slot name="before"></slot></slot> </div> <div class="first" id="first"> <div class="first-overlay"> <div class="first-overlay-container" id="firstImageContainer"> <slot name="first"><slot name="after"></slot></slot> </div> </div> <div class="handle-container"> <div class="divider"></div> <div class="handle" id="handle"> <slot name="handle"> <svg xmlns="http://www.w3.org/2000/svg" class="default-handle" viewBox="-8 -3 16 6"> <path d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vector-effect="non-scaling-stroke"/> </svg> </slot> </div> </div> </div> '),window.customElements.define("img-comparison-slider",class extends p{constructor(){super(),this.exposure=this.hasAttribute("value")?parseFloat(this.getAttribute("value")):
vendor: 6,372 bytes, line 1
150,this.slideOnHover=!1,this.slideDirection="horizontal",this.keyboard="enabled",this.isMouseDown=!1,this.animationDirection=0,this.isFocused=!1,this.dragByHandle=!1,this.onMouseMove=i=>{if(this.isMouseDown||this.slideOnHover){const r=v(i);this.slideToPage(r)}},this.bodyUserSelectStyle="",this.bodyWebkitUserSelectStyle="",this.onMouseDown=i=>{if(this.slideOnHover||this.handle&&!n(this.handleElement,i))return;i.preventDefault(),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),this.isMouseDown=!0,this.enableTransition();const r=v(i);this.slideToPage(r),this.focus(),this.bodyUserSelectStyle=window.document.body.style.userSelect,this.bodyWebkitUserSelectStyle=window.document.body.style.webkitUserSelect,window.document.body.style.userSelect="none",window.document.body.style.webkitUserSelect="none"},this.onWindowMouseUp=()=>{this.isMouseDown=!1,window.document.body.style.userSelect=this.bodyUserSelectStyle,window.document.body.style.webkitUserSelect=this.bodyWebkitUserSelectStyle,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp)},this.touchStartPoint=null,this.isTouchComparing=!1,this.hasTouchMoved=!1,this.onTouchStart=i=>{this.dragByHandle&&!n(this.handleElement,i)||(this.touchStartPoint=u(i),this.isFocused&&(this.enableTransition(),this.slideToPage(this.touchStartPoint)))},this.onTouchMove=i=>{if(this.touchStartPoint===null)return;const r=u(i);if(this.isTouchComparing)return this.slideToPage(r),i.preventDefault(),!1;if(!this.hasTouchMoved){const h=Math.abs(r.y-this.touchStartPoint.y),w=Math.abs(r.x-this.touchStartPoint.x);if(this.slideDirection==="horizontal"&&h<w||this.slideDirection==="vertical"&&h>w)return this.isTouchComparing=!0,this.focus(),this.slideToPage(r),i.preventDefault(),!1;this.hasTouchMoved=!0}},this.onTouchEnd=()=>{this.isTouchComparing=!1,this.hasTouchMoved=!1,this.touchStartPoint=null},this.onBlur=()=>{this.stopSlideAnimation(),this.isFocused=!1,this.firstElement.classList.remove("focused")},this.onFocus=()=>{this.isFocused=!0,this.firstElement.classList.add("focused")},this.onKeyDown=i=>{if(this.keyboard==="disabled")return;const r=l[i.key];this.animationDirection!==r&&r!==void 0&&(this.animationDirection=r,this.startSlideAnimation())},this.onKeyUp=i=>{if(this.keyboard==="disabled")return;const r=l[i.key];r!==void 0&&this.animationDirection===r&&this.stopSlideAnimation()},this.resetDimensions=()=>{this.imageWidth=this.offsetWidth,this.imageHeight=this.offsetHeight};const e=this.attachShadow({mode:"open"}),t=new CSSStyleSheet;t.replaceSync(s.Z),e.adoptedStyleSheets=[t],e.appendChild(a.content.cloneNode(!0)),this.firstElement=e.getElementById("first"),this.handleElement=e.getElementById("handle")}set handle(e){this.dragByHandle=e.toString().toLowerCase()!=="false"}get handle(){return this.dragByHandle}get value(){return this.exposure}set value(e){const t=parseFloat(e);t!==this.exposure&&(this.exposure=t,this.enableTransition(),this.setExposure())}get hover(){return this.slideOnHover}set hover(e){this.slideOnHover=e.toString().toLowerCase()!=="false",this.removeEventListener("mousemove",this.onMouseMove),this.slideOnHover&&this.addEventListener("mousemove",this.onMouseMove)}get direction(){return this.slideDirection}set direction(e){this.slideDirection=e.toString().toLowerCase(),this.slide(0),this.firstElement.classList.remove(...c),c.includes(this.slideDirection)&&this.firstElement.classList.add(this.slideDirection)}static get observedAttributes(){return["hover","direction"]}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),this.addEventListener("dragstart",(e=>(e.preventDefault(),!1))),new ResizeObserver(this.resetDimensions).observe(this),this.setExposure(0),this.keyboard=this.hasAttribute("keyboard")&&this.getAttribute("keyboard")==="disabled"?"disabled":"enabled",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("keyup",this.onKeyUp),this.addEventListener("focus",this.onFocus),this.addEventListener("blur",this.onBlur),this.addEventListener("touchstart",this.onTouchStart,{passive:!0}),this.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.addEventListener("touchend",this.onTouchEnd),this.addEventListener("mousedown",this.onMouseDown),this.handle=this.hasAttribute("handle")?this.getAttribute("handle"):this.dragByHandle,this.hover=this.hasAttribute("hover")?this.getAttribute("hover"):this.slideOnHover,this.direction=this.hasAttribute("direction")?this.getAttribute("direction"):this.slideDirection,this.resetDimensions(),this.classList.contains(o)||this.classList.add(o)}disconnectedCallback(){this.transitionTimer&&window.clearTimeout(this.transitionTimer)}attributeChangedCallback(e,t,i){e==="hover"&&(this.hover=i),e==="direction"&&(this.direction=i),e==="keyboard"&&(this.keyboard=i==="disabled"?"disabled":"enabled")}setExposure(e=0){var t;this.exposure=(t=this.exposure+e)<0?0:t>100?100:t,this.firstElement.style.setProperty("--exposure",100-this.exposure+"%")}slide(e=0){this.setExposure(e);const t=new Event("slide");this.dispatchEvent(t)}slideToPage(e){this.slideDirection==="horizontal"&&this.slideToPageX(e.x),this.slideDirection==="vertical"&&this.slideToPageY(e.y)}slideToPageX(e){const t=e-this.getBoundingClientRect().left-window.scrollX;this.exposure=t/this.imageWidth*100,this.slide(0)}slideToPageY(e){const t=e-this.getBoundingClientRect().top-window.scrollY;this.exposure=t/this.imageHeight*100,this.slide(0)}enableTransition(){this.firstElement.style.setProperty("--transition-time","100ms"),this.transitionTimer=window.setTimeout((()=>{this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)"),this.transitionTimer=null}),100)}startSlideAnimation(){let e=null,t=this.animationDirection;this.firstElement.style.setProperty("--transition-time","var(--keyboard-transition-time)");const i=r=>{if(this.animationDirection===0||t!==this.animationDirection)return;e===null&&(e=r);const h=(r-e)/16.666666666666668*this.animationDirection;this.slide(h),setTimeout((()=>window.requestAnimationFrame(i)),0),e=r};window.requestAnimationFrame(i)}stopSlideAnimation(){this.animationDirection=0,this.firstElement.style.setProperty("--transition-time","var(--default-transition-time)")}}))})()})()),g}var y=E();const D=x(y),k=S({__proto__:null,default:D},[y]);
1export{k as i};
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.