Files
Journal-ghost/assets/built/main.min.js
2021-07-05 16:56:13 +08:00

2 lines
44 KiB
JavaScript

function lightbox(n,l,s,c,u){function o(e,t){var o,n,i,r,a=document.querySelectorAll(".pswp")[0];r=[],t.querySelectorAll(l).forEach(function(e){i=(n=e).querySelector(s),i={src:u?n.querySelector("img").getAttribute("src"):i.getAttribute("href"),w:0,h:0},c&&n.querySelector(c)&&(i.title=n.querySelector(c).innerHTML),r.push(i)}),(o=new PhotoSwipe(a,PhotoSwipeUI_Default,r,{arrowEl:!1,bgOpacity:.9,closeEl:!1,closeOnScroll:!1,fullscreenEl:!1,history:!1,index:e,shareEl:!1,showAnimationDuration:0,showHideOpacity:!0,zoomEl:!1})).listen("gettingData",function(e,t){var n;(t.w<1||t.h<1)&&((n=new Image).onload=function(){t.w=this.width,t.h=this.height,o.updateSize(!0)},n.src=t.src)}),o.init()}document.querySelectorAll(s).forEach(function(e){e.addEventListener("click",function(e){!function(e){e.preventDefault();var t=e.target.closest(n).querySelectorAll(l),t=Array.prototype.slice.call(t).indexOf(e.target.closest(l)),e=e.target.closest(n);o(t,e)}(e)})})}function pagination(t){var n,o,i,r,a,l,s,c,u=document.querySelector("link[rel=next]");function d(){if(404===this.status)return window.removeEventListener("scroll",m),window.removeEventListener("resize",f),void c.remove();this.response.querySelectorAll("article.gh-card").forEach(function(e){n.appendChild(document.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?u.href=e.href:(window.removeEventListener("scroll",m),window.removeEventListener("resize",f),c.remove()),s=document.documentElement.scrollHeight,r=i=!1}function e(){var e;r||(t&&a+l<=s-o?i=!1:(r=!0,(e=new window.XMLHttpRequest).responseType="document",e.addEventListener("load",d),e.open("GET",u.href),e.send(null)))}function p(){i||window.requestAnimationFrame(e),i=!0}function m(){a=window.scrollY,p()}function f(){l=window.innerHeight,s=document.documentElement.scrollHeight,p()}!u||(n=document.querySelector(".gh-feed"))&&(r=i=!(o=300),a=window.scrollY,l=window.innerHeight,s=document.documentElement.scrollHeight,c=document.querySelector(".gh-loadmore"),t?(window.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",f),p()):c.addEventListener("click",p))}!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(o,l){function e(e){if(D)return!0;e=e||window.event,S.timeToIdle&&S.mouseUsed&&!x&&Z();for(var t,n,o=(e.target||e.srcElement).getAttribute("class")||"",i=0;i<N.length;i++)(t=N[i]).onTap&&-1<o.indexOf("pswp__"+t.name)&&(t.onTap(),n=!0);n&&(e.stopPropagation&&e.stopPropagation(),D=!0,e=l.features.isOldAndroid?600:30,setTimeout(function(){D=!1},e))}function t(e,t,n){l[(n?"add":"remove")+"Class"](e,"pswp__"+t)}function n(){var e=1===S.getNumItemsFn();e!==E&&(t(m,"ui--one-slide",e),E=e)}function i(){t(y,"share-modal--hidden",F)}function r(){return(F=!F)?(l.removeClass(y,"pswp__share-modal--fade-in"),setTimeout(function(){F&&i()},300)):(i(),setTimeout(function(){F||l.addClass(y,"pswp__share-modal--fade-in")},30)),F||R(),0}function a(e){var t=(e=e||window.event).target||e.srcElement;return o.shout("shareLinkClick",e,t),!(!t.href||!t.hasAttribute("download")&&(window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),F||r(),1))}function s(e){for(var t=0;t<S.closeElClasses.length;t++)if(l.hasClass(e,"pswp__"+S.closeElClasses[t]))return!0}function c(e){(e=(e=e||window.event).relatedTarget||e.toElement)&&"HTML"!==e.nodeName||(clearTimeout(k),k=setTimeout(function(){A.setIdle(!0)},S.timeToIdleOutside))}function u(e){var t,n=e.vGap;!o.likelyTouchDevice||S.mouseUsed||screen.width>S.fitControlsWidth?(t=S.barsSize,S.captionEl&&"auto"===t.bottom?(h||((h=l.createEl("pswp__caption pswp__caption--fake")).appendChild(l.createEl("pswp__caption__center")),m.insertBefore(h,f),l.addClass(m,"pswp__ui--fit")),S.addCaptionHTMLFn(e,h,!0)?(e=h.clientHeight,n.bottom=parseInt(e,10)||44):n.bottom=t.top):n.bottom="auto"===t.bottom?0:t.bottom,n.top=t.top):n.top=n.bottom=0}function d(){function e(e){if(e)for(var t=e.length,n=0;n<t;n++){i=e[n],r=i.className;for(var o=0;o<N.length;o++)a=N[o],-1<r.indexOf("pswp__"+a.name)&&(S[a.option]?(l.removeClass(i,"pswp__element--disabled"),a.onInit&&a.onInit(i)):l.addClass(i,"pswp__element--disabled"))}}var i,r,a;e(m.children);var t=l.getChildByClass(m,"pswp__top-bar");t&&e(t.children)}var p,m,f,h,g,v,y,w,x,b,C,I,T,E,S,D,_,k,A=this,M=!1,O=!0,F=!0,L={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return o.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return o.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},R=function(){for(var e,t,n,o,i="",r=0;r<S.shareButtons.length;r++)e=S.shareButtons[r],t=S.getImageURLForShare(e),n=S.getPageURLForShare(e),o=S.getTextForShare(e),i+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(n)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(o))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",S.parseShareButtonOut&&(i=S.parseShareButtonOut(e,i));y.children[0].innerHTML=i,y.children[0].onclick=a},P=0,Z=function(){clearTimeout(k),P=0,x&&A.setIdle(!1)},z=function(e){I!==e&&(t(C,"preloader--active",!e),I=e)},N=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){y=e},onTap:function(){r()}},{name:"button--share",option:"shareEl",onInit:function(e){v=e},onTap:function(){r()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){g=e}},{name:"button--close",option:"closeEl",onTap:o.close},{name:"button--arrow--left",option:"arrowEl",onTap:o.prev},{name:"button--arrow--right",option:"arrowEl",onTap:o.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){p.isFullscreen()?p.exit():p.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){C=e}}];A.init=function(){var t;l.extend(o.options,L,!0),S=o.options,m=l.getChildByClass(o.scrollWrap,"pswp__ui"),(b=o.listen)("onVerticalDrag",function(e){O&&e<.95?A.hideControls():!O&&.95<=e&&A.showControls()}),b("onPinchClose",function(e){O&&e<.9?(A.hideControls(),t=!0):t&&!O&&.9<e&&A.showControls()}),b("zoomGestureEnded",function(){(t=!1)&&!O&&A.showControls()}),b("beforeChange",A.update),b("doubleTap",function(e){var t=o.currItem.initialZoomLevel;o.getZoomLevel()!==t?o.zoomTo(t,e,333):o.zoomTo(S.getDoubleTapZoom(!1,o.currItem),e,333)}),b("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.getAttribute("class")&&-1<e.type.indexOf("mouse")&&(0<o.getAttribute("class").indexOf("__caption")||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),b("bindEvents",function(){l.bind(m,"pswpTap click",e),l.bind(o.scrollWrap,"pswpTap",A.onGlobalTap),o.likelyTouchDevice||l.bind(o.scrollWrap,"mouseover",A.onMouseOver)}),b("unbindEvents",function(){F||r(),_&&clearInterval(_),l.unbind(document,"mouseout",c),l.unbind(document,"mousemove",Z),l.unbind(m,"pswpTap click",e),l.unbind(o.scrollWrap,"pswpTap",A.onGlobalTap),l.unbind(o.scrollWrap,"mouseover",A.onMouseOver),p&&(l.unbind(document,p.eventK,A.updateFullscreen),p.isFullscreen()&&(S.hideAnimationDuration=0,p.exit()),p=null)}),b("destroy",function(){S.captionEl&&(h&&m.removeChild(h),l.removeClass(f,"pswp__caption--empty")),y&&(y.children[0].onclick=null),l.removeClass(m,"pswp__ui--over-close"),l.addClass(m,"pswp__ui--hidden"),A.setIdle(!1)}),S.showAnimationDuration||l.removeClass(m,"pswp__ui--hidden"),b("initialZoomIn",function(){S.showAnimationDuration&&l.removeClass(m,"pswp__ui--hidden")}),b("initialZoomOut",function(){l.addClass(m,"pswp__ui--hidden")}),b("parseVerticalMargin",u),d(),S.shareEl&&v&&y&&(F=!0),n(),S.timeToIdle&&b("mouseUsed",function(){l.bind(document,"mousemove",Z),l.bind(document,"mouseout",c),_=setInterval(function(){2===++P&&A.setIdle(!0)},S.timeToIdle/2)}),S.fullscreenEl&&!l.features.isOldAndroid&&((p=p||A.getFullscreenAPI())?(l.bind(document,p.eventK,A.updateFullscreen),A.updateFullscreen(),l.addClass(o.template,"pswp--supports-fs")):l.removeClass(o.template,"pswp--supports-fs")),S.preloaderEl&&(z(!0),b("beforeChange",function(){clearTimeout(T),T=setTimeout(function(){o.currItem&&o.currItem.loading?o.allowProgressiveImg()&&(!o.currItem.img||o.currItem.img.naturalWidth)||z(!1):z(!0)},S.loadingIndicatorDelay)}),b("imageLoadComplete",function(e,t){o.currItem===t&&z(!0)}))},A.setIdle=function(e){t(m,"ui--idle",x=e)},A.update=function(){M=!(!O||!o.currItem)&&(A.updateIndexIndicator(),S.captionEl&&(S.addCaptionHTMLFn(o.currItem,f),t(f,"caption--empty",!o.currItem.title)),!0),F||r(),n()},A.updateFullscreen=function(e){e&&setTimeout(function(){o.setScrollOffset(0,l.getScrollY())},50),l[(p.isFullscreen()?"add":"remove")+"Class"](o.template,"pswp--fs")},A.updateIndexIndicator=function(){S.counterEl&&(g.innerHTML=o.getCurrentIndex()+1+S.indexIndicatorSep+S.getNumItemsFn())},A.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!D)if(e.detail&&"mouse"===e.detail.pointerType)s(t)?o.close():l.hasClass(t,"pswp__img")&&(1===o.getZoomLevel()&&o.getZoomLevel()<=o.currItem.fitRatio?S.clickToCloseNonZoomable&&o.close():o.toggleDesktopZoom(e.detail.releasePoint));else if(S.tapToToggleControls&&(O?A.hideControls():A.showControls()),S.tapToClose&&(l.hasClass(t,"pswp__img")||s(t)))return void o.close()},A.onMouseOver=function(e){e=(e=e||window.event).target||e.srcElement;t(m,"ui--over-close",s(e))},A.hideControls=function(){l.addClass(m,"pswp__ui--hidden"),O=!1},A.showControls=function(){O=!0,M||A.update(),l.removeClass(m,"pswp__ui--hidden")},A.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},A.getFullscreenAPI=function(){var e,t=document.documentElement,n="fullscreenchange";return t.requestFullscreen?e={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:n}:t.mozRequestFullScreen?e={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+n}:t.webkitRequestFullscreen?e={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+n}:t.msRequestFullscreen&&(e={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),e&&(e.enter=function(){return w=S.closeOnScroll,S.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?o.template[this.enterK]():void o.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},e.exit=function(){return S.closeOnScroll=w,document[this.exitK]()},e.isFullscreen=function(){return document[this.elementK]}),e}}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(m,n,e,t){var f={features:null,bind:function(e,t,n,o){var i=(o?"remove":"add")+"EventListener";t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&e[i](t[r],n,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){t=document.createElement(t||"div");return e&&(t.className=e),t},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){f.bind(e,t,n,!0)},removeClass:function(e,t){t=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(t," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){f.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},getChildByClass:function(e,t){for(var n=e.firstChild;n;){if(f.hasClass(n,t))return n;n=n.nextSibling}},arraySearch:function(e,t,n){for(var o=e.length;o--;)if(e[o][n]===t)return o;return-1},extend:function(e,t,n){for(var o in t)if(t.hasOwnProperty(o)){if(n&&e.hasOwnProperty(o))continue;e[o]=t[o]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(f.features)return f.features;var e,t,n=f.createEl().style,o="",i={};i.oldIE=document.all&&!document.addEventListener,i.touch="ontouchstart"in window,window.requestAnimationFrame&&(i.raf=window.requestAnimationFrame,i.caf=window.cancelAnimationFrame),i.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,i.pointerEvent||(e=navigator.userAgent,!/iP(hone|od)/.test(navigator.platform)||(t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/))&&0<t.length&&(1<=(t=parseInt(t[1],10))&&t<8&&(i.isOldIOSPhone=!0)),t=(t=e.match(/Android\s([0-9\.]*)/))?t[1]:0,1<=(t=parseFloat(t))&&(t<4.4&&(i.isOldAndroid=!0),i.androidVersion=t),i.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var r,a,l,s=["transform","perspective","animationName"],c=["","webkit","Moz","ms","O"],u=0;u<4;u++){for(var o=c[u],d=0;d<3;d++)r=s[d],a=o+(o?r.charAt(0).toUpperCase()+r.slice(1):r),!i[r]&&a in n&&(i[r]=a);o&&!i.raf&&(o=o.toLowerCase(),i.raf=window[o+"RequestAnimationFrame"],i.raf&&(i.caf=window[o+"CancelAnimationFrame"]||window[o+"CancelRequestAnimationFrame"]))}return i.raf||(l=0,i.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-l)),o=window.setTimeout(function(){e(t+n)},n);return l=t+n,o},i.caf=function(e){clearTimeout(e)}),i.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,f.features=i}};f.detectFeatures(),f.features.oldIE&&(f.bind=function(e,t,n,o){t=t.split(" ");for(var i,r=(o?"detach":"attach")+"Event",a=function(){n.handleEvent.call(n)},l=0;l<t.length;l++)if(i=t[l])if("object"==typeof n&&n.handleEvent){if(o){if(!n["oldIE"+i])return!1}else n["oldIE"+i]=a;e[r]("on"+i,n["oldIE"+i])}else e[r]("on"+i,n)});var h=this,g={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e||t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};f.extend(g,t);function o(){return{x:0,y:0}}function i(e,t){f.extend(h,t.publicMethods),$e.push(e)}function a(e){var t=Yt();return t-1<e?e-t:e<0?t+e:e}function r(e,t){return et[e]||(et[e]=[]),et[e].push(t)}function v(e){var t=et[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var o=0;o<t.length;o++)t[o].apply(h,n)}}function u(){return(new Date).getTime()}function y(e){Ne=e,h.bg.style.opacity=e*g.bgOpacity}function l(e,t,n,o,i){(!Qe||i&&i!==h.currItem)&&(o/=(i||h.currItem).fitRatio),e[le]=$+t+"px, "+n+"px"+J+" scale("+o+")"}function d(e,t){var n;!g.loop&&t&&(n=K+(Ve.x*Ye-e)/Ve.x,t=Math.round(e-xt.x),(n<0&&0<t||n>=Yt()-1&&t<0)&&(e=xt.x+t*g.mainScrollEndFriction)),xt.x=e,ot(e,W)}function s(e,t){var n=bt[e]-Ge[e];return Ke[e]+qe[e]+n-t/j*n}function w(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function c(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function p(e,t){return e=$t(h.currItem,Be,e),t&&(Fe=e),e}function x(e){return(e=e||h.currItem).initialZoomLevel}function b(e){return 0<(e=e||h.currItem).w?g.maxSpreadZoom:1}function C(e,t,n,o){return o===h.currItem.initialZoomLevel?(n[e]=h.currItem.initialPosition[e],!0):(n[e]=s(e,o),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]<t.max[e]&&(n[e]=t.max[e],!0))}function I(e){var t="";g.escKey&&27===e.keyCode?t="close":g.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),t&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,h[t]()))}function T(e){e&&(De||Se||Re||Ce)&&(e.preventDefault(),e.stopPropagation())}function E(){h.setScrollOffset(0,f.getScrollY())}function S(e){at[e]&&(at[e].raf&&de(at[e].raf),lt--,delete at[e])}function D(e){at[e]&&S(e),at[e]||(lt++,at[e]={})}function _(){for(var e in at)at.hasOwnProperty(e)&&S(e)}function k(e,t,n,o,i,r,a){var l,s=u();D(e);var c=function(){if(at[e]){if(l=u()-s,o<=l)return S(e),r(n),void(a&&a());r((n-t)*i(l/o)+t),at[e].raf=ue(c)}};c()}function A(e,t){return gt.x=Math.abs(e.x-t.x),gt.y=Math.abs(e.y-t.y),Math.sqrt(gt.x*gt.x+gt.y*gt.y)}function M(e,t){return St.prevent=!Et(e.target,g.isClickableElement),v("preventDragEvent",e,t,St),St.prevent}function O(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t}function F(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)}function L(){var e=We.y-h.currItem.initialPosition.y;return 1-Math.abs(e/(Be.y/2))}function R(e){for(;0<kt.length;)kt.pop();return se?(He=0,mt.forEach(function(e){0===He?kt[0]=e:1===He&&(kt[1]=e),He++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(kt[0]=O(e.touches[0],Dt),1<e.touches.length&&(kt[1]=O(e.touches[1],_t))):(Dt.x=e.pageX,Dt.y=e.pageY,Dt.id="",kt[0]=Dt),kt}function P(e,t){var n,o,i,r=We[e]+t[e],a=0<t[e],l=xt.x+t.x,s=xt.x-ft.x,c=r>Fe.min[e]||r<Fe.max[e]?g.panEndFriction:1,r=We[e]+t[e]*c;return!g.allowPanToNext&&X!==h.currItem.initialZoomLevel||(Le?"h"!==Pe||"x"!==e||Se||(a?(r>Fe.min[e]&&(c=g.panEndFriction,Fe.min[e],n=Fe.min[e]-Ke[e]),(n<=0||s<0)&&1<Yt()?(i=l,s<0&&l>ft.x&&(i=ft.x)):Fe.min.x!==Fe.max.x&&(o=r)):(r<Fe.max[e]&&(c=g.panEndFriction,Fe.max[e],n=Ke[e]-Fe.max[e]),(n<=0||0<s)&&1<Yt()?(i=l,0<s&&l<ft.x&&(i=ft.x)):Fe.min.x!==Fe.max.x&&(o=r))):i=l,"x"!==e)?void(Re||ke||X>h.currItem.fitRatio&&(We[e]+=t[e]*c)):(void 0!==i&&(d(i,!0),ke=i!==ft.x),Fe.min.x!==Fe.max.x&&(void 0!==o?We.x=o:ke||(We.x+=t.x*c)),void 0!==i)}function Z(e){var t;"mousedown"===e.type&&0<e.button||(Wt?e.preventDefault():Ie&&"mousedown"===e.type||(M(e,!0)&&e.preventDefault(),v("pointerDown"),se&&((t=f.arraySearch(mt,e.pointerId,"id"))<0&&(t=mt.length),mt[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),e=(t=R(e)).length,Ae=null,_(),Te&&1!==e||(Te=Ze=!0,f.bind(window,Y,h),be=Ue=ze=Ce=ke=De=Ee=Se=!1,Pe=null,v("firstTouchStart",t),w(Ke,We),qe.x=qe.y=0,w(dt,t[0]),w(pt,dt),ft.x=Ve.x*Ye,ht=[{x:dt.x,y:dt.y}],we=ye=u(),p(X,!0),It(),Tt()),!Me&&1<e&&!Re&&!ke&&(j=X,Me=Ee=!(Se=!1),qe.y=qe.x=0,w(Ke,We),w(st,t[0]),w(ct,t[1]),F(st,ct,Ct),bt.x=Math.abs(Ct.x)-We.x,bt.y=Math.abs(Ct.y)-We.y,Oe=A(st,ct))))}function z(e){var t,n;e.preventDefault(),se&&-1<(t=f.arraySearch(mt,e.pointerId,"id"))&&((n=mt[t]).x=e.pageX,n.y=e.pageY),Te&&(n=R(e),Pe||De||Me?Ae=n:xt.x!==Ve.x*Ye?Pe="h":(e=Math.abs(n[0].x-dt.x)-Math.abs(n[0].y-dt.y),10<=Math.abs(e)&&(Pe=0<e?"h":"v",Ae=n)))}function N(e){if(ge.isOldAndroid){if(Ie&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(Ie),Ie=setTimeout(function(){Ie=0},600))}v("pointerUp"),M(e,!1)&&e.preventDefault(),!se||-1<(n=f.arraySearch(mt,e.pointerId,"id"))&&(r=mt.splice(n,1)[0],navigator.msPointerEnabled?(r.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],r.type||(r.type=e.pointerType||"mouse")):r.type=e.pointerType||"mouse");var t=R(e),n=t.length;if(2===(n="mouseup"===e.type?0:n))return!(Ae=null);1===n&&w(pt,t[0]),0!==n||Pe||Re||(r||("mouseup"===e.type?r={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(r={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),v("touchRelease",e,r));var o,i,r=-1;if(0===n&&(Te=!1,f.unbind(window,Y,h),It(),Me?r=0:-1!==wt&&(r=u()-wt)),wt=1===n?u():-1,r=-1!==r&&r<150?"zoom":"swipe",Me&&n<2&&(Me=!1,1===n&&(r="zoomPointerUp"),v("zoomGestureEnded")),Ae=null,De||Se||Re||Ce)if(_(),(xe=xe||Mt()).calculateSwipeSpeed("x"),Ce)L()<g.verticalDragRange?h.close():(o=We.y,i=Ne,k("verticalDrag",0,1,300,f.easing.cubic.out,function(e){We.y=(h.currItem.initialPosition.y-o)*e+o,y((1-i)*e+i),tt()}),v("onVerticalDrag",1));else{if((ke||Re)&&0===n){if(Ft(r,xe))return;r="zoomPointerUp"}if(!Re)return"swipe"!==r?void Rt():void(!ke&&X>h.currItem.fitRatio&&Ot(xe))}}var U,H,q,K,W,B,Y,G,V,X,j,$,J,Q,ee,te,ne,oe,ie,re,ae,le,se,ce,ue,de,pe,me,fe,he,ge,ve,ye,we,xe,be,Ce,Ie,Te,Ee,Se,De,_e,ke,Ae,Me,Oe,Fe,Le,Re,Pe,Ze,ze,Ne,Ue,He,qe=o(),Ke=o(),We=o(),Be={},Ye=0,Ge={},Ve=o(),Xe=0,je=!0,$e=[],Je={},Qe=!1,et={},tt=function(e){Le&&(e&&(X>h.currItem.fitRatio?Qe||(Jt(h.currItem,!1,!0),Qe=!0):Qe&&(Jt(h.currItem),Qe=!1)),l(Le,We.x,We.y,X))},nt=function(e){e.container&&l(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},ot=function(e,t){t[le]=$+e+"px, 0px"+J},it=null,rt=function(){it&&(f.unbind(document,"mousemove",rt),f.addClass(m,"pswp--has_mouse"),g.mouseUsed=!0,v("mouseUsed")),it=setTimeout(function(){it=null},100)},at={},lt=0,t={shout:v,listen:r,viewportSize:Be,options:g,isMainScrollAnimating:function(){return Re},getZoomLevel:function(){return X},getCurrentIndex:function(){return K},isDragging:function(){return Te},isZooming:function(){return Me},setScrollOffset:function(e,t){Ge.x=e,he=Ge.y=t,v("updateScrollOffset",Ge)},applyZoomPan:function(e,t,n,o){We.x=t,We.y=n,X=e,tt(o)},init:function(){if(!U&&!H){var e;h.framework=f,h.template=m,h.bg=f.getChildByClass(m,"pswp__bg"),pe=m.className,U=!0,ge=f.detectFeatures(),ue=ge.raf,de=ge.caf,le=ge.transform,fe=ge.oldIE,h.scrollWrap=f.getChildByClass(m,"pswp__scroll-wrap"),h.container=f.getChildByClass(h.scrollWrap,"pswp__container"),W=h.container.style,h.itemHolders=te=[{el:h.container.children[0],wrap:0,index:-1},{el:h.container.children[1],wrap:0,index:-1},{el:h.container.children[2],wrap:0,index:-1}],te[0].el.style.display=te[2].el.style.display="none",function(){if(le){var e=ge.perspective&&!ce;return $="translate"+(e?"3d(":"("),J=ge.perspective?", 0px)":")"}le="left",f.addClass(m,"pswp--ie"),ot=function(e,t){t.left=e+"px"},nt=function(e){var t=1<e.fitRatio?1:e.fitRatio,n=e.container.style,o=t*e.w,t=t*e.h;n.width=o+"px",n.height=t+"px",n.left=e.initialPosition.x+"px",n.top=e.initialPosition.y+"px"},tt=function(){var e,t,n;Le&&(t=(n=1<(e=h.currItem).fitRatio?1:e.fitRatio)*e.w,n=n*e.h,(e=Le).width=t+"px",e.height=n+"px",e.left=We.x+"px",e.top=We.y+"px")}}(),V={resize:h.updateSize,orientationchange:function(){clearTimeout(ve),ve=setTimeout(function(){Be.x!==h.scrollWrap.clientWidth&&h.updateSize()},500)},scroll:E,keydown:I,click:T};var t=ge.isOldIOSPhone||ge.isOldAndroid||ge.isMobileOpera;for(ge.animationName&&ge.transform&&!t||(g.showAnimationDuration=g.hideAnimationDuration=0),e=0;e<$e.length;e++)h["init"+$e[e]]();n&&(h.ui=new n(h,f)).init(),v("firstUpdate"),K=K||g.index||0,(isNaN(K)||K<0||K>=Yt())&&(K=0),h.currItem=Bt(K),(ge.isOldIOSPhone||ge.isOldAndroid)&&(je=!1),m.setAttribute("aria-hidden","false"),g.modal&&(je?m.style.position="fixed":(m.style.position="absolute",m.style.top=f.getScrollY()+"px")),void 0===he&&(v("initialLayout"),he=me=f.getScrollY());t="pswp--open ";for(g.mainClass&&(t+=g.mainClass+" "),g.showHideOpacity&&(t+="pswp--animate_opacity "),t+=ce?"pswp--touch":"pswp--notouch",t+=ge.animationName?" pswp--css_animation":"",t+=ge.svg?" pswp--svg":"",f.addClass(m,t),h.updateSize(),B=-1,Xe=null,e=0;e<3;e++)ot((e+B)*Ve.x,te[e].el.style);fe||f.bind(h.scrollWrap,G,h),r("initialZoomInEnd",function(){h.setContent(te[0],K-1),h.setContent(te[2],K+1),te[0].el.style.display=te[2].el.style.display="block",g.focus&&m.focus(),f.bind(document,"keydown",h),ge.transform&&f.bind(h.scrollWrap,"click",h),g.mouseUsed||f.bind(document,"mousemove",rt),f.bind(window,"resize scroll orientationchange",h),v("bindEvents")}),h.setContent(te[1],K),h.updateCurrItem(),v("afterInit"),je||(Q=setInterval(function(){lt||Te||Me||X!==h.currItem.initialZoomLevel||h.updateSize()},1e3)),f.addClass(m,"pswp--visible")}},close:function(){U&&(H=!(U=!1),v("close"),f.unbind(window,"resize scroll orientationchange",h),f.unbind(window,"scroll",V.scroll),f.unbind(document,"keydown",h),f.unbind(document,"mousemove",rt),ge.transform&&f.unbind(h.scrollWrap,"click",h),Te&&f.unbind(window,Y,h),clearTimeout(ve),v("unbindEvents"),Gt(h.currItem,null,!0,h.destroy))},destroy:function(){v("destroy"),Ht&&clearTimeout(Ht),m.setAttribute("aria-hidden","true"),m.className=pe,Q&&clearInterval(Q),f.unbind(h.scrollWrap,G,h),f.unbind(window,"scroll",h),It(),_(),et=null},panTo:function(e,t,n){n||(e>Fe.min.x?e=Fe.min.x:e<Fe.max.x&&(e=Fe.max.x),t>Fe.min.y?t=Fe.min.y:t<Fe.max.y&&(t=Fe.max.y)),We.x=e,We.y=t,tt()},handleEvent:function(e){e=e||window.event,V[e.type]&&V[e.type](e)},goTo:function(e){var t=(e=a(e))-K;Xe=t,K=e,h.currItem=Bt(K),Ye-=t,d(Ve.x*Ye),_(),Re=!1,h.updateCurrItem()},next:function(){h.goTo(K+1)},prev:function(){h.goTo(K-1)},updateCurrZoomItem:function(e){var t;e&&v("beforeChange",0),Le=te[1].el.children.length?(t=te[1].el.children[0],f.hasClass(t,"pswp__zoom-wrap")?t.style:null):null,Fe=h.currItem.bounds,j=X=h.currItem.initialZoomLevel,We.x=Fe.center.x,We.y=Fe.center.y,e&&v("afterChange")},invalidateCurrItems:function(){ee=!0;for(var e=0;e<3;e++)te[e].item&&(te[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==Xe){var t,n=Math.abs(Xe);if(!(e&&n<2)){h.currItem=Bt(K),Qe=!1,v("beforeChange",Xe),3<=n&&(B+=Xe+(0<Xe?-3:3),n=3);for(var o=0;o<n;o++)0<Xe?(t=te.shift(),te[2]=t,ot((++B+2)*Ve.x,t.el.style),h.setContent(t,K-n+o+1+1)):(t=te.pop(),te.unshift(t),ot(--B*Ve.x,t.el.style),h.setContent(t,K+n-o-1-1));!Le||1!==Math.abs(Xe)||(e=Bt(ne)).initialZoomLevel!==X&&($t(e,Be),Jt(e),nt(e)),Xe=0,h.updateCurrZoomItem(),ne=K,v("afterChange")}}},updateSize:function(e){if(!je&&g.modal){var t=f.getScrollY();if(he!==t&&(m.style.top=t+"px",he=t),!e&&Je.x===window.innerWidth&&Je.y===window.innerHeight)return;Je.x=window.innerWidth,Je.y=window.innerHeight,m.style.height=Je.y+"px"}if(Be.x=h.scrollWrap.clientWidth,Be.y=h.scrollWrap.clientHeight,E(),Ve.x=Be.x+Math.round(Be.x*g.spacing),Ve.y=Be.y,d(Ve.x*Ye),v("beforeResize"),void 0!==B){for(var n,o,i,r=0;r<3;r++)n=te[r],ot((r+B)*Ve.x,n.el.style),i=K+r-1,g.loop&&2<Yt()&&(i=a(i)),(o=Bt(i))&&(ee||o.needsUpdate||!o.bounds)?(h.cleanSlide(o),h.setContent(n,i),1===r&&(h.currItem=o,h.updateCurrZoomItem(!0)),o.needsUpdate=!1):-1===n.index&&0<=i&&h.setContent(n,i),o&&o.container&&($t(o,Be),Jt(o),nt(o));ee=!1}j=X=h.currItem.initialZoomLevel,(Fe=h.currItem.bounds)&&(We.x=Fe.center.x,We.y=Fe.center.y,tt(!0)),v("resize")},zoomTo:function(t,e,n,o,i){e&&(j=X,bt.x=Math.abs(e.x)-We.x,bt.y=Math.abs(e.y)-We.y,w(Ke,We));var e=p(t,!1),r={};C("x",e,r,t),C("y",e,r,t);var a=X,l=We.x,s=We.y;c(r);e=function(e){1===e?(X=t,We.x=r.x,We.y=r.y):(X=(t-a)*e+a,We.x=(r.x-l)*e+l,We.y=(r.y-s)*e+s),i&&i(e),tt(1===e)};n?k("customZoomTo",0,1,n,o||f.easing.sine.inOut,e):e(1)}},st={},ct={},ut={},dt={},pt={},mt=[],ft={},ht=[],gt={},vt=0,yt=o(),wt=0,xt=o(),bt=o(),Ct=o(),It=function(){_e&&(de(_e),_e=null)},Tt=function(){Te&&(_e=ue(Tt),At())},Et=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:Et(e.parentNode,t))},St={},Dt={},_t={},kt=[],At=function(){if(Ae){var e=Ae.length;if(0!==e)if(w(st,Ae[0]),ut.x=st.x-dt.x,ut.y=st.y-dt.y,Me&&1<e)dt.x=st.x,dt.y=st.y,(ut.x||ut.y||(r=Ae[1],a=ct,r.x!==a.x||r.y!==a.y))&&(w(ct,Ae[1]),Se||(Se=!0,v("zoomGestureStarted")),o=A(st,ct),(i=Lt(o))>h.currItem.initialZoomLevel+h.currItem.initialZoomLevel/15&&(Ue=!0),n=1,e=x(),r=b(),i<e?g.pinchToClose&&!Ue&&j<=h.currItem.initialZoomLevel?(y(a=1-(e-i)/(e/1.2)),v("onPinchClose",a),ze=!0):i=e-(n=1<(n=(e-i)/e)?1:n)*(e/3):r<i&&(i=r+(n=1<(n=(i-r)/(6*e))?1:n)*e),n<0&&(n=0),F(st,ct,yt),qe.x+=yt.x-Ct.x,qe.y+=yt.y-Ct.y,w(Ct,yt),We.x=s("x",i),We.y=s("y",i),be=X<i,X=i,tt());else if(Pe&&(Ze&&(Ze=!1,10<=Math.abs(ut.x)&&(ut.x-=Ae[0].x-pt.x),10<=Math.abs(ut.y)&&(ut.y-=Ae[0].y-pt.y)),dt.x=st.x,dt.y=st.y,0!==ut.x||0!==ut.y)){if("v"===Pe&&g.closeOnVerticalDrag&&"fit"===g.scaleMode&&X===h.currItem.initialZoomLevel){qe.y+=ut.y,We.y+=ut.y;var t=L();return Ce=!0,v("onVerticalDrag",t),y(t),void tt()}n=u(),o=st.x,i=st.y,50<n-we&&((t=2<ht.length?ht.shift():{}).x=o,t.y=i,ht.push(t),we=n),De=!0,Fe=h.currItem.bounds,P("x",ut)||(P("y",ut),c(We),tt())}}var n,o,i,r,a},Mt=function(){var t,n,o={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=1<ht.length?(t=u()-we+50,ht[ht.length-2][e]):(t=u()-ye,pt[e]),o.lastFlickOffset[e]=dt[e]-n,o.lastFlickDist[e]=Math.abs(o.lastFlickOffset[e]),20<o.lastFlickDist[e]?o.lastFlickSpeed[e]=o.lastFlickOffset[e]/t:o.lastFlickSpeed[e]=0,Math.abs(o.lastFlickSpeed[e])<.1&&(o.lastFlickSpeed[e]=0),o.slowDownRatio[e]=.95,o.slowDownRatioReverse[e]=1-o.slowDownRatio[e],o.speedDecelerationRatio[e]=1},calculateOverBoundsAnimOffset:function(t,e){o.backAnimStarted[t]||(We[t]>Fe.min[t]?o.backAnimDestination[t]=Fe.min[t]:We[t]<Fe.max[t]&&(o.backAnimDestination[t]=Fe.max[t]),void 0!==o.backAnimDestination[t]&&(o.slowDownRatio[t]=.7,o.slowDownRatioReverse[t]=1-o.slowDownRatio[t],o.speedDecelerationRatioAbs[t]<.05&&(o.lastFlickSpeed[t]=0,o.backAnimStarted[t]=!0,k("bounceZoomPan"+t,We[t],o.backAnimDestination[t],e||300,f.easing.sine.out,function(e){We[t]=e,tt()}))))},calculateAnimOffset:function(e){o.backAnimStarted[e]||(o.speedDecelerationRatio[e]=o.speedDecelerationRatio[e]*(o.slowDownRatio[e]+o.slowDownRatioReverse[e]-o.slowDownRatioReverse[e]*o.timeDiff/10),o.speedDecelerationRatioAbs[e]=Math.abs(o.lastFlickSpeed[e]*o.speedDecelerationRatio[e]),o.distanceOffset[e]=o.lastFlickSpeed[e]*o.speedDecelerationRatio[e]*o.timeDiff,We[e]+=o.distanceOffset[e])},panAnimLoop:function(){if(at.zoomPan&&(at.zoomPan.raf=ue(o.panAnimLoop),o.now=u(),o.timeDiff=o.now-o.lastNow,o.lastNow=o.now,o.calculateAnimOffset("x"),o.calculateAnimOffset("y"),tt(),o.calculateOverBoundsAnimOffset("x"),o.calculateOverBoundsAnimOffset("y"),o.speedDecelerationRatioAbs.x<.05&&o.speedDecelerationRatioAbs.y<.05))return We.x=Math.round(We.x),We.y=Math.round(We.y),tt(),void S("zoomPan")}};return o},Ot=function(e){return e.calculateSwipeSpeed("y"),Fe=h.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05?(e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0):(D("zoomPan"),e.lastNow=u(),void e.panAnimLoop())},Ft=function(e,t){var n,o;Re||(vt=K),"swipe"===e&&(o=dt.x-pt.x,e=t.lastFlickDist.x<10,30<o&&(e||20<t.lastFlickOffset.x)?r=-1:o<-30&&(e||t.lastFlickOffset.x<-20)&&(r=1)),r&&((K+=r)<0?(K=g.loop?Yt()-1:0,i=!0):K>=Yt()&&(K=g.loop?0:Yt()-1,i=!0),i&&!g.loop||(Xe+=r,Ye-=r,n=!0));var i=Ve.x*Ye,r=Math.abs(i-xt.x),a=n||i>xt.x==0<t.lastFlickSpeed.x?(a=0<Math.abs(t.lastFlickSpeed.x)?r/Math.abs(t.lastFlickSpeed.x):333,a=Math.min(a,400),Math.max(a,250)):333;return vt===K&&(n=!1),Re=!0,v("mainScrollAnimStart"),k("mainScroll",xt.x,i,a,f.easing.cubic.out,d,function(){_(),Re=!1,vt=-1,!n&&vt===K||h.updateCurrItem(),v("mainScrollAnimComplete")}),n&&h.updateCurrItem(!0),n},Lt=function(e){return 1/Oe*e*j},Rt=function(){var e=X,t=x(),n=b();X<t?e=t:n<X&&(e=n);var o,i=Ne;return ze&&!be&&!Ue&&X<t?h.close():h.zoomTo(e,0,200,f.easing.cubic.out,o=ze?function(e){y((1-i)*e+i)}:o),!0};i("Gestures",{publicMethods:{initGestures:function(){function e(e,t,n,o,i){oe=e+t,ie=e+n,re=e+o,ae=i?e+i:""}(se=ge.pointerEvent)&&ge.touch&&(ge.touch=!1),se?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):ge.touch?(e("touch","start","move","end","cancel"),ce=!0):e("mouse","down","move","up"),Y=ie+" "+re+" "+ae,G=oe,se&&!ce&&(ce=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),h.likelyTouchDevice=ce,V[oe]=Z,V[ie]=z,V[re]=N,ae&&(V[ae]=V[re]),ge.touch&&(G+=" mousedown",Y+=" mousemove mouseup",V.mousedown=V[oe],V.mousemove=V[ie],V.mouseup=V[re]),ce||(g.allowPanToNext=!1)}}});function Pt(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}}function Zt(e,t,n,o,i,r){t.loadError||o&&(t.imageAppended=!0,Jt(t,o,t===h.currItem&&Qe),n.appendChild(o),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))}function zt(e){function t(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,n.onload=n.onerror=null,n=null}e.loading=!0,e.loaded=!1;var n=e.img=f.createEl("pswp__img","img");return n.onload=t,n.onerror=function(){e.loadError=!0,t()},n.src=e.src,n}function Nt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=g.errorMsg.replace("%url%",e.src),1)}function Ut(){if(Xt.length){for(var e,t=0;t<Xt.length;t++)(e=Xt[t]).holder.index===e.index&&Zt(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Xt=[]}}var Ht,qt,Kt,Wt,Bt,Yt,Gt=function(a,e,l,t){var s;Ht&&clearTimeout(Ht),Kt=Wt=!0,a.initialLayout?(s=a.initialLayout,a.initialLayout=null):s=g.getThumbBoundsFn&&g.getThumbBoundsFn(K);function c(){S("initialZoom"),l?(h.template.removeAttribute("style"),h.bg.removeAttribute("style")):(y(1),e&&(e.style.display="block"),f.addClass(m,"pswp--animated-in"),v("initialZoom"+(l?"OutEnd":"InEnd"))),t&&t(),Wt=!1}var u=l?g.hideAnimationDuration:g.showAnimationDuration;if(!u||!s||void 0===s.x)return v("initialZoom"+(l?"Out":"In")),X=a.initialZoomLevel,w(We,a.initialPosition),tt(),m.style.opacity=l?0:1,y(1),void(u?setTimeout(function(){c()},u):c());var d,p;d=q,p=!h.currItem.src||h.currItem.loadError||g.showHideOpacity,a.miniImg&&(a.miniImg.style.webkitBackfaceVisibility="hidden"),l||(X=s.w/a.w,We.x=s.x,We.y=s.y-me,h[p?"template":"bg"].style.opacity=.001,tt()),D("initialZoom"),l&&!d&&f.removeClass(m,"pswp--animated-in"),p&&(l?f[(d?"remove":"add")+"Class"](m,"pswp--animate_opacity"):setTimeout(function(){f.addClass(m,"pswp--animate_opacity")},30)),Ht=setTimeout(function(){var t,n,o,i,r,e;v("initialZoom"+(l?"Out":"In")),l?(t=s.w/a.w,n=We.x,o=We.y,i=X,r=Ne,e=function(e){1===e?(X=t,We.x=s.x,We.y=s.y-he):(X=(t-i)*e+i,We.x=(s.x-n)*e+n,We.y=(s.y-he-o)*e+o),tt(),p?m.style.opacity=1-e:y(r-e*r)},d?k("initialZoom",0,1,u,f.easing.cubic.out,e,c):(e(1),Ht=setTimeout(c,u+20))):(X=a.initialZoomLevel,w(We,a.initialPosition),tt(),y(1),p?m.style.opacity=1:y(1),Ht=setTimeout(c,u+20))},l?25:90)},Vt={},Xt=[],jt={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return qt.length}},$t=function(e,t,n){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Pt(),e.initialPosition=e.bounds.center,e.bounds;var o,i,r,a=!n;return a&&(e.vGap||(e.vGap={top:0,bottom:0}),v("parseVerticalMargin",e)),Vt.x=t.x,Vt.y=t.y-e.vGap.top-e.vGap.bottom,a&&(o=Vt.x/e.w,i=Vt.y/e.h,e.fitRatio=o<i?o:i,"orig"===(r=g.scaleMode)?n=1:"fit"===r&&(n=e.fitRatio),e.initialZoomLevel=n=1<n?1:n,e.bounds||(e.bounds=Pt())),n?(o=(t=e).w*n,i=e.h*n,(r=t.bounds).center.x=Math.round((Vt.x-o)/2),r.center.y=Math.round((Vt.y-i)/2)+t.vGap.top,r.max.x=o>Vt.x?Math.round(Vt.x-o):r.center.x,r.max.y=i>Vt.y?Math.round(Vt.y-i)+t.vGap.top:r.center.y,r.min.x=o>Vt.x?0:r.center.x,r.min.y=i>Vt.y?t.vGap.top:r.center.y,a&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Jt=function(e,t,n){var o;e.src&&(t=t||e.container.lastChild,o=n?e.w:Math.round(e.w*e.fitRatio),n=n?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=o+"px",e.placeholder.style.height=n+"px"),t.style.width=o+"px",t.style.height=n+"px")};i("Controller",{publicMethods:{lazyLoadItem:function(e){e=a(e);var t=Bt(e);t&&(!t.loaded&&!t.loading||ee)&&(v("gettingData",e,t),t.src&&zt(t))},initController:function(){f.extend(g,jt,!0),h.items=qt=e,Bt=h.getItemAt,Yt=g.getNumItemsFn,g.loop,Yt()<3&&(g.loop=!1),r("beforeChange",function(e){for(var t=g.preload,n=null===e||0<=e,o=Math.min(t[0],Yt()),i=Math.min(t[1],Yt()),r=1;r<=(n?i:o);r++)h.lazyLoadItem(K+r);for(r=1;r<=(n?o:i);r++)h.lazyLoadItem(K-r)}),r("initialLayout",function(){h.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(K)}),r("mainScrollAnimComplete",Ut),r("initialZoomInEnd",Ut),r("destroy",function(){for(var e,t=0;t<qt.length;t++)(e=qt[t]).container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);Xt=null})},getItemAt:function(e){return 0<=e&&void 0!==qt[e]&&qt[e]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!ce||g.mouseUsed||1200<screen.width},setContent:function(t,n){g.loop&&(n=a(n));var e=h.getItemAt(t.index);e&&(e.container=null);var o,i,r=h.getItemAt(n);r?(v("gettingData",n,r),t.index=n,i=(t.item=r).container=f.createEl("pswp__zoom-wrap"),!r.src&&r.html&&(r.html.tagName?i.appendChild(r.html):i.innerHTML=r.html),Nt(r),$t(r,Be),!r.src||r.loadError||r.loaded?r.src&&!r.loadError&&((o=f.createEl("pswp__img","img")).style.opacity=1,o.src=r.src,Jt(r,o),Zt(0,r,i,o)):(r.loadComplete=function(e){if(U){if(t&&t.index===n){if(Nt(e,!0))return e.loadComplete=e.img=null,$t(e,Be),nt(e),void(t.index===K&&h.updateCurrZoomItem());e.imageAppended?!Wt&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):ge.transform&&(Re||Wt)?Xt.push({item:e,baseDiv:i,img:e.img,index:n,holder:t,clearPlaceholder:!0}):Zt(0,e,i,e.img,0,!0)}e.loadComplete=null,e.img=null,v("imageLoadComplete",n,e)}},f.features.transform&&(e="pswp__img pswp__img--placeholder",e+=r.msrc?"":" pswp__img--placeholder--blank",e=f.createEl(e,r.msrc?"img":""),r.msrc&&(e.src=r.msrc),Jt(r,e),i.appendChild(e),r.placeholder=e),r.loading||zt(r),h.allowProgressiveImg()&&(!Kt&&ge.transform?Xt.push({item:r,baseDiv:i,img:r.img,index:n,holder:t}):Zt(0,r,i,r.img,0,!0))),Kt||n!==K?nt(r):(Le=i.style,Gt(r,o||r.img)),t.el.innerHTML="",t.el.appendChild(i)):t.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});function Qt(e,t,n){var o=document.createEvent("CustomEvent"),n={origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"};o.initCustomEvent("pswpTap",!0,!0,n),e.target.dispatchEvent(o)}var en,tn,nn={};i("Tap",{publicMethods:{initTap:function(){r("firstTouchStart",h.onTapStart),r("touchRelease",h.onTapRelease),r("destroy",function(){nn={},en=null})},onTapStart:function(e){1<e.length&&(clearTimeout(en),en=null)},onTapRelease:function(e,t){var n,o,i;!t||De||Ee||lt||(n=t,en&&(clearTimeout(en),en=null,o=n,i=nn,Math.abs(o.x-i.x)<25&&Math.abs(o.y-i.y)<25)?v("doubleTap",n):"mouse"!==t.type?"BUTTON"===e.target.tagName.toUpperCase()||f.hasClass(e.target,"pswp__single-tap")?Qt(e,t):(w(nn,n),en=setTimeout(function(){Qt(e,t),en=null},300)):Qt(e,t,"mouse"))}}}),i("DesktopZoom",{publicMethods:{initDesktopZoom:function(){fe||(ce?r("mouseUsed",function(){h.setupDesktopZoom()}):h.setupDesktopZoom(!0))},setupDesktopZoom:function(e){tn={};var t="wheel mousewheel DOMMouseScroll";r("bindEvents",function(){f.bind(m,t,h.handleMouseWheel)}),r("unbindEvents",function(){tn&&f.unbind(m,t,h.handleMouseWheel)}),h.mouseZoomedIn=!1;function n(){h.mouseZoomedIn&&(f.removeClass(m,"pswp--zoomed-in"),h.mouseZoomedIn=!1),X<1?f.addClass(m,"pswp--zoom-allowed"):f.removeClass(m,"pswp--zoom-allowed"),i()}var o,i=function(){o&&(f.removeClass(m,"pswp--dragging"),o=!1)};r("resize",n),r("afterChange",n),r("pointerDown",function(){h.mouseZoomedIn&&(o=!0,f.addClass(m,"pswp--dragging"))}),r("pointerUp",i),e||n()},handleMouseWheel:function(e){if(X<=h.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||lt||Te?e.preventDefault():le&&2<Math.abs(e.deltaY)&&(q=!0,h.close())),!0;if(e.stopPropagation(),tn.x=0,"deltaX"in e)1===e.deltaMode?(tn.x=18*e.deltaX,tn.y=18*e.deltaY):(tn.x=e.deltaX,tn.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(tn.x=-.16*e.wheelDeltaX),e.wheelDeltaY?tn.y=-.16*e.wheelDeltaY:tn.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;tn.y=e.detail}p(X,!0);var t=We.x-tn.x,n=We.y-tn.y;(g.modal||t<=Fe.min.x&&t>=Fe.max.x&&n<=Fe.min.y&&n>=Fe.max.y)&&e.preventDefault(),h.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:Be.x/2+Ge.x,y:Be.y/2+Ge.y};var t=g.getDoubleTapZoom(!0,h.currItem),n=X===t;h.mouseZoomedIn=!n,h.zoomTo(n?h.currItem.initialZoomLevel:t,e,333),f[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}});function on(){return vn.hash.substring(1)}function rn(){ln&&clearTimeout(ln),cn&&clearTimeout(cn)}function an(){var e=on(),t={};if(e.length<5)return t;var n,o=e.split("&");for(r=0;r<o.length;r++)o[r]&&((n=o[r].split("=")).length<2||(t[n[0]]=n[1]));if(g.galleryPIDs){for(var i=t.pid,r=t.pid=0;r<qt.length;r++)if(qt[r].pid===i){t.pid=r;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t}var ln,sn,cn,un,dn,pn,mn,fn,hn,gn,vn,yn,wn={history:!0,galleryUID:1},xn=function(){var e,t;cn&&clearTimeout(cn),lt||Te?cn=setTimeout(xn,500):(un?clearTimeout(sn):un=!0,t=K+1,(e=Bt(K)).hasOwnProperty("pid")&&(t=e.pid),e=mn+"&gid="+g.galleryUID+"&pid="+t,fn||-1===vn.hash.indexOf(e)&&(gn=!0),t=vn.href.split("#")[0]+"#"+e,yn?"#"+e!==window.location.hash&&history[fn?"replaceState":"pushState"]("",document.title,t):fn?vn.replace(t):vn.hash=e,fn=!0,sn=setTimeout(function(){un=!1},60))};i("History",{publicMethods:{initHistory:function(){var e,t;f.extend(g,wn,!0),g.history&&(vn=window.location,fn=hn=gn=!1,mn=on(),yn="pushState"in history,-1<mn.indexOf("gid=")&&(mn=(mn=mn.split("&gid=")[0]).split("?gid=")[0]),r("afterChange",h.updateURL),r("unbindEvents",function(){f.unbind(window,"hashchange",h.onHashChange)}),e=function(){pn=!0,hn||(gn?history.back():mn?vn.hash=mn:yn?history.pushState("",document.title,vn.pathname+vn.search):vn.hash=""),rn()},r("unbindEvents",function(){q&&e()}),r("destroy",function(){pn||e()}),r("firstUpdate",function(){K=an().pid}),-1<(t=mn.indexOf("pid="))&&("&"===(mn=mn.substring(0,t)).slice(-1)&&(mn=mn.slice(0,-1))),setTimeout(function(){U&&f.bind(window,"hashchange",h.onHashChange)},40))},onHashChange:function(){return on()===mn?(hn=!0,void h.close()):void(un||(dn=!0,h.goTo(an().pid),dn=!1))},updateURL:function(){rn(),dn||(fn?ln=setTimeout(xn,800):xn())}}}),f.extend(h,t)}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).reframe=t()}(this,function(){"use strict";function t(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var o=Array(e),i=0,t=0;t<n;t++)for(var r=arguments[t],a=0,l=r.length;a<l;a++,i++)o[i]=r[a];return o}return function(e,i){return void 0===i&&(i="js-reframe"),("string"==typeof e?t(document.querySelectorAll(e)):"length"in e?t(e):[e]).forEach(function(e){var t,n,o;-1!==e.className.split(" ").indexOf(i)||-1<e.style.width.indexOf("%")||(t=e.getAttribute("height")||e.offsetHeight,n=e.getAttribute("width")||e.offsetWidth,o=("string"==typeof t?parseInt(t):t)/("string"==typeof n?parseInt(n):n)*100,(t=document.createElement("div")).className=i,(n=t.style).position="relative",n.width="100%",n.paddingTop=o+"%",(o=e.style).position="absolute",o.width="100%",o.height="100%",o.left="0",o.top="0",null!==(o=e.parentNode)&&void 0!==o&&o.insertBefore(t,e),null!==(o=e.parentNode)&&void 0!==o&&o.removeChild(e),t.appendChild(e))})}}),function(){var e=document.querySelector(".gh-burger");e&&e.addEventListener("click",function(){document.body.classList.contains("is-head-open")?document.body.classList.remove("is-head-open"):document.body.classList.add("is-head-open")})}(),document.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),n=e.attributes.width.value,e=e.attributes.height.value;t.style.flex=n/e+" 1 0%"}),lightbox(".kg-gallery-container",".kg-gallery-image",".kg-gallery-image",!1,!0),reframe(document.querySelectorAll(['.gh-content iframe[src*="youtube.com"]','.gh-content iframe[src*="youtube-nocookie.com"]','.gh-content iframe[src*="player.vimeo.com"]','.gh-content iframe[src*="kickstarter.com"][src*="video.html"]',".gh-content object",".gh-content embed"].join(","))),pagination(!1);
//# sourceMappingURL=main.min.js.map