mySIte/public/js/main.ae924a6180d10796f7ce30...

19 lines
92 KiB
JavaScript

(()=>{var oi=Object.create;var ve=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var ri=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var di=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var ci=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ri(t))!hi.call(o,s)&&s!==e&&ve(o,s,{get:()=>t[s],enumerable:!(i=ai(t,s))||i.enumerable});return o};var pi=(o,t,e)=>(e=o!=null?oi(li(o)):{},ci(t||!o||!o.__esModule?ve(e,"default",{value:o,enumerable:!0}):e,o));var Ie=di((ts,yt)=>{(function(o,t){var e=t(o,o.document,Date);o.lazySizes=e,typeof yt=="object"&&yt.exports&&(yt.exports=e)})(typeof window<"u"?window:{},function(t,e,i){"use strict";var s,n;if(function(){var p,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};n=t.lazySizesConfig||t.lazysizesConfig||{};for(p in c)p in n||(n[p]=c[p])}(),!e||!e.getElementsByClassName)return{init:function(){},cfg:n,noSupport:!0};var a=e.documentElement,r=t.HTMLPictureElement,l="addEventListener",h="getAttribute",u=t[l].bind(t),m=t.setTimeout,S=t.requestAnimationFrame||m,L=t.requestIdleCallback,Z=/^picture$/i,$=["load","error","lazyincluded","_lazyloaded"],X={},Ge=Array.prototype.forEach,J=function(p,c){return X[c]||(X[c]=new RegExp("(\\s|^)"+c+"(\\s|$)")),X[c].test(p[h]("class")||"")&&X[c]},tt=function(p,c){J(p,c)||p.setAttribute("class",(p[h]("class")||"").trim()+" "+c)},Pt=function(p,c){var g;(g=J(p,c))&&p.setAttribute("class",(p[h]("class")||"").replace(g," "))},zt=function(p,c,g){var b=g?l:"removeEventListener";g&&zt(p,c),$.forEach(function(C){p[b](C,c)})},et=function(p,c,g,b,C){var y=e.createEvent("Event");return g||(g={}),g.instance=s,y.initEvent(c,!b,!C),y.detail=g,p.dispatchEvent(y),y},At=function(p,c){var g;!r&&(g=t.picturefill||n.pf)?(c&&c.src&&!p[h]("srcset")&&p.setAttribute("srcset",c.src),g({reevaluate:!0,elements:[p]})):c&&c.src&&(p.src=c.src)},it=function(p,c){return(getComputedStyle(p,null)||{})[c]},he=function(p,c,g){for(g=g||p.offsetWidth;g<n.minSize&&c&&!p._lazysizesWidth;)g=c.offsetWidth,c=c.parentNode;return g},st=function(){var p,c,g=[],b=[],C=g,y=function(){var v=C;for(C=g.length?b:g,p=!0,c=!1;v.length;)v.shift()();p=!1},z=function(v,w){p&&!w?v.apply(this,arguments):(C.push(v),c||(c=!0,(e.hidden?m:S)(y)))};return z._lsFlush=y,z}(),mt=function(p,c){return c?function(){st(p)}:function(){var g=this,b=arguments;st(function(){p.apply(g,b)})}},je=function(p){var c,g=0,b=n.throttleDelay,C=n.ricTimeout,y=function(){c=!1,g=i.now(),p()},z=L&&C>49?function(){L(y,{timeout:C}),C!==n.ricTimeout&&(C=n.ricTimeout)}:mt(function(){m(y)},!0);return function(v){var w;(v=v===!0)&&(C=33),!c&&(c=!0,w=b-(i.now()-g),w<0&&(w=0),v||w<9?z():m(z,w))}},de=function(p){var c,g,b=99,C=function(){c=null,p()},y=function(){var z=i.now()-g;z<b?m(y,b-z):(L||C)(C)};return function(){g=i.now(),c||(c=m(y,b))}},ce=function(){var p,c,g,b,C,y,z,v,w,T,N,U,Ke=/^img$/i,Xe=/^iframe$/i,Ye="onscroll"in t&&!/(gle|ing)bot/.test(navigator.userAgent),Qe=0,nt=0,F=0,Y=-1,pe=function(d){F--,(!d||F<0||!d.target)&&(F=0)},ue=function(d){return U==null&&(U=it(e.body,"visibility")=="hidden"),U||!(it(d.parentNode,"visibility")=="hidden"&&it(d,"visibility")=="hidden")},Je=function(d,f){var _,A=d,x=ue(d);for(v-=f,N+=f,w-=f,T+=f;x&&(A=A.offsetParent)&&A!=e.body&&A!=a;)x=(it(A,"opacity")||1)>0,x&&it(A,"overflow")!="visible"&&(_=A.getBoundingClientRect(),x=T>_.left&&w<_.right&&N>_.top-1&&v<_.bottom+1);return x},me=function(){var d,f,_,A,x,I,W,k,V,H,q,Q,D=s.elements;if((b=n.loadMode)&&F<8&&(d=D.length)){for(f=0,Y++;f<d;f++)if(!(!D[f]||D[f]._lazyRace)){if(!Ye||s.prematureUnveil&&s.prematureUnveil(D[f])){ot(D[f]);continue}if((!(k=D[f][h]("data-expand"))||!(I=k*1))&&(I=nt),H||(H=!n.expand||n.expand<1?a.clientHeight>500&&a.clientWidth>500?500:370:n.expand,s._defEx=H,q=H*n.expFactor,Q=n.hFac,U=null,nt<q&&F<1&&Y>2&&b>2&&!e.hidden?(nt=q,Y=0):b>1&&Y>1&&F<6?nt=H:nt=Qe),V!==I&&(y=innerWidth+I*Q,z=innerHeight+I,W=I*-1,V=I),_=D[f].getBoundingClientRect(),(N=_.bottom)>=W&&(v=_.top)<=z&&(T=_.right)>=W*Q&&(w=_.left)<=y&&(N||T||w||v)&&(n.loadHidden||ue(D[f]))&&(c&&F<3&&!k&&(b<3||Y<4)||Je(D[f],I))){if(ot(D[f]),x=!0,F>9)break}else!x&&c&&!A&&F<4&&Y<4&&b>2&&(p[0]||n.preloadAfterLoad)&&(p[0]||!k&&(N||T||w||v||D[f][h](n.sizesAttr)!="auto"))&&(A=p[0]||D[f])}A&&!x&&ot(A)}},E=je(me),fe=function(d){var f=d.target;if(f._lazyCache){delete f._lazyCache;return}pe(d),tt(f,n.loadedClass),Pt(f,n.loadingClass),zt(f,ge),et(f,"lazyloaded")},ti=mt(fe),ge=function(d){ti({target:d.target})},ei=function(d,f){var _=d.getAttribute("data-load-mode")||n.iframeLoadMode;_==0?d.contentWindow.location.replace(f):_==1&&(d.src=f)},ii=function(d){var f,_=d[h](n.srcsetAttr);(f=n.customMedia[d[h]("data-media")||d[h]("media")])&&d.setAttribute("media",f),_&&d.setAttribute("srcset",_)},si=mt(function(d,f,_,A,x){var I,W,k,V,H,q;(H=et(d,"lazybeforeunveil",f)).defaultPrevented||(A&&(_?tt(d,n.autosizesClass):d.setAttribute("sizes",A)),W=d[h](n.srcsetAttr),I=d[h](n.srcAttr),x&&(k=d.parentNode,V=k&&Z.test(k.nodeName||"")),q=f.firesLoad||"src"in d&&(W||I||V),H={target:d},tt(d,n.loadingClass),q&&(clearTimeout(g),g=m(pe,2500),zt(d,ge,!0)),V&&Ge.call(k.getElementsByTagName("source"),ii),W?d.setAttribute("srcset",W):I&&!V&&(Xe.test(d.nodeName)?ei(d,I):d.src=I),x&&(W||V)&&At(d,{src:I})),d._lazyRace&&delete d._lazyRace,Pt(d,n.lazyClass),st(function(){var Q=d.complete&&d.naturalWidth>1;(!q||Q)&&(Q&&tt(d,n.fastLoadedClass),fe(H),d._lazyCache=!0,m(function(){"_lazyCache"in d&&delete d._lazyCache},9)),d.loading=="lazy"&&F--},!0)}),ot=function(d){if(!d._lazyRace){var f,_=Ke.test(d.nodeName),A=_&&(d[h](n.sizesAttr)||d[h]("sizes")),x=A=="auto";(x||!c)&&_&&(d[h]("src")||d.srcset)&&!d.complete&&!J(d,n.errorClass)&&J(d,n.lazyClass)||(f=et(d,"lazyunveilread").detail,x&&Lt.updateElem(d,!0,d.offsetWidth),d._lazyRace=!0,F++,si(d,f,x,A,_))}},ni=de(function(){n.loadMode=3,E()}),ye=function(){n.loadMode==3&&(n.loadMode=2),ni()},gt=function(){if(!c){if(i.now()-C<999){m(gt,999);return}c=!0,n.loadMode=3,E(),u("scroll",ye,!0)}};return{_:function(){C=i.now(),s.elements=e.getElementsByClassName(n.lazyClass),p=e.getElementsByClassName(n.lazyClass+" "+n.preloadClass),u("scroll",E,!0),u("resize",E,!0),u("pageshow",function(d){if(d.persisted){var f=e.querySelectorAll("."+n.loadingClass);f.length&&f.forEach&&S(function(){f.forEach(function(_){_.complete&&ot(_)})})}}),t.MutationObserver?new MutationObserver(E).observe(a,{childList:!0,subtree:!0,attributes:!0}):(a[l]("DOMNodeInserted",E,!0),a[l]("DOMAttrModified",E,!0),setInterval(E,999)),u("hashchange",E,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(d){e[l](d,E,!0)}),/d$|^c/.test(e.readyState)?gt():(u("load",gt),e[l]("DOMContentLoaded",E),m(gt,2e4)),s.elements.length?(me(),st._lsFlush()):E()},checkElems:E,unveil:ot,_aLSL:ye}}(),Lt=function(){var p,c=mt(function(y,z,v,w){var T,N,U;if(y._lazysizesWidth=w,w+="px",y.setAttribute("sizes",w),Z.test(z.nodeName||""))for(T=z.getElementsByTagName("source"),N=0,U=T.length;N<U;N++)T[N].setAttribute("sizes",w);v.detail.dataAttr||At(y,v.detail)}),g=function(y,z,v){var w,T=y.parentNode;T&&(v=he(y,T,v),w=et(y,"lazybeforesizes",{width:v,dataAttr:!!z}),w.defaultPrevented||(v=w.detail.width,v&&v!==y._lazysizesWidth&&c(y,T,w,v)))},b=function(){var y,z=p.length;if(z)for(y=0;y<z;y++)g(p[y])},C=de(b);return{_:function(){p=e.getElementsByClassName(n.autosizesClass),u("resize",C)},checkElems:C,updateElem:g}}(),ft=function(){!ft.i&&e.getElementsByClassName&&(ft.i=!0,Lt._(),ce._())};return m(function(){n.init&&ft()}),s={cfg:n,autoSizer:Lt,loader:ce,init:ft,uP:At,aC:tt,rC:Pt,hC:J,fire:et,gW:he,rAF:st},s})});var xt=document.getElementById("menu-toggle");xt&&xt.addEventListener("click",o=>{o.preventDefault();let t=document.getElementById("menu");xt.ariaExpanded=t.classList.contains("hidden"),t.classList.toggle("hidden")});var at=class{top;rowWidth;spacing;rowHeight;heightTolerance;minAspectRatio;maxAspectRatio;items=[];height=0;constructor(t){this.top=t.top,this.rowWidth=t.rowWidth,this.spacing=t.spacing,this.rowHeight=t.rowHeight,this.heightTolerance=t.heightTolerance,this.minAspectRatio=this.rowWidth/t.rowHeight*(1-t.heightTolerance),this.maxAspectRatio=this.rowWidth/t.rowHeight*(1+t.heightTolerance)}addItem(t){let e={aspectRatio:t},i=this.items.concat(e),s=this.rowWidth-(i.length-1)*this.spacing,n=i.reduce(function(r,l){return r+l.aspectRatio},0),a=s/this.rowHeight;if(n<this.minAspectRatio)return this.items.push(e),!0;if(n>this.maxAspectRatio){if(this.items.length===0)return this.items.push(e),this.completeLayout(s/n),!0;let r=this.rowWidth-(this.items.length-1)*this.spacing,l=this.items.reduce(function(u,m){return u+m.aspectRatio},0),h=r/this.rowHeight;return Math.abs(n-a)>Math.abs(l-h)?(this.completeLayout(r/l),!1):(this.items.push(e),this.completeLayout(s/n),!0)}else return this.items.push(e),this.completeLayout(s/n),!0}completeLayout(t){let e=this.rowWidth-(this.items.length-1)*this.spacing,i,s=Math.max(.5*this.rowHeight,Math.min(t,2*this.rowHeight));t!==s?(this.height=s,i=e/s/(e/t)):(this.height=t,i=1);let n=0;for(let a of this.items)a.top=this.top,a.width=a.aspectRatio*this.height*i,a.height=this.height,a.left=n,n+=a.width+this.spacing}};function _e(o,t){let e=0,i=[],s,n=0;for(let a of o){s||(s=new at({top:e,...t}));let r=s.addItem(a);s.height>0&&(n=s.height,i=i.concat(s.items),e+=s.height+t.spacing,s=new at({top:e,...t}),r||(r=s.addItem(a),s.height>0&&(n=s.height,i=i.concat(s.items),e+=s.height+t.spacing,s=new at({top:e,...t}))))}return s&&s.items.length&&(s.completeLayout(n||t.rowHeight),i=i.concat(s.items),e+=s.height+t.spacing),e-=t.spacing,{containerHeight:e,boxes:i}}var Se="Next",Ce="Previous",It=8,be="Close",Pe="Download",ze=!0,Ae="The photo cannot be loaded",Le=288,Tt=.25,xe="Zoom";var G=document.getElementById("gallery");if(G){let i=function(){if(o===G.getBoundingClientRect().width)return;o=G.getBoundingClientRect().width;let s=_e(e,{rowWidth:o,spacing:Number.isInteger(It)?It:8,rowHeight:Le||288,heightTolerance:Number.isInteger(Tt)?Tt:.25});t.forEach((n,a)=>{let{width:r,height:l,top:h,left:u}=s.boxes[a];n.style.position="absolute",n.style.width=r+"px",n.style.height=l+"px",n.style.top=h+"px",n.style.left=u+"px",n.style.overflow="hidden"}),G.style.position="relative",G.style.height=s.containerHeight+"px",G.style.visibility=""},o=0,t=G.querySelectorAll(".gallery-item"),e=Array.from(t).map(s=>{let n=s.querySelector("img");return n.style.width="100%",n.style.height="auto",parseFloat(n.getAttribute("width"))/parseFloat(n.getAttribute("height"))});window.addEventListener("resize",i),window.addEventListener("orientationchange",i),i(),i()}var hs=pi(Ie());function rt(o,t,e){let i=document.createElement(t);return o&&(i.className=o),e&&e.appendChild(i),i}function ui(o,t,e){let i=`translate3d(${o}px,${t||0}px,0)`;return e!==void 0&&(i+=` scale3d(${e},${e},1)`),i}function Et(o,t,e){o.style.width=typeof t=="number"?`${t}px`:t,o.style.height=typeof e=="number"?`${e}px`:e}var M={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function mi(o){return"button"in o&&o.button===1||o.ctrlKey||o.metaKey||o.altKey||o.shiftKey}function lt(o,t,e=document){let i=[];if(o instanceof Element)i=[o];else if(o instanceof NodeList||Array.isArray(o))i=Array.from(o);else{let s=typeof o=="string"?o:t;s&&(i=Array.from(e.querySelectorAll(s)))}return i}function fi(o){return typeof o=="function"&&o.prototype&&o.prototype.goTo}function Te(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}var Ot=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},Dt=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){var s,n,a;this._filters[t]||(this._filters[t]=[]),(s=this._filters[t])===null||s===void 0||s.push({fn:e,priority:i}),(n=this._filters[t])===null||n===void 0||n.sort((r,l)=>r.priority-l.priority),(a=this.pswp)===null||a===void 0||a.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(i=>i.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){var i;return(i=this._filters[t])===null||i===void 0||i.forEach(s=>{e[0]=s.fn.apply(this,e)}),e[0]}on(t,e){var i,s;this._listeners[t]||(this._listeners[t]=[]),(i=this._listeners[t])===null||i===void 0||i.push(e),(s=this.pswp)===null||s===void 0||s.on(t,e)}off(t,e){var i;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(s=>e!==s)),(i=this.pswp)===null||i===void 0||i.off(t,e)}dispatch(t,e){var i;if(this.pswp)return this.pswp.dispatch(t,e);let s=new Ot(t,e);return(i=this._listeners[t])===null||i===void 0||i.forEach(n=>{n.call(this,s)}),s}},Mt=class{constructor(t,e){if(this.element=rt("pswp__img pswp__img--placeholder",t?"img":"div",e),t){let i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&(this.element.tagName==="IMG"?(Et(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=ui(0,0,t/250)):Et(this.element,t,e))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}},Rt=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=M.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,e){if(this.slide&&this.usePlaceholder())if(this.placeholder){let i=this.placeholder.element;i&&!i.parentElement&&this.slide.container.prepend(i)}else{let i=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new Mt(i,this.slide.container)}this.element&&!e||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=rt("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=rt("pswp__content","div"),this.element.innerHTML=this.data.html||""),e&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var e,i;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;let s=this.element;this.updateSrcsetSizes(),this.data.srcset&&(s.srcset=this.data.srcset),s.src=(e=this.data.src)!==null&&e!==void 0?e:"",s.alt=(i=this.data.alt)!==null&&i!==void 0?i:"",this.state=M.LOADING,s.complete?this.onLoaded():(s.onload=()=>{this.onLoaded()},s.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=M.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===M.LOADED||this.state===M.ERROR)&&this.removePlaceholder())}onError(){this.state=M.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===M.LOADING,this)}isError(){return this.state===M.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(Et(this.element,t,e),this.isImageContent()&&!this.isError()))){let i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==M.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;let t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=e+"px",t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,e;let i=rt("pswp__error-msg","div");i.innerText=(t=(e=this.instance.options)===null||e===void 0?void 0:e.errorMsg)!==null&&t!==void 0?t:"",i=this.instance.applyFilters("contentErrorElement",i,this),this.element=rt("pswp__content pswp__error-msg-container","div"),this.element.appendChild(i),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===M.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;let t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||Te())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!Te()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===M.LOADED||this.state===M.ERROR)&&this.removePlaceholder()))}};function gi(o,t){if(o.getViewportSizeFn){let e=o.getViewportSizeFn(o,t);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function vt(o,t,e,i,s){let n=0;if(t.paddingFn)n=t.paddingFn(e,i,s)[o];else if(t.padding)n=t.padding[o];else{let a="padding"+o[0].toUpperCase()+o.slice(1);t[a]&&(n=t[a])}return Number(n)||0}function yi(o,t,e,i){return{x:t.x-vt("left",o,t,e,i)-vt("right",o,t,e,i),y:t.y-vt("top",o,t,e,i)-vt("bottom",o,t,e,i)}}var Ee=4e3,Zt=class{constructor(t,e,i,s){this.pswp=s,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){let s={x:t,y:e};this.elementSize=s,this.panAreaSize=i;let n=i.x/s.x,a=i.y/s.y;this.fit=Math.min(1,n<a?n:a),this.fill=Math.min(1,n>a?n:a),this.vFill=Math.min(1,a),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){let e=t+"ZoomLevel",i=this.options[e];if(i)return typeof i=="function"?i(this):i==="fill"?this.fill:i==="fit"?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>Ee&&(t=Ee/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}};function Oe(o,t,e){let i=t.createContentFromData(o,e),s,{options:n}=t;if(n){s=new Zt(n,o,-1);let a;t.pswp?a=t.pswp.viewportSize:a=gi(n,t);let r=yi(n,a,o,e);s.update(i.width,i.height,r)}return i.lazyLoad(),s&&i.setDisplayedSize(Math.ceil(i.width*s.initial),Math.ceil(i.height*s.initial)),i}function vi(o,t){let e=t.getItemData(o);if(!t.dispatch("lazyLoadSlide",{index:o,itemData:e}).defaultPrevented)return Oe(e,t,o)}var Ft=class extends Dt{getNumItems(){var t;let e=0,i=(t=this.options)===null||t===void 0?void 0:t.dataSource;i&&"length"in i?e=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(e=i.items.length));let s=this.dispatch("numItems",{dataSource:i,numItems:e});return this.applyFilters("numItems",s.numItems,i)}createContentFromData(t,e){return new Rt(t,this,e)}getItemData(t){var e;let i=(e=this.options)===null||e===void 0?void 0:e.dataSource,s={};Array.isArray(i)?s=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),s=i.items[t]);let n=s;n instanceof Element&&(n=this._domElementToItemData(n));let a=this.dispatch("itemData",{itemData:n||{},index:t});return this.applyFilters("itemData",a.itemData,t)}_getGalleryDOMElements(t){var e,i;return(e=this.options)!==null&&e!==void 0&&e.children||(i=this.options)!==null&&i!==void 0&&i.childSelector?lt(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){let e={element:t},i=t.tagName==="A"?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,e.w=e.width,e.h=e.height,i.dataset.pswpType&&(e.type=i.dataset.pswpType);let n=t.querySelector("img");if(n){var s;e.msrc=n.currentSrc||n.src,e.alt=(s=n.getAttribute("alt"))!==null&&s!==void 0?s:""}(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0)}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return Oe(t,this,e)}},_t=class extends Ft{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){lt(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(mi(t)||window.pswp)return;let e={x:t.clientX,y:t.clientY};!e.x&&!e.y&&(e=null);let i=this.getClickedIndex(t);i=this.applyFilters("clickedIndex",i,t,this);let s={gallery:t.currentTarget};i>=0&&(t.preventDefault(),this.loadAndOpen(i,s,e))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);let e=t.target,s=lt(this.options.children,this.options.childSelector,t.currentTarget).findIndex(n=>n===e||n.contains(e));return s!==-1?s:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,e,i){if(window.pswp||!this.options)return!1;if(!e&&this.options.gallery&&this.options.children){let s=lt(this.options.gallery);s[0]&&(e={gallery:s[0]})}return this.options.index=t,this.options.initialPointerPos=i,this.shouldOpen=!0,this.preload(t,e),!0}preload(t,e){let{options:i}=this;e&&(i.dataSource=e);let s=[],n=typeof i.pswpModule;if(fi(i.pswpModule))s.push(Promise.resolve(i.pswpModule));else{if(n==="string")throw new Error("pswpModule as string is no longer supported");if(n==="function")s.push(i.pswpModule());else throw new Error("pswpModule is not valid")}typeof i.openPromise=="function"&&s.push(i.openPromise()),i.preloadFirstSlide!==!1&&t>=0&&(this._preloadedContent=vi(t,this));let a=++this._uid;Promise.all(s).then(r=>{if(this.shouldOpen){let l=r[0];this._openPhotoswipe(l,a)}})}_openPhotoswipe(t,e){if(e!==this._uid&&this.shouldOpen||(this.shouldOpen=!1,window.pswp))return;let i=typeof t=="object"?new t.default(this.options):new t(this.options);this.pswp=i,window.pswp=i,Object.keys(this._listeners).forEach(s=>{var n;(n=this._listeners[s])===null||n===void 0||n.forEach(a=>{i.on(s,a)})}),Object.keys(this._filters).forEach(s=>{var n;(n=this._filters[s])===null||n===void 0||n.forEach(a=>{i.addFilter(s,a.fn,a.priority)})}),this._preloadedContent&&(i.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),i.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),i.init()}destroy(){var t;(t=this.pswp)===null||t===void 0||t.destroy(),this.shouldOpen=!1,this._listeners={},lt(this.options.gallery,this.options.gallerySelector).forEach(e=>{e.removeEventListener("click",this.onThumbnailsClick,!1)})}};function O(o,t,e){let i=document.createElement(t);return o&&(i.className=o),e&&e.appendChild(i),i}function P(o,t){return o.x=t.x,o.y=t.y,t.id!==void 0&&(o.id=t.id),o}function We(o){o.x=Math.round(o.x),o.y=Math.round(o.y)}function Nt(o,t){let e=Math.abs(o.x-t.x),i=Math.abs(o.y-t.y);return Math.sqrt(e*e+i*i)}function ct(o,t){return o.x===t.x&&o.y===t.y}function ut(o,t,e){return Math.min(Math.max(o,t),e)}function pt(o,t,e){let i=`translate3d(${o}px,${t||0}px,0)`;return e!==void 0&&(i+=` scale3d(${e},${e},1)`),i}function K(o,t,e,i){o.style.transform=pt(t,e,i)}var _i="cubic-bezier(.4,0,.22,1)";function ke(o,t,e,i){o.style.transition=t?`${t} ${e}ms ${i||_i}`:"none"}function Bt(o,t,e){o.style.width=typeof t=="number"?`${t}px`:t,o.style.height=typeof e=="number"?`${e}px`:e}function wi(o){ke(o)}function Si(o){return"decode"in o?o.decode().catch(()=>{}):o.complete?Promise.resolve(o):new Promise((t,e)=>{o.onload=()=>t(o),o.onerror=e})}var R={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function Ci(o){return"button"in o&&o.button===1||o.ctrlKey||o.metaKey||o.altKey||o.shiftKey}function bi(o,t,e=document){let i=[];if(o instanceof Element)i=[o];else if(o instanceof NodeList||Array.isArray(o))i=Array.from(o);else{let s=typeof o=="string"?o:t;s&&(i=Array.from(e.querySelectorAll(s)))}return i}function De(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}var He=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{He=!0}}))}catch{}var Wt=class{constructor(){this._pool=[]}add(t,e,i,s){this._toggleListener(t,e,i,s)}remove(t,e,i,s){this._toggleListener(t,e,i,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,e,i,s,n,a){if(!t)return;let r=n?"removeEventListener":"addEventListener";e.split(" ").forEach(h=>{if(h){a||(n?this._pool=this._pool.filter(m=>m.type!==h||m.listener!==i||m.target!==t):this._pool.push({target:t,type:h,listener:i,passive:s}));let u=He?{passive:s||!1}:!1;t[r](h,i,u)}})}};function $e(o,t){if(o.getViewportSizeFn){let e=o.getViewportSizeFn(o,t);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function dt(o,t,e,i,s){let n=0;if(t.paddingFn)n=t.paddingFn(e,i,s)[o];else if(t.padding)n=t.padding[o];else{let a="padding"+o[0].toUpperCase()+o.slice(1);t[a]&&(n=t[a])}return Number(n)||0}function Ve(o,t,e,i){return{x:t.x-dt("left",o,t,e,i)-dt("right",o,t,e,i),y:t.y-dt("top",o,t,e,i)-dt("bottom",o,t,e,i)}}var kt=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){let{pswp:e}=this.slide,i=this.slide[t==="x"?"width":"height"]*this.currZoomLevel,n=dt(t==="x"?"left":"top",e.options,e.viewportSize,this.slide.data,this.slide.index),a=this.slide.panAreaSize[t];this.center[t]=Math.round((a-i)/2)+n,this.max[t]=i>a?Math.round(a-i)+n:this.center[t],this.min[t]=i>a?n:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,e){return ut(e,this.max[t],this.min[t])}},Me=4e3,wt=class{constructor(t,e,i,s){this.pswp=s,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){let s={x:t,y:e};this.elementSize=s,this.panAreaSize=i;let n=i.x/s.x,a=i.y/s.y;this.fit=Math.min(1,n<a?n:a),this.fill=Math.min(1,n>a?n:a),this.vFill=Math.min(1,a),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){let e=t+"ZoomLevel",i=this.options[e];if(i)return typeof i=="function"?i(this):i==="fill"?this.fill:i==="fit"?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>Me&&(t=Me/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}},Ht=class{constructor(t,e,i){this.data=t,this.index=e,this.pswp=i,this.isActive=e===i.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!i.opener.isOpen,this.zoomLevels=new wt(i.options,t,e,i),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:e}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=O("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new kt(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){let{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!!0||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(t){let e=this.currentResolution||this.zoomLevels.initial;if(!e)return;let i=Math.round(this.width*e)||this.pswp.viewportSize.x,s=Math.round(this.height*e)||this.pswp.viewportSize.y;!this.sizeChanged(i,s)&&!t||this.content.setDisplayedSize(i,s)}sizeChanged(t,e){return t!==this.prevDisplayedWidth||e!==this.prevDisplayedHeight?(this.prevDisplayedWidth=t,this.prevDisplayedHeight=e,!0):!1}getPlaceholderElement(){var t;return(t=this.content.placeholder)===null||t===void 0?void 0:t.element}zoomTo(t,e,i,s){let{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:i}),n.animations.stopAllPan();let a=this.currZoomLevel;s||(t=ut(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,a),this.pan.y=this.calculateZoomToPanOffset("y",e,a),We(this.pan);let r=()=>{this._setResolution(t),this.applyCurrentZoomPan()};i?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:r,duration:i,easing:n.options.easing}):r()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,e,i){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];e||(e=this.pswp.getViewportCenterPoint()),i||(i=this.zoomLevels.initial);let n=this.currZoomLevel/i;return this.bounds.correctPan(t,(this.pan[t]-e[t])*n+e[t])}panTo(t,e){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",e),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),P(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,e,i){i/=this.currentResolution||this.zoomLevels.initial,K(this.container,t,e,i)}calculateSize(){let{pswp:t}=this;P(this.panAreaSize,Ve(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){let t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return pt(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}},Pi=.35,zi=.6,Re=.4,Ze=.5;function Ai(o,t){return o*t/(1-t)}var $t=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&P(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){let{p1:t,prevP1:e,dragAxis:i}=this.gestures,{currSlide:s}=this.pswp;if(i==="y"&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){let n=s.pan.y+(t.y-e.y);if(!this.pswp.dispatch("verticalDrag",{panY:n}).defaultPrevented){this._setPanWithFriction("y",n,zi);let a=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(a),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(We(s.pan),s.applyCurrentZoomPan()))}end(){let{velocity:t}=this.gestures,{mainScroll:e,currSlide:i}=this.pswp,s=0;if(this.pswp.animations.stopAll(),e.isShifted()){let a=(e.x-e.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-Ze&&a<0||t.x<.1&&a<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>Ze&&a>0||t.x>-.1&&a>.5)&&(s=-1,t.x=Math.max(t.x,0)),e.moveIndexBy(s,!0,t.x)}i&&i.currZoomLevel>i.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){let{velocity:e}=this.gestures,{currSlide:i}=this.pswp;if(!i)return;let{pan:s,bounds:n}=i,a=s[t],r=this.pswp.bgOpacity<1&&t==="y",h=a+Ai(e[t],.995);if(r){let Z=this._getVerticalDragRatio(a),$=this._getVerticalDragRatio(h);if(Z<0&&$<-Re||Z>0&&$>Re){this.pswp.close();return}}let u=n.correctPan(t,h);if(a===u)return;let m=u===h?1:.82,S=this.pswp.bgOpacity,L=u-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:u,velocity:e[t],dampingRatio:m,onUpdate:Z=>{if(r&&this.pswp.bgOpacity<1){let $=1-(u-Z)/L;this.pswp.applyBgOpacity(ut(S+(1-S)*$,0,1))}s[t]=Math.floor(Z),i.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){let{p1:e,dragAxis:i,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:a,mainScroll:r}=this.pswp,l=e[t]-s[t],h=r.x+l;if(!l||!a)return!1;if(t==="x"&&!a.isPannable()&&!n)return r.moveTo(h,!0),!0;let{bounds:u}=a,m=a.pan[t]+l;if(this.pswp.options.allowPanToNext&&i==="x"&&t==="x"&&!n){let S=r.getCurrSlideX(),L=r.x-S,Z=l>0,$=!Z;if(m>u.min[t]&&Z){if(u.min[t]<=this.startPan[t])return r.moveTo(h,!0),!0;this._setPanWithFriction(t,m)}else if(m<u.max[t]&&$){if(this.startPan[t]<=u.max[t])return r.moveTo(h,!0),!0;this._setPanWithFriction(t,m)}else if(L!==0){if(L>0)return r.moveTo(Math.max(h,S),!0),!0;if(L<0)return r.moveTo(Math.min(h,S),!0),!0}else this._setPanWithFriction(t,m)}else t==="y"?!r.isShifted()&&u.min.y!==u.max.y&&this._setPanWithFriction(t,m):this._setPanWithFriction(t,m);return!1}_getVerticalDragRatio(t){var e,i;return(t-((e=(i=this.pswp.currSlide)===null||i===void 0?void 0:i.bounds.center.y)!==null&&e!==void 0?e:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,e,i){let{currSlide:s}=this.pswp;if(!s)return;let{pan:n,bounds:a}=s;if(a.correctPan(t,e)!==e||i){let l=Math.round(e-n[t]);n[t]+=l*(i||Pi)}else n[t]=e}},Li=.05,xi=.15;function Fe(o,t,e){return o.x=(t.x+e.x)/2,o.y=(t.y+e.y)/2,o}var Vt=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){let{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,P(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){let{p1:t,startP1:e,p2:i,startP2:s,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;let r=a.zoomLevels.min,l=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;Fe(this._startZoomPoint,e,s),Fe(this._zoomPoint,t,i);let h=1/Nt(e,s)*Nt(t,i)*this._startZoomLevel;if(h>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),h<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){let u=1-(r-h)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:u}).defaultPrevented||n.applyBgOpacity(u)}else h=r-(r-h)*xi;else h>l&&(h=l+(h-l)*Li);a.pan.x=this._calculatePanForZoomLevel("x",h),a.pan.y=this._calculatePanForZoomLevel("y",h),a.setZoomLevel(h),a.applyCurrentZoomPan()}end(){let{pswp:t}=this.gestures,{currSlide:e}=t;(!e||e.currZoomLevel<e.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,e){let i=e/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*i}correctZoomPan(t){let{pswp:e}=this.gestures,{currSlide:i}=e;if(!(i!=null&&i.isZoomable()))return;this._zoomPoint.x===0&&(t=!0);let s=i.currZoomLevel,n,a=!0;s<i.zoomLevels.initial?n=i.zoomLevels.initial:s>i.zoomLevels.max?n=i.zoomLevels.max:(a=!1,n=s);let r=e.bgOpacity,l=e.bgOpacity<1,h=P({x:0,y:0},i.pan),u=P({x:0,y:0},h);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,P(this._startPan,h)),a&&(u={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),i.setZoomLevel(n),u={x:i.bounds.correctPan("x",u.x),y:i.bounds.correctPan("y",u.y)},i.setZoomLevel(s);let m=!ct(u,h);if(!m&&!a&&!l){i._setResolution(n),i.applyCurrentZoomPan();return}e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:S=>{if(S/=1e3,m||a){if(m&&(i.pan.x=h.x+(u.x-h.x)*S,i.pan.y=h.y+(u.y-h.y)*S),a){let L=s+(n-s)*S;i.setZoomLevel(L)}i.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(ut(r+(1-r)*S,0,1))},onComplete:()=>{i._setResolution(n),i.applyCurrentZoomPan()}})}};function Ne(o){return!!o.target.closest(".pswp__container")}var Ut=class{constructor(t){this.gestures=t}click(t,e){let i=e.target.classList,s=i.contains("pswp__img"),n=i.contains("pswp__item")||i.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,e):n&&this._doClickOrTapAction("bgClick",t,e)}tap(t,e){Ne(e)&&this._doClickOrTapAction("tap",t,e)}doubleTap(t,e){Ne(e)&&this._doClickOrTapAction("doubleTap",t,e)}_doClickOrTapAction(t,e,i){var s;let{pswp:n}=this.gestures,{currSlide:a}=n,r=t+"Action",l=n.options[r];if(!n.dispatch(r,{point:e,originalEvent:i}).defaultPrevented){if(typeof l=="function"){l.call(n,e,i);return}switch(l){case"close":case"next":n[l]();break;case"zoom":a?.toggleZoom(e);break;case"zoom-or-close":a!=null&&a.isZoomable()&&a.zoomLevels.secondary!==a.zoomLevels.initial?a.toggleZoom(e):n.options.clickToCloseNonZoomable&&n.close();break;case"toggle-controls":(s=this.gestures.pswp.element)===null||s===void 0||s.classList.toggle("pswp--ui-visible");break}}}},Ii=10,Ti=300,Ei=25,qt=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new $t(this),this.zoomLevels=new Vt(this),this.tapHandler=new Ut(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,e,i,s){let{pswp:n}=this,{events:a}=n,r=s?t+s:"";a.add(n.scrollWrap,t+e,this.onPointerDown.bind(this)),a.add(window,t+"move",this.onPointerMove.bind(this)),a.add(window,t+i,this.onPointerUp.bind(this)),r&&a.add(n.scrollWrap,r,this.onPointerUp.bind(this))}onPointerDown(t){let e=t.type==="mousedown"||t.pointerType==="mouse";if(e&&t.button>0)return;let{pswp:i}=this;if(!i.opener.isOpen){t.preventDefault();return}i.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(e&&(i.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),i.animations.stopAll(),this._updatePoints(t,"down"),this._numActivePoints===1&&(this.dragAxis=null,P(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,P(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?ct(this.p1,this.prevP1)||this.drag.change():(!ct(this.p1,this.prevP1)||!ct(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){let e=Date.now(),i=e-this._intervalTime;i<50&&!t||(this.velocity.x=this._getVelocity("x",i),this.velocity.y=this._getVelocity("y",i),this._intervalTime=e,P(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){let{mainScroll:e}=this.pswp;if(e.isShifted()){e.moveIndexBy(0,!0);return}if(t.type.indexOf("cancel")>0)return;if(t.type==="mouseup"||t.pointerType==="mouse"){this.tapHandler.click(this.startP1,t);return}let i=this.pswp.options.doubleTapAction?Ti:0;this._tapTimer?(this._clearTapTimer(),Nt(this._lastStartP1,this.startP1)<Ei&&this.tapHandler.doubleTap(this.startP1,t)):(P(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},i))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,e){let i=this.p1[t]-this._intervalP1[t];return Math.abs(i)>1&&e>5?i/e:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,e){this.pswp.applyFilters("preventPointerEvent",!0,t,e)&&t.preventDefault()}_updatePoints(t,e){if(this._pointerEventEnabled){let i=t,s=this._ongoingPointers.findIndex(n=>n.id===i.pointerId);e==="up"&&s>-1?this._ongoingPointers.splice(s,1):e==="down"&&s===-1?this._ongoingPointers.push(this._convertEventPosToPoint(i,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(i,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&P(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&P(this.p2,this._ongoingPointers[1])}else{let i=t;this._numActivePoints=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this._convertEventPosToPoint(i.touches[0],this.p1),this._numActivePoints++,i.touches.length>1&&(this._convertEventPosToPoint(i.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),e==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){P(this.prevP1,this.p1),P(this.prevP2,this.p2)}_updateStartPoints(){P(this.startP1,this.p1),P(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{let t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t!==0){let e=t>0?"x":"y";Math.abs(this.p1[e]-this.startP1[e])>=Ii&&(this.dragAxis=e)}}}_convertEventPosToPoint(t,e){return e.x=t.pageX-this.pswp.offset.x,e.y=t.pageY-this.pswp.offset.y,"pointerId"in t?e.id=t.pointerId:t.identifier!==void 0&&(e.id=t.identifier),e}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},Oi=.35,Gt=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){let{pswp:e}=this,i=Math.round(e.viewportSize.x+e.viewportSize.x*e.options.spacing),s=i!==this.slideWidth;s&&(this.slideWidth=i,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((n,a)=>{s&&K(n.el,(a+this._containerShiftIndex)*this.slideWidth),t&&n.slide&&n.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){let e=O("pswp__item","div",this.pswp.container);e.setAttribute("role","group"),e.setAttribute("aria-roledescription","slide"),e.setAttribute("aria-hidden","true"),e.style.display=t===1?"block":"none",this.itemHolders.push({el:e})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,e,i){let{pswp:s}=this,n=s.potentialIndex+t,a=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);let l=(t+a)%a;l<=a/2?t=l:t=l-a}else n<0?n=0:n>=a&&(n=a-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();let r=this.getCurrSlideX();if(!e)this.moveTo(r),this.updateCurrItem();else{s.animations.startSpring({isMainScroll:!0,start:this.x,end:r,velocity:i||0,naturalFrequency:30,dampingRatio:1,onUpdate:h=>{this.moveTo(h)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let l=s.potentialIndex-s.currIndex;if(s.canLoop()){let h=(l+a)%a;h<=a/2?l=h:l=h-a}Math.abs(l)>1&&this.updateCurrItem()}return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;let{pswp:e}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,e.currIndex=e.potentialIndex;let s=Math.abs(i),n;s>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),s=3,this.itemHolders.forEach(a=>{var r;(r=a.slide)===null||r===void 0||r.destroy(),a.slide=void 0}));for(let a=0;a<s;a++)i>0?(n=this.itemHolders.shift(),n&&(this.itemHolders[2]=n,this._containerShiftIndex++,K(n.el,(this._containerShiftIndex+2)*this.slideWidth),e.setContent(n,e.currIndex-s+a+2))):(n=this.itemHolders.pop(),n&&(this.itemHolders.unshift(n),this._containerShiftIndex--,K(n.el,this._containerShiftIndex*this.slideWidth),e.setContent(n,e.currIndex+s-a-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),e.animations.stopAllPan(),this.itemHolders.forEach((a,r)=>{a.slide&&a.slide.setIsActive(r===1)}),e.currSlide=(t=this.itemHolders[1])===null||t===void 0?void 0:t.slide,e.contentLoader.updateLazy(i),e.currSlide&&e.currSlide.applyCurrentZoomPan(),e.dispatch("change")}moveTo(t,e){if(!this.pswp.canLoop()&&e){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;let s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+s*Oi)}this.x=t,this.pswp.container&&K(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:e??!1})}},Di={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},j=(o,t)=>t?o:Di[o],jt=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});let e=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&e&&this._wasFocused&&e.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){let{pswp:e}=this;if(e.dispatch("keydown",{originalEvent:t}).defaultPrevented||Ci(t))return;let i,s,n=!1,a="key"in t;switch(a?t.key:t.keyCode){case j("Escape",a):e.options.escKey&&(i="close");break;case j("z",a):i="toggleZoom";break;case j("ArrowLeft",a):s="x";break;case j("ArrowUp",a):s="y";break;case j("ArrowRight",a):s="x",n=!0;break;case j("ArrowDown",a):n=!0,s="y";break;case j("Tab",a):this._focusRoot();break}if(s){t.preventDefault();let{currSlide:r}=e;e.options.arrowKeys&&s==="x"&&e.getNumItems()>1?i=n?"next":"prev":r&&r.currZoomLevel>r.zoomLevels.fit&&(r.pan[s]+=n?-80:80,r.panTo(r.pan.x,r.pan.y))}i&&(t.preventDefault(),e[i]())}_onFocusIn(t){let{template:e}=this.pswp;e&&document!==t.target&&e!==t.target&&!e.contains(t.target)&&e.focus()}},Mi="cubic-bezier(.4,0,.22,1)",Kt=class{constructor(t){var e;this.props=t;let{target:i,onComplete:s,transform:n,onFinish:a=()=>{},duration:r=333,easing:l=Mi}=t;this.onFinish=a;let h=n?"transform":"opacity",u=(e=t[h])!==null&&e!==void 0?e:"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{ke(i,h,r,l),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},r+500),i.style[h]=u},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),wi(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},Ri=12,Zi=.75,Xt=class{constructor(t,e,i){this.velocity=t*1e3,this._dampingRatio=e||Zi,this._naturalFrequency=i||Ri,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,e){let i=0,s;e/=1e3;let n=Math.E**(-this._dampingRatio*this._naturalFrequency*e);if(this._dampingRatio===1)s=this.velocity+this._naturalFrequency*t,i=(t+s*e)*n,this.velocity=i*-this._naturalFrequency+s*n;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);let a=Math.cos(this._dampedFrequency*e),r=Math.sin(this._dampedFrequency*e);i=n*(t*a+s*r),this.velocity=i*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*r+this._dampedFrequency*s*a)}return i}},Yt=class{constructor(t){this.props=t,this._raf=0;let{start:e,end:i,velocity:s,onUpdate:n,onComplete:a,onFinish:r=()=>{},dampingRatio:l,naturalFrequency:h}=t;this.onFinish=r;let u=new Xt(s,l,h),m=Date.now(),S=e-i,L=()=>{this._raf&&(S=u.easeFrame(S,Date.now()-m),Math.abs(S)<1&&Math.abs(u.velocity)<50?(n(i),a&&a(),this.onFinish()):(m=Date.now(),n(S+i),this._raf=requestAnimationFrame(L)))};this._raf=requestAnimationFrame(L)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},Qt=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,e){let i=e?new Yt(t):new Kt(t);return this.activeAnimations.push(i),i.onFinish=()=>this.stop(i),i}stop(t){t.destroy();let e=this.activeAnimations.indexOf(t);e>-1&&this.activeAnimations.splice(e,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isPan?(t.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isMainScroll?(t.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},Jt=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();let{currSlide:e}=this.pswp,{deltaX:i,deltaY:s}=t;if(e&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(e.isZoomable()){let n=-s;t.deltaMode===1?n*=.05:n*=t.deltaMode?1:.002,n=2**n;let a=e.currZoomLevel*n;e.zoomTo(a,{x:t.clientX,y:t.clientY})}}else e.isPannable()&&(t.deltaMode===1&&(i*=18,s*=18),e.panTo(e.pan.x-i,e.pan.y-s))}};function Fi(o){if(typeof o=="string")return o;if(!o||!o.isCustomSVG)return"";let t=o,e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(t.size||32),t.outlineID&&(e+='<use class="pswp__icn-shadow" xlink:href="#'+t.outlineID+'"/>'),e+=t.inner,e+="</svg>",e}var te=class{constructor(t,e){var i;let s=e.name||e.className,n=e.html;if(t.options[s]===!1)return;typeof t.options[s+"SVG"]=="string"&&(n=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:e});let a="";e.isButton?(a+="pswp__button ",a+=e.className||`pswp__button--${e.name}`):a+=e.className||`pswp__${e.name}`;let r=e.isButton?e.tagName||"button":e.tagName||"div";r=r.toLowerCase();let l=O(a,r);if(e.isButton){r==="button"&&(l.type="button");let{title:m}=e,{ariaLabel:S}=e;typeof t.options[s+"Title"]=="string"&&(m=t.options[s+"Title"]),m&&(l.title=m);let L=S||m;L&&l.setAttribute("aria-label",L)}l.innerHTML=Fi(n),e.onInit&&e.onInit(l,t),e.onClick&&(l.onclick=m=>{typeof e.onClick=="string"?t[e.onClick]():typeof e.onClick=="function"&&e.onClick(m,l,t)});let h=e.appendTo||"bar",u=t.element;h==="bar"?(t.topBar||(t.topBar=O("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),u=t.topBar):(l.classList.add("pswp__hide-on-close"),h==="wrapper"&&(u=t.scrollWrap)),(i=u)===null||i===void 0||i.appendChild(t.applyFilters("uiElement",l,e))}};function Ue(o,t,e){o.classList.add("pswp__button--arrow"),o.setAttribute("aria-controls","pswp__items"),t.on("change",()=>{t.options.loop||(e?o.disabled=!(t.currIndex<t.getNumItems()-1):o.disabled=!(t.currIndex>0))})}var Ni={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:Ue},Bi={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(o,t)=>{Ue(o,t,!0)}},Wi={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},ki={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},Hi={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(o,t)=>{let e,i=null,s=(r,l)=>{o.classList.toggle("pswp__preloader--"+r,l)},n=r=>{e!==r&&(e=r,s("active",r))},a=()=>{var r;if(!((r=t.currSlide)!==null&&r!==void 0&&r.content.isLoading())){n(!1),i&&(clearTimeout(i),i=null);return}i||(i=setTimeout(()=>{var l;n(!!(!((l=t.currSlide)===null||l===void 0)&&l.content.isLoading())),i=null},t.options.preloaderDelay))};t.on("change",a),t.on("loadComplete",r=>{t.currSlide===r.slide&&a()}),t.ui&&(t.ui.updatePreloaderVisibility=a)}},$i={name:"counter",order:5,onInit:(o,t)=>{t.on("change",()=>{o.innerText=t.currIndex+1+t.options.indexIndicatorSep+t.getNumItems()})}};function Be(o,t){o.classList.toggle("pswp--zoomed-in",t)}var ee=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){let{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[Wi,Ni,Bi,ki,Hi,$i],t.dispatch("uiRegister"),this.uiElementsData.sort((e,i)=>(e.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(e=>{this.registerElement(e)}),t.on("change",()=>{var e;(e=t.element)===null||e===void 0||e.classList.toggle("pswp--one-slide",t.getNumItems()===1)}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new te(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){let{template:t,currSlide:e,options:i}=this.pswp;if(this.pswp.opener.isClosing||!t||!e)return;let{currZoomLevel:s}=e;if(this.pswp.opener.isOpen||(s=e.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;let n=e.zoomLevels.initial-e.zoomLevels.secondary;if(Math.abs(n)<.01||!e.isZoomable()){Be(t,!1),t.classList.remove("pswp--zoom-allowed");return}t.classList.add("pswp--zoom-allowed");let a=s===e.zoomLevels.initial?e.zoomLevels.secondary:e.zoomLevels.initial;Be(t,a<=s),(i.imageClickAction==="zoom"||i.imageClickAction==="zoom-or-close")&&t.classList.add("pswp--click-to-zoom")}};function Vi(o){let t=o.getBoundingClientRect();return{x:t.left,y:t.top,w:t.width}}function Ui(o,t,e){let i=o.getBoundingClientRect(),s=i.width/t,n=i.height/e,a=s>n?s:n,r=(i.width-t*a)/2,l=(i.height-e*a)/2,h={x:i.left+r,y:i.top+l,w:t*a};return h.innerRect={w:i.width,h:i.height,x:r,y:l},h}function qi(o,t,e){let i=e.dispatch("thumbBounds",{index:o,itemData:t,instance:e});if(i.thumbBounds)return i.thumbBounds;let{element:s}=t,n,a;if(s&&e.options.thumbSelector!==!1){let r=e.options.thumbSelector||"img";a=s.matches(r)?s:s.querySelector(r)}return a=e.applyFilters("thumbEl",a,t,o),a&&(t.thumbCropped?n=Ui(a,t.width||t.w||0,t.height||t.h||0):n=Vi(a)),e.applyFilters("thumbBounds",n,t,o)}var ie=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},se=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){var s,n,a;this._filters[t]||(this._filters[t]=[]),(s=this._filters[t])===null||s===void 0||s.push({fn:e,priority:i}),(n=this._filters[t])===null||n===void 0||n.sort((r,l)=>r.priority-l.priority),(a=this.pswp)===null||a===void 0||a.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(i=>i.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){var i;return(i=this._filters[t])===null||i===void 0||i.forEach(s=>{e[0]=s.fn.apply(this,e)}),e[0]}on(t,e){var i,s;this._listeners[t]||(this._listeners[t]=[]),(i=this._listeners[t])===null||i===void 0||i.push(e),(s=this.pswp)===null||s===void 0||s.on(t,e)}off(t,e){var i;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(s=>e!==s)),(i=this.pswp)===null||i===void 0||i.off(t,e)}dispatch(t,e){var i;if(this.pswp)return this.pswp.dispatch(t,e);let s=new ie(t,e);return(i=this._listeners[t])===null||i===void 0||i.forEach(n=>{n.call(this,s)}),s}},ne=class{constructor(t,e){if(this.element=O("pswp__img pswp__img--placeholder",t?"img":"div",e),t){let i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&(this.element.tagName==="IMG"?(Bt(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=pt(0,0,t/250)):Bt(this.element,t,e))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}},oe=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=R.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,e){if(this.slide&&this.usePlaceholder())if(this.placeholder){let i=this.placeholder.element;i&&!i.parentElement&&this.slide.container.prepend(i)}else{let i=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new ne(i,this.slide.container)}this.element&&!e||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=O("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=O("pswp__content","div"),this.element.innerHTML=this.data.html||""),e&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var e,i;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;let s=this.element;this.updateSrcsetSizes(),this.data.srcset&&(s.srcset=this.data.srcset),s.src=(e=this.data.src)!==null&&e!==void 0?e:"",s.alt=(i=this.data.alt)!==null&&i!==void 0?i:"",this.state=R.LOADING,s.complete?this.onLoaded():(s.onload=()=>{this.onLoaded()},s.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=R.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===R.LOADED||this.state===R.ERROR)&&this.removePlaceholder())}onError(){this.state=R.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===R.LOADING,this)}isError(){return this.state===R.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(Bt(this.element,t,e),this.isImageContent()&&!this.isError()))){let i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==R.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;let t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=e+"px",t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,e;let i=O("pswp__error-msg","div");i.innerText=(t=(e=this.instance.options)===null||e===void 0?void 0:e.errorMsg)!==null&&t!==void 0?t:"",i=this.instance.applyFilters("contentErrorElement",i,this),this.element=O("pswp__content pswp__error-msg-container","div"),this.element.appendChild(i),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===R.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;let t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||De())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!De()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===R.LOADED||this.state===R.ERROR)&&this.removePlaceholder()))}},Gi=5;function qe(o,t,e){let i=t.createContentFromData(o,e),s,{options:n}=t;if(n){s=new wt(n,o,-1);let a;t.pswp?a=t.pswp.viewportSize:a=$e(n,t);let r=Ve(n,a,o,e);s.update(i.width,i.height,r)}return i.lazyLoad(),s&&i.setDisplayedSize(Math.ceil(i.width*s.initial),Math.ceil(i.height*s.initial)),i}function ji(o,t){let e=t.getItemData(o);if(!t.dispatch("lazyLoadSlide",{index:o,itemData:e}).defaultPrevented)return qe(e,t,o)}var ae=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,Gi),this._cachedItems=[]}updateLazy(t){let{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;let{preload:i}=e.options,s=t===void 0?!0:t>=0,n;for(n=0;n<=i[1];n++)this.loadSlideByIndex(e.currIndex+(s?n:-n));for(n=1;n<=i[0];n++)this.loadSlideByIndex(e.currIndex+(s?-n:n))}loadSlideByIndex(t){let e=this.pswp.getLoopedIndex(t),i=this.getContentByIndex(e);i||(i=ji(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){let e=this._cachedItems.findIndex(i=>!i.isAttached&&!i.hasSlide);e!==-1&&this._cachedItems.splice(e,1)[0].destroy()}}removeByIndex(t){let e=this._cachedItems.findIndex(i=>i.index===t);e!==-1&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find(e=>e.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},re=class extends se{getNumItems(){var t;let e=0,i=(t=this.options)===null||t===void 0?void 0:t.dataSource;i&&"length"in i?e=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(e=i.items.length));let s=this.dispatch("numItems",{dataSource:i,numItems:e});return this.applyFilters("numItems",s.numItems,i)}createContentFromData(t,e){return new oe(t,this,e)}getItemData(t){var e;let i=(e=this.options)===null||e===void 0?void 0:e.dataSource,s={};Array.isArray(i)?s=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),s=i.items[t]);let n=s;n instanceof Element&&(n=this._domElementToItemData(n));let a=this.dispatch("itemData",{itemData:n||{},index:t});return this.applyFilters("itemData",a.itemData,t)}_getGalleryDOMElements(t){var e,i;return(e=this.options)!==null&&e!==void 0&&e.children||(i=this.options)!==null&&i!==void 0&&i.childSelector?bi(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){let e={element:t},i=t.tagName==="A"?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,e.w=e.width,e.h=e.height,i.dataset.pswpType&&(e.type=i.dataset.pswpType);let n=t.querySelector("img");if(n){var s;e.msrc=n.currentSrc||n.src,e.alt=(s=n.getAttribute("alt"))!==null&&s!==void 0?s:""}(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0)}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return qe(t,this,e)}},ht=.003,le=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;let t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){let t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){let{pswp:t}=this,e=this.pswp.currSlide,{options:i}=t;if(i.showHideAnimationType==="fade"?(i.showHideOpacity=!0,this._thumbBounds=void 0):i.showHideAnimationType==="none"?(i.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=e?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&e?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),!this._animateZoom)this._animateRootOpacity=!0,this.isOpening&&e&&(e.zoomAndPanToInitial(),e.applyCurrentZoomPan());else{var s;this._animateRootOpacity=(s=i.showHideOpacity)!==null&&s!==void 0?s:!1}if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>ht,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(t.element&&(t.element.style.opacity=String(ht)),t.applyBgOpacity(1));return}if(this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect){var n;this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=(n=this.pswp.currSlide)===null||n===void 0?void 0:n.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")}else this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(ht)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(ht)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(ht)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&t.mainScroll.x!==0&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(t=>{let e=!1,i=!0;Si(this._placeholder).finally(()=>{e=!0,i||t(!0)}),setTimeout(()=>{i=!1,e&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){var t,e;(t=this.pswp.element)===null||t===void 0||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),(e=this.pswp.element)===null||e===void 0||e.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){let{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var e;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),(e=t.currSlide)===null||e===void 0||e.applyCurrentZoomPan()}}_animateToOpenState(){let{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){let{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;let{pswp:e}=this,{innerRect:i}=this._thumbBounds,{currSlide:s,viewportSize:n}=e;if(this._croppedZoom&&i&&this._cropContainer1&&this._cropContainer2){let a=-n.x+(this._thumbBounds.x-i.x)+i.w,r=-n.y+(this._thumbBounds.y-i.y)+i.h,l=n.x-i.w,h=n.y-i.h;t?(this._animateTo(this._cropContainer1,"transform",pt(a,r)),this._animateTo(this._cropContainer2,"transform",pt(l,h))):(K(this._cropContainer1,a,r),K(this._cropContainer2,l,h))}s&&(P(s.pan,i||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,e,i){if(!this._duration){t.style[e]=i;return}let{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[e]=i,s.startTransition(n)}},Ki={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},St=class extends re{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Wt,this.animations=new Qt,this.mainScroll=new Gt(this),this.gestures=new qt(this),this.opener=new le(this),this.keyboard=new jt(this),this.contentLoader=new ae(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Jt(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{let{itemHolders:e}=this.mainScroll;e[0]&&(e[0].el.style.display="block",this.setContent(e[0],this.currIndex-1)),e[2]&&(e[2].el.style.display="block",this.setContent(e[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){let e=this.getNumItems();return this.options.loop&&(t>e-1&&(t-=e),t<0&&(t+=e)),ut(t,0,e-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{var e;(e=t.slide)===null||e===void 0||e.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var e;(e=this.currSlide)===null||e===void 0||e.zoomTo(...t)}toggleZoom(){var t;(t=this.currSlide)===null||t===void 0||t.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),(t=this.element)===null||t===void 0||t.remove(),this.mainScroll.itemHolders.forEach(e=>{var i;(i=e.slide)===null||i===void 0||i.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((e,i)=>{var s,n;let a=((s=(n=this.currSlide)===null||n===void 0?void 0:n.index)!==null&&s!==void 0?s:0)-1+i;if(this.canLoop()&&(a=this.getLoopedIndex(a)),a===t&&(this.setContent(e,t,!0),i===1)){var r;this.currSlide=e.slide,(r=e.slide)===null||r===void 0||r.setIsActive(!0)}}),this.dispatch("change")}setContent(t,e,i){if(this.canLoop()&&(e=this.getLoopedIndex(e)),t.slide){if(t.slide.index===e&&!i)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(e<0||e>=this.getNumItems()))return;let s=this.getItemData(e);t.slide=new Ht(s,e,this),e===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;let e=$e(this.options,this);!t&&ct(e,this._prevViewportSize)||(P(this._prevViewportSize,e),this.dispatch("beforeResize"),P(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){if(!this.hasMouse){var t;this.hasMouse=!0,(t=this.element)===null||t===void 0||t.classList.add("pswp--has_mouse")}}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,e){this.offset.x=t,this.offset.y=e,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=O("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=O("pswp__bg","div",this.element),this.scrollWrap=O("pswp__scroll-wrap","section",this.element),this.container=O("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new ee(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return qi(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...Ki,...t}}};var Xi={captionContent:".pswp-caption-content",type:"auto",horizontalEdgeThreshold:20,mobileCaptionOverlapRatio:.3,mobileLayoutBreakpoint:600,verticallyCenterImage:!1},Ct=class{constructor(t,e){this.options={...Xi,...e},this.lightbox=t,this.lightbox.on("init",()=>{this.pswp=this.lightbox.pswp,this.initCaption()})}initCaption(){let{pswp:t}=this;t.on("change",()=>{this.showCaption(this.pswp.currSlide)}),t.on("calcSlideSize",e=>this.onCalcSlideSize(e)),t.on("slideDestroy",e=>{e.slide.dynamicCaption&&(e.slide.dynamicCaption.element&&e.slide.dynamicCaption.element.remove(),delete e.slide.dynamicCaption)}),t.on("zoomPanUpdate",({slide:e})=>{if(t.opener.isOpen&&e.dynamicCaption){if(e.currZoomLevel>e.zoomLevels.initial?this.hideCaption(e):this.showCaption(e),e.dynamicCaption.element){let i=0;if(e.currZoomLevel<=e.zoomLevels.initial){let s=e.pan.y-e.bounds.center.y;Math.abs(s)>1&&(i=s)}this.setCaptionYOffset(e.dynamicCaption.element,i)}this.adjustPanArea(e,e.currZoomLevel)}}),t.on("beforeZoomTo",e=>{this.adjustPanArea(t.currSlide,e.destZoomLevel)}),t.on("tapAction",e=>{e.originalEvent.target.closest(".pswp__dynamic-caption")&&e.preventDefault()})}adjustPanArea(t,e){t.dynamicCaption&&t.dynamicCaption.adjustedPanAreaSize&&(e>t.zoomLevels.initial?(t.panAreaSize.x=t.dynamicCaption.originalPanAreaSize.x,t.panAreaSize.y=t.dynamicCaption.originalPanAreaSize.y):(t.panAreaSize.x=t.dynamicCaption.adjustedPanAreaSize.x,t.panAreaSize.y=t.dynamicCaption.adjustedPanAreaSize.y))}useMobileLayout(){let{mobileLayoutBreakpoint:t}=this.options;return typeof t=="function"?t.call(this):typeof t=="number"&&window.innerWidth<t}hideCaption(t){if(t.dynamicCaption&&!t.dynamicCaption.hidden){let e=t.dynamicCaption.element;if(!e)return;t.dynamicCaption.hidden=!0,e.classList.add("pswp__dynamic-caption--faded"),t.captionFadeTimeout&&clearTimeout(t.captionFadeTimeout),t.captionFadeTimeout=setTimeout(()=>{e.style.visibility="hidden",delete t.captionFadeTimeout},400)}}setCaptionYOffset(t,e){t.style.transform=`translateY(${e}px)`}showCaption(t){if(t.dynamicCaption&&t.dynamicCaption.hidden){let e=t.dynamicCaption.element;if(!e)return;t.dynamicCaption.hidden=!1,e.style.visibility="visible",clearTimeout(t.captionFadeTimeout),t.captionFadeTimeout=setTimeout(()=>{e.classList.remove("pswp__dynamic-caption--faded"),delete t.captionFadeTimeout},50)}}setCaptionPosition(t,e,i){let s=e<=this.options.horizontalEdgeThreshold;t.classList[s?"add":"remove"]("pswp__dynamic-caption--on-hor-edge"),t.style.left=e+"px",t.style.top=i+"px"}setCaptionWidth(t,e){e?t.style.width=e+"px":t.style.removeProperty("width")}setCaptionType(t,e){let i=t.dataset.pswpCaptionType;e!==i&&(t.classList.add("pswp__dynamic-caption--"+e),t.classList.remove("pswp__dynamic-caption--"+i),t.dataset.pswpCaptionType=e)}updateCaptionPosition(t){if(!t.dynamicCaption||!t.dynamicCaption.type||!t.dynamicCaption.element)return;if(t.dynamicCaption.type==="mobile")return this.setCaptionType(t.dynamicCaption.element,t.dynamicCaption.type),t.dynamicCaption.element.style.removeProperty("left"),t.dynamicCaption.element.style.removeProperty("top"),void this.setCaptionWidth(t.dynamicCaption.element,!1);let e=t.zoomLevels.initial,i=Math.ceil(t.width*e),s=Math.ceil(t.height*e);this.setCaptionType(t.dynamicCaption.element,t.dynamicCaption.type),t.dynamicCaption.type==="aside"?(this.setCaptionPosition(t.dynamicCaption.element,t.bounds.center.x+i,t.bounds.center.y),this.setCaptionWidth(t.dynamicCaption.element,!1)):t.dynamicCaption.type==="below"&&(this.setCaptionPosition(t.dynamicCaption.element,t.bounds.center.x,t.bounds.center.y+s),this.setCaptionWidth(t.dynamicCaption.element,i))}onCalcSlideSize(t){let{slide:e}=t,i,s;if(!e.dynamicCaption){e.dynamicCaption={element:void 0,type:!1,hidden:!1};let r=this.getCaptionHTML(e);if(!r)return;e.dynamicCaption.element=document.createElement("div"),e.dynamicCaption.element.className="pswp__dynamic-caption pswp__hide-on-close",e.dynamicCaption.element.innerHTML=r,this.pswp.dispatch("dynamicCaptionUpdateHTML",{captionElement:e.dynamicCaption.element,slide:e}),e.holderElement.appendChild(e.dynamicCaption.element)}if(!e.dynamicCaption.element)return;this.storeOriginalPanAreaSize(e),e.bounds.update(e.zoomLevels.initial),this.useMobileLayout()?(e.dynamicCaption.type="mobile",s=!0):this.options.type==="auto"?e.bounds.center.x>e.bounds.center.y?e.dynamicCaption.type="aside":e.dynamicCaption.type="below":e.dynamicCaption.type=this.options.type;let n=Math.ceil(e.width*e.zoomLevels.initial),a=Math.ceil(e.height*e.zoomLevels.initial);if(this.setCaptionType(e.dynamicCaption.element,e.dynamicCaption.type),e.dynamicCaption.type==="aside"){this.setCaptionWidth(e.dynamicCaption.element,!1),i=this.measureCaptionSize(e.dynamicCaption.element,t.slide);let r=i.x,l=n+e.bounds.center.x;e.panAreaSize.x-l<=r&&(e.panAreaSize.x-=r,this.recalculateZoomLevelAndBounds(e))}else if(e.dynamicCaption.type==="below"||s){this.setCaptionWidth(e.dynamicCaption.element,s?this.pswp.viewportSize.x:n),i=this.measureCaptionSize(e.dynamicCaption.element,t.slide);let r=i.y;if(this.options.verticallyCenterImage)e.panAreaSize.y-=r,this.recalculateZoomLevelAndBounds(e);else{let l=a+e.bounds.center.y,h=e.panAreaSize.y-l,u=e.panAreaSize.y;if(h<=r){e.panAreaSize.y-=Math.min(2*(r-h),r),this.recalculateZoomLevelAndBounds(e);let m=e.panAreaSize.x*this.options.mobileCaptionOverlapRatio/2;s&&e.bounds.center.x>m&&(e.panAreaSize.y=u,this.recalculateZoomLevelAndBounds(e))}}}this.storeAdjustedPanAreaSize(e),this.updateCaptionPosition(e)}measureCaptionSize(t,e){let i=t.getBoundingClientRect();return this.pswp.dispatch("dynamicCaptionMeasureSize",{captionEl:t,slide:e,captionSize:{x:i.width,y:i.height}}).captionSize}recalculateZoomLevelAndBounds(t){t.zoomLevels.update(t.width,t.height,t.panAreaSize),t.bounds.update(t.zoomLevels.initial)}storeAdjustedPanAreaSize(t){t.dynamicCaption&&(t.dynamicCaption.adjustedPanAreaSize||(t.dynamicCaption.adjustedPanAreaSize={}),t.dynamicCaption.adjustedPanAreaSize.x=t.panAreaSize.x,t.dynamicCaption.adjustedPanAreaSize.y=t.panAreaSize.y)}storeOriginalPanAreaSize(t){t.dynamicCaption&&(t.dynamicCaption.originalPanAreaSize||(t.dynamicCaption.originalPanAreaSize={}),t.dynamicCaption.originalPanAreaSize.x=t.panAreaSize.x,t.dynamicCaption.originalPanAreaSize.y=t.panAreaSize.y)}getCaptionHTML(t){if(typeof this.options.captionContent=="function")return this.options.captionContent.call(this,t);let e=t.data.element,i="";if(e){let s=e.querySelector(this.options.captionContent);if(s)i=s.innerHTML;else{let n=e.querySelector("img");n&&(i=n.getAttribute("alt"))}}return i}};var bt=document.getElementById("gallery");if(bt){let o=new _t({gallery:bt,children:".gallery-item",showHideAnimationType:"zoom",bgOpacity:1,pswpModule:St,imageClickAction:"close",closeTitle:be,zoomTitle:xe,arrowPrevTitle:Ce,arrowNextTitle:Se,errorMsg:Ae});if(ze&&o.on("uiRegister",()=>{o.pswp.ui.registerElement({name:"download-button",order:8,isButton:!0,tagName:"a",html:{isCustomSVG:!0,inner:'<path d="M20.5 14.3 17.1 18V10h-2.2v7.9l-3.4-3.6L10 16l6 6.1 6-6.1ZM23 23H9v2h14Z" id="pswp__icn-download"/>',outlineID:"pswp__icn-download"},onInit:(t,e)=>{t.setAttribute("download",""),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"),t.setAttribute("title",Pe||"Download"),e.on("change",()=>{t.href=e.currSlide.data.element.href})}})}),o.on("change",()=>{let t=o.pswp.currSlide?.data?.element?.dataset.pswpTarget;history.replaceState("",document.title,"#"+t)}),o.on("close",()=>{history.replaceState("",document.title,window.location.pathname)}),new Ct(o,{mobileLayoutBreakpoint:700,type:"auto",mobileCaptionOverlapRatio:1}),o.init(),window.location.hash.substring(1).length>1){let t=window.location.hash.substring(1),e=bt.querySelectorAll("a");for(let i=0;i<e.length;i++)if(e[i].dataset.pswpTarget===t){o.loadAndOpen(i,{gallery:bt});break}}}})();
/*!
* Original work Copyright 2019 SmugMug, Inc.
* Modified work Copyright 2025 Nico Kaiser
* Licensed under the terms of the MIT license.
*/
/*!
* PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
* (c) 2024 Dmytro Semenov
*/
/*!
* PhotoSwipe 5.4.4 - https://photoswipe.com
* (c) 2024 Dmytro Semenov
*/
/*!
* PhotoSwipe Dynamic Caption plugin 1.2.7 - https://photoswipe.com
* (c) 2022 Dmytro Semenov
*/