PageSourceSearch

https://1narcology.ru/netcat_template/template/default/js/build/fancybox.min.js

js 1narcology.ru collected 2026-10-09 21:31:06 UTC 137,329 bytes, 2 lines download raw bytes

1((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})})(this,function(F){function j(e,t=void 0){return!(!e||e===document.body||t&&e===t)&&(B(e)?e:j(e.parentElement,t))}function c(e){var t=(new DOMParser).parseFromString(e,"text/html").body;if(1<t.childElementCount){for(var i=document.createElement("div");t.firstChild;)i.appendChild(t.firstChild);return i}return t.firstChild}let E=(e,t=1e4)=>(e=parseFloat(e+"")||0,Math.round((e+Number.EPSILON)*t)/t),B=function(e){var t,i;return!!(e&&e instanceof Element&&e.offsetParent)&&(t=e.scrollHeight>e.clientHeight,i=-1!==(e=window.getComputedStyle(e).overflowY).indexOf("hidden"),e=-1!==e.indexOf("visible"),t)&&!i&&!e},H=e=>(""+(e||"")).split(" ").filter(e=>!!e),g=(t,e,i)=>{t&&H(e).forEach(e=>{t.classList.toggle(e,i||!1)})};class s{constructor(e){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=e,this.pageX=e.pageX,this.pageY=e.pageY,this.clientX=e.clientX,this.clientY=e.clientY,this.id=self.Touch&&e instanceof Touch?e.identifier:-1,this.time=Date.now()}}let o={passive:!1};class N{constructor(e,{start:t=()=>!0,move:i=()=>{},end:n=()=>{}}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=e,this.startCallback=t,this.moveCallback=i,this.endCallback=n;for(let e of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[e]=this[e].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,o),this.element.addEventListener("touchstart",this.onTouchStart,o),this.element.addEventListener("touchmove",this.onMove,o),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(e){if(e.buttons&&0===e.button){let t=new s(e);this.currentPointers.some(e=>e.id===t.id)||this.triggerPointerStart(t,e)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}}onTouchStart(e){for(var t of Array.from(e.changedTouches||[]))this.triggerPointerStart(new s(t),e);window.addEventListener("blur",this.onWindowBlur)}onMove(e){let t=this.currentPointers.slice(),i="changedTouches"in e?Array.from(e.changedTouches||[]).map(e=>new s(e)):[new s(e)],n=[];for(let t of i){let e=this.currentPointers.findIndex(e=>e.id===t.id);e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(e,this.currentPointers.slice(),t)}onPointerEnd(e){0<e.buttons&&0!==e.button||(this.triggerPointerEnd(e,new s(e)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(e){for(var t of Array.from(e.changedTouches||[]))this.triggerPointerEnd(e,new s(t))}triggerPointerStart(e,t){return!!this.startCallback(t,e,this.currentPointers.slice())&&(this.currentPointers.push(e),this.startPointers.push(e),!0)}triggerPointerEnd(e,t){var i=this.currentPointers.findIndex(e=>e.id===t.id);i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(e,t,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){var e=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY}),e,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,o),this.element.removeEventListener("touchstart",this.onTouchStart,o),this.element.removeEventListener("touchmove",this.onMove,o),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function _(e,t){return t?Math.sqrt(Math.pow(t.clientX-e.clientX,2)+Math.pow(t.clientY-e.clientY,2)):0}function W(e,t){return t?{clientX:(e.clientX+t.clientX)/2,clientY:(e.clientY+t.clientY)/2}:e}function X(e,t){return e.split(".").reduce((e,t)=>
1"object"==typeof e?e[t]:void 0,t)}let q=e=>"object"==typeof e&&null!==e&&e.constructor===Object&&"[object Object]"===Object.prototype.toString.call(e),u=(n,...i)=>{let e=i.length;for(let t=0;t<e;t++){let e=i[t]||{};Object.entries(e).forEach(([e,t])=>{var i=Array.isArray(t)?[]:{};n[e]||Object.assign(n,{[e]:i}),q(t)?Object.assign(n[e],u(i,t)):Array.isArray(t)?Object.assign(n,{[e]:[...t]}):Object.assign(n,{[e]:t})})}return n};class Y{constructor(e={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(e);for(let e of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))e.startsWith("on")&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}setOptions(e){this.options=e?u({},this.constructor.defaults,e):{};for(let[e,t]of Object.entries(this.option("on")||{}))this.on(e,t)}option(e,...t){let i=X(e,this.options);return i=i&&"function"==typeof i?i.call(this,this,...t):i}optionFor(e,t,i,...n){let s=X(t,e),o;(s="false"===(s="true"===(s="string"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))?s:parseFloat(s))?!0:s)?!1:s)&&"function"==typeof s&&(s=s.call(this,this,e,...n));t=X(t,this.options);return t&&"function"==typeof t?s=t.call(this,this,e,...n,s):void 0===s&&(s=t),void 0===s?i:s}cn(e){var t=this.options.classes;return t&&t[e]||""}localize(t,i=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,(e,t,i)=>{let n="";return i?n=this.option(t[0]+t.toLowerCase().substring(1)+".l10n."+i):t&&(n=this.option("l10n."+t)),n=n||e});for(let e=0;e<i.length;e++)t=t.split(i[e][0]).join(i[e][1]);return t.replace(/\{\{(.*?)\}\}/g,(e,t)=>t)}on(e,i){let t=[];"string"==typeof e?t=e.split(" "):Array.isArray(e)&&(t=e),this.events||(this.events=new Map),t.forEach(e=>{let t=this.events.get(e);t||(this.events.set(e,[]),t=[]),t.includes(i)||t.push(i),this.events.set(e,t)})}off(e,i){let t=[];"string"==typeof e?t=e.split(" "):Array.isArray(e)&&(t=e),t.forEach(e=>{var t=this.events.get(e);if(Array.isArray(t)){let e=t.indexOf(i);-1<e&&t.splice(e,1)}})}emit(e,...t){[...this.events.get(e)||[]].forEach(e=>e(this,...t)),"*"!==e&&this.emit("*",e,...t)}}Object.defineProperty(Y,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(Y,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class V extends Y{constructor(e={}){super(e),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(e={}){var i,n,s=new Map;for([i,n]of Object.entries(e)){let e=this.option(i),t=this.plugins[i];t||!1===e?t&&!1===e&&(t.detach(),delete this.plugins[i]):s.set(i,new n(this,e||{}))}for(let[e,t]of s)this.plugins[e]=t,t.attach()}detachPlugins(e){for(var t of e=e||Object.keys(this.plugins)){let e=this.plugins[t];e&&e.detach(),delete this.plugins[t]}return this.emit("detachPlugins"),this}}var f,p;(i=f=f||{})[i.Init=0]="Init",i[i.Error=1]="Error",i[i.Ready=2]="Ready",i[i.Panning=3]="Panning",i[i.Mousemove=4]="Mousemove",i[i.Destroy=5]="Destroy";let m=["a","b","c","d","e","f"],Z={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},U={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:Z},$='<circle cx="25" cy="25" r="20"></circle>',G='<div class="f-spinner"><svg viewBox="0 0 50 50">'+$+$+"</svg></div>",d=e=>e&&null!==e&&e instanceof Element&&"nodeType"in e,v=(t,e)=>
1{t&&H(e).forEach(e=>{t.classList.remove(e)})},b=(t,e)=>{t&&H(e).forEach(e=>{t.classList.add(e)})},K={a:1,b:0,c:0,d:1,e:0,f:0},J=1e4,y="mousemove",Q="drag",ee="content",w="auto",te=null,ie=null;class x extends V{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return ie=null===ie?window.matchMedia("(hover: none)").matches:ie}get isMobile(){return te=null===te?/iPhone|iPad|iPod|Android/i.test(navigator.userAgent):te}get panMode(){return this.options.panMode!==y||this.isTouchDevice?Q:y}get panOnlyZoomed(){var e=this.options.panOnlyZoomed;return e===w?this.isTouchDevice:e}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){var{a:e,b:t}=this.current;return Math.sqrt(e*e+t*t)||1}get targetScale(){var{a:e,b:t}=this.target;return Math.sqrt(e*e+t*t)||1}get minScale(){return this.option("minScale")||1}get fullScale(){var e=this.contentRect;return e.fullWidth/e.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){var{containerRect:e,contentRect:t}=this,e=Math.max(e.height/t.fitHeight,e.width/t.fitWidth)||1;return Math.min(this.fullScale,e)}get isScaling(){return 1e-5<Math.abs(this.targetScale-this.scale)&&!this.isResting}get isContentLoading(){var e=this.content;return!!(e&&e instanceof HTMLImageElement)&&!e.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(var e of m){var t="e"==e||"f"===e?1e-4:1e-5;if(Math.abs(this.target[e]-this.current[e])>t)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:f.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},K)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},K)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({}
1,x.Plugins),i)),this.emit("attachPlugins"),this.emit("init");i=this.content;if(i.addEventListener("load",this.onLoad),i.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));let e=c(G);!t.contains(i)||i.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null==(t=i.parentElement)?void 0:t.insertBefore(e,i))||null}this.emit("beforeLoad")}else queueMicrotask(()=>{this.enable()})}initContent(){var e=this.container,t=this.cn(ee);let i=this.option(ee)||e.querySelector("."+t);if(i||(i=e.querySelector("img,picture")||e.firstElementChild)&&b(i,t),!(i=i instanceof HTMLPictureElement?i.querySelector("img"):i))throw new Error("No content found");this.content=i}onLoad(){var{spinner:e,container:t,state:i}=this;e&&(e.remove(),this.spinner=null),this.option("spinner")&&t.classList.remove(this.cn("isLoading")),this.emit("afterLoad"),i===f.Init?this.enable():this.updateMetrics()}onError(){this.state!==f.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=f.Error,this.emit("error"))}getNextScale(e){let{fullScale:t,targetScale:i,coverScale:n,maxScale:s,minScale:o}=this,a=o;switch(e){case"toggleMax":a=i-o<.5*(s-o)?s:o;break;case"toggleCover":a=i-o<.5*(n-o)?n:o;break;case"toggleZoom":a=i-o<.5*(t-o)?t:o;break;case"iterateZoom":var r=[1,t,s].sort((e,t)=>e-t),l=r.findIndex(e=>e>i+1e-5);a=r[l]||1}return a}attachObserver(){let e,t=()=>{var{container:e,containerRect:t}=this;return.1<Math.abs(t.width-e.getBoundingClientRect().width)||.1<Math.abs(t.height-e.getBoundingClientRect().height)};this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver(()=>{this.updateTimer||(t()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout(()=>{t()&&this.onResize(),this.updateTimer=null},500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))})),null!=(e=this.resizeObserver)&&e.observe(this.container)}detachObserver(){var e;null!=(e=this.resizeObserver)&&e.disconnect()}attachEvents(){var e=this.container;e.addEventListener("click",this.onClick,{passive:!1,capture:!1}),e.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new N(e,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(y,this.onMouseMove)}detachEvents(){var e=this.container;e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null!=(e=this.pointerTracker)&&e.stop(),this.pointerTracker=null,document.removeEventListener(y,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();var e,t=this.friction,i=this.option("maxVelocity");for(e of m)t?(this.velocity[e]*=1-t,i&&!this.isScaling&&(this.velocity[e]=Math.max(Math.min(this.velocity[e],i),-1*i)),this.current[e]+=this.velocity[e]):this.current[e]=this.target[e];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame(()=>this.animate()):this.stop("current")}setTargetForce(){for(var e of m)"e"===e&&this.isBouncingX||"f"===e&&this.isBouncingY||(this.velocity[e]=(1/(1-this.friction)-1)*(this.target[e]-this.current[e]))}checkBounds(e=0,t=0){var i=this.current,e=i.e+e,i=i.f+t,t=this.getBounds(),{x:n,y:s}=t,o=n.min,n=n.max,a=s.min,s=s.max;let r=0,l=0;return o!==1/0&&e<o?r=o-e:n!==1/0&&n<e&&(r=n-e),a!==1/0&&i<a?l=a-i:s!==1/0&&s<i&&(l=s-i),Math.abs(r)<1e-4&&(r=0),Math.abs(l)<1e-4&&(l=0),Object.assign(Object.assign({},t),{xDiff:r,yDiff:l,inBounds:!r&&!l})}clampTargetBounds(){var e=this.target,{x:t,y:i}=this.getBounds();t.min!==1/0&&(e.e=Math.max(e.e,t.min)),t.max!==1/0&&(e.e=Math.min(e.e,t.max)),i.min!==1/0&&(e.f=Math.max(e.f,i.min)),i.max!==1/0&&(e.f=Math.min(e.f,i.max))}calculateContentDim(u=this.current){let{content:p,contentRect:e}=this,{fitWidth:g,fitHeight:m,fullWidth:f,fullHeight:v}=e,b=f,y=v;
1if(this.option("zoom")||0!==this.angle){let e=!(p instanceof HTMLImageElement||"none"!==window.getComputedStyle(p).maxWidth&&"none"!==window.getComputedStyle(p).maxHeight),t=e?f:g,i=e?v:m,n=this.getMatrix(u),s=new DOMPoint(0,0).matrixTransform(n),o=new DOMPoint(0+t,0).matrixTransform(n),a=new DOMPoint(0+t,0+i).matrixTransform(n),r=new DOMPoint(0,0+i).matrixTransform(n),l=Math.abs(a.x-s.x),h=Math.abs(a.y-s.y),c=Math.abs(r.x-o.x),d=Math.abs(r.y-o.y);b=Math.max(l,c),y=Math.max(h,d)}return{contentWidth:b,contentHeight:y}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===y||this.targetScale<this.scale)this.isBouncingX=!1,this.isBouncingY=!1;else{var i=this.target,{x:n,y:s,xDiff:o,yDiff:a}=this.checkBounds(),r=this.option("maxVelocity");let e=this.velocity.e,t=this.velocity.f;0!==o?(this.isBouncingX=!0,o*e<=0?e+=.14*o:(e=.14*o,n.min!==1/0&&(this.target.e=Math.max(i.e,n.min)),n.max!==1/0&&(this.target.e=Math.min(i.e,n.max))),r&&(e=Math.max(Math.min(e,r),-1*r))):this.isBouncingX=!1,0!==a?(this.isBouncingY=!0,a*t<=0?t+=.14*a:(t=.14*a,s.min!==1/0&&(this.target.f=Math.max(i.f,s.min)),s.max!==1/0&&(this.target.f=Math.min(i.f,s.max))),r&&(t=Math.max(Math.min(t,r),-1*r))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=e),this.isBouncingY&&(this.velocity.f=t)}}enable(){let e=this.content,t=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);for(let e of m)this.current[e]=this.target[e]=t[e];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=f.Ready,this.emit("ready")}onClick(n){"click"===n.type&&0===n.detail&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&(null!=(t=this.pointerTracker)&&t.clear(),this.trackingPoints=[],this.startDecelAnim());let e=n.target;if(e&&!n.defaultPrevented)if(e.hasAttribute("disabled"))n.preventDefault(),n.stopPropagation();else if(!(t=window.getSelection())||"Range"!==t.type||e.closest("button")){var t,i=e.closest("[data-panzoom-action]"),s=e.closest("[data-panzoom-change]"),i=i||s,s=i&&d(i)?i.dataset:null;if(s){let t=s.panzoomChange,e=s.panzoomAction;if((t||e)&&n.preventDefault(),t){let e={};try{e=JSON.parse(t)}catch(n){console&&console.warn("The given data was not valid JSON")}return void this.applyChange(e)}if(e)return void(this[e]&&this[e]())}if(3<Math.abs(this.dragOffset.x)||3<Math.abs(this.dragOffset.y))n.preventDefault(),n.stopPropagation();else if(!e.closest("[data-fancybox]")){i=this.content.getBoundingClientRect(),s=this.dragStart;if(!s.time||this.canZoomOut()||!(2<Math.abs(i.x-s.x)||2<Math.abs(i.y-s.y))){this.dragStart.time=0;let e=e=>{this.option("zoom",n)&&e&&"string"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&"function"==typeof this[e]&&(n.preventDefault(),this[e]({event:n}))},t=this.option("click",n),i=this.option("dblClick",n);i?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout(()=>{1===this.clicks?(this.emit("click",n),!n.defaultPrevented&&t&&e(t)):(this.emit("dblClick",n),n.defaultPrevented||e(i)),this.clicks=0,this.clickTimer=null},350))):(this.emit("click",n),!n.defaultPrevented&&t&&e(t))}}}}addTrackingPoint(e){var t=this.trackingPoints.filter(e=>e.time>Date.now()-100);t.push(e),this.trackingPoints=t}onPointerDown(e,t,i){if(!1===this.option("touch",e))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];var n=this.content.getBoundingClientRect();if(this.dragStart={x:n.x,y:n.y,top:n.top,left:n.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===y&&1<this.targetScale)return e.preventDefault(),e.stopPropagation(),!1;n=e.composedPath()[0];if(!i.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(n.nodeName)||n.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;null!=(i=window.getSelection())&&i.removeAllRanges()}if("mousedown"===e.type)["A","BUTTON"].includes(n.nodeName)||e.preventDefault();else if(.3<Math.abs(this.velocity.a))return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(t),this.emit
1("touchStart",e)),!0}onPointerMove(a,r,l){if(!1!==this.option("touch",a)&&this.isDragging&&!(r.length<2&&this.panOnlyZoomed&&E(this.targetScale)<=E(this.minScale)||(this.emit("touchMove",a),a.defaultPrevented))){this.addTrackingPoint(r[0]);var h=this.content,c=W(l[0],l[1]),d=W(r[0],r[1]);let t=0,i=0;if(1<r.length){let e=h.getBoundingClientRect();t=c.clientX-e.left-.5*e.width,i=c.clientY-e.top-.5*e.height}var h=_(l[0],l[1]),l=_(r[0],r[1]);let e=h?l/h:1,n=d.clientX-c.clientX,s=d.clientY-c.clientY,o=(this.dragOffset.x+=n,this.dragOffset.y+=s,this.dragOffset.time=Date.now()-this.dragStart.time,E(this.targetScale)===E(this.minScale)&&this.option("lockAxis"));if(o&&!this.lockedAxis)if("xy"===o||"y"===o||"touchmove"===a.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void a.preventDefault();let e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=45<e&&e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,n=0,s=0}else this.lockedAxis=o;j(a.target,this.content)&&(o="x",this.dragOffset.y=0),o&&"xy"!==o&&this.lockedAxis!==o&&E(this.targetScale)===E(this.minScale)||(a.cancelable&&a.preventDefault(),this.container.classList.add(this.cn("isDragging")),r=this.checkBounds(n,s),this.option("rubberband")?("x"!==this.isInfinite&&(0<r.xDiff&&n<0||r.xDiff<0&&0<n)&&(n*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*r.xDiff))),"y"!==this.isInfinite&&(0<r.yDiff&&s<0||r.yDiff<0&&0<s)&&(s*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*r.yDiff)))):(r.xDiff&&(n=0),r.yDiff&&(s=0)),l=this.targetScale,h=this.minScale,d=this.maxScale,l<.5*h&&(e=Math.max(e,h)),1.5*d<l&&(e=Math.min(e,d)),"y"===this.lockedAxis&&E(l)===E(h)&&(n=0),"x"===this.lockedAxis&&E(l)===E(h)&&(s=0),this.applyChange({originX:t,originY:i,panX:n,panY:s,scale:e,friction:this.option("dragFriction"),ignoreBounds:!0}))}}onPointerUp(e,t,i){i.length?(this.dragOffset.x=0,this.dragOffset.y=0,this.trackingPoints=[]):(this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(t),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),j(e.target,this.content)&&"y"===this.lockedAxis&&(this.trackingPoints=[]),this.emit("touchEnd",e),this.isDragging=!1,this.lockedAxis=!1,this.state!==f.Destroy)&&!e.defaultPrevented&&this.startDecelAnim())}startDecelAnim(){var e=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(let e of m)this.velocity[e]=0;this.target.e=this.current.e,this.target.f=this.current.f,v(this.container,"is-scaling"),v(this.container,"is-animating"),this.isTicking=!1;var t=this.trackingPoints,i=t[0],t=t[t.length-1];let n=0,s=0,o=0;t&&i&&(n=t.clientX-i.clientX,s=t.clientY-i.clientY,o=t.time-i.time);t=(null==(d=window.visualViewport)?void 0:d.scale)||1;1!==t&&(n*=t,s*=t);let a=0,r=0,l=0,h=0,c=this.option("decelFriction");i=this.targetScale;if(0<o){l=3<Math.abs(n)?n/(o/30):0,h=3<Math.abs(s)?s/(o/30):0;let e=this.option("maxVelocity");e&&(l=Math.max(Math.min(l,e),-1*e),h=Math.max(Math.min(h,e),-1*e))}l&&(a=l/(1/(1-c)-1)),h&&(r=h/(1/(1-c)-1)),("y"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"y"===this.lockedAxis&&E(i)===this.minScale)&&(a=l=0),("x"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"x"===this.lockedAxis&&E(i)===this.minScale)&&(r=h=0);var d=this.dragOffset.x,t=this.dragOffset.y,u=this.option("dragMinThreshold")||0;Math.abs(d)<u&&Math.abs(t)<u&&(a=r=0,l=h=0),(this.option("zoom")&&(i<this.minScale-1e-5||i>this.maxScale+1e-5)||e&&!a&&!r)&&(c=.35),this.applyChange({panX:a,panY:r,friction:c}),this.emit("decel",l,h,d,t)}onWheel(e){var t=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(e,t){return Math.abs(t)>Math.abs(e)?t:e}),t=Math.max(-1,Math.min(1,t));this.emit("wheel",e,t),this.panMode===y||e.defaultPrevented||("pan"===(t=this.option("wheel"))?(e.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-e.deltaX,panY:2*-e.deltaY,bounce:!1})):"zoom"===t&&!1!==this.option("zoom")&&this.zoomWithWheel(e))}onMouseMove(e){this.panWithMouse(e)}onKeydown(e){"Escape"===e.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}
1setTransform(){this.emit("beforeTransform");let{current:i,target:n,content:e,contentRect:t}=this,s=Object.assign({},K);for(let t of m){let e="e"==t||"f"===t?J:1e5;s[t]=E(i[t],e),Math.abs(n[t]-i[t])<("e"==t||"f"===t?.51:.001)&&(i[t]=n[t])}let{a:o,b:a,c:r,d:l,e:h,f:c}=s,d=`matrix(${o}, ${a}, ${r}, ${l}, ${h}, ${c})`,u=e.parentElement instanceof HTMLPictureElement?e.parentElement:e;var p,g;(u=this.option("transformParent")?u.parentElement||u:u).style.transform!==d&&(u.style.transform=d,{contentWidth:p,contentHeight:g}=this.calculateContentDim(),t.width=p,t.height=g,this.emit("afterTransform"))}updateMetrics(r=!1){if(this&&this.state!==f.Destroy&&!this.isContentLoading){var l=Math.max(1,(null==(l=window.visualViewport)?void 0:l.scale)||1),{container:h,content:c}=this,d=c instanceof HTMLImageElement,h=h.getBoundingClientRect(),u=getComputedStyle(this.container),p=h.width*l,g=h.height*l,m=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom),u=p-(parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)),u=(this.containerRect={width:p,height:g,innerWidth:u,innerHeight:g-m},parseFloat(c.dataset.width||"")||((p=c)instanceof HTMLImageElement?p.naturalWidth:p instanceof SVGElement?p.width.baseVal.value:Math.max(p.offsetWidth,p.scrollWidth))||0),m=parseFloat(c.dataset.height||"")||((g=c)instanceof HTMLImageElement?g.naturalHeight:g instanceof SVGElement?g.height.baseVal.value:Math.max(g.offsetHeight,g.scrollHeight))||0;let e=this.option("width",u)||w,t=this.option("height",m)||w;p=e===w,g=t===w;"number"!=typeof e&&(e=u),"number"!=typeof t&&(t=m),p&&(e=u*(t/m)),g&&(t=m/(u/e));let i=c.parentElement instanceof HTMLPictureElement?c.parentElement:c;p=(i=this.option("transformParent")?i.parentElement||i:i).getAttribute("style")||"",g=(i.style.setProperty("transform","none","important"),d&&(i.style.width="",i.style.height=""),i.offsetHeight,c.getBoundingClientRect());let n=g.width*l,s=g.height*l,o=n,a=s;n=Math.min(n,e),s=Math.min(s,t),d?{width:n,height:s}=((e,t,i,n)=>{i=Math.min(i/e,n/t);return{width:e*=i,height:t*=i}})(e,t,n,s):(n=Math.min(n,e),s=Math.min(s,t));m=.5*(a-s),u=.5*(o-n);this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:g.top-h.top+m,bottom:h.bottom-g.bottom+m,left:g.left-h.left+u,right:h.right-g.right+u,fitWidth:n,fitHeight:s,width:n,height:s,fullWidth:e,fullHeight:t}),i.style.cssText=p,d&&(i.style.width=n+"px",i.style.height=s+"px"),this.setTransform(),!0!==r&&this.emit("refresh"),this.ignoreBounds||(E(this.targetScale)<E(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===f.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}}calculateBounds(){var{contentWidth:a,contentHeight:r}=this.calculateContentDim(this.target),{targetScale:l,lockedAxis:h}=this,{fitWidth:c,fitHeight:d}=this.contentRect;let u=0,p=0,g=0,m=0;var f=this.option("infinite");if(!0===f||h&&f===h)u=-1/0,g=1/0,p=-1/0,m=1/0;else{let{containerRect:e,contentRect:t}=this,i=E(c*l,J),n=E(d*l,J),{innerWidth:s,innerHeight:o}=e;e.width===i&&(s=e.width),e.width===n&&(o=e.height),a>s&&(g=.5*(a-s),u=-1*g,f=.5*(t.right-t.left),u+=f,g+=f),c>s&&a<s&&(u-=.5*(c-s),g-=.5*(c-s)),r>o&&(m=.5*(r-o),p=-1*m,h=.5*(t.bottom-t.top),p+=h,m+=h),d>o&&r<o&&(u-=.5*(d-o),g-=.5*(d-o))}return{x:{min:u,max:g},y:{min:p,max:m}}}getBounds(){var e=this.option("bounds");return e!==w?e:this.calculateBounds()}updateControls(){let e=this,t=e.container,{panMode:i,contentRect:n,targetScale:s,minScale:o}=e,a=o,r=e.option("click")||!1,l=(r&&(a=e.getNextScale(r)),e.canZoomIn()),h=e.canZoomOut(),c=i===Q&&!!this.option("touch"),d=h&&c;if(c&&(E(s)<E(o)&&!this.panOnlyZoomed&&(d=!0),E(n.width,1)>E(n.fitWidth,1)||E(n.height,1)>E(n.fitHeight,1))&&(d=!0),E(n.width*s,1)<E(n.fitWidth,1)&&(d=!1),i===y&&(d=!1),g(t,this.cn("isDraggable"),d),this.option("zoom")){var u=l&&E(a)>E(s),p=!u&&!d&&h&&E(a)<E(s);g(t,this.cn("canZoomIn"),u),g(t,this.cn("canZoomOut"),p);for(let n of t.querySelectorAll("[data-panzoom-action]")){let t=!1,i=!1;switch(n.dataset.panzoomAction){case"zoomIn":l?t=!0:i=!0;break;case"zoomOut":h?t=!0:i=!0;break;case"toggleZoom":case"iterateZoom":l||h?t=!0:i=!0;let e=n.querySelector("g");e&&(e.style.display=l?"":"none")}t?(n.removeAttribute("disabled"),n.removeAttribute("tabindex")):i&&(n.setAttribute("disabled",""),n.setAttribute("tabindex","-1"))}}}panTo({x:e=this.target.e,y:t=this.target.f,scale:i=this.targetScale,friction:n=this.option("friction"),angle:s=0,originX:o=0,originY:a=0,flipX:r=!1,flipY:l=!1,ignoreBounds:h=!1}){this.state!==f.Destroy&&this.applyChange({panX:e-this.target.e,panY:t-this.target.f,scale:i/this.targetScale,angle:s,originX:o,originY:a,friction:n,flipX:r,flipY:l,ignoreBounds:h})}applyChange({panX:e=0,panY:i=0,scale:n=1,angle:s=0,originX:o=-this.current.e,originY:a=-this.current.f,friction:r=this.option("friction"),flipX:l=!1,flipY:h=!1,ignoreBounds:c=!1,bounce:d=this.option("bounce")}){var u=this.state;if(u!==f.Destroy){this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=r||0,this.ignoreBounds=c;var r=this.current,p=r.e,r=r.f,g=this.getMatrix(this.target);let t=(new DOMMatrix).translate(p,r).translate(o,a).translate(e,i);
1if(this.option("zoom")){if(!c){let e=this.targetScale,t=this.minScale,i=this.maxScale;e*(n=e*n<t?t/e:n)>i&&(n=i/e)}t=t.scale(n)}t=t.translate(-o,-a).translate(-p,-r).multiply(g),s&&(t=t.rotate(s)),l&&(t=t.scale(-1,1)),h&&(t=t.scale(1,-1));for(let e of m)"e"!==e&&"f"!==e&&(t[e]>this.minScale+1e-5||t[e]<this.minScale-1e-5)?this.target[e]=t[e]:this.target[e]=E(t[e],J);(this.targetScale<this.scale||.1<Math.abs(n-1)||this.panMode===y||!1===d)&&!c&&this.clampTargetBounds(),u===f.Init?this.animate():this.isResting||(this.state=f.Panning,this.requestTick())}}stop(t=!1){if(this.state!==f.Init&&this.state!==f.Destroy){let e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(let e of m)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.setTransform(),v(this.container,"is-scaling"),v(this.container,"is-animating"),this.isTicking=!1,this.state=f.Ready,e&&(this.emit("endAnimation"),this.updateControls())}}
1requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),b(this.container,"is-animating"),this.isScaling&&b(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame(()=>this.animate()))}panWithMouse(i,n=this.option("mouseMoveFriction")){if(this.pmme=i,this.panMode===y&&i&&!(E(this.targetScale)<=E(this.minScale))){this.emit("mouseMove",i);var{container:s,containerRect:o,contentRect:a}=this,r=o.width,o=o.height,s=s.getBoundingClientRect(),l=(i.clientX||0)-s.left,i=(i.clientY||0)-s.top;let{contentWidth:e,contentHeight:t}=this.calculateContentDim(this.target);s=this.option("mouseMoveFactor"),s=(1<s&&(e!==r&&(e*=s),t!==o)&&(t*=s),.5*(e-r)-l/r*100/100*(e-r)),l=(s+=.5*(a.right-a.left),.5*(t-o)-i/o*100/100*(t-o));l+=.5*(a.bottom-a.top),this.applyChange({panX:s-this.target.e,panY:l-this.target.f,friction:n})}}zoomWithWheel(t){if(this.state!==f.Destroy&&this.state!==f.Init){var i=Date.now();if(i-this.pwt<45)t.preventDefault();else{this.pwt=i;var i=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce(function(e,t){return Math.abs(t)>Math.abs(e)?t:e}),i=Math.max(-1,Math.min(1,i)),{targetScale:n,maxScale:s,minScale:o}=this;let e=n*(100+45*i)/100;e=E(e)<E(o)&&E(n)<=E(o)?(this.cwd+=Math.abs(i),o):E(e)>E(s)&&E(n)>=E(s)?(this.cwd+=Math.abs(i),s):(this.cwd=0,Math.max(Math.min(e,s),o)),this.cwd>this.option("wheelLimit")||(t.preventDefault(),E(e)!==E(n)&&this.zoomTo(e,{event:t}))}}}canZoomIn(){return this.option("zoom")&&(E(this.contentRect.width,1)<E(this.contentRect.fitWidth,1)||E(this.targetScale)<E(this.maxScale))}canZoomOut(){return this.option("zoom")&&E(this.targetScale)>E(this.minScale)}zoomIn(e=1.25,t){this.zoomTo(this.targetScale*e,t)}zoomOut(e=.8,t){this.zoomTo(this.targetScale*e,t)}zoomToFit(e){this.zoomTo("fit",e)}zoomToCover(e){this.zoomTo("cover",e)}zoomToFull(e){this.zoomTo("full",e)}zoomToMax(e){this.zoomTo("max",e)}toggleZoom(e){this.zoomTo(this.getNextScale("toggleZoom"),e)}toggleMax(e){this.zoomTo(this.getNextScale("toggleMax"),e)}toggleCover(e){this.zoomTo(this.getNextScale("toggleCover"),e)}iterateZoom(e){this.zoomTo("next",e)}zoomTo(o=1,{friction:a=w,originX:r=w,originY:l=w,event:h}={}){if(!this.isContentLoading&&this.state!==f.Destroy){let{targetScale:e,fullScale:t,maxScale:i,coverScale:n}=this;if(this.stop(),(h=this.panMode===y?this.pmme||h:h)||r===w||l===w){let e=this.content.getBoundingClientRect(),t=this.container.getBoundingClientRect(),i=h?h.clientX:t.left+.5*t.width,n=h?h.clientY:t.top+.5*t.height;r=i-e.left-.5*e.width,l=n-e.top-.5*e.height}let s=1;"number"==typeof o?s=o:"full"===o?s=t:"cover"===o?s=n:"max"===o?s=i:"fit"===o?s=1:"next"===o&&(s=this.getNextScale("iterateZoom")),s=s/e||1,a=a===w?1<s?.15:.25:a,this.applyChange({scale:s,originX:r,originY:l,friction:a}),h&&this.panMode===y&&this.panWithMouse(h,a)}}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");var{containerRect:e,contentRect:t,target:i}=this;this.applyChange({panX:.5*e.width-(t.left+.5*t.fitWidth)-i.e,panY:.5*e.height-(t.top+.5*t.fitHeight)-i.f,scale:e.width/t.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");var{containerRect:e,contentRect:t,target:i}=this;this.applyChange({panX:.5*e.width-(t.left+.5*t.fitWidth)-i.e,panY:.5*e.innerHeight-(t.top+.5*t.fitHeight)-i.f,scale:e.height/t.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){var e=this.container,t=this.cn("inFullscreen"),i=this.cn("htmlHasFullscreen"),e=(e.classList.toggle(t),e.classList.contains(t));e?(document.documentElement.classList.add(i),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(e?"enterFS":"exitFS")}getMatrix(e=this.current){var{a:e,b:t,c:i,d:n,e:s,f:o}=e;return new DOMMatrix([e,t,i,n,s,o])}reset(e){if(this.state!==f.Init&&this.state!==f.Destroy){this.stop("current");for(let e of m)this.target[e]=K[e];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===e?this.option("friction"):e,this.state=f.Panning,this.requestTick())}}destroy(){this.stop(),this.state=f.Destroy,this.detachEvents(),this.detachObserver();let{container:t,content:e}=this,i=this.option("classes")||{};for(let e of Object.values(i))t.classList.remove(e+"");e&&(e.removeEventListener("load",this.onLoad),e.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(x,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:U}),Object.defineProperty(x,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});function ne(t,i){let n=!0;return(...e)=>{n&&(n=!1,t(...e),setTimeout(()=>{n=!0},i))}}let se=(e,t)=>{let i=[];
1return e.childNodes.forEach(e=>{e.nodeType!==Node.ELEMENT_NODE||t&&!e.matches(t)||i.push(e)}),i},oe=((i=p=p||{})[i.Init=0]="Init",i[i.Ready=1]="Ready",i[i.Destroy=2]="Destroy",e=>{var t;return"string"==typeof e||e instanceof HTMLElement?e={html:e}:void 0!==(t=e.thumb)&&("string"==typeof t&&(e.thumbSrc=t),t instanceof HTMLImageElement&&(e.thumbEl=t,e.thumbElSrc=t.src,e.thumbSrc=t.src),delete e.thumb),Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},e)});class e extends Y{constructor(e,t){super(t),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(){}detach(){}}var S,P;class ae extends e{constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let e=this.list;var t;return e||(e=document.createElement("ul"),b(e,this.cn("list")),e.setAttribute("role","tablist"),(t=this.instance.container).appendChild(e),b(t,this.cn("hasDots")),this.list=e),e}refresh(){var n;let t=this.instance.pages.length,e=Math.min(2,this.option("minCount")),i=Math.max(2e3,this.option("maxCount")),o=this.option("dynamicFrom");if(t<e||t>i)this.cleanup();else{var a="number"==typeof o&&5<t&&t>=o,r=!this.list||this.isDynamic!==a||this.list.children.length!==t,l=(r&&this.cleanup(),this.build());if(g(l,this.cn("isDynamic"),!!a),r)for(let e=0;e<t;e++)l.append(this.createItem(e));let s,i=0;for(let t of[...l.children]){let e=i===this.instance.page;e&&(s=t),g(t,this.cn("isCurrent"),e),null!=(n=t.children[0])&&n.setAttribute("aria-selected",e?"true":"false");for(let e of["isBeforePrev","isPrev","isNext","isAfterNext"])v(t,this.cn(e));i++}if(s=s||l.firstChild,a&&s){let e=s.previousElementSibling,t=e&&e.previousElementSibling,i=(b(e,this.cn("isPrev")),b(t,this.cn("isBeforePrev")),s.nextElementSibling),n=i&&i.nextElementSibling;b(i,this.cn("isNext")),b(n,this.cn("isAfterNext"))}this.isDynamic=a}}createItem(e=0){var t=document.createElement("li"),e=(t.setAttribute("role","presentation"),c(this.instance.localize(this.option("dotTpl"),[["%d",e+1]]).replace(/\%i/g,e+"")));return t.appendChild(e),null!=(e=t.children[0])&&e.setAttribute("role","tab"),t}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,v(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(ae,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2}});let re="disabled",le="next",he="prev";class ce extends e{constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){var e,t,i=this.instance,n=i.pages.length,s=i.page;n<2?this.cleanup():(this.build(),e=this.prev,t=this.next,e&&t&&(e.removeAttribute(re),t.removeAttribute(re),i.isInfinite||(s<=0&&e.setAttribute(re,""),n-1<=s&&t.setAttribute(re,""))))}addBtn(e){var t=this.instance,i=document.createElement("button"),n=(i.setAttribute("tabindex","0"),i.setAttribute("title",t.localize(`{{${e.toUpperCase()}}}`)),b(i,this.cn("button")+" "+this.cn(e===le?"isNext":"isPrev")),t.isRTL?e===le?he:le:e);return i.innerHTML=t.localize(this.option(n+"Tpl")),i.dataset["carousel"+((t=e)?t.match("^[a-z]")?t.charAt(0).toUpperCase()+t.substring(1):t:"")]="true",null!=(n=this.container)&&n.appendChild(i),i}build(){var e=this.instance.container,t=this.cn("container");let{container:i,prev:n,next:s}=this;i||(i=e.querySelector("."+t),this.isDom=!!i),i||(i=document.createElement("div"),b(i,t),e.appendChild(i)),this.container=i,s=(s=s||i.querySelector("[data-carousel-next]"))||this.addBtn(le),this.next=s,n=(n=n||i.querySelector("[data-carousel-prev]"))||this.addBtn(he),this.prev=n}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(ce,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>
1',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class de extends e{constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(e){this.target=this.instance,this.nav=e,this.attachEvents()}addAsNavFor(e){this.nav=this.instance,this.target=e,this.attachEvents()}attachEvents(){var{nav:e,target:t}=this;e&&t&&(e.options.initialSlide=t.options.initialPage,e.state===p.Ready?this.onNavReady(e):e.on("ready",this.onNavReady),t.state===p.Ready?this.onTargetReady(t):t.on("ready",this.onTargetReady))}onNavReady(e){e.on("createSlide",this.onNavCreateSlide),e.on("Panzoom.click",this.onNavClick),e.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(e){e.on("change",this.onTargetChange),e.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(e,t,i){this.onNavTouch(e,e.panzoom,i)}onNavTouch(e,t,i){var n,s,o;3<Math.abs(t.dragOffset.x)||3<Math.abs(t.dragOffset.y)||(t=i.target,{nav:n,target:s}=this,n&&s&&t&&(t=t.closest("[data-index]"),i.stopPropagation(),i.preventDefault(),t)&&(i=parseInt(t.dataset.index||"",10)||0,t=s.getPageForSlide(i),o=n.getPageForSlide(i),n.slideTo(o),s.slideTo(t,{friction:(null==(o=null==(n=this.nav)?void 0:n.plugins)?void 0:o.Sync.option("friction"))||0}),this.markSelectedSlide(i)))}onNavCreateSlide(e,t){t.index===this.selectedIndex&&this.markSelectedSlide(t.index)}onTargetChange(){var e,t,{target:i,nav:n}=this;i&&n&&n.state===p.Ready&&i.state===p.Ready&&(e=null==(e=null==(e=i.pages[i.page])?void 0:e.slides[0])?void 0:e.index,t=n.getPageForSlide(e),this.markSelectedSlide(e),n.slideTo(t,null===n.prevPage&&null===i.prevPage?{friction:0}:void 0))}markSelectedSlide(t){var e=this.nav;e&&e.state===p.Ready&&(this.selectedIndex=t,[...e.slides].map(e=>{e.el&&e.el.classList[e.index===t?"add":"remove"]("is-nav-selected")}))}attach(){var e=this.options.target,t=this.options.nav;e?this.addAsNavFor(e):t&&this.addAsTargetFor(t)}detach(){var e=this,t=e.nav,i=e.target;t&&(t.off("ready",e.onNavReady),t.off("createSlide",e.onNavCreateSlide),t.off("Panzoom.click",e.onNavClick),t.off("Panzoom.touchEnd",e.onNavTouch)),e.nav=null,i&&(i.off("ready",e.onTargetReady),i.off("refresh",e.onTargetChange),i.off("change",e.onTargetChange)),e.target=null}}Object.defineProperty(de,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});let ue={Navigation:ce,Dots:ae,Sync:de},pe="animationend",ge="isSelected",me="slide";class a extends V{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===p.Ready}get isInfinite(){let e=!1;var{contentDim:t,viewportDim:i,pages:n,slides:s}=this,s=s[0];return e=2<=n.length&&s&&t+s.dim>=i?this.option("infinite"):e}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(e,t={},i={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:p.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),!(e="string"==typeof e?document.querySelector(e):e)||!d(e))throw new Error("No Element found");this.container=e,this.slideNext=ne(this.slideNext.bind(this),150),this.slidePrev=ne(this.slidePrev.bind(this),150),this.userOptions=t,this.userPlugins=i,queueMicrotask(()=>{this.processOptions()})}processOptions(){var e,t,i=u({},a.defaults,this.userOptions);let n="";var s=i.breakpoints;if(s&&q(s))for(let[e,t]of Object.entries(s))window.matchMedia(e).matches&&q(t)&&(n+=e,u(i,t));n===this.bp&&this.state!==p.Init||(this.bp=n,this.state===p.Ready&&(i.initialSlide=(null==(t=null==(e=this.pages[this.page])?void 0:e.slides[0])?void 0:t.index)||0),this.state!==p.Init&&this.destroy(),super.setOptions(i),!1===this.option("enabled")?this.attachEvents():setTimeout(()=>{this.init()},0))}
1init(){this.state=p.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},a.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=p.Ready,this.emit("ready")}initLayout(){var e=this.container,t=this.option("classes");b(e,this.cn("container")),g(e,t.isLTR,!this.isRTL),g(e,t.isRTL,this.isRTL),g(e,t.isVertical,!this.isHorizontal),g(e,t.isHorizontal,this.isHorizontal);let i=this.option("viewport")||e.querySelector("."+t.viewport),n=(i||(i=document.createElement("div"),b(i,t.viewport),i.append(...se(e,"."+t.slide)),e.prepend(i)),i.addEventListener("scroll",this.onScroll),this.option("track")||e.querySelector("."+t.track));n||(n=document.createElement("div"),b(n,t.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){let i=this.track;if(i){let e=[...this.slides],t=[];[...se(i,"."+this.cn(me))].forEach(e=>{d(e)&&(e=oe({el:e,isDom:!0,index:this.slides.length}),t.push(e))});for(var n of[...this.option("slides",[])||[],...e])t.push(oe(n));this.slides=t;for(let e=0;e<this.slides.length;e++)this.slides[e].index=e;for(let e of t)this.emit("beforeInitSlide",e,e.index),this.emit("initSlide",e,e.index);this.emit("initSlides")}}setInitialPage(){var e=this.option("initialSlide");this.page="number"==typeof e?this.getPageForSlide(e):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){var{track:t,pages:i,isHorizontal:n}=this;if(t&&i.length){let e=this.page;i[e]||(this.page=e=0);i=(i[e].pos||0)*(this.isRTL&&n?1:-1);t.style.transform=`translate3d(${n?i+"px":"0"}, ${n?"0":i+"px"}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);var e=this.option("Panzoom")||{};this.panzoom=new x(this.viewport,u({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:e=>!(this.pages.length<2&&!e.options.infinite),bounds:()=>this.getBounds(),maxVelocity:e=>Math.abs(e.target[this.axis]-e.current[this.axis])<2*this.viewportDim?100:0},e)),this.panzoom.on("*",(e,t,...i)=>{this.emit("Panzoom."+t,e,...i)}),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){var e=this.container;e&&(e.addEventListener("click",this.onClick,{passive:!1,capture:!1}),e.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){var t=[];let{contentDim:e,viewportDim:i}=this;var n,s=("auto"===(s=this.option("slidesPerPage"))||e<=i)&&!1!==this.option("fill")?1/0:parseFloat(s+"");let o=0,a=0,r=0;for(let e of this.slides)(!t.length||.05<a+e.dim-i||r>=s)&&(t.push((n={},Object.assign({index:-1,slides:[],dim:0,pos:-1},n))),o=t.length-1,a=0,r=0),t[o].slides.push(e),a+=e.dim+e.gap,r++;return t}processPages(){let e=this.pages,{contentDim:t,viewportDim:n,isInfinite:i}=this,s=this.option("center"),o=this.option("fill"),a=o&&s&&t>n&&!i;if(e.forEach((i,e)=>{i.index=e,i.pos=(null==(e=i.slides[0])?void 0:e.pos)||0,i.dim=0;for(let[e,t]of i.slides.entries())i.dim+=t.dim,e<i.slides.length-1&&(i.dim+=t.gap);a&&i.pos+.5*i.dim<.5*n?i.pos=0:a&&i.pos+.5*i.dim>=t-.5*n?i.pos=t-n:s&&(i.pos+=-.5*(n-i.dim))}),e.forEach(e=>{o&&!i&&t>n&&(e.pos=Math.max(e.pos,0),e.pos=Math.min(e.pos,t-n)),e.pos=E(e.pos,1e3),e.dim=E(e.dim,1e3),Math.abs(e.pos)<=.1&&(e.pos=0)}),i)return e;let r=[],l;return e.forEach(e=>{e=Object.assign({},e);l&&e.pos===l.pos?(l.dim+=e.dim,l.slides=[...l.slides,...e.slides]):(e.index=r.length,l=e,r.push(e))}),r}getPageFromIndex(e=0){var t=this.pages.length;return e=parseInt((e||0).toString())||0,this.isInfinite?(e%t+t)%t:Math.max(Math.min(e,t-1),0)}getSlideMetrics(e){var t=this.isHorizontal?"width":"height";let i=0,n,s=e.el;
1var o=!(!s||s.parentNode),t=(s?i=parseFloat(s.dataset[t]||"")||0:((s=document.createElement("div")).style.visibility="hidden",(this.track||document.body).prepend(s)),b(s,this.cn(me)+" "+e.class+" "+e.customClass),i?(s.style[t]=i+"px",s.style["width"==t?"height":"width"]=""):(o&&(this.track||document.body).prepend(s),i=s.getBoundingClientRect()[t]*Math.max(1,(null==(t=window.visualViewport)?void 0:t.scale)||1),(t=s[this.isHorizontal?"offsetWidth":"offsetHeight"])-1>i&&(i=t)),getComputedStyle(s));return"content-box"===t.boxSizing&&(this.isHorizontal?i=(i+=parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0):i=(i+=parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0)),n=parseFloat(t[this.isHorizontal?"marginRight":"marginBottom"])||0,o?null!=(t=s.parentElement)&&t.removeChild(s):e.el||s.remove(),{dim:E(i,1e3),gap:E(n,1e3)}}getBounds(){let{isInfinite:e,isRTL:i,isHorizontal:n,pages:s}=this,o={min:0,max:0};if(e)o={min:-1/0,max:1/0};else if(s.length){let e=s[0].pos,t=s[s.length-1].pos;o=i&&n?{min:e,max:t}:{min:-1*t,max:-1*e}}return{x:n?o:{min:0,max:0},y:n?{min:0,max:0}:o}}repositionSlides(){let i,{isHorizontal:e,isRTL:t,isInfinite:n,viewport:s,viewportDim:o,contentDim:a,page:r,pages:l,slides:h,panzoom:c}=this,d=0,u=0,p=0,g=0;c?g=-1*c.current[this.axis]:l[r]&&(g=l[r].pos||0),i=e?t?"right":"left":"top",t&&e&&(g*=-1);for(let t of h){let e=t.el;e?("top"==i?(e.style.right="",e.style.left=""):e.style.top="",t.index!==d?e.style[i]=0===u?"":E(u,1e3)+"px":e.style[i]="",p+=t.dim+t.gap,d++):u+=t.dim+t.gap}if(n&&p&&s){var m=getComputedStyle(s),f="padding",v=e?"Right":"Bottom",b=parseFloat(m[f+(e?"Left":"Top")]);g-=b,o=(o+=b)+parseFloat(m[f+v]);for(let e of h)e.el&&(E(e.pos)<E(o)&&E(e.pos+e.dim+e.gap)<E(g)&&E(g)>E(a-o)&&(e.el.style[i]=E(u+p,1e3)+"px"),E(e.pos+e.gap)>=E(a-o))&&E(e.pos)>E(g+o)&&E(g)<E(o)&&(e.el.style[i]=`-${E(p,1e3)}px`)}let y,w,x=[...this.inTransition];if(1<x.length&&(y=l[x[0]],w=l[x[1]]),y&&w){let t=0;for(let e of h)e.el?this.inTransition.has(e.index)&&y.slides.indexOf(e)<0&&(e.el.style[i]=E(t+(y.pos-w.pos),1e3)+"px"):t+=e.dim+e.gap}}createSlideEl(t){var{track:s,slides:o}=this;if(s&&t&&(!t.el||!t.el.parentNode)){var a=t.el||document.createElement("div"),r=(b(a,this.cn(me)),b(a,t.class),b(a,t.customClass),t.html);r&&(r instanceof HTMLElement?a.appendChild(r):a.innerHTML=t.html+"");let i=[],n=(o.forEach((e,t)=>{e.el&&i.push(t)}),t.index),e=null;r=(e=i.length?o[i.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e)]:e)&&e.el&&e.el.parentNode?e.index<t.index?e.el.nextSibling:e.el:null;s.insertBefore(a,s.contains(r)?r:null),t.el=a,this.emit("createSlide",t)}}removeSlideEl(e,t=!1){var i,n=null==e?void 0:e.el;n&&n.parentNode&&(i=this.cn(ge),n.classList.contains(i)&&(v(n,i),this.emit("unselectSlide",e)),e.isDom&&!t?(n.removeAttribute("aria-hidden"),n.removeAttribute("data-index"),n.style.left=""):(this.emit("removeSlide",e),i=new CustomEvent(pe),n.dispatchEvent(i),e.el&&(e.el.remove(),e.el=null)))}transitionTo(e=0,t=this.option("transition")){if(!t)return!1;var i=this.page,{pages:n,panzoom:s}=this,o=(e=parseInt((e||0).toString())||0,this.getPageFromIndex(e));if(!s||!n[o]||n.length<2||1<Math.abs(((null==(r=null==(r=n[i])?void 0:r.slides[0])?void 0:r.dim)||0)-this.viewportDim))return!1;let a=i<e?1:-1;this.isInfinite&&(0===i&&e===n.length-1&&(a=-1),i===n.length-1)&&0===e&&(a=1);var r=n[o].pos*(this.isRTL?1:-1);if(i===o&&Math.abs(r-s.target[this.axis])<1)return!1;this.clearTransitions();e=s.isResting,b(this.container,this.cn("inTransition")),i=(null==(i=n[i])?void 0:i.slides[0])||null,n=(null==(n=n[o])?void 0:n.slides[0])||null;this.inTransition.add(n.index),this.createSlideEl(n);let l=i.el,h=n.el;e||t===me||(t="fadeFast",l=null);var e=this.isRTL?"next":"prev",c=this.isRTL?"prev":"next";return l&&(this.inTransition.add(i.index),i.transition=t,l.addEventListener(pe,this.onAnimationEnd),l.classList.add(`f-${t}Out`,"to-"+(0<a?c:e))),h&&(n.transition=t,h.addEventListener(pe,this.onAnimationEnd),h.classList.add(`f-${t}In`,"from-"+(0<a?e:c))),s.current[this.axis]=r,s.target[this.axis]=r,s.requestTick(),this.onChange(o),!0}manageSlideVisiblity(){let t=new Set,i=new Set,e=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(var n of this.slides)(e.has(n)?t:i).add(n);for(let e of this.inTransition)t.add(this.slides[e]);for(let e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(let e of i)t.has(e)||this.removeSlideEl(e);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(this.pages[this.page]&&this.pages[this.page].slides){var e="aria-hidden",t=this.cn(ge);if(t)for(var i of this.slides){var n=i.el;n&&(n.dataset.index=""+i.index,n.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(i)?n.removeAttribute(e):n.setAttribute(e,"true"):this.pages[this.page].slides.includes(i)?(n.classList.contains(t)||(b
1(n,t),this.emit("selectSlide",i)),n.removeAttribute(e)):(n.classList.contains(t)&&(v(n,t),this.emit("unselectSlide",i)),n.setAttribute(e,"true")))}}}flipInfiniteTrack(){var{axis:s,isHorizontal:o,isInfinite:e,isRTL:a,viewportDim:r,contentDim:l}=this,h=this.panzoom;if(h&&e){let e=h.current[s],t=h.target[s]-e,i=0,n=.5*r;a&&o?(e<-n&&(i=-1,e+=l),e>l-n&&(i=1,e-=l)):(e>n&&(i=1,e-=l),e<n-l&&(i=-1,e+=l)),i&&(h.current[s]=e,h.target[s]=e+t)}}lazyLoadImg(t,i){let e=this,n="f-fadeIn",s="is-preloading",o=!1,a=null,r=()=>{o||(o=!0,a&&(a.remove(),a=null),v(i,s),i.complete&&(b(i,n),setTimeout(()=>{v(i,n)},350)),this.option("adaptiveHeight")&&t.el&&-1<this.pages[this.page].slides.indexOf(t)&&(e.updateMetrics(),e.setViewportHeight()),this.emit("load",t))};b(i,s),i.src=i.dataset.lazySrcset||i.dataset.lazySrc||"",delete i.dataset.lazySrc,delete i.dataset.lazySrcset,i.addEventListener("error",()=>{r()}),i.addEventListener("load",()=>{r()}),setTimeout(()=>{var e=i.parentNode;e&&t.el&&(i.complete?r():o||(a=c(G),e.insertBefore(a,i)))},300)}lazyLoadSlide(i){let e=i&&i.el;if(e){let t=new Set;var n=Array.from(e.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));e.dataset.lazySrc&&n.push(e),n.map(e=>{e instanceof HTMLImageElement?t.add(e):e instanceof HTMLElement&&e.dataset.lazySrc&&(e.style.backgroundImage=`url('${e.dataset.lazySrc}')`,delete e.dataset.lazySrc)});for(let e of t)this.lazyLoadImg(i,e)}}onAnimationEnd(e){var t=e.target,i=t?parseInt(t.dataset.index||"",10)||0:-1,n=this.slides[i],e=e.animationName;t&&n&&e&&((t=!!this.inTransition.has(i)&&n.transition)&&e.substring(0,t.length+2)==="f-"+t&&this.inTransition.delete(i),this.inTransition.size||this.clearTransitions(),i===this.page)&&null!=(n=this.panzoom)&&n.isResting&&this.emit("settle")}onDecel(i,n=0,s=0,o=0,a=0){if(this.option("dragFree"))this.setPageFromPosition();else{var{isRTL:r,isHorizontal:l,axis:h,pages:c}=this,e=c.length,d=Math.abs(Math.atan2(s,n)/(Math.PI/180)),d=45<d&&d<135?l?0:s:l?n:0;if(e){let e=this.page,t=r&&l?1:-1;s=i.current[h]*t,n=this.getPageFromPosition(s).pageIndex;e=5<Math.abs(d)?(c[e].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(e=n),r&&l?d<0?e-1:e+1:d<0?e+1:e-1):0===o&&0===a?e:n,this.slideTo(e,{transition:!1,friction:i.option("decelFriction")})}}}onClick(e){var t=e.target,i=t&&d(t)?t.dataset:null;let n,s;i&&(void 0!==i.carouselPage?(s="slideTo",n=i.carouselPage):void 0!==i.carouselNext?s="slideNext":void 0!==i.carouselPrev&&(s="slidePrev")),s?(e.preventDefault(),e.stopPropagation(),t&&!t.hasAttribute("disabled")&&this[s](n)):this.emit("click",e)}onSlideTo(e){e=e.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(e,t=0){var i=this.page;this.prevPage=i,this.page=e,this.option("adaptiveHeight")&&this.setViewportHeight(),e!==i&&(this.markSelectedSlides(),this.emit("change",e,i,t))}onRefresh(){var e=this.contentDim,t=this.viewportDim;this.updateMetrics(),this.contentDim===e&&this.viewportDim===t||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var e;null!=(e=this.viewport)&&e.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(e){this.lp!==e.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=e.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(e=null,t=null){this.destroy(),this.state=p.Init,this.prevPage=null,this.userOptions=e||this.userOptions,this.userPlugins=t||this.userPlugins,this.processOptions()}slideTo(n=0,{friction:e=this.option("friction"),transition:t=this.option("transition")}={}){if(this.state!==p.Destroy){n=parseInt((n||0).toString())||0;var i=this.getPageFromIndex(n),{axis:s,isHorizontal:o,isRTL:a,pages:r,panzoom:l}=this,h=r.length,a=a&&o?1:-1;if(l&&h){if(this.page!==i){let e=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",e,n),e.defaultPrevented)return}if(!this.transitionTo(n,t)){let t=r[i].pos;if(this.isInfinite){let e=this.contentDim,i=l.target[s]*a;2===h?t+=e*Math.floor(parseFloat(n+"")/2):t=[t,t-e,t+e].reduce(function(e,t){return Math.abs(t-i)<Math.abs(e-i)?t:e})}t*=a,Math.abs(l.target[s]-t)<1||(l.panTo({x:o?t:0,y:o?0:t,friction:e}),this.onChange(i))}}}}slideToClosest(e){var t;this.panzoom&&(t=this.getPageFromPosition().pageIndex,this.slideTo(t,e))}
1slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),v(this.container,this.cn("inTransition"));var e,t=["to-prev","to-next","from-prev","from-next"];for(e of this.slides){var i,n=e.el;n&&(n.removeEventListener(pe,this.onAnimationEnd),n.classList.remove(...t),i=e.transition)&&n.classList.remove(`f-${i}Out`,`f-${i}In`)}this.manageSlideVisiblity()}addSlide(o,e){var t,i,a,r=this.panzoom,l=(null==(t=this.pages[this.page])?void 0:t.pos)||0,h=(null==(i=this.pages[this.page])?void 0:i.dim)||0,c=this.contentDim<this.viewportDim;let n=Array.isArray(e)?e:[e],s=[];for(let e of n)s.push(oe(e));this.slides.splice(o,0,...s);for(let e=0;e<this.slides.length;e++)this.slides[e].index=e;for(let e of s)this.emit("beforeInitSlide",e,e.index);if(this.page>=o&&(this.page+=s.length),this.updateMetrics(),r){let e=(null==(a=this.pages[this.page])?void 0:a.pos)||0,t=(null==(a=this.pages[this.page])?void 0:a.dim)||0,i=this.pages.length||1,n=this.isRTL?h-t:t-h,s=this.isRTL?l-e:e-l;c&&1===i?(o<=this.page&&(r.current[this.axis]-=n,r.target[this.axis]-=n),r.panTo({[this.isHorizontal?"x":"y"]:-1*e})):s&&o<=this.page&&(r.target[this.axis]-=s,r.current[this.axis]-=s,r.requestTick())}
1for(let e of s)this.emit("initSlide",e,e.index)}prependSlide(e){this.addSlide(0,e)}appendSlide(e){this.addSlide(this.slides.length,e)}removeSlide(e){var t=this.slides.length,t=this.slides[e=(e%t+t)%t];if(t){this.removeSlideEl(t,!0),this.slides.splice(e,1);for(let e=0;e<this.slides.length;e++)this.slides[e].index=e;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",t)}}updateMetrics(){let{panzoom:e,viewport:t,track:i,slides:a,isHorizontal:n,isInfinite:r}=this;if(i){var l,h,c,d,u=n?"width":"height";t&&(l=Math.max(t[n?"offsetWidth":"offsetHeight"],E(t.getBoundingClientRect()[u],1e3)),h=getComputedStyle(t),c="padding",d=n?"Right":"Bottom",l-=parseFloat(h[c+(n?"Left":"Top")])+parseFloat(h[c+d]),this.viewportDim=l);let s,o=0;for(let[i,n]of a.entries()){let e=0,t=0;!n.el&&s?(e=s.dim,t=s.gap):({dim:e,gap:t}=this.getSlideMetrics(n),s=n),e=E(e,1e3),t=E(t,1e3),n.dim=e,n.gap=t,n.pos=o,o+=e,(r||i<a.length-1)&&(o+=t)}o=E(o,1e3),this.contentDim=o,e&&(e.contentRect[u]=o,e.contentRect[n?"fullWidth":"fullHeight"]=o),this.pages=this.createPages(),this.pages=this.processPages(),this.state===p.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}}getProgress(e,t=!1,i=!1){void 0===e&&(e=this.page);var n=this.panzoom,s=this.contentDim,o=this.pages[e]||0;if(!o||!n)return e>this.page?-1:1;let a=-1*n.current.e,r=E((a-o.pos)/+o.dim,1e3),l=r,h=r;this.isInfinite&&!0!==i&&(l=E((a-o.pos+s)/+o.dim,1e3),h=E((a-o.pos-s)/+o.dim,1e3));e=[r,l,h].reduce(function(e,t){return Math.abs(t)<Math.abs(e)?t:e});return t?e:1<e?1:e<-1?-1:e}setViewportHeight(){var{page:e,pages:i,viewport:n,isHorizontal:s}=this;if(n&&i[e]){let t=0;s&&this.track&&(this.track.style.height="auto",i[e].slides.forEach(e=>{e.el&&(t=Math.max(t,e.el.offsetHeight))})),n.style.height=t?t+"px":""}}getPageForSlide(e){for(var t of this.pages)for(var i of t.slides)if(i.index===e)return t.index;return-1}getVisibleSlides(t=0){var i,s=new Set;let{panzoom:n,contentDim:o,viewportDim:a,pages:r,page:l}=this;if(a){o=o+(null==(i=this.slides[this.slides.length-1])?void 0:i.gap)||0;let e=0;e=n&&n.state!==f.Init&&n.state!==f.Destroy?-1*n.current[this.axis]:r[l]&&r[l].pos||0,this.isInfinite&&(e-=Math.floor(e/o)*o),this.isRTL&&this.isHorizontal&&(e*=-1);var h=e-a*t,c=e+a*(t+1),d=this.isInfinite?[-1,0,1]:[0];for(let n of this.slides)for(let i of d){let e=n.pos+i*o,t=e+n.dim+n.gap;e<c&&t>h&&s.add(n)}}return s}getPageFromPosition(e){var{viewportDim:t,contentDim:i,slides:n,pages:s,panzoom:o}=this,s=s.length,a=n.length,r=n[0],a=n[a-1],l=this.option("center");let h,c=0,d=void 0===e?-1*((null==o?void 0:o.target[this.axis])||0):e,u=(l&&(d+=.5*t),this.isInfinite?(d<r.pos-.5*a.gap&&(d-=i,c=-1),d>a.pos+a.dim+.5*a.gap&&(d-=i,c=1)):d=Math.max(r.pos||0,Math.min(d,a.pos)),a),p=n.find(e=>{var t=e.pos-.5*u.gap,i=e.pos+e.dim+.5*e.gap;return u=e,d>=t&&d<i});return p=p||a,{page:(h=this.getPageForSlide(p.index))+c*s,pageIndex:h}}setPageFromPosition(){var e=this.getPageFromPosition().pageIndex;this.onChange(e)}destroy(){if(![p.Destroy].includes(this.state)){this.state=p.Destroy;let{container:i,viewport:e,track:t,slides:n,panzoom:s}=this,o=this.option("classes");i.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),i.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach(e=>{this.removeSlideEl(e)}),this.detachPlugins(),e&&(e.removeEventListener("scroll",this.onScroll),e.offsetParent)&&t&&t.offsetParent&&e.replaceWith(...t.childNodes);for(let[e,t]of Object.entries(o))"container"!==e&&t&&i.classList.remove(t);this.track=null,this.viewport=null,this.page=0,this.slides=[];var a=this.events.get("ready");this.events=new Map,a&&this.events.set("ready",a)}}}Object.defineProperty(a,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:x}),Object.defineProperty(a,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}}}),Object.defineProperty(a,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:ue});function fe(e){if(!d(e))return 0;var t=window.scrollY,i=window.innerHeight,n=t+i,s=(e=e.getBoundingClientRect()).y+t,o=s+(e=e.height);if(o<t||n<s)return 0;if(t<s&&o<n)return 100;if(s<t&&n<o)return 100;let a=e;return s<t&&(a-=t-s),n<o&&(a-=o-n),e=a/i*100,Math.round(e)}let ve=!("undefined"==typeof window||!window.document||!window.document.createElement),be,ye=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not
1([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),we=e=>{if(e&&ve){void 0===be&&document.createElement("div").focus({get preventScroll(){return!(be=!0)}});try{var t,i;be?e.focus({preventScroll:!0}):(t=window.scrollY||document.body.scrollTop,i=window.scrollX||document.body.scrollLeft,e.focus(),document.body.scrollTo({top:t,left:i,behavior:"auto"}))}catch(e){}}},xe=()=>{let t=document,e,i="",n="",s="";return t.fullscreenEnabled?(i="requestFullscreen",n="exitFullscreen",s="fullscreenElement"):t.webkitFullscreenEnabled&&(i="webkitRequestFullscreen",n="webkitExitFullscreen",s="webkitFullscreenElement"),e=i?{request:function(e=t.documentElement){return"webkitRequestFullscreen"===i?e[i](Element.ALLOW_KEYBOARD_INPUT):e[i]()},exit:function(){return t[s]&&t[n]()},isFullscreen:function(){return t[s]}}:e},Ee={animated:!0,autoFocus:!0,backdropClick:"close",Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},closeButton:"auto",closeExisting:!1,commonCaption:!1,compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,contentClick:"toggleZoom",contentDblClick:!1,defaultType:"image",defaultDisplay:"flex",dragToClose:!0,Fullscreen:{autoStart:!1},groupAll:!1,groupAttr:"data-fancybox",hideClass:"f-fadeOut",hideScrollbar:!0,idle:3500,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},l10n:Object.assign(Object.assign({},Z),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}),parentEl:null,placeFocusBack:!0,showClass:"f-zoomInUp",startIndex:0,tpl:{closeButton:'<button data-fancybox-close class="f-button is-close-btn" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg></button>',main:'<div class="fancybox__container" role="dialog" aria-modal="true" aria-label="{{MODAL}}" tabindex="-1">\n    <div class="fancybox__backdrop"></div>\n    <div class="fancybox__carousel"></div>\n    <div class="fancybox__footer"></div>\n  </div>'},trapFocus:!0,wheel:"zoom"},Se=((i=S=S||{})[i.Init=0]="Init",i[i.Ready=1]="Ready",i[i.Closing=2]="Closing",i[i.CustomClosing=3]="CustomClosing",i[i.Destroy=4]="Destroy",(i=P=P||{})[i.Loading=0]="Loading",i[i.Opening=1]="Opening",i[i.Ready=2]="Ready",i[i.Closing=3]="Closing",""),Pe=!1,Ce=!1,r=null,Te=()=>{let e="",t="";var i,n,s,o,a=D.getInstance();return{hash:e=a&&(i=a.carousel,n=a.getSlide(),i)&&n&&(s=n.slug||void 0,o=n.triggerEl||void 0,t=!(t=s||a.option("slug")||"")&&o&&o.dataset?o.dataset.fancybox||"":t)&&"true"!==t?"#"+t+(!s&&1<i.slides.length?"-"+(n.index+1):""):e,slug:t,index:1}},Me=()=>{var e=new URL(document.URL).hash,t=e.slice(1).split("-"),i=t[t.length-1],i=i&&/^\+?\d+$/.test(i)&&parseInt(t.pop()||"1",10)||1;return{hash:e,slug:t.join("-"),index:i}},Oe=()=>{var{slug:t,index:i}=Me();if(t){let e=document.querySelector(`[data-slug="${t}"]`);e&&e.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),D.getInstance()||(t=document.querySelectorAll(`[data-fancybox="${t}"]`)).length&&(e=t[i-1])&&e.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0}))}},Ae=()=>{var e,t,i,n;!1!==D.defaults.Hash&&!1!==(null==(e=D.getInstance())?void 0:e.options.Hash)&&({slug:t,index:i}=Me(),n=Te().slug,e&&(t===n?e.jumpTo(i-1):(Pe=!0,e.close())),Oe())},Le=()=>{r&&clearTimeout(r),queueMicrotask(()=>{Ae()})},ze=()=>{window.addEventListener("hashchange",Le,!1),setTimeout(()=>{Ae()},500)},Re=(ve&&(/complete|interactive|loaded/.test(document.readyState)?ze():document.addEventListener("DOMContentLoaded",ze)),"is-zooming-in");class ke extends e{onCreateSlide(e,t,i){var n=this.instance.optionFor(i,"src")||"";i.el&&"image"===i.type&&"string"==typeof n&&this.setImage(i,n)}onRemoveSlide(e,t,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(e,i,n,t){v(this.instance.container,Re);for(let t of i.slides){let e=t.panzoom;e&&t.index!==n&&e.reset(.35)}}onClose(){let s=this.instance,o=s.container,a=s.getSlide();if(o&&o.parentElement&&a){let{el:e,contentEl:t,panzoom:i,thumbElSrc:n}=a;if(e&&n&&t&&i&&!i.isContentLoading&&i.state!==f.Init&&i.state!==f.Destroy){i.updateMetrics();var r=this.getZoomInfo(a);if(r){this.instance.state=S.CustomClosing,o.classList.remove(Re),o.classList.add("is-zooming-out"),t.style.backgroundImage=`url('${n}')`;
1var l=o.getBoundingClientRect(),{x:h,y:l,scale:c,opacity:r}=(1===((null==(h=window.visualViewport)?void 0:h.scale)||1)&&Object.assign(o.style,{position:"absolute",top:o.offsetTop+window.scrollY+"px",left:o.offsetLeft+window.scrollX+"px",bottom:"auto",right:"auto",width:l.width+"px",height:l.height+"px",overflow:"hidden"}),r);if(r){let e=(t=>{let i=c-t;return e=>1+((e-t)/i*-1||0)})(i.scale);i.on("afterTransform",()=>{t.style.opacity=e(i.scale)+""})}i.on("endAnimation",()=>{s.destroy()}),i.target.a=c,i.target.b=0,i.target.c=0,i.target.d=c,i.panTo({x:h,y:l,scale:c,friction:r?.2:.33,ignoreBounds:!0}),i.isResting&&s.destroy()}}}}setImage(h,e){let c=this.instance;h.src=e,this.process(h,e).then(o=>{let{contentEl:s,imageEl:e,thumbElSrc:a,el:t}=h;if(!c.isClosing()&&s&&e){s.offsetHeight;var r,l=!!c.isOpeningSlide(h)&&this.getZoomInfo(h);if(this.option("protected")&&t){t.addEventListener("contextmenu",e=>{e.preventDefault()});let e=document.createElement("div");b(e,"fancybox-protected"),s.appendChild(e)}if(a&&l){let e=o.contentRect,t=Math.max(e.fullWidth,e.fullHeight),i=null,n=(!l.opacity&&1200<t&&(i=document.createElement("img"),b(i,"fancybox-ghost"),i.src=a,s.appendChild(i)),()=>{i&&(b(i,"f-fadeFastOut"),setTimeout(()=>{i&&(i.remove(),i=null)},200))});r=a,new Promise((e,t)=>{var i=new Image;i.onload=e,i.onerror=t,i.src=r}).then(()=>{c.hideLoading(h),h.state=P.Opening,this.instance.emit("reveal",h),this.zoomIn(h).then(()=>{n(),this.instance.done(h)},()=>{}),i&&setTimeout(()=>{n()},2500<t?800:200)},()=>{c.hideLoading(h),c.revealContent(h)})}else{let e=this.optionFor(h,"initialSize"),t=this.optionFor(h,"zoom"),i={event:c.prevMouseMoveEvent||c.options.event,friction:t?.12:0},n=c.optionFor(h,"showClass")||void 0,s=!0;c.isOpeningSlide(h)&&("full"===e?o.zoomToFull(i):"cover"===e?o.zoomToCover(i):"max"===e?o.zoomToMax(i):s=!1,o.stop("current")),s&&(n=n&&(o.isDragging?"f-fadeIn":"")),c.hideLoading(h),c.revealContent(h,n)}}},()=>{c.setError(h,"{{IMAGE_ERROR}}")})}process(l,h){return new Promise((t,e)=>{let i,n=this.instance,s=l.el,o=(n.clearContent(l),n.showLoading(l),this.optionFor(l,"content"));var a,r;(o="string"==typeof o?c(o):o)&&d(o)||((o=document.createElement("img"))instanceof HTMLImageElement&&(r="",r="string"==typeof(a=l.caption)&&a?a.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${l.index+1} of `+((null==(i=n.carousel)?void 0:i.pages.length)||1),o.src=h||"",o.alt=r,o.draggable=!1,l.srcset&&o.setAttribute("srcset",l.srcset),this.instance.isOpeningSlide(l))&&(o.fetchPriority="high"),l.sizes&&o.setAttribute("sizes",l.sizes)),b(o,"fancybox-image"),l.imageEl=o,n.setContent(l,o,!1),l.panzoom=new x(s,u({transformParent:!0},this.option("Panzoom")||{},{content:o,width:(e,t)=>n.optionFor(l,"width","auto",t)||"auto",height:(e,t)=>n.optionFor(l,"height","auto",t)||"auto",wheel:()=>{var e=n.option("wheel");return("zoom"===e||"pan"==e)&&e},click:(e,t)=>{if(n.isCompact||n.isClosing())return!1;if(l.index!==(null==(i=n.getSlide())?void 0:i.index))return!1;if(t){let e=t.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(e.nodeName))return!1}var i=!t||t.target&&(null==(i=l.contentEl)?void 0:i.contains(t.target));return n.option(i?"contentClick":"backdropClick")||!1},dblClick:()=>n.isCompact?"toggleZoom":n.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:e=>{t(e)},error:()=>{e()},destroy:()=>{e()}}}))})}zoomIn(g){return new Promise((a,r)=>{let l=this.instance,h=l.container,{panzoom:c,contentEl:d,el:e}=g;c&&c.updateMetrics();var u=this.getZoomInfo(g);if(u&&e&&d&&c&&h){let{x:e,y:t,scale:i,opacity:n}=u,s=()=>{g.state!==P.Closing&&(n&&(d.style.opacity=Math.max(Math.min(1,1-(1-c.scale)/(1-i)),0)+""),1<=c.scale)&&c.scale>c.targetScale-.1&&a(c)},o=e=>{(e.scale<.99||1.01<e.scale)&&!e.isDragging||(v(h,Re),d.style.opacity="",e.off("endAnimation",o),e.off("touchStart",o),e.off("afterTransform",s),a(e))};c.on("endAnimation",o),c.on("touchStart",o),c.on("afterTransform",s),c.on(["error","destroy"],()=>{r()}),c.panTo({x:e,y:t,scale:i,friction:0,ignoreBounds:!0}),c.stop("current");
1var u={event:"mousemove"===c.panMode?l.prevMouseMoveEvent||l.options.event:void 0},p=this.optionFor(g,"initialSize");b(h,Re),l.hideLoading(g),"full"===p?c.zoomToFull(u):"cover"===p?c.zoomToCover(u):"max"===p?c.zoomToMax(u):c.reset(.172)}else r()})}getZoomInfo(e){var{el:t,imageEl:i,thumbEl:n,panzoom:s}=e,o=this.instance,a=o.container;if(!t||!i||!n||!s||fe(n)<3||!this.optionFor(e,"zoom")||!a||o.state===S.Destroy)return!1;if("0"===getComputedStyle(a).getPropertyValue("--f-images-zoom"))return!1;t=window.visualViewport||null;if(1!==(t?t.scale:1))return!1;var{top:i,left:e,width:o,height:a}=n.getBoundingClientRect(),{top:t,left:n,fitWidth:r,fitHeight:l}=s.contentRect;if(!(o&&a&&r&&l))return!1;s=s.container.getBoundingClientRect(),n=-1*((n+=s.left)+.5*r-(e+.5*o)),e=-1*((t+=s.top)+.5*l-(i+.5*a)),s=o/r;let h=this.option("zoomOpacity")||!1;return{x:n,y:e,scale:s,opacity:h="auto"===h?.1<Math.abs(o/a-r/l):h}}attach(){var e=this,t=e.instance;t.on("Carousel.change",e.onChange),t.on("Carousel.createSlide",e.onCreateSlide),t.on("Carousel.removeSlide",e.onRemoveSlide),t.on("close",e.onClose)}detach(){var e=this,t=e.instance;t.off("Carousel.change",e.onChange),t.off("Carousel.createSlide",e.onCreateSlide),t.off("Carousel.removeSlide",e.onRemoveSlide),t.off("close",e.onClose)}}Object.defineProperty(ke,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}});let Ie="html",C="youtube",T="vimeo",De="html5video",Fe=(e,i={})=>{let t=new URL(e),n=new URLSearchParams(t.search),s=new URLSearchParams;for(let[e,t]of[...n,...Object.entries(i)]){var o,a=t+"";"t"===e?(o=a.match(/((\d*)m)?(\d*)s?/))&&s.set("start",60*parseInt(o[2]||"0")+parseInt(o[3]||"0")+""):s.set(e,a)}let r=s+"",l=e.match(/#t=((.*)?\d+s)/);return l&&(r+="#t="+l[1]),r},je=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class Be extends e{onBeforeInitSlide(e,t,i){this.processType(i)}onCreateSlide(e,t,i){this.setContent(i)}onClearContent(e,t){t.xhr&&(t.xhr.abort(),t.xhr=null);var i=t.iframeEl;i&&(i.onload=i.onerror=null,i.src="//about:blank",t.iframeEl=null);let n=t.contentEl,s=t.placeholderEl;if("inline"===t.type&&n&&s)n.classList.remove("fancybox__content"),"none"!==getComputedStyle(n).getPropertyValue("display")&&(n.style.display="none"),setTimeout(()=>{s&&(n&&s.parentNode&&s.parentNode.insertBefore(n,s),s.remove())},0),t.contentEl=void 0,t.placeholderEl=void 0;else for(;t.el&&t.el.firstChild;)t.el.removeChild(t.el.firstChild)}onSelectSlide(e,t,i){i.state===P.Ready&&this.playVideo()}onUnselectSlide(e,t,i){var n,s;if(i.type===De)try{null!=(s=null==(n=i.el)?void 0:n.querySelector("video"))&&s.pause()}catch(e){}else{let e;i.type===T?e={method:"pause",value:"true"}:i.type===C&&(e={event:"command",func:"pauseVideo"}),e&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"),i.poller&&clearTimeout(i.poller)}}onDone(e,t){e.isCurrentSlide(t)&&!e.isClosing()&&this.playVideo()}onRefresh(e,t){t.slides.forEach(e=>{e.el&&(this.resizeIframe(e),this.setAspectRatio(e))})}onMessage(e){try{var t=JSON.parse(e.data);if("https://player.vimeo.com"===e.origin){if("ready"===t.event)for(var i of Array.from(document.getElementsByClassName("fancybox__iframe")))i instanceof HTMLIFrameElement&&i.contentWindow===e.source&&(i.dataset.ready="true")}else if(e.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&"onReady"===t.event){let e=document.getElementById(t.id);e&&(e.dataset.ready="true")}}catch(e){}}loadAjaxContent(e){var t=this.instance.optionFor(e,"src")||"";this.instance.showLoading(e);let i=this.instance,n=new XMLHttpRequest;i.showLoading(e),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===S.Ready&&(i.hideLoading(e),200===n.status?i.setContent(e,n.responseText):i.setError(e,404===n.status?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};var s=e.ajax||null;n.open(s?"POST":"GET",t+""),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(s),e.xhr=n}setInlineContent(e){let t=null;var i;d(e.src)?t=e.src:"string"==typeof e.src&&(i=e.src.split("#",2).pop(),t=i?document.getElementById(i):null),t?("clone"===e.type||t.closest(".fancybox__slide")?((i=(t=t.cloneNode(!0)).dataset.animationName)&&(t.classList.remove(i),delete t.dataset.animationName),i=(i=t.getAttribute("id"))?i+"--clone":`clone-${this.instance.id}-`+e.index,t.setAttribute("id",i)):t.parentNode&&((i=document.createElement("div")).classList.add("fancybox-placeholder"),t.parentNode.insertBefore(i,t),e.placeholderEl=i),this.instance.setContent(e,t)):this.instance.setError(e,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(n){let{src:e,el:s}=n;if(e&&"string"==typeof e&&s){s.classList.add("is-loading");let t=this.instance,i=document.createElement("iframe");i.className="fancybox__iframe",i.setAttribute("id",`fancybox__iframe_${t.id}_`+n.index);for(let[e,t]of Object.entries(this.optionFor(n,"iframeAttr")||{}))i.setAttribute(e,t);i.onerror=()=>{t.setError(n,"{{IFRAME_ERROR}}")},n.iframeEl=i;var o=this.optionFor(n,"preload");"iframe"!==n.type||!1===o?(i.setAttribute("src",n.src+""),t.setContent(n,i,!1),this.resizeIframe(n),t.revealContent(n)):(t.showLoading(n),i.onload=()=>{var e;i.src.length&&(e="true"!==i.dataset.ready,i.dataset.ready="true",this.resizeIframe(n),e?t.revealContent(n):t.hideLoading(n))},i.setAttribute("src",e),t.setContent(n,i,!1))}}resizeIframe(i){let{type:e,iframeEl:l}=i;if(e!==C&&e!==T){let t=null==l?void 0:l.parentElement;if(l&&t){let e=i.autoSize,a=(void 0===e&&(e=this.optionFor(i,"autoSize")),i.width||0),r=i.height||0;a&&r&&(e=!1);var h=t&&t.style;if(!1!==i.preload&&!1!==e&&h)try{let e=window.getComputedStyle(t),n=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),s=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),o=l.contentWindow;if(o){let e=o.document,t=e.getElementsByTagName(Ie)[0],i=e.body;h.width="",i.style.overflow="hidden",a=a||t.scrollWidth+n,h.width=a+"px",i.style.overflow="",h.flex="0 0 auto",h.height=i.scrollHeight+"px",r=t.scrollHeight+s}}catch(i){}if(a||r){let e={flex:"0 1 auto",width:"",height:""};a&&"auto"!==a&&(e.width=a+"px"),r&&"auto"!==r&&(e.height=r+"px"),Object.assign(h,e)}}}}playVideo(){let t=this.instance.getSlide();if(t){let e=t.el;if(e&&e.offsetParent&&this.optionFor(t,"videoAutoplay")){if(t.type===De)try{let t=e.querySelector("video");if(t){let e=t.play();void 0!==e&&e.then(()=>{}).catch(e=>{t.muted=!0,t.play()})}}catch(t){}if(t.type===C||t.type===T){let e=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if("true"===t.iframeEl.dataset.ready)return(e=t.type===C?{event:"command",func:"playVideo"}:{method:"play",value:"true"})&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"),void(t.poller=void 0);t.type===C&&(e={event:"listening",id:t.iframeEl.getAttribute("id")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"))}t.poller=setTimeout(e,250)};e()}}}}processType(n){if(n.html)n.type=Ie,n.src=n.html,n.html="";else{let i=this.instance.optionFor(n,"src","");if(i&&"string"==typeof i){let t=n.type,e=null;var s,o,a;if((e=i.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i))?(s=(o=this.optionFor(n,C)).nocookie,o=((e,t)=>{var i={};for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(i[s[n]]=e[s[n]]);return i})(o,["nocookie"]),s=`www.youtube${s?"-nocookie":""}.com`,o=Fe(i,o),a=encodeURIComponent(e[2]),n.videoId=a,n.src=`https://${s}/embed/${a}?`+o,n.thumbSrc=n.thumbSrc||`https://i.ytimg.com/vi/${a}/mqdefault.jpg`,t=C):(e=i.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/))&&(s=Fe(i,this.optionFor(n,T)),o=encodeURIComponent(e[1]),a=e[4]||"",n.videoId=o,n.src=`https://player.vimeo.com/video/${o}?`+(a?"h="+a+(s?"&":""):"")+s,t=T),!t&&n.triggerEl){let e=n.triggerEl.dataset.type;je.includes(e)&&(t=e)}t||"string"==typeof i&&("#"===i.charAt(0)?t="inline":(e=i.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(t=De,n.videoFormat=n.videoFormat||"video/"+("ogv"===e[1]?"ogg":e[1])):i.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?t="image":i.match(/\.(pdf)((\?|#).*)?$/i)&&(t="pdf")),(e=i.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(n.src=`https://maps.google.${e[1]}/?ll=${(e[2]?e[2]+"&z="+Math.floor(parseFloat(e[3]))+(e[4]?e[4].replace(/^\//,"&"):""):e[4]+"").replace(/\?/,"&")}&output=`+(e[4]&&0<e[4].indexOf("layer=c")?"svembed":"embed"),t="map"):(e=i.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(n.src=`https://maps.google.${e[1]}/maps?q=${e[2].replace("query=","q=").replace("api=1","")}&output=embed`,t="map"),t=t||this.instance.option("defaultType"),"image"===(n.type=t)&&(n.thumbSrc=n.thumbSrc||n.src)}}}setContent(e){var t=this.instance.optionFor(e,"src")||"";if(e&&e.type&&t){switch(e.type){case Ie:this.instance.setContent(e,t);break;case De:var i=this.option("videoTpl");i&&this.instance.setContent(e,i.replace(/\{\{src\}\}/gi,t+"").replace(/\{\{format\}\}/gi,this.optionFor(e,"videoFormat")||"").replace(/\{\{poster\}\}/gi,e.poster||e.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(e);break;case"ajax":this.loadAjaxContent(e);break;case"pdf":case"map":case C:case T:e.preload=!1;case"iframe":this.setIframeContent(e)}this.setAspectRatio(e)}}setAspectRatio(n){let s=n.contentEl;
1if(n.el&&s&&n.type&&[C,T,De].includes(n.type)){let t,e=n.width||"auto",i=n.height||"auto";if("auto"===e||"auto"===i){let e=((t=this.optionFor(n,"videoRatio"))+"").match(/(\d+)\s*\/\s?(\d+)/);t=e&&2<e.length?parseFloat(e[1])/parseFloat(e[2]):parseFloat(t+"")}else e&&i&&(t=e/i);var o;t&&(s.style.aspectRatio="",s.style.width="",s.style.height="",s,o=(n=s.getBoundingClientRect()).width||1,n=n.height||1,s.style.aspectRatio=t+"",t<o/n?(i="auto"===i?n:Math.min(n,i),s.style.width="auto",s.style.height=i+"px"):(e="auto"===e?o:Math.min(o,e),s.style.width=e+"px",s.style.height="auto"))}}attach(){var e=this,t=e.instance;t.on("Carousel.beforeInitSlide",e.onBeforeInitSlide),t.on("Carousel.createSlide",e.onCreateSlide),t.on("Carousel.selectSlide",e.onSelectSlide),t.on("Carousel.unselectSlide",e.onUnselectSlide),t.on("Carousel.Panzoom.refresh",e.onRefresh),t.on("done",e.onDone),t.on("clearContent",e.onClearContent),window.addEventListener("message",e.onMessage)}detach(){var e=this,t=e.instance;t.off("Carousel.beforeInitSlide",e.onBeforeInitSlide),t.off("Carousel.createSlide",e.onCreateSlide),t.off("Carousel.selectSlide",e.onSelectSlide),t.off("Carousel.unselectSlide",e.onUnselectSlide),t.off("Carousel.Panzoom.refresh",e.onRefresh),t.off("done",e.onDone),t.off("clearContent",e.onClearContent),window.removeEventListener("message",e.onMessage)}}Object.defineProperty(Be,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">\n  <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos.</video>',videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}}});let He="play",Ne="pause",_e="ready";class We extends e{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:_e}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==_e}onReady(e){this.option("autoStart")&&(e.isInfinite||e.page<e.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var e;this.inHover=!1,null!=(e=this.instance.panzoom)&&e.isResting&&this.resume()}onTimerEnd(){var e=this.instance;"play"===this.state&&(e.isInfinite||e.page!==e.pages.length-1?e.slideNext():e.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){if(!this.option("showProgress"))return null;this.removeProgressBar();var e=this.instance,t=(null==(t=e.pages[e.page])?void 0:t.slides)||[];let i=this.option("progressParentEl");return(i=i||(1===t.length?t[0].el:null)||e.viewport)?(t=document.createElement("div"),b(t,"f-progress"),i.prepend(t),(this.progressBar=t).offsetHeight,t):null}set(){let e=this,t=e.instance;var i,n;t.pages.length<2||e.timer||(i=e.option("timeout"),e.state=He,b(t.container,"has-autoplay"),(n=e.createProgressBar())&&(n.style.transitionDuration=i+"ms",n.style.transform="scaleX(1)"),e.timer=setTimeout(()=>{e.timer=null,e.inHover||e.onTimerEnd()},i),e.emit("set"))}clear(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.removeProgressBar()}start(){var e,t=this;t.set(),t.state!==_e&&(t.option("pauseOnHover")&&((e=t.instance.container).addEventListener("mouseenter",t.onMouseEnter,!1),e.addEventListener("mouseleave",t.onMouseLeave,!1)),document.addEventListener("visibilitychange",t.onVisibilityChange,!1),t.emit("start"))}stop(){var e=this,t=e.state,i=e.instance.container;e.clear(),e.state=_e,i.removeEventListener("mouseenter",e.onMouseEnter,!1),i.removeEventListener("mouseleave",e.onMouseLeave,!1),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),v(i,"has-autoplay"),t!==_e&&e.emit("stop")}
1pause(){this.state===He&&(this.state=Ne,this.clear(),this.emit(Ne))}resume(){let t=this,e=t.instance;if(e.isInfinite||e.page!==e.pages.length-1)if(t.state!==He){if(t.state===Ne&&!t.inHover){let e=new Event("resume",{bubbles:!0,cancelable:!0});t.emit("resume",e),e.defaultPrevented||t.set()}}else t.set();else t.stop()}toggle(){this.state===He||this.state===Ne?this.stop():this.start()}attach(){var e=this,t=e.instance;t.on("ready",e.onReady),t.on("Panzoom.startAnimation",e.onChange),t.on("Panzoom.endAnimation",e.onSettle),t.on("Panzoom.touchMove",e.onChange)}detach(){var e=this,t=e.instance;t.off("ready",e.onReady),t.off("Panzoom.startAnimation",e.onChange),t.off("Panzoom.endAnimation",e.onSettle),t.off("Panzoom.touchMove",e.onChange),e.stop()}}Object.defineProperty(We,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class Xe extends e{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(n){var e=n.carousel;if(e){let i=n.container;i&&(e.options.Autoplay=u({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{n.emit("startSlideshow")},set:e=>{var t;i.classList.add("has-slideshow"),(null==(t=n.getSlide())?void 0:t.state)!==P.Ready&&e.pause()},stop:()=>{i.classList.remove("has-slideshow"),n.isCompact||n.endIdle(),n.emit("endSlideshow")},resume:(e,t)=>{var i;!t||!t.cancelable||(null==(i=n.getSlide())?void 0:i.state)===P.Ready&&null!=(i=null==(i=n.carousel)?void 0:i.panzoom)&&i.isResting||t.preventDefault()}}}),e.attachPlugins({Autoplay:We}),this.ref=e.plugins.Autoplay)}}onReady(e){var e=e.carousel,t=this.ref;t&&e&&this.option("playOnStart")&&(e.isInfinite||e.page<e.pages.length-1)&&t.start()}onDone(e,t){let i=this.ref,n=e.carousel;var s;i&&n&&((s=t.panzoom)&&s.on("startAnimation",()=>{e.isCurrentSlide(t)&&i.stop()}),e.isCurrentSlide(t))&&i.resume()}onKeydown(e,t){var i=this.ref;i&&t===this.option("key")&&"BUTTON"!==(null==(t=document.activeElement)?void 0:t.nodeName)&&i.toggle()}attach(){var e=this,t=e.instance;t.on("Carousel.init",e.onPrepare),t.on("Carousel.ready",e.onReady),t.on("done",e.onDone),t.on("keydown",e.onKeydown)}detach(){var e=this,t=e.instance;t.off("Carousel.init",e.onPrepare),t.off("Carousel.ready",e.onReady),t.off("done",e.onDone),t.off("keydown",e.onKeydown)}}Object.defineProperty(Xe,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:e=>{var t;return(null==(t=e.instance.container)?void 0:t.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||e.instance.container},timeout:3e3}});var M,h,t,i={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};(t=M=M||{})[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden";let qe="isResting",Ye="thumbWidth",n="thumbHeight",O="thumbClipWidth",Ve=class extends e{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:M.Init})}get isModern(){return"modern"===this.type}onInitSlide(e,t){var i=t.el?t.el.dataset:void 0;i&&(t.thumbSrc=i.thumbSrc||t.thumbSrc||"",t[O]=parseFloat(i[O]||"")||t[O]||0,t[n]=parseFloat(i.thumbHe
1ight||"")||t[n]||0),this.addSlide(t)}onInitSlides(){this.build()}onChange(){var e,t,i,n,s,o;this.isModern&&(e=this.container,t=(o=this.instance).panzoom,i=(s=this.carousel)?s.panzoom:null,n=o.page,t)&&s&&i&&(t.isDragging?(v(e,this.cn(qe)),s=(null==(s=s.pages[n])?void 0:s.pos)||0,-1*(s+=o.getProgress(n)*(this[O]+this.thumbGap))>(o=i.getBounds()).x.min&&-1*s<o.x.max&&i.panTo({x:-1*s,friction:.12})):g(e,this.cn(qe),t.isResting),this.shiftModern())}onRefresh(){this.updateProps();for(var e of this.instance.slides||[])this.resizeModernSlide(e);this.shiftModern()}isDisabled(){let e=this.option("minCount")||0;if(e){let t=this.instance,i=0;for(let e of t.slides||[])e.thumbSrc&&i++;if(i<e)return!0}let t=this.option("type");return["modern","classic"].indexOf(t)<0}getThumb(e){var t=this.option("thumbTpl")||"";return{html:this.instance.localize(t,[["%i",e.index],["%d",e.index+1],["%s",e.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(e){var t=this.carousel;t&&t.addSlide(e.index,this.getThumb(e))}getSlides(){var e,t=[];for(e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(e){this.isModern&&(e[Ye]=e[O]&&e[n]?Math.round(this[n]*(e[O]/e[n])):this[Ye])}updateProps(){let t=this.container;var e;t&&(this.thumbGap=(e=e=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+e))||0)("gap"),this.thumbExtraGap=e("extra-gap"),this[Ye]=e("width")||40,this[O]=e("clip-width")||40,this[n]=e("height")||40)}build(){let n=this;if(n.state===M.Init)if(n.isDisabled())n.emit("disabled");else{var i=n.instance,s=i.container,o=n.getSlides(),a=n.option("type"),r=(n.type=a,n.option("parentEl")),l=n.cn("container"),h=n.cn("track");let e=null==r?void 0:r.querySelector("."+l),t=(e||(e=document.createElement("div"),b(e,l),r?r.appendChild(e):s.after(e)),b(e,"is-"+a),b(s,n.cn("hasThumbs")),n.container=e,n.updateProps(),e.querySelector("."+h));t||(t=document.createElement("div"),b(t,n.cn("track")),e.appendChild(t)),n.track=t;l=u({},{track:t,infinite:!1,center:!0,fill:"classic"===a,dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},n.option("Carousel")||{},{Sync:{target:i},slides:o}),r=new i.constructor(e,l);r.on("createSlide",(e,t)=>{n.setProps(t.index),n.emit("createSlide",t,t.el)}),r.on("ready",()=>{n.shiftModern(),n.emit("ready")}),r.on("refresh",()=>{n.shiftModern()}),r.on("Panzoom.click",(e,t,i)=>{n.onClick(i)}),n.carousel=r,n.state=M.Ready}}onClick(e){e.preventDefault(),e.stopPropagation();let t=this.instance,{pages:i,page:n}=t,s=e=>{if(e){e=e.closest("[data-carousel-index]");if(e)return[parseInt(e.dataset.carouselIndex||"",10)||0,e]}return[-1,void 0]},o=(e,t)=>{e=document.elementFromPoint(e,t);return e?s(e):[-1,void 0]},[a,,]=s(e.target);var r,l,h,c;-1<a||(c=this[O],[l,h]=o((r=e.clientX)-c,e=e.clientY),[c,e]=o(r+c,e),h&&e?(a=Math.abs(r-h.getBoundingClientRect().right)<Math.abs(r-e.getBoundingClientRect().left)?l:c)===n&&(a=a===l?c:l):h?a=l:e&&(a=c),-1<a&&i[a]&&t.slideTo(a))}getShift(e){var t=this,i=t.instance,n=t.carousel;if(!i||!n)return 0;var s=t[Ye],o=t[O],a=t.thumbGap,t=t.thumbExtraGap;if(null==(n=n.slides[e])||!n.el)return 0;n=.5*(s-o),s=i.pages.length-1;let r=i.getProgress(0),l=i.getProgress(s),h=i.getProgress(e,!1,!0),c=0,d=n+t+a;o=r<0&&-1<r,i=0<l&&l<1;return 0===e?(c=d*Math.abs(r),i&&1===r&&(c-=d*Math.abs(l))):e===s?(c=d*Math.abs(l)*-1,o&&-1===l&&(c+=d*Math.abs(r))):o||i?(c=-1*d,c=(c+=d*Math.abs(r))+d*(1-Math.abs(l))):c=d*h,c}setProps(e){var t,i;this.isModern&&(i=this.instance,t=this.carousel,i)&&t&&(t=null==(t=t.slides[e])?void 0:t.el)&&t.childNodes.length&&(i=E(1-Math.abs(i.getProgress(e))),e=E(this.getShift(e)),t.style.setProperty("--progress",i?i+"":""),t.style.setProperty("--shift",e+""))}shiftModern(){var s=this;if(s.isModern){let{instance:t,track:e}=s,i=t.panzoom,n=s.carousel;if(t&&e&&i&&n&&i.state!==f.Init&&i.state!==f.Destroy){for(let e of t.slides)s.setProps(e.index);var o=(s[O]+s.thumbGap)*(n.slides.length||0);e.style.setProperty("--width",o+"")}}}cleanup(){var e=this;e.carousel&&e.carousel.destroy(),e.carousel=null,e.container&&e.container.remove(),e.container=null,e.track&&e.track.remove(),e.track=null,e.state=M.Init,v(e.instance.container,e.cn("hasThumbs"))}attach(){var e=this,t=e.instance;t.on("initSlide",e.onInitSlide),t.state===p.Init?t.on("initSlides",e.onInitSlides):e.onInitSlides(),t.on(["change","Panzoom.afterTransform"],e.onChange),t.on("Panzoom.refresh",e.onRefresh)}detach(){var e=this,t=e.instance;t.off("initSlide",e.onInitSlide),t.off("initSlides",e.onInitSlides),t.off(["change","Panzoom.afterTransform"],e.onChange),t.off("Panzoom.refresh",e.onRefresh),e.cleanup()}},Ze=(Object.defineProperty(Ve,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.assign(Object.assign({},i),{key:"t",showOnStart:!0,parentEl:null})),Ue="is-masked",$e="aria-hidden";class Ge extends e{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){var e=this.ref;return e&&!e.isDisabled()}get isHidden(){return this.hidden}onClick(e,t){t.stopPropagation()}onCreateSlide(e,t){var i=(null==(i=null==(i=null==(i=this.instance)?void 0:i.carousel)?void 0:i.slides[t.index])?void 0:i.type)||"",t=t.el;if(t&&i){let e="for-"+i;["video","youtube","vimeo","html5video"].includes(i)&&(e+=" for-video"),b(t,e)}}onInit(){let e,i=this,t=i.instance,n=t.carousel;var s;!i.ref&&n&&(s=i.option("parentEl")||t.footer||t.container)&&((s=u({},i.options,{parentEl:s,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:t.option("Carousel.friction")||0}},on:{ready:e=>{let t=e.container;t&&this.hidden&&(i.refresh(),t.style.transition="none",i.hide(),t.offsetHeight,queueMicrotask(()=>{t.style.transition="",i.show()}))}}})).Carousel=s.Carousel||{},s.Carousel.on=u((null==(e=i.options.Carousel)?void 0:e.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),n.options.Thumbs=s,n.attachPlugins({Thumbs:Ve}),i.ref=n.plugins.Thumbs,i.option("showOnStart")||(i.ref.state=M.Hidden,i.hidden=!0))}onResize(){var e=null==(e=this.ref)?void 0:e.container;e&&(e.style.maxHeight="")}onKeydown(e,t){var i=this.option("key");i&&i===t&&this.toggle()}toggle(){var e=this.ref;if(e&&!e.isDisabled())return e.state===M.Hidden?(e.state=M.Init,void e.build()):void(this.hidden?this.show():this.hide())}show(){var e=this.ref;e&&!e.isDisabled()&&(e=e.container)&&(this.refresh(),e.offsetHeight,e.removeAttribute($e),e.classList.remove(Ue),this.hidden=!1)}hide(){var e=this.ref,e=e&&e.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(Ue),e.setAttribute($e,"true")),this.hidden=!0}refresh(){var e,t=this.ref;t&&t.state&&(e=(null==(t=t.container)?void 0:t.firstChild)||null,t)&&e&&e.childNodes.length&&(t.style.maxHeight=e.getBoundingClientRect().height+"px")}attach(){var e=this,t=e.instance;t.state===S.Init?t.on("Carousel.init",e.onInit):e.onInit(),t.on("resize",e.onResize),t.on("key
1down",e.onKeydown)}detach(){var e=this,t=e.instance;t.off("Carousel.init",e.onInit),t.off("resize",e.onResize),t.off("keydown",e.onKeydown),null!=(t=t.carousel)&&t.detachPlugins(["Thumbs"]),e.ref=null}}Object.defineProperty(Ge,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Ze});let Ke={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}},Je=((t=h=h||{})[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled",{tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}),Qe="has-toolbar",et="fancybox__toolbar";class tt extends e{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:h.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(e){var r;if(e.carousel){let e=this.option("display"),n=this.option("absolute"),s=this.option("enabled");if("auto"===s){let t=this.instance.carousel,i=0;if(t)for(let e of t.slides)!e.panzoom&&"image"!==e.type||i++;i||(s=!1)}let o=0;var l={left:[],middle:[],right:[]};if(e=s?e:void 0)for(let i of["left","middle","right"])for(let t of e[i]){let e=this.createEl(t);e&&(null!=(r=l[i])&&r.push(e),o++)}let a=null;if(a=o?this.createContainer():a){for(let[e,i]of Object.entries(l)){let t=document.createElement("div");b(t,et+"__column is-"+e);for(let e of i)t.appendChild(e);"auto"!==n||"middle"!==e||i.length||(n=!0),a.appendChild(t)}!0===n&&b(a,"is-absolute"),this.state=h.Ready,this.onRefresh()}else this.state=h.Disabled}}onClick(t){var i=this.instance,n=i.getSlide(),n=null==n?void 0:n.panzoom,e=t.target,e=e&&d(e)?e.dataset:null;if(e)if(void 0!==e.fancyboxToggleThumbs)t.preventDefault(),t.stopPropagation(),null!=(s=i.plugins.Thumbs
1)&&s.toggle();else if(void 0!==e.fancyboxToggleFullscreen)t.preventDefault(),t.stopPropagation(),this.instance.toggleFullscreen();else if(void 0!==e.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();let e=null==(i=i.carousel)?void 0:i.plugins.Autoplay;i=e.isActive;n&&"mousemove"===n.panMode&&!i&&n.reset(),void(i?e.stop():e.start())}else{var s=e.panzoomAction,i=e.panzoomChange;if((i||s)&&(t.preventDefault(),t.stopPropagation()),i){let e={};try{e=JSON.parse(i)}catch(t){}n&&n.applyChange(e)}else s&&n&&n[s]&&n[s]()}}onChange(){this.onRefresh()}onRefresh(){if(!this.instance.isClosing()){let i=this.container;if(i){let e=this.instance.getSlide();if(e&&e.state===P.Ready){var t=e&&!e.error&&e.panzoom;for(let e of i.querySelectorAll("[data-panzoom-action]"))t?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));var n=t&&t.canZoomIn(),s=t&&t.canZoomOut();for(let e of i.querySelectorAll('[data-panzoom-action="zoomIn"]'))n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(let e of i.querySelectorAll('[data-panzoom-action="zoomOut"]'))s?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(let t of i.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){s||n?(t.removeAttribute("disabled"),t.removeAttribute("tabindex")):(t.setAttribute("disabled",""),t.setAttribute("tabindex","-1"));let e=t.querySelector("g");e&&(e.style.display=n?"":"none")}}}}}onDone(e,t){var i;null!=(i=t.panzoom)&&i.on("afterTransform",()=>{this.instance.isCurrentSlide(t)&&this.onRefresh()}),this.instance.isCurrentSlide(t)&&this.onRefresh()}createContainer(){var e=this.instance.container;if(!e)return null;var t=this.option("parentEl")||e;let i=t.querySelector("."+et);return i||(i=document.createElement("div"),b(i,et),t.prepend(i)),i.addEventListener("click",this.onClick,{passive:!1,capture:!0}),e&&b(e,Qe),this.container=i}createEl(i){let t=this.instance,n=t.carousel;if(!n)return null;if("toggleFS"===i)return null;if("fullscreen"===i&&!xe())return null;let s=null;var e=n.slides.length||0;let o=0,a=0;for(let e of n.slides)!e.panzoom&&"image"!==e.type||o++,"image"!==e.type&&!e.downloadSrc||a++;if(!(e<2&&["infobar","prev","next"].includes(i))){if(void 0!==Ke[i]&&!o)return null;if("download"===i&&!a)return null;if("thumbs"===i){let e=t.plugins.Thumbs;if(!e||!e.isEnabled)return null}if("slideshow"===i&&(!n.plugins.Autoplay||e<2))return null;if(void 0!==Ke[i]){let e=Ke[i];(s=document.createElement("button")).setAttribute("title",this.instance.localize(`{{${i.toUpperCase()}}}`)),b(s,"f-button"),e.action&&(s.dataset.panzoomAction=e.action),e.change&&(s.dataset.panzoomChange=JSON.stringify(e.change)),s.appendChild(c(this.instance.localize(e.icon)))}else{let t=(this.option("items")||[])[i];t&&(s=c(this.instance.localize(t.tpl)),"function"==typeof t.click)&&s.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),"function"==typeof t.click&&t.click.call(this,this,e)})}var r=null==s?void 0:s.querySelector("svg");if(r)for(let[e,t]of Object.entries(Je))r.getAttribute(e)||r.setAttribute(e,String(t))}return s}removeContainer(){var e=this.container,e=(e&&e.remove(),this.container=null,this.state=h.Disabled,this.instance.container);e&&v(e,Qe)}attach(){var e=this,t=e.instance;t.on("Carousel.initSlides",e.onReady),t.on("done",e.onDone),t.on(["reveal","Carousel.change"],e.onChange),e.onReady(e.instance)}detach(){var e=this,t=e.instance;t.off("Carousel.initSlides",e.onReady),t.off("done",e.onDone),t.off(["reveal","Carousel.change"],e.onChange),e.removeContainer()}}Object.defineProperty(tt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g>
1<path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null}});function it(){var e=window.getSelection();return!!e&&"Range"===e.type}let nt={Hash:class extends e{onReady(){Pe=!1}onChange(e){r&&clearTimeout(r);let t=Te().hash,i=Me().hash,n=e.isOpeningSlide(e.getSlide());n&&(Se=i===t?"":i),t&&t!==i&&(r=setTimeout(()=>{try{if(e.state===S.Ready){let e="replaceState";n&&!Ce&&(e="pushState",Ce=!0),window.history[e]({},document.title,window.location.pathname+window.location.search+t)}}catch(e){}},300))}onClose(e){if(r&&clearTimeout(r),!Pe&&Ce)Ce=!1,Pe=!1,window.history.back();else if(!Pe)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(Se||""))}catch(e){}}attach(){var e=this.instance;e.on("ready",this.onReady),e.on(["Carousel.ready","Carousel.change"],this.onChange),e.on("close",this.onClose)}detach(){var e=this.instance;e.off("ready",this.onReady),e.off(["Carousel.ready","Carousel.change"],this.onChange),e.off("close",this.onClose)}static parseURL(){return Me()}static startFromUrl(){Oe()}static destroy(){window.removeEventListener("hashchange",Le,!1)}},Html:Be,Images:ke,Slideshow:Xe,Thumbs:Ge,Toolbar:tt},st="with-fancybox",ot="hide-scrollbar",at="--fancybox-scrollbar-compensate",rt="--fancybox-body-margin",lt="aria-hidden",ht="is-using-tab",ct="is-animated",dt="is-compact",ut="is-loading",pt="is-opening",gt="has-caption",l="disabled",A="tabindex",mt="download",ft="href",vt="src",L=e=>"string"==typeof e,z,R=null,k=null,bt=0,yt=0,wt=0,xt=0,I=new Map,Et=0;class D extends V{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(e=[],t={},i={}){super(t),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:S.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),z=z||xe(),this.id=t.id||++Et,I.set(this.id,this),this.userSlides=e,this.userPlugins=i,queueMicrotask(()=>{this.init()})}init(){if(this.state!==S.Destroy){if(this.state=S.Init,this.attachPlugins(Object.assign(Object.assign({}
1,D.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),!0===this.option("hideScrollbar"))if(ve){var t=document,i=t.body,t=t.documentElement;if(!i.classList.contains(ot)){let e=window.innerWidth-t.getBoundingClientRect().width;var n=parseFloat(window.getComputedStyle(i).marginRight);e<0&&(e=0),t.style.setProperty(at,e+"px"),n&&i.style.setProperty(rt,n+"px"),i.classList.add(ot)}}this.initLayout(),this.scale();let e=()=>{this.initCarousel(this.userSlides),this.state=S.Ready,this.attachEvents(),this.emit("ready"),setTimeout(()=>{this.container&&this.container.setAttribute(lt,"false")},16)};this.option("Fullscreen.autoStart")&&z&&!z.isFullscreen()?z.request().then(()=>{this.startedFs=!0,e()}).catch(()=>e()):e()}}initLayout(){var e;let t=this.option("parentEl")||document.body,i=c(this.localize(this.option("tpl.main")||""));if(i){if(i.setAttribute("id","fancybox-"+this.id),i.setAttribute("aria-label",this.localize("{{MODAL}}")),i.classList.toggle(dt,this.isCompact),b(i,this.option("mainClass")||""),b(i,pt),this.container=i,this.footer=i.querySelector(".fancybox__footer"),t.appendChild(i),b(document.documentElement,st),R&&k||(R=document.createElement("span"),b(R,"fancybox-focus-guard"),R.setAttribute(A,"0"),R.setAttribute(lt,"true"),R.setAttribute("aria-label","Focus guard"),k=R.cloneNode(),null!=(e=i.parentElement)&&e.insertBefore(R,i),null==(e=i.parentElement))||e.append(k),i.addEventListener("mousedown",e=>{bt=e.pageX,yt=e.pageY,v(i,ht)}),this.option("closeExisting"))for(let e of I.values())e.id!==this.id&&e.close();else this.option("animated")&&(b(i,ct),setTimeout(()=>{this.isClosing()||v(i,ct)},350));this.emit("initLayout")}}initCarousel(e){var t=this.container;t&&(t=t.querySelector(".fancybox__carousel"))&&((t=this.carousel=new a(t,u({},{slides:e,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}))).on("*",(e,t,...i)=>{this.emit("Carousel."+t,e,...i)}),t.on(["ready","change"],()=>{this.manageCaption()}),this.on("Carousel.removeSlide",(e,t,i)=>{this.clearContent(i),i.state=void 0}),t.on("Panzoom.touchStart",()=>{var e;this.isCompact||this.endIdle(),null!=(e=document.activeElement)&&e.closest(".f-thumbs")&&null!=(e=this.container)&&e.focus()}),t.on("settle",()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()}),this.option("dragToClose")&&(t.on("Panzoom.afterTransform",(e,i)=>{var n=this.getSlide();if(!n||!B(n.el)){n=this.container;if(n){let e=Math.abs(i.current.f),t=e<1?"":Math.max(.5,Math.min(1,1-e/i.contentRect.fitHeight*1.5));n.style.setProperty("--fancybox-ts",t?"0s":""),n.style.setProperty("--fancybox-opacity",t+"")}}}),t.on("Panzoom.touchEnd",(e,t,i)=>{var n=this.getSlide();n&&B(n.el)||t.isMobile&&document.activeElement&&-1!==["TEXTAREA","INPUT"].indexOf(null==(n=document.activeElement)?void 0:n.nodeName)||(n=Math.abs(t.dragOffset.y),"y"===t.lockedAxis&&(200<=n||50<=n&&t.dragOffset.time<300)&&(i&&i.cancelable&&i.preventDefault(),this.close(i,"f-throwOut"+(t.current.f<0?"Up":"Down"))))})),t.on("change",t=>{var e,i=null==(e=this.getSlide())?void 0:e.triggerEl;if(i){let e=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}}),t.on(["refresh","change"],t=>{let s=this.container;if(s){for(let e of s.querySelectorAll("[data-fancybox-current-index]"))e.innerHTML=t.page+1;for(let e of s.querySelectorAll("[data-fancybox-count]"))e.innerHTML=t.pages.length;if(!t.isInfinite){for(let e of s.querySelectorAll("[data-fancybox-next]"))t.page<t.pages.length-1?(e.removeAttribute(l),e.removeAttribute(A)):(e.setAttribute(l,""),e.setAttribute(A,"-1"));for(let e of s.querySelectorAll("[data-fancybox-prev]"))0<t.page?(e.removeAttribute(l),e.removeAttribute(A)):(e.setAttribute(l,""),e.setAttribute(A,"-1"))}let n=this.getSlide();if(n){let i=n.downloadSrc||"";
1i||"image"!==n.type||n.error||!L(n.src)||(i=n.src);for(let t of s.querySelectorAll("[data-fancybox-download]")){let e=n.downloadFilename;i?(t.removeAttribute(l),t.removeAttribute(A),t.setAttribute(ft,i),t.setAttribute(mt,e||i),t.setAttribute("target","_blank")):(t.setAttribute(l,""),t.setAttribute(A,"-1"),t.removeAttribute(ft),t.removeAttribute(mt))}}}}),this.emit("initCarousel"))}attachEvents(){var e=this,t=e.container;t&&(t.addEventListener("click",e.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",e.onVisibilityChange,!1),document.addEventListener("mousemove",e.onMousemove),e.option("trapFocus")&&document.addEventListener("focus",e.onFocus,!0),window.addEventListener("resize",e.onResize),t=window.visualViewport)&&(t.addEventListener("scroll",e.onResize),t.addEventListener("resize",e.onResize))}detachEvents(){var e=this,t=e.container;t&&(document.removeEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),t.removeEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),t.removeEventListener("click",e.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",e.onMousemove),window.removeEventListener("resize",e.onResize),(t=window.visualViewport)&&(t.removeEventListener("resize",e.onResize),t.removeEventListener("scroll",e.onResize)),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),document.removeEventListener("focus",e.onFocus,!0))}scale(){var n=this.container;if(n){var s,o,a=window.visualViewport,r=Math.max(1,(null==a?void 0:a.scale)||1);let e="",t="",i="";a&&1<r&&(s=a.offsetLeft+"px",o=a.offsetTop+"px",e=a.width*r+"px",t=a.height*r+"px",i=`translate3d(${s}, ${o}, 0) scale(${1/r})`),n.style.transform=i,n.style.width=e,n.style.height=t}}onClick(t){var{container:e,isCompact:i}=this;if(e&&!this.isClosing()){!i&&this.option("idle")&&this.resetIdle();var n=t.composedPath()[0];if(n.closest(".fancybox-spinner")||n.closest("[data-fancybox-close]"))t.preventDefault(),this.close(t);else if(n.closest("[data-fancybox-prev]"))t.preventDefault(),this.prev();else if(n.closest("[data-fancybox-next]"))t.preventDefault(),this.next();else if(("click"!==t.type||0!==t.detail)&&!(30<Math.abs(t.pageX-bt)||30<Math.abs(t.pageY-yt))){var s=document.activeElement;if(!(it()&&s&&e.contains(s)))if(i&&"image"===(null==(e=this.getSlide())?void 0:e.type))this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout(()=>{this.toggleIdle(),this.clickTimer=null},350);else if(this.emit("click",t),!t.defaultPrevented){let e=!1;if(n.closest(".fancybox__content")){if(s){if(s.closest("[contenteditable]"))return;n.matches(ye)||s.blur()}if(it())return;e=this.option("contentClick")}else n.closest(".fancybox__carousel")&&!n.matches(ye)&&(e=this.option("backdropClick"));"close"===e?(t.preventDefault(),this.close(t)):"next"===e?(t.preventDefault(),this.next()):"prev"===e&&(t.preventDefault(),this.prev())}}}}onWheel(e){var t=e.target;let i=this.option("wheel",e);var n="slide"===(i=t.closest(".fancybox__thumbs")?"slide":i),s=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(e,t){return Math.abs(t)>Math.abs(e)?t:e}),s=Math.max(-1,Math.min(1,s)),o=Date.now();this.pwt&&o-this.pwt<300?n&&e.preventDefault():(this.pwt=o,this.emit("wheel",e,s),e.defaultPrevented||("close"===i?(e.preventDefault(),this.close(e)):"slide"!==i||j(t)||(e.preventDefault(),this[0<s?"prev":"next"]())))}onScroll(){window.scrollTo(wt,xt)}onKeydown(e){var t,i,n,s;this.isTopmost()&&(this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle(),t=e.key,i=this.option("keyboard"))&&(n=e.composedPath()[0],s=(s=document.activeElement&&document.activeElement.classList)&&s.contains("f-button")||n.dataset.carouselPage||n.dataset.carouselIndex,"Escape"!==t&&!s&&d(n)&&(n.isContentEditable||-1!==["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(n.nodeName))||(("Tab"===e.key?b:v)(this.container,ht),e.ctrlKey)||e.altKey||e.shiftKey||(this.emit("keydown",t,e),(s=i[t])&&"function"==typeof this[s]&&(e.preventDefault(),this[s]())
1))}onResize(){var e,t=this.container;t&&(e=this.isCompact,t.classList.toggle(dt,e),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize"))}onFocus(e){this.isTopmost()&&this.checkFocus(e)}onMousemove(e){this.prevMouseMoveEvent=e,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){"visible"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){let e=this.optionFor(t,"closeButton")||!1;if("auto"===e){let e=this.plugins.Toolbar;if(e&&e.state===h.Ready)return}if(e&&t.contentEl&&!t.closeBtnEl){var i=this.option("tpl.closeButton");if(i){let e=c(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&b(t.el,"has-close-btn")}}}manageCaption(i=void 0){var t,n="fancybox__caption",e=this.container;if(e){v(e,gt);var s=this.isCompact||this.option("commonCaption"),o=!s;if(this.caption&&this.stop(this.caption),o&&this.caption&&(this.caption.remove(),this.caption=null),s&&!this.caption)for(let e of(null==(r=this.carousel)?void 0:r.slides)||[])e.captionEl&&(e.captionEl.remove(),e.captionEl=void 0,v(e.el,gt),null!=(t=e.el))&&t.removeAttribute("aria-labelledby");if((i=i||this.getSlide())&&(!s||this.isCurrentSlide(i))){var a=i.el,r=this.optionFor(i,"caption","");if(r){let t=null;if(o){if(t=i.captionEl||null,a&&!t){let e=n+`_${this.id}_`+i.index;t=document.createElement("div"),b(t,n),t.setAttribute("id",e),i.captionEl=a.appendChild(t),b(a,gt),a.setAttribute("aria-labelledby",e)}}else(t=(t=this.caption)||e.querySelector("."+n))||((t=document.createElement("div")).dataset.fancyboxCaption="",b(t,n),(this.footer||e).prepend(t)),b(e,gt),this.caption=t;t&&(t.innerHTML="",L(r)||"number"==typeof r?t.innerHTML=r+"":r instanceof HTMLElement&&t.appendChild(r))}else s&&this.caption&&this.animate(this.caption,"f-fadeOut",()=>{this.caption&&(this.caption.innerHTML="")})}}}checkFocus(e){this.focus(e)}focus(r){if(!this.ignoreFocusChange){let t=document.activeElement||null,i=(null==r?void 0:r.target)||null,o=this.container,a=null==(h=this.carousel)?void 0:h.viewport;if(o&&a&&(r||!t||!o.contains(t))){var l,h=this.getSlide(),c=h&&h.state===P.Ready?h.el:null;if(c&&!c.contains(t)&&o!==t){r&&r.cancelable&&r.preventDefault(),this.ignoreFocusChange=!0;let n=[],s=null;for(l of Array.from(o.querySelectorAll(ye))){let e=!l.offsetParent||!!l.closest('[aria-hidden="true"]'),t=c&&c.contains(l),i=!a.contains(l);if(l===o||(t||i)&&!e){n.push(l);let e=l.dataset.origTabindex;void 0!==e&&e&&(l.tabIndex=parseFloat(e)),l.removeAttribute("data-orig-tabindex"),!l.hasAttribute("autoFocus")&&s||(s=l)}else{let e=void 0===l.dataset.origTabindex?l.getAttribute("tabindex")||"":l.dataset.origTabindex;e&&(l.dataset.origTabindex=e),l.tabIndex=-1}}let e=null;r?(!i||n.indexOf(i)<0)&&(e=s||o,n.length)&&(t===k?e=n[0]:this.lastFocus!==o&&t!==R||(e=n[n.length-1])):e=(!h||"image"!==h.type)&&s||o,e&&we(e),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}}}}next(){var e=this.carousel;e&&1<e.pages.length&&e.slideNext()}prev(){var e=this.carousel;e&&1<e.pages.length&&e.slidePrev()}jumpTo(...e){this.carousel&&this.carousel.slideTo(...e)}isTopmost(){var e;return(null==(e=D.getInstance())?void 0:e.id)==this.id}animate(i=null,n="",s){if(i&&n){this.stop(i);let t=e=>{e.target===i&&i.dataset.animationName&&(i.removeEventListener("animationend",t),delete i.dataset.animationName,s&&s(),v(i,n))};i.dataset.animationName=n,i.addEventListener("animationend",t),b(i,n)}else s&&s()}stop(e){e&&e.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:e}))}setContent(e,i="",n=!0){if(!this.isClosing()){var s=e.el;if(s){let t=null;if(d(i)?t=i:(t=c(i+""),d(t)||((t=document.createElement("div")).innerHTML=i+"")),["img","picture","iframe","video","audio"].includes(t.nodeName.toLowerCase())){let e=document.createElement("div");e.appendChild(t),t=e}(t=d(t)&&e.filter&&!e.error?t.querySelector(e.filter):t)&&d(t)?(b(t,"fancybox__content"),e.id&&t.setAttribute("id",e.id),s.classList.add("has-"+(e.error?"error":e.type||"unknown")),s.prepend(t),"none"===t.style.display&&(t.style.display=""),"none"===getComputedStyle(t).getPropertyValue("display")&&(t.style.display=e.display||this.option("defaultDisplay")||"flex"),e.contentEl=t,n&&this.revealContent(e),this.manageCloseBtn(e),this.manageCaption(e)):this.setError(e,"{{ELEMENT_NOT_FOUND}}")}}}revealContent(e,t){var i=e.el,n=e.contentEl;
1i&&n&&(this.emit("reveal",e),this.hideLoading(e),e.state=P.Opening,(t=this.isOpeningSlide(e)?void 0===t?this.optionFor(e,"showClass"):t:"f-fadeIn")?this.animate(n,t,()=>{this.done(e)}):this.done(e))}done(t){this.isClosing()||(t.state=P.Ready,this.emit("done",t),b(t.el,"is-done"),this.isCurrentSlide(t)&&this.option("autoFocus")&&queueMicrotask(()=>{var e;null!=(e=t.panzoom)&&e.updateControls(),this.option("autoFocus")&&this.focus()}),this.isOpeningSlide(t)&&(v(this.container,pt),!this.isCompact)&&this.option("idle")&&this.setIdle())}isCurrentSlide(e){var t=this.getSlide();return!(!e||!t)&&t.index===e.index}isOpeningSlide(e){var t;return null===(null==(t=this.carousel)?void 0:t.prevPage)&&e&&e.index===(null==(t=this.getSlide())?void 0:t.index)}showLoading(t){t.state=P.Loading;let i=t.el;i&&(b(i,ut),this.emit("loading",t),t.spinnerEl||setTimeout(()=>{var e;this.isClosing()||t.spinnerEl||t.state!==P.Loading||(e=c(G),b(e,"fancybox-spinner"),t.spinnerEl=e,i.prepend(e),this.animate(e,"f-fadeIn"))},250))}hideLoading(t){var i=t.el;if(i){let e=t.spinnerEl;this.isClosing()?null!=e&&e.remove():(v(i,ut),e&&this.animate(e,"f-fadeOut",()=>{e.remove()}
1),t.state===P.Loading&&(this.emit("loaded",t),t.state=P.Ready))}}setError(e,t){var i;this.isClosing()||(i=new Event("error",{bubbles:!0,cancelable:!0}),this.emit("error",i,e),i.defaultPrevented)||(e.error=t,this.hideLoading(e),this.clearContent(e),(i=document.createElement("div")).classList.add("fancybox-error"),i.innerHTML=this.localize(t||"<p>{{ERROR}}</p>"),this.setContent(e,i))}clearContent(e){var t;void 0!==e.state&&(this.emit("clearContent",e),e.contentEl&&(e.contentEl.remove(),e.contentEl=void 0),(t=e.el)&&(v(t,"has-error"),v(t,"has-unknown"),v(t,"has-"+(e.type||"unknown"))),e.closeBtnEl&&e.closeBtnEl.remove(),e.closeBtnEl=void 0,e.captionEl&&e.captionEl.remove(),e.captionEl=void 0,e.spinnerEl&&e.spinnerEl.remove(),e.spinnerEl=void 0)}getSlide(){var e=this.carousel;return(null==(e=null==e?void 0:e.pages[null==e?void 0:e.page])?void 0:e.slides[0])||void 0}close(t,i){if(!this.isClosing()){var e=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",e,t),!e.defaultPrevented){t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());let e=()=>{this.proceedClose(t,i)};this.startedFs&&z&&z.isFullscreen()?Promise.resolve(z.exit()).then(()=>e()):e()}}}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(e=!1){var t=()=>{this.clearIdle(),this.idle=!0,b(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(e)t();else{let e=this.option("idle");e&&(this.idleTimer=setTimeout(t,e))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,v(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){z&&(z.isFullscreen()?z.exit():z.request().then(()=>{this.startedFs=!0}))}isClosing(){return[S.Closing,S.CustomClosing,S.Destroy].includes(this.state)}proceedClose(e,t){var i;this.state=S.Closing,this.clearIdle(),this.detachEvents();let n=this.container,s=this.carousel,o=this.getSlide(),a=o&&this.option("placeFocusBack")?o.triggerEl||this.option("triggerEl"):null;if(a&&(fe(a)?we(a):a.focus()),n&&(v(n,pt),b(n,"is-closing"),n.setAttribute(lt,"true"),this.option("animated")&&b(n,ct),n.style.pointerEvents="none"),s){s.clearTransitions(),null!=(i=s.panzoom)&&i.destroy(),null!=(i=s.plugins.Navigation)&&i.detach();for(let i of s.slides){i.state=P.Closing,this.hideLoading(i);let e=i.contentEl,t=(e&&this.stop(e),null==i?void 0:i.panzoom);t&&(t.stop(),t.detachEvents(),t.detachObserver()),this.isCurrentSlide(i)||s.emit("removeSlide",i)}}wt=window.scrollX,xt=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",e),this.state!==S.CustomClosing?(t=void 0===t&&o?this.optionFor(o,"hideClass"):t)&&o?(this.animate(o.contentEl,t,()=>{s&&s.emit("removeSlide",o)}),setTimeout(()=>{this.destroy()},500)):this.destroy():setTimeout(()=>{this.destroy()},500)}destroy(){var e,t;this.state!==S.Destroy&&(window.removeEventListener("scroll",this.onScroll),this.state=S.Destroy,null!=(e=this.carousel)&&e.destroy(),(e=this.container)&&e.remove(),I.delete(this.id),(e=D.getInstance())?e.focus():(R&&(R.remove(),R=null),k&&(k.remove(),k=null),v(document.documentElement,st),ve&&((t=(e=document).body).classList.remove(ot),t.style.setProperty(rt,""),e.documentElement.style.setProperty(at,"")),this.emit("destroy")))}static bind(n,s,o){if(ve){let e,t="",i={};void 0===n?e=document.body:L(n)?(e=document.body,t=n,"object"==typeof s&&(i=s||{})):(e=n,L(s)&&(t=s),"object"==typeof o&&(i=o||{})),e&&d(e)&&(t=t||"[data-fancybox]",(n=D.openers.get(e)||new Map).set(t,i),D.openers.set(e,n),1===n.size)&&e.addEventListener("click",D.fromEvent)}}static unbind(e,t){let i,n="";L(e)?(i=document.body,n=e):(i=e,L(t)&&(n=t)),i&&((e=D.openers.get(i))&&n&&e.delete(n),n&&e||(D.openers.delete(i),i.removeEventListener("click",D.fromEvent)))}static destroy(){let e;for(;e=D.getInstance();)e.destroy();for(let e of D.openers.keys())e.removeEventListener("click",D.fromEvent);D.openers=new Map}static fromEvent(c){if(!c.defaultPrevented&&!(c.button&&0!==c.button||c.ctrlKey||c.metaKey||c.shift
1Key)){let h=c.composedPath()[0];var d=h.closest("[data-fancybox-trigger]");if(d){let e=d.dataset.fancyboxTrigger||"",t=document.querySelectorAll(`[data-fancybox="${e}"]`),i=parseInt(d.dataset.fancyboxIndex||"",10)||0;h=t[i]||h}if(h&&h instanceof Element){let o,a,r,l;if([...D.openers].reverse().find(([n,e])=>!(!n.contains(h)||![...e].reverse().find(([e,t])=>{var i=h.closest(e);return!!i&&(o=n,a=e,r=i,l=t,!0)}))),o&&a&&r){l=l||{},c.preventDefault(),h=r;let e=[],t=u({},Ee,l),i=(t.event=c,t.triggerEl=h,t.delegate=d,t.groupAll),n=t.groupAttr,s=n&&h?h.getAttribute(""+n):"";return h&&!s&&!i||(e=[].slice.call(o.querySelectorAll(a))),!(e=h&&!i?s?e.filter(e=>e.getAttribute(""+n)===s):[h]:e).length||(c=D.getInstance())&&c.options.triggerEl&&-1<e.indexOf(c.options.triggerEl)?void 0:(h&&(t.startIndex=e.indexOf(h)),D.fromNodes(e,t))}}}}static fromSelector(e,t,i){let n=null,s="",o={};return L(e)?(n=document.body,s=e,"object"==typeof t&&(o=t||{})):e instanceof HTMLElement&&L(t)&&(n=e,s=t,"object"==typeof i)&&(o=i||{}),!!(n&&s&&(e=D.openers.get(n))&&(o=u({},e.get(s)||{},o)))&&D.fromNodes(Array.from(n.querySelectorAll(s)),o)}static fromNodes(e,s){s=u({},Ee,s||{});var o,a=[];for(o of e){let t=o.dataset||{},e=t.src||o.getAttribute(ft)||o.getAttribute("currentSrc")||o.getAttribute(vt)||void 0,i;var r=s.delegate;let n;(i=(i=r&&a.length===s.startIndex?r instanceof HTMLImageElement?r:r.querySelector("img:not([aria-hidden])"):i)||(o instanceof HTMLImageElement?o:o.querySelector("img:not([aria-hidden])")))&&!(n=i.currentSrc||i.src||void 0)&&i.dataset&&(n=i.dataset.lazySrc||i.dataset.src||void 0);var l={src:e,triggerEl:o,thumbEl:i,thumbElSrc:n,thumbSrc:n};for(let e in t){var h="false"!=(h=t[e]+"")&&("true"==h||h);l[e]=h}a.push(l)}return new D(a,s)}static getInstance(e){return e?I.get(e):Array.from(I.values()).reverse().find(e=>!e.isClosing()&&e)||null}static getSlide(){var e;return(null==(e=D.getInstance())?void 0:e.getSlide())||null}static show(e=[],t={}){return new D(e,t)}static next(){var e=D.getInstance();e&&e.next()}static prev(){var e=D.getInstance();e&&e.prev()}static close(e=!0,...t){if(e)for(let e of I.values())e.close(...t);else{let e=D.getInstance();e&&e.close(...t)}}}Object.defineProperty(D,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(D,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Ee}),Object.defineProperty(D,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(D,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),F.Carousel=a,F.Fancybox=D,F.Panzoom=x});
2//# sourceMappingURL=fancybox.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.