function Layzr(a){this._lastScroll=0,this._ticking=!1,a=a||{},this._optionsContainer=document.querySelector(a.container)||window,this._optionsSelector=a.selector||"[data-layzr]",this._optionsAttr=a.attr||"data-layzr",this._optionsAttrSrcSet=a.attrSrcSet||"data-layzr-srcset",this._optionsAttrRetina=a.retinaAttr||"data-layzr-retina",this._optionsAttrBg=a.bgAttr||"data-layzr-bg",this._optionsAttrHidden=a.hiddenAttr||"data-layzr-hidden",this._optionsThreshold=a.threshold||0,this._optionsBefore=a.before||null,this._optionsAfter=a.after||null,this._optionsCallback=a.callback||null,this._retina=window.devicePixelRatio>1,this._srcAttr=this._retina?this._optionsAttrRetina:this._optionsAttr,this._nodes=document.querySelectorAll(this._optionsSelector),this._handlerBind=this._requestScroll.bind(this),this._create()}function simple_tooltip(a,b){jQuery(a).each(function(a){jQuery("body").append("
"+jQuery(this).find("span.tooltip-c").html()+"
");var c=jQuery("#"+b+a);jQuery(this).removeAttr("title").mouseover(function(){c.css({opacity:1,display:"none"}).fadeIn(400)}).mousemove(function(a){var b,d,e=jQuery(window).scrollTop(),f=jQuery(window).width(),g=15;b=f-30>=c.width()+a.pageX?a.pageX+g:f-c.width()-g,d=e+30>=a.pageY-c.height()?e+g:a.pageY-c.height()-33,c.css({left:b,top:d})}).mouseout(function(){c.css({left:"-9999px"})})})}jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(1-Math.pow(2,-10*b/e))+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(2-Math.pow(2,-10*--b))+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),h=b-f&&d<=c+f&&!a.hasAttribute(this._optionsAttrHidden)},Layzr.prototype._reveal=function(a){var b=a.getAttribute(this._srcAttr)||a.getAttribute(this._optionsAttr),c=this;if("function"==typeof this._optionsCallback){a.addEventListener?a.addEventListener("load",function(){c._optionsCallback.call(a)}):a.attachEvent("onload",function(){c._optionsCallback.call(a)})}"function"==typeof this._optionsBefore&&this._optionsBefore.call(a),a.hasAttribute(this._optionsAttrBg)?a.style.backgroundImage="url("+b+")":(b&&a.setAttribute("src",b),a.hasAttribute(this._optionsAttrSrcSet)&&a.setAttribute("srcset",a.getAttribute(this._optionsAttrSrcSet))),"function"==typeof this._optionsAfter&&this._optionsAfter.call(a),a.removeAttribute(this._optionsAttr),a.removeAttribute(this._optionsAttrSrcSet),a.removeAttribute(this._optionsAttrRetina),a.removeAttribute(this._optionsAttrBg),a.removeAttribute(this._optionsAttrHidden)},Layzr.prototype.updateSelector=function(){this._nodes=document.querySelectorAll(this._optionsSelector)},Layzr.prototype.update=function(){for(var a=this._nodes.length,b=0;b0,window.requestAnimationFrame&&(d.raf=window.requestAnimationFrame,d.caf=window.cancelAnimationFrame),d.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!d.pointerEvent){var f=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var g=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);g&&g.length>0&&(g=parseInt(g[1],10))>=1&&g<8&&(d.isOldIOSPhone=!0)}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(i<4.4&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|opera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;n<4;n++){c=m[n];for(var o=0;o<3;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;hb-1?a-b:a<0?b+a:a},za={},Aa=function(a,b){return za[a]||(za[a]=[]),za[a].push(b)},Ba=function(a){var b=za[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;df.currItem.fitRatio?wa||(ic(f.currItem,!1,!0),wa=!0):wa&&(ic(f.currItem),wa=!1)),Ea(ca,na.x,na.y,q))},Ga=function(a){a.container&&Ea(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ha=function(a,b){b[C]=s+a+"px, 0px"+t},Ia=function(a,b){if(!g.loop&&b){var c=k+(ra.x*pa-a)/ra.x,d=Math.round(a-pb.x);(c<0&&d>0||c>=Yb()-1&&d<0)&&(a=pb.x+d*g.mainScrollEndFriction)}pb.x=a,Ha(a,l)},Ja=function(a,b){var c=qb[a]-qa[a];return ma[a]+la[a]+c-c*(b/r)},Ka=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},La=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Ma=null,Na=function(){Ma&&(e.unbind(document,"mousemove",Na),e.addClass(a,"pswp--has_mouse"),g.mouseUsed=!0,Ba("mouseUsed")),Ma=setTimeout(function(){Ma=null},100)},Oa=function(){e.bind(document,"keydown",f),L.transform&&e.bind(f.scrollWrap,"click",f),g.mouseUsed||e.bind(document,"mousemove",Na),e.bind(window,"resize scroll orientationchange",f),Ba("bindEvents")},Pa=function(){e.unbind(window,"resize scroll orientationchange",f),e.unbind(window,"scroll",p.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Na),L.transform&&e.unbind(f.scrollWrap,"click",f),T&&e.unbind(window,n,f),clearTimeout(M),Ba("unbindEvents")},Qa=function(a,b){var c=ec(f.currItem,oa,a);return b&&(ba=c),c},Ra=function(a){return a||(a=f.currItem),a.initialZoomLevel},Sa=function(a){return a||(a=f.currItem),a.w>0?g.maxSpreadZoom:1},Ta=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=Ja(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Fa=function(){if(ca){var a=ca,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=na.x+"px",a.top=na.y+"px"}}},Va=function(a){var b="";g.escKey&&27===a.keyCode?b="close":g.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Wa=function(a){a&&(W||V||da||R)&&(a.preventDefault(),a.stopPropagation())},Xa=function(){f.setScrollOffset(0,e.getScrollY())},Ya={},Za=0,$a=function(a){Ya[a]&&(Ya[a].raf&&G(Ya[a].raf),Za--,delete Ya[a])},_a=function(a){Ya[a]&&$a(a),Ya[a]||(Za++,Ya[a]={})},ab=function(){for(var a in Ya)Ya.hasOwnProperty(a)&&$a(a)},bb=function(a,b,c,d,e,f,g){var h,i=Ca();_a(a);var j=function(){if(Ya[a]){if((h=Ca()-i)>=d)return $a(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),Ya[a].raf=F(j)}};j()},cb={shout:Ba,listen:Aa,viewportSize:oa,options:g,isMainScrollAnimating:function(){return da},getZoomLevel:function(){return q},getCurrentIndex:function(){return k},isDragging:function(){return T},isZooming:function(){return $},setScrollOffset:function(a,b){qa.x=a,K=qa.y=b,Ba("updateScrollOffset",qa)},applyZoomPan:function(a,b,c,d){na.x=b,na.y=c,q=a,Fa(d)},init:function(){if(!h&&!i){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),H=a.className,h=!0,L=e.detectFeatures(),F=L.raf,G=L.caf,C=L.transform,J=L.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),l=f.container.style,f.itemHolders=w=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],w[0].el.style.display=w[2].el.style.display="none",Ua(),p={resize:f.updateSize,orientationchange:function(){clearTimeout(M),M=setTimeout(function(){oa.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:Xa,keydown:Va,click:Wa};var d=L.isOldIOSPhone||L.isOldAndroid||L.isMobileOpera;for(L.animationName&&L.transform&&!d||(g.showAnimationDuration=g.hideAnimationDuration=0),c=0;c=Yb())&&(k=0),f.currItem=Xb(k),(L.isOldIOSPhone||L.isOldAndroid)&&(ta=!1),a.setAttribute("aria-hidden","false"),g.modal&&(ta?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===K&&(Ba("initialLayout"),K=I=e.getScrollY());var j="pswp--open ";for(g.mainClass&&(j+=g.mainClass+" "),g.showHideOpacity&&(j+="pswp--animate_opacity "),j+=E?"pswp--touch":"pswp--notouch",j+=L.animationName?" pswp--css_animation":"",j+=L.svg?" pswp--svg":"",e.addClass(a,j),f.updateSize(),m=-1,sa=null,c=0;c<3;c++)Ha((c+m)*ra.x,w[c].el.style);J||e.bind(f.scrollWrap,o,f),Aa("initialZoomInEnd",function(){f.setContent(w[0],k-1),f.setContent(w[2],k+1),w[0].el.style.display=w[2].el.style.display="block",g.focus&&a.focus(),Oa()}),f.setContent(w[1],k),f.updateCurrItem(),Ba("afterInit"),ta||(u=setInterval(function(){Za||T||$||q!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),e.addClass(a,"pswp--visible")}},close:function(){h&&(h=!1,i=!0,Ba("close"),Pa(),$b(f.currItem,null,!0,f.destroy))},destroy:function(){Ba("destroy"),Tb&&clearTimeout(Tb),a.setAttribute("aria-hidden","true"),a.className=H,u&&clearInterval(u),e.unbind(f.scrollWrap,o,f),e.unbind(window,"scroll",f),vb(),ab(),za=null},panTo:function(a,b,c){c||(a>ba.min.x?a=ba.min.x:aba.min.y?b=ba.min.y:b=3&&(m+=sa+(sa>0?-3:3),c=3);for(var d=0;d0?(b=w.shift(),w[2]=b,m++,Ha((m+2)*ra.x,b.el.style),f.setContent(b,k-c+d+1+1)):(b=w.pop(),w.unshift(b),m--,Ha(m*ra.x,b.el.style),f.setContent(b,k+c-d-1-1));if(ca&&1===Math.abs(sa)){var e=Xb(x);e.initialZoomLevel!==q&&(ec(e,oa),ic(e),Ga(e))}sa=0,f.updateCurrZoomItem(),x=k,Ba("afterChange")}}},updateSize:function(b){if(!ta&&g.modal){var c=e.getScrollY();if(K!==c&&(a.style.top=c+"px",K=c),!b&&va.x===window.innerWidth&&va.y===window.innerHeight)return;va.x=window.innerWidth,va.y=window.innerHeight,a.style.height=va.y+"px"}if(oa.x=f.scrollWrap.clientWidth,oa.y=f.scrollWrap.clientHeight,Xa(),ra.x=oa.x+Math.round(oa.x*g.spacing),ra.y=oa.y,Ia(ra.x*pa),Ba("beforeResize"),void 0!==m){for(var d,h,i,j=0;j<3;j++)d=w[j],Ha((j+m)*ra.x,d.el.style),i=k+j-1,g.loop&&Yb()>2&&(i=ya(i)),h=Xb(i),h&&(v||h.needsUpdate||!h.bounds)?(f.cleanSlide(h),f.setContent(d,i),1===j&&(f.currItem=h,f.updateCurrZoomItem(!0)),h.needsUpdate=!1):-1===d.index&&i>=0&&f.setContent(d,i),h&&h.container&&(ec(h,oa),ic(h),Ga(h));v=!1}r=q=f.currItem.initialZoomLevel,ba=f.currItem.bounds,ba&&(na.x=ba.center.x,na.y=ba.center.y,Fa(!0)),Ba("resize")},zoomTo:function(a,b,c,d,f){b&&(r=q,qb.x=Math.abs(b.x)-na.x,qb.y=Math.abs(b.y)-na.y,Ka(ma,na));var g=Qa(a,!1),h={};Ta("x",g,h,a),Ta("y",g,h,a);var i=q,j={x:na.x,y:na.y};La(h);var k=function(b){1===b?(q=a,na.x=h.x,na.y=h.y):(q=(a-i)*b+i,na.x=(h.x-j.x)*b+j.x,na.y=(h.y-j.y)*b+j.y),f&&f(b),Fa(1===b)};c?bb("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},db={},eb={},fb={},gb={},hb={},ib=[],jb={},kb=[],lb={},mb=0,nb=ka(),ob=0,pb=ka(),qb=ka(),rb=ka(),sb=function(a,b){return a.x===b.x&&a.y===b.y},tb=function(a,b){return Math.abs(a.x-b.x)<25&&Math.abs(a.y-b.y)<25},ub=function(a,b){return lb.x=Math.abs(a.x-b.x),lb.y=Math.abs(a.y-b.y),Math.sqrt(lb.x*lb.x+lb.y*lb.y)},vb=function(){X&&(G(X),X=null)},wb=function(){T&&(X=F(wb),Mb())},xb=function(){return!("fit"===g.scaleMode&&q===f.currItem.initialZoomLevel)},yb=function(a,b){return!(!a||a===document)&&!(a.getAttribute("class")&&a.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(b(a)?a:yb(a.parentNode,b))},zb={},Ab=function(a,b){return zb.prevent=!yb(a.target,g.isClickableElement),Ba("preventDragEvent",a,b,zb),zb.prevent},Bb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Cb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Db=function(a,b,c){if(a-O>50){var d=kb.length>2?kb.shift():{};d.x=b,d.y=c,kb.push(d),O=a}},Eb=function(){var a=na.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(oa.y/2))},Fb={},Gb={},Hb=[],Ib=function(a){for(;Hb.length>0;)Hb.pop();return D?(ja=0,ib.forEach(function(a){0===ja?Hb[0]=a:1===ja&&(Hb[1]=a),ja++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Hb[0]=Bb(a.touches[0],Fb),a.touches.length>1&&(Hb[1]=Bb(a.touches[1],Gb))):(Fb.x=a.pageX,Fb.y=a.pageY,Fb.id="",Hb[0]=Fb),Hb},Jb=function(a,b){var c,d,e,h,i=na[a]+b[a],j=b[a]>0,k=pb.x+b.x,l=pb.x-jb.x;return c=i>ba.min[a]||iba.min[a]&&(c=g.panEndFriction,ba.min[a]-i,d=ba.min[a]-ma[a]),(d<=0||l<0)&&Yb()>1?(h=k,l<0&&k>jb.x&&(h=jb.x)):ba.min.x!==ba.max.x&&(e=i)):(i0)&&Yb()>1?(h=k,l>0&&kf.currItem.fitRatio&&(na[a]+=b[a]*c)):(void 0!==h&&(Ia(h,!0),Y=h!==jb.x),ba.min.x!==ba.max.x&&(void 0!==e?na.x=e:Y||(na.x+=b.x*c)),void 0!==h)},Kb=function(a){if(!("mousedown"===a.type&&a.button>0)){if(Wb)return void a.preventDefault();if(!S||"mousedown"!==a.type){if(Ab(a,!0)&&a.preventDefault(),Ba("pointerDown"),D){var b=e.arraySearch(ib,a.pointerId,"id");b<0&&(b=ib.length),ib[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Ib(a),d=c.length;Z=null,ab(),T&&1!==d||(T=fa=!0,e.bind(window,n,f),Q=ia=ga=R=Y=W=U=V=!1,ea=null,Ba("firstTouchStart",c),Ka(ma,na),la.x=la.y=0,Ka(gb,c[0]),Ka(hb,gb),jb.x=ra.x*pa,kb=[{x:gb.x,y:gb.y}],O=N=Ca(),Qa(q,!0),vb(),wb()),!$&&d>1&&!da&&!Y&&(r=q,V=!1,$=U=!0,la.y=la.x=0,Ka(ma,na),Ka(db,c[0]),Ka(eb,c[1]),Cb(db,eb,rb),qb.x=Math.abs(rb.x)-na.x,qb.y=Math.abs(rb.y)-na.y,_=aa=ub(db,eb))}}},Lb=function(a){if(a.preventDefault(),D){var b=e.arraySearch(ib,a.pointerId,"id");if(b>-1){var c=ib[b];c.x=a.pageX,c.y=a.pageY}}if(T){var d=Ib(a);if(ea||W||$)Z=d;else if(pb.x!==ra.x*pa)ea="h";else{var f=Math.abs(d[0].x-gb.x)-Math.abs(d[0].y-gb.y);Math.abs(f)>=10&&(ea=f>0?"h":"v",Z=d)}}},Mb=function(){if(Z){var a=Z.length;if(0!==a)if(Ka(db,Z[0]),fb.x=db.x-gb.x,fb.y=db.y-gb.y,$&&a>1){if(gb.x=db.x,gb.y=db.y,!fb.x&&!fb.y&&sb(Z[1],eb))return;Ka(eb,Z[1]),V||(V=!0,Ba("zoomGestureStarted"));var b=ub(db,eb),c=Rb(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ia=!0);var d=1,e=Ra(),h=Sa();if(c1&&(d=1),c=e-d*(e/3);else c>h&&(d=(c-h)/(6*e),d>1&&(d=1),c=h+d*e);d<0&&(d=0),_=b,Cb(db,eb,nb),la.x+=nb.x-rb.x,la.y+=nb.y-rb.y,Ka(rb,nb),na.x=Ja("x",c),na.y=Ja("y",c),Q=c>q,q=c,Fa()}else{if(!ea)return;if(fa&&(fa=!1,Math.abs(fb.x)>=10&&(fb.x-=Z[0].x-hb.x),Math.abs(fb.y)>=10&&(fb.y-=Z[0].y-hb.y)),gb.x=db.x,gb.y=db.y,0===fb.x&&0===fb.y)return;if("v"===ea&&g.closeOnVerticalDrag&&!xb()){la.y+=fb.y,na.y+=fb.y;var k=Eb();return R=!0,Ba("onVerticalDrag",k),Da(k),void Fa()}Db(Ca(),db.x,db.y),W=!0,ba=f.currItem.bounds;var l=Jb("x",fb);l||(Jb("y",fb),La(na),Fa())}}},Nb=function(a){if(L.isOldAndroid){if(S&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(S),S=setTimeout(function(){S=0},600))}Ba("pointerUp"),Ab(a,!1)&&a.preventDefault();var b;if(D){var c=e.arraySearch(ib,a.pointerId,"id");if(c>-1)if(b=ib.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var h,i=Ib(a),j=i.length;if("mouseup"===a.type&&(j=0),2===j)return Z=null,!0;1===j&&Ka(hb,i[0]),0!==j||ea||da||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Ba("touchRelease",a,b));var k=-1;if(0===j&&(T=!1,e.unbind(window,n,f),vb(),$?k=0:-1!==ob&&(k=Ca()-ob)),ob=1===j?Ca():-1,h=-1!==k&&k<150?"zoom":"swipe",$&&j<2&&($=!1,1===j&&(h="zoomPointerUp"),Ba("zoomGestureEnded")),Z=null,W||V||da||R)if(ab(),P||(P=Ob()),P.calculateSwipeSpeed("x"),R){var l=Eb();if(lf.currItem.fitRatio&&Pb(P))}},Ob=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){kb.length>1?(a=Ca()-O+50,b=kb[kb.length-2][d]):(a=Ca()-N,b=hb[d]),c.lastFlickOffset[d]=gb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(na[a]>ba.min[a]?c.backAnimDestination[a]=ba.min[a]:na[a]30&&(i||b.lastFlickOffset.x>20)?d=-1:h<-30&&(i||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(k+=d,k<0?(k=g.loop?Yb()-1:0,j=!0):k>=Yb()&&(k=g.loop?0:Yb()-1,j=!0),j&&!g.loop||(sa+=d,pa-=d,c=!0));var l,m=ra.x*pa,n=Math.abs(m-pb.x);return c||m>pb.x==b.lastFlickSpeed.x>0?(l=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,l=Math.min(l,400),l=Math.max(l,250)):l=333,mb===k&&(c=!1),da=!0,Ba("mainScrollAnimStart"),bb("mainScroll",pb.x,m,l,e.easing.cubic.out,Ia,function(){ab(),da=!1,mb=-1,(c||mb!==k)&&f.updateCurrItem(),Ba("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Rb=function(a){return 1/aa*a*r},Sb=function(){var a=q,b=Ra(),c=Sa();qc&&(a=c);var d,g=ha;return ga&&!Q&&!ia&&q1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=E,p[y]=Kb,p[z]=Lb,p[A]=Nb,B&&(p[B]=p[A]),L.touch&&(o+=" mousedown",n+=" mousemove mouseup",p.mousedown=p[y],p.mousemove=p[z],p.mouseup=p[A]),E||(g.allowPanToNext=!1)}}});var Tb,Ub,Vb,Wb,Xb,Yb,Zb,$b=function(b,c,d,h){Tb&&clearTimeout(Tb),Wb=!0,Vb=!0;var i;b.initialLayout?(i=b.initialLayout,b.initialLayout=null):i=g.getThumbBoundsFn&&g.getThumbBoundsFn(k);var l=d?g.hideAnimationDuration:g.showAnimationDuration,m=function(){$a("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Da(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Ba("initialZoom"+(d?"OutEnd":"InEnd"))),h&&h(),Wb=!1};if(!l||!i||void 0===i.x)return Ba("initialZoom"+(d?"Out":"In")),q=b.initialZoomLevel,Ka(na,b.initialPosition),Fa(),a.style.opacity=d?0:1,Da(1),void(l?setTimeout(function(){m()},l):m());!function(){var c=j,h=!f.currItem.src||f.currItem.loadError||g.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(q=i.w/b.w,na.x=i.x,na.y=i.y-I,f[h?"template":"bg"].style.opacity=.001,Fa()),_a("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),h&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Tb=setTimeout(function(){if(Ba("initialZoom"+(d?"Out":"In")),d){var f=i.w/b.w,g={x:na.x,y:na.y},j=q,k=ha,n=function(b){1===b?(q=f,na.x=i.x,na.y=i.y-K):(q=(f-j)*b+j,na.x=(i.x-g.x)*b+g.x,na.y=(i.y-K-g.y)*b+g.y),Fa(),h?a.style.opacity=1-b:Da(k-b*k)};c?bb("initialZoom",0,1,l,e.easing.cubic.out,n,m):(n(1),Tb=setTimeout(m,l+20))}else q=b.initialZoomLevel,Ka(na,b.initialPosition),Fa(),Da(1),h?a.style.opacity=1:Da(1),Tb=setTimeout(m,l+20)},d?25:90)}()},_b={},ac=[],bc={index:0,errorMsg:'
The image could not be loaded.
',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Ub.length}},cc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},dc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((_b.x-b)/2),d.center.y=Math.round((_b.y-c)/2)+a.vGap.top,d.max.x=b>_b.x?Math.round(_b.x-b):d.center.x,d.max.y=c>_b.y?Math.round(_b.y-c)+a.vGap.top:d.center.y,d.min.x=b>_b.x?0:d.center.x,d.min.y=c>_b.y?a.vGap.top:d.center.y},ec=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Ba("parseVerticalMargin",a)),_b.x=b.x,_b.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=_b.x/a.w,f=_b.y/a.h;a.fitRatio=e1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=cc())}if(!c)return;return dc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=cc(),a.initialPosition=a.bounds.center,a.bounds},fc=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,ic(b,d,b===f.currItem&&wa),c.appendChild(d),g&&setTimeout(function(){ b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},gc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},hc=function(a,b){if(a.src&&a.loadError&&a.container)return b&&(a.container.innerHTML=""),a.container.innerHTML=g.errorMsg.replace("%url%",a.src),!0},ic=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},jc=function(){if(ac.length){for(var a,b=0;b=0,e=Math.min(c[0],Yb()),h=Math.min(c[1],Yb());for(b=1;b<=(d?h:e);b++)f.lazyLoadItem(k+b);for(b=1;b<=(d?e:h);b++)f.lazyLoadItem(k-b)}),Aa("initialLayout",function(){f.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(k)}),Aa("mainScrollAnimComplete",jc),Aa("initialZoomInEnd",jc),Aa("destroy",function(){for(var a,b=0;b=0&&void 0!==Ub[a]&&Ub[a]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!E||g.mouseUsed||screen.width>1200},setContent:function(a,b){g.loop&&(b=ya(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,i=f.getItemAt(b);if(!i)return void(a.el.innerHTML="");Ba("gettingData",b,i),a.index=b,a.item=i;var j=i.container=e.createEl("pswp__zoom-wrap");if(!i.src&&i.html&&(i.html.tagName?j.appendChild(i.html):j.innerHTML=i.html),hc(i),ec(i,oa),!i.src||i.loadError||i.loaded)i.src&&!i.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=i.src,ic(i,d),fc(0,i,j,d));else{if(i.loadComplete=function(c){if(h){if(a&&a.index===b){if(hc(c,!0))return c.loadComplete=c.img=null,ec(c,oa),Ga(c),void(a.index===k&&f.updateCurrZoomItem());c.imageAppended?!Wb&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):L.transform&&(da||Wb)?ac.push({item:c,baseDiv:j,img:c.img,index:b,holder:a,clearPlaceholder:!0}):fc(0,c,j,c.img,0,!0)}c.loadComplete=null,c.img=null,Ba("imageLoadComplete",b,c)}},e.features.transform){var l="pswp__img pswp__img--placeholder";l+=i.msrc?"":" pswp__img--placeholder--blank";var m=e.createEl(l,i.msrc?"img":"");i.msrc&&(m.src=i.msrc),ic(i,m),j.appendChild(m),i.placeholder=m}i.loading||gc(i),f.allowProgressiveImg()&&(!Vb&&L.transform?ac.push({item:i,baseDiv:j,img:i.img,index:b,holder:a}):fc(0,i,j,i.img,0,!0))}Vb||b!==k?Ga(i):(ca=j.style,$b(i,d||i.img)),a.el.innerHTML="",a.el.appendChild(j)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var kc,lc={},mc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};xa("Tap",{publicMethods:{initTap:function(){Aa("firstTouchStart",f.onTapStart),Aa("touchRelease",f.onTapRelease),Aa("destroy",function(){lc={},kc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(kc),kc=null)},onTapRelease:function(a,b){if(b&&!W&&!U&&!Za){var c=b;if(kc&&(clearTimeout(kc),kc=null,tb(c,lc)))return void Ba("doubleTap",c);if("mouse"===b.type)return void mc(a,b,"mouse");if("BUTTON"===a.target.tagName.toUpperCase()||e.hasClass(a.target,"pswp__single-tap"))return void mc(a,b);Ka(lc,c),kc=setTimeout(function(){mc(a,b),kc=null},300)}}}});var nc;xa("DesktopZoom",{publicMethods:{initDesktopZoom:function(){J||(E?Aa("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){nc={};var c="wheel mousewheel DOMMouseScroll";Aa("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Aa("unbindEvents",function(){nc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),q<1?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Aa("resize",g),Aa("afterChange",g),Aa("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Aa("pointerUp",h),b||g()},handleMouseWheel:function(a){if(q<=f.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||Za||T?a.preventDefault():C&&Math.abs(a.deltaY)>2&&(j=!0,f.close())),!0;if(a.stopPropagation(),nc.x=0,"deltaX"in a)1===a.deltaMode?(nc.x=18*a.deltaX,nc.y=18*a.deltaY):(nc.x=a.deltaX,nc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(nc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?nc.y=-.16*a.wheelDeltaY:nc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;nc.y=a.detail}Qa(q,!0);var b=na.x-nc.x,c=na.y-nc.y;(g.modal||b<=ba.min.x&&b>=ba.max.x&&c<=ba.min.y&&c>=ba.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:oa.x/2+qa.x,y:oa.y/2+qa.y};var c=g.getDoubleTapZoom(!0,f.currItem),d=q===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac={history:!0,galleryUID:1},Bc=function(){return yc.hash.substring(1)},Cc=function(){oc&&clearTimeout(oc),qc&&clearTimeout(qc)},Dc=function(){var a=Bc(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c-1&&(uc=uc.substring(0,b),"&"===uc.slice(-1)&&(uc=uc.slice(0,-1))),setTimeout(function(){h&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Bc()===uc?(wc=!0,void f.close()):void(rc||(sc=!0,f.goTo(Dc().pid),sc=!1))},updateURL:function(){Cc(),sc||(vc?oc=setTimeout(Ec,800):Ec())}}}),e.extend(f,cb)}}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";return function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.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 a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!(!c.href||!c.hasAttribute("download")&&(window.open(c.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)),y||F(),1))},H=function(){for(var a,b,c,d,e,f="",g=0;g