mirror of
https://github.com/TryGhost/Ruby.git
synced 2024-10-30 04:48:33 +02:00
2 lines
80 KiB
JavaScript
2 lines
80 KiB
JavaScript
!function(t,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("jquery")):t.jQueryBridget=i(t,t.jQuery)}(window,function(e,t){"use strict";function i(c,o,u){(u=u||t||e.jQuery)&&(o.prototype.option||(o.prototype.option=function(e){u.isPlainObject(e)&&(this.options=u.extend(!0,this.options,e))}),u.fn[c]=function(e){if("string"!=typeof e)return n=e,this.each(function(e,t){var i=u.data(t,c);i?(i.option(n),i._init()):(i=new o(t,n),u.data(t,c,i))}),this;var t,r,a,s,l,n,i=d.call(arguments,1);return a=i,l="$()."+c+'("'+(r=e)+'")',(t=this).each(function(e,t){var i,n,o=u.data(t,c);o?(i=o[r])&&"_"!=r.charAt(0)?(n=i.apply(o,a),s=void 0===s?n:s):p(l+" is not a valid method"):p(c+" not initialized. Cannot call methods, i.e. "+l)}),void 0!==s?s:t},n(u))}function n(e){!e||e&&e.bridget||(e.bridget=i)}var d=Array.prototype.slice,o=e.console,p=void 0===o?function(){}:function(e){o.error(e)};return n(t||e.jQuery),i}),function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return-1!=n&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o];n&&n[r]&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",t):"object"==typeof module&&module.exports?module.exports=t():e.matchesSelector=t()}(window,function(){"use strict";var i=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0;i<t.length;i++){var n=t[i]+"MatchesSelector";if(e[n])return n}}();return function(e,t){return e[i](t)}}),function(t,i){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("desandro-matches-selector")):t.fizzyUIUtils=i(t,t.matchesSelector)}(window,function(c,r){var u={extend:function(e,t){for(var i in t)e[i]=t[i];return e},modulo:function(e,t){return(e%t+t)%t}},t=Array.prototype.slice;u.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?t.call(e):[e]},u.removeFrom=function(e,t){var i=e.indexOf(t);-1!=i&&e.splice(i,1)},u.getParent=function(e,t){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,r(e,t))return e},u.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},u.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},u.filterFindElements=function(e,n){e=u.makeArray(e);var o=[];return e.forEach(function(e){if(e instanceof HTMLElement){if(!n)return void o.push(e);r(e,n)&&o.push(e);for(var t=e.querySelectorAll(n),i=0;i<t.length;i++)o.push(t[i])}}),o},u.debounceMethod=function(e,t,n){n=n||100;var o=e.prototype[t],r=t+"Timeout";e.prototype[t]=function(){var e=this[r];clearTimeout(e);var t=arguments,i=this;this[r]=setTimeout(function(){o.apply(i,t),delete i[r]},n)}},u.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},u.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,i){return t+"-"+i}).toLowerCase()};var d=c.console;return u.htmlInit=function(s,l){u.docReady(function(){var e=u.toDashed(l),o="data-"+e,t=document.querySelectorAll("["+o+"]"),i=document.querySelectorAll(".js-"+e),n=u.makeArray(t).concat(u.makeArray(i)),r=o+"-options",a=c.jQuery;n.forEach(function(t){var e,i=t.getAttribute(o)||t.getAttribute(r);try{e=i&&JSON.parse(i)}catch(e){return void(d&&d.error("Error parsing "+o+" on "+t.className+": "+e))}var n=new s(t,e);a&&a.data(t,l,n)})})},u}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/core",["ev-emitter/ev-emitter","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("ev-emitter"),require("fizzy-ui-utils")):i.InfiniteScroll=n(i,i.EvEmitter,i.fizzyUIUtils)}(window,function(t,e,o){function r(e,t){var i=o.getQueryElement(e);if(i){if((e=i).infiniteScrollGUID){var n=s[e.infiniteScrollGUID];return n.option(t),n}this.element=e,this.options=o.extend({},r.defaults),this.option(t),a&&(this.$element=a(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(i||e))}var a=t.jQuery,s={};r.defaults={},r.create={},r.destroy={};var i=r.prototype;o.extend(i,e.prototype);var n=0;i.create=function(){var e=this.guid=++n;if(this.element.infiniteScrollGUID=e,(s[e]=this).pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath())for(var t in this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit(),r.create)r.create[t].call(this);else console.error("Disabling InfiniteScroll")},i.option=function(e){o.extend(this.options,e)},i.callOnInit=function(){var e=this.options.onInit;e&&e.call(this,this)},i.dispatchEvent=function(e,t,i){this.log(e,i);var n,o,r=t?[t].concat(i):i;this.emitEvent(e,r),a&&this.$element&&(n=e+=".infiniteScroll",t&&((o=a.Event(t)).type=e,n=o),this.$element.trigger(n,i))};var l={initialized:function(e){return"on "+e},request:function(e){return"URL: "+e},load:function(e,t){return(e.title||"")+". URL: "+t},error:function(e,t){return e+". URL: "+t},append:function(e,t,i){return i.length+" items. URL: "+t},last:function(e,t){return"URL: "+t},history:function(e,t){return"URL: "+t},pageIndex:function(e,t){return"current page determined to be: "+e+" from "+t}};i.log=function(e,t){var i,n;this.options.debug&&(i="[InfiniteScroll] "+e,(n=l[e])&&(i+=". "+n.apply(this,t)),console.log(i))},i.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},i.updateScroller=function(){var e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:o.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e}else this.scroller=t},i.updateGetPath=function(){var e=this.options.path;if(e){var t=typeof e;if("function"!=t)return"string"==t&&e.match("{{#}}")?void this.updateGetPathTemplate(e):void this.updateGetPathSelector(e);this.getPath=e}else console.error("InfiniteScroll path option required. Set as: "+e)},i.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var c=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return i.updateGetPathSelector=function(e){var t=document.querySelector(e);if(t){for(var i,n,o=t.getAttribute("href"),r=0;o&&r<c.length;r++){n=c[r];var a=o.match(n);if(a){i=a.slice(1);break}}return i?(this.isPathSelector=!0,this.getPath=function(){var e=this.pageIndex+1;return i[0]+e+i[2]}.bind(this),this.pageIndex=parseInt(i[1],10)-1,void this.log("pageIndex",[this.pageIndex,"next link"])):void console.error("InfiniteScroll unable to parse next link href: "+o)}console.error("Bad InfiniteScroll path option. Next link not found: "+e)},i.updateGetAbsolutePath=function(){var e,t,i=this.getPath();i.match(/^http/)||i.match(/^\//)?this.getAbsolutePath=this.getPath:(e=location.pathname,i.match(/^\?/)?this.getAbsolutePath=function(){return e+this.getPath()}:(t=e.substring(0,e.lastIndexOf("/")),this.getAbsolutePath=function(){return t+"/"+this.getPath()}))},r.create.hideNav=function(){var e=o.getQueryElement(this.options.hideNav);e&&(e.style.display="none",this.nav=e)},r.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},i.destroy=function(){for(var e in this.allOff(),r.destroy)r.destroy[e].call(this);delete this.element.infiniteScrollGUID,delete s[this.guid],a&&this.$element&&a.removeData(this.element,"infiniteScroll")},r.throttle=function(n,o){var r,a;return o=o||200,function(){var e=+new Date,t=arguments,i=function(){r=e,n.apply(this,t)}.bind(this);r&&e<r+o?(clearTimeout(a),a=setTimeout(i,o)):i()}},r.data=function(e){var t=(e=o.getQueryElement(e))&&e.infiniteScrollGUID;return t&&s[t]},r.setJQuery=function(e){a=e},o.htmlInit(r,"infinite-scroll"),i._init=function(){},a&&a.bridget&&a.bridget("infiniteScroll",r),r}),function(t,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/page-load",["./core"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("./core")):i(t,t.InfiniteScroll)}(window,function(n,o){function a(e){for(var t=document.createDocumentFragment(),i=0;e&&i<e.length;i++)t.appendChild(e[i]);return t}function i(e){for(var t=e.querySelectorAll("script"),i=0;i<t.length;i++){var n=t[i],o=document.createElement("script");(function(e,t){for(var i=e.attributes,n=0;n<i.length;n++){var o=i[n];t.setAttribute(o.name,o.value)}})(n,o),o.innerHTML=n.innerHTML,n.parentNode.replaceChild(o,n)}}var e=o.prototype;return o.defaults.loadOnScroll=!0,o.defaults.checkLastPage=!0,o.defaults.responseType="document",o.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},e.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()},e.loadNextPage=function(){var t,e,i,n,o,r,a,s,l,c;!this.isLoading&&this.canLoad&&(t=this.getAbsolutePath(),this.isLoading=!0,e=function(e){this.onPageLoad(e,t)}.bind(this),i=function(e){this.onPageError(e,t)}.bind(this),n=function(e){this.lastPageReached(e,t)}.bind(this),o=t,r=this.options.responseType,a=e,s=i,l=n,(c=new XMLHttpRequest).open("GET",o,!0),c.responseType=r||"",c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.onload=function(){var e;200==c.status?a(c.response):204==c.status?l(c.response):(e=new Error(c.statusText),s(e))},c.onerror=function(){var e=new Error("Network error requesting "+o);s(e)},c.send(),this.dispatchEvent("request",null,[t]))},e.onPageLoad=function(e,t){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[e,t]),this.appendNextPage(e,t),e},e.appendNextPage=function(e,t){var i,n,o,r=this.options.append;"document"==this.options.responseType&&r&&(i=e.querySelectorAll(r),n=a(i),o=function(){this.appendItems(i,n),this.isLoading=!1,this.dispatchEvent("append",null,[e,t,i])}.bind(this),this.options.outlayer?this.appendOutlayerItems(n,o):o())},e.appendItems=function(e,t){e&&e.length&&(i(t=t||a(e)),this.element.appendChild(t))},e.appendOutlayerItems=function(e,t){var i=o.imagesLoaded||n.imagesLoaded;return i?void i(e,t):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},e.onAppendOutlayer=function(e,t,i){this.options.outlayer.appended(i)},e.checkLastPage=function(e,t){var i=this.options.checkLastPage;if(i){var n,o=this.options.path;if("function"==typeof o)if(!this.getPath())return void this.lastPageReached(e,t);"string"==typeof i?n=i:this.isPathSelector&&(n=o),n&&e.querySelector&&(e.querySelector(n)||this.lastPageReached(e,t))}},e.lastPageReached=function(e,t){this.canLoad=!1,this.dispatchEvent("last",null,[e,t])},e.onPageError=function(e,t){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[e,t]),e},o.create.prefill=function(){if(this.options.prefill){var e=this.options.append;if(!e)return void console.error("append option required for prefill. Set as :"+e);this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()}},e.prefill=function(){var e=this.getPrefillDistance();this.isPrefilling=0<=e,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},e.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},e.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},o}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(i,e,t){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var e=this.options.scrollThreshold;!e&&0!==e||this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){var t=e?"addEventListener":"removeEventListener";this.scroller[t]("scroll",this.pageScrollHandler),i[t]("resize",this.resizeHandler)},n.onPageScroll=e.throttle(function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){return this.top+this.element.clientHeight-(i.pageYOffset+this.windowHeight)},n.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},n.onResize=function(){this.updateMeasurements()},t.debounceMethod(e,"onResize",150),e}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(n,e,t){var i=e.prototype;e.defaults.history="replace";var r=document.createElement("a");return e.create.history=function(){if(this.options.history)return r.href=this.getAbsolutePath(),(r.origin||r.protocol+"//"+r.host)==location.origin?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+r.origin+" on "+location.origin+" . History behavior disabled.")},i.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},i.bindHistoryAppendEvents=function(e){var t=e?"addEventListener":"removeEventListener";this.scroller[t]("scroll",this.scrollHistoryHandler),n[t]("unload",this.unloadHandler)},i.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=i.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},i.onAppendHistory=function(e,t,i){var n,o;i&&i.length&&(n=i[0],o=this.getElementScrollY(n),r.href=t,this.scrollPages.push({top:o,path:r.href,title:e.title}))},i.getElementScrollY=function(e){return this.options.elementScroll?this.getElementElementScrollY(e):this.getElementWindowScrollY(e)},i.getElementWindowScrollY=function(e){return e.getBoundingClientRect().top+n.pageYOffset},i.getElementElementScrollY=function(e){return e.offsetTop-this.top},i.onScrollHistory=function(){for(var e,t,i=this.getScrollViewY(),n=0;n<this.scrollPages.length;n++){var o=this.scrollPages[n];if(o.top>=i)break;e=n,t=o}e!=this.scrollPageIndex&&(this.scrollPageIndex=e,this.setHistory(t.title,t.path))},t.debounceMethod(e,"onScrollHistory",150),i.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:n.pageYOffset+this.windowHeight/2},i.setHistory=function(e,t){var i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,e,t),this.options.historyTitle&&(document.title=e),this.dispatchEvent("history",null,[e,t]))},i.onUnload=function(){var e,t,i=this.scrollPageIndex;0!==i&&(e=this.scrollPages[i],t=n.pageYOffset-e.top+this.top,this.destroyHistory(),scrollTo(0,t))},i.onPageLoadHistory=function(e,t){this.setHistory(e.title,t)},e}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e,t){this.element=e,this.infScroll=t,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),t.on("request",this.disable.bind(this)),t.on("load",this.enable.bind(this)),t.on("error",this.hide.bind(this)),t.on("last",this.hide.bind(this))}return t.create.button=function(){var e=i.getQueryElement(this.options.button);e&&(this.button=new n(e,this))},t.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(e){e.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},t.Button=n,t}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e){r(e,"none")}function o(e){r(e,"block")}function r(e,t){e&&(e.style.display=t)}var a=t.prototype;return t.create.status=function(){var e=i.getQueryElement(this.options.status);e&&(this.statusElement=e,this.statusEventElements={request:e.querySelector(".infinite-scroll-request"),error:e.querySelector(".infinite-scroll-error"),last:e.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},a.bindHideStatus=function(e){var t=this.options.append?"append":"load";this[e](t,this.hideAllStatus)},a.showRequestStatus=function(){this.showStatus("request")},a.showErrorStatus=function(){this.showStatus("error")},a.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},a.showStatus=function(e){o(this.statusElement),this.hideStatusEventElements(),o(this.statusEventElements[e])},a.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},a.hideStatusEventElements=function(){for(var e in this.statusEventElements){n(this.statusEventElements[e])}},t}),function(e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}((window,function(e){return e})),function(t,i){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("ev-emitter")):t.imagesLoaded=i(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function r(e,t){for(var i in t)e[i]=t[i];return e}function a(e,t,i){if(!(this instanceof a))return new a(e,t,i);var n,o=e;return"string"==typeof e&&(o=document.querySelectorAll(e)),o?(this.elements=(n=o,Array.isArray(n)?n:"object"==typeof n&&"number"==typeof n.length?c.call(n):[n]),this.options=r({},this.options),"function"==typeof t?i=t:r(this.options,t),i&&this.on("always",i),this.getImages(),s&&(this.jqDeferred=new s.Deferred),void setTimeout(this.check.bind(this))):void l.error("Bad element for imagesLoaded "+(o||e))}function i(e){this.img=e}function n(e,t){this.url=e,this.element=t,this.img=new Image}var s=t.jQuery,l=t.console,c=Array.prototype.slice;(a.prototype=Object.create(e.prototype)).options={},a.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},a.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background)for(var r=e.querySelectorAll(this.options.background),n=0;n<r.length;n++){var a=r[n];this.addElementBackgroundImages(a)}}};var u={1:!0,9:!0,11:!0};return a.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},a.prototype.addImage=function(e){var t=new i(e);this.images.push(t)},a.prototype.addBackground=function(e,t){var i=new n(e,t);this.images.push(i)},a.prototype.check=function(){function t(e,t,i){setTimeout(function(){n.progress(e,t,i)})}var n=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},a.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&l&&l.log("progress: "+i,e,t)},a.prototype.complete=function(){var e,t=this.hasAnyBroken?"fail":"done";this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred&&(e=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[e](this))},(i.prototype=Object.create(e.prototype)).check=function(){return this.getIsImageComplete()?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},i.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},i.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},i.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},i.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},i.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},i.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},(n.prototype=Object.create(i.prototype)).check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},n.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},n.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},(a.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((s=e).fn.imagesLoaded=function(e,t){return new a(this,e,t).jqDeferred.promise(s(this))})})(),a}),function(r){"use strict";r.fn.fitVids=function(e){var t,i,o={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(i=document.createElement("div")).innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>',t.appendChild(i.childNodes[1])),e&&r.extend(o,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];o.customSelector&&e.push(o.customSelector);var n=".fitvidsignore";o.ignore&&(n=n+", "+o.ignore);var t=r(this).find(e.join(","));(t=(t=t.not("object object")).not(n)).each(function(){var e,t,i=r(this);0<i.parents(n).length||"embed"===this.tagName.toLowerCase()&&i.parent("object").length||i.parent(".fluid-width-video-wrapper").length||(i.css("height")||i.css("width")||!isNaN(i.attr("height"))&&!isNaN(i.attr("width"))||(i.attr("height",9),i.attr("width",16)),e=("object"===this.tagName.toLowerCase()||i.attr("height")&&!isNaN(parseInt(i.attr("height"),10))?parseInt(i.attr("height"),10):i.height())/(isNaN(parseInt(i.attr("width"),10))?i.width():parseInt(i.attr("width"),10)),i.attr("name")||(t="fitvid"+r.fn.fitVids._count,i.attr("name",t),r.fn.fitVids._count++),i.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),i.removeAttr("height").removeAttr("width"))})})},r.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){var t=function(s,R){"use strict";if(R.getElementsByClassName){var H,F,N=R.documentElement,l=s.Date,n=s.HTMLPictureElement,c="addEventListener",q="getAttribute",u=s[c],B=s.setTimeout,d=s.requestAnimationFrame||B,p=s.requestIdleCallback,j=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],i={},W=Array.prototype.forEach,U=function(e,t){return i[t]||(i[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),i[t].test(e[q]("class")||"")&&i[t]},Z=function(e,t){U(e,t)||e.setAttribute("class",(e[q]("class")||"").trim()+" "+t)},Y=function(e,t){var i;(i=U(e,t))&&e.setAttribute("class",(e[q]("class")||"").replace(i," "))},$=function(t,i,e){var n=e?c:"removeEventListener";e&&$(t,i),o.forEach(function(e){t[n](e,i)})},G=function(e,t,i,n,o){var r=R.createEvent("Event");return i||(i={}),i.instance=H,r.initEvent(t,!n,!o),r.detail=i,e.dispatchEvent(r),r},K=function(e,t){var i;!n&&(i=s.picturefill||F.pf)?(t&&t.src&&!e[q]("srcset")&&e.setAttribute("srcset",t.src),i({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)},Q=function(e,t){return(getComputedStyle(e,null)||{})[t]},a=function(e,t,i){for(i=i||e.offsetWidth;i<F.minSize&&t&&!e._lazysizesWidth;)i=t.offsetWidth,t=t.parentNode;return i},V=function(){var i,n,t=[],o=[],r=t,a=function(){var e=r;for(r=t.length?o:t,i=!0,n=!1;e.length;)e.shift()();i=!1},e=function(e,t){i&&!t?e.apply(this,arguments):(r.push(e),n||(n=!0,(R.hidden?B:d)(a)))};return e._lsFlush=a,e}(),X=function(i,e){return e?function(){V(i)}:function(){var e=this,t=arguments;V(function(){i.apply(e,t)})}},J=function(e){var i,n=0,o=F.throttleDelay,r=F.ricTimeout,t=function(){i=!1,n=l.now(),e()},a=p&&r>49?function(){p(t,{timeout:r}),r!==F.ricTimeout&&(r=F.ricTimeout)}:X(function(){B(t)},!0);return function(e){var t;(e=!0===e)&&(r=33),i||(i=!0,t=o-(l.now()-n),t<0&&(t=0),e||t<9?a():B(a,t))}},ee=function(e){var t,i,n=99,o=function(){t=null,e()},r=function(){var e=l.now()-i;e<n?B(r,n-e):(p||o)(o)};return function(){i=l.now(),t||(t=B(r,n))}};!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};F=s.lazySizesConfig||s.lazysizesConfig||{};for(e in t)e in F||(F[e]=t[e]);s.lazySizesConfig=F,B(function(){F.init&&r()})}();var e=function(){var h,f,d,m,t,g,y,v,b,w,x,S,r=/^img$/i,p=/^iframe$/i,E="onscroll"in s&&!/(gle|ing)bot/.test(navigator.userAgent),I=0,C=0,T=0,k=-1,A=function(e){T--,e&&e.target&&$(e.target,A),(!e||T<0||!e.target)&&(T=0)},z=function(e){return null==S&&(S="hidden"==Q(R.body,"visibility")),S||"hidden"!=Q(e.parentNode,"visibility")&&"hidden"!=Q(e,"visibility")},L=function(e,t){var i,n=e,o=z(e);for(v-=t,x+=t,b-=t,w+=t;o&&(n=n.offsetParent)&&n!=R.body&&n!=N;)(o=(Q(n,"opacity")||1)>0)&&"visible"!=Q(n,"overflow")&&(i=n.getBoundingClientRect(),o=w>i.left&&b<i.right&&x>i.top-1&&v<i.bottom+1);return o},e=function(){var e,t,i,n,o,r,a,s,l,c,u,d,p=H.elements;if((m=F.loadMode)&&T<8&&(e=p.length)){for(t=0,k++,c=!F.expand||F.expand<1?N.clientHeight>500&&N.clientWidth>500?500:370:F.expand,u=c*F.expFactor,d=F.hFac,S=null,C<u&&T<1&&k>2&&m>2&&!R.hidden?(C=u,k=0):C=m>1&&k>1&&T<6?c:I;t<e;t++)if(p[t]&&!p[t]._lazyRace)if(E)if((s=p[t][q]("data-expand"))&&(r=1*s)||(r=C),l!==r&&(g=innerWidth+r*d,y=innerHeight+r,a=-1*r,l=r),i=p[t].getBoundingClientRect(),(x=i.bottom)>=a&&(v=i.top)<=y&&(w=i.right)>=a*d&&(b=i.left)<=g&&(x||w||b||v)&&(F.loadHidden||z(p[t]))&&(f&&T<3&&!s&&(m<3||k<4)||L(p[t],r))){if(O(p[t]),o=!0,T>9)break}else!o&&f&&!n&&T<4&&k<4&&m>2&&(h[0]||F.preloadAfterLoad)&&(h[0]||!s&&(x||w||b||v||"auto"!=p[t][q](F.sizesAttr)))&&(n=h[0]||p[t]);else O(p[t]);n&&!o&&O(n)}},i=J(e),P=function(e){Z(e.target,F.loadedClass),Y(e.target,F.loadingClass),$(e.target,M),G(e.target,"lazyloaded")},n=X(P),M=function(e){n({target:e.target})},D=function(t,i){try{t.contentWindow.location.replace(i)}catch(e){t.src=i}},_=function(e){var t,i=e[q](F.srcsetAttr);(t=F.customMedia[e[q]("data-media")||e[q]("media")])&&e.setAttribute("media",t),i&&e.setAttribute("srcset",i)},a=X(function(e,t,i,n,o){var r,a,s,l,c,u;(c=G(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(i?Z(e,F.autosizesClass):e.setAttribute("sizes",n)),a=e[q](F.srcsetAttr),r=e[q](F.srcAttr),o&&(s=e.parentNode,l=s&&j.test(s.nodeName||"")),u=t.firesLoad||"src"in e&&(a||r||l),c={target:e},u&&($(e,A,!0),clearTimeout(d),d=B(A,2500),Z(e,F.loadingClass),$(e,M,!0)),l&&W.call(s.getElementsByTagName("source"),_),a?e.setAttribute("srcset",a):r&&!l&&(p.test(e.nodeName)?D(e,r):e.src=r),o&&(a||l)&&K(e,{src:r})),e._lazyRace&&delete e._lazyRace,Y(e,F.lazyClass),V(function(){(!u||e.complete&&e.naturalWidth>1)&&(u?A(c):T--,P(c))},!0)}),O=function(e){var t,i=r.test(e.nodeName),n=i&&(e[q](F.sizesAttr)||e[q]("sizes")),o="auto"==n;(!o&&f||!i||!e[q]("src")&&!e.srcset||e.complete||U(e,F.errorClass)||!U(e,F.lazyClass))&&(t=G(e,"lazyunveilread").detail,o&&te.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,T++,a(e,t,o,n,i))},o=function(){if(!f){if(l.now()-t<999)return void B(o,999);var e=ee(function(){F.loadMode=3,i()});f=!0,F.loadMode=3,i(),u("scroll",function(){3==F.loadMode&&(F.loadMode=2),e()},!0)}};return{_:function(){t=l.now(),H.elements=R.getElementsByClassName(F.lazyClass),h=R.getElementsByClassName(F.lazyClass+" "+F.preloadClass),u("scroll",i,!0),u("resize",i,!0),s.MutationObserver?new MutationObserver(i).observe(N,{childList:!0,subtree:!0,attributes:!0}):(N[c]("DOMNodeInserted",i,!0),N[c]("DOMAttrModified",i,!0),setInterval(i,999)),u("hashchange",i,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(e){R[c](e,i,!0)}),/d$|^c/.test(R.readyState)?o():(u("load",o),R[c]("DOMContentLoaded",i),B(o,2e4)),H.elements.length?(e(),V._lsFlush()):i()},checkElems:i,unveil:O}}(),te=function(){var i,r=X(function(e,t,i,n){var o,r,a;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),j.test(t.nodeName||""))for(o=t.getElementsByTagName("source"),r=0,a=o.length;r<a;r++)o[r].setAttribute("sizes",n);i.detail.dataAttr||K(e,i.detail)}),n=function(e,t,i){var n,o=e.parentNode;o&&(i=a(e,o,i),n=G(e,"lazybeforesizes",{width:i,dataAttr:!!t}),n.defaultPrevented||(i=n.detail.width)&&i!==e._lazysizesWidth&&r(e,o,n,i))},e=function(){var e,t=i.length;if(t)for(e=0;e<t;e++)n(i[e])},t=ee(e);return{_:function(){i=R.getElementsByClassName(F.autosizesClass),u("resize",t)},checkElems:t,updateElem:n}}(),r=function(){r.i||(r.i=!0,te._(),e._())};return H={cfg:F,autoSizer:te,loader:e,init:r,uP:K,aC:Z,rC:Y,hC:U,fire:G,gW:a,rAF:V}}}(e,e.document);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}(window),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(o,s){function e(e){if(k)return!0;e=e||window.event,T.timeToIdle&&T.mouseUsed&&!w&&H();for(var t,i,n,o=(e.target||e.srcElement).getAttribute("class")||"",r=0;r<N.length;r++)(t=N[r]).onTap&&-1<o.indexOf("pswp__"+t.name)&&(t.onTap(),i=!0);i&&(e.stopPropagation&&e.stopPropagation(),k=!0,n=s.features.isOldAndroid?600:30,setTimeout(function(){k=!1},n))}function i(e,t,i){s[(i?"add":"remove")+"Class"](e,"pswp__"+t)}function n(){var e=1===T.getNumItemsFn();e!==C&&(i(h,"ui--one-slide",e),C=e)}function t(){i(v,"share-modal--hidden",D)}function r(){return(D=!D)?(s.removeClass(v,"pswp__share-modal--fade-in"),setTimeout(function(){D&&t()},300)):(t(),setTimeout(function(){D||s.addClass(v,"pswp__share-modal--fade-in")},30)),D||O(),0}function a(e){var t=(e=e||window.event).target||e.srcElement;return o.shout("shareLinkClick",e,t),!(!t.href||!t.hasAttribute("download")&&(window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),D||r(),1))}function l(e){for(var t=0;t<T.closeElClasses.length;t++)if(s.hasClass(e,"pswp__"+T.closeElClasses[t]))return!0}function c(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(z),z=setTimeout(function(){L.setIdle(!0)},T.timeToIdleOutside))}function u(e){var t,i,n=e.vGap;!o.likelyTouchDevice||T.mouseUsed||screen.width>T.fitControlsWidth?(t=T.barsSize,T.captionEl&&"auto"===t.bottom?(m||((m=s.createEl("pswp__caption pswp__caption--fake")).appendChild(s.createEl("pswp__caption__center")),h.insertBefore(m,f),s.addClass(h,"pswp__ui--fit")),T.addCaptionHTMLFn(e,m,!0)?(i=m.clientHeight,n.bottom=parseInt(i,10)||44):n.bottom=t.top):n.bottom="auto"===t.bottom?0:t.bottom,n.top=t.top):n.top=n.bottom=0}function d(){function e(e){if(e)for(var t=e.length,i=0;i<t;i++){o=e[i],r=o.className;for(var n=0;n<N.length;n++)a=N[n],-1<r.indexOf("pswp__"+a.name)&&(T[a.option]?(s.removeClass(o,"pswp__element--disabled"),a.onInit&&a.onInit(o)):s.addClass(o,"pswp__element--disabled"))}}var o,r,a;e(h.children);var t=s.getChildByClass(h,"pswp__top-bar");t&&e(t.children)}var p,h,f,m,g,y,v,b,w,x,S,E,I,C,T,k,A,z,L=this,P=!1,M=!0,D=!0,_={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return o.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return o.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},O=function(){for(var e,t,i,n,o="",r=0;r<T.shareButtons.length;r++)e=T.shareButtons[r],t=T.getImageURLForShare(e),i=T.getPageURLForShare(e),n=T.getTextForShare(e),o+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(i)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(n))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",T.parseShareButtonOut&&(o=T.parseShareButtonOut(e,o));v.children[0].innerHTML=o,v.children[0].onclick=a},R=0,H=function(){clearTimeout(z),R=0,w&&L.setIdle(!1)},F=function(e){E!==e&&(i(S,"preloader--active",!e),E=e)},N=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){v=e},onTap:function(){r()}},{name:"button--share",option:"shareEl",onInit:function(e){y=e},onTap:function(){r()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){g=e}},{name:"button--close",option:"closeEl",onTap:o.close},{name:"button--arrow--left",option:"arrowEl",onTap:o.prev},{name:"button--arrow--right",option:"arrowEl",onTap:o.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){p.isFullscreen()?p.exit():p.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){S=e}}];L.init=function(){var t;s.extend(o.options,_,!0),T=o.options,h=s.getChildByClass(o.scrollWrap,"pswp__ui"),(x=o.listen)("onVerticalDrag",function(e){M&&e<.95?L.hideControls():!M&&.95<=e&&L.showControls()}),x("onPinchClose",function(e){M&&e<.9?(L.hideControls(),t=!0):t&&!M&&.9<e&&L.showControls()}),x("zoomGestureEnded",function(){(t=!1)&&!M&&L.showControls()}),x("beforeChange",L.update),x("doubleTap",function(e){var t=o.currItem.initialZoomLevel;o.getZoomLevel()!==t?o.zoomTo(t,e,333):o.zoomTo(T.getDoubleTapZoom(!1,o.currItem),e,333)}),x("preventDragEvent",function(e,t,i){var n=e.target||e.srcElement;n&&n.getAttribute("class")&&-1<e.type.indexOf("mouse")&&(0<n.getAttribute("class").indexOf("__caption")||/(SMALL|STRONG|EM)/i.test(n.tagName))&&(i.prevent=!1)}),x("bindEvents",function(){s.bind(h,"pswpTap click",e),s.bind(o.scrollWrap,"pswpTap",L.onGlobalTap),o.likelyTouchDevice||s.bind(o.scrollWrap,"mouseover",L.onMouseOver)}),x("unbindEvents",function(){D||r(),A&&clearInterval(A),s.unbind(document,"mouseout",c),s.unbind(document,"mousemove",H),s.unbind(h,"pswpTap click",e),s.unbind(o.scrollWrap,"pswpTap",L.onGlobalTap),s.unbind(o.scrollWrap,"mouseover",L.onMouseOver),p&&(s.unbind(document,p.eventK,L.updateFullscreen),p.isFullscreen()&&(T.hideAnimationDuration=0,p.exit()),p=null)}),x("destroy",function(){T.captionEl&&(m&&h.removeChild(m),s.removeClass(f,"pswp__caption--empty")),v&&(v.children[0].onclick=null),s.removeClass(h,"pswp__ui--over-close"),s.addClass(h,"pswp__ui--hidden"),L.setIdle(!1)}),T.showAnimationDuration||s.removeClass(h,"pswp__ui--hidden"),x("initialZoomIn",function(){T.showAnimationDuration&&s.removeClass(h,"pswp__ui--hidden")}),x("initialZoomOut",function(){s.addClass(h,"pswp__ui--hidden")}),x("parseVerticalMargin",u),d(),T.shareEl&&y&&v&&(D=!0),n(),T.timeToIdle&&x("mouseUsed",function(){s.bind(document,"mousemove",H),s.bind(document,"mouseout",c),A=setInterval(function(){2===++R&&L.setIdle(!0)},T.timeToIdle/2)}),T.fullscreenEl&&!s.features.isOldAndroid&&((p=p||L.getFullscreenAPI())?(s.bind(document,p.eventK,L.updateFullscreen),L.updateFullscreen(),s.addClass(o.template,"pswp--supports-fs")):s.removeClass(o.template,"pswp--supports-fs")),T.preloaderEl&&(F(!0),x("beforeChange",function(){clearTimeout(I),I=setTimeout(function(){o.currItem&&o.currItem.loading?o.allowProgressiveImg()&&(!o.currItem.img||o.currItem.img.naturalWidth)||F(!1):F(!0)},T.loadingIndicatorDelay)}),x("imageLoadComplete",function(e,t){o.currItem===t&&F(!0)}))},L.setIdle=function(e){i(h,"ui--idle",w=e)},L.update=function(){P=!(!M||!o.currItem)&&(L.updateIndexIndicator(),T.captionEl&&(T.addCaptionHTMLFn(o.currItem,f),i(f,"caption--empty",!o.currItem.title)),!0),D||r(),n()},L.updateFullscreen=function(e){e&&setTimeout(function(){o.setScrollOffset(0,s.getScrollY())},50),s[(p.isFullscreen()?"add":"remove")+"Class"](o.template,"pswp--fs")},L.updateIndexIndicator=function(){T.counterEl&&(g.innerHTML=o.getCurrentIndex()+1+T.indexIndicatorSep+T.getNumItemsFn())},L.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!k)if(e.detail&&"mouse"===e.detail.pointerType){if(l(t))return void o.close();s.hasClass(t,"pswp__img")&&(1===o.getZoomLevel()&&o.getZoomLevel()<=o.currItem.fitRatio?T.clickToCloseNonZoomable&&o.close():o.toggleDesktopZoom(e.detail.releasePoint))}else if(T.tapToToggleControls&&(M?L.hideControls():L.showControls()),T.tapToClose&&(s.hasClass(t,"pswp__img")||l(t)))return void o.close()},L.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;i(h,"ui--over-close",l(t))},L.hideControls=function(){s.addClass(h,"pswp__ui--hidden"),M=!1},L.showControls=function(){M=!0,P||L.update(),s.removeClass(h,"pswp__ui--hidden")},L.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},L.getFullscreenAPI=function(){var e,t=document.documentElement,i="fullscreenchange";return t.requestFullscreen?e={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:i}:t.mozRequestFullScreen?e={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+i}:t.webkitRequestFullscreen?e={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+i}:t.msRequestFullscreen&&(e={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),e&&(e.enter=function(){return b=T.closeOnScroll,T.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?o.template[this.enterK]():void o.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},e.exit=function(){return T.closeOnScroll=b,document[this.exitK]()},e.isFullscreen=function(){return document[this.elementK]}),e}}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(h,n,e,t){var f={features:null,bind:function(e,t,i,n){var o=(n?"remove":"add")+"EventListener";t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&e[o](t[r],i,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){var i=document.createElement(t||"div");return e&&(i.className=e),i},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,i){f.bind(e,t,i,!0)},removeClass:function(e,t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){f.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 i=e.firstChild;i;){if(f.hasClass(i,t))return i;i=i.nextSibling}},arraySearch:function(e,t,i){for(var n=e.length;n--;)if(e[n][i]===t)return n;return-1},extend:function(e,t,i){for(var n in t)if(t.hasOwnProperty(n)){if(i&&e.hasOwnProperty(n))continue;e[n]=t[n]}},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(f.features)return f.features;var e,t,i,n,o=f.createEl().style,r="",a={};a.oldIE=document.all&&!document.addEventListener,a.touch="ontouchstart"in window,window.requestAnimationFrame&&(a.raf=window.requestAnimationFrame,a.caf=window.cancelAnimationFrame),a.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,a.pointerEvent||(e=navigator.userAgent,!/iP(hone|od)/.test(navigator.platform)||(t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/))&&0<t.length&&(1<=(t=parseInt(t[1],10))&&t<8&&(a.isOldIOSPhone=!0)),n=(i=e.match(/Android\s([0-9\.]*)/))?i[1]:0,1<=(n=parseFloat(n))&&(n<4.4&&(a.isOldAndroid=!0),a.androidVersion=n),a.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var s,l,c,u=["transform","perspective","animationName"],d=["","webkit","Moz","ms","O"],p=0;p<4;p++){r=d[p];for(var h=0;h<3;h++)s=u[h],l=r+(r?s.charAt(0).toUpperCase()+s.slice(1):s),!a[s]&&l in o&&(a[s]=l);r&&!a.raf&&(r=r.toLowerCase(),a.raf=window[r+"RequestAnimationFrame"],a.raf&&(a.caf=window[r+"CancelAnimationFrame"]||window[r+"CancelRequestAnimationFrame"]))}return a.raf||(c=0,a.raf=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-c)),n=window.setTimeout(function(){e(t+i)},i);return c=t+i,n},a.caf=function(e){clearTimeout(e)}),a.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,f.features=a}};f.detectFeatures(),f.features.oldIE&&(f.bind=function(e,t,i,n){t=t.split(" ");for(var o,r=(n?"detach":"attach")+"Event",a=function(){i.handleEvent.call(i)},s=0;s<t.length;s++)if(o=t[s])if("object"==typeof i&&i.handleEvent){if(n){if(!i["oldIE"+o])return!1}else i["oldIE"+o]=a;e[r]("on"+o,i["oldIE"+o])}else e[r]("on"+o,i)});var m=this,g={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"};f.extend(g,t);function i(){return{x:0,y:0}}function o(e,t){f.extend(m,t.publicMethods),Ve.push(e)}function l(e){var t=$t();return t-1<e?e-t:e<0?t+e:e}function r(e,t){return et[e]||(et[e]=[]),et[e].push(t)}function y(e){var t=et[e];if(t){var i=Array.prototype.slice.call(arguments);i.shift();for(var n=0;n<t.length;n++)t[n].apply(m,i)}}function v(){return(new Date).getTime()}function b(e){Ne=e,m.bg.style.opacity=e*g.bgOpacity}function a(e,t,i,n,o){(!Je||o&&o!==m.currItem)&&(n/=o?o.fitRatio:m.currItem.fitRatio),e[se]=V+t+"px, "+i+"px"+X+" scale("+n+")"}function u(e,t){var i,n;!g.loop&&t&&(i=W+(Ge.x*Ye-e)/Ge.x,n=Math.round(e-xt.x),(i<0&&0<n||i>=$t()-1&&n<0)&&(e=xt.x+n*g.mainScrollEndFriction)),xt.x=e,nt(e,U)}function w(e,t){var i=St[e]-$e[e];return We[e]+je[e]+i-t/Q*i}function x(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function S(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function d(e,t){var i=Xt(m.currItem,Ze,e);return t&&(De=i),i}function E(e){return(e=e||m.currItem).initialZoomLevel}function I(e){return 0<(e=e||m.currItem).w?g.maxSpreadZoom:1}function p(e,t,i,n){return n===m.currItem.initialZoomLevel?(i[e]=m.currItem.initialPosition[e],!0):(i[e]=w(e,n),i[e]>t.min[e]?(i[e]=t.min[e],!0):i[e]<t.max[e]&&(i[e]=t.max[e],!0))}function s(e){var t="";g.escKey&&27===e.keyCode?t="close":g.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,m[t]()))}function c(e){e&&(ke||Te||Oe||Se)&&(e.preventDefault(),e.stopPropagation())}function C(){m.setScrollOffset(0,f.getScrollY())}function T(e){at[e]&&(at[e].raf&&de(at[e].raf),st--,delete at[e])}function k(e){at[e]&&T(e),at[e]||(st++,at[e]={})}function A(){for(var e in at)at.hasOwnProperty(e)&&T(e)}function z(e,t,i,n,o,r,a){var s,l=v();k(e);var c=function(){if(at[e]){if(s=v()-l,n<=s)return T(e),r(i),void(a&&a());r((i-t)*o(s/n)+t),at[e].raf=ue(c)}};c()}function L(e,t){return yt.x=Math.abs(e.x-t.x),yt.y=Math.abs(e.y-t.y),Math.sqrt(yt.x*yt.x+yt.y*yt.y)}function P(e,t){return kt.prevent=!Tt(e.target,g.isClickableElement),y("preventDragEvent",e,t,kt),kt.prevent}function M(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t}function D(e,t,i){i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y)}function _(){var e=Ue.y-m.currItem.initialPosition.y;return 1-Math.abs(e/(Ze.y/2))}function O(e){for(;0<Lt.length;)Lt.pop();return le?(Be=0,ft.forEach(function(e){0===Be?Lt[0]=e:1===Be&&(Lt[1]=e),Be++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(Lt[0]=M(e.touches[0],At),1<e.touches.length&&(Lt[1]=M(e.touches[1],zt))):(At.x=e.pageX,At.y=e.pageY,At.id="",Lt[0]=At),Lt}function R(e,t){var i,n,o,r=Ue[e]+t[e],a=0<t[e],s=xt.x+t.x,l=xt.x-mt.x,c=r>De.min[e]||r<De.max[e]?g.panEndFriction:1,r=Ue[e]+t[e]*c;return!g.allowPanToNext&&K!==m.currItem.initialZoomLevel||(_e?"h"!==Re||"x"!==e||Te||(a?(r>De.min[e]&&(c=g.panEndFriction,De.min[e],i=De.min[e]-We[e]),(i<=0||l<0)&&1<$t()?(o=s,l<0&&s>mt.x&&(o=mt.x)):De.min.x!==De.max.x&&(n=r)):(r<De.max[e]&&(c=g.panEndFriction,De.max[e],i=We[e]-De.max[e]),(i<=0||0<l)&&1<$t()?(o=s,0<l&&s<mt.x&&(o=mt.x)):De.min.x!==De.max.x&&(n=r))):o=s,"x"!==e)?void(Oe||ze||K>m.currItem.fitRatio&&(Ue[e]+=t[e]*c)):(void 0!==o&&(u(o,!0),ze=o!==mt.x),De.min.x!==De.max.x&&(void 0!==n?Ue.x=n:ze||(Ue.x+=t.x*c)),void 0!==o)}function H(e){if(!("mousedown"===e.type&&0<e.button)){if(Zt)return void e.preventDefault();var t,i,n;Ee&&"mousedown"===e.type||(P(e,!0)&&e.preventDefault(),y("pointerDown"),le&&((t=f.arraySearch(ft,e.pointerId,"id"))<0&&(t=ft.length),ft[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),n=(i=O(e)).length,Le=null,A(),Ie&&1!==n||(Ie=He=!0,f.bind(window,Y,m),xe=qe=Fe=Se=ze=ke=Ce=Te=!1,Re=null,y("firstTouchStart",i),x(We,Ue),je.x=je.y=0,x(pt,i[0]),x(ht,pt),mt.x=Ge.x*Ye,gt=[{x:pt.x,y:pt.y}],be=ve=v(),d(K,!0),It(),Ct()),!Pe&&1<n&&!Oe&&!ze&&(Q=K,Pe=Ce=!(Te=!1),je.y=je.x=0,x(We,Ue),x(ct,i[0]),x(ut,i[1]),D(ct,ut,Et),St.x=Math.abs(Et.x)-Ue.x,St.y=Math.abs(Et.y)-Ue.y,Me=L(ct,ut)))}}function F(e){var t,i,n,o;e.preventDefault(),le&&-1<(t=f.arraySearch(ft,e.pointerId,"id"))&&((i=ft[t]).x=e.pageX,i.y=e.pageY),Ie&&(n=O(e),Re||ke||Pe?Le=n:xt.x!==Ge.x*Ye?Re="h":(o=Math.abs(n[0].x-pt.x)-Math.abs(n[0].y-pt.y),10<=Math.abs(o)&&(Re=0<o?"h":"v",Le=n)))}function N(e){if(ge.isOldAndroid){if(Ee&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(Ee),Ee=setTimeout(function(){Ee=0},600))}var t,i;y("pointerUp"),P(e,!1)&&e.preventDefault(),!le||-1<(i=f.arraySearch(ft,e.pointerId,"id"))&&(t=ft.splice(i,1)[0],navigator.msPointerEnabled?(t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type||(t.type=e.pointerType||"mouse")):t.type=e.pointerType||"mouse");var n,o=O(e),r=o.length;if("mouseup"===e.type&&(r=0),2===r)return!(Le=null);1===r&&x(ht,o[0]),0!==r||Re||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"})),y("touchRelease",e,t));var a,s,l=-1;if(0===r&&(Ie=!1,f.unbind(window,Y,m),It(),Pe?l=0:-1!==wt&&(l=v()-wt)),wt=1===r?v():-1,n=-1!==l&&l<150?"zoom":"swipe",Pe&&r<2&&(Pe=!1,1===r&&(n="zoomPointerUp"),y("zoomGestureEnded")),Le=null,ke||Te||Oe||Se)if(A(),(we=we||Mt()).calculateSwipeSpeed("x"),Se){_()<g.verticalDragRange?m.close():(a=Ue.y,s=Ne,z("verticalDrag",0,1,300,f.easing.cubic.out,function(e){Ue.y=(m.currItem.initialPosition.y-a)*e+a,b((1-s)*e+s),tt()}),y("onVerticalDrag",1))}else{if((ze||Oe)&&0===r){if(_t(n,we))return;n="zoomPointerUp"}if(!Oe)return"swipe"!==n?void Rt():void(!ze&&K>m.currItem.fitRatio&&Dt(we))}}var q,B,j,W,U,Z,Y,$,G,K,Q,V,X,J,ee,te,ie,ne,oe,re,ae,se,le,ce,ue,de,pe,he,fe,me,ge,ye,ve,be,we,xe,Se,Ee,Ie,Ce,Te,ke,Ae,ze,Le,Pe,Me,De,_e,Oe,Re,He,Fe,Ne,qe,Be,je=i(),We=i(),Ue=i(),Ze={},Ye=0,$e={},Ge=i(),Ke=0,Qe=!0,Ve=[],Xe={},Je=!1,et={},tt=function(e){_e&&(e&&(K>m.currItem.fitRatio?Je||(Jt(m.currItem,!1,!0),Je=!0):Je&&(Jt(m.currItem),Je=!1)),a(_e,Ue.x,Ue.y,K))},it=function(e){e.container&&a(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},nt=function(e,t){t[se]=V+e+"px, 0px"+X},ot=null,rt=function(){ot&&(f.unbind(document,"mousemove",rt),f.addClass(h,"pswp--has_mouse"),g.mouseUsed=!0,y("mouseUsed")),ot=setTimeout(function(){ot=null},100)},at={},st=0,lt={shout:y,listen:r,viewportSize:Ze,options:g,isMainScrollAnimating:function(){return Oe},getZoomLevel:function(){return K},getCurrentIndex:function(){return W},isDragging:function(){return Ie},isZooming:function(){return Pe},setScrollOffset:function(e,t){$e.x=e,me=$e.y=t,y("updateScrollOffset",$e)},applyZoomPan:function(e,t,i,n){Ue.x=t,Ue.y=i,K=e,tt(n)},init:function(){if(!q&&!B){var e;m.framework=f,m.template=h,m.bg=f.getChildByClass(h,"pswp__bg"),pe=h.className,q=!0,ge=f.detectFeatures(),ue=ge.raf,de=ge.caf,se=ge.transform,fe=ge.oldIE,m.scrollWrap=f.getChildByClass(h,"pswp__scroll-wrap"),m.container=f.getChildByClass(m.scrollWrap,"pswp__container"),U=m.container.style,m.itemHolders=te=[{el:m.container.children[0],wrap:0,index:-1},{el:m.container.children[1],wrap:0,index:-1},{el:m.container.children[2],wrap:0,index:-1}],te[0].el.style.display=te[2].el.style.display="none",function(){if(se){var e=ge.perspective&&!ce;return V="translate"+(e?"3d(":"("),X=ge.perspective?", 0px)":")"}se="left",f.addClass(h,"pswp--ie"),nt=function(e,t){t.left=e+"px"},it=function(e){var t=1<e.fitRatio?1:e.fitRatio,i=e.container.style,n=t*e.w,o=t*e.h;i.width=n+"px",i.height=o+"px",i.left=e.initialPosition.x+"px",i.top=e.initialPosition.y+"px"},tt=function(){var e,t,i,n,o;_e&&(e=_e,n=(i=1<(t=m.currItem).fitRatio?1:t.fitRatio)*t.w,o=i*t.h,e.width=n+"px",e.height=o+"px",e.left=Ue.x+"px",e.top=Ue.y+"px")}}(),G={resize:m.updateSize,orientationchange:function(){clearTimeout(ye),ye=setTimeout(function(){Ze.x!==m.scrollWrap.clientWidth&&m.updateSize()},500)},scroll:C,keydown:s,click:c};var t=ge.isOldIOSPhone||ge.isOldAndroid||ge.isMobileOpera;for(ge.animationName&&ge.transform&&!t||(g.showAnimationDuration=g.hideAnimationDuration=0),e=0;e<Ve.length;e++)m["init"+Ve[e]]();n&&(m.ui=new n(m,f)).init(),y("firstUpdate"),W=W||g.index||0,(isNaN(W)||W<0||W>=$t())&&(W=0),m.currItem=Yt(W),(ge.isOldIOSPhone||ge.isOldAndroid)&&(Qe=!1),h.setAttribute("aria-hidden","false"),g.modal&&(Qe?h.style.position="fixed":(h.style.position="absolute",h.style.top=f.getScrollY()+"px")),void 0===me&&(y("initialLayout"),me=he=f.getScrollY());var i="pswp--open ";for(g.mainClass&&(i+=g.mainClass+" "),g.showHideOpacity&&(i+="pswp--animate_opacity "),i+=ce?"pswp--touch":"pswp--notouch",i+=ge.animationName?" pswp--css_animation":"",i+=ge.svg?" pswp--svg":"",f.addClass(h,i),m.updateSize(),Z=-1,Ke=null,e=0;e<3;e++)nt((e+Z)*Ge.x,te[e].el.style);fe||f.bind(m.scrollWrap,$,m),r("initialZoomInEnd",function(){m.setContent(te[0],W-1),m.setContent(te[2],W+1),te[0].el.style.display=te[2].el.style.display="block",g.focus&&h.focus(),f.bind(document,"keydown",m),ge.transform&&f.bind(m.scrollWrap,"click",m),g.mouseUsed||f.bind(document,"mousemove",rt),f.bind(window,"resize scroll orientationchange",m),y("bindEvents")}),m.setContent(te[1],W),m.updateCurrItem(),y("afterInit"),Qe||(J=setInterval(function(){st||Ie||Pe||K!==m.currItem.initialZoomLevel||m.updateSize()},1e3)),f.addClass(h,"pswp--visible")}},close:function(){q&&(B=!(q=!1),y("close"),f.unbind(window,"resize scroll orientationchange",m),f.unbind(window,"scroll",G.scroll),f.unbind(document,"keydown",m),f.unbind(document,"mousemove",rt),ge.transform&&f.unbind(m.scrollWrap,"click",m),Ie&&f.unbind(window,Y,m),clearTimeout(ye),y("unbindEvents"),Gt(m.currItem,null,!0,m.destroy))},destroy:function(){y("destroy"),jt&&clearTimeout(jt),h.setAttribute("aria-hidden","true"),h.className=pe,J&&clearInterval(J),f.unbind(m.scrollWrap,$,m),f.unbind(window,"scroll",m),It(),A(),et=null},panTo:function(e,t,i){i||(e>De.min.x?e=De.min.x:e<De.max.x&&(e=De.max.x),t>De.min.y?t=De.min.y:t<De.max.y&&(t=De.max.y)),Ue.x=e,Ue.y=t,tt()},handleEvent:function(e){e=e||window.event,G[e.type]&&G[e.type](e)},goTo:function(e){var t=(e=l(e))-W;Ke=t,W=e,m.currItem=Yt(W),Ye-=t,u(Ge.x*Ye),A(),Oe=!1,m.updateCurrItem()},next:function(){m.goTo(W+1)},prev:function(){m.goTo(W-1)},updateCurrZoomItem:function(e){var t;e&&y("beforeChange",0),_e=te[1].el.children.length?(t=te[1].el.children[0],f.hasClass(t,"pswp__zoom-wrap")?t.style:null):null,De=m.currItem.bounds,Q=K=m.currItem.initialZoomLevel,Ue.x=De.center.x,Ue.y=De.center.y,e&&y("afterChange")},invalidateCurrItems:function(){ee=!0;for(var e=0;e<3;e++)te[e].item&&(te[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==Ke){var t,i=Math.abs(Ke);if(!(e&&i<2)){m.currItem=Yt(W),Je=!1,y("beforeChange",Ke),3<=i&&(Z+=Ke+(0<Ke?-3:3),i=3);for(var n,o=0;o<i;o++)0<Ke?(t=te.shift(),te[2]=t,nt((++Z+2)*Ge.x,t.el.style),m.setContent(t,W-i+o+1+1)):(t=te.pop(),te.unshift(t),nt(--Z*Ge.x,t.el.style),m.setContent(t,W+i-o-1-1));!_e||1!==Math.abs(Ke)||(n=Yt(ie)).initialZoomLevel!==K&&(Xt(n,Ze),Jt(n),it(n)),Ke=0,m.updateCurrZoomItem(),ie=W,y("afterChange")}}},updateSize:function(e){if(!Qe&&g.modal){var t=f.getScrollY();if(me!==t&&(h.style.top=t+"px",me=t),!e&&Xe.x===window.innerWidth&&Xe.y===window.innerHeight)return;Xe.x=window.innerWidth,Xe.y=window.innerHeight,h.style.height=Xe.y+"px"}if(Ze.x=m.scrollWrap.clientWidth,Ze.y=m.scrollWrap.clientHeight,C(),Ge.x=Ze.x+Math.round(Ze.x*g.spacing),Ge.y=Ze.y,u(Ge.x*Ye),y("beforeResize"),void 0!==Z){for(var i,n,o,r=0;r<3;r++)i=te[r],nt((r+Z)*Ge.x,i.el.style),o=W+r-1,g.loop&&2<$t()&&(o=l(o)),(n=Yt(o))&&(ee||n.needsUpdate||!n.bounds)?(m.cleanSlide(n),m.setContent(i,o),1===r&&(m.currItem=n,m.updateCurrZoomItem(!0)),n.needsUpdate=!1):-1===i.index&&0<=o&&m.setContent(i,o),n&&n.container&&(Xt(n,Ze),Jt(n),it(n));ee=!1}Q=K=m.currItem.initialZoomLevel,(De=m.currItem.bounds)&&(Ue.x=De.center.x,Ue.y=De.center.y,tt(!0)),y("resize")},zoomTo:function(t,e,i,n,o){e&&(Q=K,St.x=Math.abs(e.x)-Ue.x,St.y=Math.abs(e.y)-Ue.y,x(We,Ue));var r=d(t,!1),a={};p("x",r,a,t),p("y",r,a,t);var s=K,l=Ue.x,c=Ue.y;S(a);function u(e){1===e?(K=t,Ue.x=a.x,Ue.y=a.y):(K=(t-s)*e+s,Ue.x=(a.x-l)*e+l,Ue.y=(a.y-c)*e+c),o&&o(e),tt(1===e)}i?z("customZoomTo",0,1,i,n||f.easing.sine.inOut,u):u(1)}},ct={},ut={},dt={},pt={},ht={},ft=[],mt={},gt=[],yt={},vt=0,bt=i(),wt=0,xt=i(),St=i(),Et=i(),It=function(){Ae&&(de(Ae),Ae=null)},Ct=function(){Ie&&(Ae=ue(Ct),Pt())},Tt=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:Tt(e.parentNode,t))},kt={},At={},zt={},Lt=[],Pt=function(){if(Le){var e=Le.length;if(0!==e)if(x(ct,Le[0]),dt.x=ct.x-pt.x,dt.y=ct.y-pt.y,Pe&&1<e){if(pt.x=ct.x,pt.y=ct.y,!dt.x&&!dt.y&&(p=Le[1],h=ut,p.x===h.x&&p.y===h.y))return;x(ut,Le[1]),Te||(Te=!0,y("zoomGestureStarted"));var t=L(ct,ut),i=Ot(t);i>m.currItem.initialZoomLevel+m.currItem.initialZoomLevel/15&&(qe=!0);var n,o=1,r=E(),a=I();i<r?g.pinchToClose&&!qe&&Q<=m.currItem.initialZoomLevel?(b(n=1-(r-i)/(r/1.2)),y("onPinchClose",n),Fe=!0):(1<(o=(r-i)/r)&&(o=1),i=r-o*(r/3)):a<i&&(1<(o=(i-a)/(6*r))&&(o=1),i=a+o*r),o<0&&(o=0),D(ct,ut,bt),je.x+=bt.x-Et.x,je.y+=bt.y-Et.y,x(Et,bt),Ue.x=w("x",i),Ue.y=w("y",i),xe=K<i,K=i,tt()}else{if(!Re)return;if(He&&(He=!1,10<=Math.abs(dt.x)&&(dt.x-=Le[0].x-ht.x),10<=Math.abs(dt.y)&&(dt.y-=Le[0].y-ht.y)),pt.x=ct.x,pt.y=ct.y,0===dt.x&&0===dt.y)return;if("v"===Re&&g.closeOnVerticalDrag&&"fit"===g.scaleMode&&K===m.currItem.initialZoomLevel){je.y+=dt.y,Ue.y+=dt.y;var s=_();return Se=!0,y("onVerticalDrag",s),b(s),void tt()}l=v(),c=ct.x,u=ct.y,50<l-be&&((d=2<gt.length?gt.shift():{}).x=c,d.y=u,gt.push(d),be=l),ke=!0,De=m.currItem.bounds,R("x",dt)||(R("y",dt),S(Ue),tt())}}var l,c,u,d,p,h},Mt=function(){var t,i,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){i=1<gt.length?(t=v()-be+50,gt[gt.length-2][e]):(t=v()-ve,ht[e]),n.lastFlickOffset[e]=pt[e]-i,n.lastFlickDist[e]=Math.abs(n.lastFlickOffset[e]),20<n.lastFlickDist[e]?n.lastFlickSpeed[e]=n.lastFlickOffset[e]/t:n.lastFlickSpeed[e]=0,Math.abs(n.lastFlickSpeed[e])<.1&&(n.lastFlickSpeed[e]=0),n.slowDownRatio[e]=.95,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatio[e]=1},calculateOverBoundsAnimOffset:function(t,e){n.backAnimStarted[t]||(Ue[t]>De.min[t]?n.backAnimDestination[t]=De.min[t]:Ue[t]<De.max[t]&&(n.backAnimDestination[t]=De.max[t]),void 0!==n.backAnimDestination[t]&&(n.slowDownRatio[t]=.7,n.slowDownRatioReverse[t]=1-n.slowDownRatio[t],n.speedDecelerationRatioAbs[t]<.05&&(n.lastFlickSpeed[t]=0,n.backAnimStarted[t]=!0,z("bounceZoomPan"+t,Ue[t],n.backAnimDestination[t],e||300,f.easing.sine.out,function(e){Ue[t]=e,tt()}))))},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,Ue[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(at.zoomPan&&(at.zoomPan.raf=ue(n.panAnimLoop),n.now=v(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),tt(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return Ue.x=Math.round(Ue.x),Ue.y=Math.round(Ue.y),tt(),void T("zoomPan")}};return n},Dt=function(e){return e.calculateSwipeSpeed("y"),De=m.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05?(e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0):(k("zoomPan"),e.lastNow=v(),void e.panAnimLoop())},_t=function(e,t){var i,n,o,r,a;Oe||(vt=W),"swipe"===e&&(o=pt.x-ht.x,r=t.lastFlickDist.x<10,30<o&&(r||20<t.lastFlickOffset.x)?n=-1:o<-30&&(r||t.lastFlickOffset.x<-20)&&(n=1)),n&&((W+=n)<0?(W=g.loop?$t()-1:0,a=!0):W>=$t()&&(W=g.loop?0:$t()-1,a=!0),a&&!g.loop||(Ke+=n,Ye-=n,i=!0));var s=Ge.x*Ye,l=Math.abs(s-xt.x),c=i||s>xt.x==0<t.lastFlickSpeed.x?(c=0<Math.abs(t.lastFlickSpeed.x)?l/Math.abs(t.lastFlickSpeed.x):333,c=Math.min(c,400),Math.max(c,250)):333;return vt===W&&(i=!1),Oe=!0,y("mainScrollAnimStart"),z("mainScroll",xt.x,s,c,f.easing.cubic.out,u,function(){A(),Oe=!1,vt=-1,!i&&vt===W||m.updateCurrItem(),y("mainScrollAnimComplete")}),i&&m.updateCurrItem(!0),i},Ot=function(e){return 1/Me*e*Q},Rt=function(){var e=K,t=E(),i=I();K<t?e=t:i<K&&(e=i);var n,o=Ne;return Fe&&!xe&&!qe&&K<t?m.close():(Fe&&(n=function(e){b((1-o)*e+o)}),m.zoomTo(e,0,200,f.easing.cubic.out,n)),!0};o("Gestures",{publicMethods:{initGestures:function(){function e(e,t,i,n,o){ne=e+t,oe=e+i,re=e+n,ae=o?e+o:""}(le=ge.pointerEvent)&&ge.touch&&(ge.touch=!1),le?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):ge.touch?(e("touch","start","move","end","cancel"),ce=!0):e("mouse","down","move","up"),Y=oe+" "+re+" "+ae,$=ne,le&&!ce&&(ce=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),m.likelyTouchDevice=ce,G[ne]=H,G[oe]=F,G[re]=N,ae&&(G[ae]=G[re]),ge.touch&&($+=" mousedown",Y+=" mousemove mouseup",G.mousedown=G[ne],G.mousemove=G[oe],G.mouseup=G[re]),ce||(g.allowPanToNext=!1)}}});function Ht(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}}function Ft(e,t,i,n,o,r){t.loadError||n&&(t.imageAppended=!0,Jt(t,n,t===m.currItem&&Je),i.appendChild(n),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))}function Nt(e){function t(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,i.onload=i.onerror=null,i=null}e.loading=!0,e.loaded=!1;var i=e.img=f.createEl("pswp__img","img");return i.onload=t,i.onerror=function(){e.loadError=!0,t()},i.src=e.src,i}function qt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=g.errorMsg.replace("%url%",e.src),1)}function Bt(){if(Qt.length){for(var e,t=0;t<Qt.length;t++)(e=Qt[t]).holder.index===e.index&&Ft(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Qt=[]}}var jt,Wt,Ut,Zt,Yt,$t,Gt=function(a,e,s,t){var l;jt&&clearTimeout(jt),Ut=Zt=!0,a.initialLayout?(l=a.initialLayout,a.initialLayout=null):l=g.getThumbBoundsFn&&g.getThumbBoundsFn(W);function c(){T("initialZoom"),s?(m.template.removeAttribute("style"),m.bg.removeAttribute("style")):(b(1),e&&(e.style.display="block"),f.addClass(h,"pswp--animated-in"),y("initialZoom"+(s?"OutEnd":"InEnd"))),t&&t(),Zt=!1}var u=s?g.hideAnimationDuration:g.showAnimationDuration;if(!u||!l||void 0===l.x)return y("initialZoom"+(s?"Out":"In")),K=a.initialZoomLevel,x(Ue,a.initialPosition),tt(),h.style.opacity=s?0:1,b(1),void(u?setTimeout(function(){c()},u):c());var d,p;d=j,p=!m.currItem.src||m.currItem.loadError||g.showHideOpacity,a.miniImg&&(a.miniImg.style.webkitBackfaceVisibility="hidden"),s||(K=l.w/a.w,Ue.x=l.x,Ue.y=l.y-he,m[p?"template":"bg"].style.opacity=.001,tt()),k("initialZoom"),s&&!d&&f.removeClass(h,"pswp--animated-in"),p&&(s?f[(d?"remove":"add")+"Class"](h,"pswp--animate_opacity"):setTimeout(function(){f.addClass(h,"pswp--animate_opacity")},30)),jt=setTimeout(function(){var t,i,n,o,r,e;y("initialZoom"+(s?"Out":"In")),s?(t=l.w/a.w,i=Ue.x,n=Ue.y,o=K,r=Ne,e=function(e){1===e?(K=t,Ue.x=l.x,Ue.y=l.y-me):(K=(t-o)*e+o,Ue.x=(l.x-i)*e+i,Ue.y=(l.y-me-n)*e+n),tt(),p?h.style.opacity=1-e:b(r-e*r)},d?z("initialZoom",0,1,u,f.easing.cubic.out,e,c):(e(1),jt=setTimeout(c,u+20))):(K=a.initialZoomLevel,x(Ue,a.initialPosition),tt(),b(1),p?h.style.opacity=1:b(1),jt=setTimeout(c,u+20))},s?25:90)},Kt={},Qt=[],Vt={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 Wt.length}},Xt=function(e,t,i){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Ht(),e.initialPosition=e.bounds.center,e.bounds;var n,o,r,a,s,l,c,u=!i;return u&&(e.vGap||(e.vGap={top:0,bottom:0}),y("parseVerticalMargin",e)),Kt.x=t.x,Kt.y=t.y-e.vGap.top-e.vGap.bottom,u&&(s=Kt.x/e.w,l=Kt.y/e.h,e.fitRatio=s<l?s:l,"orig"===(c=g.scaleMode)?i=1:"fit"===c&&(i=e.fitRatio),1<i&&(i=1),e.initialZoomLevel=i,e.bounds||(e.bounds=Ht())),i?(o=(n=e).w*i,r=e.h*i,(a=n.bounds).center.x=Math.round((Kt.x-o)/2),a.center.y=Math.round((Kt.y-r)/2)+n.vGap.top,a.max.x=o>Kt.x?Math.round(Kt.x-o):a.center.x,a.max.y=r>Kt.y?Math.round(Kt.y-r)+n.vGap.top:a.center.y,a.min.x=o>Kt.x?0:a.center.x,a.min.y=r>Kt.y?n.vGap.top:a.center.y,u&&i===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Jt=function(e,t,i){var n,o;e.src&&(t=t||e.container.lastChild,n=i?e.w:Math.round(e.w*e.fitRatio),o=i?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=n+"px",e.placeholder.style.height=o+"px"),t.style.width=n+"px",t.style.height=o+"px")};o("Controller",{publicMethods:{lazyLoadItem:function(e){e=l(e);var t=Yt(e);t&&(!t.loaded&&!t.loading||ee)&&(y("gettingData",e,t),t.src&&Nt(t))},initController:function(){f.extend(g,Vt,!0),m.items=Wt=e,Yt=m.getItemAt,$t=g.getNumItemsFn,g.loop,$t()<3&&(g.loop=!1),r("beforeChange",function(e){for(var t=g.preload,i=null===e||0<=e,n=Math.min(t[0],$t()),o=Math.min(t[1],$t()),r=1;r<=(i?o:n);r++)m.lazyLoadItem(W+r);for(r=1;r<=(i?n:o);r++)m.lazyLoadItem(W-r)}),r("initialLayout",function(){m.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(W)}),r("mainScrollAnimComplete",Bt),r("initialZoomInEnd",Bt),r("destroy",function(){for(var e,t=0;t<Wt.length;t++)(e=Wt[t]).container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);Qt=null})},getItemAt:function(e){return 0<=e&&void 0!==Wt[e]&&Wt[e]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!ce||g.mouseUsed||1200<screen.width},setContent:function(t,i){g.loop&&(i=l(i));var e=m.getItemAt(t.index);e&&(e.container=null);var n,o,r,a,s=m.getItemAt(i);s?(y("gettingData",i,s),t.index=i,o=(t.item=s).container=f.createEl("pswp__zoom-wrap"),!s.src&&s.html&&(s.html.tagName?o.appendChild(s.html):o.innerHTML=s.html),qt(s),Xt(s,Ze),!s.src||s.loadError||s.loaded?s.src&&!s.loadError&&((n=f.createEl("pswp__img","img")).style.opacity=1,n.src=s.src,Jt(s,n),Ft(0,s,o,n)):(s.loadComplete=function(e){if(q){if(t&&t.index===i){if(qt(e,!0))return e.loadComplete=e.img=null,Xt(e,Ze),it(e),void(t.index===W&&m.updateCurrZoomItem());e.imageAppended?!Zt&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):ge.transform&&(Oe||Zt)?Qt.push({item:e,baseDiv:o,img:e.img,index:i,holder:t,clearPlaceholder:!0}):Ft(0,e,o,e.img,0,!0)}e.loadComplete=null,e.img=null,y("imageLoadComplete",i,e)}},f.features.transform&&(r="pswp__img pswp__img--placeholder",r+=s.msrc?"":" pswp__img--placeholder--blank",a=f.createEl(r,s.msrc?"img":""),s.msrc&&(a.src=s.msrc),Jt(s,a),o.appendChild(a),s.placeholder=a),s.loading||Nt(s),m.allowProgressiveImg()&&(!Ut&&ge.transform?Qt.push({item:s,baseDiv:o,img:s.img,index:i,holder:t}):Ft(0,s,o,s.img,0,!0))),Ut||i!==W?it(s):(_e=o.style,Gt(s,n||s.img)),t.el.innerHTML="",t.el.appendChild(o)):t.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});function ei(e,t,i){var n=document.createEvent("CustomEvent"),o={origEvent:e,target:e.target,releasePoint:t,pointerType:i||"touch"};n.initCustomEvent("pswpTap",!0,!0,o),e.target.dispatchEvent(n)}var ti,ii,ni={};o("Tap",{publicMethods:{initTap:function(){r("firstTouchStart",m.onTapStart),r("touchRelease",m.onTapRelease),r("destroy",function(){ni={},ti=null})},onTapStart:function(e){1<e.length&&(clearTimeout(ti),ti=null)},onTapRelease:function(e,t){if(t&&!ke&&!Ce&&!st){var i=t;if(ti&&(clearTimeout(ti),ti=null,n=i,o=ni,Math.abs(n.x-o.x)<25&&Math.abs(n.y-o.y)<25))return void y("doubleTap",i);if("mouse"===t.type)return void ei(e,t,"mouse");if("BUTTON"===e.target.tagName.toUpperCase()||f.hasClass(e.target,"pswp__single-tap"))return void ei(e,t);x(ni,i),ti=setTimeout(function(){ei(e,t),ti=null},300)}var n,o}}}),o("DesktopZoom",{publicMethods:{initDesktopZoom:function(){fe||(ce?r("mouseUsed",function(){m.setupDesktopZoom()}):m.setupDesktopZoom(!0))},setupDesktopZoom:function(e){ii={};var t="wheel mousewheel DOMMouseScroll";r("bindEvents",function(){f.bind(h,t,m.handleMouseWheel)}),r("unbindEvents",function(){ii&&f.unbind(h,t,m.handleMouseWheel)}),m.mouseZoomedIn=!1;function i(){m.mouseZoomedIn&&(f.removeClass(h,"pswp--zoomed-in"),m.mouseZoomedIn=!1),K<1?f.addClass(h,"pswp--zoom-allowed"):f.removeClass(h,"pswp--zoom-allowed"),o()}var n,o=function(){n&&(f.removeClass(h,"pswp--dragging"),n=!1)};r("resize",i),r("afterChange",i),r("pointerDown",function(){m.mouseZoomedIn&&(n=!0,f.addClass(h,"pswp--dragging"))}),r("pointerUp",o),e||i()},handleMouseWheel:function(e){if(K<=m.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||st||Ie?e.preventDefault():se&&2<Math.abs(e.deltaY)&&(j=!0,m.close())),!0;if(e.stopPropagation(),ii.x=0,"deltaX"in e)1===e.deltaMode?(ii.x=18*e.deltaX,ii.y=18*e.deltaY):(ii.x=e.deltaX,ii.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(ii.x=-.16*e.wheelDeltaX),e.wheelDeltaY?ii.y=-.16*e.wheelDeltaY:ii.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;ii.y=e.detail}d(K,!0);var t=Ue.x-ii.x,i=Ue.y-ii.y;(g.modal||t<=De.min.x&&t>=De.max.x&&i<=De.min.y&&i>=De.max.y)&&e.preventDefault(),m.panTo(t,i)},toggleDesktopZoom:function(e){e=e||{x:Ze.x/2+$e.x,y:Ze.y/2+$e.y};var t=g.getDoubleTapZoom(!0,m.currItem),i=K===t;m.mouseZoomedIn=!i,m.zoomTo(i?m.currItem.initialZoomLevel:t,e,333),f[(i?"remove":"add")+"Class"](h,"pswp--zoomed-in")}}});function oi(){return yi.hash.substring(1)}function ri(){si&&clearTimeout(si),ci&&clearTimeout(ci)}function ai(){var e=oi(),t={};if(e.length<5)return t;var i,n=e.split("&");for(r=0;r<n.length;r++){n[r]&&((i=n[r].split("=")).length<2||(t[i[0]]=i[1]))}if(g.galleryPIDs){for(var o=t.pid,r=t.pid=0;r<Wt.length;r++)if(Wt[r].pid===o){t.pid=r;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t}var si,li,ci,ui,di,pi,hi,fi,mi,gi,yi,vi,bi={history:!0,galleryUID:1},wi=function(){var e,t,i,n;ci&&clearTimeout(ci),st||Ie?ci=setTimeout(wi,500):(ui?clearTimeout(li):ui=!0,e=W+1,(t=Yt(W)).hasOwnProperty("pid")&&(e=t.pid),i=hi+"&gid="+g.galleryUID+"&pid="+e,fi||-1===yi.hash.indexOf(i)&&(gi=!0),n=yi.href.split("#")[0]+"#"+i,vi?"#"+i!==window.location.hash&&history[fi?"replaceState":"pushState"]("",document.title,n):fi?yi.replace(n):yi.hash=i,fi=!0,li=setTimeout(function(){ui=!1},60))};o("History",{publicMethods:{initHistory:function(){var e,t;f.extend(g,bi,!0),g.history&&(yi=window.location,fi=mi=gi=!1,hi=oi(),vi="pushState"in history,-1<hi.indexOf("gid=")&&(hi=(hi=hi.split("&gid=")[0]).split("?gid=")[0]),r("afterChange",m.updateURL),r("unbindEvents",function(){f.unbind(window,"hashchange",m.onHashChange)}),e=function(){pi=!0,mi||(gi?history.back():hi?yi.hash=hi:vi?history.pushState("",document.title,yi.pathname+yi.search):yi.hash=""),ri()},r("unbindEvents",function(){j&&e()}),r("destroy",function(){pi||e()}),r("firstUpdate",function(){W=ai().pid}),-1<(t=hi.indexOf("pid="))&&("&"===(hi=hi.substring(0,t)).slice(-1)&&(hi=hi.slice(0,-1))),setTimeout(function(){q&&f.bind(window,"hashchange",m.onHashChange)},40))},onHashChange:function(){return oi()===hi?(mi=!0,void m.close()):void(ui||(di=!0,m.goTo(ai().pid),di=!1))},updateURL:function(){ri(),di||(fi?si=setTimeout(wi,800):wi())}}}),f.extend(m,lt)}}),function(x){x.fn.theiaStickySidebar=function(e){var t,i;function n(e,t){return!0===e.initialized||!(x("body").width()<e.minWidth)&&(i=t,(b=e).initialized=!0,x("head").append(x('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),i.each(function(){var i,e={};e.sidebar=x(this),e.options=b||{},e.container=x(e.options.containerSelector),0==e.container.length&&(e.container=e.sidebar.parent()),e.sidebar.parents().css("-webkit-transform","none"),e.sidebar.css({position:"relative",overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),e.stickySidebar=e.sidebar.find(".theiaStickySidebar"),0==e.stickySidebar.length&&(i=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i,e.sidebar.find("script").filter(function(e,t){return 0===t.type.length||t.type.match(i)}).remove(),e.stickySidebar=x("<div>").addClass("theiaStickySidebar").append(e.sidebar.children()),e.sidebar.append(e.stickySidebar)),e.marginBottom=parseInt(e.sidebar.css("margin-bottom")),e.paddingTop=parseInt(e.sidebar.css("padding-top")),e.paddingBottom=parseInt(e.sidebar.css("padding-bottom"));var t,n,o=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight();function v(){e.fixedScrollTop=0,e.sidebar.css({"min-height":"1px"}),e.stickySidebar.css({position:"static",width:"",transform:"none"})}e.stickySidebar.css("padding-top",1),e.stickySidebar.css("padding-bottom",1),o-=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight()-r-o,0==o?(e.stickySidebar.css("padding-top",0),e.stickySidebarPaddingTop=0):e.stickySidebarPaddingTop=1,0==r?(e.stickySidebar.css("padding-bottom",0),e.stickySidebarPaddingBottom=0):e.stickySidebarPaddingBottom=1,e.previousScrollTop=null,e.fixedScrollTop=0,v(),e.onScroll=function(e){if(e.stickySidebar.is(":visible"))if(x("body").width()<e.options.minWidth)v();else{if(e.options.disableOnResponsiveLayouts)if(e.sidebar.outerWidth("none"==e.sidebar.css("float"))+50>e.container.width())return void v();var t,i,n,o,r,a,s,l,c,u,d,p,h,f,m,g=x(document).scrollTop(),y="static";g>=e.sidebar.offset().top+(e.paddingTop-e.options.additionalMarginTop)&&(t=e.paddingTop+b.additionalMarginTop,i=e.paddingBottom+e.marginBottom+b.additionalMarginBottom,n=e.sidebar.offset().top,o=e.sidebar.offset().top+(p=e.container,h=p.height(),p.children().each(function(){h=Math.max(h,x(this).height())}),h),r=0+b.additionalMarginTop,a=e.stickySidebar.outerHeight()+t+i<x(window).height()?r+e.stickySidebar.outerHeight():x(window).height()-e.marginBottom-e.paddingBottom-b.additionalMarginBottom,s=n-g+e.paddingTop,l=o-g-e.paddingBottom-e.marginBottom,c=e.stickySidebar.offset().top-g,u=e.previousScrollTop-g,"fixed"==e.stickySidebar.css("position")&&"modern"==e.options.sidebarBehavior&&(c+=u),"stick-to-top"==e.options.sidebarBehavior&&(c=b.additionalMarginTop),"stick-to-bottom"==e.options.sidebarBehavior&&(c=a-e.stickySidebar.outerHeight()),c=0<u?Math.min(c,r):Math.max(c,a-e.stickySidebar.outerHeight()),c=Math.max(c,s),c=Math.min(c,l-e.stickySidebar.outerHeight()),y=((d=e.container.height()==e.stickySidebar.outerHeight())||c!=r)&&(d||c!=a-e.stickySidebar.outerHeight())?g+c-e.sidebar.offset().top-e.paddingTop<=b.additionalMarginTop?"static":"absolute":"fixed"),"fixed"==y?(f=x(document).scrollLeft(),e.stickySidebar.css({position:"fixed",width:w(e.stickySidebar)+"px",transform:"translateY("+c+"px)",left:e.sidebar.offset().left+parseInt(e.sidebar.css("padding-left"))-f+"px",top:"0px"})):"absolute"==y?(m={},"absolute"!=e.stickySidebar.css("position")&&(m.position="absolute",m.transform="translateY("+(g+c-e.sidebar.offset().top-e.stickySidebarPaddingTop-e.stickySidebarPaddingBottom)+"px)",m.top="0px"),m.width=w(e.stickySidebar)+"px",m.left="",e.stickySidebar.css(m)):"static"==y&&v(),"static"!=y&&1==e.options.updateSidebarHeight&&e.sidebar.css({"min-height":e.stickySidebar.outerHeight()+e.stickySidebar.offset().top-e.sidebar.offset().top+e.paddingBottom}),e.previousScrollTop=g}},e.onScroll(e),x(document).scroll((t=e,function(){t.onScroll(t)})),x(window).resize((n=e,function(){n.stickySidebar.css({position:"static"}),n.onScroll(n)}))}),!0);var b,i}function w(e){var t;try{t=e[0].getBoundingClientRect().width}catch(e){}return void 0===t&&(t=e.width()),t}(e=x.extend({containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0,disableOnResponsiveLayouts:!0,sidebarBehavior:"modern"},e)).additionalMarginTop=parseInt(e.additionalMarginTop)||0,e.additionalMarginBottom=parseInt(e.additionalMarginBottom)||0,n(t=e,i=this)||(console.log("TSS: Body width smaller than options.minWidth. Init is delayed."),x(document).scroll(function(t,i){return function(e){n(t,i)&&x(this).unbind(e)}}(t,i)),x(window).resize(function(t,i){return function(e){n(t,i)&&x(this).unbind(e)}}(t,i)))}}(jQuery);var body=$("body");function author(){"use strict";$(".author-name").on("click",function(){$(this).next(".author-social").toggleClass("enabled")})}function stickySidebar(){"use strict";jQuery(".sidebar-column, .related-column").theiaStickySidebar({additionalMarginTop:30,additionalMarginBottom:30})}function pagination(){"use strict";var e=$(".post-feed .row"),n=$(".infinite-scroll-button");body.hasClass("paged-next")&&(e.on("request.infiniteScroll",function(e,t){n.hide()}),e.on("load.infiniteScroll",function(e,t,i){$(t).find("body").hasClass("paged-next")&&n.show()}),e.infiniteScroll({append:".post-column",button:".infinite-scroll-button",debug:!1,hideNav:".pagination",history:!1,path:".pagination .older-posts",scrollThreshold:!1,status:".infinite-scroll-status"}))}function facebook(){"use strict";var e=$(".widget-facebook");"__YOUR_FACEBOOK_PAGE_URL__"==e.find(".fb-page").attr("data-href")&&e.remove()}function video(){"use strict";$(".post-content").fitVids()}function gallery(){"use strict";document.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),i=e.attributes.width.value/e.attributes.height.value;t.style.flex=i+" 1 0%"}),pswp(".kg-gallery-container",".kg-gallery-image",".kg-gallery-image",!1,!0),pswp(".kg-image-card",".kg-image",".kg-image",!1,!1)}function offCanvas(){"use strict";$(".burger:not(.burger.close)").on("click",function(){body.addClass("canvas-visible canvas-opened"),dimmer("open","medium")}),$(".burger-close").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))}),$(".dimmer").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))})}function pswp(n,s,l,c,u){function o(e,t){var n,i,o,r,a=document.querySelectorAll(".pswp")[0];r=[],$(t).find(s).each(function(e,t){i=$(t),i.find(l),o={src:u?i.find("img").attr("src"):i.attr("src"),w:0,h:0},c&&i.find(c).length&&(o.title=i.find(c).html()),r.push(o)}),(n=new PhotoSwipe(a,PhotoSwipeUI_Default,r,{closeOnScroll:!1,history:!1,index:e,shareEl:!1,showAnimationDuration:0,showHideOpacity:!0})).listen("gettingData",function(e,t){var i;(t.w<1||t.h<1)&&((i=new Image).onload=function(){t.w=this.width,t.h=this.height,n.updateSize(!0)},i.src=t.src)}),n.init()}$(n).on("click",l,function(e){!function(e){e.preventDefault();var t=$(e.target).closest(n).find(s).index($(e.target).closest(s)),i=$(e.target).closest(n);o(t,i[0])}(e)})}function dimmer(e,t){"use strict";var i=$(".dimmer");switch(e){case"open":i.fadeIn(t);break;case"close":i.fadeOut(t)}}window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.loadHidden=!1,$(function(){"use strict";author(),stickySidebar(),pagination(),facebook(),video(),gallery(),offCanvas()});
|
|
//# sourceMappingURL=main.min.js.map
|