!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,z,t,n){function e(){return{x:0,y:0}}function N(e,t){g.extend(w,t.publicMethods),Be.push(e)}function K(e){var t=L();return t-1t.min[e]?n[e]=t.min[e]:n[e]=ut&&(y=0w.currItem.fitRatio&&Kt(be))}}var V,X,j,m,$,J,Q,ee,o,f,te,ne,oe,ie,ae,r,re,le,se,ue,ce,de,pe,i,me,fe,he,xe,ye,ge,l,we,ve,be,Ce,Ie,Te,s,Ee,De,_e,Se,Me,u,c,Fe,d,h,x,y,ke,Oe,Ae,Re,Le,g={features:null,bind:function(e,t,n,o){var i=(o?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;aw.currItem.fitRatio?We||(rn(w.currItem,!1,!0),We=!0):We&&(rn(w.currItem),We=!1)),Ge(h,b.x,b.y,f))},qe=function(e){e.container&&Ge(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Ve=function(e,t){t[de]=ne+e+"px, 0px"+oe},Xe=function(e,t){var n;!v.loop&&t&&(t=m+(I.x*Ne-e)/I.x,n=Math.round(e-R.x),t<0&&0=L()-1&&n<0)&&(e=R.x+n*v.mainScrollEndFriction),R.x=e,Ve(e,$)},je=function(e,t){var n=wt[e]-Ke[e];return ze[e]+Pe[e]+n-t/te*n},M=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},$e=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Je=null,Qe=function(){Je&&(g.unbind(document,"mousemove",Qe),g.addClass(p,"pswp--has_mouse"),v.mouseUsed=!0,E("mouseUsed")),Je=setTimeout(function(){Je=null},100)},et=function(e,t){e=on(w.currItem,C,e);return t&&(d=e),e},tt=function(e){return(e=e||w.currItem).initialZoomLevel},nt=function(e){return 0<(e=e||w.currItem).w?v.maxSpreadZoom:1},F={},ot=0,it=function(e){F[e]&&(F[e].raf&&fe(F[e].raf),ot--,delete F[e])},at=function(e){F[e]&&it(e),F[e]||(ot++,F[e]={})},rt=function(){for(var e in F)F.hasOwnProperty(e)&&it(e)},lt=function(e,t,n,o,i,a,r){function l(){F[e]&&(s=D()-u,o<=s?(it(e),a(n),r&&r()):(a((n-t)*i(s/o)+t),F[e].raf=me(l)))}var s,u=D();at(e);l()},n={shout:E,listen:a,viewportSize:C,options:v,isMainScrollAnimating:function(){return x},getZoomLevel:function(){return f},getCurrentIndex:function(){return m},isDragging:function(){return s},isZooming:function(){return c},setScrollOffset:function(e,t){Ke.x=e,ge=Ke.y=t,E("updateScrollOffset",Ke)},applyZoomPan:function(e,t,n,o){b.x=t,b.y=n,f=e,S(o)},init:function(){if(!V&&!X){w.framework=g,w.template=p,w.bg=g.getChildByClass(p,"pswp__bg"),he=p.className,V=!0,l=g.detectFeatures(),me=l.raf,fe=l.caf,de=l.transform,ye=l.oldIE,w.scrollWrap=g.getChildByClass(p,"pswp__scroll-wrap"),w.container=g.getChildByClass(w.scrollWrap,"pswp__container"),$=w.container.style,w.itemHolders=r=[{el:w.container.children[0],wrap:0,index:-1},{el:w.container.children[1],wrap:0,index:-1},{el:w.container.children[2],wrap:0,index:-1}],r[0].el.style.display=r[2].el.style.display="none",de?(t=l.perspective&&!i,ne="translate"+(t?"3d(":"("),oe=l.perspective?", 0px)":")"):(de="left",g.addClass(p,"pswp--ie"),Ve=function(e,t){t.left=e+"px"},qe=function(e){var t=1=L())&&(m=0),w.currItem=$t(m),(l.isOldIOSPhone||l.isOldAndroid)&&(Ue=!1),p.setAttribute("aria-hidden","false"),v.modal&&(Ue?p.style.position="fixed":(p.style.position="absolute",p.style.top=g.getScrollY()+"px")),void 0===ge&&(E("initialLayout"),ge=xe=g.getScrollY());var n="pswp--open ";for(v.mainClass&&(n+=v.mainClass+" "),v.showHideOpacity&&(n+="pswp--animate_opacity "),n=(n=(n+=i?"pswp--touch":"pswp--notouch")+(l.animationName?" pswp--css_animation":""))+(l.svg?" pswp--svg":""),g.addClass(p,n),w.updateSize(),J=-1,T=null,e=0;e<3;e++)Ve((e+J)*I.x,r[e].el.style);ye||g.bind(w.scrollWrap,ee,w),a("initialZoomInEnd",function(){w.setContent(r[0],m-1),w.setContent(r[2],m+1),r[0].el.style.display=r[2].el.style.display="block",v.focus&&p.focus(),g.bind(document,"keydown",w),l.transform&&g.bind(w.scrollWrap,"click",w),v.mouseUsed||g.bind(document,"mousemove",Qe),g.bind(window,"resize scroll",w),E("bindEvents")}),w.setContent(r[1],m),w.updateCurrItem(),E("afterInit"),Ue||(ie=setInterval(function(){ot||s||c||f!==w.currItem.initialZoomLevel||w.updateSize()},1e3)),g.addClass(p,"pswp--visible")}},close:function(){V&&(X=!(V=!1),E("close"),g.unbind(window,"resize",w),g.unbind(window,"scroll",o.scroll),g.unbind(document,"keydown",w),g.unbind(document,"mousemove",Qe),l.transform&&g.unbind(w.scrollWrap,"click",w),s&&g.unbind(window,Q,w),E("unbindEvents"),Jt(w.currItem,null,!0,w.destroy))},destroy:function(){E("destroy"),qt&&clearTimeout(qt),p.setAttribute("aria-hidden","true"),p.className=he,ie&&clearInterval(ie),g.unbind(w.scrollWrap,ee,w),g.unbind(window,"scroll",w),It(),rt(),Ye=null},panTo:function(e,t,n){n||(e>d.min.x?e=d.min.x:ed.min.y?t=d.min.y:td.min[e]||ad.min[e]&&(u=v.panEndFriction,d.min[e],n=d.min[e]-ze[e]),(n<=0||s<0)&&1mt.x&&(i=mt.x)):d.min.x!==d.max.x&&(o=a)):(aw.currItem.fitRatio&&(b[e]+=t[e]*u)},zt=function(){if(u){var e,t,n,o,i,a=u.length;if(0!==a)if(M(k,u[0]),O.x=k.x-A.x,O.y=k.y-A.y,c&&1w.currItem.initialZoomLevel+w.currItem.initialZoomLevel/15&&(Re=!0),t=1,n=tt(),o=nt(),e=ut&&(O.x-=u[0].x-dt.x),Math.abs(O.y)>=ut)&&(O.y-=u[0].y-dt.y),A.x=k.x,A.y=k.y,0!==O.x||0!==O.y)){if("v"===y&&v.closeOnVerticalDrag)if(!Et())return Pe.y+=O.y,b.y+=O.y,i=Ot(),Ie=!0,E("onVerticalDrag",i),_(i),void S();kt(D(),k.x,k.y),_e=!0,d=w.currItem.bounds,Pt("x",O)||(Pt("y",O),$e(b),S())}}},Nt=function(){var t,n,o={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=(1d.min[t]?o.backAnimDestination[t]=d.min[t]:b[t]=L()&&(m=v.loop?0:L()-1,i=!0),i&&!v.loop||(T+=o,Ne-=o,n=!0));var n,o,i,e=I.x*Ne,a=Math.abs(e-R.x),r=n||e>R.x==0The image could not be loaded.',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Vt.length}},tn=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},nn=function(e,t,n){var o=e.bounds;o.center.x=Math.round((Z.x-t)/2),o.center.y=Math.round((Z.y-n)/2)+e.vGap.top,o.max.x=t>Z.x?Math.round(Z.x-t):o.center.x,o.max.y=n>Z.y?Math.round(Z.y-n)+e.vGap.top:o.center.y,o.min.x=t>Z.x?0:o.center.x,o.min.y=n>Z.y?e.vGap.top:o.center.y},on=function(e,t,n){var o,i;return e.src&&!e.loadError?((o=!n)&&(e.vGap||(e.vGap={top:0,bottom:0}),E("parseVerticalMargin",e)),Z.x=t.x,Z.y=t.y-e.vGap.top-e.vGap.bottom,o&&(t=Z.x/e.w,i=Z.y/e.h,e.fitRatio=t=d.max.x&&n<=d.min.y&&n>=d.max.y)&&e.preventDefault(),w.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:C.x/2+Ke.x,y:C.y/2+Ke.y};var t=v.getDoubleTapZoom(!0,w.currItem),n=f===t;w.mouseZoomedIn=!n,w.zoomTo(n?w.currItem.initialZoomLevel:t,e,333),g[(n?"remove":"add")+"Class"](p,"pswp--zoomed-in")}}}),g.extend(w,n)}}),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"+e.label+"";if(E.parseShareButtonOut)i=E.parseShareButtonOut(e,i)}y.children[0].innerHTML=i,y.children[0].onclick=z}}function a(e){for(var t=0;t