!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalthis?globalthis:t||self).window=t.window||{})}(this,(function(t){"use strict";const e=t=>"object"==typeof t&&null!==t&&t.constructor===object&&"[object object]"===object.prototype.tostring.call(t),i=(t,...n)=>{const s=n.length;for(let o=0;o{const o=array.isarray(s)?[]:{};t[n]||object.assign(t,{[n]:o}),e(s)?object.assign(t[n],i(o,s)):array.isarray(s)?object.assign(t,{[n]:[...s]}):object.assign(t,{[n]:s})}))}return t},n=function(t){return(new domparser).parsefromstring(t,"text/html").body.firstchild},s=!("undefined"==typeof window||!window.document||!window.document.createelement);let o;const a=["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([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),r='
',l={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"},c={dragtoclose:!0,hidescrollbar:!0,carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},contentclick:"togglezoom",contentdblclick:!1,backdropclick:"close",animated:!0,idle:3500,showclass:"f-zoominup",hideclass:"f-fadeout",commoncaption:!1,parentel:null,startindex:0,l10n:object.assign(object.assign({},l),{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"}),tpl:{closebutton:'',main:''},groupall:!1,groupattr:"data-fancybox",defaulttype:"image",defaultdisplay:"block",autofocus:!0,trapfocus:!0,placefocusback:!0,closebutton:"auto",keyboard:{escape:"close",delete:"close",backspace:"close",pageup:"next",pagedown:"prev",arrowup:"prev",arrowdown:"next",arrowright:"next",arrowleft:"prev"},fullscreen:{autostart:!1},compact:()=>window.matchmedia("(max-width: 578px), (max-height: 578px)").matches,wheel:"zoom"};var h,d;!function(t){t[t.init=0]="init",t[t.ready=1]="ready",t[t.closing=2]="closing",t[t.customclosing=3]="customclosing",t[t.destroy=4]="destroy"}(h||(h={})),function(t){t[t.loading=0]="loading",t[t.opening=1]="opening",t[t.ready=2]="ready",t[t.closing=3]="closing"}(d||(d={}));const u=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class p{constructor(t={}){object.defineproperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),object.defineproperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new map}),this.setoptions(t);for(const t of object.getownpropertynames(object.getprototypeof(this)))t.startswith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setoptions(t){this.options=t?i({},this.constructor.defaults,t):{};for(const[t,e]of object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=u(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionfor(t,e,i,...n){let s=u(e,t);var o;"string"!=typeof(o=s)||isnan(o)||isnan(parsefloat(o))||(s=parsefloat(s)),"true"===s&&(s=!0),"false"===s&&(s=!1),s&&"function"==typeof s&&(s=s.call(this,this,t,...n));let a=u(e,this.options);return a&&"function"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=string(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let n="";return i?n=this.option(`${e[0]+e.tolowercase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;ie))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):array.isarray(t)&&(i=t),this.events||(this.events=new map),i.foreach((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):array.isarray(t)&&(i=t),i.foreach((t=>{const i=this.events.get(t);if(array.isarray(i)){const t=i.indexof(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].foreach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}object.defineproperty(p,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.7"}),object.defineproperty(p,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class m extends p{constructor(t={}){super(t),object.defineproperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachplugins(t={}){const e=new map;for(const[i,n]of object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach();this.emit("attachplugins")}detachplugins(){for(const t of object.values(this.plugins))t.detach();return this.plugins={},this.emit("detachplugins"),this}}class f extends p{constructor(t,e){super(e),object.defineproperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const g=()=>{queuemicrotask((()=>{(()=>{const{slug:t,index:e}=b.parseurl(),i=xt.getinstance();if(i&&!1!==i.option("hash")){const n=i.carousel;if(t&&n){for(let e of n.slides)if(e.slug&&e.slug===t)return n.slideto(e.index);if(t===i.option("slug"))return n.slideto(e-1);const s=i.getslide(),o=s&&s.triggerel&&s.triggerel.dataset;if(o&&o.fancybox===t)return n.slideto(e-1)}b.hassilentclose=!0,i.close()}b.startfromurl()})()}))};class b extends f{constructor(){super(...arguments),object.defineproperty(this,"orighash",{enumerable:!0,configurable:!0,writable:!0,value:""}),object.defineproperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null})}onchange(){const t=this.instance,e=t.carousel;this.timer&&cleartimeout(this.timer);const i=t.getslide();if(!e||!i)return;const n=t.isopeningslide(i),s=new url(document.url).hash;let o,a=i.slug||void 0;o=a||this.instance.option("slug"),!o&&i.triggerel&&i.triggerel.dataset&&(o=i.triggerel.dataset.fancybox);let r="";o&&"true"!==o&&(r="#"+o+(!a&&e.slides.length>1?"-"+(i.index+1):"")),n&&(this.orighash=s!==r?s:""),r&&s!==r&&(this.timer=settimeout((()=>{try{window.history[n?"pushstate":"replacestate"]({},document.title,window.location.pathname+window.location.search+r)}catch(t){}}),300))}onclose(){if(this.timer&&cleartimeout(this.timer),!0!==b.hassilentclose)try{window.history.replacestate({},document.title,window.location.pathname+window.location.search+(this.orighash||""))}catch(t){}}attach(){this.instance.on("carousel.ready",this.onchange),this.instance.on("carousel.change",this.onchange),this.instance.on("close",this.onclose)}detach(){this.instance.off("carousel.ready",this.onchange),this.instance.off("carousel.change",this.onchange),this.instance.off("close",this.onclose)}static parseurl(){const t=window.location.hash.slice(1),e=t.split("-"),i=e[e.length-1],n=i&&/^\+?\d+$/.test(i)&&parseint(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:n}}static startfromurl(){if(b.hassilentclose=!1,xt.getinstance()||!1===xt.defaults.hash)return;const{hash:t,slug:e,index:i}=b.parseurl();if(!e)return;let n=document.queryselector(`[data-slug="${t}"]`);if(n&&n.dispatchevent(new customevent("click",{bubbles:!0,cancelable:!0})),xt.getinstance())return;const s=document.queryselectorall(`[data-fancybox="${e}"]`);s.length&&(n=s[i-1],n&&n.dispatchevent(new customevent("click",{bubbles:!0,cancelable:!0})))}static destroy(){window.removeeventlistener("hashchange",g,!1)}}function v(){window.addeventlistener("hashchange",g,!1),settimeout((()=>{b.startfromurl()}),500)}object.defineproperty(b,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}}),object.defineproperty(b,"hassilentclose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),s&&(/complete|interactive|loaded/.test(document.readystate)?v():document.addeventlistener("domcontentloaded",v));const y=(t,e=1e4)=>(t=parsefloat(t+"")||0,math.round((t+number.epsilon)*e)/e),w=function(t,e){return!(!t||t===document.body||e&&t===e)&&(function(t){if(!(t&&t instanceof element&&t.offsetparent))return!1;const e=t.scrollheight>t.clientheight,i=window.getcomputedstyle(t).overflowy,n=-1!==i.indexof("hidden"),s=-1!==i.indexof("visible");return e&&!n&&!s}(t)?t:w(t.parentelement,e))},x=t=>`${t||""}`.split(" ").filter((t=>!!t)),s=(t,e,i)=>{x(e).foreach((e=>{t&&t.classlist.toggle(e,i||!1)}))};class e{constructor(t){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=t,this.pagex=t.pagex,this.pagey=t.pagey,this.clientx=t.clientx,this.clienty=t.clienty,this.id=self.touch&&t instanceof touch?t.identifier:-1,this.time=date.now()}}const p={passive:!1};class m{constructor(t,{start:e=(()=>!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=t,this.startcallback=e,this.movecallback=i,this.endcallback=n;for(const t of["onpointerstart","ontouchstart","onmove","ontouchend","onpointerend","onwindowblur"])this[t]=this[t].bind(this);this.element.addeventlistener("mousedown",this.onpointerstart,p),this.element.addeventlistener("touchstart",this.ontouchstart,p),this.element.addeventlistener("touchmove",this.onmove,p),this.element.addeventlistener("touchend",this.ontouchend),this.element.addeventlistener("touchcancel",this.ontouchend)}onpointerstart(t){if(!t.buttons||0!==t.button)return;const e=new e(t);this.currentpointers.some((t=>t.id===e.id))||this.triggerpointerstart(e,t)&&(window.addeventlistener("mousemove",this.onmove),window.addeventlistener("mouseup",this.onpointerend),window.addeventlistener("blur",this.onwindowblur))}ontouchstart(t){for(const e of array.from(t.changedtouches||[]))this.triggerpointerstart(new e(e),t);window.addeventlistener("blur",this.onwindowblur)}onmove(t){const e=this.currentpointers.slice(),i="changedtouches"in t?array.from(t.changedtouches||[]).map((t=>new e(t))):[new e(t)],n=[];for(const t of i){const e=this.currentpointers.findindex((e=>e.id===t.id));e<0||(n.push(t),this.currentpointers[e]=t)}n.length&&this.movecallback(t,this.currentpointers.slice(),e)}onpointerend(t){t.buttons>0&&0!==t.button||(this.triggerpointerend(t,new e(t)),window.removeeventlistener("mousemove",this.onmove),window.removeeventlistener("mouseup",this.onpointerend),window.removeeventlistener("blur",this.onwindowblur))}ontouchend(t){for(const e of array.from(t.changedtouches||[]))this.triggerpointerend(t,new e(e))}triggerpointerstart(t,e){return!!this.startcallback(e,t,this.currentpointers.slice())&&(this.currentpointers.push(t),this.startpointers.push(t),!0)}triggerpointerend(t,e){const i=this.currentpointers.findindex((t=>t.id===e.id));i<0||(this.currentpointers.splice(i,1),this.startpointers.splice(i,1),this.endcallback(t,e,this.currentpointers.slice()))}onwindowblur(){this.clear()}clear(){for(;this.currentpointers.length;){const t=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:t.clientx,clienty:t.clienty}),t,this.currentpointers.slice())}}stop(){this.element.removeeventlistener("mousedown",this.onpointerstart,p),this.element.removeeventlistener("touchstart",this.ontouchstart,p),this.element.removeeventlistener("touchmove",this.onmove,p),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 c(t,e){return e?math.sqrt(math.pow(e.clientx-t.clientx,2)+math.pow(e.clienty-t.clienty,2)):0}function t(t,e){return e?{clientx:(t.clientx+e.clientx)/2,clienty:(t.clienty+e.clienty)/2}:t}var o;!function(t){t[t.init=0]="init",t[t.error=1]="error",t[t.ready=2]="ready",t[t.panning=3]="panning",t[t.mousemove=4]="mousemove",t[t.destroy=5]="destroy"}(o||(o={}));const a=["a","b","c","d","e","f"],l={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:l},z=t=>t&&null!==t&&t instanceof element&&"nodetype"in t,r=(t,e)=>{x(e).foreach((e=>{t&&t.classlist.remove(e)}))},k=(t,e)=>{x(e).foreach((e=>{t&&t.classlist.add(e)}))},i={a:1,b:0,c:0,d:1,e:0,f:0},d=1e5,f=1e3;let j=null,h=null;class b extends m{get istouchdevice(){return null===h&&(h=window.matchmedia("(hover: none)").matches),h}get ismobile(){return null===j&&(j=/iphone|ipad|ipod|android/i.test(navigator.useragent)),j}get panmode(){return"mousemove"!==this.options.panmode||this.istouchdevice?"drag":"mousemove"}get panonlyzoomed(){const t=this.options.panonlyzoomed;return"auto"===t?this.istouchdevice:t}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(){const{a:t,b:e}=this.current;return math.sqrt(t*t+e*e)||1}get targetscale(){const{a:t,b:e}=this.target;return math.sqrt(t*t+e*e)||1}get minscale(){return this.option("minscale")||1}get fullscale(){const{contentrect:t}=this;return t.fullwidth/t.fitwidth||1}get maxscale(){return this.fullscale*(this.option("maxscale")||1)||1}get coverscale(){const{containerrect:t,contentrect:e}=this,i=math.max(t.height/e.fitheight,t.width/e.fitwidth)||1;return math.min(this.fullscale,i)}get isscaling(){return math.abs(this.targetscale-this.scale)>1e-5&&!this.isresting}get iscontentloading(){const t=this.content;return!!(t&&t instanceof htmlimageelement)&&!t.complete}get isresting(){if(this.isbouncingx||this.isbouncingy)return!1;for(const t of a){const e="e"==t||"f"===t?.001:1e-5;if(math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignorebounds&&!this.checkbounds().inbounds)}constructor(t,e={},i={}){var s;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,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),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,"wheeldelta",{enumerable:!0,configurable:!0,writable:!0,value:0}),object.defineproperty(this,"prevwheeldelta",{enumerable:!0,configurable:!0,writable:!0,value:0}),object.defineproperty(this,"prevwheeltime",{enumerable:!0,configurable:!0,writable:!0,value:0}),object.defineproperty(this,"prevmousemoveevent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:o.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({},i)}),object.defineproperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:object.assign({},i)}),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("no element found");if(this.container=t,this.initcontent(),this.attachplugins(object.assign(object.assign({},b.plugins),i)),this.emit("init"),this.iscontentloading){const e=this.content;if(this.option("spinner")){t.classlist.add(this.cn("isloading"));const i=n(r);t.contains(e)?this.spinner=(null===(s=e.parentelement)||void 0===s?void 0:s.insertbefore(i,e))||null:this.spinner=t.appendchild(i)}this.emit("beforeload"),e.addeventlistener("load",this.onload),e.addeventlistener("error",this.onerror)}else queuemicrotask((()=>{this.enable()}))}initcontent(){const{container:t}=this;let e=this.option("content")||t.queryselector(`.${this.cn("content")}`);if(e||(e=t.queryselector("img")||t.firstelementchild,e&&e.classlist.add(this.cn("content"))),!e)throw new error("no content found");this.content=e}onload(){this.spinner&&(this.spinner.remove(),this.spinner=null),this.option("spinner")&&this.container.classlist.remove(this.cn("isloading")),this.emit("afterload"),this.state===o.init&&this.enable()}onerror(){this.state!==o.destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachevents(),this.state=o.error,this.emit("error"))}attachobserver(){var t;const e=()=>math.abs(this.containerrect.width-this.container.getboundingclientrect().width)>.1||math.abs(this.containerrect.height-this.container.getboundingclientrect().height)>.1;this.resizeobserver||void 0===window.resizeobserver||(this.resizeobserver=new resizeobserver((()=>{this.updatetimer||(e()?(this.onresize(),this.ismobile&&(this.updatetimer=settimeout((()=>{e()&&this.onresize(),this.updatetimer=null}),500))):this.updatetimer&&(cleartimeout(this.updatetimer),this.updatetimer=null))}))),null===(t=this.resizeobserver)||void 0===t||t.observe(this.container)}detachobserver(){var t;null===(t=this.resizeobserver)||void 0===t||t.disconnect()}attachevents(){const{container:t}=this;t.addeventlistener("click",this.onclick,{passive:!1,capture:!1}),t.addeventlistener("wheel",this.onwheel,{passive:!1}),this.pointertracker=new m(t,{start:this.onpointerdown,move:this.onpointermove,end:this.onpointerup}),document.addeventlistener("mousemove",this.onmousemove)}detachevents(){var t;const{container:e}=this;e.removeeventlistener("click",this.onclick,{passive:!1,capture:!1}),e.removeeventlistener("wheel",this.onwheel,{passive:!1}),null===(t=this.pointertracker)||void 0===t||t.stop(),this.pointertracker=null,document.removeeventlistener("mousemove",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();const t=this.option("maxvelocity");for(const e of a)this.friction?(this.velocity[e]*=1-this.friction,t&&!this.isscaling&&(this.velocity[e]=math.max(math.min(this.velocity[e],t),-1*t)),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(const t of a)"e"===t&&this.isbouncingx||"f"===t&&this.isbouncingy||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkbounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getbounds(),{x:a,y:r}=o,l=a.min,c=a.max,h=r.min,d=r.max;let u=0,p=0;return l!==1/0&&nc&&(u=c-n),h!==1/0&&sd&&(p=d-s),math.abs(u)<.001&&(u=0),math.abs(p)<.001&&(p=0),object.assign(object.assign({},o),{xdiff:u,ydiff:p,inbounds:!u&&!p})}clamptargetbounds(){const{target:t}=this,{x:e,y:i}=this.getbounds();e.min!==1/0&&(t.e=math.max(t.e,e.min)),e.max!==1/0&&(t.e=math.min(t.e,e.max)),i.min!==1/0&&(t.f=math.max(t.f,i.min)),i.max!==1/0&&(t.f=math.min(t.f,i.max))}calculatecontentdim(t=this.current){const{content:e,contentrect:i}=this,{fitwidth:n,fitheight:s,fullwidth:o,fullheight:a}=i;let r=o,l=a;if(this.option("zoom")||0!==this.angle){const i=!(e instanceof htmlimageelement)&&("none"===window.getcomputedstyle(e).maxwidth||"none"===window.getcomputedstyle(e).maxheight),c=i?o:n,h=i?a:s,d=this.getmatrix(t),u=new dompoint(0,0).matrixtransform(d),p=new dompoint(0+c,0).matrixtransform(d),m=new dompoint(0+c,0+h).matrixtransform(d),f=new dompoint(0,0+h).matrixtransform(d),g=math.abs(m.x-u.x),b=math.abs(m.y-u.y),v=math.abs(f.x-p.x),y=math.abs(f.y-p.y);r=math.max(g,v),l=math.max(b,y)}return{contentwidth:r,contentheight:l}}setedgeforce(){if(this.ignorebounds||this.isdragging||"mousemove"===this.panmode||this.targetscale{const t=window.getselection();return t&&"range"===t.type})()&&!i.closest("button"))return;const n=i.closest("[data-panzoom-action]"),s=i.closest("[data-panzoom-change]"),o=n||s,a=o&&z(o)?o.dataset:null;if(a){const e=a.panzoomchange,i=a.panzoomaction;if((e||i)&&t.preventdefault(),e){let t={};try{t=json.parse(e)}catch(t){console&&console.warn("the given data was not valid json")}return void this.applychange(t)}if(i)return void(this[i]&&this[i]())}if(math.abs(this.dragoffset.x)>3||math.abs(this.dragoffset.y)>3)return t.preventdefault(),void t.stoppropagation();const r=this.content.getboundingclientrect();if(this.dragstart.time&&!this.canzoomout()&&(math.abs(r.x-this.dragstart.x)>2||math.abs(r.y-this.dragstart.y)>2))return;this.dragstart.time=0;const l=e=>{!this.option("zoom")||math.abs(this.velocity.a)>.3||e&&"string"==typeof e&&/(iteratezoom)|(toggle(zoom|full|cover|max)|(zoomto(fit|cover|max)))/.test(e)&&"function"==typeof this[e]&&(t.preventdefault(),this[e]({event:t}))},c=this.option("click",t),h=this.option("dblclick",t);h?(this.clicks++,1==this.clicks&&(this.clicktimer=settimeout((()=>{1===this.clicks?(this.emit("click",t),!t.defaultprevented&&c&&l(c)):(this.emit("dblclick",t),t.defaultprevented||l(h)),this.clicks=0,this.clicktimer=null}),350))):(this.emit("click",t),!t.defaultprevented&&c&&l(c))}addtrackingpoint(t){const e=this.trackingpoints.filter((t=>t.time>date.now()-100));e.push(t),this.trackingpoints=e}onpointerdown(t,e,i){var n;this.dragoffset={x:0,y:0,time:0},this.trackingpoints=[];const s=this.content.getboundingclientrect();if(this.dragstart={x:s.x,y:s.y,top:s.top,left:s.left,time:date.now()},this.clicktimer)return!1;if("mousemove"===this.panmode&&this.targetscale>1)return t.preventdefault(),t.stoppropagation(),!1;if(!i.length){const e=t.composedpath()[0];if(["a","textarea","option","input","select","video"].includes(e.nodename)||e.closest("[contenteditable]")||e.closest("[data-selectable]")||e.closest("[data-panzoom-change]")||e.closest("[data-panzoom-action]"))return!1;null===(n=window.getselection())||void 0===n||n.removeallranges()}return"mousedown"===t.type&&t.preventdefault(),y(this.targetscale,1e3)===y(this.minscale,1e3)?(this.stop(),this.target.e=this.current.e,this.target.f=this.current.f):this.stop("target"),this.isdragging=!0,this.addtrackingpoint(e),this.emit("touchstart",t),!0}onpointermove(t,e,i){if(!1===this.option("touch",t))return;if(!this.isdragging)return;if(e.length<2&&this.panonlyzoomed&&y(this.targetscale)<=y(this.minscale))return;if(this.emit("touchmove",t),t.defaultprevented)return;this.addtrackingpoint(e[0]);const{content:n}=this,s=t(i[0],i[1]),o=t(e[0],e[1]);let a=0,r=0;if(e.length>1){const t=n.getboundingclientrect();a=s.clientx-t.left-.5*t.width,r=s.clienty-t.top-.5*t.height}const l=c(i[0],i[1]),c=c(e[0],e[1]);let h=l?c/l:1,d=o.clientx-s.clientx,u=o.clienty-s.clienty;this.dragoffset.x+=d,this.dragoffset.y+=u,this.dragoffset.time=date.now()-this.dragstart.time;let p=y(this.targetscale)===y(this.minscale)&&this.option("lockaxis");if(p&&!this.lockedaxis)if("xy"===p||"y"===p||"touchmove"===t.type){if(math.abs(this.dragoffset.x)<6&&math.abs(this.dragoffset.y)<6)return void t.preventdefault();const e=math.abs(180*math.atan2(this.dragoffset.y,this.dragoffset.x)/math.pi);this.lockedaxis=e>45&&e<135?"y":"x",this.dragoffset.x=0,this.dragoffset.y=0,d=0,u=0}else this.lockedaxis=p;if(w(t.target,this.content)&&(p="x",this.dragoffset.y=0),p&&"xy"!==p&&this.lockedaxis!==p&&y(this.targetscale)===y(this.minscale))return;t.cancelable&&t.preventdefault(),this.container.classlist.add(this.cn("isdragging"));const m=this.checkbounds(d,u);this.option("rubberband")?("x"!==this.isinfinite&&(m.xdiff>0&&d<0||m.xdiff<0&&d>0)&&(d*=math.max(0,.5-math.abs(.75/this.contentrect.fitwidth*m.xdiff))),"y"!==this.isinfinite&&(m.ydiff>0&&u<0||m.ydiff<0&&u>0)&&(u*=math.max(0,.5-math.abs(.75/this.contentrect.fitheight*m.ydiff)))):(m.xdiff&&(d=0),m.ydiff&&(u=0));const f=this.targetscale,g=this.minscale,b=this.maxscale;f<.5*g&&(h=math.max(h,g)),f>1.5*b&&(h=math.min(h,b)),"y"===this.lockedaxis&&y(f)===y(g)&&(d=0),"x"===this.lockedaxis&&y(f)===y(g)&&(u=0),this.applychange({originx:a,originy:r,panx:d,pany:u,scale:h,friction:this.option("dragfriction"),ignorebounds:!0})}onpointerup(t,e,i){if(i.length)return this.dragoffset.x=0,this.dragoffset.y=0,void(this.trackingpoints=[]);this.container.classlist.remove(this.cn("isdragging")),this.isdragging&&(this.addtrackingpoint(e),this.panonlyzoomed&&this.contentrect.width-this.contentrect.fitwidth<1&&this.contentrect.height-this.contentrect.fitheight<1&&(this.trackingpoints=[]),w(t.target,this.content)&&"y"===this.lockedaxis&&(this.trackingpoints=[]),this.emit("touchend",t),this.isdragging=!1,this.lockedaxis=!1,this.state!==o.destroy&&(t.defaultprevented||this.startdecelanim()))}startdecelanim(){this.raf&&(cancelanimationframe(this.raf),this.raf=null),this.isbouncingx=!1,this.isbouncingy=!1;for(const t of a)this.velocity[t]=0,this.target[t]=this.current[t];r(this.container,"is-scaling"),r(this.container,"is-animating"),this.isticking=!1;const{trackingpoints:t}=this,e=t[0],i=t[t.length-1];let n=0,s=0,o=0;i&&e&&(n=i.clientx-e.clientx,s=i.clienty-e.clienty,o=i.time-e.time);let a=0,r=0,l=0,c=0,h=this.option("decelfriction");const d=this.targetscale;if((dthis.maxscale+1e-5)&&(h=.35),o>0){l=math.abs(n)>3?n/(o/30):0,c=math.abs(s)>3?s/(o/30):0;const t=this.option("maxvelocity");t&&(l=math.max(math.min(l,t),-1*t),c=math.max(math.min(c,t),-1*t))}l&&(a=l/(1/(1-h)-1)),c&&(r=c/(1/(1-h)-1)),("y"===this.option("lockaxis")||"xy"===this.option("lockaxis")&&"y"===this.lockedaxis&&y(d)===this.minscale)&&(a=l=0),("x"===this.option("lockaxis")||"xy"===this.option("lockaxis")&&"x"===this.lockedaxis&&y(d)===this.minscale)&&(r=c=0);const u=this.dragoffset.x,p=this.dragoffset.y,m=this.option("dragminthreshold")||0;math.abs(u){let e=0;return e=t instanceof htmlimageelement?t.naturalwidth:t instanceof svgelement?t.width.baseval.value:t.offsetwidth,math.max(e,t.scrollwidth)})(n)),"auto"===p&&(p=parsefloat(n.dataset.height||"")||(t=>{let e=0;return e=t instanceof htmlimageelement?t.naturalheight:t instanceof svgelement?t.height.baseval.value:t.offsetheight,math.max(e,t.scrollheight)})(n));const m=(this.option("transformparent")?n.parentelement:null)||n,f=m.getattribute("style")||"";m.style.setproperty("transform","none","important"),n instanceof htmlimageelement&&(m.style.width="",m.style.height=""),m.offsetheight;const g=n.getboundingclientrect();let b=g.width,v=g.height,w=0,x=0;if(n instanceof htmlimageelement&&({width:b,height:v,top:w,left:x}=((t,e,i,n)=>{const s=i/n;return s>t/e?(i=t,n=t/s):(i=e*s,n=e),{width:i,height:n,top:.5*(e-n),left:.5*(t-i)}})(g.width,g.height,u,p)),this.contentrect=object.assign(object.assign({},this.contentrect),{top:g.top-a.top+w,bottom:a.bottom-g.bottom+w,left:g.left-a.left+x,right:a.right-g.right+x,fitwidth:b,fitheight:v,width:b,height:v,fullwidth:u,fullheight:p}),m.style.csstext=f,n instanceof htmlimageelement&&(m.style.width=`${b}px`,m.style.height=`${v}px`),this.settransform(),!0!==t){let t="";math.abs(l-s)>1&&(t+="x"),math.abs(c-o)>1&&(t+="y"),t&&this.emit("refresh",t)}this.ignorebounds||(y(this.targetscale)this.maxscale?this.zoomto(this.maxscale,{friction:0}):this.state===o.init||this.checkbounds().inbounds||this.requesttick()),this.updatecontrols()}getbounds(){const t=this.option("bounds");if("auto"!==t)return t;const{contentwidth:e,contentheight:i}=this.calculatecontentdim(this.target);let n=0,s=0,o=0,a=0;const r=this.option("infinite");if(!0===r||this.lockedaxis&&r===this.lockedaxis)n=-1/0,o=1/0,s=-1/0,a=1/0;else{let{containerrect:t,contentrect:r}=this,l=y(this.contentrect.fitwidth*this.targetscale,f),c=y(this.contentrect.fitheight*this.targetscale,f),{innerwidth:h,innerheight:d}=t;if(this.containerrect.width===l&&(h=t.width),this.containerrect.width===c&&(d=t.height),e>h){o=.5*(e-h),n=-1*o;let t=.5*(r.right-r.left);n+=t,o+=t}if(this.contentrect.fitwidth>h&&ed){a=.5*(i-d),s=-1*a;let t=.5*(r.bottom-r.top);s+=t,a+=t}this.contentrect.fitheight>d&&i-1||this.contentrect.height-this.contentrect.fitheight>-1)&&(a=!0),this.contentrect.width*this.targetscaley(this.targetscale),l=!r&&!a&&s&&y(i).9*t.fullscale?"none":"")}}panto({x:t=this.target.e,y:e=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:c=!1}){this.state!==o.destroy&&this.applychange({panx:t-this.target.e,pany:e-this.target.f,scale:i/this.targetscale,angle:s,originx:o,originy:a,friction:n,flipx:r,flipy:l,ignorebounds:c})}applychange({panx:t=0,pany:e=0,scale:i=1,angle:n=0,originx:s=-this.current.e,originy:o=-this.current.f,friction:a=this.option("friction"),flipx:r=!1,flipy:l=!1,ignorebounds:c=!1,bounce:h=this.option("bounce")}){const d=this.state;if(d===o.init||d===o.destroy)return;this.raf&&(cancelanimationframe(this.raf),this.raf=null),this.isbouncingx=!1,this.isbouncingy=!1;for(const t of a)this.velocity[t]=0;this.friction=a||0,this.ignorebounds=c;const{current:u}=this,p=u.e,m=u.f,f=this.getmatrix(this.target);let g=(new dommatrix).translate(p,m).translate(s,o).translate(t,e);if(this.option("zoom")){if(!c){const t=this.targetscale,e=this.minscale,n=this.maxscale;t*in&&(i=n/t)}g=g.scale(i)}g=g.translate(-s,-o).translate(-p,-m).multiply(f),n&&(g=g.rotate(n)),r&&(g=g.scale(-1,1)),l&&(g=g.scale(1,-1));for(const t of a)"a"!=t&&"d"!=t||!(g[t]>this.minscale+1e-5||g[t].1||"mousemove"===this.panmode||!1===h)&&!c&&this.clamptargetbounds(),this.isresting||(this.state=o.panning,this.requesttick())}stop(t=!1){if(this.state===o.init||this.state===o.destroy)return;const e=this.isticking;this.raf&&(cancelanimationframe(this.raf),this.raf=null),this.isbouncingx=!1,this.isbouncingy=!1;for(const e of a)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.settransform(),r(this.container,"is-scaling"),r(this.container,"is-animating"),this.isticking=!1,this.state=o.ready,e&&(this.emit("endanimation"),this.updatecontrols())}requesttick(){this.isticking||(this.emit("startanimation"),this.updatecontrols(),k(this.container,"is-animating"),this.isscaling&&k(this.container,"is-scaling")),this.isticking=!0,this.raf||(this.raf=requestanimationframe((()=>this.animate())))}panwithmouse(t,e=this.option("mousemovefriction")){if(this.prevmousemoveevent=t,"mousemove"!==this.panmode||!t)return;if(y(this.targetscale)<=y(this.minscale))return;this.emit("mousemove",t);const{container:i,containerrect:n,contentrect:s}=this,o=n.width,a=n.height,r=i.getboundingclientrect(),l=(t.clientx||0)-r.left,c=(t.clienty||0)-r.top;let{contentwidth:h,contentheight:d}=this.calculatecontentdim(this.target);const u=this.option("mousemovefactor");u>1&&(h!==o&&(h*=u),d!==a&&(d*=u));let p=.5*(h-o)-l/o*100/100*(h-o);p+=.5*(s.right-s.left);let m=.5*(d-a)-c/a*100/100*(d-a);m+=.5*(s.bottom-s.top),this.applychange({panx:p-this.target.e,pany:m-this.target.f,friction:e})}zoomwithwheel(t){if(this.state===o.destroy||this.state===o.init)return;const e=math.abs(t.deltay)<100&&math.abs(t.deltax)<100?25:50,i=math.max(-1,math.min(1,-t.deltay||-t.deltax||-t.detail)),n=this.targetscale,s=this.maxscale,o=this.minscale;let a=n*(100+i*e)/100;as&&n>=s?(this.wheeldelta+=math.abs(i),a=s):(this.wheeldelta=0,a=math.max(math.min(a,s),o)),this.wheeldelta>this.option("wheellimit")||(t.preventdefault(),a!==n&&this.zoomto(a,{event:t}))}canzoomin(){return this.option("zoom")&&(this.contentrect.widththis.minscale+1e-5}zoomin(t=1.25,e){this.zoomto(this.targetscale*t,e)}zoomout(t=.8,e){this.zoomto(this.targetscale*t,e)}zoomtofit(t){this.zoomto("fit",t)}zoomtocover(t){this.zoomto("cover",t)}zoomtofull(t){this.zoomto("full",t)}zoomtomax(t){this.zoomto("max",t)}togglezoom(t){this.zoomto(this.targetscale-this.minscale<.5*(this.fullscale-this.minscale)?"full":"fit",t)}togglemax(t){this.zoomto(this.targetscale-this.minscale<.5*(this.maxscale-this.minscale)?"max":"fit",t)}togglecover(t){this.zoomto(this.targetscale-this.minscale<.5*(this.coverscale-this.minscale)?"cover":"fit",t)}iteratezoom(t){this.zoomto("next",t)}zoomto(t=1,{friction:e="auto",originx:i=0,originy:n=0,event:s}={}){if(this.iscontentloading||this.state===o.destroy)return;this.stop();const{targetscale:o}=this;let a=1;if("mousemove"===this.panmode&&(s=this.prevmousemoveevent||s),s){const t=this.content.getboundingclientrect(),e=s.clientx||0,o=s.clienty||0;i=e-t.left-.5*t.width,n=o-t.top-.5*t.height}const r=this.fullscale,l=this.maxscale;let c=this.coverscale;"number"==typeof t?a=t/o:("next"===t&&(r-c<.2&&(c=r),t=o1?.15:.25:e,this.applychange({scale:a,originx:i,originy:n,friction:e}),s&&"mousemove"===this.panmode&&this.panwithmouse(s,e)}rotateccw(){this.applychange({angle:-90})}rotatecw(){this.applychange({angle:90})}flipx(){this.applychange({flipx:!0})}flipy(){this.applychange({flipy:!0})}fitx(){this.stop("target");const{containerrect:t,contentrect:e,target:i}=this;this.applychange({panx:.5*t.width-(e.left+.5*e.fitwidth)-i.e,pany:.5*t.height-(e.top+.5*e.fitheight)-i.f,scale:t.width/e.fitwidth/this.targetscale,originx:0,originy:0,ignorebounds:!0})}fity(){this.stop("target");const{containerrect:t,contentrect:e,target:i}=this;this.applychange({panx:.5*t.width-(e.left+.5*e.fitwidth)-i.e,pany:.5*t.height-(e.top+.5*e.fitheight)-i.f,scale:t.height/e.fitheight/this.targetscale,originx:0,originy:0,ignorebounds:!0})}togglefs(){const{container:t}=this,e=this.cn("infullscreen"),i=this.cn("htmlhasfullscreen");t.classlist.toggle(e);const n=t.classlist.contains(e);n?(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(n?"enterfs":"exitfs")}getmatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new dommatrix([e,i,n,s,o,a])}reset(t){if(this.state!==o.init&&this.state!==o.destroy){this.stop("current");for(const t of a)this.target[t]=i[t];this.target.a=this.minscale,this.target.d=this.minscale,this.isresting||(this.friction=void 0===t?this.option("friction"):t,this.state=o.panning,this.requesttick())}}destroy(){this.stop(),this.state=o.destroy,this.detachevents(),this.detachobserver();const{container:t,content:e}=this,i=this.option("classes")||{};for(const e of object.values(i))t.classlist.remove(e+"");e&&(e.removeeventlistener("load",this.onload),e.removeeventlistener("error",this.onerror)),this.detachplugins()}}object.defineproperty(b,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:l}),object.defineproperty(b,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const _=t=>new promise(((e,i)=>{const n=new image;n.onload=e,n.onerror=i,n.src=t}));class n extends f{oncreateslide(t,e,i){const n=this.instance,s=n.optionfor(i,"src")||"",{el:o,type:a}=i;o&&"image"===a&&"string"==typeof s&&this.setcontent(i,s).then((t=>{if(n.isclosing())return;const e=i.contentel,s=i.imageel,o=i.thumbelsrc,a=this.optionfor(i,"initialsize"),r=this.optionfor(i,"zoom"),l={event:n.prevmousemoveevent||n.options.event,friction:r?.12:0};if(e&&s&&o&&n.isopeningslide(i)&&this.getzoominfo(i)){let t=document.createelement("img");k(t,"fancybox-ghost"),e.appendchild(t),t.src=o,settimeout((()=>{n.animate(t,"f-fadefastout",(()=>{t&&(t.remove(),t=null)}))}),333),_(o).then((()=>{i.state=d.opening,this.instance.emit("reveal",i),this.zoomin(i).then((()=>{this.instance.done(i)}),(()=>{n.hideloading(i)}))}),(()=>{n.hideloading(i),n.revealcontent(i)}))}else{let e=n.optionfor(i,"showclass")||void 0,s=!0;n.isopeningslide(i)&&("full"===a?t.zoomtofull(l):"cover"===a?t.zoomtocover(l):"max"===a?t.zoomtomax(l):s=!1,t.stop("current")),s&&e&&(e="f-fadein"),n.revealcontent(i,e)}}),(()=>{n.seterror(i,"{{image_error}}")}))}onremoveslide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageel=void 0}onchange(t,e,i,n){for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onclose(){const t=this.instance,e=t.container,i=t.getslide();if(!e||!e.parentelement||!i)return;const{el:n,contentel:s,panzoom:o}=i,a=i.thumbelsrc;if(!n||!a||!s||!o||o.iscontentloading||o.state===o.init||o.state===o.destroy)return;o.updatemetrics();let r=this.getzoominfo(i);if(!r)return;this.instance.state=h.customclosing,n.classlist.remove("is-zooming-in"),n.classlist.add("is-zooming-out"),s.style.backgroundimage=`url('${a}')`,_(a).then((()=>{n.classlist.add("hide-image")}),(()=>{}));const l=e.getboundingclientrect();object.assign(e.style,{position:"absolute",top:`${window.pageyoffset}px`,left:`${window.pagexoffset}px`,bottom:"auto",right:"auto",width:`${l.width}px`,height:`${l.height}px`,overflow:"hidden"});const{x:c,y:d,scale:u,opacity:p}=r;if(p){const t=((t,e,i,n)=>{const s=e-t,o=n-i;return e=>i+((e-t)/s*o||0)})(o.scale,u,1,0);o.on("aftertransform",(()=>{s.style.opacity=t(o.scale)+""}))}o.on("endanimation",(()=>{t.destroy()})),o.target.a=u,o.target.b=0,o.target.c=0,o.target.d=u,o.panto({x:c,y:d,scale:u,friction:p?.2:.33,ignorebounds:!0}),o.isresting&&t.destroy()}setcontent(t,e){return new promise(((n,s)=>{var o,a;const r=this.instance,l=t.el;if(!l)return void s();r.showloading(t);const c=document.createelement("img");if(c.classlist.add("fancybox-image"),c.src=e||"",c.alt=(null===(o=t.caption)||void 0===o?void 0:o.replace(/<[^>]+>/gi,"").substring(0,1e3))||`image ${t.index+1} of ${null===(a=r.carousel)||void 0===a?void 0:a.pages.length}`,c.draggable=!1,t.srcset&&c.setattribute("srcset",t.srcset),t.sizes&&c.setattribute("sizes",t.sizes),t.imageel=c,r.setcontent(t,c,!1),this.option("protected")){l.addeventlistener("contextmenu",(t=>{t.preventdefault()}));const e=t.contentel;if(e){const t=document.createelement("div");k(t,"fancybox-protected"),e.append(t)}}t.panzoom=new b(l,i({},this.option("panzoom")||{},{content:c,width:r.optionfor(t,"width","auto"),height:r.optionfor(t,"height","auto"),wheel:()=>{const t=r.option("wheel");return("zoom"===t||"pan"==t)&&t},click:(e,i)=>{var n;if(r.iscompact||r.isclosing())return!1;let s=!i||i.target&&(null===(n=t.contentel)||void 0===n?void 0:n.contains(i.target));return r.option(s?"contentclick":"backdropclick")||!1},dblclick:()=>r.iscompact?"togglezoom":r.option("contentdblclick")||!1,spinner:!1,panonlyzoomed:!0,wheellimit:1/0,transformparent:!0,on:{ready:t=>{n(t)},error:()=>{s()},destroy:()=>{s()}}}))}))}zoomin(t){return new promise(((e,i)=>{const{panzoom:n,contentel:s,el:o}=t;n&&n.updatemetrics();const a=this.getzoominfo(t);if(!(a&&o&&s&&n))return void i();const{x:r,y:l,scale:c,opacity:h}=a,u=()=>{t.state!==d.closing&&(h&&(s.style.opacity=math.max(math.min(1,1-(1-n.scale)/(1-c)),0)+""),n.scale>=1&&n.scale>n.targetscale-.1&&e(n))},p=t=>{t.scale<.99||t.scale>1.01||(s.style.opacity="",o.classlist.remove("is-zooming-in"),t.off("endanimation",p),t.off("touchstart",p),t.off("aftertransform",u),e(t))};n.on("endanimation",p),n.on("touchstart",p),n.on("aftertransform",u),n.on(["error","destroy"],(()=>{i()})),n.panto({x:r,y:l,scale:c,friction:0,ignorebounds:!0}),n.stop("current");const m=this.instance,f={event:"mousemove"===n.panmode?m.prevmousemoveevent||m.options.event:void 0},g=this.optionfor(t,"initialsize");k(o,"is-zooming-in"),m.hideloading(t),"full"===g?n.zoomtofull(f):"cover"===g?n.zoomtocover(f):"max"===g?n.zoomtomax(f):n.reset(.165)}))}getzoominfo(t){const{el:e,imageel:i,thumbel:n,panzoom:s}=t;if(!e||!i||!n||!s||(t=>{const e=window.pageyoffset,i=window.pageyoffset+window.innerheight;if(!z(t))return 0;const n=t.getboundingclientrect(),s=n.y+window.pageyoffset,o=n.y+n.height+window.pageyoffset;if(e>o||io)return 100;if(si)return 100;let a=n.height;si&&(a-=o-i);const r=a/window.innerheight*100;return math.round(r)})(n)<5||!this.optionfor(t,"zoom")||this.instance.state===h.destroy)return!1;const{top:o,left:a,width:r,height:l}=n.getboundingclientrect();let{top:c,left:d,fitwidth:u,fitheight:p}=s.contentrect;if(!(r&&l&&u&&p))return!1;const m=r/u,f=s.container.getboundingclientrect();c+=f.top,d+=f.left;const g=-1*(d+.5*u-(a+.5*r)),b=-1*(c+.5*p-(o+.5*l));let v=this.option("zoomopacity")||!1;return"auto"===v&&(v=math.abs(r/l-u/p)>.1),{x:g,y:b,scale:m,opacity:v}}attach(){this.instance.on("carousel.change",this.onchange),this.instance.on("carousel.createslide",this.oncreateslide),this.instance.on("carousel.removeslide",this.onremoveslide),this.instance.on("close",this.onclose)}detach(){this.instance.off("carousel.change",this.onchange),this.instance.off("carousel.createslide",this.oncreateslide),this.instance.off("carousel.removeslide",this.onremoveslide),this.instance.off("close",this.onclose)}}object.defineproperty(n,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialsize:"fit",panzoom:{maxscale:1},protected:!1,zoom:!0,zoomopacity:"auto"}});const w=(t,e={})=>{const i=new url(t),n=new urlsearchparams(i.search),s=new urlsearchparams;for(const[t,i]of[...n,...object.entries(e)]){let e=i.tostring();"t"===t?s.set("start",parseint(e).tostring()):s.set(t,e)}let o=s.tostring(),a=t.match(/#t=((.*)?\d+s)/);return a&&(o+=`#t=${a[1]}`),o},$={ajax:null,autosize:!0,preload:!0,videoautoplay:!0,videoratio:16/9,videotpl:'',videoformat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,rel:0,fs:1}},x=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo","video"];class y extends f{oninitslide(t,e,i){this.processtype(i)}oncreateslide(t,e,i){this.setcontent(i)}onremoveslide(t,e,i){i.closebtnel&&(i.closebtnel.remove(),i.closebtnel=void 0),i.xhr&&(i.xhr.abort(),i.xhr=null),i.iframeel&&(i.iframeel.onload=i.iframeel.onerror=null,i.iframeel.src="//about:blank",i.iframeel=null);const n=i.contentel,s=i.placeholderel;if("inline"===i.type&&n&&s)n.classlist.remove("fancybox__content"),"none"!==n.style.display&&(n.style.display="none"),s.parentnode&&s.parentnode.insertbefore(n,s),s.remove(),i.placeholderel=null;else for(;i.el&&i.el.firstchild;)i.el.removechild(i.el.firstchild)}onselectslide(t,e,i){i.state===d.ready&&this.playvideo()}onunselectslide(t,e,i){var n,s;if("html5video"===i.type){try{null===(s=null===(n=i.el)||void 0===n?void 0:n.queryselector("video"))||void 0===s||s.pause()}catch(t){}return}let o;"vimeo"===i.type?o={method:"pause",value:"true"}:"youtube"===i.type&&(o={event:"command",func:"pausevideo"}),o&&i.iframeel&&i.iframeel.contentwindow&&i.iframeel.contentwindow.postmessage(json.stringify(o),"*"),i.poller&&cleartimeout(i.poller)}ondone(t,e){t.iscurrentslide(e)&&!t.isclosing()&&this.playvideo()}onrefresh(t,e){e.slides.foreach((t=>{t.el&&(this.setaspectratio(t),this.resizeiframe(t))}))}onmessage(t){try{let e=json.parse(t.data);if("https://player.vimeo.com"===t.origin){if("ready"===e.event)for(let e of array.from(document.getelementsbyclassname("fancybox__iframe")))e instanceof htmliframeelement&&e.contentwindow===t.source&&(e.dataset.ready="true")}else if("https://www.youtube-nocookie.com"===t.origin&&"onready"===e.event){const t=document.getelementbyid(e.id);t&&(t.dataset.ready="true")}}catch(t){}}loadajaxcontent(t){const e=this.instance.optionfor(t,"src")||"";this.instance.showloading(t);const i=this.instance,n=new xmlhttprequest;i.showloading(t),n.onreadystatechange=function(){n.readystate===xmlhttprequest.done&&i.state===h.ready&&(i.hideloading(t),200===n.status?i.setcontent(t,n.responsetext):i.seterror(t,404===n.status?"{{ajax_not_found}}":"{{ajax_forbidden}}"))};const s=t.ajax||null;n.open(s?"post":"get",e+""),n.setrequestheader("content-type","application/x-www-form-urlencoded"),n.setrequestheader("x-requested-with","xmlhttprequest"),n.send(s),t.xhr=n}setinlinecontent(t){let e=null;if(z(t.src))e=t.src;else if("string"==typeof t.src){const i=t.src.split("#",2).pop();e=i?document.getelementbyid(i):null}if(e){if("clone"===t.type||e.dataset.placeholderid){e=e.clonenode(!0);const i=e.dataset.animationname;i&&(e.classlist.remove(i),delete e.dataset.animationname),delete e.dataset.placeholderid;let n=e.getattribute("id");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setattribute("id",n)}else if(e.parentnode){const i=document.createelement("div");i.classlist.add("fancybox-placeholder"),e.parentnode.insertbefore(i,e),t.placeholderel=i}this.instance.setcontent(t,e)}else this.instance.seterror(t,"{{element_not_found}}")}setiframecontent(t){const{src:e,el:i}=t;if(!e||"string"!=typeof e||!i)return;const n=this.instance,s=document.createelement("iframe");s.classname="fancybox__iframe",s.setattribute("id",`fancybox__iframe_${n.id}_${t.index}`),s.setattribute("allow","autoplay; fullscreen"),s.setattribute("scrolling","auto"),s.onerror=()=>{n.seterror(t,"{{iframe_error}}")},t.iframeel=s;const o=this.optionfor(t,"preload");if(i.classlist.add("is-loading"),"iframe"!==t.type||!1===o)return s.setattribute("src",t.src+""),this.resizeiframe(t),void n.setcontent(t,s);n.showloading(t),s.onload=()=>{if(!s.src.length)return;const e="true"!==s.dataset.ready;s.dataset.ready="true",this.resizeiframe(t),e?n.revealcontent(t):n.hideloading(t)},s.setattribute("src",e),n.setcontent(t,s,!1)}resizeiframe(t){const e=t.iframeel,i=null==e?void 0:e.parentelement;if(!e||!i)return;let n=t.autosize,s=t.width||0,o=t.height||0;s&&o&&(n=!1);const a=i&&i.style;if(!1!==t.preload&&!1!==n&&a)try{const t=window.getcomputedstyle(i),n=parsefloat(t.paddingleft)+parsefloat(t.paddingright),r=parsefloat(t.paddingtop)+parsefloat(t.paddingbottom),l=e.contentwindow;if(l){const t=l.document,e=t.getelementsbytagname("html")[0],i=t.body;a.width="",i.style.overflow="hidden",s=s||e.scrollwidth+n,a.width=`${s}px`,i.style.overflow="",a.flex="0 0 auto",a.height=`${i.scrollheight}px`,o=e.scrollheight+r}}catch(t){}if(s||o){const t={flex:"0 1 auto",width:"",height:""};s&&(t.width=`${s}px`),o&&(t.height=`${o}px`),object.assign(a,t)}}playvideo(){const t=this.instance.getslide();if(!t)return;const{el:e}=t;if(!e||!e.offsetparent)return;if(!this.optionfor(t,"videoautoplay"))return;if("html5video"===t.type)try{const t=e.queryselector("video");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if("youtube"!==t.type&&"vimeo"!==t.type)return;const i=()=>{if(t.iframeel&&t.iframeel.contentwindow){let e;if("true"===t.iframeel.dataset.ready)return e="youtube"===t.type?{event:"command",func:"playvideo"}:{method:"play",value:"true"},e&&t.iframeel.contentwindow.postmessage(json.stringify(e),"*"),void(t.poller=void 0);"youtube"===t.type&&(e={event:"listening",id:t.iframeel.getattribute("id")},t.iframeel.contentwindow.postmessage(json.stringify(e),"*"))}t.poller=settimeout(i,250)};i()}processtype(t){if(t.html)return t.type="html",t.src=t.html,void(t.html="");const e=this.instance.optionfor(t,"src","");if(!e||"string"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(?:youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listtype=(?:.*)&list=(?:.*))(?:.*)/i)){const s=w(e,this.optionfor(t,"youtube")),o=encodeuricomponent(n[1]);t.videoid=o,t.src=`https://www.youtube-nocookie.com/embed/${o}?${s}`,t.thumbsrc=t.thumbsrc||`https://i.ytimg.com/vi/${o}/mqdefault.jpg`,i="youtube"}else if(n=e.match(/^.+vimeo.com\/(?:\/)?([\d]+)(.*)?/)){const s=w(e,this.optionfor(t,"vimeo")),o=encodeuricomponent(n[1]);t.videoid=o,t.src=`https://player.vimeo.com/video/${o}?${s}`,i="vimeo"}if(!i&&t.triggerel){const e=t.triggerel.dataset.type;x.includes(e)&&(i=e)}i||"string"==typeof e&&("#"===e.charat(0)?i="inline":(n=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i="html5video",t.videoformat=t.videoformat||"video/"+("ogv"===n[1]?"ogg":n[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i="image":e.match(/\.(pdf)((\?|#).*)?$/i)?i="pdf":(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(t.src=`https://maps.google.${n[1]}/?ll=${(n[2]?n[2]+"&z="+math.floor(parsefloat(n[3]))+(n[4]?n[4].replace(/^\//,"&"):""):n[4]+"").replace(/\?/,"&")}&output=${n[4]&&n[4].indexof("layer=c")>0?"svembed":"embed"}`,i="map"):(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace("query=","q=").replace("api=1","")}&output=embed`,i="map")),i=i||this.instance.option("defaulttype"),t.type=i,"image"===i&&(t.thumbsrc=t.thumbsrc||t.src)}setcontent(t){const e=this.instance.optionfor(t,"src")||"";if(t&&t.type&&e){switch(t.type){case"html":this.instance.setcontent(t,e);break;case"html5video":const i=this.option("videotpl");i&&this.instance.setcontent(t,i.replace(/\{\{src\}\}/gi,e+"").replace(/\{\{format\}\}/gi,this.optionfor(t,"videoformat")||"").replace(/\{\{poster\}\}/gi,t.poster||t.thumbsrc||""));break;case"inline":case"clone":this.setinlinecontent(t);break;case"ajax":this.loadajaxcontent(t);break;case"pdf":case"map":case"youtube":case"vimeo":t.preload=!1;case"iframe":this.setiframecontent(t)}this.setaspectratio(t)}}setaspectratio(t){var e;const i=t.contentel,n=this.optionfor(t,"videoratio"),s=null===(e=t.el)||void 0===e?void 0:e.getboundingclientrect();if(!(i&&s&&n&&1!==n&&t.type&&["video","youtube","vimeo","html5video"].includes(t.type)))return;const o=s.width,a=s.height;i.style.aspectratio=n+"",i.style.width=o/a>n?"auto":"",i.style.height=o/a>n?"":"auto"}attach(){this.instance.on("carousel.initslide",this.oninitslide),this.instance.on("carousel.createslide",this.oncreateslide),this.instance.on("carousel.removeslide",this.onremoveslide),this.instance.on("carousel.selectslide",this.onselectslide),this.instance.on("carousel.unselectslide",this.onunselectslide),this.instance.on("carousel.panzoom.refresh",this.onrefresh),this.instance.on("done",this.ondone),window.addeventlistener("message",this.onmessage)}detach(){this.instance.off("carousel.initslide",this.oninitslide),this.instance.off("carousel.createslide",this.oncreateslide),this.instance.off("carousel.removeslide",this.onremoveslide),this.instance.off("carousel.selectslide",this.onselectslide),this.instance.off("carousel.unselectslide",this.onunselectslide),this.instance.off("carousel.panzoom.refresh",this.onrefresh),this.instance.off("done",this.ondone),window.removeeventlistener("message",this.onmessage)}}object.defineproperty(y,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:$});class q extends f{constructor(){super(...arguments),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:"ready"}),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"ready"!==this.state}onready(t){this.option("autostart")&&(t.isinfinite||t.page{this.timer=null,this.inhover||this.ontimerend()}),t),this.emit("set")}clear(){this.timer&&(cleartimeout(this.timer),this.timer=null),this.removeprogressbar()}start(){if(this.set(),this.option("pauseonhover")){const t=this.instance.container;t.addeventlistener("mouseenter",this.onmouseenter,!1),t.addeventlistener("mouseleave",this.onmouseleave,!1)}document.addeventlistener("visibilitychange",this.onvisibilitychange,!1)}stop(){const t=this.instance.container;this.clear(),this.state="ready",t.removeeventlistener("mouseenter",this.onmouseenter,!1),t.removeeventlistener("mouseleave",this.onmouseleave,!1),document.removeeventlistener("visibilitychange",this.onvisibilitychange,!1),r(t,"has-autoplay"),this.emit("stop")}pause(){"play"===this.state&&(this.state="pause",this.clear(),this.emit("pause"))}resume(){const t=this.instance;if(t.isinfinite||t.page!==t.pages.length-1)if("play"!==this.state){if("pause"===this.state&&!this.inhover){const t=new event("resume",{bubbles:!0,cancelable:!0});this.emit("resume",event),t.defaultprevented||this.set()}}else this.set();else this.stop()}toggle(){"play"===this.state||"pause"===this.state?this.stop():this.set()}attach(){this.instance.on("ready",this.onready),this.instance.on("panzoom.startanimation",this.onchange),this.instance.on("panzoom.endanimation",this.onsettle),this.instance.on("panzoom.touchmove",this.onchange)}detach(){this.instance.off("ready",this.onready),this.instance.off("panzoom.startanimation",this.onchange),this.instance.off("panzoom.endanimation",this.onsettle),this.instance.off("panzoom.touchmove",this.onchange),this.stop()}}object.defineproperty(q,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autostart:!0,pauseonhover:!0,progressparentel:null,showprogress:!0,timeout:3e3}});class z extends f{constructor(){super(...arguments),object.defineproperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onprepare(t){const e=t.carousel;if(!e)return;const n=t.container;n&&(e.options.autoplay=i(this.option("autoplay")||{},{pauseonhover:!1,autostart:!1,timeout:this.option("timeout"),progressparentel:()=>n.queryselector(".fancybox__toolbar [data-fancybox-toggle-slideshow]")||n,on:{set:e=>{var i;n.classlist.add("has-slideshow"),(null===(i=t.getslide())||void 0===i?void 0:i.state)!==d.ready&&e.pause()},stop:()=>{n.classlist.remove("has-slideshow"),t.iscompact||t.endidle()},resume:(e,i)=>{var n,s,o;!i||!i.cancelable||(null===(n=t.getslide())||void 0===n?void 0:n.state)===d.ready&&(null===(o=null===(s=t.carousel)||void 0===s?void 0:s.panzoom)||void 0===o?void 0:o.isresting)||i.preventdefault()}}}),e.attachplugins({autoplay:q}),this.ref=e.plugins.autoplay)}onready(t){const e=t.carousel,i=this.ref;e&&i&&this.option("playonstart")&&(e.isinfinite||e.page{t.iscurrentslide(e)&&i.stop()})),t.iscurrentslide(e)&&i.resume()}onkeydown(t,e){var i;const n=this.ref;n&&e===this.option("key")&&"button"!==(null===(i=document.activeelement)||void 0===i?void 0:i.nodename)&&n.toggle()}attach(){this.instance.on("carousel.init",this.onprepare),this.instance.on("carousel.ready",this.onready),this.instance.on("done",this.ondone),this.instance.on("keydown",this.onkeydown)}detach(){this.instance.off("carousel.init",this.onprepare),this.instance.off("carousel.ready",this.onready),this.instance.off("done",this.ondone),this.instance.off("keydown",this.onkeydown)}}object.defineproperty(z,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playonstart:!1,timeout:3e3}});const v={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:'',type:"modern"};var g;!function(t){t[t.init=0]="init",t[t.ready=1]="ready",t[t.hidden=2]="hidden",t[t.disabled=3]="disabled"}(g||(g={}));let u=class extends f{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,"panzoom",{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,"shouldcenter",{enumerable:!0,configurable:!0,writable:!0,value:!0}),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:g.init})}formatthumb(t,e){return this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbsrc||"data:image/gif;base64,r0lgodlhaqabaiaaaaaaap///yh5baeaaaaalaaaaaabaaeaaaibraa7"]])}getslides(){const t=[],e=this.option("thumbtpl")||"";if(e)for(const i of this.instance.slides||[]){let n="";i.type&&(n=`for-${i.type}`,i.type&&["video","youtube","vimeo","html5video"].includes(i.type)&&(n+=" for-video")),t.push({html:this.formatthumb(i,e),customclass:n})}return t}getprogress(t){const e=this.instance,i=e.panzoom,n=e.pages[t]||0;if(!n||!i)return 0;let s=-1*i.current.e,o=e.contentdim,a=(s-n.pos)/(1*n.dim),r=(s+o-n.pos)/(1*n.dim),l=(s-o-n.pos)/(1*n.dim);return a=math.max(0,math.min(1,math.abs(a))),r=math.max(0,math.min(1,math.abs(r))),l=math.max(0,math.min(1,math.abs(l))),a=math.min(a,r,l),a}oninitslide(t,e){const i=e.el;i&&(e.thumbsrc=i.dataset.thumbsrc||e.thumbsrc||"",e.thumbclipwidth=parsefloat(i.dataset.thumbclipwidth||"")||e.thumbclipwidth||0,e.thumbheight=parsefloat(i.dataset.thumbheight||"")||e.thumbheight||0)}oninitslides(){this.state===g.init&&this.build()}onrefreshm(){this.refreshmodern()}onchangem(){"modern"===this.type&&(this.shouldcenter=!0,this.centermodern())}onclickmodern(t){t.preventdefault(),t.stoppropagation();const e=this.instance,i=e.page,n=t=>{if(t){const e=t.closest("[data-carousel-index]");if(e)return parseint(e.dataset.carouselindex||"",10)||0}return-1},s=(t,e)=>{const i=document.elementfrompoint(t,e);return i?n(i):-1};let o=n(t.target);o<0&&(o=s(t.clientx+this.thumbgap,t.clienty),o===i&&(o=i-1)),o<0&&(o=s(t.clientx-this.thumbgap,t.clienty),o===i&&(o=i+1)),o<0&&(o=(e=>{let n=s(t.clientx-e,t.clienty),a=s(t.clientx+e,t.clienty);return o<0&&n===i&&(o=i+1),o<0&&a===i&&(o=i-1),o})(this.thumbextragap)),o===i?this.centermodern():o>-1&&o{this.emit("ready")}))}buildmodern(){if("modern"!==this.type)return;const{container:t,track:e,instance:i}=this,s=this.option("thumbtpl")||"";if(!t||!e||!s)return;k(t,"is-horizontal"),this.updatemodern();for(const t of i.slides||[]){const i=document.createelement("div");if(k(i,this.cn("slide")),t.type){let e=`for-${t.type}`;["video","youtube","vimeo","html5video"].includes(t.type)&&(e+=" for-video"),k(i,e)}i.appendchild(n(this.formatthumb(t,s))),t.thumbslideel=i,e.appendchild(i),this.resizemodernslide(t)}const o=new i.constructor.panzoom(t,{content:e,lockaxis:"x",zoom:!1,panonlyzoomed:!1,bounds:()=>{let t=0,e=0,n=i.slides[0],s=i.slides[i.slides.length-1],o=i.slides[i.page];return n&&s&&o&&(e=-1*this.getmodernthumbpos(0),0!==i.page&&(e+=.5*(n.thumbwidth||0)),t=-1*this.getmodernthumbpos(i.slides.length-1),i.page!==i.slides.length-1&&(t+=(s.thumbwidth||0)-(o.thumbwidth||0)-.5*(s.thumbwidth||0))),{x:{min:t,max:e},y:{min:0,max:0}}}});o.on("touchstart",(()=>{this.shouldcenter=!1})),o.on("click",((t,e)=>this.onclickmodern(e))),o.on("ready",(()=>{this.centermodern(),this.emit("ready")})),o.on(["aftertransform","refresh"],(t=>{this.lazyloadmodern()})),this.panzoom=o,this.refreshmodern()}updatemodern(){if("modern"!==this.type)return;const{container:t}=this;t&&(this.thumbgap=parsefloat(getcomputedstyle(t).getpropertyvalue("--f-thumb-gap"))||0,this.thumbextragap=parsefloat(getcomputedstyle(t).getpropertyvalue("--f-thumb-extra-gap"))||0,this.thumbwidth=parsefloat(getcomputedstyle(t).getpropertyvalue("--f-thumb-width"))||40,this.thumbclipwidth=parsefloat(getcomputedstyle(t).getpropertyvalue("--f-thumb-clip-width"))||40,this.thumbheight=parsefloat(getcomputedstyle(t).getpropertyvalue("--f-thumb-height"))||40)}refreshmodern(){var t;if("modern"===this.type){this.updatemodern();for(const t of this.instance.slides||[])this.resizemodernslide(t);this.ontransformm(),null===(t=this.panzoom)||void 0===t||t.updatemetrics(!0),this.centermodern(0)}}centermodern(t){const e=this.instance,{container:i,panzoom:n}=this;if(!i||!n||n.state===o.init)return;const s=e.page;let o=this.getmodernthumbpos(s),a=o;for(let t=e.page-3;te.pages.length-1||t===e.page)continue;const i=1-this.getprogress(t);i>0&&i<1&&(a+=i*(this.getmodernthumbpos(t)-o))}let r=100;void 0===t&&(t=.2,e.intransition.size>0&&(t=.12),math.abs(-1*n.current.e-a)>n.containerrect.width&&(t=.5,r=0)),n.options.maxvelocity=r,n.applychange({panx:y(-1*a-n.target.e,1e3),friction:null===e.prevpage?0:t})}lazyloadmodern(){const{instance:t,panzoom:e}=this;if(!e)return;const i=-1*e.current.e||0;let s=this.getmodernthumbpos(t.page);if(e.state!==o.init||0===s)for(const s of t.slides||[]){const t=s.thumbslideel;if(!t)continue;const o=t.queryselector("img[data-lazy-src]"),a=s.index,l=this.getmodernthumbpos(a),c=i-.5*e.containerrect.innerwidth,h=c+e.containerrect.innerwidth;if(!o||lh)continue;let d=o.dataset.lazysrc;if(!d||!d.length)continue;if(delete o.dataset.lazysrc,o.src=d,o.complete)continue;k(t,this.cn("isloading"));const u=n(r);t.appendchild(u),o.addeventlistener("load",(()=>{t.offsetparent&&(t.classlist.remove(this.cn("isloading")),u.remove())}),!1)}}resizemodernslide(t){if("modern"!==this.type)return;if(!t.thumbslideel)return;const e=t.thumbclipwidth&&t.thumbheight?math.round(this.thumbheight*(t.thumbclipwidth/t.thumbheight)):this.thumbwidth;t.thumbwidth=e}getmodernthumbpos(t){const e=this.instance.slides[t],i=this.panzoom;if(!i||!i.contentrect.fitwidth)return 0;let n=i.containerrect.innerwidth,s=i.contentrect.width;2===this.instance.slides.length&&(t-=1,s=2*this.thumbclipwidth);let o=t*(this.thumbclipwidth+this.thumbgap)+this.thumbextragap+.5*(e.thumbwidth||0);return o-=s>n?.5*n:.5*s,y(o||0,1)}build(){const t=this.instance,e=t.container,i=this.option("mincount")||0;if(i){let e=0;for(const i of t.slides||[])i.thumbsrc&&e++;if(e{e.stoppropagation()}}},on:{ready:t=>{const e=t.container;e&&this.hidden&&(this.refresh(),e.style.transition="none",this.hide(),e.offsetheight,queuemicrotask((()=>{e.style.transition="",this.show()})))}}}),e.attachplugins({thumbs:u}),this.ref=e.plugins.thumbs,this.option("showonstart")||(this.ref.state=g.hidden,this.hidden=!0))}onresize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxheight="")}onkeydown(t,e){const i=this.option("key");i&&i===e&&this.toggle()}toggle(){const t=this.ref;t&&t.state!==g.disabled&&(t.state!==g.hidden?this.hidden?this.show():this.hide():t.build())}show(){const t=this.ref,e=t&&t.state!==g.disabled&&t.container;e&&(this.refresh(),e.offsetheight,e.removeattribute("aria-hidden"),e.classlist.remove("is-hidden"),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetheight,e.classlist.add("is-hidden"),e.setattribute("aria-hidden","true")),this.hidden=!0}refresh(){const t=this.ref;if(!t||t.state===g.disabled)return;const e=t.container,i=(null==e?void 0:e.firstchild)||null;e&&i&&i.childnodes.length&&(e.style.maxheight=`${i.getboundingclientrect().height}px`)}attach(){this.instance.on("carousel.init",this.oninit),this.instance.on("resize",this.onresize),this.instance.on("keydown",this.onkeydown)}detach(){this.instance.off("carousel.init",this.oninit),this.instance.off("resize",this.onresize),this.instance.off("keydown",this.onkeydown)}}object.defineproperty(j,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:k});const q={panleft:{icon:'',change:{panx:-100}},panright:{icon:'',change:{panx:100}},panup:{icon:'',change:{pany:-100}},pandown:{icon:'',change:{pany:100}},zoomin:{icon:'',action:"zoomin"},zoomout:{icon:'',action:"zoomout"},toggle1to1:{icon:'',action:"togglezoom"},togglezoom:{icon:'',action:"togglezoom"},iteratezoom:{icon:'',action:"iteratezoom"},rotateccw:{icon:'',action:"rotateccw"},rotatecw:{icon:'',action:"rotatecw"},flipx:{icon:'',action:"flipx"},flipy:{icon:'',action:"flipy"},fitx:{icon:'',action:"fitx"},fity:{icon:'',action:"fity"},reset:{icon:'',action:"reset"},togglefs:{icon:'',action:"togglefs"}};var tt;!function(t){t[t.init=0]="init",t[t.ready=1]="ready",t[t.disabled=2]="disabled"}(tt||(tt={}));const et={absolute:"auto",display:{left:["infobar"],middle:[],right:["iteratezoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'
/
'},download:{tpl:''},prev:{tpl:''},next:{tpl:''},slideshow:{tpl:''},fullscreen:{tpl:''},thumbs:{tpl:''},close:{tpl:''}},parentel:null},it={tabindex:"-1",width:"24",height:"24",viewbox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};class nt extends f{constructor(){super(...arguments),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:tt.init}),object.defineproperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onready(t){var e;if(!t.carousel)return;let i=this.option("display"),n=this.option("absolute"),s=this.option("enabled");if("auto"===s){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||"image"===i.type)&&e++;e||(s=!1)}s||(i=void 0);let o=0;const a={left:[],middle:[],right:[]};if(i)for(const t of["left","middle","right"])for(const n of i[t]){const i=this.createel(n);i&&(null===(e=a[t])||void 0===e||e.push(i),o++)}let r=null;if(o&&(r=this.createcontainer()),r){for(const[t,e]of object.entries(a)){const i=document.createelement("div");k(i,"fancybox__toolbar__column is-"+t);for(const t of e)i.appendchild(t);"auto"!==n||"middle"!==t||e.length||(n=!0),r.appendchild(i)}!0===n&&k(r,"is-absolute"),this.state=tt.ready,this.onrefresh()}else this.state=tt.disabled}onclick(t){var e,i;const n=this.instance,s=n.getslide(),o=null==s?void 0:s.panzoom,a=t.target,r=a&&z(a)?a.dataset:null;if(!r)return;if(void 0!==r.fancyboxtogglethumbs)return t.preventdefault(),t.stoppropagation(),void(null===(e=n.plugins.thumbs)||void 0===e||e.toggle());if(void 0!==r.fancyboxtogglefullscreen)return t.preventdefault(),t.stoppropagation(),void this.instance.togglefullscreen();if(void 0!==r.fancyboxtoggleslideshow){t.preventdefault(),t.stoppropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.autoplay;let s=e.isactive;return o&&"mousemove"===o.panmode&&!s&&o.reset(),void(s?e.stop():e.start())}const l=r.panzoomaction,c=r.panzoomchange;if((c||l)&&(t.preventdefault(),t.stoppropagation()),c){let t={};try{t=json.parse(c)}catch(t){}o&&o.applychange(t)}else l&&o&&o[l]&&o[l]()}onchange(){this.onrefresh()}onrefresh(){if(this.instance.isclosing())return;const t=this.container;if(!t)return;const e=this.instance.getslide();if(!e||e.state!==d.ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.queryselectorall("[data-panzoom-action]"))i?(e.removeattribute("disabled"),e.removeattribute("tabindex")):(e.setattribute("disabled",""),e.setattribute("tabindex","-1"));let n=i&&i.canzoomin(),s=i&&i.canzoomout();for(const e of t.queryselectorall('[data-panzoom-action="zoomin"]'))n?(e.removeattribute("disabled"),e.removeattribute("tabindex")):(e.setattribute("disabled",""),e.setattribute("tabindex","-1"));for(const e of t.queryselectorall('[data-panzoom-action="zoomout"]'))s?(e.removeattribute("disabled"),e.removeattribute("tabindex")):(e.setattribute("disabled",""),e.setattribute("tabindex","-1"));for(const e of t.queryselectorall('[data-panzoom-action="togglezoom"],[data-panzoom-action="iteratezoom"]')){s||n?(e.removeattribute("disabled"),e.removeattribute("tabindex")):(e.setattribute("disabled",""),e.setattribute("tabindex","-1"));const t=e.queryselector("g");t&&(t.style.display=n?"":"none")}}ondone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on("aftertransform",(()=>{this.instance.iscurrentslide(e)&&this.onrefresh()})),this.instance.iscurrentslide(e)&&this.onrefresh()}createcontainer(){const t=this.instance.container;if(!t)return null;const e=this.option("parentel")||t,i=document.createelement("div");return k(i,"fancybox__toolbar"),e.prepend(i),i.addeventlistener("click",this.onclick,{passive:!1,capture:!0}),t&&k(t,"has-toolbar"),this.container=i,i}createel(t){var e;const i=this.instance.carousel;if(!i)return null;if("togglefs"===t)return null;if("fullscreen"===t&&!this.instance.fsapi)return null;let s=null;const o=i.slides.length||0;let a=0,r=0;for(const t of i.slides)(t.panzoom||"image"===t.type)&&a++,("image"===t.type||t.downloadsrc)&&r++;if(o<2&&["infobar","prev","next"].includes(t))return s;if(void 0!==q[t]&&!a)return null;if("download"===t&&!r)return null;if("thumbs"===t){const t=this.instance.plugins.thumbs;if(!t||!t.isenabled)return null}if("slideshow"===t){if(!(null===(e=this.instance.carousel)||void 0===e?void 0:e.plugins.autoplay)||o<2)return null}if(void 0!==q[t]){const e=q[t];s=document.createelement("button"),s.setattribute("title",this.instance.localize(`{{${t.touppercase()}}}`)),k(s,"f-button"),e.action&&(s.dataset.panzoomaction=e.action),e.change&&(s.dataset.panzoomchange=json.stringify(e.change)),s.appendchild(n(this.instance.localize(e.icon)))}else{const e=(this.option("items")||[])[t];e&&(s=n(this.instance.localize(e.tpl)),"function"==typeof e.click&&s.addeventlistener("click",(t=>{t.preventdefault(),t.stoppropagation(),"function"==typeof e.click&&e.click.call(this,this,t)})))}const l=null==s?void 0:s.queryselector("svg");if(l)for(const[t,e]of object.entries(it))l.getattribute(t)||l.setattribute(t,string(e));return s}removecontainer(){var t;const e=this.container;e&&e.removeeventlistener("click",this.onclick,{passive:!1,capture:!0}),null===(t=this.container)||void 0===t||t.remove(),this.container=null,this.state=tt.disabled;const i=this.instance.container;i&&r(i,"has-toolbar")}attach(){this.instance.on("carousel.initslides",this.onready),this.instance.on("done",this.ondone),this.instance.on("reveal",this.onchange),this.instance.on("carousel.change",this.onchange),this.onready(this.instance)}detach(){this.instance.off("carousel.initslides",this.onready),this.instance.off("done",this.ondone),this.instance.off("reveal",this.onchange),this.instance.off("carousel.change",this.onchange),this.removecontainer()}}object.defineproperty(nt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:et});const st={hash:b,html:y,images:n,slideshow:z,thumbs:j,toolbar:nt},ot=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),settimeout((()=>{i=!0}),e))}},at=(t,e)=>{let i=[];return t.childnodes.foreach((t=>{t.nodetype!==node.element_node||e&&!t.matches(e)||i.push(t)})),i},rt={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"}};var lt;!function(t){t[t.init=0]="init",t[t.ready=1]="ready",t[t.destroy=2]="destroy"}(lt||(lt={}));const ct=t=>{if("string"==typeof t&&(t={html:t}),!(t instanceof string||t instanceof htmlelement)){const e=t.thumb;void 0!==e&&("string"==typeof e&&(t.thumbsrc=e),e instanceof htmlimageelement&&(t.thumbel=e,t.thumbelsrc=e.src,t.thumbsrc=e.src),delete t.thumb)}return object.assign({html:"",el:null,isdom:!1,class:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},ht=(t={})=>object.assign({index:-1,slides:[],dim:0,pos:-1},t),dt={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:'',dynamicfrom:11,maxcount:1/0,mincount:2};class ut extends f{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 t=this.list;return t||(t=document.createelement("ul"),k(t,this.cn("list")),t.setattribute("role","tablist"),this.instance.container.appendchild(t),k(this.instance.container,this.cn("hasdots")),this.list=t),t}refresh(){var t;const e=this.instance.pages.length,i=math.min(2,this.option("mincount")),n=math.max(2e3,this.option("maxcount")),s=this.option("dynamicfrom");if(en)return void this.cleanup();const o="number"==typeof s&&e>5&&e>=s,a=!this.list||this.isdynamic!==o||this.list.children.length!==e;a&&this.cleanup();const r=this.build();if(s(r,this.cn("isdynamic"),!!o),a)for(let t=0;t=e-1&&s.setattribute("disabled","")))}createbutton(t){const e=this.instance,i=document.createelement("button");i.setattribute("tabindex","0"),i.setattribute("title",e.localize(`{{${t.touppercase()}}}`)),k(i,this.cn("button")+" "+this.cn("next"===t?"isnext":"isprev"));const n=e.isrtl?"next"===t?"prev":"next":t;var s;return i.innerhtml=e.localize(this.option(`${n}tpl`)),i.dataset[`carousel${s=t,s?s.match("^[a-z]")?s.charat(0).touppercase()+s.substring(1):s:""}`]="true",i}build(){let t=this.container;t||(this.container=t=document.createelement("div"),k(t,this.cn("container")),this.instance.container.appendchild(t)),this.next||(this.next=t.appendchild(this.createbutton("next"))),this.prev||(this.prev=t.appendchild(this.createbutton("prev")))}cleanup(){this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove(),this.prev=null,this.next=null,this.container=null}attach(){this.instance.on(["refresh","change"],this.onrefresh)}detach(){this.instance.off(["refresh","change"],this.onrefresh),this.cleanup()}}object.defineproperty(pt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isnext:"is-next",isprev:"is-prev"},nexttpl:'',prevtpl:''}});class mt extends f{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(t){this.target=this.instance,this.nav=t,this.attachevents()}addasnavfor(t){this.nav=this.instance,this.target=t,this.attachevents()}attachevents(){this.nav&&this.target&&(this.nav.options.initialslide=this.target.options.initialpage,this.nav.on("ready",this.onnavready),this.nav.state===lt.ready&&this.onnavready(this.nav),this.target.on("ready",this.ontargetready),this.target.state===lt.ready&&this.ontargetready(this.target))}onnavready(t){t.on("createslide",this.onnavcreateslide),t.on("panzoom.click",this.onnavclick),t.on("panzoom.touchend",this.onnavtouch),this.ontargetchange()}ontargetready(t){t.on("change",this.ontargetchange),t.on("panzoom.refresh",this.ontargetchange),this.ontargetchange()}onnavclick(t,e,i){i.pointertype||this.onnavtouch(t,t.panzoom,i)}onnavtouch(t,e,i){var n,s;if(math.abs(e.dragoffset.x)>3||math.abs(e.dragoffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest("[data-index]");if(i.stoppropagation(),i.stopimmediatepropagation(),i.preventdefault(),!l)return;const c=parseint(l.dataset.index||"",10)||0,h=r.getpageforslide(c),d=a.getpageforslide(c);a.slideto(d),r.slideto(h,{friction:null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.sync.option("friction")}),this.markselectedslide(c)}onnavcreateslide(t,e){e.index===this.selectedindex&&this.markselectedslide(e.index)}ontargetchange(){const{target:t,nav:e}=this;if(!t||!e)return;if(e.state!==lt.ready||t.state!==lt.ready)return;const i=t.pages[t.page].slides[0].index,n=e.getpageforslide(i);this.markselectedslide(i),e.slideto(n)}markselectedslide(t){const{nav:e}=this;if(!e||e.state!==lt.ready)return;this.selectedindex=t,[...e.slides].filter((t=>t.el&&t.el.classlist.remove("is-nav-selected")));const i=e.slides[t];i&&i.el&&i.el.classlist.add("is-nav-selected")}attach(){let t=this.options.target,e=this.options.nav;t?this.addasnavfor(t):e&&this.addastargetfor(e)}detach(){this.nav&&(this.nav.off("ready",this.onnavready),this.nav.off("createslide",this.onnavcreateslide),this.nav.off("panzoom.click",this.onnavclick),this.nav.off("panzoom.touchend",this.onnavtouch)),this.nav=null,this.target&&(this.target.off("ready",this.ontargetready),this.target.off("refresh",this.ontargetchange),this.target.off("change",this.ontargetchange)),this.target=null}}object.defineproperty(mt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const ft={navigation:pt,dots:ut,sync:mt};class gt extends m{get axis(){return this.ishorizontal?"e":"f"}get isenabled(){return this.state===lt.ready}get isinfinite(){let t=!1;const e=this.contentdim,i=this.viewportdim;return this.pages.length>=2&&e>1.5*i&&(t=this.option("infinite")),t}get isrtl(){return"rtl"===this.option("direction")}get ishorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),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,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:lt.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}),"string"==typeof t&&(t=document.queryselector(t)),!t||!z(t))throw new error("no element found");this.container=t,this.slidenext=ot(this.slidenext.bind(this),150),this.slideprev=ot(this.slideprev.bind(this),150),this.useroptions=e,this.userplugins=i,queuemicrotask((()=>{this.processoptions()}))}processoptions(){const t=i({},gt.defaults,this.useroptions);let n="";const s=t.breakpoints;if(s&&e(s))for(const[o,a]of object.entries(s))window.matchmedia(o).matches&&e(a)&&(n+=o,i(t,a));n===this.bp&&this.state!==lt.init||(this.bp=n,this.state===lt.ready&&(t.initialslide=this.pages[this.page].slides[0].index),this.state!==lt.init&&this.destroy(),super.setoptions(t),!1===this.option("enabled")?this.attachevents():settimeout((()=>{this.init()}),0))}init(){this.state=lt.init,this.emit("init"),this.attachplugins(object.assign(object.assign({},gt.plugins),this.userplugins)),this.initlayout(),this.initslides(),this.updatemetrics(),this.setinitialposition(),this.initpanzoom(),this.attachevents(),this.state=lt.ready,this.emit("ready")}initlayout(){const{container:t}=this,e=this.option("classes");k(t,this.cn("container")),s(t,e.isltr,!this.isrtl),s(t,e.isrtl,this.isrtl),s(t,e.isvertical,!this.ishorizontal),s(t,e.ishorizontal,this.ishorizontal);let i=this.option("viewport")||t.queryselector(`.${e.viewport}`);i||(i=document.createelement("div"),k(i,e.viewport),i.append(...at(t,`.${e.slide}`)),t.prepend(i));let n=this.option("track")||t.queryselector(`.${e.track}`);n||(n=document.createelement("div"),k(n,e.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(){const{track:t}=this;if(t){this.slides=[],[...at(t,`.${this.cn("slide")}`)].foreach((t=>{if(z(t)){const e=ct({el:t,isdom:!0,index:this.slides.length});this.slides.push(e),this.emit("initslide",e,this.slides.length)}}));for(let t of this.option("slides",[])){const e=ct(t);e.index=this.slides.length,this.slides.push(e),this.emit("initslide",e,this.slides.length)}this.emit("initslides")}}setinitialpage(){let t=0;const e=this.option("initialslide");t="number"==typeof e?this.getpageforslide(e):parseint(this.option("initialpage",0)+"",10)||0,this.page=t}setinitialposition(){if(!this.track||!this.pages.length)return;const t=this.ishorizontal;let e=this.page;this.pages[e]||(this.page=e=0);const i=this.pages[e].pos*(this.isrtl&&t?1:-1),n=t?`${i}px`:"0",s=t?"0":`${i}px`;this.track.style.transform=`translate3d(${n}, ${s}, 0) scale(1)`,this.option("adaptiveheight")&&this.setviewportheight()}initpanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option("panzoom")||{};this.panzoom=new b(this.viewport,i({},{content:this.track,zoom:!1,panonlyzoomed:!1,lockaxis:this.ishorizontal?"x":"y",infinite:this.isinfinite,click:!1,dblclick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getbounds(),maxvelocity:t=>math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportdim?100:0},t)),this.panzoom.on("*",((t,e,...i)=>{this.emit(`panzoom.${e}`,t,...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(){const t=this.container;t&&(t.addeventlistener("click",this.onclick,{passive:!1,capture:!1}),t.addeventlistener("slideto",this.onslideto)),window.addeventlistener("resize",this.onresize)}createpages(){let t=[];const{contentdim:e,viewportdim:i}=this,n=this.option("slidesperpage");if("number"==typeof n&&e>i){for(let e=0;ei)&&(t.push(ht()),s=t.length-1,o=0),o+=e.dim+e.gap,t[s].slides.push(e);return t}processpages(){const t=this.pages,{contentdim:e,viewportdim:i}=this,n=this.option("center"),s=this.option("fill"),o=s&&n&&e>i&&!this.isinfinite;if(t.foreach(((t,s)=>{t.index=s,t.pos=t.slides[0].pos,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e=e-.5*i?t.pos=e-i:n&&(t.pos+=-.5*(i-t.dim))})),t.foreach(((t,n)=>{s&&!this.isinfinite&&e>i&&(t.pos=math.max(t.pos,0),t.pos=math.min(t.pos,e-i)),t.pos=y(t.pos,1e3),t.dim=y(t.dim,1e3),t.pos<.1&&t.pos>-.1&&(t.pos=0)})),this.isinfinite)return t;const a=[];let r;return t.foreach((t=>{const e=object.assign({},t);r&&e.pos===r.pos?(r.dim+=e.dim,r.slides=[...r.slides,...e.slides]):(e.index=a.length,r=e,a.push(e))})),a}getpagefromindex(t=0){const e=this.pages.length;let i;return t=parseint((t||0).tostring())||0,i=this.isinfinite?(t%e+e)%e:math.max(math.min(t,this.pages.length-1),0),i}getslidemetrics(t){const e=this.ishorizontal?"width":"height";let i=0,n=0,s=t.el;s?i=parsefloat(s.dataset[e]||"")||0:(s=document.createelement("div"),s.style.visibility="hidden",k(s,this.cn("slide")+" "+t.class),(this.track||document.body).prepend(s)),i?(s.style[e]=`${i}px`,s.style["width"===e?"height":"width"]=""):i=s.getboundingclientrect()[e];const o=getcomputedstyle(s);return"content-box"===o.boxsizing&&(this.ishorizontal?(i+=parsefloat(o.paddingleft)||0,i+=parsefloat(o.paddingright)||0):(i+=parsefloat(o.paddingtop)||0,i+=parsefloat(o.paddingbottom)||0)),n=parsefloat(o[this.ishorizontal?"marginright":"marginbottom"])||0,this.ishorizontal,t.el||s.remove(),{dim:y(i,1e3),gap:y(n,1e3)}}getbounds(){let t={min:0,max:0};if(this.isinfinite)t={min:-1/0,max:1/0};else if(this.pages.length){const e=this.pages[0].pos,i=this.pages[this.pages.length-1].pos;t=this.isrtl&&this.ishorizontal?{min:e,max:i}:{min:-1*i,max:-1*e}}return{x:this.ishorizontal?t:{min:0,max:0},y:this.ishorizontal?{min:0,max:0}:t}}repositionslides(){const{viewportdim:t,contentdim:e,page:i,pages:n}=this;let s,o=0,a=0,r=0,l=0;this.panzoom?l=-1*this.panzoom.current[this.ishorizontal?"e":"f"]:n[i]&&(l=n[i].pos||0),s=this.ishorizontal?this.isrtl?"right":"left":"top",this.isrtl&&this.ishorizontal&&(l*=-1);for(const t of this.slides)t.el?("top"===s?(t.el.style.right="",t.el.style.left=""):t.el.style.top="",t.index!==o?t.el.style[s]=0===a?"":`${y(a,1e3)}px`:t.el.style[s]="",r+=t.dim+t.gap,o++):a+=t.dim+t.gap;if(this.isinfinite&&r)for(const i of this.slides)i.el&&(y(i.pos)y(e-t)&&(i.el.style[s]=`${y(a+r,1e3)}px`),y(i.pos+i.gap)>=y(e-t)&&y(i.pos)>y(l+t)&&y(l)1&&(c=this.pages[d[0]],h=this.pages[d[1]]),c&&h){let t=0;for(const e of this.slides)e.el?this.intransition.has(e.index)&&c.slides.indexof(e)<0&&(e.el.style[s]=`${y(t+(c.pos-h.pos),1e3)}px`):t+=e.dim+e.gap}}createslideel(t){if(!this.track||!t)return;if(t.el)return;const e=document.createelement("div");k(e,this.cn("slide")),k(e,t.class),k(e,t.customclass),t.html&&(e.innerhtml=t.html);const i=[];this.slides.foreach(((t,e)=>{t.el&&i.push(e)}));const n=t.index;let s=null;if(i.length){let t=i.reduce(((t,e)=>math.abs(e-n)this.page?1:-1,a=this.pages[s].pos*(this.isrtl?1:-1);if(this.page===s&&y(a,1e3)===y(n.target[this.axis],1e3))return!1;this.cleartransitions();const r=n.isresting;k(this.container,this.cn("intransition"));const l=this.pages[this.page].slides[0],c=this.pages[s].slides[0];this.intransition.add(c.index),this.createslideel(c);let h=l.el,d=c.el;r||"slide"===e||(e="fadefast",h=null);const u=this.isrtl?"next":"prev",p=this.isrtl?"prev":"next";return h&&(this.intransition.add(l.index),l.transition=e,h.addeventlistener("animationend",this.onanimationend),h.classlist.add(`f-${e}out`,`to-${o>0?p:u}`)),d&&(c.transition=e,d.addeventlistener("animationend",this.onanimationend),d.classlist.add(`f-${e}in`,`from-${o>0?u:p}`)),n.panto({x:this.ishorizontal?a:0,y:this.ishorizontal?0:a,friction:0}),this.onchange(s),!0}manageslidevisiblity(){const t=new set,e=new set,i=this.getvisibleslides(parsefloat(this.option("preload",0)+"")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.intransition)t.add(this.slides[e]);for(const e of t)this.createslideel(e),this.lazyloadslide(e);for(const i of e)t.has(i)||this.removeslideel(i);this.markselectedslides(),this.repositionslides()}markselectedslides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t="aria-hidden";let e=this.cn("isselected");if(e)for(const i of this.slides)i.el&&(i.el.dataset.index=`${i.index}`,this.pages[this.page].slides.includes(i)?(i.el.classlist.contains(e)||(k(i.el,e),this.emit("selectslide",i)),i.el.removeattribute(t)):(i.el.classlist.contains(e)&&(r(i.el,e),this.emit("unselectslide",i)),i.el.setattribute(t,"true")))}flipinfinitetrack(){const t=this.panzoom;if(!t||!this.isinfinite)return;const e="x"===this.option("axis")?"e":"f",{viewportdim:i,contentdim:n}=this;let s=t.current[e],o=t.target[e]-s,a=0,r=.5*i,l=n;this.isrtl&&this.ishorizontal?(s<-r&&(a=-1,s+=l),s>l-r&&(a=1,s-=l)):(s>r&&(a=1,s-=l),s<-l+r&&(a=-1,s+=l)),a&&(t.current[e]=s,t.target[e]=s+o)}lazyloadslide(t){const e=this,i=t&&t.el;if(!i)return;const s=new set;i.queryselectorall("[data-lazy-srcset]").foreach((t=>{t instanceof htmlimageelement&&s.add(t)})),i.queryselectorall("[data-lazy-src]").foreach((t=>{t instanceof htmlimageelement?s.add(t):z(t)&&(t.style.backgroundimage=`url('${t.dataset.lazysrc||""}')`)}));const o=(t,i,n)=>{n&&(n.remove(),n=null),i.complete&&(i.style.display=""),this.option("adaptiveheight")&&t.el&&this.pages[this.page].slides.indexof(t)>-1&&e.setviewportheight()};for(const e of s){let i=null;e.src=e.dataset.lazysrcset||e.dataset.lazysrc||"",delete e.dataset.lazysrc,delete e.dataset.lazysrcset,e.style.display="none",e.addeventlistener("error",(()=>{o(t,e,i)})),e.addeventlistener("load",(()=>{o(t,e,i)})),settimeout((()=>{e.parentnode&&t.el&&(e.complete?o(t,e,i):(i=n(r),e.parentnode.insertbefore(i,e)))}),300)}let a=i.dataset.lazysrc;a&&a.length&&(i.style.backgroundimage=`url('${a}')`)}cleartransitions(){this.intransition.clear(),r(this.container,this.cn("intransition"));const t=["to-prev","to-next","from-prev","from-next"];for(const e of this.slides){const i=e.el;if(i){i.removeeventlistener("animationend",this.onanimationend),i.classlist.remove(...t);const n=e.transition;n&&i.classlist.remove(`f-${n}out`,`f-${n}in`)}}this.manageslidevisiblity()}onanimationend(t){const e=t.target,i=e?parseint(e.dataset.index||"",10)||0:-1,n=this.slides[i],s=t.animationname;if(!e||!n||!s)return;const o=!!this.intransition.has(i)&&n.transition;o&&s.substring(0,o.length+2)===`f-${o}`&&this.intransition.delete(i),this.intransition.size||this.cleartransitions(),i===this.page&&this.emit("settle")}ondecel(t,e=0,i=0,n=0,s=0){const o=this.isrtl,a=this.ishorizontal,r=this.axis,l=this.pages.length,c=math.abs(math.atan2(i,e)/(math.pi/180));let h=0;if(h=c>45&&c<135?a?0:i:a?e:0,!l)return;const d=this.option("dragfree");let u=this.page;const p=t.target[r]*(this.isrtl&&a?1:-1),{pageindex:m}=this.getpagefromposition(p),f=t.current[r]*(o&&a?1:-1);let{page:g}=this.getpagefromposition(f);d?this.onchange(m):(math.abs(h)>5?(math.max(math.abs(n),math.abs(s))>this.pages[u].slides[0].dim&&(console.log(`yes? targetpage: ${m}; currentpage: ${g}`),u=g),u=o&&a?h<0?u-1:u+1:h<0?u+1:u-1):u=g,this.slideto(u,{transition:!1,friction:t.option("decelfriction")}))}onclick(t){const e=t.target,i=e&&z(e)?e.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?(t.preventdefault(),t.stoppropagation(),e&&!e.hasattribute("disabled")&&this[s](n)):this.emit("click",t)}onslideto(t){const e=t.detail||0;this.slideto(this.getpageforslide(e),{friction:0})}onchange(t,e=0){const i=this.page;this.prevpage=i,this.page=t,this.option("adaptiveheight")&&this.setviewportheight(),t!==i&&(this.markselectedslides(),this.emit("change",t,i,e))}onrefresh(t,e=""){let i=this.contentdim,n=this.viewportdim;this.updatemetrics(),this.contentdim===i&&this.viewportdim===n||this.slideto(this.page,{friction:0,transition:!1})}onresize(){this.option("breakpoints")&&this.processoptions()}onbeforetransform(){this.flipinfinitetrack(),this.manageslidevisiblity()}onendanimation(){this.emit("settle")}reinit(t=null,e=null){this.destroy(),this.state=lt.init,this.useroptions=t||this.useroptions,this.userplugins=e||this.userplugins,this.processoptions()}slideto(t=0,{friction:e=this.option("friction"),transition:i=this.option("transition")}={}){if(this.state===lt.destroy)return;const n=this.panzoom,s=this.pages.length;if(!n||!s)return;if(this.transitionto(t,i))return;const o=this.axis,a=this.getpagefromindex(t);let r=this.pages[a].pos,l=0;if(this.isinfinite){const t=n.current[o]*(this.isrtl&&this.ishorizontal?1:-1),e=this.contentdim,i=r+e,s=r-e;math.abs(t-i){t.el&&(s=math.max(s,t.el.offsetheight))}))),i.style.height=s?`${s}px`:""}getpageforslide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getvisibleslides(t=0){var e;const i=new set;let{contentdim:n,viewportdim:s,pages:o,page:a}=this;n=n+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let r=0;r=this.panzoom?-1*this.panzoom.current[this.axis]:o[a]&&o[a].pos||0,this.isinfinite&&(r-=math.floor(r/n)*n),this.isrtl&&this.ishorizontal&&(r*=-1);const l=r-s*t,c=r+s*(t+1),h=this.isinfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of h){const s=t.pos+e*n,o=t.pos+t.dim+t.gap+e*n;sl&&i.add(t)}return i}getpagefromposition(t){const{viewportdim:e,contentdim:i}=this,n=this.pages.length,s=this.slides.length,o=this.slides[s-1];let a=0,r=0,l=0;const c=this.option("center");c&&(t+=.5*e),this.isinfinite||(t=math.max(this.slides[0].pos,math.min(t,o.pos)));const h=i+o.gap;l=math.floor(t/h)||0,t-=l*h;let d=o,u=this.slides.find((e=>{const i=t+(d&&!c?.5*d.dim:0);return d=e,e.pos<=i&&e.pos+e.dim+e.gap>i}));return u||(u=o),r=this.getpageforslide(u.index),a=r+l*n,{page:a,pageindex:r,interval:l}}destroy(){if([lt.destroy].includes(this.state))return;this.state=lt.destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option("classes");t.removeeventlistener("click",this.onclick,{passive:!1,capture:!1}),t.removeeventlistener("slideto",this.onslideto),window.removeeventlistener("resize",this.onresize),s&&(s.destroy(),this.panzoom=null),n&&n.foreach((t=>{this.removeslideel(t)})),this.detachplugins(),this.track=null,this.viewport=null,this.page=0,e&&i&&e.replacewith(...i.childnodes);for(const[e,i]of object.entries(o))"container"!==e&&i&&t.classlist.remove(i);this.slides=[];const a=this.events.get("ready");this.events=new map,a&&this.events.set("ready",a)}}object.defineproperty(gt,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:b}),object.defineproperty(gt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:rt}),object.defineproperty(gt,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:ft});let bt=null,vt=null;const yt=new map;let wt=0;class xt extends m{get isidle(){return this.idle}get iscompact(){return this.option("compact")}constructor(t=[],e={},i={}){super(e),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,"prevwheeltime",{enumerable:!0,configurable:!0,writable:!0,value:0}),object.defineproperty(this,"ignorefocuschange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),object.defineproperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:h.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,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),object.defineproperty(this,"caption",{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}),object.defineproperty(this,"fsapi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fsapi=(()=>{let t,e="",i="",n="";return document.fullscreenenabled?(e="requestfullscreen",i="exitfullscreen",n="fullscreenelement"):document.webkitfullscreenenabled&&(e="webkitrequestfullscreen",i="webkitexitfullscreen",n="webkitfullscreenelement"),e&&(t={request:function(t){return"webkitrequestfullscreen"===e?t[e](element.allow_keyboard_input):t[e]()},exit:function(){return document[n]&&document[i]()},isfullscreen:function(){return document[n]}}),t})(),this.id=e.id||++wt,yt.set(this.id,this),this.userslides=t,this.userplugins=i,queuemicrotask((()=>{this.init()}))}init(){this.state=h.init,this.attachplugins(object.assign(object.assign({},xt.plugins),this.userplugins)),this.emit("init"),!0===this.option("hidescrollbar")&&(()=>{if(!s)return;if(document.body.classlist.contains("compensate-for-scrollbar"))return;const t=window.innerwidth-document.documentelement.getboundingclientrect().width;t>1&&(document.documentelement.style.setproperty("--fancybox-scrollbar-compensate",`${t}px`),document.body.classlist.add("compensate-for-scrollbar"))})(),this.initlayout();const t=()=>{this.initcarousel(this.userslides),this.state=h.ready,this.attachevents(),this.emit("ready"),settimeout((()=>{this.container&&this.container.setattribute("aria-hidden","false")}),16)};this.option("fullscreen.autostart")&&this.fsapi&&!this.fsapi.isfullscreen()?this.fsapi.request(this.container).then((()=>t())).catch((()=>t())):t()}initlayout(){const t=this.option("parentel")||document.body,e=n(this.localize(this.option("tpl.main")||""));e&&(e.setattribute("id",`fancybox-${this.id}`),e.setattribute("aria-label",this.localize("{{modal}}")),e.classlist.toggle("is-compact",this.iscompact),k(e,this.option("mainclass")||""),this.container=e,this.footer=e.queryselector(".fancybox__footer"),t.appendchild(e),document.documentelement.classlist.add("with-fancybox"),bt&&vt||(bt=document.createelement("button"),bt.classlist.add("fancybox-focus-guard"),bt.setattribute("aria-hidden","true"),bt.setattribute("aria-label","focus guard"),bt.setattribute("type","button"),vt=bt.clonenode(),document.body.prepend(bt),document.body.append(vt)),this.option("animated")&&(e.classlist.add("is-animated"),settimeout((()=>{this.isclosing()||e.classlist.remove("is-animated")}),350)),this.emit("initlayout"))}initcarousel(t){const e=this.container;if(!e)return;const n=e.queryselector(".fancybox__carousel");if(!n)return;const s=this.carousel=new gt(n,i({},{slides:t,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")||{}));s.on("*",((t,e,...i)=>{this.emit(`carousel.${e}`,t,...i)})),s.on(["ready","change"],(()=>{this.managecaption(this.getslide())})),s.on("removeslide",((t,e)=>{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,e.state=void 0})),s.on("panzoom.touchstart",(()=>{this.iscompact||this.endidle()})),s.on("settle",(()=>{this.idletimer||this.iscompact||!this.option("idle")||this.setidle(),this.option("autofocus")&&this.checkfocus()})),this.option("dragtoclose")&&(s.on("panzoom.aftertransform",((t,e)=>{const i=this.container;if(i){const t=math.abs(e.current.f),n=t<1?"":math.max(.5,math.min(1,1-t/e.contentrect.fitheight*1.5));i.style.setproperty("--fancybox-ts",n?"0s":""),i.style.setproperty("--fancybox-opacity",n+"")}})),s.on("panzoom.touchend",((t,e,i)=>{var n;if(e.ismobile&&document.activeelement&&-1!==["textarea","input","select"].indexof(null===(n=document.activeelement)||void 0===n?void 0:n.nodename))return;const s=this.getslide();if(s&&s.el&&s.el.scrollheight>s.el.clientheight)return;const o=math.abs(e.dragoffset.y);"y"===e.lockedaxis&&(o>=200||o>=50&&e.dragoffset.time<300)&&(i&&i.cancelable&&i.preventdefault(),this.close(i,"f-throwout"+(e.current.f<0?"up":"down")))}))),s.on(["change"],(t=>{var e;let i=null===(e=this.getslide())||void 0===e?void 0:e.triggerel;if(i){const e=new customevent("slideto",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchevent(e)}})),s.on(["refresh","change"],(t=>{const e=this.container;if(!e)return;for(const i of e.queryselectorall("[data-fancybox-current-index]"))i.innerhtml=t.page+1;for(const i of e.queryselectorall("[data-fancybox-count]"))i.innerhtml=t.pages.length;if(!t.isinfinite){for(const i of e.queryselectorall("[data-fancybox-next]"))t.page0?(i.removeattribute("disabled"),i.removeattribute("tabindex")):(i.setattribute("disabled",""),i.setattribute("tabindex","-1"))}const i=this.getslide();let n=(null==i?void 0:i.downloadsrc)||"";n||!i||"image"!==i.type||i.error||"string"!=typeof i.src||(n=i.src);for(const t of e.queryselectorall("[data-fancybox-download]"))n?(t.removeattribute("disabled"),t.removeattribute("tabindex"),t.setattribute("href",n),t.setattribute("download",n),t.setattribute("target","_blank")):(t.setattribute("disabled",""),t.setattribute("tabindex","-1"),t.removeattribute("href"),t.removeattribute("download"))})),this.emit("initcarousel")}attachevents(){const t=this.container;t&&(document.addeventlistener("keydown",this.onkeydown,{passive:!1,capture:!0}),t.addeventlistener("wheel",this.onwheel,{passive:!1,capture:!1}),t.addeventlistener("click",this.onclick,{passive:!1,capture:!1}),document.addeventlistener("mousemove",this.onmousemove),window.addeventlistener("resize",this.onresize),this.option("trapfocus")&&document.addeventlistener("focus",this.onfocus,!0),document.addeventlistener("visibilitychange",this.onvisibilitychange,!1))}detachevents(){const t=this.container;t&&(document.removeeventlistener("keydown",this.onkeydown,{passive:!1,capture:!0}),t.removeeventlistener("wheel",this.onwheel,{passive:!1,capture:!1}),t.removeeventlistener("click",this.onclick,{passive:!1,capture:!1}),document.removeeventlistener("mousemove",this.onmousemove),window.removeeventlistener("resize",this.onresize),document.removeeventlistener("visibilitychange",this.onvisibilitychange,!1),document.removeeventlistener("focus",this.onfocus,!0))}onclick(t){var e,i;if(this.isclosing())return;!this.iscompact&&this.option("idle")&&this.resetidle();const n=t.composedpath()[0];if(n===(null===(e=this.carousel)||void 0===e?void 0:e.container))return;if(n.closest(".f-spinner")||n.closest("[data-fancybox-close]"))return t.preventdefault(),void this.close(t);if(n.closest("[data-fancybox-prev]"))return t.preventdefault(),void this.prev();if(n.closest("[data-fancybox-next]"))return t.preventdefault(),void this.next();if(this.iscompact&&"image"===(null===(i=this.getslide())||void 0===i?void 0:i.type))return void(this.clicktimer?(cleartimeout(this.clicktimer),this.clicktimer=null):this.clicktimer=settimeout((()=>{this.toggleidle(),this.clicktimer=null}),350));if(this.emit("click",t),t.defaultprevented)return;let s=!1;const o=document.activeelement;if(n.closest(".fancybox__content")){if(o){if(o.closest("[contenteditable]"))return;n.matches(a)||o.blur()}if((r=window.getselection())&&"range"===r.type)return;s=this.option("contentclick")}else n.closest(".fancybox__carousel")&&!n.matches(a)&&(s=this.option("backdropclick"));var r;"close"===s?(t.preventdefault(),this.close(t)):"next"===s?(t.preventdefault(),this.next()):"prev"===s&&(t.preventdefault(),this.prev())}onwheel(t){const e=t.wheeldeltay?t.wheeldeltay===-3*t.deltay:0===t.deltamode,i=date.now();if(this.prevwheeltime&&i-this.prevwheeltime<(e?600:300))return void t.preventdefault();if(this.prevwheeltime=i,this.emit("wheel",t),t.defaultprevented)return;const n=this.option("wheel",t);if("close"===n)t.preventdefault(),this.close(t);else if("slide"===n){t.preventdefault();this[math.max(-1,math.min(1,-t.deltay||-t.deltax||-t.detail))>0?"prev":"next"]()}}onkeydown(t){if(!this.istopmost())return;this.iscompact||!this.option("idle")||this.isclosing()||this.resetidle();const e=t.key,i=this.option("keyboard");if(!i||t.ctrlkey||t.altkey||t.shiftkey)return;const n=t.composedpath()[0],s=document.activeelement&&document.activeelement.classlist,o=s&&s.contains("f-button")||n.dataset.carouselpage||n.dataset.carouselindex;if("escape"!==e&&!o&&z(n)){if(n.iscontenteditable||-1!==["button","textarea","option","input","select","video"].indexof(n.nodename))return}this.emit("keydown",e,t);const a=i[e];"function"==typeof this[a]&&(t.preventdefault(),this[a]())}onresize(){const t=this.container;if(!t)return;const e=this.iscompact;t.classlist.toggle("is-compact",e),this.managecaption(this.getslide()),this.iscompact?this.clearidle():this.endidle(),this.emit("resize")}onfocus(t){this.istopmost()&&this.focus(t)}onmousemove(t){this.prevmousemoveevent=t,!this.iscompact&&this.option("idle")&&this.resetidle()}onvisibilitychange(){"visible"===document.visibilitystate?this.checkfocus():this.endidle()}manageclosebtn(t){const e=this.optionfor(t,"closebutton")||!1;if("auto"===e){const t=this.plugins.toolbar;if(t&&t.state===tt.ready)return}if(!e)return;if(!t.contentel||t.closebtnel)return;const i=this.option("tpl.closebutton");if(i){const e=n(this.localize(i));t.closebtnel=t.contentel.appendchild(e),t.el&&k(t.el,"has-close-btn")}}managecaption(t){var e,i,n;const s=this.container;if(!s)return;const o=this.iscompact||this.option("commoncaption"),a=!o;if(this.caption&&this.stop(this.caption),a&&this.caption&&(this.caption.remove(),this.caption=null),o&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionel&&(t.captionel.remove(),t.captionel=void 0,null===(i=t.el)||void 0===i||i.classlist.remove("has-caption"),null===(n=t.el)||void 0===n||n.removeattribute("aria-labelledby"));if(t||(t=this.getslide()),!t||o&&!this.iscurrentslide(t))return;const r=t.el;let l=this.optionfor(t,"caption","");if("string"!=typeof l||!l.length)return void(o&&this.caption&&this.animate(this.caption,"f-fadeout",(()=>{var t;null===(t=this.caption)||void 0===t||t.remove(),this.caption=null})));let c=null;if(a){if(c=t.captionel||null,r&&!c){const e=`fancybox__caption_${this.id}_${t.index}`;c=document.createelement("div"),c.classname="fancybox__caption",c.setattribute("id",e),t.captionel=r.appendchild(c),r.classlist.add("has-caption"),r.setattribute("aria-labelledby",e)}}else{if(c=this.caption,c||(c=s.queryselector(".fancybox__caption")),!c){c=document.createelement("div"),c.dataset.fancyboxcaption="",c.classname="fancybox__caption",c.innerhtml=l;(this.footer||s).prepend(c)}s.classlist.add("has-caption"),this.caption=c}c&&(c.innerhtml=l)}checkfocus(){var t;const e=document.activeelement||null;e&&(null===(t=this.container)||void 0===t?void 0:t.contains(e))||this.focus()}focus(t){var e;if(this.ignorefocuschange)return;const i=document.activeelement||null,n=(null==t?void 0:t.target)||null,r=this.container,l=this.getslide();if(!r||!(null===(e=this.carousel)||void 0===e?void 0:e.viewport))return;const c=l&&l.state===d.ready?l.el:null;if(!c||c.contains(i)||r===i)return;t&&t.cancelable&&t.preventdefault(),this.ignorefocuschange=!0;const h=array.from(r.queryselectorall(a));let u=[],p=r;for(let t of h){const e=!t.offsetparent||t.closest('[aria-hidden="true"]'),i=c&&c.contains(t),n=!this.carousel.viewport.contains(t);t===r||(i||n)&&!e?(u.push(t),void 0!==t.dataset.origtabindex&&(t.tabindex=parsefloat(t.dataset.origtabindex)),t.removeattribute("data-orig-tabindex"),t.hasattribute("autofocus")&&(p=t)):(t.dataset.origtabindex=void 0===t.dataset.origtabindex?t.getattribute("tabindex")||void 0:t.dataset.origtabindex,t.tabindex=-1)}let m=null;t?(!n||u.indexof(n)<0)&&(m=p,u.length&&(i===vt?m=u[0]:this.lastfocus!==r&&i!==bt||(m=u[u.length-1]))):this.option("autofocus")&&(m=p),m&&(t=>{if(t&&s){void 0===o&&document.createelement("div").focus({get preventscroll(){return o=!0,!1}});try{if(o)t.focus({preventscroll:!0});else{const e=window.pagexoffset||document.body.scrolltop,i=window.pageyoffset||document.body.scrollleft;t.focus(),document.body.scrollto({top:e,left:i,behavior:"auto"})}}catch(t){}}})(m),this.lastfocus=document.activeelement,this.ignorefocuschange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slidenext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slideprev()}jumpto(...t){this.carousel&&this.carousel.slideto(...t)}istopmost(){var t;return(null===(t=xt.getinstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e="",i){if(!t||!e)return void(i&&i());this.stop(t);const n=s=>{s.target===t&&t.dataset.animationname&&(t.removeeventlistener("animationend",n),delete t.dataset.animationname,i&&i(),t.classlist.remove(e))};t.dataset.animationname=e,t.addeventlistener("animationend",n),t.classlist.add(e)}stop(t){t&&t.dispatchevent(new customevent("animationend",{bubbles:!1,cancelable:!0,currenttarget:t}))}setcontent(t,e="",i=!0){if(this.isclosing())return;const n=t.el;if(!n)return;let s=null;if(z(e))["img","iframe","video","audio"].includes(e.nodename.tolowercase())?(s=document.createelement("div"),s.appendchild(e)):s=e;else{const t=document.createrange().createcontextualfragment(e);s=document.createelement("div"),s.appendchild(t)}s instanceof element&&t.filter&&!t.error&&(s=s.queryselector(t.filter)),s instanceof element?(s.classlist.add("fancybox__content"),t.id&&s.setattribute("id",t.id),"none"!==s.style.display&&"none"!==getcomputedstyle(s).getpropertyvalue("display")||(s.style.display=t.display||this.option("defaultdisplay")||"flex"),n.classlist.add(`has-${t.error?"error":t.type||"unknown"}`),n.prepend(s),t.contentel=s,i&&this.revealcontent(t),this.manageclosebtn(t),this.managecaption(t)):this.seterror(t,"{{element_not_found}}")}revealcontent(t,e){const i=t.el,n=t.contentel;i&&n&&(this.emit("reveal",t),this.hideloading(t),t.state=d.opening,(e=this.isopeningslide(t)?void 0===e?this.optionfor(t,"showclass"):e:"f-fadein")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){var e;this.isclosing()||(t.state=d.ready,this.emit("done",t),null===(e=t.el)||void 0===e||e.classlist.add("is-done"),this.iscurrentslide(t)&&this.option("autofocus")&&queuemicrotask((()=>{var t;if(this.option("autofocus")){const e=document.activeelement||null;e&&(null===(t=this.container)||void 0===t?void 0:t.contains(e))||this.focus()}})),this.isopeningslide(t)&&!this.iscompact&&this.option("idle")&&this.setidle())}iscurrentslide(t){const e=this.getslide();return!(!t||!e)&&e.index===t.index}isopeningslide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevpage)&&t.index===(null===(i=this.getslide())||void 0===i?void 0:i.index)}showloading(t){t.state=d.loading;const e=t.el;if(!e)return;e.classlist.add("is-loading"),this.emit("loading",t),t.spinnerel||settimeout((()=>{if(!this.isclosing()&&!t.spinnerel&&t.state===d.loading){let i=n(r);t.spinnerel=i,e.prepend(i),this.animate(i,"f-fadein")}}),250)}hideloading(t){const e=t.el;if(!e)return;const i=t.spinnerel;this.isclosing()?null==i||i.remove():(e.classlist.remove("is-loading"),i&&this.animate(i,"f-fadeout",(()=>{i.remove()})),t.state===d.loading&&(this.emit("loaded",t),t.state=d.ready))}seterror(t,e){if(this.isclosing())return;this.emit("error"),t.error=e,this.hideloading(t),this.clearcontent(t);const i=document.createelement("div");i.classlist.add("fancybox-error"),i.innerhtml=this.localize(e||"

{{error}}

"),this.setcontent(t,i)}clearcontent(t){var e;null===(e=this.carousel)||void 0===e||e.emit("removeslide",t),t.contentel&&(t.contentel.remove(),t.contentel=void 0),t.closebtnel&&(t.closebtnel.remove(),t.closebtnel=void 0);const i=t.el;i&&(r(i,"is-loading"),r(i,"has-error"),r(i,"has-unknown"),r(i,`has-${t.type||"unknown"}`))}getslide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isclosing())return;const i=new event("shouldclose",{bubbles:!0,cancelable:!0});if(this.emit("shouldclose",i,t),i.defaultprevented)return;t&&t.cancelable&&(t.preventdefault(),t.stoppropagation());const n=this.fsapi,s=()=>{this.proceedclose(t,e)};n&&n.isfullscreen()?promise.resolve(n.exit()).then((()=>s())):s()}clearidle(){this.idletimer&&cleartimeout(this.idletimer),this.idletimer=null}setidle(t=!1){const e=()=>{var t;this.clearidle(),this.idle=!0,null===(t=this.container)||void 0===t||t.classlist.add("is-idle"),this.emit("setidle")};if(this.clearidle(),!this.isclosing())if(t)e();else{const t=this.option("idle");t&&(this.idletimer=settimeout(e,t))}}endidle(){var t;this.clearidle(),this.idle&&!this.isclosing()&&(this.idle=!1,null===(t=this.container)||void 0===t||t.classlist.remove("is-idle"),this.emit("endidle"))}resetidle(){this.endidle(),this.setidle()}toggleidle(){this.idle?this.endidle():this.setidle(!0)}togglefullscreen(){const t=this.fsapi;t&&(t.isfullscreen()?t.exit():this.container&&t.request(this.container))}isclosing(){return[h.closing,h.customclosing,h.destroy].includes(this.state)}proceedclose(t,e){var i,n;this.state=h.closing,this.clearidle(),this.detachevents();const s=this.container,o=this.carousel,a=this.getslide();if(a){const t=this.option("placefocusback")?(null===(i=this.getslide())||void 0===i?void 0:i.triggerel)||this.option("trigger"):null;t&&t.focus()}if(s&&(k(s,"is-closing"),s.setattribute("aria-hidden","true"),this.option("animated")&&k(s,"is-animated"),s.style.pointerevents="none"),o){o.cleartransitions(),null===(n=o.panzoom)||void 0===n||n.destroy();for(const t of o.slides){t.state=d.closing,this.hideloading(t);const e=t.contentel;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachevents(),i.detachobserver()),this.iscurrentslide(t)||o.emit("removeslide",t)}}this.emit("close",t),this.state!==h.customclosing?(void 0===e&&a&&(e=this.optionfor(a,"hideclass")),e&&a?(this.animate(a.contentel,e,(()=>{o&&o.emit("removeslide",a)})),settimeout((()=>{this.destroy()}),350)):this.destroy()):settimeout((()=>{this.destroy()}),350)}destroy(){var t;if(this.state===h.destroy)return;this.state=h.destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),yt.delete(this.id);const i=xt.getinstance();i?i.focus():(bt&&(bt.remove(),bt=null),vt&&(vt.remove(),vt=null),document.documentelement.classlist.remove("with-fancybox"),s&&(document.documentelement.style.setproperty("--fancybox-scrollbar-compensate",""),document.body.classlist.remove("compensate-for-scrollbar")))}static bind(t,e,i){if(!s)return;let n,o="",a={};if("string"==typeof t?(n=document.body,o=t,"object"==typeof e&&(a=e||{})):(n=t,"string"==typeof e&&(o=e),"object"==typeof i&&(a=i||{})),!n)return;o=o||"[data-fancybox]";const r=xt.openers.get(n)||new map;r.set(o,a),xt.openers.set(n,r),1===r.size&&n.addeventlistener("click",xt.fromevent)}static unbind(t,e){let i,n="";if("string"==typeof t?(i=document.body,n=t):(i=t,"string"==typeof e&&(n=e)),!i)return;const s=xt.openers.get(i);s&&n&&s.delete(n),n&&s||(xt.openers.delete(i),i.removeeventlistener("click",xt.fromevent))}static destroy(){let t;for(;t=xt.getinstance();)t.destroy();for(const t of xt.openers.keys())t.removeeventlistener("click",xt.fromevent);xt.openers=new map}static fromevent(t){if(t.defaultprevented)return;if(t.button&&0!==t.button)return;if(t.ctrlkey||t.metakey||t.shiftkey)return;let e=t.composedpath()[0];const n=e.closest("[data-fancybox-trigger]");if(n){const t=n.dataset.fancyboxtrigger||"",i=document.queryselectorall(`[data-fancybox="${t}"]`),s=parseint(n.dataset.fancyboxindex||"",10)||0;e=i[s]||e}if(!(e&&e instanceof element))return;let s,o,a,r;if([...xt.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,n])=>{let l=e.closest(i);return!!l&&(s=t,o=i,a=l,r=n,!0)}))))),!s||!o||!a)return;r=r||{},t.preventdefault(),e=a;let l=[],h=i({},c,r);h.event=t,h.trigger=e,h.delegate=n;const d=h.groupall,u=h.groupattr,p=u&&e?e.getattribute(`${u}`):"";if((!e||p||d)&&(l=[].slice.call(s.queryselectorall(o))),e&&!d&&(l=p?l.filter((t=>t.getattribute(`${u}`)===p)):[e]),!l.length)return;const m=xt.getinstance();return m&&m.options.trigger&&l.indexof(m.options.trigger)>-1?void 0:(e&&(h.startindex=l.indexof(e)),xt.fromnodes(l,h))}static fromnodes(t,e){e=i({},c,e);const n=[];for(const i of t){const t=i.dataset||{},s=t.src||i.getattribute("href")||i.getattribute("currentsrc")||i.getattribute("src")||void 0;let o;const a=e.delegate;let r;a&&n.length===e.startindex&&(o=a instanceof htmlimageelement?a:a.queryselector("img:not([aria-hidden])")),o||(o=i instanceof htmlimageelement?i:i.queryselector("img:not([aria-hidden])")),o&&(r=o.currentsrc||o.src||void 0,!r&&o.dataset&&(r=o.dataset.lazysrc||o.dataset.src||void 0));const l={src:s,triggerel:i,thumbel:o,thumbelsrc:r,thumbsrc:r};for(const e in t)"fancybox"!==e&&(l[e]=t[e]+"");n.push(l)}return new xt(n,e)}static getinstance(t){if(t)return yt.get(t);return array.from(yt.values()).reverse().find((t=>!t.isclosing()&&t))||null}static getslide(){var t;return(null===(t=xt.getinstance())||void 0===t?void 0:t.getslide())||null}static show(t=[],e={}){return new xt(t,e)}static next(){const t=xt.getinstance();t&&t.next()}static prev(){const t=xt.getinstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of yt.values())t.close(...e);else{const t=xt.getinstance();t&&t.close(...e)}}}object.defineproperty(xt,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.7"}),object.defineproperty(xt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:c}),object.defineproperty(xt,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:st}),object.defineproperty(xt,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new map}),t.fancybox=xt}));