function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e,t){"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(e,t,n,o){var i={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){i.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){i.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(i.hasClass(n,t))return n;n=n.nextSibling}},arraySearch:function(e,t,n){for(var o=e.length;o--;)if(e[o][n]===t)return o;return-1},extend:function(e,t,n){for(var o in t)if(t.hasOwnProperty(o)){if(n&&e.hasOwnProperty(o))continue;e[o]=t[o]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(i.features)return i.features;var e=i.createEl().style,t="",n={};if(n.oldIE=document.all&&!document.addEventListener,n.touch="ontouchstart"in window,window.requestAnimationFrame&&(n.raf=window.requestAnimationFrame,n.caf=window.cancelAnimationFrame),n.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,!n.pointerEvent){var o=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);a&&a.length>0&&(a=parseInt(a[1],10))>=1&&a<8&&(n.isOldIOSPhone=!0)}var r=o.match(/Android\s([0-9\.]*)/),l=r?r[1]:0;(l=parseFloat(l))>=1&&(l<4.4&&(n.isOldAndroid=!0),n.androidVersion=l),n.isMobileOpera=/opera mini|opera mobi/i.test(o)}for(var s,c,u=["transform","perspective","animationName"],p=["","webkit","Moz","ms","O"],d=0;d<4;d++){t=p[d];for(var m=0;m<3;m++)s=u[m],c=t+(t?s.charAt(0).toUpperCase()+s.slice(1):s),!n[s]&&c in e&&(n[s]=c);t&&!n.raf&&(t=t.toLowerCase(),n.raf=window[t+"RequestAnimationFrame"],n.raf&&(n.caf=window[t+"CancelAnimationFrame"]||window[t+"CancelRequestAnimationFrame"]))}if(!n.raf){var f=0;n.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},n.caf=function(e){clearTimeout(e)}}return n.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,i.features=n,n}};i.detectFeatures(),i.features.oldIE&&(i.bind=function(e,t,n,o){t=t.split(" ");for(var i,a=(o?"detach":"attach")+"Event",r=function(){n.handleEvent.call(n)},l=0;l<t.length;l++)if(i=t[l])if("object"===_typeof(n)&&n.handleEvent){if(o){if(!n["oldIE"+i])return!1}else n["oldIE"+i]=r;e[a]("on"+i,n["oldIE"+i])}else e[a]("on"+i,n)});var a=this,r={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e||t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};i.extend(r,o);var l,s,c,u,p,d,m,f,h,v,w,g,y,x,b,_,I,C,T,D,E,S,A,O,M,k,F,R,L,Z,P,z,N,U,B,H,K,W,j,G,Y,q,V,X,$,Q,J,ee,te,ne,oe,ie,ae,re,le,se,ce,ue={x:0,y:0},pe={x:0,y:0},de={x:0,y:0},me={},fe=0,he={},ve={x:0,y:0},we=0,ge=!0,ye=[],xe={},be=!1,_e=function(e,t){i.extend(a,t.publicMethods),ye.push(e)},Ie=function(e){var t=Ht();return e>t-1?e-t:e<0?t+e:e},Ce={},Te=function(e,t){return Ce[e]||(Ce[e]=[]),Ce[e].push(t)},De=function(e){var t=Ce[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var o=0;o<t.length;o++)t[o].apply(a,n)}},Ee=function(){return(new Date).getTime()},Se=function(e){le=e,a.bg.style.opacity=e*r.bgOpacity},Ae=function(e,t,n,o,i){(!be||i&&i!==a.currItem)&&(o/=i?i.fitRatio:a.currItem.fitRatio),e[S]=g+t+"px, "+n+"px"+y+" scale("+o+")"},Oe=function(e){ne&&(e&&(v>a.currItem.fitRatio?be||($t(a.currItem,!1,!0),be=!0):be&&($t(a.currItem),be=!1)),Ae(ne,de.x,de.y,v))},Me=function(e){e.container&&Ae(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},ke=function(e,t){t[S]=g+e+"px, 0px"+y},Fe=function(e,t){if(!r.loop&&t){var n=u+(ve.x*fe-e)/ve.x,o=Math.round(e-pt.x);(n<0&&o>0||n>=Ht()-1&&o<0)&&(e=pt.x+o*r.mainScrollEndFriction)}pt.x=e,ke(e,p)},Re=function(e,t){var n=dt[e]-he[e];return pe[e]+ue[e]+n-n*(t/w)},Le=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Ze=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Pe=null,ze=function(){Pe&&(i.unbind(document,"mousemove",ze),i.addClass(e,"pswp--has_mouse"),r.mouseUsed=!0,De("mouseUsed")),Pe=setTimeout(function(){Pe=null},100)},Ne=function(e,t){var n=Yt(a.currItem,me,e);return t&&(te=n),n},Ue=function(e){return e||(e=a.currItem),e.initialZoomLevel},Be=function(e){return e||(e=a.currItem),e.w>0?r.maxSpreadZoom:1},He=function(e,t,n,o){return o===a.currItem.initialZoomLevel?(n[e]=a.currItem.initialPosition[e],!0):(n[e]=Re(e,o),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]<t.max[e]&&(n[e]=t.max[e],!0))},Ke=function(e){var t="";r.escKey&&27===e.keyCode?t="close":r.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),t&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,a[t]()))},We=function(e){e&&(V||q||oe||W)&&(e.preventDefault(),e.stopPropagation())},je=function(){a.setScrollOffset(0,i.getScrollY())},Ge={},Ye=0,qe=function(e){Ge[e]&&(Ge[e].raf&&k(Ge[e].raf),Ye--,delete Ge[e])},Ve=function(e){Ge[e]&&qe(e),Ge[e]||(Ye++,Ge[e]={})},Xe=function(){for(var e in Ge)Ge.hasOwnProperty(e)&&qe(e)},$e=function(e,t,n,o,i,a,r){var l,s=Ee();Ve(e);var c=function(){if(Ge[e]){if((l=Ee()-s)>=o)return qe(e),a(n),void(r&&r());a((n-t)*i(l/o)+t),Ge[e].raf=M(c)}};c()},Qe={shout:De,listen:Te,viewportSize:me,options:r,isMainScrollAnimating:function(){return oe},getZoomLevel:function(){return v},getCurrentIndex:function(){return u},isDragging:function(){return G},isZooming:function(){return J},setScrollOffset:function(e,t){he.x=e,Z=he.y=t,De("updateScrollOffset",he)},applyZoomPan:function(e,t,n,o){de.x=t,de.y=n,v=e,Oe(o)},init:function(){if(!l&&!s){var n;a.framework=i,a.template=e,a.bg=i.getChildByClass(e,"pswp__bg"),F=e.className,l=!0,P=i.detectFeatures(),M=P.raf,k=P.caf,S=P.transform,L=P.oldIE,a.scrollWrap=i.getChildByClass(e,"pswp__scroll-wrap"),a.container=i.getChildByClass(a.scrollWrap,"pswp__container"),p=a.container.style,a.itemHolders=_=[{el:a.container.children[0],wrap:0,index:-1},{el:a.container.children[1],wrap:0,index:-1},{el:a.container.children[2],wrap:0,index:-1}],_[0].el.style.display=_[2].el.style.display="none",function(){if(S){var t=P.perspective&&!O;return g="translate"+(t?"3d(":"("),void(y=P.perspective?", 0px)":")")}S="left",i.addClass(e,"pswp--ie"),ke=function(e,t){t.left=e+"px"},Me=function(e){var t=e.fitRatio>1?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"},Oe=function(){if(ne){var e=ne,t=a.currItem,n=t.fitRatio>1?1:t.fitRatio,o=n*t.w,i=n*t.h;e.width=o+"px",e.height=i+"px",e.left=de.x+"px",e.top=de.y+"px"}}}(),h={resize:a.updateSize,orientationchange:function(){clearTimeout(z),z=setTimeout(function(){me.x!==a.scrollWrap.clientWidth&&a.updateSize()},500),clearTimeout(N),N=setTimeout(function(){me.x!==a.scrollWrap.clientWidth&&a.updateSize()},1e3)},scroll:je,keydown:Ke,click:We};var o=P.isOldIOSPhone||P.isOldAndroid||P.isMobileOpera;for(P.animationName&&P.transform&&!o||(r.showAnimationDuration=r.hideAnimationDuration=0),n=0;n<ye.length;n++)a["init"+ye[n]]();if(t)(a.ui=new t(a,i)).init();De("firstUpdate"),u=u||r.index||0,(isNaN(u)||u<0||u>=Ht())&&(u=0),a.currItem=Bt(u),(P.isOldIOSPhone||P.isOldAndroid)&&(ge=!1),e.setAttribute("aria-hidden","false"),r.modal&&(ge?e.style.position="fixed":(e.style.position="absolute",e.style.top=i.getScrollY()+"px")),void 0===Z&&(De("initialLayout"),Z=R=i.getScrollY());var c="pswp--open ";for(r.mainClass&&(c+=r.mainClass+" "),r.showHideOpacity&&(c+="pswp--animate_opacity "),c+=O?"pswp--touch":"pswp--notouch",c+=P.animationName?" pswp--css_animation":"",c+=P.svg?" pswp--svg":"",1===r.maxSpreadZoom&&!1===r.pinchToClose&&!1===r.zoomEl&&(c+=" pswp--zoom-prevented"),i.addClass(e,c),a.updateSize(),d=-1,we=null,n=0;n<3;n++)ke((n+d)*ve.x,_[n].el.style);L||i.bind(a.scrollWrap,f,a),Te("initialZoomInEnd",function(){a.setContent(_[0],u-1),a.setContent(_[2],u+1),_[0].el.style.display=_[2].el.style.display="block",r.focus&&e.focus(),i.bind(document,"keydown",a),P.transform&&i.bind(a.scrollWrap,"click",a),r.mouseUsed||i.bind(document,"mousemove",ze),i.bind(window,"resize scroll orientationchange",a),De("bindEvents")}),a.setContent(_[1],u),a.updateCurrItem(),De("afterInit"),ge||(x=setInterval(function(){Ye||G||J||v!==a.currItem.initialZoomLevel||a.updateSize()},1e3)),i.addClass(e,"pswp--visible")}},close:function(){l&&(l=!1,s=!0,De("close"),i.unbind(window,"resize scroll orientationchange",a),i.unbind(window,"scroll",h.scroll),i.unbind(document,"keydown",a),i.unbind(document,"mousemove",ze),P.transform&&i.unbind(a.scrollWrap,"click",a),G&&i.unbind(window,m,a),clearTimeout(z),clearTimeout(N),De("unbindEvents"),Kt(a.currItem,null,!0,a.destroy))},destroy:function(){De("destroy"),Pt&&clearTimeout(Pt),e.setAttribute("aria-hidden","true"),e.className=F,x&&clearInterval(x),i.unbind(a.scrollWrap,f,a),i.unbind(window,"scroll",a),ht(),Xe(),Ce=null},panTo:function(e,t,n){n||(e>te.min.x?e=te.min.x:e<te.max.x&&(e=te.max.x),t>te.min.y?t=te.min.y:t<te.max.y&&(t=te.max.y)),de.x=e,de.y=t,Oe()},handleEvent:function(e){e=e||window.event,h[e.type]&&h[e.type](e)},goTo:function(e){var t=(e=Ie(e))-u;we=t,u=e,a.currItem=Bt(u),fe-=t,Fe(ve.x*fe),Xe(),oe=!1,a.updateCurrItem()},next:function(){a.goTo(u+1)},prev:function(){a.goTo(u-1)},updateCurrZoomItem:function(e){if(e&&De("beforeChange",0),_[1].el.children.length){var t=_[1].el.children[0];ne=i.hasClass(t,"pswp__zoom-wrap")?t.style:null}else ne=null;te=a.currItem.bounds,w=v=a.currItem.initialZoomLevel,de.x=te.center.x,de.y=te.center.y,e&&De("afterChange")},invalidateCurrItems:function(){b=!0;for(var e=0;e<3;e++)_[e].item&&(_[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==we){var t,n=Math.abs(we);if(!(e&&n<2)){a.currItem=Bt(u),be=!1,De("beforeChange",we),n>=3&&(d+=we+(we>0?-3:3),n=3);for(var o=0;o<n;o++)we>0?(t=_.shift(),_[2]=t,d++,ke((d+2)*ve.x,t.el.style),a.setContent(t,u-n+o+1+1)):(t=_.pop(),_.unshift(t),d--,ke(d*ve.x,t.el.style),a.setContent(t,u+n-o-1-1));if(ne&&1===Math.abs(we)){var i=Bt(I);i.initialZoomLevel!==v&&(Yt(i,me),$t(i),Me(i))}we=0,a.updateCurrZoomItem(),I=u,De("afterChange")}}},updateSize:function(t){if(!ge&&r.modal){var n=i.getScrollY();if(Z!==n&&(e.style.top=n+"px",Z=n),!t&&xe.x===window.innerWidth&&xe.y===window.innerHeight)return;xe.x=window.innerWidth,xe.y=window.innerHeight,e.style.height=xe.y+"px"}if(me.x=a.scrollWrap.clientWidth,me.y=a.scrollWrap.clientHeight,je(),ve.x=me.x+Math.round(me.x*r.spacing),ve.y=me.y,Fe(ve.x*fe),De("beforeResize"),void 0!==d){for(var o,l,s,c=0;c<3;c++)o=_[c],ke((c+d)*ve.x,o.el.style),s=u+c-1,r.loop&&Ht()>2&&(s=Ie(s)),(l=Bt(s))&&(b||l.needsUpdate||!l.bounds)?(a.cleanSlide(l),a.setContent(o,s),1===c&&(a.currItem=l,a.updateCurrZoomItem(!0)),l.needsUpdate=!1):-1===o.index&&s>=0&&a.setContent(o,s),l&&l.container&&(Yt(l,me),$t(l),Me(l));b=!1}w=v=a.currItem.initialZoomLevel,(te=a.currItem.bounds)&&(de.x=te.center.x,de.y=te.center.y,Oe(!0)),De("resize")},zoomTo:function(e,t,n,o,a){t&&(w=v,dt.x=Math.abs(t.x)-de.x,dt.y=Math.abs(t.y)-de.y,Le(pe,de));var r=Ne(e,!1),l={};He("x",r,l,e),He("y",r,l,e);var s=v,c=de.x,u=de.y;Ze(l);var p=function(t){1===t?(v=e,de.x=l.x,de.y=l.y):(v=(e-s)*t+s,de.x=(l.x-c)*t+c,de.y=(l.y-u)*t+u),a&&a(t),Oe(1===t)};n?$e("customZoomTo",0,1,n,o||i.easing.sine.inOut,p):p(1)}},Je={},et={},tt={},nt={},ot={},it=[],at={},rt=[],lt={},st=0,ct={x:0,y:0},ut=0,pt={x:0,y:0},dt={x:0,y:0},mt={x:0,y:0},ft=function(e,t){return lt.x=Math.abs(e.x-t.x),lt.y=Math.abs(e.y-t.y),Math.sqrt(lt.x*lt.x+lt.y*lt.y)},ht=function(){X&&(k(X),X=null)},vt=function(){G&&(X=M(vt),Ot())},wt=function(e,t){return!(!e||e===document)&&(!(e.getAttribute("class")&&e.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(t(e)?e:wt(e.parentNode,t)))},gt={},yt=function(e,t){return gt.prevent=!wt(e.target,r.isClickableElement),De("preventDragEvent",e,t,gt),gt.prevent},xt=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},bt=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},_t=function(){var e=de.y-a.currItem.initialPosition.y;return 1-Math.abs(e/(me.y/2))},It={},Ct={},Tt=[],Dt=function(e){for(;Tt.length>0;)Tt.pop();return A?(ce=0,it.forEach(function(e){0===ce?Tt[0]=e:1===ce&&(Tt[1]=e),ce++})):e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(Tt[0]=xt(e.touches[0],It),e.touches.length>1&&(Tt[1]=xt(e.touches[1],Ct))):(It.x=e.pageX,It.y=e.pageY,It.id="",Tt[0]=It),Tt},Et=function(e,t){var n,o,i,l,s=de[e]+t[e],c=t[e]>0,u=pt.x+t.x,p=pt.x-at.x;if(n=s>te.min[e]||s<te.max[e]?r.panEndFriction:1,s=de[e]+t[e]*n,(r.allowPanToNext||v===a.currItem.initialZoomLevel)&&(ne?"h"!==ie||"x"!==e||q||(c?(s>te.min[e]&&(n=r.panEndFriction,te.min[e]-s,o=te.min[e]-pe[e]),(o<=0||p<0)&&Ht()>1?(l=u,p<0&&u>at.x&&(l=at.x)):te.min.x!==te.max.x&&(i=s)):(s<te.max[e]&&(n=r.panEndFriction,s-te.max[e],o=pe[e]-te.max[e]),(o<=0||p>0)&&Ht()>1?(l=u,p>0&&u<at.x&&(l=at.x)):te.min.x!==te.max.x&&(i=s))):l=u,"x"===e))return void 0!==l&&(Fe(l,!0),$=l!==at.x),te.min.x!==te.max.x&&(void 0!==i?de.x=i:$||(de.x+=t.x*n)),void 0!==l;oe||$||v>a.currItem.fitRatio&&(de[e]+=t[e]*n)},St=function(e){if(!("mousedown"===e.type&&e.button>0))if(Ut)e.preventDefault();else if(!j||"mousedown"!==e.type){if(yt(e,!0)&&e.preventDefault(),De("pointerDown"),A){var t=i.arraySearch(it,e.pointerId,"id");t<0&&(t=it.length),it[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=Dt(e),o=n.length;Q=null,Xe(),G&&1!==o||(G=ae=!0,i.bind(window,m,a),K=se=re=W=$=V=Y=q=!1,ie=null,De("firstTouchStart",n),Le(pe,de),ue.x=ue.y=0,Le(nt,n[0]),Le(ot,nt),at.x=ve.x*fe,rt=[{x:nt.x,y:nt.y}],B=U=Ee(),Ne(v,!0),ht(),vt()),!J&&o>1&&!oe&&!$&&(w=v,q=!1,J=Y=!0,ue.y=ue.x=0,Le(pe,de),Le(Je,n[0]),Le(et,n[1]),bt(Je,et,mt),dt.x=Math.abs(mt.x)-de.x,dt.y=Math.abs(mt.y)-de.y,ee=ft(Je,et))}},At=function(e){if(e.preventDefault(),A){var t=i.arraySearch(it,e.pointerId,"id");if(t>-1){var n=it[t];n.x=e.pageX,n.y=e.pageY}}if(G){var o=Dt(e);if(ie||V||J)Q=o;else if(pt.x!==ve.x*fe)ie="h";else{var a=Math.abs(o[0].x-nt.x)-Math.abs(o[0].y-nt.y);Math.abs(a)>=10&&(ie=a>0?"h":"v",Q=o)}}},Ot=function(){if(Q){var e=Q.length;if(0!==e)if(Le(Je,Q[0]),tt.x=Je.x-nt.x,tt.y=Je.y-nt.y,J&&e>1){if(nt.x=Je.x,nt.y=Je.y,!tt.x&&!tt.y&&function(e,t){return e.x===t.x&&e.y===t.y}(Q[1],et))return;Le(et,Q[1]),q||(q=!0,De("zoomGestureStarted"));var t=ft(Je,et),n=Lt(t);n>a.currItem.initialZoomLevel+a.currItem.initialZoomLevel/15&&(se=!0);var o=1,i=Ue(),l=Be();if(n<i)if(r.pinchToClose&&!se&&w<=a.currItem.initialZoomLevel){var s=1-(i-n)/(i/1.2);Se(s),De("onPinchClose",s),re=!0}else(o=(i-n)/i)>1&&(o=1),n=i-o*(i/3);else n>l&&((o=(n-l)/(6*i))>1&&(o=1),n=l+o*i);o<0&&(o=0),bt(Je,et,ct),ue.x+=ct.x-mt.x,ue.y+=ct.y-mt.y,Le(mt,ct),de.x=Re("x",n),de.y=Re("y",n),K=n>v,v=n,Oe()}else{if(!ie)return;if(ae&&(ae=!1,Math.abs(tt.x)>=10&&(tt.x-=Q[0].x-ot.x),Math.abs(tt.y)>=10&&(tt.y-=Q[0].y-ot.y)),nt.x=Je.x,nt.y=Je.y,0===tt.x&&0===tt.y)return;if("v"===ie&&r.closeOnVerticalDrag&&"fit"===r.scaleMode&&v===a.currItem.initialZoomLevel){ue.y+=tt.y,de.y+=tt.y;var c=_t();return W=!0,De("onVerticalDrag",c),Se(c),void Oe()}!function(e,t,n){if(e-B>50){var o=rt.length>2?rt.shift():{};o.x=t,o.y=n,rt.push(o),B=e}}(Ee(),Je.x,Je.y),V=!0,te=a.currItem.bounds,Et("x",tt)||(Et("y",tt),Ze(de),Oe())}}},Mt=function(e){if(P.isOldAndroid){if(j&&"mouseup"===e.type)return;e.type.indexOf("touch")>-1&&(clearTimeout(j),j=setTimeout(function(){j=0},600))}var t;if(De("pointerUp"),yt(e,!1)&&e.preventDefault(),A){var n=i.arraySearch(it,e.pointerId,"id");if(n>-1)if(t=it.splice(n,1)[0],navigator.msPointerEnabled){t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type||(t.type=e.pointerType||"mouse")}else t.type=e.pointerType||"mouse"}var o,l=Dt(e),s=l.length;if("mouseup"===e.type&&(s=0),2===s)return Q=null,!0;1===s&&Le(ot,l[0]),0!==s||ie||oe||(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"})),De("touchRelease",e,t));var c=-1;if(0===s&&(G=!1,i.unbind(window,m,a),ht(),J?c=0:-1!==ut&&(c=Ee()-ut)),ut=1===s?Ee():-1,o=-1!==c&&c<150?"zoom":"swipe",J&&s<2&&(J=!1,1===s&&(o="zoomPointerUp"),De("zoomGestureEnded")),Q=null,V||q||oe||W)if(Xe(),H||(H=kt()),H.calculateSwipeSpeed("x"),W){if(_t()<r.verticalDragRange)a.close();else{var u=de.y,p=le;$e("verticalDrag",0,1,300,i.easing.cubic.out,function(e){de.y=(a.currItem.initialPosition.y-u)*e+u,Se((1-p)*e+p),Oe()}),De("onVerticalDrag",1)}}else{if(($||oe)&&0===s){if(Rt(o,H))return;o="zoomPointerUp"}oe||("swipe"===o?!$&&v>a.currItem.fitRatio&&Ft(H):Zt())}},kt=function(){var e,t,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(o){rt.length>1?(e=Ee()-B+50,t=rt[rt.length-2][o]):(e=Ee()-U,t=ot[o]),n.lastFlickOffset[o]=nt[o]-t,n.lastFlickDist[o]=Math.abs(n.lastFlickOffset[o]),n.lastFlickDist[o]>20?n.lastFlickSpeed[o]=n.lastFlickOffset[o]/e:n.lastFlickSpeed[o]=0,Math.abs(n.lastFlickSpeed[o])<.1&&(n.lastFlickSpeed[o]=0),n.slowDownRatio[o]=.95,n.slowDownRatioReverse[o]=1-n.slowDownRatio[o],n.speedDecelerationRatio[o]=1},calculateOverBoundsAnimOffset:function(e,t){n.backAnimStarted[e]||(de[e]>te.min[e]?n.backAnimDestination[e]=te.min[e]:de[e]<te.max[e]&&(n.backAnimDestination[e]=te.max[e]),void 0!==n.backAnimDestination[e]&&(n.slowDownRatio[e]=.7,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatioAbs[e]<.05&&(n.lastFlickSpeed[e]=0,n.backAnimStarted[e]=!0,$e("bounceZoomPan"+e,de[e],n.backAnimDestination[e],t||300,i.easing.sine.out,function(t){de[e]=t,Oe()}))))},calculateAnimOffset:function(e){n.backAnimStarted[e]||(n.speedDecelerationRatio[e]=n.speedDecelerationRatio[e]*(n.slowDownRatio[e]+n.slowDownRatioReverse[e]-n.slowDownRatioReverse[e]*n.timeDiff/10),n.speedDecelerationRatioAbs[e]=Math.abs(n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]),n.distanceOffset[e]=n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]*n.timeDiff,de[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(Ge.zoomPan&&(Ge.zoomPan.raf=M(n.panAnimLoop),n.now=Ee(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),Oe(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return de.x=Math.round(de.x),de.y=Math.round(de.y),Oe(),void qe("zoomPan")}};return n},Ft=function(e){if(e.calculateSwipeSpeed("y"),te=a.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05)return e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0;Ve("zoomPan"),e.lastNow=Ee(),e.panAnimLoop()},Rt=function(e,t){var n,o,l;if(oe||(st=u),"swipe"===e){var s=nt.x-ot.x,c=t.lastFlickDist.x<10;s>30&&(c||t.lastFlickOffset.x>20)?o=-1:s<-30&&(c||t.lastFlickOffset.x<-20)&&(o=1)}o&&((u+=o)<0?(u=r.loop?Ht()-1:0,l=!0):u>=Ht()&&(u=r.loop?0:Ht()-1,l=!0),l&&!r.loop||(we+=o,fe-=o,n=!0));var p,d=ve.x*fe,m=Math.abs(d-pt.x);return n||d>pt.x==t.lastFlickSpeed.x>0?(p=Math.abs(t.lastFlickSpeed.x)>0?m/Math.abs(t.lastFlickSpeed.x):333,p=Math.min(p,400),p=Math.max(p,250)):p=333,st===u&&(n=!1),oe=!0,De("mainScrollAnimStart"),$e("mainScroll",pt.x,d,p,i.easing.cubic.out,Fe,function(){Xe(),oe=!1,st=-1,(n||st!==u)&&a.updateCurrItem(),De("mainScrollAnimComplete")}),n&&a.updateCurrItem(!0),n},Lt=function(e){return 1/ee*e*w},Zt=function(){var e=v,t=Ue(),n=Be();v<t?e=t:v>n&&(e=n);var o,r=le;return re&&!K&&!se&&v<t?(a.close(),!0):(re&&(o=function(e){Se((1-r)*e+r)}),a.zoomTo(e,0,200,i.easing.cubic.out,o),!0)};_e("Gestures",{publicMethods:{initGestures:function(){var e=function(e,t,n,o,i){C=e+t,T=e+n,D=e+o,E=i?e+i:""};(A=P.pointerEvent)&&P.touch&&(P.touch=!1),A?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):P.touch?(e("touch","start","move","end","cancel"),O=!0):e("mouse","down","move","up"),m=T+" "+D+" "+E,f=C,A&&!O&&(O=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),a.likelyTouchDevice=O,h[C]=St,h[T]=At,h[D]=Mt,E&&(h[E]=h[D]),P.touch&&(f+=" mousedown",m+=" mousemove mouseup",h.mousedown=h[C],h.mousemove=h[T],h.mouseup=h[D]),O||(r.allowPanToNext=!1)}}});var Pt,zt,Nt,Ut,Bt,Ht,Kt=function(t,n,o,l){var s;Pt&&clearTimeout(Pt),Ut=!0,Nt=!0,t.initialLayout?(s=t.initialLayout,t.initialLayout=null):s=r.getThumbBoundsFn&&r.getThumbBoundsFn(u);var p=o?r.hideAnimationDuration:r.showAnimationDuration,d=function(){qe("initialZoom"),o?(a.template.removeAttribute("style"),a.bg.removeAttribute("style")):(Se(1),n&&(n.style.display="block"),i.addClass(e,"pswp--animated-in"),De("initialZoom"+(o?"OutEnd":"InEnd"))),l&&l(),Ut=!1};if(!p||!s||void 0===s.x)return De("initialZoom"+(o?"Out":"In")),v=t.initialZoomLevel,Le(de,t.initialPosition),Oe(),e.style.opacity=o?0:1,Se(1),void(p?setTimeout(function(){d()},p):d());var m,f;m=c,f=!a.currItem.src||a.currItem.loadError||r.showHideOpacity,t.miniImg&&(t.miniImg.style.webkitBackfaceVisibility="hidden"),o||(v=s.w/t.w,de.x=s.x,de.y=s.y-R,a[f?"template":"bg"].style.opacity=.001,Oe()),Ve("initialZoom"),o&&!m&&i.removeClass(e,"pswp--animated-in"),f&&(o?i[(m?"remove":"add")+"Class"](e,"pswp--animate_opacity"):setTimeout(function(){i.addClass(e,"pswp--animate_opacity")},30)),Pt=setTimeout(function(){if(De("initialZoom"+(o?"Out":"In")),o){var n=s.w/t.w,a={x:de.x,y:de.y},r=v,l=le,c=function(t){1===t?(v=n,de.x=s.x,de.y=s.y-Z):(v=(n-r)*t+r,de.x=(s.x-a.x)*t+a.x,de.y=(s.y-Z-a.y)*t+a.y),Oe(),f?e.style.opacity=1-t:Se(l-t*l)};m?$e("initialZoom",0,1,p,i.easing.cubic.out,c,d):(c(1),Pt=setTimeout(d,p+20))}else v=t.initialZoomLevel,Le(de,t.initialPosition),Oe(),Se(1),f?e.style.opacity=1:Se(1),Pt=setTimeout(d,p+20)},o?25:90)},Wt={},jt=[],Gt={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return zt.length}},Yt=function(e,t,n){if(e.src&&!e.loadError){var o=!n;if(o&&(e.vGap||(e.vGap={top:0,bottom:0}),De("parseVerticalMargin",e)),Wt.x=t.x,Wt.y=t.y-e.vGap.top-e.vGap.bottom,o){var i=Wt.x/e.w,a=Wt.y/e.h;e.fitRatio=i<a?i:a;var l=r.scaleMode;"orig"===l?n=1:"fit"===l&&(n=e.fitRatio),n>1&&(n=1),e.initialZoomLevel=n,e.bounds||(e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}})}if(!n)return;return function(e,t,n){var o=e.bounds;o.center.x=Math.round((Wt.x-t)/2),o.center.y=Math.round((Wt.y-n)/2)+e.vGap.top,o.max.x=t>Wt.x?Math.round(Wt.x-t):o.center.x,o.max.y=n>Wt.y?Math.round(Wt.y-n)+e.vGap.top:o.center.y,o.min.x=t>Wt.x?0:o.center.x,o.min.y=n>Wt.y?e.vGap.top:o.center.y}(e,e.w*n,e.h*n),o&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds}return 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},qt=function(e,t,n,o,i,r){t.loadError||o&&(t.imageAppended=!0,$t(t,o,t===a.currItem&&be),n.appendChild(o),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},Vt=function(e){e.loading=!0,e.loaded=!1;var t=e.img=i.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};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},Xt=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=r.errorMsg.replace("%url%",e.src),!0},$t=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"}},Qt=function(){if(jt.length){for(var e,t=0;t<jt.length;t++)(e=jt[t]).holder.index===e.index&&qt(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);jt=[]}};_e("Controller",{publicMethods:{lazyLoadItem:function(e){e=Ie(e);var t=Bt(e);t&&(!t.loaded&&!t.loading||b)&&(De("gettingData",e,t),t.src&&Vt(t))},initController:function(){i.extend(r,Gt,!0),a.items=zt=n,Bt=a.getItemAt,Ht=r.getNumItemsFn,r.loop,Ht()<3&&(r.loop=!1),Te("beforeChange",function(e){var t,n=r.preload,o=null===e||e>=0,i=Math.min(n[0],Ht()),l=Math.min(n[1],Ht());for(t=1;t<=(o?l:i);t++)a.lazyLoadItem(u+t);for(t=1;t<=(o?i:l);t++)a.lazyLoadItem(u-t)}),Te("initialLayout",function(){a.currItem.initialLayout=r.getThumbBoundsFn&&r.getThumbBoundsFn(u)}),Te("mainScrollAnimComplete",Qt),Te("initialZoomInEnd",Qt),Te("destroy",function(){for(var e,t=0;t<zt.length;t++)(e=zt[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);jt=null})},getItemAt:function(e){return e>=0&&(void 0!==zt[e]&&zt[e])},allowProgressiveImg:function(){return r.forceProgressiveLoading||!O||r.mouseUsed||screen.width>1200},setContent:function(e,t){r.loop&&(t=Ie(t));var n=a.getItemAt(e.index);n&&(n.container=null);var o,s=a.getItemAt(t);if(s){De("gettingData",t,s),e.index=t,e.item=s;var c=s.container=i.createEl("pswp__zoom-wrap");if(!s.src&&s.html&&(s.html.tagName?c.appendChild(s.html):c.innerHTML=s.html),Xt(s),Yt(s,me),!s.src||s.loadError||s.loaded)s.src&&!s.loadError&&((o=i.createEl("pswp__img","img")).style.opacity=1,o.src=s.src,$t(s,o),qt(0,s,c,o));else{if(s.loadComplete=function(n){if(l){if(e&&e.index===t){if(Xt(n,!0))return n.loadComplete=n.img=null,Yt(n,me),Me(n),void(e.index===u&&a.updateCurrZoomItem());n.imageAppended?!Ut&&n.placeholder&&(n.placeholder.style.display="none",n.placeholder=null):P.transform&&(oe||Ut)?jt.push({item:n,baseDiv:c,img:n.img,index:t,holder:e,clearPlaceholder:!0}):qt(0,n,c,n.img,0,!0)}n.loadComplete=null,n.img=null,De("imageLoadComplete",t,n)}},i.features.transform){var p="pswp__img pswp__img--placeholder";p+=s.msrc?"":" pswp__img--placeholder--blank";var d=i.createEl(p,s.msrc?"img":"");s.msrc&&(d.src=s.msrc),$t(s,d),c.appendChild(d),s.placeholder=d}s.loading||Vt(s),a.allowProgressiveImg()&&(!Nt&&P.transform?jt.push({item:s,baseDiv:c,img:s.img,index:t,holder:e}):qt(0,s,c,s.img,0,!0))}Nt||t!==u?Me(s):(ne=c.style,Kt(s,o||s.img)),e.el.innerHTML="",e.el.appendChild(c)}else e.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});var Jt,en,tn={},nn=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)};_e("Tap",{publicMethods:{initTap:function(){Te("firstTouchStart",a.onTapStart),Te("touchRelease",a.onTapRelease),Te("destroy",function(){tn={},Jt=null})},onTapStart:function(e){e.length>1&&(clearTimeout(Jt),Jt=null)},onTapRelease:function(e,t){var n,o;if(!i.hasClass(e.target,"pswp__button")&&!i.hasClass(e.target,"pswp__share-modal")&&(t&&!V&&!Y&&!Ye)){var a=t;if(Jt&&(clearTimeout(Jt),Jt=null,n=a,o=tn,Math.abs(n.x-o.x)<25&&Math.abs(n.y-o.y)<25))return void De("doubleTap",a);if("mouse"===t.type)return void nn(e,t,"mouse");if("BUTTON"===e.target.tagName.toUpperCase()||i.hasClass(e.target,"pswp__single-tap"))return void nn(e,t);Le(tn,a),Jt=setTimeout(function(){nn(e,t),Jt=null},300)}}}}),_e("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(O?Te("mouseUsed",function(){a.setupDesktopZoom()}):a.setupDesktopZoom(!0))},setupDesktopZoom:function(t){en={};var n="wheel mousewheel DOMMouseScroll";Te("bindEvents",function(){i.bind(e,n,a.handleMouseWheel)}),Te("unbindEvents",function(){en&&i.unbind(e,n,a.handleMouseWheel)}),a.mouseZoomedIn=!1;var o,r=function(){a.mouseZoomedIn&&(i.removeClass(e,"pswp--zoomed-in"),a.mouseZoomedIn=!1),v<1?i.addClass(e,"pswp--zoom-allowed"):i.removeClass(e,"pswp--zoom-allowed"),l()},l=function(){o&&(i.removeClass(e,"pswp--dragging"),o=!1)};Te("resize",r),Te("afterChange",r),Te("pointerDown",function(){a.mouseZoomedIn&&(o=!0,i.addClass(e,"pswp--dragging"))}),Te("pointerUp",l),t||r()},handleMouseWheel:function(e){if(v<=a.currItem.fitRatio)return r.modal&&(!r.closeOnScroll||Ye||G?e.preventDefault():S&&Math.abs(e.deltaY)>2&&(c=!0,a.close())),!0;if(e.stopPropagation(),en.x=0,"deltaX"in e)1===e.deltaMode?(en.x=18*e.deltaX,en.y=18*e.deltaY):(en.x=e.deltaX,en.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(en.x=-.16*e.wheelDeltaX),e.wheelDeltaY?en.y=-.16*e.wheelDeltaY:en.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;en.y=e.detail}Ne(v,!0);var t=de.x-en.x,n=de.y-en.y;(r.modal||t<=te.min.x&&t>=te.max.x&&n<=te.min.y&&n>=te.max.y)&&e.preventDefault(),a.panTo(t,n)},toggleDesktopZoom:function(t){t=t||{x:me.x/2+he.x,y:me.y/2+he.y};var n=r.getDoubleTapZoom(!0,a.currItem),o=v===n;a.mouseZoomedIn=!o,a.zoomTo(o?a.currItem.initialZoomLevel:n,t,333),i[(o?"remove":"add")+"Class"](e,"pswp--zoomed-in")}}});var on,an,rn,ln,sn,cn,un,pn,dn,mn,fn={history:!0,galleryUID:1},hn=function(){return mn.hash.substring(1)},vn=function(){on&&clearTimeout(on),rn&&clearTimeout(rn)},wn=function(){var e,t="",o=hn(),i={};return null!==(e=(o=(o=(o=o.replace("%5B","[")).replace("%5D","]")).replace(/([^|])(poster=|videoplayer)/gm,"$1|$2")).match(/^!([\w\-[\]]+?\/(?:(\d+)(?=\/))?(https?:\/\/[^&]*)?([A-Z]{2}\/[_\w]*)?)/im))?(t=(t=e[1]).substring(t.indexOf("/")+1,t.length),/^([A-Z]{2}\/[_\w]*)$/im.test(t)&&(t=t.replace("/","-")),jQuery.each(n,function(e,n){return void 0!==n.contentID&&n.contentID=="jig-contentID-"+t||n.src==t?(i.pid=e,!1):void 0}),i.pid=parseInt(i.pid,10)):i.pid=0,i},gn=function(){if(rn&&clearTimeout(rn),Ye||G)rn=setTimeout(gn,500);else{ln?clearTimeout(an):ln=!0;var e="!"+r.galleryUID+"/";if(void 0!==n[u].contentID){var t=/(?:jig-contentID)-(\w{2})-([^\s]*)/im.exec(n[u].contentID);null!==t&&(e+=t[1]+"/"+t[2])}else e+=n[u].src;if(un){var o=mn.href.split("#")[0]+"#"+e;mn.replace(o)}else-1===mn.hash.indexOf(e)&&-1===mn.hash.indexOf("%5B")&&-1===mn.hash.indexOf("%5D")&&(dn=!0),mn.hash=e;un=!0,an=setTimeout(function(){ln=!1},60)}};_e("History",{publicMethods:{initHistory:function(){if(i.extend(r,fn,!0),r.history){mn=window.location,dn=!1,pn=!1,un=!1,Te("afterChange",a.updateURL),Te("unbindEvents",function(){i.unbind(window,"hashchange",a.onHashChange)});var e=function(){cn=!0,pn||(dn?history.back():"pushState"in history?history.pushState("",document.title,mn.pathname+mn.search):mn.hash=""),vn()};Te("unbindEvents",function(){c&&e()}),Te("destroy",function(){cn||e()}),Te("firstUpdate",function(){u=wn().pid}),setTimeout(function(){l&&i.bind(window,"hashchange",a.onHashChange)},40)}},onHashChange:function(){if(""===hn())return pn=!0,void a.close();ln||(sn=!0,a.goTo(wn().pid),sn=!1)},updateURL:function(){vn(),sn||(un?on=setTimeout(gn,800):gn())}}}),i.extend(a,Qe)}}),function(e,t){"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(e,t){var n,o,i,a,r,l,s,c,u,p,d,m,f,h,v,w,g,y,x=this,b=!1,_=!0,I=!0,C={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return e.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return e.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},T=function(e){if(w)return!0;e=e||window.event,v.timeToIdle&&v.mouseUsed&&!u&&R();for(var n,o,i=(e.target||e.srcElement).getAttribute("class")||"",a=0;a<z.length;a++)(n=z[a]).onTap&&i.indexOf("pswp__"+n.name)>-1&&(n.onTap(),o=!0);if(o){e.stopPropagation&&e.stopPropagation(),w=!0;var r=t.features.isOldAndroid?600:30;setTimeout(function(){w=!1},r)}},D=function(e,n,o){t[(o?"add":"remove")+"Class"](e,"pswp__"+n)},E=function(){var e=1===v.getNumItemsFn();e!==h&&(D(o,"ui--one-slide",e),h=e)},S=function(){D(s,"share-modal--hidden",I)},A=function(){return(I=!I)?(t.removeClass(s,"pswp__share-modal--fade-in"),setTimeout(function(){I&&S()},300)):(S(),setTimeout(function(){I||t.addClass(s,"pswp__share-modal--fade-in")},30)),I||M(),!1},O=function(t){var n=(t=t||window.event).target||t.srcElement;return e.shout("shareLinkClick",t,n),!!n.href&&(!!n.hasAttribute("download")||(window.open(n.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)),I||A(),!1))},M=function(){var t,n,o,i="",a=e.options.shareButtons;if(location.hash){var r=(n=decodeURI(document.location.href)).split("#!");n=r[0]+"#!"+r[1]}else n=location.href;if(void 0!==e.options.socialButtons){var l=e.options.socialButtons;a=[],l=(l=(l=l.toLowerCase()).replace(/[^ftp]/gi,"")).split("");var c=jQuery.inArray("f",l),u=jQuery.inArray("t",l),p=jQuery.inArray("p",l);~c&&(a[c]=e.options.shareButtons[0]),~u&&(a[u]=e.options.shareButtons[1]),~p&&(a[p]=e.options.shareButtons[2]),void 0!==e.options.shareButtons[3]&&a.push(e.options.shareButtons[3])}jQuery.each(a,function(a,r){void 0!==r&&(o=(e.currItem.title||"")+(e.currItem.description?(e.currItem.title?" ":"")+e.currItem.description:"")||document.title,t=r.url.replace("{{url}}",encodeURIComponent(n)).replace("{{facebook_url}}",encodeURIComponent(n.replace("#!",(-1===n.indexOf("?")?"?":"&")+"_escaped_fragment_="))).replace("{{image_url}}",encodeURIComponent(e.currItem.src||"")).replace("{{raw_image_url}}",e.currItem.src||"").replace("{{title}}",encodeURIComponent(e.currItem.title||document.title)).replace("{{description}}",encodeURIComponent(jQuery("<p>"+o.replace(/<a(?:.+?)href=['"](.+?)['"](?:.+?>)(.+?)(?:<\/a>)/gm,"$2: $1")+"</p>").text())),i+='<a href="'+t+'" target="_blank" class="pswp__share--'+r.id+'"'+(r.download?"download":"")+">"+r.label+"</a>")}),s.children[0].innerHTML=i,s.children[0].onclick=O},k=function(e){for(var n=0;n<v.closeElClasses.length;n++)if(t.hasClass(e,"pswp__"+v.closeElClasses[n]))return!0},F=0,R=function(){clearTimeout(y),F=0,u&&x.setIdle(!1)},L=function(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(y),y=setTimeout(function(){x.setIdle(!0)},v.timeToIdleOutside))},Z=function(e){m!==e&&(D(d,"preloader--active",!e),m=e)},P=function(n){var r=n.vGap;if(!e.likelyTouchDevice||v.mouseUsed||screen.width>v.fitControlsWidth){var l=v.barsSize;if(v.captionEl&&"auto"===l.bottom)if(a||((a=t.createEl("pswp__caption pswp__caption--fake")).appendChild(t.createEl("pswp__caption__center")),o.insertBefore(a,i),t.addClass(o,"pswp__ui--fit")),v.addCaptionHTMLFn(n,a,!0)){var s=a.clientHeight;r.bottom=parseInt(s,10)||44}else r.bottom=l.top;else r.bottom="auto"===l.bottom?0:l.bottom;r.top=l.top}else r.top=r.bottom=0},z=[{name:"caption",option:"captionEl",onInit:function(e){i=e}},{name:"share-modal",option:"shareEl",onInit:function(e){s=e},onTap:function(){A()}},{name:"button--share",option:"shareEl",onInit:function(e){l=e},onTap:function(){A()}},{name:"button--zoom",option:"zoomEl",onTap:e.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){r=e}},{name:"button--close",option:"closeEl",onTap:e.close},{name:"button--arrow--left",option:"arrowEl",onTap:e.prev},{name:"button--arrow--right",option:"arrowEl",onTap:e.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){n.isFullscreen()?n.exit():n.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){d=e}}];x.init=function(){var r;t.extend(e.options,C,!0),v=e.options,o=t.getChildByClass(e.scrollWrap,"pswp__ui"),(p=e.listen)("onVerticalDrag",function(e){_&&e<.95?x.hideControls():!_&&e>=.95&&x.showControls()}),p("onPinchClose",function(e){_&&e<.9?(x.hideControls(),r=!0):r&&!_&&e>.9&&x.showControls()}),p("zoomGestureEnded",function(){(r=!1)&&!_&&x.showControls()}),p("beforeChange",x.update),p("doubleTap",function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(v.getDoubleTapZoom(!1,e.currItem),t,333)}),p("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.getAttribute("class")&&e.type.indexOf("mouse")>-1&&(o.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),p("bindEvents",function(){t.bind(o,"pswpTap click",T),t.bind(e.scrollWrap,"pswpTap",x.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",x.onMouseOver)}),p("unbindEvents",function(){I||A(),g&&clearInterval(g),t.unbind(document,"mouseout",L),t.unbind(document,"mousemove",R),t.unbind(o,"pswpTap click",T),t.unbind(e.scrollWrap,"pswpTap",x.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",x.onMouseOver),n&&(t.unbind(document,n.eventK,x.updateFullscreen),n.isFullscreen()&&(v.hideAnimationDuration=0,n.exit()),n=null)}),p("destroy",function(){v.captionEl&&(a&&o.removeChild(a),t.removeClass(i,"pswp__caption--empty")),s&&(s.children[0].onclick=null),t.removeClass(o,"pswp__ui--over-close"),t.addClass(o,"pswp__ui--hidden"),x.setIdle(!1)}),v.showAnimationDuration||t.removeClass(o,"pswp__ui--hidden"),p("initialZoomIn",function(){v.showAnimationDuration&&t.removeClass(o,"pswp__ui--hidden")}),p("initialZoomOut",function(){t.addClass(o,"pswp__ui--hidden")}),p("parseVerticalMargin",P),function(){var e,n,i,a=function(o){if(o)for(var a=o.length,r=0;r<a;r++){e=o[r],n=e.className;for(var l=0;l<z.length;l++)i=z[l],n.indexOf("pswp__"+i.name)>-1&&(v[i.option]?(t.removeClass(e,"pswp__element--disabled"),i.onInit&&i.onInit(e)):t.addClass(e,"pswp__element--disabled"))}};a(o.children);var r=t.getChildByClass(o,"pswp__top-bar");r&&a(r.children)}(),v.shareEl&&l&&s&&(I=!0),E(),v.timeToIdle&&p("mouseUsed",function(){t.bind(document,"mousemove",R),t.bind(document,"mouseout",L),g=setInterval(function(){2===++F&&x.setIdle(!0)},v.timeToIdle/2)}),v.fullscreenEl&&!t.features.isOldAndroid&&(n||(n=x.getFullscreenAPI()),n?(t.bind(document,n.eventK,x.updateFullscreen),x.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),v.preloaderEl&&(Z(!0),p("beforeChange",function(){clearTimeout(f),f=setTimeout(function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&Z(!1):Z(!0)},v.loadingIndicatorDelay)}),p("imageLoadComplete",function(t,n){e.currItem===n&&Z(!0)}))},x.setIdle=function(e){u=e,D(o,"ui--idle",e)},x.update=function(){_&&e.currItem?(x.updateIndexIndicator(),v.captionEl&&(v.addCaptionHTMLFn(e.currItem,i),D(i,"caption--empty",!e.currItem.title&&!e.currItem.description)),b=!0):b=!1,I||A(),E()},x.updateFullscreen=function(o){o&&setTimeout(function(){e.setScrollOffset(0,t.getScrollY())},50),t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},x.updateIndexIndicator=function(){v.counterEl&&(r.innerHTML=e.getCurrentIndex()+1+v.indexIndicatorSep+v.getNumItemsFn())},x.onGlobalTap=function(n){var o=(n=n||window.event).target||n.srcElement;if(!w)if(n.detail&&"mouse"===n.detail.pointerType){if(k(o))return void e.close();t.hasClass(o,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?v.clickToCloseNonZoomable&&e.close():e.toggleDesktopZoom(n.detail.releasePoint))}else if(v.tapToToggleControls&&(_?x.hideControls():x.showControls()),v.tapToClose&&(t.hasClass(o,"pswp__img")||k(o)))return void e.close()},x.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;D(o,"ui--over-close",k(t))},x.hideControls=function(){t.addClass(o,"pswp__ui--hidden"),_=!1},x.showControls=function(){_=!0,b||x.update(),t.removeClass(o,"pswp__ui--hidden")},x.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},x.getFullscreenAPI=function(){var t,n=document.documentElement,o="fullscreenchange";return n.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:o}:n.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+o}:n.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+o}:n.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){if(c=v.closeOnScroll,v.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK)return e.template[this.enterK]();e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return v.closeOnScroll=c,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}}}),function(e){e.fn.JIGphotoSwipe=function(t){var n=this,o=e(n[0]).closest(".justified-image-grid"),i=e.extend(!0,{},t),a=function(t){t.preventDefault();var n,o=e(t.target).closest(".jig-imageContainer").attr("class"),i=/(?:jig-contentID)-(\w{2})-([^\s]*)/im.exec(o),a=e(t.target).closest("a.jig-link"),r=a.attr("rel").split(" ").shift();return n=null!=i?i[0]:a.attr("href"),l(n,r),!1},r=function(){var e,t="",n=location.hash,o={};return null!==(e=(n=(n=(n=n.replace("%5B","[")).replace("%5D","]")).replace(/([^|])(poster=|videoplayer)/gm,"$1|$2")).match(/^#!([\w\-[\]]+?\/(?:(\d+)(?=\/))?(https?:\/\/[^&]*)?([A-Z]{2}\/[_\w]*)?)/im))&&(t=(t=e[1]).substring(t.indexOf("/")+1,t.length),/^([A-Z]{2}\/[_\w]*)$/im.test(t)&&(t=t.replace("/","-"))),o.contentID="jig-contentID-"+t,o.theRel=n.substring(2,n.indexOf("/")),o},l=function(o,a,r){var l,s=function(t){var o=[];return n.filter('[rel~="'+t+'"]').each(function(t){var n=e(this),i=n.find("img"),a=n.find("img").attr("alt"),r=n.attr("title"),l=n.attr("data-wh").split("x"),s="jig-overflow"==n.parent().attr("class")?n.closest(".jig-imageContainer").attr("class"):n.attr("class"),c=/(?:jig-contentID)-(\w{2})-([^\s]*)/im.exec(s),u={src:n.attr("href"),w:parseInt(l[0],10),h:parseInt(l[1],10),msrc:i.attr("src")};null!=c&&(u.contentID=c[0]),a&&(u.title=a),r&&(u.description=r),u.el=n[0],o.push(u)}),o}(a),c=!1;if(0==s.length)return!1;e.each(s,function(e,n){return void 0!==n.contentID&&n.contentID==o||n.src==o?(t.index=e,!1):void 0}),t.galleryUID=a,t.getThumbBoundsFn=function(t){if("jig-overflow"==e(s[t].el).parent().attr("class")){var n=s[t].el.getElementsByTagName("img")[0],o=e(window).scrollTop(),i=n.getBoundingClientRect();return{x:i.left,y:i.top+o,w:i.width}}return{x:e(window).width()/2,y:e(window).height()/2+e(window).scrollTop(),w:0}},t.addCaptionHTMLFn=function(e,t,n){var o=[];return void 0!==e.title&&o.push(e.title),void 0!==e.description&&o.push("<small>"+e.description+"</small>"),0==o.length?(t.children[0].innerText="",!1):(t.children[0].innerHTML=o.join("<br/>"),!0)},t.shareButtons=[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{facebook_url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{title}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{description}}"}],void 0!==t.allowDownload&&!0===t.allowDownload&&t.shareButtons.push({id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}),r?(t.showAnimationDuration=0,void 0!==i.closeOnScroll&&1!=i.closeOnScroll||(t.closeOnScroll=!1,l=!0)):t.showAnimationDuration=void 0===i.showAnimationDuration?333:i.showAnimationDuration;var u=e(s[t.index].el);"jig-overflow"==u.parent().attr("class")&&("0px"!==u.find("img").css("margin-left")||u.parent().parent().hasClass("differentAspectRatio"))&&(c=!0),c||void 0!==t.aspectRatioMismatch&&!0===t.aspectRatioMismatch?(t.showAnimationDuration=0,t.showHideOpacity=void 0===i.showHideOpacity||i.showHideOpacity,t.mainClass="hidePsPlaceholder"):(t.showAnimationDuration=void 0===i.showAnimationDuration?333:i.showAnimationDuration,t.showHideOpacity=void 0!==i.showHideOpacity&&i.showHideOpacity,t.mainClass=void 0===i.mainClass?"":i.mainClass),e(".pswp").removeAttr("style"),e(".pswp").removeClass(function(e,t){return(t.match(/pswp--\S+theme/g)||[]).join(" ")}),void 0!==t.customTheme&&e(".pswp").addClass("pswp--"+t.customTheme+"-theme"),e.fn.JIGphotoSwipe.gallery=new PhotoSwipe(e(".pswp")[0],PhotoSwipeUI_Default,s,t),e.fn.JIGphotoSwipe.gallery.listen("close",function(){e("body").removeClass("photoswipe-open")}),e.fn.JIGphotoSwipe.gallery.listen("afterInit",function(){e("body").addClass("photoswipe-open")}),e.fn.JIGphotoSwipe.gallery.init(),1==l&&setTimeout(function(){e.fn.JIGphotoSwipe.gallery.options.closeOnScroll=!0},2e3)};!function(){if(0===e(".pswp").length){var n=void 0!==t.captionAlign?" pswp__ca_"+t.captionAlign:" pswp__ca_center";e("body").append('<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"><div class="pswp__bg"></div><div class="pswp__scroll-wrap"><div class="pswp__container"><div class="pswp__item"></div><div class="pswp__item"></div><div class="pswp__item"></div></div><div class="pswp__ui pswp__ui--hidden'+n+'"><div class="pswp__top-bar"><div class="pswp__counter"></div><span class="pswp__button pswp__button--close" title="Close (Esc)"></span><span class="pswp__button pswp__button--share" title="Share"></span><span class="pswp__button pswp__button--fs" title="Toggle fullscreen"></span><span class="pswp__button pswp__button--zoom" title="Zoom in/out"></span><div class="pswp__preloader"><div class="pswp__preloader__icn"><div class="pswp__preloader__cut"><div class="pswp__preloader__donut"></div></div></div></div></div><div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"><div class="pswp__share-tooltip"></div></div><span class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></span><span class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></span><div class="pswp__caption"><div class="pswp__caption__center"></div></div></div></div></div>')}o.off("click.photoswipe").on("click.photoswipe","a.jig-link",a);var i=r();i.theRel&&i.contentID&&l(i.contentID,i.theRel,!0)}()}}(jQuery);
function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function loadJustifiedImageGrid(e){e.justifiedImageGrid=function(t,i){var r={targetHeight:190,heightDeviation:40,limitByViewport:"yes",aspectRatio:"",disableCropping:"",randomizeWidth:"",margins:4,animSpeed:300,limit:0,initiallyLoad:"",maxRows:"",linkClass:"",linkRel:"jig[*instance*]",linkAttributeName:"",linkAttributeValue:"",linkAttribute:"",linkTitleField:"description",imgAltField:"title",wrapText:"no",readingDirection:"ltr",loadMore:"off",loadMoreText:"Load more",loadMoreCountText:"(*count* images remaining)",loadMoreOffset:100,loadMoreAutoWidth:"on",disableHover:"no",downloadLink:"no",lightboxLink:"no",verticalCenterCaptions:"off",customFonts:"yes",captionHeight:54,quality:90,retinaReady:"yes",retinaQuality:"auto",minRetinaQuality:30,maxRetinaDensity:3,caption:"fade",captionMatchWidth:"no",captionMatchWidthForceNo:!1,titleField:"title",captionField:"description",lightbox:"prettyphoto",lightboxInit:"jigAddLightbox1",overlay:"hovered",overlayIcon:"off",bordersTotal:0,innerBorder:"always",innerBorderWidth:0,innerBorderAnimate:"width",middleBorder:"always",middleBorderWidth:0,middleBorderColor:"white",outerBorder:"always",outerBorderColor:"black",specialFx:"off",specialFxType:"desaturate",captionFxVisibility:"in_front_of_overlay",specialFxOptions:"",specialFxBlend:1,incompleteLastRow:"normal",errorChecking:"yes",suppressErrors:"no",retryCount:0,resizeCount:0,errorChecked:!1,errorImages:[],filters:!1,filterMultiple:"no",filterStyle:"buttons",L2filters:!1,L2FilterMultiple:"no",L2FilterStyle:"buttons",filterSmallestColor:"#A3A3A3",filterSmallestSize:11,filterLargestColor:"#000000",filterLargestSize:22,separatorCharacter:" - ",thumbnailFilename:"normal",imageFormat:"auto",cropZone:"",instance:1,element:e(t),lastWindowWidth:e(window).width()},a=this,o=e.extend({},r,i),n="object"===_typeof(e.support)&&"opacity"in e.support&&!e.support.opacity,l="",s=!!window.chrome&&!/opera|opr/i.test(navigator.userAgent);this.s=o;try{l=window.navigator.userAgent.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./),"Netscape"==navigator.appName&&-1===navigator.appVersion.indexOf("Trident")&&-1!==navigator.appVersion.indexOf("Edge")&&(l=!0)}catch(e){l=!1}var d=!1;"ontouchstart"in document.documentElement&&(d=!0),void 0!==t.dataset.touchedByJIG&&e("> *:not(.jig-clearfix)",t).remove(),a.init=function(){if(o.originalTargetHeight=o.targetHeight,o.minHeight=o.originalMinHeight=o.targetHeight-o.heightDeviation,o.maxHeight=o.originalMaxHeight=o.targetHeight+o.heightDeviation,o.prevScreenHeightLimitRatio=-1,o.defaultHeightRatio=o.originalDefaultHeightRatio=o.targetHeight/o.maxHeight,o.originalLimit=o.limit,o.hiddenOpacity=n?.01:0,l&&o.element.addClass("jig-ua-ie"),n&&o.element.addClass("jig-ua-old-ie"),!1===d?o.element.addClass("jig-no-touch"):o.element.addClass("jig-touch"),"no"!==o.lightbox&&"links-off"!==o.lightbox&&"new_tab"!==o.lightbox)if(o.hiddenLinkClass=""!==o.linkClass?'class="jig-link jig-hiddenLink '+o.linkClass+'" ':'class="jig-link jig-hiddenLink" ',o.linkClass=""!==o.linkClass?'class="jig-link '+o.linkClass+'" ':'class="jig-link" ',-1!==o.linkRel.indexOf("*instance*"))o.linkRel='rel="'+o.linkRel.replace("*instance*",o.instance)+'" ';else if(-1!==o.linkRel.indexOf("auto"))switch(o.lightbox){case"prettyphoto":o.linkRel='rel="'+o.linkRel.replace("auto","prettyPhoto["+o.instance+"]")+'" ';break;case"colorbox":o.linkRel='rel="'+o.linkRel.replace("auto","colorBox["+o.instance+"]")+'" ';break;default:o.linkRel='rel="'+o.linkRel.replace("auto","gallery["+o.instance+"]")+'" '}else o.linkRel='rel="'+o.linkRel+'" ';else o.linkClass="",o.hiddenLinkClass="",o.linkRel="";if(""!==o.linkAttributeName&&(""!==o.linkAttributeValue?o.linkAttribute=" "+o.linkAttributeName+'="'+o.linkAttributeValue+'"':o.linkAttribute=" "+o.linkAttributeName+'=""'),"function"==typeof window.jigHookItems&&(o.items=window.jigHookItems(o.items)),o.allItems=o.selectedItems=o.items.slice(),o.aspectRatio&&(o.maxWidth=Math.floor(o.maxHeight*parseFloat(o.aspectRatio)),"normal"==o.incompleteLastRow&&(o.incompleteLastRow="match","off"!==o.loadMore&&(o.incompleteLastRow="flexible-match"))),"yes"==o.retinaReady&&(void 0===window.devicePixelRatio||1==window.devicePixelRatio?(o.retinaReady="no",o.devicePixelRatio=1):window.devicePixelRatio>o.maxRetinaDensity?o.devicePixelRatio=o.maxRetinaDensity:o.devicePixelRatio=window.devicePixelRatio),"yes"==o.retinaReady&&("auto"==o.retinaQuality?(o.quality=Math.ceil(o.quality/o.devicePixelRatio),o.quality=o.quality>o.minRetinaQuality?o.quality:o.minRetinaQuality):o.quality=o.retinaQuality),"yes"==o.disableCropping&&(o.minHeight=o.originalMinHeight=50),"captions"==o.specialFx&&"below"==o.caption&&(o.specialFx="off"),"yes"==o.customFonts&&"off"!==o.caption&&("below"==o.caption||"off"!==o.verticalCenterCaptions||"captions"==o.specialFx)){var i=e("body").find(".jig-fontCheck");if(0===i.length){e("body").append('<div class="jig-fontCheck">!"\'\\#$%&amp;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~ A quick brown fox jumps over the lazy dog.</div>');var r=(i=e("body").find(".jig-fontCheck")).width(),s=0,f=setInterval(function(){s++;var t=i.width();r!=t&&0!==t?(e("body").trigger("jig-fontLoaded"),i.remove(),clearInterval(f)):s>50&&(i.remove(),clearInterval(f))},100)}}var h,p=function(){return!1},u=p,m=p,w=p,v=p,y=p,j=p,b=p,x=p,k=p,I=p,L=p,R=p,W=function(t,i,r,a){if("captions"!==o.specialFx||".jig-caption-wrapper .jig-caption"!==i)t.find(i).JIGhoverFlow(r,{opacity:a},o.animSpeed);else{var n=t.find(i),l=C(n,!0);n.JIGhoverFlow(r,{opacity:a},{duration:o.animSpeed,progress:function(){0!==e(this).closest(".jig-cw-role-real").length&&T(l)}})}},M=function(t,i,r,a){if("captions"!==o.specialFx)t.find(i).JIGhoverFlow(r,{height:a},o.animSpeed,"JIGeaseInOutQuad");else{var n=t.find(i),l=C(n);n.JIGhoverFlow(r,{height:a},{duration:o.animSpeed,easing:"JIGeaseInOutQuad",progress:function(){0!==e(this).closest(".jig-cw-role-real").length&&T(l)}})}},F=function(t,i,r,a){if("captions"!==o.specialFx)t.find(i).JIGhoverFlow(r,{height:a},{duration:o.animSpeed,easing:"JIGeaseInOutQuad",progress:function(){var e=t.find(".jig-caption-wrapper"),i=t.parent();e.css("top",Math.round(i.height()/2-e.height()/2))}});else{var n=t.find(i),l=C(n),s=n.closest(".jig-caption");t.find(i).JIGhoverFlow(r,{height:a},{duration:o.animSpeed,easing:"JIGeaseInOutQuad",progress:function(){var i=t.find(".jig-caption-wrapper"),r=t.parent();i.css("top",Math.round(r.height()/2-s.height()/2)),0!==e(this).closest(".jig-cw-role-real").length&&T(l)},complete:function(){"slide"!=o.caption&&"reverse-slide"!=o.caption||"hide"!=a||t.find(".jig-cw-role-effect").height(.01)}})}},A=function(e,t,i,r){e.find(t).JIGhoverFlow(i,{opacity:r},o.animSpeed)},_=function(e,t,i,r){e.find(t).JIGhoverFlow(i,{borderLeftWidth:r,borderTopWidth:r,borderRightWidth:r,borderBottomWidth:r},o.animSpeed)};switch(o.overlay){case"hovered":"on"===o.overlayIcon?(u=function(e){W(e,"div.jig-overlay-wrapper, div.jig-overlay-icon-wrapper","mouseenter","show")},m=function(e){W(e,"div.jig-overlay-wrapper, div.jig-overlay-icon-wrapper","mouseleave","hide")}):(u=function(e){W(e,"div.jig-overlay-wrapper","mouseenter","show")},m=function(e){W(e,"div.jig-overlay-wrapper","mouseleave","hide")});break;case"others":"on"===o.overlayIcon?(u=function(e){W(e,"div.jig-overlay-wrapper, div.jig-overlay-icon-wrapper","mouseenter","hide")},m=function(e){W(e,"div.jig-overlay-wrapper, div.jig-overlay-icon-wrapper","mouseleave","show")}):(u=function(e){W(e,"div.jig-overlay-wrapper","mouseenter","hide")},m=function(e){W(e,"div.jig-overlay-wrapper","mouseleave","show")})}switch(o.innerBorder){case"hovered":switch(o.innerBorderAnimate){case"width":b=function(e){_(e,"div.jig-border","mouseenter",o.innerBorderWidth+"px")},x=function(e){_(e,"div.jig-border","mouseleave",0)};break;case"opacity":b=function(e){W(e,"div.jig-border","mouseenter","show")},x=function(e){W(e,"div.jig-border","mouseleave","hide")};break;case"off":b=function(t){e(t).find("div.jig-border").show()},x=function(t){e(t).find("div.jig-border").hide()}}break;case"others":switch(o.innerBorderAnimate){case"width":b=function(e){_(e,"div.jig-border","mouseenter",0)},x=function(e){_(e,"div.jig-border","mouseleave",o.innerBorderWidth+"px")};break;case"opacity":b=function(e){W(e,"div.jig-border","mouseenter","hide")},x=function(e){W(e,"div.jig-border","mouseleave","show")};break;case"off":b=function(t){e(t).find("div.jig-border").hide()},x=function(t){e(t).find("div.jig-border").show()}}}switch(o.middleBorder){case"hovered":k=function(t){e(t).parent().parent("div.jig-imageContainer").css("background",o.middleBorderColor)},I=function(t){e(t).parent().parent("div.jig-imageContainer").css("background","transparent")};break;case"others":k=function(t){e(t).parent().parent("div.jig-imageContainer").css("background","transparent")},I=function(t){e(t).parent().parent("div.jig-imageContainer").css("background",o.middleBorderColor)}}switch(o.outerBorder){case"hovered":L=function(t){e(t).parent().parent("div.jig-imageContainer").css("border-color",o.outerBorderColor)},R=function(t){e(t).parent().parent("div.jig-imageContainer").css("border-color","transparent")};break;case"others":L=function(t){e(t).parent().parent("div.jig-imageContainer").css("border-color","transparent")},R=function(t){e(t).parent().parent("div.jig-imageContainer").css("border-color",o.outerBorderColor)}}if(n)switch(o.specialFx){case"others":w=function(e){A(e,".jig-pixastic","mouseleave",.01)},v=function(e){A(e,".jig-pixastic","mouseleave",o.specialFxBlend)};break;case"hovered":w=function(e){A(e,".jig-pixastic","mouseenter",o.specialFxBlend)},v=function(e){A(e,".jig-pixastic","mouseleave",.01)}}else switch(o.specialFx){case"others":w=function(e){A(e,".jig-pixastic","mouseenter",.01)},v=function(e){A(e,".jig-pixastic","mouseleave",o.specialFxBlend)};break;case"hovered":w=function(e){A(e,".jig-pixastic","mouseenter",o.specialFxBlend)},v=function(e){A(e,".jig-pixastic","mouseleave",.01)}}switch(o.caption){case"fade":y=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseenter","show")},j=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseleave","hide")};break;case"reverse-fade":y=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseenter","hide")},j=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseleave","show")};break;case"slide":n?(y=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseenter","show")},j=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseleave","hide")}):"off"==o.verticalCenterCaptions||"simple"==o.verticalCenterCaptions?(y=function(e){M(e,".jig-caption-wrapper .jig-caption","mouseenter","show")},j=function(e){M(e,".jig-caption-wrapper .jig-caption","mouseleave","hide")}):(y=function(e){F(e,".jig-caption-wrapper .jig-caption","mouseenter","show")},j=function(e){F(e,".jig-caption-wrapper .jig-caption","mouseleave","hide")});break;case"reverse-slide":n?(y=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseenter","hide")},j=function(e){W(e,".jig-caption-wrapper .jig-caption","mouseleave","show")}):"off"==o.verticalCenterCaptions||"simple"==o.verticalCenterCaptions?(y=function(e){M(e,".jig-caption-wrapper .jig-caption","mouseenter","hide")},j=function(e){M(e,".jig-caption-wrapper .jig-caption","mouseleave","show")}):(y=function(e){F(e,".jig-caption-wrapper .jig-caption","mouseenter","hide")},j=function(e){F(e,".jig-caption-wrapper .jig-caption","mouseleave","show")});break;case"mixed":"off"==o.verticalCenterCaptions||"simple"==o.verticalCenterCaptions?(y=function(e){M(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseenter","show")},j=function(e){M(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseleave","hide")}):(y=function(e){F(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseenter","show")},j=function(e){F(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseleave","hide")});break;case"reverse-mixed":"off"==o.verticalCenterCaptions||"simple"==o.verticalCenterCaptions?(y=function(e){M(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseenter","hide")},j=function(e){M(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseleave","show")}):(y=function(e){F(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseenter","hide")},j=function(e){F(e,".jig-caption-wrapper .jig-caption-description-wrapper","mouseleave","show")})}if("yes"!==o.disableHover&&(o.element.on("mouseenter mouseleave","a",function(t){var i=e(this);"none"!==i.css("display")&&(t.stopImmediatePropagation(),"mouseenter"===t.type?(u(i),w(i),y(i),b(i),k(i),L(i),i.data("title",i.attr("title")),i.removeAttr("title")):(m(i),v(i),j(i),x(i),I(i),R(i),i.attr("title",i.data("title"))))}),o.element.on("mousedown","a",function(t){e(this).attr("title",e(this).data("title"))})),e("body").one("jig-fontLoaded",c),"off"!==o.loadMore&&(o.loadMoreCounter=0,"carousel"==o.lightbox&&o.element.on("click",function(t){if(e(t.target).hasClass("justified-image-grid"))return t.stopPropagation(),void t.preventDefault()}),o.element.on("click",".jig-loadMoreButton",S)),"prettyphoto"==o.lightbox&&"undefined"!=typeof jigOtherPrettyPhotoIsPresent&&e(document).ready(function(){setTimeout(function(){window[o.lightboxInit]()},10)}),o.filters||o.L2filters){if(o.filteredImages=[],o.filters){var B,G;o.filterMultiple=o.filterMultiple||"no",o.filterStyle=o.filterStyle||"buttons","buttons"==o.filterStyle?(o.filterType="Button",B="div"):(o.filterType="Tag",B="span");var P='<div id="jig'+o.instance+"-filter"+o.filterType+'s" class="jig-filter'+o.filterType+"s "+("no"!==o.filterMultiple?"jig-filterMultiple ":"jig-filterSingle ")+(d?"jig-touch ":"jig-no-touch ")+(l?"jig-ua-ie":"")+'jig-clearfix" data-filter-level="1">';for(G in o.filters)H(o.filters,G)&&(o.filteredImages[G]=[],P+="<"+B+' class="jig-filter'+o.filterType+'" data-filter-slug="'+G+'">'+o.filters[G]+"</"+B+">");P+="</div>",o.element.before(P),void 0!==o.filteredImages["all-items-nofilter"]&&(o.filteredImages["all-items-nofilter"]=o.selectedItems.slice());for(var z=0,E=o.selectedItems.length;z<E;z+=1)if(o.selectedItems[z].filters)for(var O=0,D=o.selectedItems[z].filters.length;O<D;O+=1)void 0!==o.filteredImages[o.selectedItems[z].filters[O][0]]&&"function"==typeof o.filteredImages[o.selectedItems[z].filters[O][0]].push&&o.filteredImages[o.selectedItems[z].filters[O][0]].push(o.selectedItems[z]);var N=e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType+'[data-filter-slug="all-items-nofilter"]');if(N.length>0&&e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).first().attr("data-filter-slug")!==N.attr("data-filter-slug")&&N.parent().prepend(N),"tags"==o.filterStyle){for(G in o.filters)H(o.filters,G)&&e("#jig"+o.instance+"-filter"+o.filterType+'s .jig-filterTag[data-filter-slug="'+G+'"]').attr("rel",o.filteredImages[G].length);e.fn.tagcloud.defaults={size:{start:o.filterSmallestSize,end:o.filterLargestSize,unit:"px"},color:{start:o.filterSmallestColor,end:o.filterLargestColor}},N.length>0?(N.css({"font-size":o.filterLargestSize,color:o.filterLargestColor}),e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).slice(1).tagcloud()):e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).tagcloud()}e("#jig"+o.instance+"-filter"+o.filterType+"s").on("click",".jig-filter"+o.filterType,g)}if(o.L2filters){var J,Q;o.L2filterMultiple=o.L2filterMultiple||"no",o.L2filterStyle=o.L2filterStyle||"buttons","buttons"==o.L2filterStyle?(o.L2filterType="Button",J="div"):(o.L2filterType="Tag",J="span"),o.L2filteredImages=[];var q='<div id="jig'+o.instance+"-L2filter"+o.L2filterType+'s" class="jig-filter'+o.L2filterType+"s "+("no"!==o.L2filterMultiple?"jig-filterMultiple ":"jig-filterSingle ")+(d?"jig-touch ":"jig-no-touch ")+(l?"jig-ua-ie":"")+'jig-clearfix" data-filter-level="2">';for(Q in o.L2filters)H(o.L2filters,Q)&&(o.L2filteredImages[Q]=[],q+="<"+J+' class="jig-filter'+o.L2filterType+'" data-filter-slug="'+Q+'">'+o.L2filters[Q]+"</"+J+">");q+="</div>",o.element.before(q),void 0!==o.L2filteredImages["all-items-nofilter"]&&(o.L2filteredImages["all-items-nofilter"]=o.selectedItems.slice());for(var U=0,$=o.selectedItems.length;U<$;U+=1)if(o.selectedItems[U].L2filters)for(var V=0,Z=o.selectedItems[U].L2filters.length;V<Z;V+=1)void 0!==o.L2filteredImages[o.selectedItems[U].L2filters[V][0]]&&"function"==typeof o.L2filteredImages[o.selectedItems[U].L2filters[V][0]].push&&o.L2filteredImages[o.selectedItems[U].L2filters[V][0]].push(o.selectedItems[U]);var K=e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType+'[data-filter-slug="all-items-nofilter"]');if(K.length>0&&e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).first().attr("data-filter-slug")!==K.attr("data-filter-slug")&&K.parent().prepend(K),"tags"==o.L2filterStyle){for(Q in o.L2filters)H(o.L2filters,Q)&&e("#jig"+o.instance+"-L2filter"+o.L2filterType+'s .jig-filterTag[data-filter-slug="'+Q+'"]').attr("rel",o.L2filteredImages[Q].length);e.fn.tagcloud.defaults={size:{start:o.filterSmallestSize,end:o.filterLargestSize,unit:"px"},color:{start:o.filterSmallestColor,end:o.filterLargestColor}},K.length>0?(K.css({"font-size":o.filterLargestSize,color:o.filterLargestColor}),e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).slice(1).tagcloud()):e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).tagcloud()}e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s").on("click",".jig-filter"+o.L2filterType,g)}g()}else a.createGallery();o.element.trigger("jig-created"),e(window).resize(function(){void 0!==h&&clearTimeout(h),h=setTimeout(function(){a.createGallery("resize"),o.element.trigger("jig-resized")},100)}),t.dataset.touchedByJIG=!0},a.createGallery=function(t){if(!1===e.JIGjQueryMinVersion("1.7"))return JIGjQueryMinVersion("1.7",!0),!1;var i,r=Math.round(o.element.width()),l=e(window).width();void 0===o.fixedWidth?(o.element.css("width","").css("width",Math.round(o.element.width())),0===o.element.width()?void 0===o.fallbackWidth?0!==r&&l==o.lastWindowWidth?o.element.css("width",r+"px"):(i=0,o.element.parents().each(function(t,r){var a=e(r),n=e(r).parent(),s=a.width();if(a.is(":visible")&&0!==s)return o.element.css("width",s-i+"px"),void 0===n.data("jigAddedTabsHandler")&&(n.on("click",function(t){l!==e(window).width()&&n.find(".justified-image-grid").each(function(){var t=e(this);t.is(":visible")&&t.data("justifiedImageGrid").createGallery("resize")})}),n.data("jigAddedTabsHandler",!0)),!1;i+=a.outerWidth(!0)-a.width()})):o.element.css("width",o.fallbackWidth+"px"):o.element.width()>1e4&&(o.element.css("width",l),e(window).on("load",function(){a.createGallery("resize")}))):o.element.css("width","").css("width",o.fixedWidth);var s=Math.round(o.element.width());if(s<9)return o.retryCount>10?void o.element.find(".jig-clearfix").html("The element is invisible or too thin, upon page loading. In case of using tabs, try a Custom width in the General settings and you may also use a fixed width. (Justified Image Grid)"):void(o.retryBuilding=setTimeout(function(){o.retryCount++,a.createGallery()},100));if(o.retryBuilding&&clearTimeout(o.retryBuilding),o.element.find(".jig-clearfix").empty(),o.justResized=!1,"resize"===t){if(o.areaWidth&&o.areaWidth==s)return;o.justResized=!0}if(o.element.find(".jig-overflow a *:not(div)").off(),o.areaWidth=s,o.row=[],o.fullWidth=o.extra=0,o.rows=[],o.unshifts=[],o.screenHeight=e(window).height(),o.screenHeightLimitRatio=Math.min(o.screenHeight/o.originalMaxHeight,1),"yes"===o.limitByViewport&&o.prevScreenHeightLimitRatio!==o.screenHeightLimitRatio){if(o.screenHeightLimitRatio<1?(o.maxHeight=o.screenHeight,o.targetHeight=Math.round(o.maxHeight-o.heightDeviation*o.screenHeightLimitRatio),o.minHeight=50!=o.minHeight?Math.round(o.targetHeight-o.heightDeviation*o.screenHeightLimitRatio):50,o.defaultHeightRatio=o.targetHeight/o.maxHeight):(o.maxHeight=o.originalMaxHeight,o.targetHeight=o.originalTargetHeight,o.minHeight=o.originalMinHeight,o.defaultHeightRatio=o.originalDefaultHeightRatio),-1!=o.prevScreenHeightLimitRatio||1!=o.screenHeightLimitRatio)for(var d in o.selectedItems)H(o.selectedItems,d)&&(void 0===o.selectedItems[d].originalWidth&&(o.selectedItems[d].originalWidth=o.selectedItems[d].width),o.selectedItems[d].width=Math.round(o.selectedItems[d].originalWidth*o.screenHeightLimitRatio));o.prevScreenHeightLimitRatio=o.screenHeightLimitRatio}if(o.items=o.selectedItems.slice(),!0===o.errorChecked&&!1===o.justResized){for(var g in o.items)if(H(o.items,g)&&-1!=e.inArray(void 0===o.items[g].photon?void 0===o.items[g].thumbUrl?o.items[g].url:o.items[g].thumbUrl:o.items[g].photon,o.errorImages)){var p=o.items[g];if(o.items.splice(g,1),o.filters){var u=e("#jig"+o.instance+"-filterButtons .jig-filterButtonSelected").attr("data-filter-slug");o.filteredImages[u]=o.items.slice();for(var m=1,w=o.filters.length;m<w;m+=1)for(var v=0,y=o.filteredImages[o.filters[m][0]].length;v<y;v+=1){var k=e.inArray(p,o.filteredImages[o.filters[m][0]]);-1!=k&&o.filteredImages[o.filters[m][0]].splice(k,1)}}}if(o.selectedItems=o.items.slice(),o.errorImages=[],0===o.selectedItems.length)return void M();o.errorChecked=!1}for(""!==o.maxRows&&0!==o.maxRows||(o.maxRows=1e3),o.rowcount=0,o.imagesShown=0,""!==o.initiallyLoad&&"off"!==o.loadMore&&0===o.loadMoreCounter&&(o.limit=parseInt(o.initiallyLoad,10)),0===o.limit?o.whileUntil=0:o.limit<o.selectedItems.length?o.whileUntil=o.items.length-o.limit:o.whileUntil=0;o.items.length>o.whileUntil&&o.rowcount<o.maxRows;){var L=h();!1!==L&&(o.rows.push(L),o.rowcount++)}o.imagesShown+=o.selectedItems.length-o.items.length,o.element.find(".jig-imageContainer").slice(o.imagesShown).remove(),o.imagesAlreadyAdded=o.element.find(".jig-imageContainer").length;for(var C,T=0,R=0,F=o.rows.length;R<F;R+=1)for(var A=0,_=o.rows[R].length;A<_;A+=1)T++,(C=o.rows[R][A]).container&&T<=o.imagesAlreadyAdded?b(C,o.rows[R].length,A):j(C,o.rows[R].length,A);if("links-off"!==o.lightbox&&"no"!==o.lightbox&&"new_tab"!==o.lightbox&&""!==o.linkrel){for(;o.unshifts.length>0;)void 0===(C=o.unshifts.shift()).linkContainer?x(C):o.currentHiddenLink=C.linkContainer;for(;o.items.length>0;)void 0===(C=o.items.shift()).linkContainer?x(C):o.currentHiddenLink=C.linkContainer;o.currentHiddenLink=void 0}if(void 0===o.fixedWidth&&(o.element.css("width","").css("width",Math.round(o.element.width())),0===o.element.width()&&o.element.css("width",o.areaWidth+"px")),e("img",o.element).not(".jig-hiddenImg").on("load",function(){if(this.complete||void 0!==this.naturalWidth&&0!==this.naturalWidth||void 0!==this.readyState&&("complete"===this.readyState||4===this.readyState)||n){var t=e(this).closest("a"),i=e(this).closest(".jig-overflow");if(0!==t.length&&!0!==t.hasClass("jig-loaded"))if(t.addClass("jig-loaded"),"0"===i.css("opacity")&&i.css("opacity",1),"off"!=o.specialFx)e(this).clone().addClass("jig-pixastic").insertAfter(e(this)).on("load",I).each(function(){(this.complete||void 0!==this.naturalWidth&&0!==this.naturalWidth||void 0!==this.readyState&&("complete"===this.readyState||4===this.readyState))&&e(this).trigger("load")});e(this).off("load")}else if("yes"==o.errorChecking){var r=/(?:\?src=)(.*)(?:&h=)|^(https?:\/\/.+?wp\.com.*)$/g.exec(e(this).attr("src"));null!==r?void 0!==r[1]?o.errorImages.push(r[1]):void 0!==r[2]&&o.errorImages.push(r[2]):o.errorImages.push(e(this).attr("src")),e(this).closest(".jig-imageContainer").addClass("jig-unloadable"),W()}}).on("error",function(){if("yes"==o.errorChecking){var t=/(?:\?src=)(.*)(?:&h=)|^(https?:\/\/.+?wp\.com.*)$/g.exec(e(this).attr("src"));null!==t?void 0!==t[1]?o.errorImages.push(t[1]):void 0!==t[2]&&o.errorImages.push(t[2]):o.errorImages.push(e(this).attr("src")),e(this).closest(".jig-imageContainer").addClass("jig-unloadable"),W()}}).each(function(){(this.complete||void 0!==this.naturalWidth&&0!==this.naturalWidth||void 0!==this.readyState&&("complete"===this.readyState||4===this.readyState))&&e(this).trigger("load")}),"resize"!==t?f():"prettyphoto"==o.lightbox&&"undefined"!=typeof jigReCallPrettyPhotoAfterPossibleResize?setTimeout(function(){window[o.lightboxInit](),jigReCallPrettyPhotoAfterPossibleResize=void 0},10):o.visibleImageCount!=e(".jig-imageContainer",o.element).length&&f(),"click"==o.loadMore||"scroll"==o.loadMore||"hybrid"==o.loadMore||"once"==o.loadMore){o.loadMoreButton=o.element.find(".jig-loadMoreButton");var B=o.selectedItems.length-o.limit,G=o.element.find(".jig-hiddenLink").length;if(1==o.loadMoreButton.length)B>0?(o.loadMoreButton.find(".jig-loadMoreButton-count").text(0!==G?G:B),"yes"===o.loadMoreAutoWidth&&o.loadMoreButton.css("width",o.loadMoreButton.find(".jig-loadMoreButton-inner").width())):o.loadMoreButton.remove();else if(B>0){var P="";o.loadMoreCountText&&"none"!==o.loadMoreCountText&&(P=(P=o.loadMoreCountText).replace("*count*",'<span class="jig-loadMoreButton-count">'+(0!==G?G:B)+"</span>")),o.loadMoreButton=e('<div class="jig-loadMoreButton"><span class="jig-loadMoreButton-inner">'+o.loadMoreText+(""!==P?"<br />"+P:"")+"</span></div>"),o.element.find(".jig-clearfix").after(o.loadMoreButton),"yes"===o.loadMoreAutoWidth&&o.loadMoreButton.css("width",o.loadMoreButton.find(".jig-loadMoreButton-inner").width())}"scroll"!=o.loadMore&&"hybrid"!=o.loadMore||e(window).scroll(function(){if(("scroll"==o.loadMore||"hybrid"==o.loadMore&&o.loadMoreCounter>0)&&o.selectedItems.length-o.limit>0){var t=o.element.find(".jig-loadMoreButton").offset();e(window).scrollTop()>=t.top-parseInt(o.loadMoreOffset,10)-e(window).height()&&S()}})}if("no"!==o.wrapText){var z=o.element.find(".jig-imageContainer").last();0===o.element.find(".jig-flowSpacer").length&&o.element.find(".jig-imageContainer").last().after('<div class="jig-flowSpacer"></div>');var E=o.element.find(".jig-flowSpacer").css({width:"1px",height:z.height()+3,float:"ltr"==o.readingDirection?"left":"right"});setTimeout(function(){"ltr"==o.readingDirection?o.element.offset().left==E.offset().left?E.css("margin-right",0):E.css("margin-right",2*o.margins):o.element.offset().left==E.offset().left?E.css("margin-left",0):E.css("margin-left",2*o.margins)},1)}if("yes"!=o.customFonts||"off"===o.caption||"below"!=o.caption&&"off"===o.verticalCenterCaptions&&"captions"!=o.specialFx||c(!0),o.prevInstanceID="#jig"+(o.instance-1),e(window).width()!=l||o.areaWidth!=Math.round(o.element.width()))return o.resizeCount++,o.resizeCount>1&&o.element.css("min-height",o.element.height()),a.createGallery("resize"),o.instance>1&&0!==e(o.prevInstanceID).length&&e(o.prevInstanceID).data("justifiedImageGrid").createGallery("resize"),void o.element.css("min-height","");o.instance>1&&0!==e(o.prevInstanceID).length&&(o.prevInstanceData=e(o.prevInstanceID).data("justifiedImageGrid"),o.prevInstanceData.s.element.css("width","").css("width",o.prevInstanceData.s.element.width()),o.prevInstanceData.s.areaWidth!=o.prevInstanceData.s.element.width()&&o.prevInstanceData.createGallery("resize")),o.resizeCount=0,o.lastWindowWidth=l,o.visibleImageCount=e(".jig-imageContainer",o.element).length};var c=function(t){!0!==t&&(t="captions"==o.specialFx),o.element.find(".jig-imageContainer").each(function(i,r){var a,n=e(r);if("off"!==o.verticalCenterCaptions){var l=(a=n.find(".jig-caption-wrapper")).filter(".jig-cw-role-real"),d=l.height(),c=l.find(".jig-caption"),f=("mixed"==o.caption||"reverse-mixed"==o.caption)&&l.find(".jig-caption-description-wrapper");"slide"!=o.caption&&"reverse-slide"!=o.caption||!c.is(":animated")?"mixed"!=o.caption&&"reverse-mixed"!=o.caption||!f.is(":animated")?(0===d&&(c.css({opacity:0,display:"block"}),d=l.height(),c.removeAttr("style")),!0===t?a.css({bottom:"auto",top:Math.round(l.closest(".jig-imageContainer").height()/2-d/2)}):a.css({bottom:"auto"}).animate({top:Math.round(l.closest(".jig-imageContainer").height()/2-d/2)},o.animSpeed,"JIGeaseInOutQuad")):f.promise().done(function(){d=l.height();var e=f.height();"mixed"==o.caption&&0!==e?(f.css({display:"none"}),d=l.height(),f.css({display:"block"})):"reverse-mixed"==o.caption&&0===e&&(f.css({display:"block"}),d=l.height(),f.css({display:"none"})),a.css({bottom:"auto"}).animate({top:Math.round(l.closest(".jig-imageContainer").height()/2-d/2)},o.animSpeed,"JIGeaseInOutQuad")}):c.promise().done(function(){0===(d=l.height())&&(c.css({opacity:0,display:"block"}),d=l.height(),c.removeAttr("style")),a.css({bottom:"auto"}).animate({top:Math.round(l.closest(".jig-imageContainer").height()/2-d/2)},o.animSpeed,"JIGeaseInOutQuad")})}"below"==o.caption&&R(n,!0),"captions"==o.specialFx&&(s&&"no"!==o.captionMatchWidth&&n.find(".jig-caption-title, .jig-caption-wrapper").each(function(){var t=e(this),i=t.css("width","")[0].getBoundingClientRect().width;i%2!=0&&(i=Math.ceil(i),t.css({width:i%2!=0?i+1:i}))}),a=a||n.find(".jig-caption-wrapper"),T(C(a)))})},f=function(){switch(o.lightbox){case"prettyphoto":case"colorbox":case"magnific":case"photoswipe":case"photoswipe3":case"foobox":case"custom":window[o.lightboxInit]();break;case"links-off":o.element.find("a").css("cursor","default"),o.element.on("click","a",function(e){e.preventDefault()}),e(o.element).on("click","a",function(e){2===e.which&&e.preventDefault()})}},g=function(t){var i,r,n,l,s,d=e(this),c=d.attr("data-filter-slug"),f=!1;if(void 0===t&&(!1!==o.filters?(d=e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).first(),c=d.attr("data-filter-slug")):(d=e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).first(),c=d.attr("data-filter-slug"))),1==(i=d.parent().attr("data-filter-level"))){if("no"==o.filterMultiple||"all-items-nofilter"==c)!1===d.hasClass("jig-filter"+o.filterType+"Selected")&&(d.siblings(".jig-filter"+o.filterType+"Selected").removeClass("jig-filter"+o.filterType+"Selected"),d.addClass("jig-filter"+o.filterType+"Selected"),o.selectedItems=o.filteredImages[c],f=!0);else{var g=d.parent().find(".jig-filter"+o.filterType+"Selected").length;if(1==g&&"all-items-nofilter"==d.siblings(".jig-filter"+o.filterType+"Selected").attr("data-filter-slug")&&d.siblings(".jig-filter"+o.filterType+"Selected").removeClass("jig-filter"+o.filterType+"Selected"),!1===d.hasClass("jig-filter"+o.filterType+"Selected"))d.addClass("jig-filter"+o.filterType+"Selected"),g++;else{if(1==g){if("all-items-nofilter"!=e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).first().attr("data-filter-slug"))return;e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType).first().click().addClass("jig-filter"+o.filterType+"Selected")}d.removeClass("jig-filter"+o.filterType+"Selected"),g--}var h=[];if(d.parent().find(".jig-filter"+o.filterType+"Selected").each(function(){h.push(e(this).attr("data-filter-slug"))}),c=h.toString(),void 0===o.filteredImages[c]){o.filteredImages[c]=[];var p=0;for(n=o.allItems.length,r=0;r<n;r+=1)if(o.allItems[r].filters)for(p=0,s=o.allItems[r].filters.length,l=0;l<s;l+=1)"or"==o.filterMultiple?e.inArray(o.allItems[r].filters[l][0],h)>-1&&-1==e.inArray(o.allItems[r],o.filteredImages[c])&&o.filteredImages[c].push(o.allItems[r]):(e.inArray(o.allItems[r].filters[l][0],h)>-1&&p++,p==h.length&&-1==e.inArray(o.allItems[r],o.filteredImages[c])&&o.filteredImages[c].push(o.allItems[r]))}o.selectedItems=o.filteredImages[c],f=!0}f&&o.L2filters&&(o.L1selectedItems=o.selectedItems)}if(o.L2filters){if(void 0===t&&(i=(d=e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).first()).parent().attr("data-filter-level")),2==i)if("no"==o.L2filterMultiple||"all-items-nofilter"==c)d.siblings(".jig-filter"+o.L2filterType+"Selected").removeClass("jig-filter"+o.L2filterType+"Selected"),d.addClass("jig-filter"+o.L2filterType+"Selected");else{var u=d.parent().find(".jig-filter"+o.L2filterType+"Selected").length;if(1==u&&"all-items-nofilter"==d.siblings(".jig-filter"+o.L2filterType+"Selected").attr("data-filter-slug")&&d.siblings(".jig-filter"+o.L2filterType+"Selected").removeClass("jig-filter"+o.L2filterType+"Selected"),!1===d.hasClass("jig-filter"+o.L2filterType+"Selected"))d.addClass("jig-filter"+o.L2filterType+"Selected"),u++;else{if(1==u){if("all-items-nofilter"!=e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).first().attr("data-filter-slug"))return;e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType).first().click().addClass("jig-filter"+o.L2filterType+"Selected")}d.removeClass("jig-filter"+o.L2filterType+"Selected"),u--}}var m=[];e("#jig"+o.instance+"-L2filter"+o.L2filterType+"s .jig-filter"+o.L2filterType+"Selected").each(function(){m.push(e(this).attr("data-filter-slug"))}),c=[],o.filters&&e("#jig"+o.instance+"-filter"+o.filterType+"s .jig-filter"+o.filterType+"Selected").each(function(){c.push(e(this).attr("data-filter-slug"))});var w=c.concat(m).toString();if(!1===o.filters&&(o.L1selectedItems=o.allItems),void 0===o.filteredImages[w])if(1==m.length&&"all-items-nofilter"==m[0])o.filteredImages[w]=o.L1selectedItems,o.selectedItems=o.filteredImages[w];else{o.filteredImages[w]=[];var v=0;for(n=o.L1selectedItems.length,r=0;r<n;r+=1)if(o.L1selectedItems[r].L2filters)for(v=0,s=o.L1selectedItems[r].L2filters.length,l=0;l<s;l+=1)"or"==o.L2filterMultiple?e.inArray(o.L1selectedItems[r].L2filters[l][0],m)>-1&&-1==e.inArray(o.L1selectedItems[r],o.filteredImages[w])&&o.filteredImages[w].push(o.L1selectedItems[r]):(e.inArray(o.L1selectedItems[r].L2filters[l][0],m)>-1&&v++,v==m.length&&-1==e.inArray(o.L1selectedItems[r],o.filteredImages[w])&&o.filteredImages[w].push(o.L1selectedItems[r]))}o.selectedItems=o.filteredImages[w],f=!0}if(f){o.element.find(".jig-imageContainer, .jig-hiddenLink").remove();for(var y=0,j=o.selectedItems.length;y<j;y+=1)o.selectedItems[y].linkContainer=void 0;a.createGallery("filter")}},h=function(){for(o.row=[],o.validRow=!0,o.fullWidth=0,o.extra=0;o.items.length>o.whileUntil&&o.extra<o.areaWidth;){var e=o.items.shift();e.newHeight=e.newWidth=e.containerHeight=e.containerWidth=e.marLeft=void 0,e.ratio=e.width/o.maxHeight,o.row.push(e),o.fullWidth+=Math.round(e.width*o.defaultHeightRatio)+o.margins+o.bordersTotal,o.extra=o.fullWidth-o.margins}if(o.extra-=o.areaWidth,o.row.length>0&&o.extra>0||0===o.rows.length&&o.items.length>o.whileUntil){for(var t="landscape",i=0,r=o.row.length;i<r;i+=1)if(o.row[i].ratio<1){t="portrait";break}"landscape"==t?u():"yes"!==o.disableCropping?m():u()}else{if(o.rows.length>0&&o.items.length==o.whileUntil){switch(o.incompleteLastRow){case"flexible":m("flexible");break;case"flexible-center":m("flexible-center");break;case"hide":m("hide");break;case"flexible-match":"off"!==o.loadMore&&o.selectedItems.length-o.limit<=0?p():m("flexible");break;case"flexible-match-center":"off"!==o.loadMore&&o.selectedItems.length-o.limit<=0?p("center"):m("flexible-center");break;case"match":p();break;case"match-center":p("center");break;case"center":m("center");break;default:m("lastRow")}return!0===o.validRow?o.row:(o.imagesShown-=o.row.length,o.unshifts=o.row,o.whileUntil+=o.unshifts.length,!1)}"center"!==o.incompleteLastRow&&"match-center"!==o.incompleteLastRow&&"flexible-match-center"!==o.incompleteLastRow?m("lastRow"):m("center")}return o.row},p=function(e){for(var t,i=0,r=0,a=o.rows.length;r<a;r+=1)i=r;if(void 0!==o.rows[i]&&void 0!==o.rows[i][0]){t=o.rows[i][0].containerHeight?o.rows[i][0].containerHeight:o.rows[i][0].newHeight,o.marginsTotal=(o.row.length-1)*o.margins+o.row.length*o.bordersTotal,o.rowlen=0;for(var n=0,l=o.row.length;n<l;n+=1)void 0!==o.rows[i][n]&&o.row[n].width==o.rows[i][n].width?(o.row[n].newHeight=o.rows[i][n].newHeight,o.row[n].containerHeight=o.rows[i][n].containerHeight,o.row[n].newWidth=o.rows[i][n].newWidth,o.row[n].containerWidth=o.rows[i][n].containerWidth,o.row[n].marLeft=o.rows[i][n].marLeft):(o.row[n].newHeight=t,o.row[n].newWidth=Math.round(o.row[n].newHeight*o.row[n].ratio)),o.rowlen+=o.row[n].newWidth,void 0!==o.row[n].marLeft&&(o.rowlen-=2*o.row[n].marLeft);t>o.targetHeight&&(o.remaining=o.rowlen+o.marginsTotal-o.areaWidth,o.remaining>0&&w()),void 0!==e&&o.rowlen+o.marginsTotal<o.areaWidth&&(o.row[0].spaceLeft=Math.floor(.5*(o.areaWidth-o.rowlen-o.marginsTotal)))}else m("lastRow")},u=function(){var e=!0;o.marginsTotal=(o.row.length-1)*o.margins+o.row.length*o.bordersTotal,o.rowlen=0,o.heights=[];for(var t=0,i=o.row.length;t<i;t+=1){var r=Math.round(o.row[t].width*o.defaultHeightRatio),a=Math.round((r+o.marginsTotal/o.row.length)/o.fullWidth*o.extra);if(o.row[t].newWidth=r-a,o.heights[t]=o.row[t].newWidth/o.row[t].ratio,o.heights[t]<o.minHeight)return void m();o.heights[t]>o.maxHeight?(o.row[t].newHeight=o.targetHeight,o.row[t].newWidth=Math.round(o.row[t].newHeight*o.row[t].ratio),e=!1):(o.row[t].newHeight=o.heights[t],o.rowlen+=o.row[t].newWidth)}e&&(o.remaining=o.rowlen+o.marginsTotal-o.areaWidth,w())},m=function(e){var t=!0;if(1!=o.row.length&&void 0===e){var i=o.row.pop();o.fullWidth-=Math.round(i.width*o.defaultHeightRatio)+o.margins+o.bordersTotal,o.items.unshift(i),o.extra=o.fullWidth-o.margins,o.extra-=o.areaWidth}o.marginsTotal=(o.row.length-1)*o.margins+o.row.length*o.bordersTotal,o.rowlen=0,o.heights=[];for(var r=0,a=o.row.length;r<a;r+=1){var n=Math.round(o.row[r].width*o.defaultHeightRatio),l=Math.round((n+o.marginsTotal/o.row.length)/o.fullWidth*o.extra);if(o.row[r].newWidth=n-l,o.heights[r]=o.row[r].newWidth/o.row[r].ratio,o.heights[r]>o.maxHeight){if(void 0===e){var s=o.items.shift();return o.row.push(s),o.fullWidth+=Math.round(s.width*o.defaultHeightRatio)+o.margins+o.bordersTotal,o.extra=o.fullWidth-o.margins,o.extra-=o.areaWidth,void v()}if("off"!==o.loadMore&&o.selectedItems.length-o.limit<=0&&("flexible"==e?e="lastRow":"flexible-center"==e&&(e="center")),"lastRow"==e){for(var d=0,c=o.row.length;d<c;d+=1)o.row[d].newHeight=o.targetHeight,o.row[d].newWidth=Math.round(o.row[d].newHeight*o.row[d].ratio);return}if("center"==e){for(var f=0,g=0,h=o.row.length;g<h;g+=1)o.row[g].newHeight=o.targetHeight,o.row[g].newWidth=Math.round(o.row[g].newHeight*o.row[g].ratio),f+=o.row[g].newWidth;return void(o.row[0].spaceLeft=Math.floor(.5*(o.areaWidth-f-o.marginsTotal)))}o.validRow=!1,o.row[r].newWidth=void 0,t=!1}else if(o.heights[r]<o.minHeight&&void 0===e)return void v();void 0!==o.row[r].newWidth&&(o.row[r].newHeight=o.heights[r],o.rowlen+=o.row[r].newWidth)}t&&(o.remaining=o.rowlen+o.marginsTotal-o.areaWidth,w())},w=function(){if(0!==o.remaining)if(o.remaining>0)for(;o.remaining>0;)for(var e=0,t=o.row.length;e<t&&(o.row[e].newWidth--,o.row[e].newHeight=o.heights[e]=o.row[e].newWidth/o.row[e].ratio,o.remaining--,0!==o.remaining);e+=1);else for(;o.remaining<0;)for(var i=0,r=o.row.length;i<r&&(o.row[i].newWidth++,o.row[i].newHeight=o.heights[i]=o.row[i].newWidth/o.row[i].ratio,o.remaining++,0!==o.remaining);i+=1);for(var a=Math.floor(Math.min.apply(null,o.heights)),n=0,l=o.row.length;n<l;n+=1)o.row[n].containerHeight=a,o.row[n].newHeight=Math.round(o.row[n].newHeight)},v=function(){for(var e=y(),t=0,i=o.row.length;t<i;t+=1){var r=e[t],a=o.row[t];a.marLeft=Math.round(r/2),a.containerWidth=a.newWidth-r}},y=function(){var e=[],t=0;o.marginsTotal=(o.row.length-1)*o.margins+o.row.length*o.bordersTotal;for(var i=0,r=o.row.length;i<r;i+=1){var a=o.row[i],n=Math.round(o.row[i].width*o.defaultHeightRatio);a.newHeight=o.targetHeight,a.newWidth=n,e[i]=Math.round((n+o.marginsTotal/o.row.length)/o.fullWidth*o.extra),t+=e[i]}var l=o.extra-t;if(0!==l)if(l>0)for(;l>0;)for(var s=0,d=e.length;s<d&&(e[s]++,0!==--l);s+=1);else for(;l<0;)for(var c=0,f=e.length;c<f&&(e[c]--,0!==++l);c+=1);return e},j=function(t,i,r){if(isNaN(t.newWidth)||!t.width)return!1;void 0!==t.linkContainer&&(e(t.linkContainer).remove(),t.linkContainer=void 0),void 0===t[o.linkTitleField]&&(t[o.linkTitleField]=""),void 0===t[o.imgAltField]&&(t[o.imgAltField]=""),void 0===t[o.titleField]&&(t[o.titleField]=""),void 0===t[o.captionField]&&(t[o.captionField]=""),void 0===t.gallery&&(t.gallery="");var a="";t.carousel_data?(t.carousel_data=" "+t.carousel_data+" ",a=" tiled-gallery-item"):t.carousel_data="",t.extra_class&&(a+=" "+t.extra_class),t.off="",t.url=(t.link,t.url);var n,l=e('<div class="jig-imageContainer'+a+'"/>'),s=e('<div class="jig-overflow"/>'),d=t.url,c=t.link_target?t.link_target:"_self",f=o.linkClass,g=o.linkRel,h="",p="",u=!0;if(""!==t.gallery&&(l.append(t.gallery.html),g=' rel="'+t.gallery.rel+'" ',l.addClass(t.gallery.lightbox_class),l.attr("id",t.gallery.id)),t.link&&(d=t.link,"video"!==c&&"videoplayer"!==c?(f="foobox"!==c?'target="'+c+'" '+f.replace("jig-link","jig-customLink"):'target="'+c+'" '+f.replace("jig-link",""),g=t.link_rel?'rel="'+t.link_rel+'"':""):"magnific"==o.lightbox&&-1==f.indexOf("mfp-")&&(f=f.replace("jig-link","jig-link mfp-iframe")),"videoplayer"!=c&&"foobox"!=c||-1===d.indexOf("&poster=")&&-1===d.indexOf("|poster=")||(u=!1)),!0===u&&("https%3A%2F%2F"===(d=(d+"").replace(/\+/g,"%20")).substr(0,14)||"http%3A%2F%2F"===d.substr(0,13)))try{d=decodeURIComponent(d)}catch(e){}h=t[o.linkTitleField],p=t[o.imgAltField],t.download&&("yes"==o.downloadLink?h+=n=(0!==h.length?o.separatorCharacter:"")+t.download:"alt"==o.downloadLink&&(p+=n=(0!==p.length?o.separatorCharacter:"")+t.download)),t.lightbox_link&&("yes"==o.lightboxLink?h+=(0!==h.length?o.separatorCharacter:"")+t.lightbox_link:"alt"==o.lightboxLink&&(p+=(0!==p.length?o.separatorCharacter:"")+t.lightbox_link)),""!==h&&(h='title="'+h+'" '),""!==p&&(p='alt="'+p+'" '),"new_tab"==o.lightbox&&(f='target="_blank" ');var m=o.linkAttribute;t.extra_class&&(m=m.replace("*content*",t.extra_class.replace(/.*jig-contentID-[A-Z]{2}-(\d+).*/gm,"$1"))),void 0!==t.link_attribute_name&&(m=void 0!==t.link_attribute_value?" "+t.link_attribute_name+'="'+t.link_attribute_value+'"':" "+t.link_attribute_name+'=""');var w=e("<a "+f+g+m+h+(t.wh?'data-wh="'+t.wh+'" ':"")+'href="'+("links-off"!=o.lightbox?d:"#")+'" />'),v=e("<img "+p+t.carousel_data+"/>");if(t.carousel_data&&t.download&&("yes"==o.downloadLink?(n=(0!==v.attr("data-image-title").length?o.separatorCharacter:"")+e("<textarea />").html(t.download).val(),v.attr("data-image-title",v.attr("data-image-title")+n)):"alt"==o.downloadLink&&(n=(0!==v.attr("data-image-description").length?"<br />":"")+e("<textarea />").html(t.download).val(),v.attr("data-image-description",v.attr("data-image-description")+n))),void 0!==t.geo&&v.attr("data-geo",t.geo),r==i-1&&l.addClass("jig-last"),s.css("width",(t.containerWidth?t.containerWidth:t.newWidth)+"px"),s.css("height",(t.containerHeight?t.containerHeight:t.newHeight)+"px"),t.photon)v.attr("src",decodeURIComponent((t.photon+"").replace(/\+/g,"%20")));else{var y,j,b=t.thumbUrl?t.thumbUrl:t.url,x=o.originalMaxHeight,k="";"normal"==o.thumbnailFilename&&("auto"===o.imageFormat?null!==(j=/.*\.(jpe?g|gif|bmp|png|webp)/im.exec(b))&&(k="&f=."+j[1]):"webp"===o.imageFormat?k="&f=.webp":"avif"===o.imageFormat&&(k="&f=.avif")),o.aspectRatio||o.randomizeWidth?(y=o.maxWidth,""!==o.randomizeWidth&&(y=void 0!==t.originalWidth?t.originalWidth:t.width),"yes"==o.retinaReady&&(x=Math.floor(x*o.devicePixelRatio),y=Math.floor(y*o.devicePixelRatio)),v.attr("src",o.timthumb+"?src="+b+"&h="+x+"&w="+y+"&q="+o.quality+o.cropZone+k)):"yes"==o.retinaReady?(x=Math.floor(x*o.devicePixelRatio),y=Math.floor((void 0!==t.originalWidth?t.originalWidth:t.width)*o.devicePixelRatio),v.attr("src",o.timthumb+"?src="+b+"&h="+x+"&w="+y+"&q="+o.quality+o.cropZone+k)):v.attr("src",o.timthumb+"?src="+b+"&h="+x+"&q="+o.quality+o.cropZone+k)}if(v.attr("width",t.newWidth).css("width",t.newWidth+"px"),v.attr("height",t.newHeight).css("height",t.newHeight+"px"),t.marLeft&&v.css("margin-left",-t.marLeft+"px"),("center"==o.incompleteLastRow||"flexible-center"==o.incompleteLastRow||"flexible-match-center"==o.incompleteLastRow||"match-center"==o.incompleteLastRow)&&t.spaceLeft&&t.spaceLeft>0&&(l.css("ltr"==o.readingDirection?"margin-left":"margin-right",t.spaceLeft+"px"),t.spaceLeft=0),v.css("margin-top",0),w.append(v),"off"!==o.overlay&&w.append('<div class="jig-overlay-wrapper"><div class="jig-overlay"></div></div>'+("on"===o.overlayIcon?'<div class="jig-overlay-icon-wrapper"><div class="jig-overlay-icon"></div></div>':"")),"off"!==o.caption){""!==t.gallery&&(t[o.titleField]=void 0!==t.gallery[o.titleField]&&""!==t.gallery[o.titleField]&&" "!==t.gallery[o.titleField]?t.gallery[o.titleField]:"",t[o.captionField]=void 0!==t.gallery[o.captionField]&&""!==t.gallery[o.captionField]&&" "!==t.gallery[o.captionField]?t.gallery[o.captionField]:"");var I="";""!==t[o.titleField]&&" "!==t[o.titleField]&&(I+='<div class="jig-caption-title">'+F(t[o.titleField],"<br><hr><em><strong><mark><i><b><font><span><ul><ol><li>")+"</div>"),""!==t[o.captionField]&&" "!==t[o.captionField]&&(I+='<div class="jig-caption-description-wrapper"><div class="jig-caption-description'+(""!==I?"":" jig-alone")+'">'+F(t[o.captionField],"<br><hr><em><strong><mark><i><b><font><span><ul><ol><li>")+"</div></div>"),""!==I?(t.$captionWrapper=e('<div class="jig-caption-wrapper jig-cw-role-real"><div class="jig-caption">'+I+"</div></div>"),"below"!==o.caption?w.append(t.$captionWrapper):0!==o.middleBorderWidth&&"always"==o.innerBorder&&"always"!==o.middleBorder?l.append(t.$captionWrapper.width(s.width()-2*parseFloat(o.innerBorderWidth))):l.append(t.$captionWrapper.css({width:s.css("width")}))):"below"==o.caption&&(t.$captionWrapper=e('<div class="jig-caption-wrapper"></div>'),0!==o.middleBorderWidth&&"always"==o.innerBorder&&"always"!==o.middleBorder?l.append(t.$captionWrapper.width(s.width()-2*parseFloat(o.innerBorderWidth))):l.append(t.$captionWrapper.css({width:s.css("width")})))}if(0===o.bordersTotal&&0===o.innerBorderWidth||w.append('<div class="jig-border"></div>'),s.append(w),t.carousel_data&&t.caption&&s.append('<div class="tiled-gallery-caption">'+F(t.caption)+"</div>"),l.prepend(s),o.element.find(".jig-clearfix").before(l),"off"!==o.caption)if("below"==o.caption)R(l);else if("captions"==o.specialFx){var L,C=l.find(".jig-cw-role-real");0!==C.length&&((L="no"==o.captionMatchWidth||o.captionMatchWidthForceNo?e(C[0].cloneNode(!1)):C.clone()).removeClass("jig-cw-role-real").addClass("jig-cw-role-effect"),"off"!==o.overlay?"in_front_of_overlay"==o.captionFxVisibility?l.find(".jig-overlay-wrapper").after(L):l.find(".jig-overlay-wrapper").before(L):C.before(L))}return t.container=l,t.overflow=s,t.img=v,t.linkElement=w,l},b=function(e,t,i){i==t-1?e.container.addClass("jig-last"):e.container.removeClass("jig-last");var r=e.overflow,a=e.img;if(r.css("width",(e.containerWidth?e.containerWidth:e.newWidth)+"px").width(),r.css("height",(e.containerHeight?e.containerHeight:e.newHeight)+"px"),a.attr("width",e.newWidth).css("width",e.newWidth+"px"),a.attr("height",e.newHeight).css("height",e.newHeight+"px"),e.marLeft?a.css("margin-left",-e.marLeft+"px"):a.css("margin-left",""),"center"!=o.incompleteLastRow&&"flexible-center"!=o.incompleteLastRow&&"flexible-match-center"!=o.incompleteLastRow&&"match-center"!=o.incompleteLastRow||(e.spaceLeft&&e.spaceLeft>0?(e.container.css("ltr"==o.readingDirection?"margin-left":"margin-right",e.spaceLeft+"px"),e.spaceLeft=0):e.container.css("ltr"==o.readingDirection?"margin-left":"margin-right","")),"off"!=o.specialFx){var n=a.siblings(".jig-pixastic");0===n.length&&"captions"==o.specialFx&&(n=a.siblings(".jig-cw-role-effect").find(".jig-pixastic")),k(n,a)}if("below"==o.caption&&(0!==o.middleBorderWidth&&"always"==o.innerBorder&&"always"!==o.middleBorder?e.$captionWrapper.width((e.containerWidth?e.containerWidth:e.newWidth)-2*parseFloat(o.innerBorderWidth)):e.container.css({width:(e.containerWidth?e.containerWidth:e.newWidth)+"px"})),"off"!==o.caption&&"off"!==o.verticalCenterCaptions){var l=e.container.find(".jig-cw-role-real").clone();l.find(".jig-caption").css("display","block"),l.appendTo(e.linkElement).css({bottom:"auto",opacity:.01}).css("top",Math.round((e.containerHeight?e.containerHeight:e.newHeight)/2-l.height()/2));var s=l.css("top");l.remove(),e.container.find(".jig-caption-wrapper").css({bottom:"auto"}).animate({top:s},o.animSpeed,"JIGeaseInOutQuad")}},x=function(t){void 0===t[o.linkTitleField]&&(t[o.linkTitleField]=""),void 0===t[o.imgAltField]&&(t[o.imgAltField]=""),void 0===t[o.titleField]&&(t[o.titleField]=""),void 0===t[o.captionField]&&(t[o.captionField]=""),t.off="";var i="";t.carousel_data?(t.carousel_data=" "+t.carousel_data+" ",i=" tiled-gallery-item"):t.carousel_data="",t.extra_class&&(i+=" "+t.extra_class);var r,a=t.url,n="",l="",s=o.hiddenLinkClass,d=t.link_target?t.link_target:"_self",c=o.linkRel,f=!0;if(""!==i&&(s=s.replace('jig-hiddenLink"',"jig-hiddenLink"+i+'"')),t.link&&(a=t.link,"video"!==d&&"videoplayer"!==d?(s="foobox"!==d?'target="'+d+'" '+s.replace("jig-link","jig-customLink jig-hiddenLink"):'target="'+d+'" '+s.replace("jig-link","jig-hiddenLink"),c=t.link_rel?'rel="'+t.link_rel+'"':""):"magnific"==o.lightbox&&-1==s.indexOf("mfp-")&&(s=s.replace("jig-link","jig-link mfp-iframe")),"videoplayer"!=d&&"foobox"!=d||-1===a.indexOf("&poster=")&&-1===a.indexOf("|poster=")||(f=!1)),!0===f&&("https%3A%2F%2F"===(a=(a+"").replace(/\+/g,"%20")).substr(0,14)||"http%3A%2F%2F"===a.substr(0,13)))try{a=decodeURIComponent(a)}catch(e){}n=t[o.linkTitleField],l=t[o.imgAltField],t.download&&("yes"==o.downloadLink?n+=r=(0!==n.length?o.separatorCharacter:"")+t.download:"alt"==o.downloadLink&&(l+=r=(0!==l.length?o.separatorCharacter:"")+t.download)),t.lightbox_link&&("yes"==o.lightboxLink?n+=(0!==n.length?o.separatorCharacter:"")+t.lightbox_link:"alt"==o.lightboxLink&&(l+=(0!==l.length?o.separatorCharacter:"")+t.lightbox_link)),""!==n&&(n='title="'+n+'" '),""!==l&&(l='alt="'+l+'" ');var g=o.linkAttribute;t.extra_class&&(g=g.replace("*content*",t.extra_class.replace(/.*jig-contentID-[A-Z]{2}-(\d+).*/gm,"$1"))),void 0!==t.link_attribute_name&&(g=void 0!==t.link_attribute_value?" "+t.link_attribute_name+'="'+t.link_attribute_value+'"':" "+t.link_attribute_name+'=""');var h=e("<a "+s+c+g+n+(t.wh?'data-wh="'+t.wh+'" ':"")+'href="'+("links-off"!=o.lightbox?a:"#")+'"/>'),p=e('<img class="jig-hiddenImg" '+l+t.carousel_data+"/>");t.carousel_data&&t.download&&("yes"==o.downloadLink?(r=(0!==p.attr("data-image-title").length?o.separatorCharacter:"")+e("<textarea />").html(t.download).val(),p.attr("data-image-title",p.attr("data-image-title")+r)):"alt"==o.downloadLink&&(r=(0!==p.attr("data-image-description").length?"<br />":"")+e("<textarea />").html(t.download).val(),p.attr("data-image-description",p.attr("data-image-description")+r))),p.attr("src","data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D"),h.append(p),t.linkContainer=h,void 0!==o.currentHiddenLink?e(o.currentHiddenLink).after(h):o.element.find(".jig-clearfix").after(h),o.currentHiddenLink=h},k=function(t,i){i.off("load"),0!==t.length&&t.off("load").remove(),i.clone().addClass("jig-pixastic").insertAfter(i).on("load",I).each(function(){(this.complete||void 0!==this.naturalWidth&&0!==this.naturalWidth)&&e(this).trigger("load")})},I=function(){if(!0!==e(this).hasClass("jig-specialfx-complete"))if(e(this).stop().css("display","block").css("opacity",1),""===o.specialFxOptions)switch(o.specialFxType){case"desaturate":Pixastic.process(this,"desaturate",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio,average:!1},L);break;case"blur":Pixastic.process(this,"blurfast",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio,amount:.5},L);break;case"glow":Pixastic.process(this,"glow",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio,amount:.3,radius:.2},L);break;case"sepia":Pixastic.process(this,"sepia",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio},L);break;case"laplace_dark":Pixastic.process(this,"laplace",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio,edgeStrength:2,invert:!1,greyLevel:0},L);break;case"laplace_light":Pixastic.process(this,"laplace",{retinaReady:o.retinaReady,devicePixelRatio:o.devicePixelRatio,edgeStrength:2,invert:!0,greyLevel:0},L)}else{var t=function(e){for(var t={},i=0,r=e.length;i<r;i+=1){var a=e[i].split(":");t[a[0]]=a[1]}return t.retinaReady=o.retinaReady,t.devicePixelRatio=o.devicePixelRatio,t}(o.specialFxOptions);switch(o.specialFxType){case"desaturate":Pixastic.process(this,"desaturate",t,L);break;case"blur":Pixastic.process(this,"blurfast",t,L);break;case"glow":Pixastic.process(this,"glow",t,L);break;case"sepia":Pixastic.process(this,"sepia",L);break;case"laplace_dark":case"laplace_light":Pixastic.process(this,"laplace",t,L)}}e(this).off("load")},L=function(t,i){if(!1===t){var r=e(i);return r.siblings(".jig-cw-role-effect").remove(),void r.remove()}if(t=e(t),"hovered"===o.specialFx?t.css("opacity",o.hiddenOpacity):t.css("opacity",o.specialFxBlend),t.addClass("jig-specialfx-complete"),"captions"==o.specialFx){var a=t.closest(".jig-imageContainer").find(".jig-cw-role-effect");if("no"==o.captionMatchWidth)t.appendTo(a);else try{var n=t[0].toDataURL("image/jpeg"),l=t.css("width")+" "+t.css("height");t.remove(),a.find(".jig-caption-title").css({"background-image":"url("+n+")","background-size":l}),a.find(".jig-caption-description").css({"background-image":"url("+n+")","background-size":l})}catch(e){o.captionMatchWidthForceNo=!0;var s=t.closest(".jig-imageContainer");s.find(".jig-cw-role-effect .jig-caption").remove(),s.find(".jig-caption-title").css({display:"block"}),t.appendTo(a)}T(C(a))}},C=function(e,t){var i={};if(i.roleEffect=e.eq(0).closest(".jig-caption-wrapper"),0===i.roleEffect.length)return!1;if("no"==o.captionMatchWidth||o.captionMatchWidthForceNo)i.roleEffect.hasClass("jig-cw-role-effect")?i.roleReal=i.roleEffect.siblings(".jig-cw-role-real"):(i.roleReal=i.roleEffect,i.roleEffect=i.roleEffect.siblings(".jig-cw-role-effect")),t&&(i.fadeZeroHeight=t),i.captionElement=i.roleReal.find(".jig-caption");else{if(i.roleEffect=i.roleEffect.filter(".jig-cw-role-effect"),!i.roleEffect.hasClass("jig-cw-role-effect"))return!1;i.img=i.roleEffect.siblings("img"),i.captionTitle=i.roleEffect.find(".jig-caption-title"),i.captionDescription=i.roleEffect.find(".jig-caption-description")}return i},T=function(e){if(!1===e)return!1;if("no"==o.captionMatchWidth||o.captionMatchWidthForceNo){var t=e.roleReal.position();0!==e.roleReal.height()?(e.roleEffect.css({height:e.captionElement.height()+"px"}).find(".jig-pixastic").css({top:-t.top+"px"}),e.fadeZeroHeight&&e.roleEffect.css({opacity:e.captionElement.css("opacity")})):e.roleEffect.find(".jig-pixastic").css({top:-t.top+"px"})}else{var i=e.roleEffect.position(),r=e.captionTitle.position(),a=e.captionDescription.position(),n=parseInt(e.img.css("margin-left"),10);r&&e.captionTitle.css({"background-position":n-r.left+"px "+-i.top+"px"}),a&&e.captionDescription.css({"background-position":n+"px "+(-a.top-i.top)+"px"})}},R=function(e){e.find(".jig-caption-wrapper").dotdotdot({watch:!0,keep:"br"})};o.errorChecked=!1;var W=function(){e(".jig-unloadable").length>0&&(o.errorChecked=!0,o.element.find(".jig-unloadable").remove(),a.createGallery("errorCheck"))},M=function(){"yes"!==o.suppressErrors&&("publicly"!==o.suppressErrors||e("body").hasClass("logged-in"))&&o.element.html('<a href="https://justifiedgrid.com/support/fix/all-of-the-images-have-failed-to-load/" target="_blank" rel="external nofollow" style="border-style:none; text-decoration: none; font-weight: bold;"><div style="background-color: #212121; color: white; padding: 10px; display: inline-block;">JIG</div><div style="background-color: #b71c1c; color:white; color: rgba(255, 255, 255, 0.87); padding: 10px; display: inline-block;">All of the images have failed to load. Please click here to reach the troubleshooting fix.</div></a>')};function H(e,t){return"hasOwnProperty"in e?e.hasOwnProperty(t):Object.prototype.hasOwnProperty.call(e,t)}function F(e,t){if(e=function(e,t){if(void 0===e)return"";var i=0,r=!1;void 0===t&&(t=2);e=e.toString().replace(/&lt;/g,"<").replace(/&gt;/g,">");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};0===t&&(r=!0);if("number"!=typeof t){for(var o=0,n=(t=[].concat(t)).length;o<n;o+=1)0===a[t[o]]?r=!0:a[t[o]]&&(i|=a[t[o]]);t=i}t&a.ENT_HTML_QUOTE_SINGLE&&(e=e.replace(/&#0*39;/g,"'"));r||(e=e.replace(/&quot;/g,'"'));return e=e.replace(/&amp;/g,"&")}(e),"below"==o.caption)return e;t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return e.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(e,i){return t.indexOf("<"+i.toLowerCase()+">")>-1?e:""})}function S(e){void 0!==e&&e.stopPropagation();var t=o.element.find(".jig-overflow > a.jig-loaded").length,i=o.element.find(".jig-imageContainer .jig-overflow > a").length;"no"==o.errorChecking&&(i-=5),void 0!==o.loadCheckTimeout&&clearTimeout(o.loadCheckTimeout),t<i?(o.loadCheckTimeout=setTimeout(function(){S()},500),o.loadMoreButton.animate({opacity:.5},300,"JIGswing")):(o.loadMoreButton.animate({opacity:1},300,"JIGswing"),o.limit+=o.originalLimit,o.loadMoreCounter++,"once"==o.loadMore&&(o.limit=o.allItems.length),a.createGallery())}a.init()},e.fn.justifiedImageGrid=function(t){return this.each(function(){if(void 0===e(this).data("justifiedImageGrid")){var i=new e.justifiedImageGrid(this,t);e(this).data("justifiedImageGrid",i)}})},e.extend(e.easing,{JIGswing:function(e){return.5-Math.cos(e*Math.PI)/2},JIGeaseInOutQuad:function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2}}),e.fn.JIGhoverFlow=function(t,i,r,a,o){if(-1==e.inArray(t,["mouseover","mouseenter","mouseout","mouseleave"]))return this;var n="object"===_typeof(r)?r:{complete:o||!o&&a||"function"==typeof r&&r,duration:r,easing:o&&a||a&&"function"!=typeof a&&a};void 0===n.easing&&(n.easing="JIGswing"),n.queue=!1;var l=n.complete;return n.complete=function(){e(this).dequeue(),"function"==typeof l&&l.call(this)},this.each(function(){var r=e(this);"mouseover"==t||"mouseenter"==t?r.data("jQuery.JIGhoverFlow",!0):r.removeData("jQuery.JIGhoverFlow"),r.queue(function(){("mouseover"==t||"mouseenter"==t?void 0!==r.data("jQuery.JIGhoverFlow"):void 0===r.data("jQuery.JIGhoverFlow"))?r.animate(i,n):r.queue([])})})},function(e){"use strict";var t=function(e,t){return e-t},i=function(e){4===e.length&&(e=e.replace(/(\w)(\w)(\w)/gi,"$1$1$2$2$3$3"));var t=/(\w{2})(\w{2})(\w{2})/.exec(e);return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]},r=function(e,t,r){var a,o=jQuery.map(i(e.start),function(e,i){var a=Math.round(e+t[i]*r);return a>255?a=255:a<0&&(a=0),a});return a=o,"#"+jQuery.map(a,function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}).join("")};e.fn.tagcloud=function(a){var o,n,l=e.extend({},e.fn.tagcloud.defaults,a),s=this.map(function(){return e(this).attr("rel")}),d=(s=jQuery.makeArray(s).sort(t))[0],c=s.pop()-d;return 0===c&&(c=1),l.size&&(o=(l.size.end-l.size.start)/c),l.color&&(n=function(e,t){return jQuery.map(i(e.end),function(r,a){return(r-i(e.start)[a])/t})}(l.color,c)),this.each(function(){var t=e(this).attr("rel")-d;l.size&&e(this).css({"font-size":l.size.start+t*o+l.size.unit}),l.color&&e(this).css({color:r(l.color,n,t)})})},e.fn.tagcloud.defaults={size:{start:14,end:18,unit:"pt"}}}(jQuery),e.JIGjQueryMinVersion=function(t,i){if(t){var r=e().jquery,a=t.split("."),o=r.split("."),n=[],l=[],s=!1;n[0]=isNaN(parseInt(a[0],10))?0:parseInt(a[0],10),n[1]=isNaN(parseInt(a[1],10))?0:parseInt(a[1],10),n[2]=isNaN(parseInt(a[2],10))?0:parseInt(a[2],10),n[3]=isNaN(parseInt(a[3],10))?0:parseInt(a[3],10),l[0]=isNaN(parseInt(o[0],10))?0:parseInt(o[0],10),l[1]=isNaN(parseInt(o[1],10))?0:parseInt(o[1],10),l[2]=isNaN(parseInt(o[2],10))?0:parseInt(o[2],10),l[3]=isNaN(parseInt(o[3],10))?0:parseInt(o[3],10);for(var d=0;d<4;d++){if(n[d]<=l[d]){if(s=!0,n[d]==l[d])continue;break}s=!1;break}if(!0===s)return!0;if(!0!==i)return!1;e(".justified-image-grid").html('<span style="color:red;font-weight:bold">Your jQuery version ('+e().jquery+") is old, this plugin needs at least 1.7, please go to the plugin settings and choose another jQuery source. If this does not work then your theme or a plugin is not using WordPress best practices and forces the loading of an old version. In that case contact the author of Justified Image Grid.</span>")}return!1}}loadJustifiedImageGrid(jQuery);