1/* PhotoSwipe - v4.1.2 - 2017-04-05 2* http://photoswipe.com 3* Copyright (c) 2017 Dmitry Semenov; */ 4!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";var e;return function(m,i,e,t){ 5/*>>framework-bridge*/ 6/** 7 * 8 * Set of generic functions used by gallery. 9 * 10 * You're free to modify anything here as long as functionality is kept. 11 * 12 */ 13var h={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){var n=document.createElement(t||"div");return e&&(n.className=e),n},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){h.bind(e,t,n,!0)},removeClass:function(e,t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){h.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(h.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}} 14/* 15 elastic: { 16 out: function ( k ) { 17 18 var s, a = 0.1, p = 0.4; 19 if ( k === 0 ) return 0; 20 if ( k === 1 ) return 1; 21 if ( !a || a < 1 ) { a = 1; s = p / 4; } 22 else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI ); 23 return ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 ); 24 25 }, 26 }, 27 back: { 28 out: function ( k ) { 29 var s = 1.70158; 30 return --k * k * ( ( s + 1 ) * k + s ) + 1; 31 } 32 } 33 */}, 34/** 35 * 36 * @return {object} 37 * 38 * { 39 * raf : request animation frame function 40 * caf : cancel animation frame function 41 * transfrom : transform property key (with vendor), or null if not supported 42 * oldIE : IE8 or below 43 * } 44 * 45 */ 46detectFeatures:function(){if(h.features)return h.features;var e,t=h.createEl().style,n="",o={}; 47// IE8 and below 48// fix false-positive detection of old Android in new IE 49// (IE11 ua string contains "Android 4.0") 50if(o.oldIE=document.all&&!document.addEventListener,o.touch="ontouchstart"in window,window.requestAnimationFrame&&(o.raf=window.requestAnimationFrame,o.caf=window.cancelAnimationFrame),o.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!o.pointerEvent){var i=navigator.userAgent; 51// Detect if device is iPhone or iPod and if it's older than iOS 8 52// http://stackoverflow.com/a/14223920 53// 54// This detection is made because of buggy top/bottom toolbars 55// that don't trigger window.resize event. 56// For more info refer to _isFixedPosition variable in core.js 57if(/iP(hone|od)/.test(navigator.platform)){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);a&&0<a.length&&1<=(a=parseInt(a[1],10))&&a<8&&(o.isOldIOSPhone=!0)} 58// Detect old Android (before KitKat) 59// due to bugs related to position:fixed 60// http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript 61var r=i.match(/Android\s([0-9\.]*)/),l=r?r[1]:0;1<=(l=parseFloat(l))&&(l<4.4&&(o.isOldAndroid=!0),o.androidVersion=l),o.isMobileOpera=/opera mini|o
61pera mobi/i.test(i)}for(var s=["transform","perspective","animationName"],u=["","webkit","Moz","ms","O"],c,d,p=0;p<4;p++){n=u[p];for(var m=0;m<3;m++)c=s[m], 62// uppercase first letter of property name, if vendor is present 63d=n+(n?c.charAt(0).toUpperCase()+c.slice(1):c),!o[c]&&d in t&&(o[c]=d);n&&!o.raf&&(n=n.toLowerCase(),o.raf=window[n+"RequestAnimationFrame"],o.raf&&(o.caf=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]))}if(!o.raf){var f=0;o.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-f)),o=window.setTimeout(function(){e(t+n)},n);return f=t+n,o},o.caf=function(e){clearTimeout(e)}} 64// Detect SVG support 65return o.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,h.features=o}};h.detectFeatures(), 66// Override addEventListener for old versions of IE 67h.features.oldIE&&(h.bind=function(e,t,n,o){t=t.split(" ");for(var i=(o?"detach":"attach")+"Event",a,r=function(){n.handleEvent.call(n)},l=0;l<t.length;l++)if(a=t[l])if("object"==typeof n&&n.handleEvent){if(o){if(!n["oldIE"+a])return!1}else n["oldIE"+a]=r;e[i]("on"+a,n["oldIE"+a])}else e[i]("on"+a,n)}); 68/*>>framework-bridge*/ 69/*>>core*/ 70//function(template, UiClass, items, options) 71var f=this,n=25,o=3,v={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!0,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e?1:t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0, 72// not fully implemented yet 73scaleMode:"fit"}; 74/** 75 * Static vars, don't change unless you know what you're doing. 76 */h.extend(v,t); 77/** 78 * Private helper variables & functions 79 */ 80var a=function(){return{x:0,y:0}},s,r,g,x,l,u,c={x:0,y:0},d={x:0,y:0},y={x:0,y:0},p,// drag move, drag end & drag cancel events array 81w,// drag start events array 82b,I={},C,T,E,D,S,_,M=0,F={},A={x:0,y:0},// size of slide area, including spacing 83O,k,R=0,// difference of indexes since last content update 84L,P,Z,z,N,U,K=!0,B,H=[],W,Y,G,q,V,X,j,$={},J=!1,Q, 85// Registers PhotoSWipe module (History, Controller ...) 86ee=function(e,t){h.extend(f,t.publicMethods),H.push(e)},te=function(e){var t=an();return t-1<e?e-t:e<0?t+e:e},
87// Micro bind/trigger 88ne={},oe=function(e,t){return ne[e]||(ne[e]=[]),ne[e].push(t)},ie=function(e){var t=ne[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var o=0;o<t.length;o++)t[o].apply(f,n)}},ae=function(){return(new Date).getTime()},re=function(e){yt=e,f.bg.style.opacity=e*v.bgOpacity},le=function(e,t,n,o,i){(!J||i&&i!==f.currItem)&&(o/=i?i.fitRatio:f.currItem.fitRatio),e[N]=E+t+"px, "+n+"px"+D+" scale("+o+")"},se=function(e){pt&&(e&&(C>f.currItem.fitRatio?J||(mn(f.currItem,!1,!0),J=!0):J&&(mn(f.currItem),J=!1)),le(pt,y.x,y.y,C))},ue=function(e){e.container&&le(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},ce=function(e,t){t[N]=E+e+"px, 0px"+D},de=function(e,t){if(!v.loop&&t){var n=x+(A.x*M-e)/A.x,o=Math.round(e-dt.x);(n<0&&0<o||n>=an()-1&&o<0)&&(e=dt.x+o*v.mainScrollEndFriction)}dt.x=e,ce(e,l)},pe=function(e,t){var n=ft[e]-F[e];return d[e]+c[e]+n-n*(t/T)},me=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},fe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},he=null,ve=function(){ 89// Wait until mouse move event is fired at least twice during 100ms 90// We do this, because some mobile browsers trigger it on touchstart 91he&&(h.unbind(document,"mousemove",ve),h.addClass(m,"pswp--has_mouse"),v.mouseUsed=!0,ie("mouseUsed")),he=setTimeout(function(){he=null},100)},ge=function(){h.bind(document,"keydown",f),j.transform&& 92// don't bind click event in browsers that don't support transform (mostly IE8) 93h.bind(f.scrollWrap,"click",f),v.mouseUsed||h.bind(document,"mousemove",ve),h.bind(window,"resize scroll orientationchange",f),ie("bindEvents")},xe=function(){h.unbind(window,"resize scroll orientationchange",f),h.unbind(window,"scroll",b.scroll),h.unbind(document,"keydown",f),h.unbind(document,"mousemove",ve),j.transform&&h.unbind(f.scrollWrap,"click",f),et&&h.unbind(window,p,f),clearTimeout(Q),ie("unbindEvents")},ye=function(e,t){var n=un(f.currItem,I,e);return t&&(ct=n),n},we=function(e){return e||(e=f.currItem),e.initialZoomLevel},be=function(e){return e||(e=f.currItem),0<e.w?v.maxSpreadZoom:1}, 94// Return true if offset is out of the bounds 95Ie=function(e,t,n,o){return o===f.currItem.initialZoomLevel?(n[e]=f.currItem.initialPosition[e],!0):(n[e]=pe(e,o),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]<t.max[e]&&(n[e]=t.max[e],!0))},Ce=function(){if(N){ 96// setup 3d transforms 97var e=j.perspective&&!B;return E="translate"+(e?"3d(":"("),void(D=j.perspective?", 0px)":")")} 98// Override zoom/pan/move functions in case old browser is used (most likely IE) 99// (so they use left/top/width/height, instead of CSS transform) 100N="left",h.addClass(m,"pswp--ie"),ce=function(e,t){t.left=e+"px"},ue=function(e){var t=1<e.fitRatio?1:e.fitRatio,n=e.container.style,o=t*e.w,i=t*e.h;n.width=o+"px",n.height=i+"px",n.left=e.initialPosition.x+"px",n.top=e.initialPosition.y+"px"},se=function(){if(pt){var e=pt,t=f.currItem,n=1<t.fitRatio?1:t.fitRatio,o=n*t.w,i=n*t.h;e.width=o+"px",e.height=i+"px",e.left=y.x+"px",e.top=y.y+"px"}}},Te=function(e){var t="";v.escKey&&27===e.keyCode?t="close":v.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),t&&( 101// don't do anything if special key pressed to prevent from overriding default browser actions 102// e.g. in Chrome on Mac cmd+arrow-left returns to previous page 103e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,f[t]()))},Ee=function(e){e&&(ot||nt||mt||Xe)&&(e.preventDefault(),e.stopPropagation()); 104// don't allow click event to pass through when triggering after drag or some other gesture 105},De=function(){f.setScrollOffset(0,h.getScrollY())},Se={},_e=0,Me=function(e){Se[e]&&(Se[e].raf&&Y(Se[e].raf),_e--,delete Se[e])},Fe=function(e){Se[e]&&Me(e),Se[e]||(_e++,Se[e]={})},Ae=function(){for(var e in Se)Se.hasOwnProperty(e)&&Me(e)},Oe=function(e,t,n,o,i,a,r){var l=ae(),s;Fe(e);var u=function(){if(Se[e]){// time diff 106//b - beginning (start prop) 107//d - anim duration 108if(s=ae()-l,o<=s)return Me(e),a(n),void(r&&r());a((n-t)*i(s/o)+t),Se[e].raf=W(u)}};u()},ke={ 109// make a few local variables and functions public 110shout:ie,listen:oe,viewportSize:I,options:v,isMainScrollAnimating:function(){return mt},getZoomLevel:function(){return C},getCurrentIndex:function(){return x},isDragging:function(){return et},isZooming:function(){return lt},setScrollOffset:function(e,t){F.x=e,X=F.y=t,ie("updateScrollOffset",F)},applyZoomPan:function(e,t,n,o){y.x=t,y.y=n,C=e,se(o)},init:function(){if(!s&&!r){var e;f.framework=h,// basic functionality 111f.template=m,// root DOM element of PhotoSwipe 112f.bg=h.getChildByClass(m,"pswp__bg"),G=m.className,s=!0,j=h.detectFeatures(),W=j.raf,Y=j.caf,N=j.transform,V=j.oldIE,f.scrollWrap=h.getChildByClass(m,"pswp__scroll-wrap"),f.container=h.getChildByClass(f.scrollWrap,"pswp__container"),l=f.container.style,// for fast access 113// Objects that hold slides (there are only 3 in DOM) 114f.itemHolders=O=[{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}], 115// hide nearby item holders until initial zoom animation finishes (to avoid extra Paints) 116O[0].el.style.display=O[2].el.style.display="none",Ce(), 117// Setup global events 118b={resize:f.updateSize, 119// Fixes: iOS 10.3 resize event 120// does not update scrollWrap.clientWidth instantly after resize 121// https://github.com/dimsemenov/PhotoSwipe/issues/1315 122orientationchange:function(){clearTimeout(Q),Q=setTimeout(function(){I.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:De,keydown:Te,click:Ee}; 123// disable show/hide effects on old browsers that don't support CSS animations or transforms, 124// old IOS, Android and Opera mobile. Blackberry seems to work fine, even older models. 125var t=j.isOldIOSPhone||j.isOldAndroid||j.isMobileOpera,n; 126// init modules 127for(j.animationName&&j.transform&&!t||(v.showAnimationDuration=v.hideAnimationDuration=0),e=0;e<H.length;e++)f["init"+H[e]](); 128// init 129if(i)(f.ui=new i(f,h)).init();ie("firstUpdate"),x=x||v.index||0, 130// validate index 131(isNaN(x)||x<0||x>=an())&&(x=0),f.currItem=on(x),(j.isOldIOSPhone||j.isOldAndroid)&&(K=!1),m.setAttribute("aria-hidden","false"),v.modal&&(K?m.style.position="fixed":(m.style.position="absolute",m.style.top=h.getScrollY()+"px")),void 0===X&&(ie("initialLayout"),X=q=h.getScrollY()); 132// add classes to root element of PhotoSwipe 133var o="pswp--open ";for(v.mainClass&&(o+=v.mainClass+" "),v.showHideOpacity&&(o+="pswp--animate_opacity "),o+=B?"pswp--touch":"pswp--notouch",o+=j.animationName?" pswp--css_animation":"",o+=j.svg?" pswp--svg":"",h.addClass(m,o),f.updateSize(), 134// initial update 135u=-1,R=null,e=0;e<3;e++)ce((e+u)*A.x,O[e].el.style);V||h.bind(f.scrollWrap,w,f),oe("initialZoomInEnd",function(){f.setContent(O[0],x-1),f.setContent(O[2],x+1),O[0].el.style.display=O[2].el.style.display="block",v.focus&& 136// focus causes layout, 137// which causes lag during the animation, 138// that's why we delay it untill the initial zoom transition ends 139m.focus(),ge()}), 140// set content for center slide (first time) 141f.setContent(O[1],x),f.updateCurrItem(),ie("afterInit"),K||( 142// On all versions of iOS lower than 8.0, we check size of viewport every second. 143// 144// This is done to detect when Safari top & bottom bars appear, 145// as this action doesn't trigger any events (like resize). 146// 147// On iOS8 they fixed this. 148// 149// 10 Nov 2014: iOS 7 usage ~40%. iOS 8 usage 56%. 150S=setInterval(function(){_e||et||lt||C!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),h.addClass(m,"pswp--visible")}}, 151// Close the gallery, then destroy it
152close:function(){s&&(r=!(s=!1),ie("close"),xe(),jt(f.currItem,null,!0,f.destroy))}, 153// destroys the gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks) 154destroy:function(){ie("destroy"),Xt&&clearTimeout(Xt),m.setAttribute("aria-hidden","true"),m.className=G,S&&clearInterval(S),h.unbind(f.scrollWrap,w,f), 155// we unbind scroll event at the end, as closing animation may depend on it 156h.unbind(window,"scroll",f),Tt(),Ae(),ne=null}, 157/** 158 * Pan image to position 159 * @param {Number} x 160 * @param {Number} y 161 * @param {Boolean} force Will ignore bounds if set to true. 162 */ 163panTo:function(e,t,n){n||(e>ct.min.x?e=ct.min.x:e<ct.max.x&&(e=ct.max.x),t>ct.min.y?t=ct.min.y:t<ct.max.y&&(t=ct.max.y)),y.x=e,y.y=t,se()},handleEvent:function(e){e=e||window.event,b[e.type]&&b[e.type](e)},goTo:function(e){var t=(e=te(e))-x;R=t,x=e,f.currItem=on(x),M-=t,de(A.x*M),Ae(),mt=!1,f.updateCurrItem()},next:function(){f.goTo(x+1)},prev:function(){f.goTo(x-1)}, 164// update current zoom/pan objects 165updateCurrZoomItem:function(e){ 166// itemHolder[1] is middle (current) item 167if(e&&ie("beforeChange",0),O[1].el.children.length){var t=O[1].el.children[0];pt=h.hasClass(t,"pswp__zoom-wrap")?t.style:null}else pt=null;ct=f.currItem.bounds,T=C=f.currItem.initialZoomLevel,y.x=ct.center.x,y.y=ct.center.y,e&&ie("afterChange")},invalidateCurrItems:function(){_=!0;for(var e=0;e<3;e++)O[e].item&&(O[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==R){var t=Math.abs(R),n;if(!(e&&t<2)){f.currItem=on(x),J=!1,ie("beforeChange",R),3<=t&&(u+=R+(0<R?-3:3),t=3);for(var o=0;o<t;o++)0<R?(n=O.shift(),O[2]=n,ce((// move first to last 168++u+2)*A.x,n.el.style),f.setContent(n,x-t+o+1+1)):(n=O.pop(),O.unshift(n),ce(// move last to first 169--u*A.x,n.el.style),f.setContent(n,x+t-o-1-1)); 170// reset zoom/pan on previous item 171if(pt&&1===Math.abs(R)){var i=on(k);i.initialZoomLevel!==C&&(un(i,I),mn(i),ue(i))} 172// reset diff after update 173R=0,f.updateCurrZoomItem(),k=x,ie("afterChange")}}},updateSize:function(e){if(!K&&v.modal){var t=h.getScrollY();if(X!==t&&(m.style.top=t+"px",X=t),!e&&$.x===window.innerWidth&&$.y===window.innerHeight)return;$.x=window.innerWidth,$.y=window.innerHeight, 174//template.style.width = _windowVisibleSize.x + 'px'; 175m.style.height=$.y+"px"}// even may be used for example to switch image sources 176// don't re-calculate size on inital size update 177if(I.x=f.scrollWrap.clientWidth,I.y=f.scrollWrap.clientHeight,De(),A.x=I.x+Math.round(I.x*v.spacing),A.y=I.y,de(A.x*M),ie("beforeResize"),void 0!==u){for(var n,o,i,a=0;a<3;a++)n=O[a],ce((a+u)*A.x,n.el.style),i=x+a-1,v.loop&&2<an()&&(i=te(i)), 178// re-render gallery item if `needsUpdate`, 179// or doesn't have `bounds` (entirely new slide object) 180( 181// update zoom level on items and refresh source (if needsUpdate) 182o=on(i))&&(_||o.needsUpdate||!o.bounds)?(f.cleanSlide(o),f.setContent(n,i), 183// if "center" slide 1841===a&&(f.currItem=o,f.updateCurrZoomItem(!0)),o.needsUpdate=!1):-1===n.index&&0<=i&&
185// add content first time 186f.setContent(n,i),o&&o.container&&(un(o,I),mn(o),ue(o));_=!1}T=C=f.currItem.initialZoomLevel,(ct=f.currItem.bounds)&&(y.x=ct.center.x,y.y=ct.center.y,se(!0)),ie("resize")}, 187// Zoom current item to 188zoomTo:function(t,e,n,o,i){ 189/* 190 if(destZoomLevel === 'fit') { 191 destZoomLevel = self.currItem.fitRatio; 192 } else if(destZoomLevel === 'fill') { 193 destZoomLevel = self.currItem.fillRatio; 194 } 195 */ 196e&&(T=C,ft.x=Math.abs(e.x)-y.x,ft.y=Math.abs(e.y)-y.y,me(d,y));var a=ye(t,!1),r={};Ie("x",a,r,t),Ie("y",a,r,t);var l=C,s=y.x,u=y.y;fe(r);var c=function(e){y.y=1===e?(C=t,y.x=r.x,r.y):(C=(t-l)*e+l,y.x=(r.x-s)*e+s,(r.y-u)*e+u),i&&i(e),se(1===e)};n?Oe("customZoomTo",0,1,n,o||h.easing.sine.inOut,c):c(1)}},Re=30,Le=10,Pe,Ze, 197// pool of objects that are used during dragging of zooming 198ze={},// first point 199Ne={},// second point (for zoom gesture) 200Ue={},Ke={},Be={},He=[],We={},Ye,Ge=[],// array of points during dragging, used to determine type of gesture 201qe={},Ve,Xe,je,$e=0,Je={x:0,y:0},Qe=0,et,// at least one pointer is down 202tt,// at least two _pointers are down 203nt,// zoom level changed during zoom gesture 204ot,it,at,rt,// array of current touch points 205lt,st,ut,ct,dt={x:0,y:0},pt,mt,// true, if animation after swipe gesture is running 206ft={x:0,y:0},ht={x:0,y:0},vt,gt,xt,yt,wt,bt=function(e,t){return e.x===t.x&&e.y===t.y},It=function(e,t){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n},Ct=function(e,t){return qe.x=Math.abs(e.x-t.x),qe.y=Math.abs(e.y-t.y),Math.sqrt(qe.x*qe.x+qe.y*qe.y)},Tt=function(){it&&(Y(it),it=null)},Et=function(){et&&(it=W(Et),Bt())},Dt=function(){return!("fit"===v.scaleMode&&C===f.currItem.initialZoomLevel)}, 207// find the closest parent DOM element 208St=function(e,t){return!(!e||e===document)&&( 209// don't search elements above pswp__scroll-wrap 210!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:St(e.parentNode,t)))},_t={},Mt=function(e,t){return _t.prevent=!St(e.target,v.isClickableElement),ie("preventDragEvent",e,t,_t),_t.prevent},Ft=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},At=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},Ot=function(e,t,n){if(50<e-Ze){var o=2<Ge.length?Ge.shift():{};o.x=t,o.y=n,Ge.push(o),Ze=e}},kt=function(){var e=y.y-f.currItem.initialPosition.y;// difference between initial and current position 211return 1-Math.abs(e/(I.y/2))}, 212// points pool, reused during touch events 213Rt={},Lt={},Pt=[],Zt,zt=function(e){ 214// clean up previous points, without recreating array 215for(;0<Pt.length;)Pt.pop();return U?(Zt=0, 216// we can use forEach, as pointer events are supported only in modern browsers 217He.forEach(function(e){0===Zt?Pt[0]=e:1===Zt&&(Pt[1]=e),Zt++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(Pt[0]=Ft(e.touches[0],Rt),1<e.touches.length&&(Pt[1]=Ft(e.touches[1],Lt))):(Rt.x=e.pageX,Rt.y=e.pageY,Rt.id="",Pt[0]=Rt),Pt},Nt=function(e,t){var n,o=0,i=y[e]+t[e],a,r=0<t[e],l=dt.x+t.x,s=dt.x-We.x,u,c; 218// calculate fdistance over the bounds and friction 219// move main scroll or start panning 220if(n=i>ct.min[e]||i<ct.max[e]?v.panEndFriction:1,i=y[e]+t[e]*n,(v.allowPanToNext||C===f.currItem.initialZoomLevel)&&(pt?"h"!==vt||"x"!==e||nt||(r?(i>ct.min[e]&&(n=v.panEndFriction,o=ct.min[e]-i,a=ct.min[e]-d[e]), 221// drag right 222(a<=0||s<0)&&1<an()?(c=l,s<0&&l>We.x&&(c=We.x)):ct.min.x!==ct.max.x&&(u=i)):(i<ct.max[e]&&(n=v.panEndFriction,o=i-ct.max[e],a=d[e]-ct.max[e]),(a<=0||0<s)&&1<an()?(c=l,0<s&&l<We.x&&(c=We.x)):ct.min.x!==ct.max.x&&(u=i))):c=l,"x"===e))return void 0!==c&&(de(c,!0),at=c!==We.x),ct.min.x!==ct.max.x&&(void 0!==u?y.x=u:at||(y.x+=t.x*n)),void 0!==c;mt||at||C>f.currItem.fitRatio&&(y[e]+=t[e]*n)}, 223// Pointerdown/touchstart/mousedown handler 224Ut=function(e){ 225// Allow dragging only via left mouse button. 226// As this handler is not added in IE8 - we ignore e.which 227// 228// http://www.quirksmode.org/js/events_properties.html 229// https://developer.mozilla.org/en-US/docs/Web/API/event.button 230if(!("mousedown"===e.type&&0<e.button))if(tn)e.preventDefault();else if(!je||"mousedown"!==e.type){if(Mt(e,!0)&&e.preventDefault(),ie("pointerDown"),U){var t=h.arraySearch(He,e.pointerId,"id");t<0&&(t=He.length),He[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=zt(e),o=n.length;rt=null,Ae(), 231// init drag 232et&&1!==o||(et=gt=!0,h.bind(window,p,f),Ve=wt=xt=Xe=at=ot=tt=nt=!1,vt=null,ie("firstTouchStart",n),me(d,y),c.x=c.y=0,me(Ke,n[0]),me(Be,Ke), 233//_equalizePoints(_startMainScrollPos, _mainScrollPos); 234We.x=A.x*M,Ge=[{x:Ke.x,y:Ke.y}],Ze=Pe=ae(), 235//_mainScrollAnimationEnd(true); 236ye(C,!0), 237// Start rendering 238Tt(),Et()), 239// init zoom 240!lt&&1<o&&!mt&&!at&&(T=C,// true if zoom changed at least once 241lt=tt=!(nt=!1),c.y=c.x=0,me(d,y),me(ze,n[0]),me(Ne,n[1]),At(ze,Ne,ht),ft.x=Math.abs(ht.x)-y.x,ft.y=Math.abs(ht.y)-y.y,st=ut=Ct(ze,Ne))}}, 242// Pointermove/touchmove/mousemove handler 243Kt=function(e){if(e.preventDefault(),U){var t=h.arraySearch(He,e.pointerId,"id");if(-1<t){var n=He[t];n.x=e.pageX,n.y=e.pageY}}if(et){var o=zt(e);if(vt||ot||lt)rt=o;else if(dt.x!==A.x*M) 244// if main scroll position is shifted â direction is always horizontal 245vt="h";else{var i=Math.abs(o[0].x-Ke.x)-Math.abs(o[0].y-Ke.y); 246// check the direction of movement 24710<=Math.abs(i)&&(vt=0<i?"h":"v",rt=o)}}}, 248// 249Bt=function(){if(rt){var e=rt.length;if(0!==e)if(me(ze,rt[0]),Ue.x=ze.x-Ke.x,Ue.y=ze.y-Ke.y,lt&&1<e){ 250// check if one of two points changed 251if( 252// Handle behaviour for more than 1 point 253Ke.x=ze.x,Ke.y=ze.y,!Ue.x&&!Ue.y&&bt(rt[1],Ne))return;me(Ne,rt[1]),nt||(nt=!0,ie("zoomGestureStarted")); 254// Distance between two points 255var t=Ct(ze,Ne),n=qt(t); 256// slightly over the of initial zoom level 257n>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(wt=!0); 258// Apply the friction if zoom level is out of the bounds 259var o=1,i=we(),a=be();if(n<i)if(v.pinchToClose&&!wt&&T<=f.currItem.initialZoomLevel){ 260// fade out background if zooming out 261var r,l=1-(i-n)/(i/1.2);re(l),ie("onPinchClose",l),xt=!0}else 1<(o=(i-n)/i)&&(o=1),n=i-o*(i/3);else a<n&&( 262// 1.5 - extra zoom level above the max. E.g. if max is x6, real max 6 + 1.5 = 7.5 2631<(o=(n-a)/(6*i))&&(o=1),n=a+o*i);o<0&&(o=0), 264// distance between touch points after friction is applied 265st=t, 266// _centerPoint - The point in the middle of two pointers 267At(ze,Ne,Je), 268// paning with two pointers pressed 269c.x+=Je.x-ht.x,c.y+=Je.y-ht.y,me(ht,Je),y.x=pe("x",n),y.y=pe("y",n),Ve=C<n,C=n,se()}else{ 270// handle behaviour for one point (dragging or panning) 271if(!vt)return; 272// do nothing if pointers position hasn't changed 273if(gt&&(gt=!1,
274// subtract drag distance that was used during the detection direction 27510<=Math.abs(Ue.x)&&(Ue.x-=rt[0].x-Be.x),10<=Math.abs(Ue.y)&&(Ue.y-=rt[0].y-Be.y)),Ke.x=ze.x,Ke.y=ze.y,0===Ue.x&&0===Ue.y)return;if("v"===vt&&v.closeOnVerticalDrag&&!Dt()){c.y+=Ue.y,y.y+=Ue.y;var s=kt();return Xe=!0,ie("onVerticalDrag",s),re(s),void se()}var u;Ot(ae(),ze.x,ze.y),ot=!0,ct=f.currItem.bounds,Nt("x",Ue)||(Nt("y",Ue),fe(y),se())}}}, 276// Pointerup/pointercancel/touchend/touchcancel/mouseup event handler 277Ht=function(e){if(j.isOldAndroid){if(je&&"mouseup"===e.type)return; 278// on Android (v4.1, 4.2, 4.3 & possibly older) 279// ghost mousedown/up event isn't preventable via e.preventDefault, 280// which causes fake mousedown event 281// so we block mousedown/up for 600ms 282-1<e.type.indexOf("touch")&&(clearTimeout(je),je=setTimeout(function(){je=0},600))}var t;if(ie("pointerUp"),Mt(e,!1)&&e.preventDefault(),U){var n=h.arraySearch(He,e.pointerId,"id");if(-1<n)if(t=He.splice(n,1)[0],navigator.pointerEnabled)t.type=e.pointerType||"mouse";else{var o={4:"mouse",// event.MSPOINTER_TYPE_MOUSE 2832:"touch",// event.MSPOINTER_TYPE_TOUCH 2843:"pen"};t.type=o[e.pointerType],t.type||(t.type=e.pointerType||"mouse")}}var i=zt(e),a,r=i.length; 285// Do nothing if there were 3 touch points or more 286if("mouseup"===e.type&&(r=0),2===r)return!(rt=null); 287// if second pointer released 2881===r&&me(Be,i[0]), 289// pointer hasn't moved, send "tap release" point 2900!==r||vt||mt||(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"})),ie("touchRelease",e,t)); 291// Difference in time between releasing of two last touch points (zoom gesture) 292var l=-1; 293// Gesture completed, no pointers left 294if(0===r&&(et=!1,h.unbind(window,p,f),Tt(),lt? 295// Two points released at the same time 296l=0:-1!==Qe&&(l=ae()-Qe)),Qe=1===r?ae():-1,a=-1!==l&&l<150?"zoom":"swipe",lt&&r<2&&(lt=!1, 297// Only second point released 2981===r&&(a="zoomPointerUp"),ie("zoomGestureEnded")),rt=null,ot||nt||mt||Xe)if(Ae(),Ye||(Ye=Wt()),Ye.calculateSwipeSpeed("x"),Xe){var s;if(kt()<v.verticalDragRange)f.close();else{var u=y.y,c=yt;Oe("verticalDrag",0,1,300,h.easing.cubic.out,function(e){y.y=(f.currItem.initialPosition.y-u)*e+u,re((1-c)*e+c),se()}),ie("onVerticalDrag",1)}} 299// main scroll 300else{if((at||mt)&&0===r){var d;if(Gt(a,Ye))return;a="zoomPointerUp"} 301// prevent zoom/pan animation when main scroll animation runs 302mt||( 303// Complete simple zoom gesture (reset zoom level if it's out of the bounds) 304"swipe"===a? 305// Complete pan gesture if main scroll is not shifted, and it's possible to pan current image 306!at&&C>f.currItem.fitRatio&&Yt(Ye):Vt())}}, 307// Returns object with data about gesture 308// It's created only once and then reused 309Wt=function(){ 310// temp local vars 311var t,n,o={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=1<Ge.length?(t=ae()-Ze+50,Ge[Ge.length-2][e]):(t=ae()-Pe,Be[e]),o.lastFlickOffset[e]=Ke[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]||(y[t]>ct.min[t]?o.backAnimDestination[t]=ct.min[t]:y[t]<ct.max[t]&&(o.backAnimDestination[t]=ct.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,Oe("bounceZoomPan"+t,y[t],o.backAnimDestination[t],e||300,h.easing.sine.out,function(e){y[t]=e,se()}))))}, 312// Reduces the speed by slowDownRatio (per 10ms) 313calculateAnimOffset: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,y[e]+=o.distanceOffset[e])},panAnimLoop:function(){if(Se.zoomPan&&(Se.zoomPan.raf=W(o.panAnimLoop),o.now=ae(),o.timeDiff=o.now-o.lastNow,o.lastNow=o.now,o.calculateAnimOffset("x"),o.calculateAnimOffset("y"),se(),o.calculateOverBoundsAnimOffset("x"),o.calculateOverBoundsAnimOffset("y"),o.speedDecelerationRatioAbs.x<.05&&o.speedDecelerationRatioAbs.y<.05)) 314// round pan position 315return y.x=Math.round(y.x),y.y=Math.round(y.y),se(),void Me("zoomPan")}}; 316// s = this 317return o},Yt=function(e){ 318// Avoid acceleration animation if speed is too low 319if( 320// calculate swipe speed for Y axis (paanning) 321e.calculateSwipeSpeed("y"),ct=f.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,
322// Run pan drag release animation. E.g. if you drag image and release finger without momentum. 323e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0; 324// Animation loop that controls the acceleration after pan gesture ends 325Fe("zoomPan"),e.lastNow=ae(),e.panAnimLoop()},Gt=function(e,t){var n,o,i;if(mt||($e=x),"swipe"===e){var a=Ke.x-Be.x,r=t.lastFlickDist.x<10; 326// if container is shifted for more than MIN_SWIPE_DISTANCE, 327// and last flick gesture was in right direction 32830<a&&(r||20<t.lastFlickOffset.x)? 329// go to prev item 330o=-1:a<-30&&(r||t.lastFlickOffset.x<-20)&&( 331// go to next item 332o=1)}o&&((x+=o)<0?(x=v.loop?an()-1:0,i=!0):x>=an()&&(x=v.loop?0:an()-1,i=!0),i&&!v.loop||(R+=o,M-=o,n=!0));var l=A.x*M,s=Math.abs(l-dt.x),u;return u=n||l>dt.x==0<t.lastFlickSpeed.x?(u=0<Math.abs(t.lastFlickSpeed.x)?s/Math.abs(t.lastFlickSpeed.x):333,u=Math.min(u,400),Math.max(u,250)):333,$e===x&&(n=!1),mt=!0,ie("mainScrollAnimStart"),Oe("mainScroll",dt.x,l,u,h.easing.cubic.out,de,function(){Ae(),mt=!1,$e=-1,(n||$e!==x)&&f.updateCurrItem(),ie("mainScrollAnimComplete")}),n&&f.updateCurrItem(!0),n},qt=function(e){return 1/ut*e*T}, 333// Resets zoom if it's out of bounds 334Vt=function(){var e=C,t=we(),n=be();C<t?e=t:n<C&&(e=n);var o=1,i,a=yt;return xt&&!Ve&&!wt&&C<t? 335//_closedByScroll = true; 336f.close():(xt&&(i=function(e){re((1-a)*e+a)}),f.zoomTo(e,0,200,h.easing.cubic.out,i)),!0};ee("Gestures",{publicMethods:{initGestures:function(){ 337// helper function that builds touch/pointer/mouse events 338var e=function(e,t,n,o,i){L=e+t,P=e+n,Z=e+o,z=i?e+i:""};(U=j.pointerEvent)&&j.touch&&( 339// we don't need touch events, if browser supports pointer events 340j.touch=!1),U?navigator.pointerEnabled?e("pointer","down","move","up","cancel"): 341// IE10 pointer events are case-sensitive 342e("MSPointer","Down","Move","Up","Cancel"):j.touch?(e("touch","start","move","end","cancel"),B=!0):e("mouse","down","move","up"),p=P+" "+Z+" "+z,w=L,U&&!B&&(B=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints), 343// make variable public 344f.likelyTouchDevice=B,b[L]=Ut,b[P]=Kt,b[Z]=Ht,// the Kraken 345z&&(b[z]=b[Z]), 346// Bind mouse events on device with detected hardware touch support, in case it supports multiple types of input. 347j.touch&&(w+=" mousedown",p+=" mousemove mouseup",b.mousedown=b[L],b.mousemove=b[P],b.mouseup=b[Z]),B||( 348// don't allow pan to next slide from zoomed state on Desktop 349v.allowPanToNext=!1)}}}); 350/*>>gestures*/ 351/*>>show-hide-transition*/ 352/**
353 * show-hide-transition.js: 354 * 355 * Manages initial opening or closing transition. 356 * 357 * If you're not planning to use transition for gallery at all, 358 * you may set options hideAnimationDuration and showAnimationDuration to 0, 359 * and just delete startAnimation function. 360 * 361 */ 362var Xt,jt=function(s,e,u,t){ 363// dimensions of small thumbnail {x:,y:,w:}. 364// Height is optional, as calculated based on large image. 365var c;Xt&&clearTimeout(Xt),en=tn=!0,s.initialLayout?(c=s.initialLayout,s.initialLayout=null):c=v.getThumbBoundsFn&&v.getThumbBoundsFn(x);var d=u?v.hideAnimationDuration:v.showAnimationDuration,p=function(){Me("initialZoom"),u?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(re(1),e&&(e.style.display="block"),h.addClass(m,"pswp--animated-in"),ie("initialZoom"+(u?"OutEnd":"InEnd"))),t&&t(),tn=!1},n; 366// if bounds aren't provided, just open gallery without animation 367if(!d||!c||void 0===c.x)return ie("initialZoom"+(u?"Out":"In")),C=s.initialZoomLevel,me(y,s.initialPosition),se(),m.style.opacity=u?0:1,re(1),void(d?setTimeout(function(){p()},d):p());(function(){var r=g,l=!f.currItem.src||f.currItem.loadError||v.showHideOpacity; 368// apply hw-acceleration to image 369s.miniImg&&(s.miniImg.style.webkitBackfaceVisibility="hidden"),u||(C=c.w/s.w,y.x=c.x,y.y=c.y-q,f[l?"template":"bg"].style.opacity=.001,se()),Fe("initialZoom"),u&&!r&&h.removeClass(m,"pswp--animated-in"),l&&(u?h[(r?"remove":"add")+"Class"](m,"pswp--animate_opacity"):setTimeout(function(){h.addClass(m,"pswp--animate_opacity")},30)),Xt=setTimeout(function(){if(ie("initialZoom"+(u?"Out":"In")),u){ 370// "out" animation uses rAF only when PhotoSwipe is closed by browser scroll, to recalculate position 371var t=c.w/s.w,n=y.x,o=y.y,i=C,a=yt,e=function(e){y.y=1===e?(C=t,y.x=c.x,c.y-X):(C=(t-i)*e+i,y.x=(c.x-n)*e+n,(c.y-X-o)*e+o),se(),l?m.style.opacity=1-e:re(a-e*a)};r?Oe("initialZoom",0,1,d,h.easing.cubic.out,e,p):(e(1),Xt=setTimeout(p,d+20))}else 372// "in" animation always uses CSS transitions (instead of rAF). 373// CSS transition work faster here, 374// as developer may also want to animate other things, 375// like ui on top of sliding area, which can be animated just via CSS 376C=s.initialZoomLevel,me(y,s.initialPosition),se(),re(1),l?m.style.opacity=1:re(1),Xt=setTimeout(p,d+20)},u?25:90)})()},$t,Jt={},Qt=[],en,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,// TODO 377preload:[1,1],getNumItemsFn:function(){return $t.length}},on,an,rn,ln=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},sn=function(e,t,n){var o=e.bounds; 378// position of element when it's centered 379o.center.x=Math.round((Jt.x-t)/2),o.center.y=Math.round((Jt.y-n)/2)+e.vGap.top, 380// maximum pan position 381o.max.x=t>Jt.x?Math.round(Jt.x-t):o.center.x,o.max.y=n>Jt.y?Math.round(Jt.y-n)+e.vGap.top:o.center.y, 382// minimum pan position 383o.min.x=t>Jt.x?0:o.center.x,o.min.y=n>Jt.y?e.vGap.top:o.center.y},un=function(e,t,n){if(!e.src||e.loadError) 384// if it's not image, we return zero bounds (content is not zoomable) 385return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},e.initialPosition=e.bounds.center,e.bounds;var o=!n;if(o&&(e.vGap||(e.vGap={top:0,bottom:0}), 386// allows overriding vertical margin for individual items 387ie("parseVerticalMargin",e)),Jt.x=t.x,Jt.y=t.y-e.vGap.top-e.vGap.bottom,o){var i=Jt.x/e.w,a=Jt.y/e.h;e.fitRatio=i<a?i:a; 388//item.fillRatio = hRatio > vRatio ? hRatio : vRatio; 389var r=v.scaleMode;"orig"===r?n=1:"fit"===r&&(n=e.fitRatio),1<n&&(n=1),e.initialZoomLevel=n,e.bounds||( 390// reuse bounds object 391e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}})}return n?(sn(e,e.w*n,e.h*n),o&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},cn=function(e,t,n,o,i,a){t.loadError||o&&(t.imageAppended=!0,mn(t,o,t===f.currItem&&J),n.appendChild(o),a&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},dn=function(e){e.loading=!0,e.loaded=!1;var t=e.img=h.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};// + '?a=' + Math.random(); 392return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},pn=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=v.errorMsg.replace("%url%",e.
392src),!0},mn=function(e,t,n){if(e.src){t||(t=e.container.lastChild);var o=n?e.w:Math.round(e.w*e.fitRatio),i=n?e.h:Math.round(e.h*e.fitRatio);e.placeholder&&!e.loaded&&(e.placeholder.style.width=o+"px",e.placeholder.style.height=i+"px"),t.style.width=o+"px",t.style.height=i+"px"}},fn=function(){if(Qt.length){for(var e,t=0;t<Qt.length;t++)(e=Qt[t]).holder.index===e.index&&cn(e.index,e.item,e.baseDiv,e.img,!1,e.clearPlaceholder);Qt=[]}}; 393/*>>show-hide-transition*/ 394/*>>items-controller*/ 395/** 396* 397* Controller manages gallery items, their dimensions, and their content. 398* 399*/ee("Controller",{publicMethods:{lazyLoadItem:function(e){e=te(e);var t=on(e);t&&(!t.loaded&&!t.loading||_)&&(ie("gettingData",e,t),t.src&&dn(t))},initController:function(){h.extend(v,nn,!0),f.items=$t=e,on=f.getItemAt,an=v.getNumItemsFn,//self.getNumItems; 400rn=v.loop,an()<3&&(v.loop=!1),oe("beforeChange",function(e){var t=v.preload,n=null===e||0<=e,o=Math.min(t[0],an()),i=Math.min(t[1],an()),a;for(a=1;a<=(n?i:o);a++)f.lazyLoadItem(x+a);for(a=1;a<=(n?o:i);a++)f.lazyLoadItem(x-a)}),oe("initialLayout",function(){f.currItem.initialLayout=v.getThumbBoundsFn&&v.getThumbBoundsFn(x)}),oe("mainScrollAnimComplete",fn),oe("initialZoomInEnd",fn),oe("destroy",function(){for(var e,t=0;t<$t.length;t++) 401// remove reference to DOM elements, for GC 402(e=$t[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);Qt=null})},getItemAt:function(e){return 0<=e&&(void 0!==$t[e]&&$t[e])},allowProgressiveImg:function(){ 403// 1. Progressive image loading isn't working on webkit/blink 404// when hw-acceleration (e.g. translateZ) is applied to IMG element. 405// That's why in PhotoSwipe parent element gets zoom transform, not image itself. 406// 407// 2. Progressive image loading sometimes blinks in webkit/blink when applying animation to parent element. 408// That's why it's disabled on touch devices (mainly because of swipe transition) 409// 410// 3. Progressive image loading sometimes doesn't work in IE (up to 11). 411// Don't allow progressive loading on non-large touch devices 412return v.forceProgressiveLoading||!B||v.mouseUsed||1200<screen.width; 413// 1200 - to eliminate touch devices with large screen (like Chromebook Pixel) 414},setContent:function(t,n){v.loop&&(n=te(n));var e=f.getItemAt(t.index);e&&(e.container=null);var o=f.getItemAt(n),i;if(o){ 415// allow to override data 416ie("gettingData",n,o),t.index=n; 417// base container DIV is created only once for each of 3 holders 418var a=(t.item=o).container=h.createEl("pswp__zoom-wrap");if(!o.src&&o.html&&(o.html.tagName?a.appendChild(o.html):a.innerHTML=o.html),pn(o),un(o,I),!o.src||o.loadError||o.loaded)o.src&&!o.loadError&&( 419// image object is created every time, due to bugs of image loading & delay when switching images 420(i=h.createEl("pswp__img","img")).style.opacity=1,i.src=o.src,mn(o,i),cn(n,o,a,i,!0));else{if(o.loadComplete=function(e){ 421// gallery closed before image finished loading 422if(s){ 423// check if holder hasn't changed while image was loading 424if(t&&t.index===n){if(pn(e,!0))return e.loadComplete=e.img=null,un(e,I),ue(e),void(t.index===x&& 425// recalculate dimensions 426f.updateCurrZoomItem());e.imageAppended? 427// remove preloader & mini-img 428!tn&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):j.transform&&(mt||tn)?Qt.push({item:e,baseDiv:a,img:e.img,index:n,holder:t,clearPlaceholder:!0}):cn(n,e,a,e.img,mt||tn,!0)}e.loadComplete=null,e.img=null,// no need to store image element after it's added 429ie("imageLoadComplete",n,e)}},h.features.transform){var r="pswp__img pswp__img--placeholder";r+=o.msrc?"":" pswp__img--placeholder--blank";var l=h.createEl(r,o.msrc?"img":"");o.msrc&&(l.src=o.msrc),mn(o,l),a.appendChild(l),o.placeholder=l}o.loading||dn(o),f.allowProgressiveImg()&&( 430// just append image 431!en&&j.transform?Qt.push({item:o,baseDiv:a,img:o.img,index:n,holder:t}):cn(n,o,a,o.img,!0,!0))}en||n!==x?ue(o):(pt=a.style,jt(o,i||o.img)),t.el.innerHTML="",t.el.appendChild(a)}else t.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}}); 432/*>>items-controller*/ 433/*>>tap*/ 434/** 435 * tap.js: 436 * 437 * Displatches tap and double-tap events. 438 * 439 */ 440var hn,vn={},gn=function(e,t,n){var o=document.createEvent("CustomEvent"),i={origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"};o.initCustomEvent("pswpTap",!0,!0,i),e.target.dispatchEvent(o)},xn;ee("Tap",{publicMethods:{initTap:function(){oe("firstTouchStart",f.onTapStart),oe("touchRelease",f.onTapRelease),oe("destroy",function(){vn={},hn=null})},onTapStart:function(e){1<e.length&&(clearTimeout(hn),hn=null)},onTapRelease:function(e,t){if(t&&!ot&&!tt&&!_e){var n=t,o;if(hn&&(clearTimeout(hn),hn=null,It(n,vn)))return void ie("doubleTap",n);if("mouse"===t.type)return void gn(e,t,"mouse"); 441// avoid double tap delay on buttons and elements that have class pswp__single-tap 442if("BUTTON"===e.target.tagName.toUpperCase()||h.hasClass(e.target,"pswp__single-tap"))return void gn(e,t);me(vn,n),hn=setTimeout(function(){gn(e,t),hn=null},300)}}}}),ee("DesktopZoom",{publicMethods:{initDesktopZoom:function(){V||(B? 443// if detected hardware touch support, we wait until mouse is used, 444// and only then apply desktop-zoom features 445oe("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(e){xn={};var t="wheel mousewheel DOMMouseScroll";oe("bindEvents",function(){h.bind(m,t,f.handleMouseWheel)}),oe("unbindEvents",function(){xn&&h.unbind(m,t,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var n,o=function(){f.mouseZoomedIn&&(h.removeClass(m,"pswp--zoomed-in"),f.mouseZoomedIn=!1),C<1?h.addClass(m,"pswp--zoom-allowed"):h.removeClass(m,"pswp--zoom-allowed"),i()},i=function(){n&&(h.removeClass(m,"pswp--dragging"),n=!1)};oe("resize",o),oe("afterChange",o),oe("pointerDown",function(){f.mouseZoomedIn&&(n=!0,h.addClass(m,"pswp--dragging"))}),oe("pointerUp",i),e||o()},handleMouseWheel:function(e){if(C<=f.currItem.fitRatio)return v.modal&&(!v.closeOnScroll||_e||et?e.preventDefault():N&&2<Math.abs(e.deltaY)&&( 446// close PhotoSwipe 447// if browser supports transforms & scroll changed enough 448g=!0,f.close())),!0; 449// allow just one event to fire 450if(e.stopPropagation(), 451// https://developer.mozilla.org/en-US/docs/Web/Events/wheel 452xn.x=0,"deltaX"in e)1/* DOM_DELTA_LINE */===e.deltaMode?( 453// 18 - average line height 454xn.x=18*e.deltaX,xn.y=18*e.deltaY):(xn.x=e.deltaX,xn.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(xn.x=-.16*e.wheelDeltaX),e.wheelDeltaY?xn.y=-.16*e.wheelDeltaY:xn.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;xn.y=e.detail}ye(C,!0);var t=y.x-xn.x,n=y.y-xn.y; 455// only prevent scrolling in nonmodal mode when not at edges 456(v.modal||t<=ct.min.x&&t>=ct.max.x&&n<=ct.min.y&&n>=ct.max.y)&&e.preventDefault(), 457// TODO: use rAF instead of mousewheel? 458f.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:I.x/2+F.x,y:I.y/2+F.y};var t=v.getDoubleTapZoom(!0,f.currItem),n=C===t;f.mouseZoomedIn=!n,f.zoomTo(n?f.currItem.initialZoomLevel:t,e,333),h[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}}); 459/*>>desktop-zoom*/ 460/*>>history*/ 461/** 462 * 463 * history.js: 464 * 465 * - Back button to close gallery. 466 * 467 * - Unique URL for each slide: example.com/&pid=1&gid=3 468 * (where PID is picture index, and GID and gallery index) 469 * 470 * - Switch URL when slides change. 471 * 472 */ 473var yn={history:!0,galleryUID:1},wn,bn,In,Cn,Tn,En,Dn,Sn,_n,Mn,Fn,An,On=function(){return Fn.hash.substring(1)},kn=function(){wn&&clearTimeout(wn),In&&clearTimeout(In)}, 474// pid - Picture index 475// gid - Gallery index 476Rn=function(){var e=On(),t={};if(e.length<5)// pid=1 477return t;var n,o=e.split("&");for(n=0;n<o.length;n++)if(o[n]){var i=o[n].split("=");i.length<2||(t[i[0]]=i[1])}if(v.galleryPIDs){ 478// detect custom pid in hash and search for it among the items collection 479var a=t.pid;// if custom pid cannot be found, fallback to the first item 480for(n=t.pid=0;n<$t.length;n++)if($t[n].pid===a){t.pid=n;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t},Ln=function(){if(In&&clearTimeout(In),_e||et) 481// changing browser URL forces layout/paint in some browsers, which causes noticable lag during animation 482// that's why we update hash only when no animations running 483In=setTimeout(Ln,500);else{Cn?clearTimeout(bn):Cn=!0;var e=x+1,t=on(x);t.hasOwnProperty("pid")&&( 484// carry forward any custom pid assigned to the item 485e=t.pid);var n=Dn+"&gid="+v.galleryUID+"&pid="+e;Sn||-1===Fn.hash.indexOf(n)&&(Mn=!0);var o=Fn.href.split("#")[0]+"#"+n;An?"#"+n!==window.location.hash&&history[Sn?"replaceState":"pushState"]("",document.title,o):Sn?Fn.replace(o):Fn.hash=n,Sn=!0,bn=setTimeout(function(){Cn=!1},60)}};ee("History",{publicMethods:{initHistory:function(){if(h.extend(v,yn,!0),v.history){Fn=window.location,Sn=_n=Mn=!1,Dn=On(),An="pushState"in history,-1<Dn.indexOf("gid=")&&(Dn=(Dn=Dn.split("&gid=")[0]).split("?gid=")[0]),oe("afterChange",f.updateURL),oe("unbindEvents",function(){h.unbind(window,"hashchange",f.onHashChange)});var e=function(){En=!0,_n||(Mn?history.back():Dn?Fn.hash=Dn:An? 486// remove hash from url without refreshing it or scrolling to top 487history.pushState("",document.title,Fn.pathname+Fn.search):Fn.hash=""),kn()};oe("unbindEvents",function(){g&& 488// if PhotoSwipe is closed by scroll, we go "back" before the closing animation starts 489// this is done to keep the scroll position 490e()}),oe("destroy",function(){En||e()}),oe("firstUpdate",function(){x=Rn().pid});var t=Dn.indexOf("pid=");-1<t&&"&"===(Dn=Dn.substring(0,t)).slice(-1)&&(Dn=Dn.slice(0,-1)),setTimeout(function(){s&&// hasn't destroyed yet 491h.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){if(On()===Dn)return _n=!0,void f.close();Cn||(Tn=!0,f.goTo(Rn().pid),Tn=!1)},updateURL:function(){ 492// Delay the update of URL, to avoid lag during transition, 493// and to not to trigger actions like "refresh page sound" or "blinking favicon" to often 494kn(),Tn||(Sn?wn=setTimeout(Ln,800):Ln())}}}), 495/*>>history*/ 496h.extend(f,ke)}}), 497/* PhotoSwipe Default UI - 4.1.2 - 2017-04-05 498* http://photoswipe.com 499* Copyright (c) 2017 Dmitry Semenov; */ 500/** 501* 502* UI on top of main sliding area (caption, arrows, close button, etc.). 503* Built just using public methods/properties of PhotoSwipe.
504* 505*/ 506function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";var e;return function(o,l){var n=this,e=!1,i=!0,t,s,a,r,u,c,d,p=!0,m,f,h,v,g,x,y,w,b={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,// 2s 507addCaptionHTMLFn:function(e,t/*, isFake */){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},I,C,T=function(e){if(I)return!0;e=e||window.event,w.timeToIdle&&w.mouseUsed&&!f&& 508// reset idle timer 509P();for(var t,n,o=(e.target||e.srcElement).getAttribute("class")||"",i,a=0;a<W.length;a++)(n=W[a]).onTap&&-1<o.indexOf("pswp__"+n.name)&&(n.onTap(),i=!0);if(i){e.stopPropagation&&e.stopPropagation(),I=!0; 510// Some versions of Android don't prevent ghost click event 511// when preventDefault() was called on touchstart and/or touchend. 512// 513// This happens on v4.3, 4.2, 4.1, 514// older versions strangely work correctly, 515// but just in case we add delay on all of them) 516var r=l.features.isOldAndroid?600:30;C=setTimeout(function(){I=!1},r)}},E=function(){return!o.likelyTouchDevice||w.mouseUsed||screen.width>w.fitControlsWidth},D=function(e,t,n){l[(n?"add":"remove")+"Class"](e,"pswp__"+t)}, 517// add class when there is just one item in the gallery 518// (by default it hides left/right arrows and 1ofX counter) 519S=function(){var e=1===w.getNumItemsFn();e!==y&&(D(s,"ui--one-slide",e),y=e)},_=function(){D(d,"share-modal--hidden",p)},M=function(){return(p=!p)?(l.removeClass(d,"pswp__share-modal--fade-in"),setTimeout(function(){p&&_()},300)):(_(),setTimeout(function(){p||l.addClass(d,"pswp__share-modal--fade-in")},30)),p||A(),!1},F=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)),p||M(),!1))},A=function(){for(var e="",t,n,o,i,a,r=0;r<w.shareButtons.length;r++)t=w.shareButtons[r],o=w.getImageURLForShare(t),i=w.getPageURLForShare(t),a=w.getTextForShare(t),e+='<a href="'+(n=t.url.replace("{{url}}",encodeURIComponent(i)).replace("{{image_url}}",encodeURIComponent(o)).replace("{{raw_image_url}}",o).replace("{{text}}",encodeURIComponent(a)))+'" target="_blank" class="pswp__share--'+t.id+'"'+(t.download?"download":"")+">"+t.label+"</a>",w.parseShareButtonOut&&(e=w.parseShareButtonOut(t,e));d.children[0].innerHTML=e,d.children[0].onclick=F},O=function(e){for(var t=0;t<w.closeElClasses.length;t++)if(l.hasClass(e,"pswp__"+w.closeElClasses[t]))return!0},k,R,L=0,P=function(){clearTimeout(R),L=0,f&&n.setIdle(!1)},Z=function(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(R),R=setTimeout(function(){n.setIdle(!0)},w.timeToIdleOutside))},z=function(){w.fullscreenEl&&!l.features.isOldAndroid&&(t||(t=n.getFullscreenAPI()),t?(l.bind(document,t.eventK,n.updateFullscreen),n.updateFullscreen(),l.addClass(o.template,"pswp--supports-fs")):l.removeClass(o.template,"pswp--supports-fs"))},N=function(){ 520// Setup loading indicator 521w.preloaderEl&&(U(!0),h("beforeChange",function(){clearTimeout(x), 522// display loading indicator with delay 523x=setTimeout(function(){o.currItem&&o.currItem.loading?(!o.allowProgressiveImg()||o.currItem.img&&!o.currItem.img.naturalWi
523dth)&& 524// show preloader if progressive loading is not enabled, 525// or image width is not defined yet (because of slow connection) 526U(!1):U(!0)},w.loadingIndicatorDelay)}),h("imageLoadComplete",function(e,t){o.currItem===t&&U(!0)}))},U=function(e){g!==e&&(D(v,"preloader--active",!e),g=e)},K=function(e){var t=e.vGap;if(E()){var n=w.barsSize;if(w.captionEl&&"auto"===n.bottom)if(r||((r=l.createEl("pswp__caption pswp__caption--fake")).appendChild(l.createEl("pswp__caption__center")),s.insertBefore(r,a),l.addClass(s,"pswp__ui--fit")),w.addCaptionHTMLFn(e,r,!0)){var o=r.clientHeight;t.bottom=parseInt(o,10)||44}else t.bottom=n.top;// if no caption, set size of bottom gap to size of top 527else t.bottom="auto"===n.bottom?0:n.bottom; 528// height of top bar is static, no need to calculate it 529t.top=n.top}else t.top=t.bottom=0},B=function(){ 530// Hide controls when mouse is used 531w.timeToIdle&&h("mouseUsed",function(){l.bind(document,"mousemove",P),l.bind(document,"mouseout",Z),k=setInterval(function(){2===++L&&n.setIdle(!0)},w.timeToIdle/2)})},H=function(){ 532// Hide controls when pinching to close 533var t; 534// Hide controls on vertical drag 535h("onVerticalDrag",function(e){i&&e<.95?n.hideControls():!i&&.95<=e&&n.showControls()}),h("onPinchClose",function(e){i&&e<.9?(n.hideControls(),t=!0):t&&!i&&.9<e&&n.showControls()}),h("zoomGestureEnded",function(){(t=!1)&&!i&&n.showControls()})},W=[{name:"caption",option:"captionEl",onInit:function(e){a=e}},{name:"share-modal",option:"shareEl",onInit:function(e){d=e},onTap:function(){M()}},{name:"button--share",option:"shareEl",onInit:function(e){c=e},onTap:function(){M()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){u=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(){t.isFullscreen()?t.exit():t.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){v=e}}],Y=function(){var i,a,r,e=function(e){if(e)for(var t=e.length,n=0;n<t;n++){i=e[n],a=i.className;for(var o=0;o<W.length;o++)r=W[o],-1<a.indexOf("pswp__"+r.name)&&(w[r.option]?(// if element is not disabled from options 536l.removeClass(i,"pswp__element--disabled"),r.onInit&&r.onInit(i)):l.addClass(i,"pswp__element--disabled"))}};e(s.children);var t=l.getChildByClass(s,"pswp__top-bar");t&&e(t.children)};n.init=function(){ 537// extend options 538l.extend(o.options,b,!0), 539// create local link for fast access 540w=o.options, 541// find pswp__ui element 542s=l.getChildByClass(o.scrollWrap,"pswp__ui"), 543// create local link 544h=o.listen,H(), 545// update controls when slides change 546h("beforeChange",n.update), 547// toggle zoom on double-tap 548h("doubleTap",function(e){var t=o.currItem.initialZoomLevel;o.getZoomLevel()!==t?o.zoomTo(t,e,333):o.zoomTo(w.getDoubleTapZoom(!1,o.currItem),e,333)}), 549// Allow text selection in caption 550h("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)}), 551// bind events for UI 552h("bindEvents",function(){l.bind(s,"pswpTap click",T),l.bind(o.scrollWrap,"pswpTap",n.onGlobalTap),o.likelyTouchDevice||l.bind(o.scrollWrap,"mouseover",n.onMouseOver)}), 553// unbind events for UI 554h("unbindEvents",function(){p||M(),k&&clearInterval(k),l.unbind(document,"mouseout",Z),l.unbind(document,"mousemove",P),l.unbind(s,"pswpTap click",T),l.unbind(o.scrollWrap,"pswpTap",n.onGlobalTap),l.unbind(o.scrollWrap,"mouseover",n.onMouseOver),t&&(l.unbind(document,t.eventK,n.updateFullscreen),t.isFullscreen()&&(w.hideAnimationDuration=0,t.exit()),t=null)}), 555// clean up things when gallery is destroyed 556h("destroy",function(){w.captionEl&&(r&&s.removeChild(r),l.removeClass(a,"pswp__caption--empty")),d&&(d.children[0].onclick=null),l.removeClass(s,"pswp__ui--over-close"),l.addClass(s,"pswp__ui--hidden"),n.setIdle(!1)}),w.showAnimationDuration||l.removeClass(s,"pswp__ui--hidden"),h("initialZoomIn",function(){w.showAnimationDuration&&l.removeClass(s,"pswp__ui--hidden")}),h("initialZoomOut",function(){l.addClass(s,"pswp__ui--hidden")}),h("parseVerticalMargin",K),Y(),w.shareEl&&c&&d&&(p=!0),S(),B(),z(),N()},n.setIdle=function(e){D(s,"ui--idle",f=e)},n.update=function(){ 557// Don't update UI if it's hidden 558e=!(!i||!o.currItem)&&(n.updateIndexIndicator(),w.captionEl&&(w.addCaptionHTMLFn(o.currItem,a),D(a,"caption--empty",!o.currItem.title)),!0),p||M(),S()},n.updateFullscreen=function(e){e&& 559// some browsers change window scroll position during the fullscreen 560// so PhotoSwipe updates it just in case 561setTimeout(function(){o.setScrollOffset(0,l.getScrollY())},50), 562// toogle pswp--fs class on root element
563l[(t.isFullscreen()?"add":"remove")+"Class"](o.template,"pswp--fs")},n.updateIndexIndicator=function(){w.counterEl&&(u.innerHTML=o.getCurrentIndex()+1+w.indexIndicatorSep+w.getNumItemsFn())},n.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!I)if(e.detail&&"mouse"===e.detail.pointerType){ 564// close gallery if clicked outside of the image 565if(O(t))return void o.close();l.hasClass(t,"pswp__img")&&(1===o.getZoomLevel()&&o.getZoomLevel()<=o.currItem.fitRatio?w.clickToCloseNonZoomable&&o.close():o.toggleDesktopZoom(e.detail.releasePoint))}else 566// tap to close gallery 567if( 568// tap anywhere (except buttons) to toggle visibility of controls 569w.tapToToggleControls&&(i?n.hideControls():n.showControls()),w.tapToClose&&(l.hasClass(t,"pswp__img")||O(t)))return void o.close()},n.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement; 570// add class when mouse is over an element that should close the gallery 571D(s,"ui--over-close",O(t))},n.hideControls=function(){l.addClass(s,"pswp__ui--hidden"),i=!1},n.showControls=function(){i=!0,e||n.update(),l.removeClass(s,"pswp__ui--hidden")},n.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},n.getFullscreenAPI=function(){var e=document.documentElement,t,n="fullscreenchange";return e.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:n}:e.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+n}:e.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+n}:e.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){if( 572// disable close-on-scroll in fullscreen 573m=w.closeOnScroll,w.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK)return o.template[this.enterK]();o.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return w.closeOnScroll=m,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}}}); 574// PhotoSwipe 575var initPhotoSwipeFromDOM=function(e){for( 576// parse slide data (url, title, size ...) from DOM elements 577// (children of gallerySelector) 578var u=function(e){for(var t=e.childNodes,n=t.length,o=[],i,a,r,l,s=0;s<n;s++)// <figure> element 579// include only element nodes 5801===(i=t[s]).nodeType&&(// <a> element 581r=(a=i.children[0]).getAttribute("data-size").split("x"), 582// create slide object 583l={src:a.getAttribute("href"),w:parseInt(r[0],10),h:parseInt(r[1],10)},1<i.children.length&&( 584// <figcaption> content 585l.title=i.children[1].innerHTML),0<a.children.length&&( 586// <img> thumbnail element, retrieving thumbnail url 587l.msrc=a.children[0].getAttribute("src")),l.el=i,// save link to element for getThumbBoundsFn 588o.push(l));return o},c=function e(t,n){return t&&(n(t)?t:e(t.parentNode,n))},t=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1;var t=e.target||e.srcElement,n=c(t,function(e){return e.tagName&&"FIGURE"===e.tagName.toUpperCase()}); 589// find root element of slide 590if(n){for( 591// find index of clicked item by looping through all child nodes 592// alternatively, you may define index via data- attribute 593var o=n.parentNode,i=n.parentNode.childNodes,a=i.length,r=0,l,s=0;s<a;s++)if(1===i[s].nodeType){if(i[s]===n){l=r;break}r++}return 0<=l&& 594// open PhotoSwipe if valid index found 595d(l,o),!1}},n=function(){var e=window.location.hash.substring(1),t={};if(e.length<5)return t;for(var n=e.split("&"),o=0;o<n.length;o++)if(n[o]){var i=n[o].split("=");i.length<2||(t[i[0]]=i[1])}return t.gid&&(t.gid=parseInt(t.gid,10)),t},d=function(e,t,n,o){var i=document.querySelectorAll(".pswp")[0],a,r,l; 596// PhotoSwipe opened from URL 597if(l=u(t), 598// define options (if needed) 599r={ 600// define gallery index (for URL) 601galleryUID:t.getAttribute("data-pswp-uid"),getThumbBoundsFn:function(e){ 602// See Options -> getThumbBoundsFn section of documentation for more info 603var t=l[e].el.getElementsByTagName("img")[0],// find thumbnail 604n=window.pageYOffset||document.documentElement.scrollTop,o=t.getBoundingClientRect();return{x:o.left,y:o.top+n,w:o.width}}},o)if(r.galleryPIDs){ 605// parse real index when custom PIDs are used 606// http://photoswipe.com/documentation/faq.html#custom-pid-in-url 607for(var s=0;s<l.length;s++)if(l[s].pid==e){r.index=s;break}}else 608// in URL indexes start from 1 609r.index=parseInt(e,10)-1;else r.index=parseInt(e,10); 610// exit if index not found 611isNaN(r.index)||(n&&(r.showAnimationDuration=0),( 612// Pass data to PhotoSwipe and initialize it 613a=new PhotoSwipe(i,PhotoSwipeUI_Default,l,r)).init())},o=document.querySelectorAll(e),i=0,a=o.length 614// find nearest parent element 615;i<a;i++)o[i].setAttribute("data-pswp-uid",i+1),o[i].onclick=t; 616// Parse URL and open gallery if it contains #&pid=3&gid=1 617var r=n();r.pid&&r.gid&&d(r.pid,o[r.gid-1],!0,!0)}; 618// execute above function 619initPhotoSwipeFromDOM(".photoswipe-container");
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.