File "photoswipe-bundle.min.js"

Full Path: /home/ycoalition/public_html/blog/wp-content/themes/woodmart/js/libs/photoswipe-bundle.min.js
File size: 39.06 KB
MIME-type: text/plain
Charset: utf-8

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