vendor: 21,461 bytes, lines 1-15
1var Te=Object.defineProperty;var Oe=(v,_,b)=>_ in v?Te(v,_,{enumerable:!0,configurable:!0,writable:!0,value:b}):v[_]=b;var w=(v,_,b)=>(Oe(v,typeof _!="symbol"?_+"":_,b),b),Ye=(v,_,b)=>{if(!_.has(v))throw TypeError("Cannot "+b)};var O=(v,_,b)=>{if(_.has(v))throw TypeError("Cannot add the same private member more than once");_ instanceof WeakSet?_.add(v):_.set(v,b)};var Y=(v,_,b)=>(Ye(v,_,"access private method"),b);(function(v,_){typeof exports=="object"&&typeof module<"u"?module.exports=_():typeof define=="function"&&define.amd?define(_):(v=typeof globalThis<"u"?globalThis:v||self,v.Zoomist=_())})(this,function(){var j,Lt,U,zt,k,Mt,G,Ct,F,It,P,xt,q,$t,K,Nt,J,Bt,Q,Wt,tt,Ht,et,Zt;"use strict";const v="",_=e=>{if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},b=e=>typeof e=="function",H=e=>!isNaN(Number(e)),it=e=>e==null,ot=e=>e instanceof HTMLElement?e:document.querySelector(e),at=(e,t)=>t?e.closest(`.${t}`):null,z=e=>"touches"in e?e.touches.length===0?{clientX:0,clientY:0}:e.touches.length===1?{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:{clientX:[...e.touches].reduce((t,s)=>t+s.clientX,0)/e.touches.length,clientY:[...e.touches].reduce((t,s)=>t+s.clientY,0)/e.touches.length}:{clientX:e.clientX,clientY:e.clientY},A=e=>{const{width:t,height:s,top:n,left:o,bottom:r}=e.getBoundingClientRect();return{width:t,height:s,top:n,left:o,bottom:r}},St=e=>e.touches.length>=2?Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY):0,x=(e,t)=>{for(const[s,n]of Object.entries(t))typeof n=="string"&&e.style.setProperty(s,n)},$=(e,t)=>{for(const[s,n]of Object.entries(t))e.setAttribute(s,n)},T=(e,t)=>{for(const[s,n]of Object.entries(t))e[s]=n},L=(e,t,s)=>Math.min(Math.max(e,t),s),X=e=>isNaN(e)?0:Math.round(e*100)/100,bt=e=>{throw new Error(e)},rt=e=>console.warn(e),N=(e="div",t,s,n)=>{const o=document.createElement(e);return t&&o.classList.add(...t.split(" ")),s&&$(o,s),n&&(o.innerHTML=n),o},E="zoomist",Vt=`${E}-container`,Tt=`${E}-wrapper`,lt=`${E}-image`,jt=`${E}-not-draggable`,Ut=`${E}-not-wheelable`,B=`${E}-slider`,kt=`${E}-slider-wrapper`,Gt=`${E}-slider-bar`,Ft=`${E}-slider-button`,Z=`${E}-zoomer`,Pt=`${E}-zoomer-button`,ct=`${E}-zoomer-icon`,ht=`${E}-zoomer-in`,ut=`${E}-zoomer-out`,dt=`${E}-zoomer-reset`,qt=`${E}-zoomer-disabled`,Kt={tabindex:"0",role:"slider","aria-label":"slider for zoomist","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0","aria-disabled":"false"},mt={tabindex:"0",role:"button",type:"button","aria-disabled":"false"},Jt={...mt,"aria-label":"button for zoom in zoomist"},Qt={...mt,"aria-label":"button for zoom out zoomist"},te={...mt,"aria-label":"button for reset zoomist scale"},M=typeof window<"u"&&typeof window.document<"u"&&"ontouchstart"in window,ee=M?"touchstart":"mousedown",Ot=M?"touchmove":"mousemove",Yt=M?"touchend":"mouseup",se="wheel",ne=["left","right","center"],ie=["top","bottom","center"],Xt="--scale",Dt="--translate-x",yt="--translate-y",oe="--value",wt={draggable:!0,wheelable:!0,pinchable:!0,bounds:!0,zoomRatio:.1,maxScale:10,minScale:1,initScale:null,dragReleaseOnBounds:!1,wheelReleaseOnMinMax:!1,disableDraggingClass:jt,disableWheelingClass:Ut,smooth:!1},ae={el:null,direction:"horizontal"},re={el:`.${B}`},le={el:null,inEl:null,outEl:null,resetEl:null,disabledClass:qt},ce={el:`.${Z}`,inEl:`.${ht}`,outEl:`.${ut}`,resetEl:`.${dt}`},he={ready:null,reset:null,resize:null,beforeDestroy:null,destroy:null,beforeUpdate:null,update:null,zoom:null,wheel:null,dragStart:null,drag:null,dragEnd:null,pinchStart:null,pinch:null,pinchEnd:null,slideStart:null,slide:null,slideEnd:null},ue={slider:null,zoomer:null},de=` 2<svg viewBox="0 0 12 12" class="${ct}"> 3 <polygon points="12,5.5 6.5,5.5 6.5,0 5.5,0 5.5,5.5 0,5.5 0,6.5 5.5,6.5 5.5,12 6.5,12 6.5,6.5 12,6.5 "/> 4</svg> 5`,me=` 6<svg viewBox="0 0 12 12" class="${ct}"> 7 <rect y="5.5" width="12" height="1"/> 8</svg> 9`,fe=` 10<svg viewBox="0 0 12 12" class="${ct}"> 11 <path d="m7.45,1.27l.35-.22c.26-.17.34-.52.17-.78-.17-.27-.52-.34-.78-.17l-1.54.99-.19.13-.11.46,1.12,1.75c.11.17.29.26.48.26.1,0,.21-.03.31-.09.26-.17.34-.52.17-.78l-.29-.46c1.85.5,3.22,2.17,3.22,4.18,0,2.39-1.95,4.34-4.34,4.34S1.66,8.92,1.66,6.52c0-1.15.44-2.23,1.25-3.05.22-.22.22-.58,0-.8-.22-.22-.58-.22-.8,0-1.02,1.03-1.58,2.4-1.58,3.85,0,3.02,2.46,5.48,5.48,5.48s5.48-2.46,5.48-5.48c0-2.51-1.71-4.62-4.02-5.26Z"/> 12</svg> 13`,ge={on(e,t){if(!t||!b(t))return this;const{__events__:s}=this;return e.split(" ").forEach(n=>{const o=n;s[o]||(s[o]=[]),s[o].push(t)}),this},emit(e,...t){const{__events__:s}=this;return s[e]?(s[e].forEach(n=>{b(n)&&n.apply(this,t)}),this):this},zoom(e,t){const{scale:s}=this.transform,n=this.useFixedRatio(X(s*(e+1)));return s===n?this:(this.zoomTo(n,t),this)},zoomTo(e,t=!0){const{image:s,transform:{scale:n,translateX:o,translateY:r},options:{bounds:i}}=this;if(e=this.useFixedRatio(e),e===n)return this;if(this.transform.scale=e,!t)return this.emit("zoom",this,this.transform.scale),this;t=typeof t=="boolean"?this.getContainerCenterClient():t;const{clientX:l,clientY:h}=t,{top:c,left:f,width:d,height:a}=A(s),{width:m,height:g}=this.getImageDiff(),p=e/n-1,D=(d/2-l+f)*p+o,u=(a/2-h+c)*p+r,S=i?L(D,m,-m):D,y=i?L(u,g,-g):u;return T(this.transform,{translateX:S,translateY:y}),this.emit("zoom",this,this.transform.scale),this},move(e){const{options:{bounds:t},transform:{translateX:s,translateY:n}}=this,{x:o,y:r}=e,{width:i,height:l}=this.getImageDiff();if(H(o)){const h=s+o,c=t?L(h,i,-i):h;this.transform.translateX=c}if(H(r)){const h=n+r,c=t?L(h,l,-l):h;this.transform.translateY=c}return this},moveTo(e){const{options:{bounds:t}}=this,{x:s,y:n}=e,{width:o,height:r}=this.getImageDiff();if(H(s)){const i=Number(s),l=t?L(i,o,-o):i;this.transform.translateX=l}if(H(n)){const i=Number(n),l=t?L(i,r,-r):i;this.transform.translateY=l}if(ne.some(i=>i===s)){const l={left:-o,right:o,center:0}[s];this.transform.translateX=l}if(ie.some(i=>i===n)){const l={top:-r,bottom:r,center:0}[n];this.transform.translateY=l}return this},slideTo(e){const{options:{minScale:t,maxScale:s}}=this,n=(s-t)*e/100+t;return this.zoomTo(n),this},reset(){const{options:{initScale:e}}=this;return T(this.transform,{scale:e,translateX:0,translateY:0}),this.emit("reset",this),this},destroy(e=!1){const{element:t,image:s,controller:n}=this;return this.mounted&&(this.emit("beforeDestroy",this),n.abort(),this.destroyModules(),e&&s&&(this.reset(),s.removeAttribute("style")),t[E]=null,this.mounted=!1,this.emit("destroy",this)),null},update(e){const{element:t,controller:s}=this;return this.emit("beforeUpdate",this),t[E]=null,this.mounted=!1,s.abort(),this.destroyModules(),e&&(this.options=Object.assign({},wt,_(e)&&e)),this.init(),this.emit("update",this),this},getImageData(){return{...this.data.imageData}},getContainerData(){return{...this.data.containerData}},getSliderValue(){const{__modules__:{slider:e}}=this;return e&&e.value!==void 0?e.value:null},isOnBoundTop(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateY:t}}=this,{height:s}=this.getImageDiff();return t*-1===X(s)},isOnBoundBottom(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateY:t}}=this,{height:s}=this.getImageDiff();return t===X(s)},isOnBoundLeft(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateX:t}}=this,{width:s}=this.getImageDiff();return t*-1===X(s)},isOnBoundRight(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateX:t}}=this,{width:s}=this.getImageDiff();return t===X(s)},isOnBoundX(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateX:t}}=this,{width:s}=this.getImageDiff();return Math.abs(t)===Math.abs(X(s))},isOnBoundY(){const{options:{bounds:e}}=this;if(!e)return!1;const{transform:{translateY:t}}=this,{height:s}=this.getImageDiff();return Math.abs(t)===Math.abs(X(s))},isOnMinScale(){const{options:{minScale:e}}=this,{transform:{scale:t}}=this;return t===e},isOnMaxScale(){const{options:{maxScale:e}}=this,{transform:{scale:t}}=this;return t===e},getImageDiff(){const{width:e,height:t}=this.getContainerData(),{width:s,height:n}=this.getImageData();return{width:(e-s)/2,height:(t-n)/2}},getContainerCenterClient(){const{element:e}=this,{top:t,left:s,width:n,height:o}=A(e);return{clientX:s+n/2,clientY:t+o/2}},getScaleRatio(){const{transform:{scale:e},options:{minScale:t,maxScale:s}}=this;return(e-t)/(s-t)},useFixedRatio(e){const{options:{minScale:t,maxScale:s}}=this;return L(e,t,s)},useAnimate(e){const{options:{smooth:t},transform:s}=this,o=(1100-(typeof t=="object"?Math.max(.1,Math.min(1,t.damping)):.6)*1e3)*.5,r=()=>{if(!this.states.dragging&&(Math.abs(e.velocityX)>.01||Math.abs(e.velocityY)>.01)){const i=Date.now(),l=i-e.lastTime,h=Math.exp(-l/o);e.velocityX*=h,e.velocityY*=h,e.lastTime=i;const c=e.velocityX*l,f=e.velocityY*l;if(this.moveTo({x:s.translateX+c,y:s.translateY+f}),Math.abs(e.velocityX)<.01&&Math.abs(e.velocityY)<.01){e.frame=null;return}}e.frame=requestAnimationFrame(r)};return r}},{defineProperty:V}=Object;class Rt{constructor(t,s){O(this,j);O(this,U);O(this,k);O(this,G);O(this,F);O(this,P);O(this,q);O(this,K);O(this,J);O(this,Q);O(this,tt);O(this,et);w(this,"element");w(this,"options");w(this,"wrapper");w(this,"image");w(this,"mounted");w(this,"data");w(this,"transform");w(this,"states");w(this,"controller");w(this,"__events__");w(this,"__modules__");if(!t)return bt("The first argument is required.");const n=ot(t);if(!n)return bt(`Element ${t} is not exist.`);this.element=n,this.options=Object.assign({},wt,_(s)&&s),this.init()}init(){const{element:t}=this,{options:{bounds:s,minScale:n,maxScale:o,initScale:r}}=this;if(t[E])return;t[E]=this;const i=t.querySelector(`.${Tt}`),l=t.querySelector(`.${lt}`);if(!i)return rt(`${E} needs a ".${Tt}" element.`);if(!l)return rt(`${E} needs a ".${lt}" element.`);this.options.minScale=s&&n<1?1:n,this.options.maxScale=Math.max(o,n),this.options.initScale=L(r||n,n,o),this.wrapper=i,this.image=l,Y(this,j,Lt).call(this)}destroyModules(){const{slider:t,zoomer:s}=this.__modules__;t&&this.destroySlider(),s&&this.destroyZoomer()}destroySlider(){var r,i;const{__modules__:{slider:t}}=this;if(!t||!t.mounted)return;const{options:{el:s},controller:n}=t;s===`.${B}`?(r=t.sliderEl)==null||r.remove():(i=t.sliderTrack)==null||i.remove(),n==null||n.abort(),t.mounted=!1}destroyZoomer(){const{__modules__:{zoomer:t}}=this;if(!t||!t.mounted)return;const{options:{el:s,inEl:n,outEl:o,resetEl:r},controller:i,zoomerEl:l,zoomerInEl:h,zoomerOutEl:c,zoomerResetEl:f}=t,d=(a,m,g)=>{a===`.${m}`&&(g==null||g.remove())};[{target:s,className:Z,el:l},{target:n,className:ht,el:h},{target:o,className:ut,el:c},{target:r,className:dt,el:f}].forEach(a=>d(a.target,a.className,a.el)),i==null||i.abort(),t.mounted=!1}}return j=new WeakSet,Lt=function(){const{element:t,image:s,options:n}=this,{draggable:o,pinchable:r}=n,{offsetWidth:i,offsetHeight:l}=t,{offsetWidth:h,offsetHeight:c}=s,{width:f,height:d}=A(s);if(!h||!c)return rt(`The width or height of ${lt} should not be 0.`);if(this.transform={scale:0,translateX:0,translateY:0},this.data={imageData:{originWidth:h,originHeight:c,width:f,height:d},containerData:{width:i,height:l}},M&&(o||r)&&(this.data.touchData={hypot:0,prevX:0,prevY:0,offsetX:0,offsetY:0,imageTop:0,imageLeft:0,widthDiff:0,heightDiff:0,lastTime:0,velocityX:0,velocityY:0,frame:null}),!M&&o&&(this.data.dragData={prevX:0,prevY:0,lastTime:0,velocityX:0,velocityY:0,frame:null}),this.__events__={...he},n.on)for(const[a,m]of Object.entries(n.on))this.__events__[a]=[m];if(this.__modules__={...ue},n.slider){const a=n.slider===!0?re:n.slider;this.__modules__.slider={options:Object.assign({},ae,a)}}if(n.zoomer){const a=n.zoomer===!0?ce:n.zoomer;this.__modules__.zoomer={options:Object.assign({},le,a)}}this.controller=new AbortController,Y(this,U,zt).call(this)},U=new WeakSet,zt=function(){if(this.mounted)return;const{element:t,image:s,options:{minScale:n,maxScale:o,initScale:r},__modules__:{slider:i,zoomer:l}}=this;x(s,{transform:` 14 translate(var(${Dt}, 0px), var(${yt}, 0px)) 15 scale(var(${Xt}, 0))`}),V(this.transform,"scale",{get:()=>this.transform.__scale__,set:h=>{const c=this.useFixedRatio(h);if(!(it(c)||this.transform.__scale__===c)){if(this.transform.__scale__=c,x(s,{[Xt]:c.toString()}),T(this.data.imageData,{width:A(s).width,height:A(s).height}),i){const f=Math.round(this.getScaleRatio()*100);i.value=f}if(l&&l.options.disabledClass){const{zoomerInEl:f,zoomerOutEl:d,zoomerResetEl:a,options:{disabledClass:m}}=l;f&&(f.classList[c===o?"add":"remove"](m),$(f,{"aria-disabled":c===o?"true":"false"})),d&&(d.classList[c===n?"add":"remove"](m),$(d,{"aria-disabled":c===n?"true":"false"})),a&&(a.classList[c===r?"add":"remove"](m),$(a,{"aria-disabled":c===r?"true":"false"}))}}}}),V(this.transform,"translateX",{get:()=>this.transform.__translateX__,set:h=>{const c=X(h);it(c)||this.transform.__translateX__===c||(this.transform.__translateX__=c,x(s,{[Dt]:`${c}px`}))}}),V(this.transform,"translateY",{get:()=>this.transform.__translateY__,set:h=>{const c=X(h);it(c)||this.transform.__translateY__===c||(this.transform.__translateY__=c,x(s,{[yt]:`${c}px`}))}}),Y(this,k,Mt).call(this),Y(this,K,Nt).call(this),T(this.transform,{scale:r,translateX:0,translateY:0}),t.classList.add(Vt),this.mounted=!0,this.emit("ready",this)},k=new WeakSet,Mt=function(){const{wrapper:t,options:s,controller:{signal:n}}=this,{draggable:o,pinchable:r,wheelable:i}=s;if(this.states={},i){this.states.wheeling=!1;const l=h=>Y(this,G,Ct).call(this,h);t.addEventListener(se,l,{signal:n})}if(M&&(o||r)){o&&(this.states.dragging=!1),r&&(this.states.pinching=!1);const l=h=>Y(this,P,xt).call(this,h);t.addEventListener("touchstart",l,{signal:n})}if(!M&&o){this.states.dragging=!1;const l=h=>Y(this,F,It).call(this,h);t.addEventListener("mousedown",l,{signal:n})}Y(this,q,$t).call(this)},G=new WeakSet,Ct=function(t){const{options:{zoomRatio:s,wheelReleaseOnMinMax:n,disableWheelingClass:o}}=this,r=(t.deltaY||t.detail)>0?-1:1;if(n){const i=this.isOnMinScale(),l=this.isOnMaxScale();i&&r===-1||l&&r===1||t.preventDefault()}else t.preventDefault();this.states.wheeling||at(t.target,o)||(this.states.wheeling=!0,setTimeout(()=>{this.states.wheeling=!1},30),this.zoom(r*s,z(t)),this.emit("wheel",this,this.transform.scale,t))},F=new WeakSet,It=function(t){const{data:s,transform:n,options:{disableDraggingClass:o,smooth:r}}=this,{dragData:i,imageData:l}=s;if(!i||!l)return;const h=d=>{if(d&&d.button!==0||(d.preventDefault(),at(d.target,o)))return;i.frame!==null&&cancelAnimationFrame(i.frame);const a=Date.now(),{clientX:m,clientY:g}=z(d);if(T(i,{prevX:m,prevY:g,lastTime:a,velocityX:0,velocityY:0,frame:null}),this.states.dragging=!0,r){const p=this.useAnimate(i);i.frame=requestAnimationFrame(p)}this.emit("dragStart",this,{x:n.translateX,y:n.translateY},d),document.addEventListener("mousemove",c),document.addEventListener("mouseup",f)},c=d=>{if(d.touches||!this.states.dragging)return;d.preventDefault();const a=Date.now(),{clientX:m,clientY:g}=z(d),p=m-i.prevX,D=g-i.prevY,u=a-i.lastTime,S=n.translateX+p,y=n.translateY+D;this.moveTo({x:S,y}),r&&u>0&&(i.velocityX=.8*(p/u)+.2*i.velocityX,i.velocityY=.8*(D/u)+.2*i.velocityY),T(i,{prevX:m,prevY:g,lastTime:a}),this.emit("drag",this,{x:S,y},d)},f=d=>{d.touches||(this.states.dragging=!1,this.emit("dragEnd",this,{x:n.translateX,y:n.translateY},d),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",f))};h(t)},P=new WeakSet,xt=function(t){const{data:s,transform:n,options:{maxScale:o,minScale:r,draggable:i,pinchable:l,bounds:h,dragReleaseOnBounds:c,disableDraggingClass:f,smooth:d}}=this,{touchData:a,imageData:m}=s;if(!a||!m)return;const g=u=>{if(!u.touches)return;if(h&&c){const I=this.isOnBoundX(),W=this.isOnBoundY();u.touches.length===1&&(I||W)||u.preventDefault()}else u.preventDefault();if(at(u.target,f)&&u.touches.length<=1)return;a.frame!==null&&cancelAnimationFrame(a.frame);const S=Date.now(),{top:y,left:R}=A(this.image),{width:C,height:ft}=this.getImageDiff(),{clientX:st,clientY:nt}=z(u);if(T(a,{hypot:St(u),prevX:st,prevY:nt,offsetX:0,offsetY:0,imageTop:y,imageLeft:R,widthDiff:C,heightDiff:ft,lastTime:S,velocityX:0,velocityY:0,frame:null}),i){if(this.states.dragging=!0,d){const I=this.useAnimate(a);a.frame=requestAnimationFrame(I)}this.emit("dragStart",this,{x:n.translateX,y:n.translateY},u)}l&&u.touches.length===2&&(this.states.pinching=!0,this.emit("pinchStart",this,n.scale,u)),document.addEventListener("touchmove",p),document.addEventListener("touchend",D)},p=u=>{if(!u.touches)return;const S=Date.now(),{states:{dragging:y,pinching:R}}=this,{top:C,left:ft}=A(this.image),{width:st,height:nt}=this.getImageDiff(),I=R&&u.touches.length!==2||!R&&u.touches.length===2,W=St(u),gt=W?W/a.hypot:1,_t=this.useFixedRatio(gt*n.scale),{clientX:pt,clientY:Et}=z(u),_e=pt+a.offsetX,pe=Et+a.offsetY;if(l&&u.touches.length===2&&(R||(this.states.pinching=!0,this.emit("pinchStart",this,n.scale,u)),this.zoomTo(_t,!1)),y){I&&(a.velocityX=0,a.velocityY=0);const At=_t!==o&&_t!==r&&l&&u.touches.length===2?gt:1,Ee=X(_e-a.imageLeft-(st-a.widthDiff)-(a.prevX-a.imageLeft)*At+n.translateX),ve=X(pe-a.imageTop-(nt-a.heightDiff)-(a.prevY-a.imageTop)*At+n.translateY);if(this.moveTo({x:Ee,y:ve}),d&&u.touches.length===1&&!I){const vt=S-a.lastTime;if(vt>0){const Se=pt-a.prevX,be=Et-a.prevY;a.velocityX=.8*(Se/vt)+.2*a.velocityX,a.velocityY=.8*(be/vt)+.2*a.velocityY}}}T(a,{hypot:W,prevX:pt,prevY:Et,imageTop:C,imageLeft:ft,widthDiff:st,heightDiff:nt,lastTime:S}),R&&u.touches.length===2&&this.emit("pinch",this,n.scale,u),y&&this.emit("drag",this,{x:n.translateX,y:n.translateY},u)},D=u=>{if(!u.touches)return;const{states:{dragging:S,pinching:y}}=this;if(y&&u.touches.length===1){this.states.pinching=!1;const{clientX:R,clientY:C}=z(u);T(a,{prevX:R,prevY:C,velocityX:0,velocityY:0,lastTime:Date.now()}),this.emit("pinchEnd",this,n.scale,u)}if(S&&!u.touches.length&&(this.states.dragging=!1,this.emit("dragEnd",this,{x:n.translateX,y:n.translateY},u)),S&&u.touches.length===1){const{clientX:R,clientY:C}=z(u);T(a,{offsetX:a.prevX-R,offsetY:a.prevY-C})}u.touches.length||(document.removeEventListener("touchmove",p),document.removeEventListener("touchend",D))};g(t)},q=new WeakSet,$t=function(){const{element:t,image:s,transform:n}=this;new ResizeObserver(()=>{const{offsetWidth:r,offsetHeight:i}=t,{width:l,height:h}=this.getContainerData();if(r===l&&i===h)return;const c=n.translateX,f=n.translateY;if(c){const p=r/l*c;this.transform.translateX=p}if(f){const p=i/h*f;this.transform.translateY=p}const{offsetWidth:d,offsetHeight:a}=s,{width:m,height:g}=A(s);T(this.data.containerData,{width:r,height:i}),T(this.data.imageData,{originWidth:d,originHeight:a,width:m,height:g}),this.emit("resize",this)}).observe(t)},K=new WeakSet,Nt=function(){const{slider:t,zoomer:s}=this.__modules__;t&&Y(this,J,Bt).call(this),s&&Y(this,tt,Ht).call(this)},J=new WeakSet,Bt=function(){const{element:t,__modules__:{slider:s}}=this;if(!s||s.mounted)return;const{options:{el:n,direction:o}}=s;if(!n)return;const r=n===`.${B}`,i=r?N("div",B):ot(n);if(!i)return;const l=N("div",kt),h=N("span",Gt),c=N("span",Ft,{...Kt,"aria-orientation":o});i.classList.add(`${B}-${o}`),V(s,"value",{get(){return s.__value__},set(f){s.__value__!==f&&(s.__value__=f,x(i,{[oe]:f.toString()}),$(c,{"aria-valuenow":f.toString()}))}}),T(s,{value:this.getScaleRatio()*100,controller:new AbortController,sliding:!1,sliderEl:i,sliderTrack:l,sliderButton:c}),Y(this,Q,Wt).call(this),l.append(h,c),i.append(l),r&&t.append(i),s.mounted=!0},Q=new WeakSet,Wt=function(){const{options:{minScale:t,maxScale:s},__modules__:{slider:n}}=this;if(!n)return;const{options:{direction:o},controller:r,sliderEl:i,sliderTrack:l}=n;if(!i||!l)return;const h=o==="vertical",c=m=>{const g=A(l),p=g[h?"height":"width"],D=g[h?"bottom":"left"],u=z(m)[h?"clientY":"clientX"],S=X(L((u-D)*(h?-1:1)/p,0,1));return(s-t)*S+t},f=m=>{if(m instanceof MouseEvent&&m.button!==0)return;n.sliding=!0;const g=c(m);this.zoomTo(g),this.emit("slideStart",this,this.getSliderValue(),m),document.addEventListener(Ot,d),document.addEventListener(Yt,a)},d=m=>{if(!n.sliding)return;const g=c(m);this.zoomTo(g),this.emit("slide",this,this.getSliderValue(),m)},a=m=>{this.emit("slideEnd",this,this.getSliderValue(),m),n.sliding=!1,document.removeEventListener(Ot,d),document.removeEventListener(Yt,a)};i.addEventListener(ee,f,{signal:r==null?void 0:r.signal})},tt=new WeakSet,Ht=function(){const{element:t,__modules__:{zoomer:s}}=this;if(!s||s.mounted)return;const{options:{el:n,inEl:o,outEl:r,resetEl:i}}=s,l=[o,r,i],h=(m,g,p,D,u)=>{if(!m)return null;const S=m===`.${p}`;return p=l.includes(m)?`${p} ${Pt}`:p,S?N(g,p,D,u):ot(m)},c=h(n,"div",Z),f=h(o,"button",ht,Jt,de),d=h(r,"button",ut,Qt,me),a=h(i,"button",dt,te,fe);T(s,{controller:new AbortController,zoomerEl:c,zoomerInEl:f,zoomerOutEl:d,zoomerResetEl:a}),c&&(f&&c.append(f),d&&c.append(d),a&&c.append(a),n===`.${Z}`&&t.append(c)),Y(this,et,Zt).call(this),s.mounted=!0},et=new WeakSet,Zt=function(){const{options:{zoomRatio:t},__modules__:{zoomer:s}}=this,n=this;if(!s)return;const{controller:o,zoomerInEl:r,zoomerOutEl:i,zoomerResetEl:l}=s;r&&r.addEventListener("click",()=>{n.zoom(t)},{signal:o==null?void 0:o.signal}),i&&i.addEventListener("click",()=>{n.zoom(-t)},{signal:o==null?void 0:o.signal}),l&&l.addEventListener("click",()=>{n.reset()},{signal:o==null?void 0:o.signal})},Object.assign(Rt.prototype,ge),Rt});
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.