!function(){"use strict";function t(){return globalThis||self||window||global}function e(t,e){let i=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n],i++,t)}function i(t,e){if(t&&t instanceof Element&&e&&"string"==typeof e)return t.classList.contains(e);throw new Error("Element and/or ClassName arguments are not correct.")}function n(t,e,i){if(i=i||!1,t&&t instanceof Element&&e&&"string"==typeof e)return i?new Promise((function(i){window.requestAnimationFrame((function(){t.classList.add(e),i(t.classList)}))})):(t.classList.add(e),t.classList);throw new Error("Element and/or ClassName arguments are not correct.")}function s(t,e,i){if(i=i||!1,t&&t instanceof Element&&e&&"string"==typeof e)return i?new Promise((function(i){window.requestAnimationFrame((function(){t.classList.remove(e),i(t.classList)}))})):(t.classList.remove(e),t.classList);throw new Error("Element and/or ClassName arguments are not correct.")}function o(t,e,i){return e&&"string"==typeof e?void 0!==i?t.setAttribute(e,i):t.getAttribute(e):t.attributes}function r(t,e,i){return e&&"string"==typeof e?void 0!==i?(t.dataset[e]=i,t.dataset[e]):t.dataset[e]:t.dataset}function a(...t){const{length:i}=t;if(t=t.filter((t=>!!t)),0===i)return document.createElement("div");if(1!==i){const e=document.createElement("div");for(let n=0;n1?n[i[0]](...e):n[t](...e)})),n}const c={expires(){const t=new Date;return t.setTime(t.getTime()+31557081599.999996),t.toGMTString()},get:t=>new Map(decodeURIComponent(document.cookie).split(/;/u).map((t=>t.trim().split(/[=]/u)))).get(t),has:t=>new Map(decodeURIComponent(document.cookie).split(/;/u).map((t=>t.trim().split(/[=]/u)))).has(t),set(t,e,i={}){const{expiration:n=this.expires(),sameSite:s="Strict",path:o="/"}=i,r=[`${t}=${encodeURIComponent(e)}`];r.push(`expires=${n}`),r.push(`path=${o}`),r.push(`SameSite=${s};Secure`),document.cookie=r.join(";")},delete(t){document.cookie=`${t}=;expires=0;`}};class h{constructor(){}static register(){const e=t();return void 0===e.WaitRegister&&(e.WaitRegister={interactive:[],complete:[],DOMContentLoaded:[],load:[]},document.addEventListener("readystatechange",(()=>h.all(document.readyState))),document.addEventListener("DOMContentLoaded",(()=>h.all("DOMContentLoaded"))),window.addEventListener("load",(()=>h.all("load")))),e.WaitRegister}static set(t,e){const{resolve:i,reject:n,func:s,args:o}=e,r=h.register();let a=!1;const{readyState:c}=document;switch(t){case"interactive":case"DOMContentLoaded":if("loading"!==c){a=!0;try{i(s(...o))}catch(t){n(t)}}break;case"complete":case"load":if("complete"===c){a=!0;try{i(s(...o))}catch(t){n(t)}}}!1===a&&r[t].push((function(){return new Promise((function(t,e){try{return t(i(s(...o)))}catch(t){e(n(t))}}))}))}static all(t){return Promise.all(h.register()[t].map((t=>t())))}static time(t){return new Promise((e=>setTimeout(e,t)))}static delay(t,e,...i){return setTimeout(t,e||0,...i)}static async(t,...e){return new Promise((function(i,n){try{i(t(...e))}catch(t){n(t)}}))}static promiseDelay(t,e,...i){return new Promise((function(n,s){return setTimeout((function(...e){try{return n(t(...e))}catch(t){return s(t)}}),e,...i)}))}static interactive(t,...e){return new Promise((function(i,n){h.set("interactive",{resolve:i,reject:n,func:t,args:e})}))}static complete(t,...e){return new Promise((function(i,n){h.set("complete",{resolve:i,reject:n,func:t,args:e})}))}static DOMContentLoaded(t,...e){return new Promise((function(i,n){h.set("DOMContentLoaded",{resolve:i,reject:n,func:t,args:e})}))}static ready(t,...e){return new Promise((function(i,n){h.set("complete",{resolve:i,reject:n,func:t,args:e})}))}static load(t,...e){return new Promise((function(i,n){h.set("complete",{resolve:i,reject:n,func:t,args:e})}))}}const u={linearTween:function(t,e,i,n){return i*t/n+e},easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:function(t,e,i,n){return t/=n,i*(--t*t*t+1)+e},easeInOutCubic:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,i,n){return t/=n,-i*(--t*t*t*t-1)+e},easeInOutQuart:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,i,n){return t/=n,i*(--t*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,i,n){return i*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,i,n){return i*(1-Math.pow(2,-10*t/n))+e},easeInOutExpo:function(t,e,i,n){return(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:(t--,i/2*(2-Math.pow(2,-10*t))+e)},easeInCirc:function(t,e,i,n){return t/=n,-i*(Math.sqrt(1-t*t)-1)+e},easeOutCirc:function(t,e,i,n){return t/=n,t--,i*Math.sqrt(1-t*t)+e},easeInOutCirc:function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,i/2*(Math.sqrt(1-t*t)+1)+e)}};function l(t,e,i=1e3){t.preventDefault(),t.stopPropagation();const{easeInOutCubic:n}=u,s=document.querySelector(e);if(!(s instanceof HTMLElement))return;const o=window.pageYOffset,r=o+s.getBoundingClientRect().top-o;let a=0;window.requestAnimationFrame((function t(e){a=a||e;const s=e-a,c=n(s,o,r,i);window.scrollTo(0,c),st(i,...e)))},v=function(t){return document.getElementById(t)},I=function(t,e=document){return e.getElementsByClassName(t)},y=function(t){t.preventDefault(),t.stopPropagation()};class C{constructor(){this.actions=[],this.cache=Object.create(null)}has(t){return t in this.cache}set(t,e,i=!1){if(i||!this.has(t))return this.cache[t]=e;throw new Error(`"${t}" has already been saved in environment.`)}get(t){if(!this.has(t))throw new Error(`"${t}" did not have been saved in environment yet.`);return this.cache[t]}byId(t){return this.has(t)?this.cache[t]:this.set(t,v(t),!0)}byClass(t,e=document){return this.has(t)?this.cache[t]:this.set(t,I(t,e))}assert(t,e){if(this.has(t))try{return m(e)?this.get(t)===e:m(this.get(t))}catch(t){return w(t)}return!1}push(...t){for(const e of t)f(e)?this.actions.push(e):w(`func:${e} is not a function.`)}async run(){try{return Promise.all(this.actions.map(h.interactive))}catch(t){return w(t)}}}const x=new C,k=function(t){return i(t,"toggled")},E=function(t){return function(t,e,o){if(o=o||!1,t&&t instanceof Element&&e&&"string"==typeof e)return i(t,e)?s(t,e,o):n(t,e,o);throw new Error("Element and/or ClassName arguments are not correct.")}(t,"toggled")},S=function(t,e=x){const{bottom:i}=e.get("first-header").getClientRects()[0],{top:n}=t.getClientRects()[0];return i>n},P=function(t){if(t instanceof HTMLAnchorElement){const e=o(t,"rel")||"";e.includes("noopener")||o(t,"rel",g(e)?`${e} noopener`:"noopener")}};class T{static get cookie(){return c.get("color-scheme")}static set cookie(t){c.set("color-scheme",t)}static get cookieState(){const t=T.cookie;return g(t)?t:null}static isCookieSet(){return c.has("color-scheme")}static deleteCookie(){return c.delete("color-scheme"),!1===c.has("color-scheme")}static get autoState(){return i(document.body,"color-scheme-auto")}static get classState(){return i(document.body,"color-scheme-light")?"light":i(document.body,"color-scheme-dark")?"dark":null}static get userState(){return x instanceof C?x.assert("csh-sel"):is(byId("color-scheme-selector"))}static get browserState(){try{const t=window.matchMedia("(prefers-color-scheme: light)");return"not all"!==t.matches&&(t.matches?"light":"dark")}catch(t){return w(t)}}static get state(){const{classState:t,userState:e,cookieState:i,browserState:n}=T;if(g(t)){if(e){if(g(i))return i}else T.deleteCookie()||w("color-scheme cookie did not have been deleted.");return t}if(e){if(g(i))return i}else T.deleteCookie()||w("color-scheme cookie did not have been deleted.");return g(n)?n:"light"}static get coherenceCondition(){return i(document.body,"color-scheme-light")&&i(document.body,"has-post-thumbnail")}static get scheme(){return x.get("colorScheme").scheme}static set scheme(t){x.get("colorScheme").scheme=t}static getOppositeState(t){return g(t)?"light"===t?"dark":"light":null}static detect(){const e=new T;return t().colorScheme=e,e.scheme}static toLightScheme(t){i(t,"color-scheme-dark")&&(s(t,"color-scheme-dark",!0),n(t,"color-scheme-light",!0))}static toDarkScheme(t){i(t,"color-scheme-light")&&(s(t,"color-scheme-light",!0),n(t,"color-scheme-dark",!0))}static change(t,e){const{body:i}=document;switch(t){case"dark":s(i,"color-scheme-light",!0),n(i,"color-scheme-dark",!0);break;case"light":s(i,"color-scheme-dark",!0),n(i,"color-scheme-light",!0);break;case"auto":{const t=T.browserState||T.classState||"light";s(i,`color-scheme-${T.getOppositeState(t)}`,!0),n(i,`color-scheme-${t}`,!0);break}default:return w("scheme is not defined.")}return x.assert("colorScheme")&&(T.scheme=t),e&&(T.cookie=t),t}static init(){const t=g(T.browserState),e=window.matchMedia("(prefers-color-scheme: light)");return t&&e.addListener((()=>{const{autoState:t,classState:e,userState:i,cookieState:n,browserState:s}=T;(i&&g(n)&&"auto"===n||!(g(e)&&!t||i))&&T.change(s,!1)})),T.change(T.state,!1)}static changeHeaderScheme(){const t=x.byId("site-header"),e=x.get("pro-bar"),i=x.assert("pro-bar");T.coherenceCondition&&(!function(t=x){return t.assert("nav-toggle")&&k(t.get("nav-toggle"))||t.assert("sea-toggle")&&k(t.get("sea-toggle"))}()?(S(t)?T.toDarkScheme(t):T.toLightScheme(t),i&&(S(e)?T.toDarkScheme(e):T.toLightScheme(e))):(T.toLightScheme(t),i&&T.toLightScheme(e)))}constructor(){this.scheme=T.init()}}class O{constructor(t,e){this.Pr={na:e||"lightbox",bo:document.body,te:null,Cu:{ir:null,gr:null,th:null,im:{},is:[]},An:{el:null,in:null,ch:[],ti:null},Co:{nb:null,pb:null},Re:{mh:null,mw:null,nh:null,nw:null},St:{op:!1}},this.Pr.te=a({id:this.in("content-wrapper"),class:[this.cn("content-wrapper")]}),this.Pu={op:t||{},bo:null,wr:null,th:[]},Object.preventExtensions(this.Pr),Object.preventExtensions(this.Pu)}get name(){return this.Pr.na}get body(){return this.Pr.bo}get template(){return this.Pr.te}get currImgRatio(){return this.Pr.Cu.ir}set currImgRatio(t){this.Pr.Cu.ir=t}get currGroup(){return this.Pr.Cu.gr}set currGroup(t){this.Pr.Cu.gr=t}get currThumbnail(){return this.Pr.Cu.th}set currThumbnail(t){this.Pr.Cu.th=t}get currImage(){return this.Pr.Cu.im}set currImage(t){this.Pr.Cu.im=t}get currImages(){return this.Pr.Cu.is}set currImages(t){this.Pr.Cu.is=t}get animElement(){return this.Pr.An.el}set animElement(t){this.Pr.An.el=t}get animInterval(){return this.Pr.An.in}set animInterval(t){this.Pr.An.in=t}get animChildren(){return this.Pr.An.ch}get animTimeout(){return this.Pr.An.ti}set animTimeout(t){this.Pr.An.ti=t}get nextButton(){return this.Pr.Co.nb}set nextButton(t){this.Pr.Co.nb=t}get prevButton(){return this.Pr.Co.pb}set prevButton(t){this.Pr.Co.pb=t}get maxHeight(){return this.Pr.Re.mh}set maxHeight(t){this.Pr.Re.mh=t}get maxWidth(){return this.Pr.Re.mw}set maxWidth(t){this.Pr.Re.mw=t}get newImageHeight(){return this.Pr.Re.nh}set newImageHeight(t){this.Pr.Re.nh=t}get newImageWidth(){return this.Pr.Re.nw}set newImageWidth(t){this.Pr.Re.nw=t}get isOpen(){return this.Pr.St.op}set isOpen(t){this.Pr.St.op=t}get options(){return this.Pu.op}set options(t){this.Pu.op=t}get box(){return this.Pu.bo}set box(t){this.Pu.bo=t}get wrapper(){return this.Pu.wr}set wrapper(t){this.Pu.wr=t}get thumbnails(){return this.Pu.th}get height(){return window.innerHeight}get width(){return window.innerWidth}in(t){return`${this.name}${g(t)?`-${t}`:""}`}cn(t){return`${this.name}${g(t)?`-${t}`:""}`}dn(t){return`data-${this.cn(t)}`}push(...t){for(const e of t)e.addEventListener("click",(t=>{y(t),this.currGroup=o(e,this.dn("group"))||!1,this.currThumbnail=e,this.open(e,!1,!1,!1)}));this.thumbnails.push(...t)}getByGroup(t){return[...this.thumbnails.filter((e=>o(e,this.dn("group"))===t))]}getPosition(t,e){const i=this.getByGroup(e);for(let e=0,n=i.length;e0){c.forEach(((t,e)=>{for(const i of t.querySelectorAll(r)){const t=i.getElementsByTagName("a")[0]||i.getElementsByTagName("img")[0];if("A"===t.tagName){if(/\.(?:jpg|gif|png)$/u.test(t.href)){o(t,this.dn(),t.href),o(t,this.dn("group"),e);const n=i.querySelector(a);m(n)&&o(t,this.dn("caption"),n.innerText)}}else{o(t,this.dn(),t.src),o(t,this.dn("group"),e);const n=i.querySelector(a);m(n)&&o(t,this.dn("caption"),n.innerText)}}})),this.load();for(const t of c)for(const e of t.querySelectorAll(r)){const t=e.querySelector(a);m(t)&&t.addEventListener("click",(t=>{y(t),e.querySelector("a, img").dispatchEvent(new Event("click"))}))}}}preload(){const{currGroup:t,currImages:e,currThumbnail:i}=this;if(!t)return!1;const n=new Image,s=new Image,r=this.getPosition(i,t);r===e.length-1?(n.src=o(e[e.length-1],this.dn())||e[e.length-1].src,s.src=o(e[0],this.dn())||e[0].src):0===r?(n.src=o(e[e.length-1],this.dn())||e[e.length-1].src,s.src=o(e[1],this.dn())||e[1].src):(n.src=o(e[r-1],this.dn())||e[r-1].src,s.src=o(e[r+1],this.dn())||e[r+1].src)}startAnimation(){const{options:{loadingAnimation:t}}=this;this.stopAnimation(),this.animTimeout=setTimeout((()=>{if(n(this.box,this.cn("loading")),d(t)){let e=0;this.animInterval=setInterval((()=>{n(this.animChildren[e],this.cn("active")),setTimeout((()=>{s(this.animChildren[e],this.cn("active"))}),t),e=e>=this.animChildren.length?0:++e}),t)}}),500)}stopAnimation(){const{options:{loadingAnimation:t}}=this;if(s(this.box,this.cn("loading")),!p(t)&&t){clearInterval(this.animInterval);for(const t of this.animChildren)s(t,this.cn("active"))}}initializeControls(){if(!this.nextButton){const t=this.options.nextImage;this.nextButton=a({$:"span",class:[this.cn("next"),...t?[]:[this.cn("no-img")]],_:[...t?[{$:"img",attr:{src:this.options.nextImage}}]:[]],events:[["click",t=>{y(t),this.next()}]]}),this.box.appendChild(this.nextButton)}if(n(this.nextButton,this.cn("active")),!this.prevButton){const t=this.options.prevImage;this.prevButton=a({$:"span",class:[this.cn("prev"),...t?[]:[this.cn("no-img")]],_:[...t?[{$:"img",attr:{src:this.options.prevImage}}]:[]],events:[["click",t=>{y(t),this.prev()}]]}),this.box.appendChild(this.prevButton)}n(this.prevButton,this.cn("active"))}repositionControls(){if(this.options.responsive&&this.nextButton&&this.prevButton){const t=this.height/2-this.nextButton.offsetHeight/2;this.nextButton.style.top=`${t}px`,this.prevButton.style.top=`${t}px`}}setOptions(t={}){const e=function(t,e){return function(t){return"boolean"==typeof t}(t)?t:e||!1},i=function(t,e){return p(t)?t:e||!1};this.options={boxId:t.boxId||!1,controls:e(t.controls,!0),dimensions:e(t.dimensions,!0),captions:e(t.captions,!0),prevImage:i(t.prevImage,!1),nextImage:i(t.nextImage,!1),hideCloseButton:t.hideCloseButton||!1,closeOnClick:e(t.closeOnClick,!0),nextOnClick:e(t.nextOnClick,!0),loadingAnimation:!m(t.loadingAnimation)||t.loadingAnimation,animationElementCount:t.animationElementCount||4,preload:e(t.preload,!0),carousel:e(t.carousel,!0),animation:d(t.animation)||!1===t.animation?t.animation:400,responsive:e(t.responsive,!0),maxImageSize:t.maxImageSize||.8,keyControls:e(t.keyControls,!0),hideOverflow:t.hideOverflow||!0,onopen:t.onopen||!1,onclose:t.onclose||!1,onload:t.onload||!1,onresize:t.onresize||!1,onloaderror:t.onloaderror||!1,onimageclick:!!f(t.onimageclick)&&t.onimageclick};let{boxId:s,controls:o,dimensions:r,captions:c,prevImage:h,nextImage:u,hideCloseButton:l,closeOnClick:g,nextOnClick:w,loadingAnimation:b,animationElementCount:I,preload:C,carousel:x,animation:k,responsive:E,maxImageSize:S,keyControls:P,hideOverflow:T,onopen:O,onclose:L,onload:B,onresize:H,onloaderror:M,onimageclick:A}=this.options;if(s)this.box=v(this.options.boxId),n(this.box,this.cn());else if(!this.box){const t=v(this.in())||a({id:this.in()});n(t,this.cn()),this.box=t,this.body.appendChild(this.box)}if(this.box.appendChild(this.template),this.wrapper=v(this.in("content-wrapper")),l||this.box.appendChild(a({$:"span",id:this.in("close"),class:[this.cn("close")],_:["✗"],events:[["click",t=>{y(t),this.close()}]]})),g&&this.box.addEventListener("click",(t=>{y(t),this.close()})),p(b))this.animElement=new Image,this.animElement.src=b,n(this.animElement,this.cn("loading-animation")),this.box.appendChild(this.animElement);else if(b){b=d(b)?b:200,this.animElement=a({class:[this.cn("loading-animation")]});for(let t=0;t{this.resize(),this.isOpen&&this.options.env})),P&&document.addEventListener("keydown",(t=>{this.isOpen&&(y(t),{27:()=>this.close(),37:()=>this.prev(),39:()=>this.next()}[t.keyCode]())}))}open(t,e,s,r){if(t&&e&&(e=!1),!t&&!e)return!1;let c;this.currGroup=e||this.currGroup||o(t,this.dn("group")),this.currGroup&&(this.currImages=this.getByGroup(this.currGroup),!1===t&&(t=this.currImages[0])),this.currImage.img=new Image,this.currThumbnail=t,p(t)?c=t:o(t,this.dn())?c=o(t,this.dn()):({src:c}=t),this.currImgRatio=!1,this.isOpen||(d(this.options.animation)&&(n(this.currImage.img,this.cn("animate-transition")),n(this.currImage.img,this.cn("animate-init"))),this.isOpen=!0,this.options.onopen&&this.options.onopen(this.currImage)),this.options&&m(this.options.hideOverflow)&&!this.options.hideOverflow||this.body,this.box.style.paddingTop="0",this.wrapper.innerHTML="",this.wrapper.appendChild(this.currImage.img),this.options.animation&&n(this.wrapper,this.cn("animate"));const h=o(t,this.dn("caption"));h&&this.options.captions&&this.wrapper.appendChild(a({$:"p",class:[this.cn("caption")],_:[h]})),n(this.box,this.cn("active")),this.options.controls&&this.currImages.length>1&&(this.initializeControls(),this.repositionControls()),this.currImage.img.addEventListener("error",(t=>{this.options.onloaderror&&(t._happenedWhile=r||!1,this.options.onloaderror(t))})),this.currImage.img.addEventListener("load",(t=>{const{target:e}=t;this.currImage.originalWidth=e.naturalWidth||e.width,this.currImage.originalHeight=e.naturalHeight||e.height;const o=setInterval((()=>{i(this.box,this.cn("active"))&&(n(this.wrapper,this.cn("wrapper-active")),d(this.options.animation)&&n(this.currImage.img,this.cn("animate-transition")),s&&s(),this.stopAnimation(),clearTimeout(this.animTimeout),this.options.preload&&this.preload(),this.options.nextOnClick&&(n(this.currImage.img,this.cn("next-on-click")),this.currImage.img.addEventListener("click",(t=>{y(t),this.next()}))),this.options.onimageclick&&this.currImage.img.addEventListener("click",(t=>{y(t),this.options.onimageclick(this.currImage)})),this.options.onload&&this.options.onload(r),clearInterval(o),this.resize())}),10)})),this.currImage.img.src=c,this.startAnimation()}load(t=this.options){this.setOptions(t),this.push(...[...document.querySelectorAll(`[${this.dn()}]`)].map(((t,e)=>(o(t,this.dn())&&o(t,this.dn("index"),e),t))))}resize(){if(!this.currImage.img)return;this.maxWidth=this.width,this.maxHeight=this.height;const t=this.box.offsetWidth,e=this.box.offsetHeight;!this.currImgRatio&&this.currImage.img&&this.currImage.img.offsetWidth&&this.currImage.img.offsetHeight&&(this.currImgRatio=this.currImage.img.offsetWidth/this.currImage.img.offsetHeight),Math.floor(t/this.currImgRatio)>e?(this.newImageWidth=e*this.currImgRatio,this.newImageHeight=e):(this.newImageHeight=t,this.newImageWidth=t/this.currImgRatio),this.newImageWidth=Math.floor(this.newImageWidth*this.options.maxImageSize),this.newImageHeight=Math.floor(this.newImageHeight*this.options.maxImageSize),(this.options.dimensions&&this.newImageHeight>this.currImage.originalHeight||this.options.dimensions&&this.newImageWidth>this.currImage.originalWidth)&&(this.newImageHeight=this.currImage.originalHeight,this.newImageWidth=this.currImage.originalWidth),o(this.currImage.img,"width",this.newImageWidth),o(this.currImage.img,"height",this.newImageHeight),setTimeout((()=>{this.repositionControls()}),200),this.options.onresize&&this.options.onresize(this.currImage)}next(){if(!this.currGroup)return;const t=this.getPosition(this.currThumbnail,this.currGroup)+1;if(this.currImages[t])this.currThumbnail=this.currImages[t];else{if(!this.options.carousel)return;this.currThumbnail=this.currImages[0]}d(this.options.animation)?(s(this.currImage.img,this.cn("animating-next")),setTimeout((()=>{this.open(this.currThumbnail,!1,(()=>{setTimeout((()=>{n(this.currImage.img,this.cn("animating-next"))}),this.options.animation/2)}),"next")}),this.options.animation/2)):this.open(this.currThumbnail,!1,!1,"next")}prev(){if(!this.currGroup)return;const t=this.getPosition(this.currThumbnail,this.currGroup)-1;if(this.currImages[t])this.currThumbnail=this.currImages[t];else{if(!this.options.carousel)return;this.currThumbnail=this.currImages[this.currImages.length-1]}d(this.options.animation)?(s(this.currImage.img,this.cn("animating-next")),setTimeout((()=>{this.open(this.currThumbnail,!1,(()=>{setTimeout((()=>{n(this.currImage.img,this.cn("animating-next"))}),this.options.animation/2)}),"prev")}),this.options.animation/2)):this.open(this.currThumbnail,!1,!1,"prev")}close(){this.currGroup=null,this.currThumbnail=null;const t=this.currImage;for(this.currImage={};this.currImages.length;)this.currImages.pop();this.isOpen=!1,s(this.box,this.cn("active")),s(this.wrapper,this.cn("wrapper-active")),s(this.nextButton,this.cn("active")),s(this.prevButton,this.cn("active")),this.box.style.paddingTop="0px",this.stopAnimation(),this.options&&m(this.options.hideCloseButton)&&!this.options.hideOverflow||this.body,this.options.onclose&&this.options.onclose(t)}}x.set("global",t()),x.set("site-header",v("site-header")),x.set("site-loop",v("site-loop")),x.set("first-header",I("post-header")[0]),x.set("nav-toggle",v("navigation-toggle")),x.set("sea-toggle",v("search-toggle")),x.set("sea-input",v("search-input-0")),x.set("pro-bar",v("site-progress-bar")),x.set("csh-sel",v("color-scheme-selector")),x.set("csh-light",v("light-scheme-option")),x.set("csh-dark",v("dark-scheme-option")),x.set("csh-auto",v("auto-scheme-option"));try{f(aemi_color_scheme)&&x.push(aemi_color_scheme)}catch(t){x.push((()=>{const t=T.detect();let e=!1;e=x instanceof C?x.assert("csh-sel"):g(v("color-scheme-selector")),e&&(x.get(`csh-${t}`).checked=!0,x.get("csh-sel").addEventListener("input",(async()=>{x.get("csh-light").checked?T.change("light",!0):x.get("csh-dark").checked?T.change("dark",!0):x.get("csh-auto").checked&&T.change("auto",!0)})))}))}try{f(aemi_menu)&&x.push(aemi_menu)}catch(t){x.push((()=>{for(const t of I("menu"))if(!["header-menu","header-social","footer-menu"].includes(t.id))for(const e of I("menu-item-has-children",t))e.getElementsByTagName("li").length>0&&e.insertBefore(a({class:["toggle"],_:[{class:["toggle-element"]}]}),e.childNodes[1])}))}try{f(aemi_loop)&&x.push(aemi_loop)}catch(t){x.push((()=>{if(x.assert("site-loop")){const t=x.get("site-loop").getElementsByClassName("entry");for(const e of t){const t=e.getElementsByTagName("a")[0];m(t)&&(e.addEventListener("click",(()=>{t.click()})),e.addEventListener("mouseenter",(()=>{n(e,":hover")})),e.addEventListener("mouseleave",(()=>{s(e,":hover")})))}}}))}try{f(aemi_form_fix)&&x.push(aemi_form_fix)}catch(t){x.push((()=>{for(const t of document.getElementsByClassName("comment-form"))t.removeAttribute("novalidate")}))}try{f(aemi_toggle)&&x.push(aemi_toggle)}catch(t){x.push((()=>{for(const t of I("toggle"))t.addEventListener("click",(()=>{const e=r(t,"target");g(e)&&E(v(e)),E(t)}))}))}try{f(aemi_galleries)&&x.push(aemi_galleries)}catch(t){x.push((()=>new O({env:x}).prepare({wrapperSelectors:[".gallery",".blocks-gallery-grid",".wp-block-gallery",".justified-gallery"],itemSelectors:[".gallery-item",".blocks-gallery-item",".jg-entry"],captionSelectors:["figcaption",".gallery-caption"]})))}try{f(aemi_view_handler)&&x.push(aemi_view_handler)}catch(t){x.push((()=>{const t="page-scrolled",e="header-hidden";[{test:[x.assert("pro-bar")],func:()=>b((()=>{const t=document.body.clientHeight-window.innerHeight,e=window.scrollY/t;x.get("pro-bar").style.width=100*(e>1?1:e)+"vw"})),args:[]},{test:[],func:o=>b((r=>{const a={startTime:r,height:document.body.clientHeight,position:window.scrollY};setTimeout(((r,a)=>b(((r,a,c)=>{const{startTime:h,height:u,position:l}=c,m=window.scrollY,g=x.get("nav-toggle"),d=x.get("sea-toggle");if(l>0?n(a,t):s(a,t),o&&(!g||!k(g))&&(!d||!k(d))){const t=r-h;if(t>100){const o=m-l,r=Math.round(1e3*o/t);i(a,e)?(r<0&&l>0&&l+window.innerHeight=u)&&s(a,e):r>0&&l>0&&l+window.innerHeight{if(t.every((t=>!0===t)))for(const t of["scroll","resize"])window.addEventListener(t,(()=>e(...i)),{passive:!0})}))}))}try{f(aemi_mutation_observer)&&x.push(aemi_mutation_observer)}catch(t){x.push((()=>{const t=[x.get("nav-toggle"),x.get("sea-toggle")],e=new MutationObserver((function(e){for(const{target:i}of e){const e=t.filter((t=>t!==i));if(k(i))for(const t of e.filter((t=>k(t))))E(x.byId(r(t,"target"))),E(t);i===x.get("sea-toggle")&&x.assert("sea-input")&&h.promiseDelay((()=>{x.get("sea-input").focus()}),200),T.changeHeaderScheme()}}));e.observe(x.get("nav-toggle"),{attributes:!0,attributeFilter:["class"]}),e.observe(x.get("sea-toggle"),{attributes:!0,attributeFilter:["class"]});new MutationObserver((function(t){for(let e=0,{length:n}=t;e{for(const t of document.getElementsByTagName("a")){let e,i,n,s;try{e=new URL(t.href),({hash:i}=e),s=window.location.origin!==e.origin,n=!s&&window.location.pathname===e.pathname&&g(i)}catch(e){t.href.indexOf("#")>=0&&(i=t.href.split("?")[0],n=g(i))}s&&P(t),n&&t.addEventListener("click",(()=>{l(i)}))}}))}x.run()}();