Ghost_Ruby_Theme/assets/built/main.min.js
2021-11-29 16:33:35 +08:00

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(l,c,u){(u=u||t||e.jQuery)&&(c.prototype.option||(c.prototype.option=function(e){u.isPlainObject(e)&&(this.options=u.extend(!0,this.options,e))}),u.fn[l]=function(e){if("string"!=typeof e)return a=e,this.each(function(e,t){var i=u.data(t,l);i?(i.option(a),i._init()):(i=new c(t,a),u.data(t,l,i))}),this;var n,o,r,s,a,t=d.call(arguments,1);return o=t,s="$()."+l+'("'+(n=e)+'")',(e=this).each(function(e,t){var i=u.data(t,l);i?(t=i[n])&&"_"!=n.charAt(0)?(i=t.apply(i,o),r=void 0===r?i:r):p(s+" is not a valid method"):p(l+" not initialized. Cannot call methods, i.e. "+s)}),void 0!==r?r:e},n(u))}function n(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||{},e=i[e]=i[e]||[];return-1==e.indexOf(t)&&e.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){e=this._events&&this._events[e];if(e&&e.length){t=e.indexOf(t);return-1!=t&&e.splice(t,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(i,r){var l={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;l.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?t.call(e):[e]},l.removeFrom=function(e,t){t=e.indexOf(t);-1!=t&&e.splice(t,1)},l.getParent=function(e,t){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,r(e,t))return e},l.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},l.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.filterFindElements=function(e,n){e=l.makeArray(e);var o=[];return e.forEach(function(e){if(e instanceof HTMLElement)if(n){r(e,n)&&o.push(e);for(var t=e.querySelectorAll(n),i=0;i<t.length;i++)o.push(t[i])}else o.push(e)}),o},l.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)}},l.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},l.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,i){return t+"-"+i}).toLowerCase()};var c=i.console;return l.htmlInit=function(s,a){l.docReady(function(){var e=l.toDashed(a),n="data-"+e,t=document.querySelectorAll("["+n+"]"),e=document.querySelectorAll(".js-"+e),e=l.makeArray(t).concat(l.makeArray(e)),o=n+"-options",r=i.jQuery;e.forEach(function(t){var e=t.getAttribute(n)||t.getAttribute(o);try{i=e&&JSON.parse(e)}catch(e){return void(c&&c.error("Error parsing "+n+" on "+t.className+": "+e))}var i=new s(t,i);r&&r.data(t,a,i)})})},l}),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=a[e.infiniteScrollGUID];return n.option(t),n}this.element=e,this.options=o.extend({},r.defaults),this.option(t),s&&(this.$element=s(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(i||e))}var s=t.jQuery,a={};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,(a[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=t?[t].concat(i):i;this.emitEvent(e,n),s&&this.$element&&(n=e+=".infiniteScroll",t&&((t=s.Event(t)).type=e,n=t),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;this.options.debug&&(i="[InfiniteScroll] "+e,(e=l[e])&&(i+=". "+e.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?)"),e=new RegExp(e),e=location.href.match(e);e&&(this.pageIndex=parseInt(e[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=t.getAttribute("href"),o=0;n&&o<c.length;o++){var r=n.match(c[o]);if(r){i=r.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: "+n)}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 a[this.guid],s&&this.$element&&s.removeData(this.element,"infiniteScroll")},r.throttle=function(n,o){var r,s;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(s),s=setTimeout(i,o)):i()}},r.data=function(e){e=(e=o.getQueryElement(e))&&e.infiniteScrollGUID;return e&&a[e]},r.setJQuery=function(e){s=e},o.htmlInit(r,"infinite-scroll"),i._init=function(){},s&&s.bridget&&s.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 r(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,s,a,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,s=e,a=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?s(c.response):204==c.status?l(c.response):(e=new Error(c.statusText),a(e))},c.onerror=function(){var e=new Error("Network error requesting "+o);a(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=this.options.append;"document"==this.options.responseType&&o&&(i=e.querySelectorAll(o),n=r(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||r(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(){var e;this.options.prefill&&((e=this.options.append)?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error("append option required for prefill. Set as :"+e))},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(t,e,i){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){e=e?"addEventListener":"removeEventListener";this.scroller[e]("scroll",this.pageScrollHandler),t[e]("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-(t.pageYOffset+this.windowHeight)},n.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},n.onResize=function(){this.updateMeasurements()},i.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(t,e,i){var n=e.prototype;e.defaults.history="replace";var o=document.createElement("a");return e.create.history=function(){if(this.options.history)return o.href=this.getAbsolutePath(),(o.origin||o.protocol+"//"+o.host)==location.origin?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+o.origin+" on "+location.origin+" . History behavior disabled.")},n.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)},n.bindHistoryAppendEvents=function(e){e=e?"addEventListener":"removeEventListener";this.scroller[e]("scroll",this.scrollHistoryHandler),t[e]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(e,t,i){i&&i.length&&(i=i[0],i=this.getElementScrollY(i),o.href=t,this.scrollPages.push({top:i,path:o.href,title:e.title}))},n.getElementScrollY=function(e){return this.options.elementScroll?this.getElementElementScrollY(e):this.getElementWindowScrollY(e)},n.getElementWindowScrollY=function(e){return e.getBoundingClientRect().top+t.pageYOffset},n.getElementElementScrollY=function(e){return e.offsetTop-this.top},n.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))},i.debounceMethod(e,"onScrollHistory",150),n.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.pageYOffset+this.windowHeight/2},n.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]))},n.onUnload=function(){var e=this.scrollPageIndex;0!==e&&(e=this.scrollPages[e],e=t.pageYOffset-e.top+this.top,this.destroyHistory(),scrollTo(0,e))},n.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 s=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"))},s.bindHideStatus=function(e){var t=this.options.append?"append":"load";this[e](t,this.hideAllStatus)},s.showRequestStatus=function(){this.showStatus("request")},s.showErrorStatus=function(){this.showStatus("error")},s.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},s.showStatus=function(e){o(this.statusElement),this.hideStatusEventElements(),o(this.statusEventElements[e])},s.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},s.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 s(e,t,i){if(!(this instanceof s))return new s(e,t,i);var n,o=e;return(o="string"==typeof e?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(),a&&(this.jqDeferred=new a.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 a=t.jQuery,l=t.console,c=Array.prototype.slice;(s.prototype=Object.create(e.prototype)).options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.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 s=r[n];this.addElementBackgroundImages(s)}}};var u={1:!0,9:!0,11:!0};return s.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)}},s.prototype.addImage=function(e){e=new i(e);this.images.push(e)},s.prototype.addBackground=function(e,t){t=new n(e,t);this.images.push(t)},s.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()},s.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)},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0,this.emitEvent(e,[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])},(s.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((a=e).fn.imagesLoaded=function(e,t){return new s(this,e,t).jqDeferred.promise(a(this))})})(),s}),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);e=r(this).find(e.join(","));(e=(e=e.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(a,R){"use strict";if(R.getElementsByClassName){var H,F,N=R.documentElement,l=a.Date,n=a.HTMLPictureElement,c="addEventListener",B="getAttribute",u=a[c],q=a.setTimeout,d=a.requestAnimationFrame||q,p=a.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[B]("class")||"")&&i[t]},Z=function(e,t){U(e,t)||e.setAttribute("class",(e[B]("class")||"").trim()+" "+t)},Y=function(e,t){var i;(i=U(e,t))&&e.setAttribute("class",(e[B]("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=a.picturefill||F.pf)?(t&&t.src&&!e[B]("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]},s=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,s=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?q:d)(s)))};return e._lsFlush=s,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()},s=p&&r>49?function(){p(t,{timeout:r}),r!==F.ricTimeout&&(r=F.ricTimeout)}:X(function(){q(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?s():q(s,t))}},ee=function(e){var t,i,n=99,o=function(){t=null,e()},r=function(){var e=l.now()-i;e<n?q(r,n-e):(p||o)(o)};return function(){i=l.now(),t||(t=q(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=a.lazySizesConfig||a.lazysizesConfig||{};for(e in t)e in F||(F[e]=t[e]);a.lazySizesConfig=F,q(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 a&&!/(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,s,a,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((a=p[t][B]("data-expand"))&&(r=1*a)||(r=C),l!==r&&(g=innerWidth+r*d,y=innerHeight+r,s=-1*r,l=r),i=p[t].getBoundingClientRect(),(x=i.bottom)>=s&&(v=i.top)<=y&&(w=i.right)>=s*d&&(b=i.left)<=g&&(x||w||b||v)&&(F.loadHidden||z(p[t]))&&(f&&T<3&&!a&&(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]||!a&&(x||w||b||v||"auto"!=p[t][B](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[B](F.srcsetAttr);(t=F.customMedia[e[B]("data-media")||e[B]("media")])&&e.setAttribute("media",t),i&&e.setAttribute("srcset",i)},s=X(function(e,t,i,n,o){var r,s,a,l,c,u;(c=G(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(i?Z(e,F.autosizesClass):e.setAttribute("sizes",n)),s=e[B](F.srcsetAttr),r=e[B](F.srcAttr),o&&(a=e.parentNode,l=a&&j.test(a.nodeName||"")),u=t.firesLoad||"src"in e&&(s||r||l),c={target:e},u&&($(e,A,!0),clearTimeout(d),d=q(A,2500),Z(e,F.loadingClass),$(e,M,!0)),l&&W.call(a.getElementsByTagName("source"),_),s?e.setAttribute("srcset",s):r&&!l&&(p.test(e.nodeName)?D(e,r):e.src=r),o&&(s||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[B](F.sizesAttr)||e[B]("sizes")),o="auto"==n;(!o&&f||!i||!e[B]("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++,s(e,t,o,n,i))},o=function(){if(!f){if(l.now()-t<999)return void q(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),a.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),q(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,s;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),j.test(t.nodeName||""))for(o=t.getElementsByTagName("source"),r=0,s=o.length;r<s;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=s(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:s,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(n,a){function e(e){if(k)return!0;e=e||window.event,T.timeToIdle&&T.mouseUsed&&!w&&s();for(var t,i,n=(e.target||e.srcElement).getAttribute("class")||"",o=0;o<F.length;o++)(t=F[o]).onTap&&-1<n.indexOf("pswp__"+t.name)&&(t.onTap(),i=!0);i&&(e.stopPropagation&&e.stopPropagation(),k=!0,e=a.features.isOldAndroid?600:30,setTimeout(function(){k=!1},e))}function i(){var e=1===T.getNumItemsFn();e!==C&&(O(h,"ui--one-slide",e),C=e)}function t(){O(v,"share-modal--hidden",D)}function o(){return(D=!D)?(a.removeClass(v,"pswp__share-modal--fade-in"),setTimeout(function(){D&&t()},300)):(t(),setTimeout(function(){D||a.addClass(v,"pswp__share-modal--fade-in")},30)),D||function(){for(var e,t,i,n,o,r="",s=0;s<T.shareButtons.length;s++)e=T.shareButtons[s],i=T.getImageURLForShare(e),n=T.getPageURLForShare(e),o=T.getTextForShare(e),r+='<a href="'+(t=e.url.replace("{{url}}",encodeURIComponent(n)).replace("{{image_url}}",encodeURIComponent(i)).replace("{{raw_image_url}}",i).replace("{{text}}",encodeURIComponent(o)))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",T.parseShareButtonOut&&(r=T.parseShareButtonOut(e,r));v.children[0].innerHTML=r,v.children[0].onclick=R}(),0}function r(e){for(var t=0;t<T.closeElClasses.length;t++)if(a.hasClass(e,"pswp__"+T.closeElClasses[t]))return!0}function s(){clearTimeout(z),H=0,w&&L.setIdle(!1)}function l(e){(e=(e=e||window.event).relatedTarget||e.toElement)&&"HTML"!==e.nodeName||(clearTimeout(z),z=setTimeout(function(){L.setIdle(!0)},T.timeToIdleOutside))}function c(e){E!==e&&(O(S,"preloader--active",!e),E=e)}function u(e){var t,i=e.vGap;!n.likelyTouchDevice||T.mouseUsed||screen.width>T.fitControlsWidth?(t=T.barsSize,T.captionEl&&"auto"===t.bottom?(m||((m=a.createEl("pswp__caption pswp__caption--fake")).appendChild(a.createEl("pswp__caption__center")),h.insertBefore(m,f),a.addClass(h,"pswp__ui--fit")),T.addCaptionHTMLFn(e,m,!0)?(e=m.clientHeight,i.bottom=parseInt(e,10)||44):i.bottom=t.top):i.bottom="auto"===t.bottom?0:t.bottom,i.top=t.top):i.top=i.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<F.length;n++)s=F[n],-1<r.indexOf("pswp__"+s.name)&&(T[s.option]?(a.removeClass(o,"pswp__element--disabled"),s.onInit&&s.onInit(o)):a.addClass(o,"pswp__element--disabled"))}}var o,r,s;e(h.children);var t=a.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 n.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return n.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},O=function(e,t,i){a[(i?"add":"remove")+"Class"](e,"pswp__"+t)},R=function(e){var t=(e=e||window.event).target||e.srcElement;return n.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||o(),1))},H=0,F=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){v=e},onTap:function(){o()}},{name:"button--share",option:"shareEl",onInit:function(e){y=e},onTap:function(){o()}},{name:"button--zoom",option:"zoomEl",onTap:n.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){g=e}},{name:"button--close",option:"closeEl",onTap:n.close},{name:"button--arrow--left",option:"arrowEl",onTap:n.prev},{name:"button--arrow--right",option:"arrowEl",onTap:n.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;a.extend(n.options,_,!0),T=n.options,h=a.getChildByClass(n.scrollWrap,"pswp__ui"),(x=n.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=n.currItem.initialZoomLevel;n.getZoomLevel()!==t?n.zoomTo(t,e,333):n.zoomTo(T.getDoubleTapZoom(!1,n.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(){a.bind(h,"pswpTap click",e),a.bind(n.scrollWrap,"pswpTap",L.onGlobalTap),n.likelyTouchDevice||a.bind(n.scrollWrap,"mouseover",L.onMouseOver)}),x("unbindEvents",function(){D||o(),A&&clearInterval(A),a.unbind(document,"mouseout",l),a.unbind(document,"mousemove",s),a.unbind(h,"pswpTap click",e),a.unbind(n.scrollWrap,"pswpTap",L.onGlobalTap),a.unbind(n.scrollWrap,"mouseover",L.onMouseOver),p&&(a.unbind(document,p.eventK,L.updateFullscreen),p.isFullscreen()&&(T.hideAnimationDuration=0,p.exit()),p=null)}),x("destroy",function(){T.captionEl&&(m&&h.removeChild(m),a.removeClass(f,"pswp__caption--empty")),v&&(v.children[0].onclick=null),a.removeClass(h,"pswp__ui--over-close"),a.addClass(h,"pswp__ui--hidden"),L.setIdle(!1)}),T.showAnimationDuration||a.removeClass(h,"pswp__ui--hidden"),x("initialZoomIn",function(){T.showAnimationDuration&&a.removeClass(h,"pswp__ui--hidden")}),x("initialZoomOut",function(){a.addClass(h,"pswp__ui--hidden")}),x("parseVerticalMargin",u),d(),T.shareEl&&y&&v&&(D=!0),i(),T.timeToIdle&&x("mouseUsed",function(){a.bind(document,"mousemove",s),a.bind(document,"mouseout",l),A=setInterval(function(){2===++H&&L.setIdle(!0)},T.timeToIdle/2)}),T.fullscreenEl&&!a.features.isOldAndroid&&((p=p||L.getFullscreenAPI())?(a.bind(document,p.eventK,L.updateFullscreen),L.updateFullscreen(),a.addClass(n.template,"pswp--supports-fs")):a.removeClass(n.template,"pswp--supports-fs")),T.preloaderEl&&(c(!0),x("beforeChange",function(){clearTimeout(I),I=setTimeout(function(){n.currItem&&n.currItem.loading?n.allowProgressiveImg()&&(!n.currItem.img||n.currItem.img.naturalWidth)||c(!1):c(!0)},T.loadingIndicatorDelay)}),x("imageLoadComplete",function(e,t){n.currItem===t&&c(!0)}))},L.setIdle=function(e){O(h,"ui--idle",w=e)},L.update=function(){P=!(!M||!n.currItem)&&(L.updateIndexIndicator(),T.captionEl&&(T.addCaptionHTMLFn(n.currItem,f),O(f,"caption--empty",!n.currItem.title)),!0),D||o(),i()},L.updateFullscreen=function(e){e&&setTimeout(function(){n.setScrollOffset(0,a.getScrollY())},50),a[(p.isFullscreen()?"add":"remove")+"Class"](n.template,"pswp--fs")},L.updateIndexIndicator=function(){T.counterEl&&(g.innerHTML=n.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)r(t)?n.close():a.hasClass(t,"pswp__img")&&(1===n.getZoomLevel()&&n.getZoomLevel()<=n.currItem.fitRatio?T.clickToCloseNonZoomable&&n.close():n.toggleDesktopZoom(e.detail.releasePoint));else if(T.tapToToggleControls&&(M?L.hideControls():L.showControls()),T.tapToClose&&(a.hasClass(t,"pswp__img")||r(t)))return void n.close()},L.onMouseOver=function(e){e=(e=e||window.event).target||e.srcElement;O(h,"ui--over-close",r(e))},L.hideControls=function(){a.addClass(h,"pswp__ui--hidden"),M=!1},L.showControls=function(){M=!0,P||L.update(),a.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?n.template[this.enterK]():void n.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(p,i,e,t){var h={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){t=document.createElement(t||"div");return e&&(t.className=e),t},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,i){h.bind(e,t,i,!0)},removeClass:function(e,t){t=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(t," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){h.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},getChildByClass:function(e,t){for(var i=e.firstChild;i;){if(h.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(h.features)return h.features;var e,t,i=h.createEl().style,n="",o={};o.oldIE=document.all&&!document.addEventListener,o.touch="ontouchstart"in window,window.requestAnimationFrame&&(o.raf=window.requestAnimationFrame,o.caf=window.cancelAnimationFrame),o.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,o.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&&(o.isOldIOSPhone=!0)),t=(t=e.match(/Android\s([0-9\.]*)/))?t[1]:0,1<=(t=parseFloat(t))&&(t<4.4&&(o.isOldAndroid=!0),o.androidVersion=t),o.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var r,s,a,l=["transform","perspective","animationName"],c=["","webkit","Moz","ms","O"],u=0;u<4;u++){for(var n=c[u],d=0;d<3;d++)r=l[d],s=n+(n?r.charAt(0).toUpperCase()+r.slice(1):r),!o[r]&&s in i&&(o[r]=s);n&&!o.raf&&(n=n.toLowerCase(),o.raf=window[n+"RequestAnimationFrame"],o.raf&&(o.caf=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]))}return o.raf||(a=0,o.raf=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-a)),n=window.setTimeout(function(){e(t+i)},i);return a=t+i,n},o.caf=function(e){clearTimeout(e)}),o.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,h.features=o}};h.detectFeatures(),h.features.oldIE&&(h.bind=function(e,t,i,n){t=t.split(" ");for(var o,r=(n?"detach":"attach")+"Event",s=function(){i.handleEvent.call(i)},a=0;a<t.length;a++)if(o=t[a])if("object"==typeof i&&i.handleEvent){if(n){if(!i["oldIE"+o])return!1}else i["oldIE"+o]=s;e[r]("on"+o,i["oldIE"+o])}else e[r]("on"+o,i)});var f=this,r=25,m={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"};h.extend(m,t);function n(){return{x:0,y:0}}function o(e,t){h.extend(f,t.publicMethods),Le.push(e)}function s(e){var t=Qt();return t-1<e?e-t:e<0?t+e:e}function a(e,t){return De[e]||(De[e]=[]),De[e].push(t)}function l(e,t,i,n){return n===f.currItem.initialZoomLevel?(i[e]=f.currItem.initialPosition[e],!0):(i[e]=je(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 c(e){var t="";m.escKey&&27===e.keyCode?t="close":m.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,f[t]()))}function u(e){e&&(se||re||fe||te)&&(e.preventDefault(),e.stopPropagation())}function d(){f.setScrollOffset(0,h.getScrollY())}function g(e){var t;"mousedown"===e.type&&0<e.button||(Gt?e.preventDefault():ie&&"mousedown"===e.type||(Tt(e,!0)&&e.preventDefault(),_e("pointerDown"),q&&((t=h.arraySearch(ct,e.pointerId,"id"))<0&&(t=ct.length),ct[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),e=(t=_t(e)).length,ce=null,et(),ne&&1!==e||(ne=ge=!0,h.bind(window,C,f),ee=be=ye=te=le=se=oe=re=!1,me=null,_e("firstTouchStart",t),We(Se,Ee),xe.x=xe.y=0,We(at,t[0]),We(lt,at),ut.x=ke.x*Ce,dt=[{x:at.x,y:at.y}],X=V=Oe(),$e(A,!0),xt(),St()),!ue&&1<e&&!fe&&!le&&(z=A,ue=oe=!(re=!1),xe.y=xe.x=0,We(Se,Ee),We(ot,t[0]),We(rt,t[1]),At(ot,rt,vt),yt.x=Math.abs(vt.x)-Ee.x,yt.y=Math.abs(vt.y)-Ee.y,de=wt(ot,rt))))}function y(e){var t,i;e.preventDefault(),q&&-1<(t=h.arraySearch(ct,e.pointerId,"id"))&&((i=ct[t]).x=e.pageX,i.y=e.pageY),ne&&(i=_t(e),me||se||ue?ce=i:gt.x!==ke.x*Ce?me="h":(e=Math.abs(i[0].x-at.x)-Math.abs(i[0].y-at.y),Math.abs(e)>=nt&&(me=0<e?"h":"v",ce=i)))}function v(e){if(K.isOldAndroid){if(ie&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(ie),ie=setTimeout(function(){ie=0},600))}_e("pointerUp"),Tt(e,!1)&&e.preventDefault(),!q||-1<(i=h.arraySearch(ct,e.pointerId,"id"))&&(r=ct.splice(i,1)[0],navigator.msPointerEnabled?(r.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],r.type||(r.type=e.pointerType||"mouse")):r.type=e.pointerType||"mouse");var t=_t(e),i=t.length;if(2===(i="mouseup"===e.type?0:i))return!(ce=null);1===i&&We(lt,t[0]),0!==i||me||fe||(r||("mouseup"===e.type?r={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(r={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),_e("touchRelease",e,r));var n,o,r=-1;if(0===i&&(ne=!1,h.unbind(window,C,f),xt(),ue?r=0:-1!==mt&&(r=Oe()-mt)),mt=1===i?Oe():-1,r=-1!==r&&r<150?"zoom":"swipe",ue&&i<2&&(ue=!1,1===i&&(r="zoomPointerUp"),_e("zoomGestureEnded")),ce=null,se||re||fe||te)if(et(),(J=J||Ht()).calculateSwipeSpeed("x"),te)Lt()<m.verticalDragRange?f.close():(n=Ee.y,o=ve,tt("verticalDrag",0,1,300,h.easing.cubic.out,function(e){Ee.y=(f.currItem.initialPosition.y-n)*e+n,Re((1-o)*e+o),Fe()}),_e("onVerticalDrag",1));else{if((le||fe)&&0===i){if(Nt(r,J))return;r="zoomPointerUp"}if(!fe)return"swipe"!==r?void qt():void(!le&&A>f.currItem.fitRatio&&Ft(J))}}var b,w,x,S,E,I,C,T,k,A,z,L,P,M,D,_,O,R,H,F,N,B,q,j,W,U,Z,Y,$,G,K,Q,V,X,J,ee,te,ie,ne,oe,re,se,ae,le,ce,ue,de,pe,he,fe,me,ge,ye,ve,be,we,xe=n(),Se=n(),Ee=n(),Ie={},Ce=0,Te={},ke=n(),Ae=0,ze=!0,Le=[],Pe={},Me=!1,De={},_e=function(e){var t=De[e];if(t){var i=Array.prototype.slice.call(arguments);i.shift();for(var n=0;n<t.length;n++)t[n].apply(f,i)}},Oe=function(){return(new Date).getTime()},Re=function(e){ve=e,f.bg.style.opacity=e*m.bgOpacity},He=function(e,t,i,n,o){(!Me||o&&o!==f.currItem)&&(n/=(o||f.currItem).fitRatio),e[B]=L+t+"px, "+i+"px"+P+" scale("+n+")"},Fe=function(e){he&&(e&&(A>f.currItem.fitRatio?Me||(ri(f.currItem,!1,!0),Me=!0):Me&&(ri(f.currItem),Me=!1)),He(he,Ee.x,Ee.y,A))},Ne=function(e){e.container&&He(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Be=function(e,t){t[B]=L+e+"px, 0px"+P},qe=function(e,t){var i;!m.loop&&t&&(i=S+(ke.x*Ce-e)/ke.x,t=Math.round(e-gt.x),(i<0&&0<t||i>=Qt()-1&&t<0)&&(e=gt.x+t*m.mainScrollEndFriction)),gt.x=e,Be(e,E)},je=function(e,t){var i=yt[e]-Te[e];return Se[e]+xe[e]+i-t/z*i},We=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Ue=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Ze=null,Ye=function(){Ze&&(h.unbind(document,"mousemove",Ye),h.addClass(p,"pswp--has_mouse"),m.mouseUsed=!0,_e("mouseUsed")),Ze=setTimeout(function(){Ze=null},100)},$e=function(e,t){e=ni(f.currItem,Ie,e);return t&&(pe=e),e},Ge=function(e){return(e=e||f.currItem).initialZoomLevel},Ke=function(e){return 0<(e=e||f.currItem).w?m.maxSpreadZoom:1},Qe={},Ve=0,Xe=function(e){Qe[e]&&(Qe[e].raf&&U(Qe[e].raf),Ve--,delete Qe[e])},Je=function(e){Qe[e]&&Xe(e),Qe[e]||(Ve++,Qe[e]={})},et=function(){for(var e in Qe)Qe.hasOwnProperty(e)&&Xe(e)},tt=function(e,t,i,n,o,r,s){var a,l=Oe();Je(e);function c(){if(Qe[e]){if(a=Oe()-l,n<=a)return Xe(e),r(i),void(s&&s());r((i-t)*o(a/n)+t),Qe[e].raf=W(c)}}c()},t={shout:_e,listen:a,viewportSize:Ie,options:m,isMainScrollAnimating:function(){return fe},getZoomLevel:function(){return A},getCurrentIndex:function(){return S},isDragging:function(){return ne},isZooming:function(){return ue},setScrollOffset:function(e,t){Te.x=e,G=Te.y=t,_e("updateScrollOffset",Te)},applyZoomPan:function(e,t,i,n){Ee.x=t,Ee.y=i,A=e,Fe(n)},init:function(){if(!b&&!w){var e;f.framework=h,f.template=p,f.bg=h.getChildByClass(p,"pswp__bg"),Z=p.className,b=!0,K=h.detectFeatures(),W=K.raf,U=K.caf,B=K.transform,$=K.oldIE,f.scrollWrap=h.getChildByClass(p,"pswp__scroll-wrap"),f.container=h.getChildByClass(f.scrollWrap,"pswp__container"),E=f.container.style,f.itemHolders=_=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],_[0].el.style.display=_[2].el.style.display="none",function(){if(B){var e=K.perspective&&!j;return L="translate"+(e?"3d(":"("),P=K.perspective?", 0px)":")"}B="left",h.addClass(p,"pswp--ie"),Be=function(e,t){t.left=e+"px"},Ne=function(e){var t=1<e.fitRatio?1:e.fitRatio,i=e.container.style,n=t*e.w,t=t*e.h;i.width=n+"px",i.height=t+"px",i.left=e.initialPosition.x+"px",i.top=e.initialPosition.y+"px"},Fe=function(){var e,t,i,n;he&&(e=he,i=(t=1<(n=f.currItem).fitRatio?1:n.fitRatio)*n.w,n=t*n.h,e.width=i+"px",e.height=n+"px",e.left=Ee.x+"px",e.top=Ee.y+"px")}}(),k={resize:f.updateSize,orientationchange:function(){clearTimeout(Q),Q=setTimeout(function(){Ie.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:d,keydown:c,click:u};var t=K.isOldIOSPhone||K.isOldAndroid||K.isMobileOpera;for(K.animationName&&K.transform&&!t||(m.showAnimationDuration=m.hideAnimationDuration=0),e=0;e<Le.length;e++)f["init"+Le[e]]();i&&(f.ui=new i(f,h)).init(),_e("firstUpdate"),S=S||m.index||0,(isNaN(S)||S<0||S>=Qt())&&(S=0),f.currItem=Kt(S),(K.isOldIOSPhone||K.isOldAndroid)&&(ze=!1),p.setAttribute("aria-hidden","false"),m.modal&&(ze?p.style.position="fixed":(p.style.position="absolute",p.style.top=h.getScrollY()+"px")),void 0===G&&(_e("initialLayout"),G=Y=h.getScrollY());t="pswp--open ";for(m.mainClass&&(t+=m.mainClass+" "),m.showHideOpacity&&(t+="pswp--animate_opacity "),t+=j?"pswp--touch":"pswp--notouch",t+=K.animationName?" pswp--css_animation":"",t+=K.svg?" pswp--svg":"",h.addClass(p,t),f.updateSize(),I=-1,Ae=null,e=0;e<3;e++)Be((e+I)*ke.x,_[e].el.style);$||h.bind(f.scrollWrap,T,f),a("initialZoomInEnd",function(){f.setContent(_[0],S-1),f.setContent(_[2],S+1),_[0].el.style.display=_[2].el.style.display="block",m.focus&&p.focus(),h.bind(document,"keydown",f),K.transform&&h.bind(f.scrollWrap,"click",f),m.mouseUsed||h.bind(document,"mousemove",Ye),h.bind(window,"resize scroll orientationchange",f),_e("bindEvents")}),f.setContent(_[1],S),f.updateCurrItem(),_e("afterInit"),ze||(M=setInterval(function(){Ve||ne||ue||A!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),h.addClass(p,"pswp--visible")}},close:function(){b&&(w=!(b=!1),_e("close"),h.unbind(window,"resize scroll orientationchange",f),h.unbind(window,"scroll",k.scroll),h.unbind(document,"keydown",f),h.unbind(document,"mousemove",Ye),K.transform&&h.unbind(f.scrollWrap,"click",f),ne&&h.unbind(window,C,f),clearTimeout(Q),_e("unbindEvents"),Vt(f.currItem,null,!0,f.destroy))},destroy:function(){_e("destroy"),Zt&&clearTimeout(Zt),p.setAttribute("aria-hidden","true"),p.className=Z,M&&clearInterval(M),h.unbind(f.scrollWrap,T,f),h.unbind(window,"scroll",f),xt(),et(),De=null},panTo:function(e,t,i){i||(e>pe.min.x?e=pe.min.x:e<pe.max.x&&(e=pe.max.x),t>pe.min.y?t=pe.min.y:t<pe.max.y&&(t=pe.max.y)),Ee.x=e,Ee.y=t,Fe()},handleEvent:function(e){e=e||window.event,k[e.type]&&k[e.type](e)},goTo:function(e){var t=(e=s(e))-S;Ae=t,S=e,f.currItem=Kt(S),Ce-=t,qe(ke.x*Ce),et(),fe=!1,f.updateCurrItem()},next:function(){f.goTo(S+1)},prev:function(){f.goTo(S-1)},updateCurrZoomItem:function(e){var t;e&&_e("beforeChange",0),he=_[1].el.children.length?(t=_[1].el.children[0],h.hasClass(t,"pswp__zoom-wrap")?t.style:null):null,pe=f.currItem.bounds,z=A=f.currItem.initialZoomLevel,Ee.x=pe.center.x,Ee.y=pe.center.y,e&&_e("afterChange")},invalidateCurrItems:function(){D=!0;for(var e=0;e<3;e++)_[e].item&&(_[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==Ae){var t,i=Math.abs(Ae);if(!(e&&i<2)){f.currItem=Kt(S),Me=!1,_e("beforeChange",Ae),3<=i&&(I+=Ae+(0<Ae?-3:3),i=3);for(var n=0;n<i;n++)0<Ae?(t=_.shift(),_[2]=t,Be((++I+2)*ke.x,t.el.style),f.setContent(t,S-i+n+1+1)):(t=_.pop(),_.unshift(t),Be(--I*ke.x,t.el.style),f.setContent(t,S+i-n-1-1));!he||1!==Math.abs(Ae)||(e=Kt(O)).initialZoomLevel!==A&&(ni(e,Ie),ri(e),Ne(e)),Ae=0,f.updateCurrZoomItem(),O=S,_e("afterChange")}}},updateSize:function(e){if(!ze&&m.modal){var t=h.getScrollY();if(G!==t&&(p.style.top=t+"px",G=t),!e&&Pe.x===window.innerWidth&&Pe.y===window.innerHeight)return;Pe.x=window.innerWidth,Pe.y=window.innerHeight,p.style.height=Pe.y+"px"}if(Ie.x=f.scrollWrap.clientWidth,Ie.y=f.scrollWrap.clientHeight,d(),ke.x=Ie.x+Math.round(Ie.x*m.spacing),ke.y=Ie.y,qe(ke.x*Ce),_e("beforeResize"),void 0!==I){for(var i,n,o,r=0;r<3;r++)i=_[r],Be((r+I)*ke.x,i.el.style),o=S+r-1,m.loop&&2<Qt()&&(o=s(o)),(n=Kt(o))&&(D||n.needsUpdate||!n.bounds)?(f.cleanSlide(n),f.setContent(i,o),1===r&&(f.currItem=n,f.updateCurrZoomItem(!0)),n.needsUpdate=!1):-1===i.index&&0<=o&&f.setContent(i,o),n&&n.container&&(ni(n,Ie),ri(n),Ne(n));D=!1}z=A=f.currItem.initialZoomLevel,(pe=f.currItem.bounds)&&(Ee.x=pe.center.x,Ee.y=pe.center.y,Fe(!0)),_e("resize")},zoomTo:function(t,e,i,n,o){e&&(z=A,yt.x=Math.abs(e.x)-Ee.x,yt.y=Math.abs(e.y)-Ee.y,We(Se,Ee));var e=$e(t,!1),r={};l("x",e,r,t),l("y",e,r,t);var s=A,a={x:Ee.x,y:Ee.y};Ue(r);e=function(e){1===e?(A=t,Ee.x=r.x,Ee.y=r.y):(A=(t-s)*e+s,Ee.x=(r.x-a.x)*e+a.x,Ee.y=(r.y-a.y)*e+a.y),o&&o(e),Fe(1===e)};i?tt("customZoomTo",0,1,i,n||h.easing.sine.inOut,e):e(1)}},it=30,nt=10,ot={},rt={},st={},at={},lt={},ct=[],ut={},dt=[],pt={},ht=0,ft=n(),mt=0,gt=n(),yt=n(),vt=n(),bt=function(e,t){return e.x===t.x&&e.y===t.y},wt=function(e,t){return pt.x=Math.abs(e.x-t.x),pt.y=Math.abs(e.y-t.y),Math.sqrt(pt.x*pt.x+pt.y*pt.y)},xt=function(){ae&&(U(ae),ae=null)},St=function(){ne&&(ae=W(St),Rt())},Et=function(){return!("fit"===m.scaleMode&&A===f.currItem.initialZoomLevel)},It=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:It(e.parentNode,t))},Ct={},Tt=function(e,t){return Ct.prevent=!It(e.target,m.isClickableElement),_e("preventDragEvent",e,t,Ct),Ct.prevent},kt=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},At=function(e,t,i){i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y)},zt=function(e,t,i){var n;50<e-X&&((n=2<dt.length?dt.shift():{}).x=t,n.y=i,dt.push(n),X=e)},Lt=function(){var e=Ee.y-f.currItem.initialPosition.y;return 1-Math.abs(e/(Ie.y/2))},Pt={},Mt={},Dt=[],_t=function(e){for(;0<Dt.length;)Dt.pop();return q?(we=0,ct.forEach(function(e){0===we?Dt[0]=e:1===we&&(Dt[1]=e),we++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(Dt[0]=kt(e.touches[0],Pt),1<e.touches.length&&(Dt[1]=kt(e.touches[1],Mt))):(Pt.x=e.pageX,Pt.y=e.pageY,Pt.id="",Dt[0]=Pt),Dt},Ot=function(e,t){var i,n,o,r=Ee[e]+t[e],s=0<t[e],a=gt.x+t.x,l=gt.x-ut.x,c=r>pe.min[e]||r<pe.max[e]?m.panEndFriction:1,r=Ee[e]+t[e]*c;return!m.allowPanToNext&&A!==f.currItem.initialZoomLevel||(he?"h"!==me||"x"!==e||re||(s?(r>pe.min[e]&&(c=m.panEndFriction,pe.min[e],i=pe.min[e]-Se[e]),(i<=0||l<0)&&1<Qt()?(o=a,l<0&&a>ut.x&&(o=ut.x)):pe.min.x!==pe.max.x&&(n=r)):(r<pe.max[e]&&(c=m.panEndFriction,pe.max[e],i=Se[e]-pe.max[e]),(i<=0||0<l)&&1<Qt()?(o=a,0<l&&a<ut.x&&(o=ut.x)):pe.min.x!==pe.max.x&&(n=r))):o=a,"x"!==e)?void(fe||le||A>f.currItem.fitRatio&&(Ee[e]+=t[e]*c)):(void 0!==o&&(qe(o,!0),le=o!==ut.x),pe.min.x!==pe.max.x&&(void 0!==n?Ee.x=n:le||(Ee.x+=t.x*c)),void 0!==o)},Rt=function(){if(ce){var e,t,i,n,o=ce.length;if(0!==o)if(We(ot,ce[0]),st.x=ot.x-at.x,st.y=ot.y-at.y,ue&&1<o)at.x=ot.x,at.y=ot.y,!st.x&&!st.y&&bt(ce[1],rt)||(We(rt,ce[1]),re||(re=!0,_e("zoomGestureStarted")),e=wt(ot,rt),(r=Bt(e))>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(be=!0),t=1,i=Ge(),n=Ke(),r<i?m.pinchToClose&&!be&&z<=f.currItem.initialZoomLevel?(Re(o=1-(i-r)/(i/1.2)),_e("onPinchClose",o),ye=!0):r=i-(t=1<(t=(i-r)/i)?1:t)*(i/3):n<r&&(r=n+(t=1<(t=(r-n)/(6*i))?1:t)*i),t<0&&(t=0),At(ot,rt,ft),xe.x+=ft.x-vt.x,xe.y+=ft.y-vt.y,We(vt,ft),Ee.x=je("x",r),Ee.y=je("y",r),ee=A<r,A=r,Fe());else if(me&&(ge&&(ge=!1,Math.abs(st.x)>=nt&&(st.x-=ce[0].x-lt.x),Math.abs(st.y)>=nt&&(st.y-=ce[0].y-lt.y)),at.x=ot.x,at.y=ot.y,0!==st.x||0!==st.y)){if("v"===me&&m.closeOnVerticalDrag&&!Et()){xe.y+=st.y,Ee.y+=st.y;var r=Lt();return te=!0,_e("onVerticalDrag",r),Re(r),void Fe()}zt(Oe(),ot.x,ot.y),se=!0,pe=f.currItem.bounds,Ot("x",st)||(Ot("y",st),Ue(Ee),Fe())}}},Ht=function(){var t,i,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){i=1<dt.length?(t=Oe()-X+50,dt[dt.length-2][e]):(t=Oe()-V,lt[e]),n.lastFlickOffset[e]=at[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]||(Ee[t]>pe.min[t]?n.backAnimDestination[t]=pe.min[t]:Ee[t]<pe.max[t]&&(n.backAnimDestination[t]=pe.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,tt("bounceZoomPan"+t,Ee[t],n.backAnimDestination[t],e||300,h.easing.sine.out,function(e){Ee[t]=e,Fe()}))))},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,Ee[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(Qe.zoomPan&&(Qe.zoomPan.raf=W(n.panAnimLoop),n.now=Oe(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),Fe(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return Ee.x=Math.round(Ee.x),Ee.y=Math.round(Ee.y),Fe(),void Xe("zoomPan")}};return n},Ft=function(e){return e.calculateSwipeSpeed("y"),pe=f.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):(Je("zoomPan"),e.lastNow=Oe(),void e.panAnimLoop())},Nt=function(e,t){var i,n;fe||(ht=S),"swipe"===e&&(n=at.x-lt.x,e=t.lastFlickDist.x<10,it<n&&(e||20<t.lastFlickOffset.x)?r=-1:n<-it&&(e||t.lastFlickOffset.x<-20)&&(r=1)),r&&((S+=r)<0?(S=m.loop?Qt()-1:0,o=!0):S>=Qt()&&(S=m.loop?0:Qt()-1,o=!0),o&&!m.loop||(Ae+=r,Ce-=r,i=!0));var o=ke.x*Ce,r=Math.abs(o-gt.x),s=i||o>gt.x==0<t.lastFlickSpeed.x?(s=0<Math.abs(t.lastFlickSpeed.x)?r/Math.abs(t.lastFlickSpeed.x):333,s=Math.min(s,400),Math.max(s,250)):333;return ht===S&&(i=!1),fe=!0,_e("mainScrollAnimStart"),tt("mainScroll",gt.x,o,s,h.easing.cubic.out,qe,function(){et(),fe=!1,ht=-1,!i&&ht===S||f.updateCurrItem(),_e("mainScrollAnimComplete")}),i&&f.updateCurrItem(!0),i},Bt=function(e){return 1/de*e*z},qt=function(){var e=A,t=Ge(),i=Ke();A<t?e=t:i<A&&(e=i);var n,o=ve;return ye&&!ee&&!be&&A<t?f.close():(ye&&(n=function(e){Re((1-o)*e+o)}),f.zoomTo(e,0,200,h.easing.cubic.out,n)),!0};o("Gestures",{publicMethods:{initGestures:function(){function e(e,t,i,n,o){R=e+t,H=e+i,F=e+n,N=o?e+o:""}(q=K.pointerEvent)&&K.touch&&(K.touch=!1),q?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):K.touch?(e("touch","start","move","end","cancel"),j=!0):e("mouse","down","move","up"),C=H+" "+F+" "+N,T=R,q&&!j&&(j=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),f.likelyTouchDevice=j,k[R]=g,k[H]=y,k[F]=v,N&&(k[N]=k[F]),K.touch&&(T+=" mousedown",C+=" mousemove mouseup",k.mousedown=k[R],k.mousemove=k[H],k.mouseup=k[F]),j||(m.allowPanToNext=!1)}}});function jt(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=h.createEl("pswp__img","img");return i.onload=t,i.onerror=function(){e.loadError=!0,t()},i.src=e.src,i}function Wt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=m.errorMsg.replace("%url%",e.src),1)}function Ut(){if(Jt.length){for(var e,t=0;t<Jt.length;t++)(e=Jt[t]).holder.index===e.index&&oi(e.index,e.item,e.baseDiv,e.img,!1,e.clearPlaceholder);Jt=[]}}var Zt,Yt,$t,Gt,Kt,Qt,Vt=function(r,e,s,t){var a;Zt&&clearTimeout(Zt),$t=Gt=!0,r.initialLayout?(a=r.initialLayout,r.initialLayout=null):a=m.getThumbBoundsFn&&m.getThumbBoundsFn(S);function l(){Xe("initialZoom"),s?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Re(1),e&&(e.style.display="block"),h.addClass(p,"pswp--animated-in"),_e("initialZoom"+(s?"OutEnd":"InEnd"))),t&&t(),Gt=!1}var c=s?m.hideAnimationDuration:m.showAnimationDuration;if(!c||!a||void 0===a.x)return _e("initialZoom"+(s?"Out":"In")),A=r.initialZoomLevel,We(Ee,r.initialPosition),Fe(),p.style.opacity=s?0:1,Re(1),void(c?setTimeout(function(){l()},c):l());var u,d;u=x,d=!f.currItem.src||f.currItem.loadError||m.showHideOpacity,r.miniImg&&(r.miniImg.style.webkitBackfaceVisibility="hidden"),s||(A=a.w/r.w,Ee.x=a.x,Ee.y=a.y-Y,f[d?"template":"bg"].style.opacity=.001,Fe()),Je("initialZoom"),s&&!u&&h.removeClass(p,"pswp--animated-in"),d&&(s?h[(u?"remove":"add")+"Class"](p,"pswp--animate_opacity"):setTimeout(function(){h.addClass(p,"pswp--animate_opacity")},30)),Zt=setTimeout(function(){var t,i,n,o,e;_e("initialZoom"+(s?"Out":"In")),s?(t=a.w/r.w,i={x:Ee.x,y:Ee.y},n=A,o=ve,e=function(e){1===e?(A=t,Ee.x=a.x,Ee.y=a.y-G):(A=(t-n)*e+n,Ee.x=(a.x-i.x)*e+i.x,Ee.y=(a.y-G-i.y)*e+i.y),Fe(),d?p.style.opacity=1-e:Re(o-e*o)},u?tt("initialZoom",0,1,c,h.easing.cubic.out,e,l):(e(1),Zt=setTimeout(l,c+20))):(A=r.initialZoomLevel,We(Ee,r.initialPosition),Fe(),Re(1),d?p.style.opacity=1:Re(1),Zt=setTimeout(l,c+20))},s?25:90)},Xt={},Jt=[],ei={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 Yt.length}},ti=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},ii=function(e,t,i){var n=e.bounds;n.center.x=Math.round((Xt.x-t)/2),n.center.y=Math.round((Xt.y-i)/2)+e.vGap.top,n.max.x=t>Xt.x?Math.round(Xt.x-t):n.center.x,n.max.y=i>Xt.y?Math.round(Xt.y-i)+e.vGap.top:n.center.y,n.min.x=t>Xt.x?0:n.center.x,n.min.y=i>Xt.y?e.vGap.top:n.center.y},ni=function(e,t,i){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=ti(),e.initialPosition=e.bounds.center,e.bounds;var n,o=!i;return o&&(e.vGap||(e.vGap={top:0,bottom:0}),_e("parseVerticalMargin",e)),Xt.x=t.x,Xt.y=t.y-e.vGap.top-e.vGap.bottom,o&&(n=Xt.x/e.w,t=Xt.y/e.h,e.fitRatio=n<t?n:t,"orig"===(t=m.scaleMode)?i=1:"fit"===t&&(i=e.fitRatio),e.initialZoomLevel=i=1<i?1:i,e.bounds||(e.bounds=ti())),i?(ii(e,e.w*i,e.h*i),o&&i===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},oi=function(e,t,i,n,o,r){t.loadError||n&&(t.imageAppended=!0,ri(t,n,t===f.currItem&&Me),i.appendChild(n),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},ri=function(e,t,i){var n;e.src&&(t=t||e.container.lastChild,n=i?e.w:Math.round(e.w*e.fitRatio),i=i?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=n+"px",e.placeholder.style.height=i+"px"),t.style.width=n+"px",t.style.height=i+"px")};o("Controller",{publicMethods:{lazyLoadItem:function(e){e=s(e);var t=Kt(e);t&&(!t.loaded&&!t.loading||D)&&(_e("gettingData",e,t),t.src&&jt(t))},initController:function(){h.extend(m,ei,!0),f.items=Yt=e,Kt=f.getItemAt,Qt=m.getNumItemsFn,m.loop,Qt()<3&&(m.loop=!1),a("beforeChange",function(e){for(var t=m.preload,i=null===e||0<=e,n=Math.min(t[0],Qt()),o=Math.min(t[1],Qt()),r=1;r<=(i?o:n);r++)f.lazyLoadItem(S+r);for(r=1;r<=(i?n:o);r++)f.lazyLoadItem(S-r)}),a("initialLayout",function(){f.currItem.initialLayout=m.getThumbBoundsFn&&m.getThumbBoundsFn(S)}),a("mainScrollAnimComplete",Ut),a("initialZoomInEnd",Ut),a("destroy",function(){for(var e,t=0;t<Yt.length;t++)(e=Yt[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 0<=e&&void 0!==Yt[e]&&Yt[e]},allowProgressiveImg:function(){return m.forceProgressiveLoading||!j||m.mouseUsed||1200<screen.width},setContent:function(t,i){m.loop&&(i=s(i));var e=f.getItemAt(t.index);e&&(e.container=null);var n,o,r=f.getItemAt(i);r?(_e("gettingData",i,r),t.index=i,o=(t.item=r).container=h.createEl("pswp__zoom-wrap"),!r.src&&r.html&&(r.html.tagName?o.appendChild(r.html):o.innerHTML=r.html),Wt(r),ni(r,Ie),!r.src||r.loadError||r.loaded?r.src&&!r.loadError&&((n=h.createEl("pswp__img","img")).style.opacity=1,n.src=r.src,ri(r,n),oi(i,r,o,n,!0)):(r.loadComplete=function(e){if(b){if(t&&t.index===i){if(Wt(e,!0))return e.loadComplete=e.img=null,ni(e,Ie),Ne(e),void(t.index===S&&f.updateCurrZoomItem());e.imageAppended?!Gt&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):K.transform&&(fe||Gt)?Jt.push({item:e,baseDiv:o,img:e.img,index:i,holder:t,clearPlaceholder:!0}):oi(i,e,o,e.img,fe||Gt,!0)}e.loadComplete=null,e.img=null,_e("imageLoadComplete",i,e)}},h.features.transform&&(e="pswp__img pswp__img--placeholder",e+=r.msrc?"":" pswp__img--placeholder--blank",e=h.createEl(e,r.msrc?"img":""),r.msrc&&(e.src=r.msrc),ri(r,e),o.appendChild(e),r.placeholder=e),r.loading||jt(r),f.allowProgressiveImg()&&(!$t&&K.transform?Jt.push({item:r,baseDiv:o,img:r.img,index:i,holder:t}):oi(i,r,o,r.img,!0,!0))),$t||i!==S?Ne(r):(he=o.style,Vt(r,n||r.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 si(e,t,i){var n=document.createEvent("CustomEvent"),i={origEvent:e,target:e.target,releasePoint:t,pointerType:i||"touch"};n.initCustomEvent("pswpTap",!0,!0,i),e.target.dispatchEvent(n)}var ai,li,ci={};o("Tap",{publicMethods:{initTap:function(){a("firstTouchStart",f.onTapStart),a("touchRelease",f.onTapRelease),a("destroy",function(){ci={},ai=null})},onTapStart:function(e){1<e.length&&(clearTimeout(ai),ai=null)},onTapRelease:function(e,t){var i,n,o;!t||se||oe||Ve||(i=t,ai&&(clearTimeout(ai),ai=null,n=i,o=ci,Math.abs(n.x-o.x)<r&&Math.abs(n.y-o.y)<r)?_e("doubleTap",i):"mouse"!==t.type?"BUTTON"===e.target.tagName.toUpperCase()||h.hasClass(e.target,"pswp__single-tap")?si(e,t):(We(ci,i),ai=setTimeout(function(){si(e,t),ai=null},300)):si(e,t,"mouse"))}}}),o("DesktopZoom",{publicMethods:{initDesktopZoom:function(){$||(j?a("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(e){li={};var t="wheel mousewheel DOMMouseScroll";a("bindEvents",function(){h.bind(p,t,f.handleMouseWheel)}),a("unbindEvents",function(){li&&h.unbind(p,t,f.handleMouseWheel)}),f.mouseZoomedIn=!1;function i(){f.mouseZoomedIn&&(h.removeClass(p,"pswp--zoomed-in"),f.mouseZoomedIn=!1),A<1?h.addClass(p,"pswp--zoom-allowed"):h.removeClass(p,"pswp--zoom-allowed"),o()}var n,o=function(){n&&(h.removeClass(p,"pswp--dragging"),n=!1)};a("resize",i),a("afterChange",i),a("pointerDown",function(){f.mouseZoomedIn&&(n=!0,h.addClass(p,"pswp--dragging"))}),a("pointerUp",o),e||i()},handleMouseWheel:function(e){if(A<=f.currItem.fitRatio)return m.modal&&(!m.closeOnScroll||Ve||ne?e.preventDefault():B&&2<Math.abs(e.deltaY)&&(x=!0,f.close())),!0;if(e.stopPropagation(),li.x=0,"deltaX"in e)1===e.deltaMode?(li.x=18*e.deltaX,li.y=18*e.deltaY):(li.x=e.deltaX,li.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(li.x=-.16*e.wheelDeltaX),e.wheelDeltaY?li.y=-.16*e.wheelDeltaY:li.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;li.y=e.detail}$e(A,!0);var t=Ee.x-li.x,i=Ee.y-li.y;(m.modal||t<=pe.min.x&&t>=pe.max.x&&i<=pe.min.y&&i>=pe.max.y)&&e.preventDefault(),f.panTo(t,i)},toggleDesktopZoom:function(e){e=e||{x:Ie.x/2+Te.x,y:Ie.y/2+Te.y};var t=m.getDoubleTapZoom(!0,f.currItem),i=A===t;f.mouseZoomedIn=!i,f.zoomTo(i?f.currItem.initialZoomLevel:t,e,333),h[(i?"remove":"add")+"Class"](p,"pswp--zoomed-in")}}});function ui(){pi&&clearTimeout(pi),fi&&clearTimeout(fi)}function di(){var e=Ci(),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(m.galleryPIDs){for(var o=t.pid,r=t.pid=0;r<Yt.length;r++)if(Yt[r].pid===o){t.pid=r;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t}var pi,hi,fi,mi,gi,yi,vi,bi,wi,xi,Si,Ei,Ii={history:!0,galleryUID:1},Ci=function(){return Si.hash.substring(1)},Ti=function(){var e,t;fi&&clearTimeout(fi),Ve||ne?fi=setTimeout(Ti,500):(mi?clearTimeout(hi):mi=!0,t=S+1,(e=Kt(S)).hasOwnProperty("pid")&&(t=e.pid),e=vi+"&gid="+m.galleryUID+"&pid="+t,bi||-1===Si.hash.indexOf(e)&&(xi=!0),t=Si.href.split("#")[0]+"#"+e,Ei?"#"+e!==window.location.hash&&history[bi?"replaceState":"pushState"]("",document.title,t):bi?Si.replace(t):Si.hash=e,bi=!0,hi=setTimeout(function(){mi=!1},60))};o("History",{publicMethods:{initHistory:function(){var e,t;h.extend(m,Ii,!0),m.history&&(Si=window.location,bi=wi=xi=!1,vi=Ci(),Ei="pushState"in history,-1<vi.indexOf("gid=")&&(vi=(vi=vi.split("&gid=")[0]).split("?gid=")[0]),a("afterChange",f.updateURL),a("unbindEvents",function(){h.unbind(window,"hashchange",f.onHashChange)}),e=function(){yi=!0,wi||(xi?history.back():vi?Si.hash=vi:Ei?history.pushState("",document.title,Si.pathname+Si.search):Si.hash=""),ui()},a("unbindEvents",function(){x&&e()}),a("destroy",function(){yi||e()}),a("firstUpdate",function(){S=di().pid}),-1<(t=vi.indexOf("pid="))&&("&"===(vi=vi.substring(0,t)).slice(-1)&&(vi=vi.slice(0,-1))),setTimeout(function(){b&&h.bind(window,"hashchange",f.onHashChange)},40))},onHashChange:function(){return Ci()===vi?(wi=!0,void f.close()):void(mi||(gi=!0,f.goTo(di().pid),gi=!1))},updateURL:function(){ui(),gi||(bi?pi=setTimeout(Ti,800):Ti())}}}),h.extend(f,t)}}),function(f){f.fn.theiaStickySidebar=function(e){var t,i;function n(e,t){return!0===e.initialized||!(f("body").width()<e.minWidth)&&(t=t,(p=e).initialized=!0,f("head").append(f('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),t.each(function(){var i,e={};e.sidebar=f(this),e.options=p||{},e.container=f(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=f("<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 d(){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,d(),e.onScroll=function(e){if(e.stickySidebar.is(":visible"))if(f("body").width()<e.options.minWidth)d();else{if(e.options.disableOnResponsiveLayouts)if(e.sidebar.outerWidth("none"==e.sidebar.css("float"))+50>e.container.width())return void d();var t,i,n,o,r,s,a,l,c=f(document).scrollTop(),u="static";c>=e.sidebar.offset().top+(e.paddingTop-e.options.additionalMarginTop)&&(i=e.paddingTop+p.additionalMarginTop,r=e.paddingBottom+e.marginBottom+p.additionalMarginBottom,o=e.sidebar.offset().top,n=e.sidebar.offset().top+(s=e.container,a=s.height(),s.children().each(function(){a=Math.max(a,f(this).height())}),a),t=0+p.additionalMarginTop,s=e.stickySidebar.outerHeight()+i+r<f(window).height()?t+e.stickySidebar.outerHeight():f(window).height()-e.marginBottom-e.paddingBottom-p.additionalMarginBottom,i=o-c+e.paddingTop,r=n-c-e.paddingBottom-e.marginBottom,o=e.stickySidebar.offset().top-c,n=e.previousScrollTop-c,"fixed"==e.stickySidebar.css("position")&&"modern"==e.options.sidebarBehavior&&(o+=n),"stick-to-top"==e.options.sidebarBehavior&&(o=p.additionalMarginTop),"stick-to-bottom"==e.options.sidebarBehavior&&(o=s-e.stickySidebar.outerHeight()),o=0<n?Math.min(o,t):Math.max(o,s-e.stickySidebar.outerHeight()),o=Math.max(o,i),o=Math.min(o,r-e.stickySidebar.outerHeight()),u=((r=e.container.height()==e.stickySidebar.outerHeight())||o!=t)&&(r||o!=s-e.stickySidebar.outerHeight())?c+o-e.sidebar.offset().top-e.paddingTop<=p.additionalMarginTop?"static":"absolute":"fixed"),"fixed"==u?(l=f(document).scrollLeft(),e.stickySidebar.css({position:"fixed",width:h(e.stickySidebar)+"px",transform:"translateY("+o+"px)",left:e.sidebar.offset().left+parseInt(e.sidebar.css("padding-left"))-l+"px",top:"0px"})):"absolute"==u?(l={},"absolute"!=e.stickySidebar.css("position")&&(l.position="absolute",l.transform="translateY("+(c+o-e.sidebar.offset().top-e.stickySidebarPaddingTop-e.stickySidebarPaddingBottom)+"px)",l.top="0px"),l.width=h(e.stickySidebar)+"px",l.left="",e.stickySidebar.css(l)):"static"==u&&d(),"static"!=u&&1==e.options.updateSidebarHeight&&e.sidebar.css({"min-height":e.stickySidebar.outerHeight()+e.stickySidebar.offset().top-e.sidebar.offset().top+e.paddingBottom}),e.previousScrollTop=c}},e.onScroll(e),f(document).scroll((t=e,function(){t.onScroll(t)})),f(window).resize((n=e,function(){n.stickySidebar.css({position:"static"}),n.onScroll(n)}))}),!0);var p}function h(e){var t;try{t=e[0].getBoundingClientRect().width}catch(e){}return t=void 0===t?e.width():t}(e=f.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."),f(document).scroll(function(t,i){return function(e){n(t,i)&&f(this).unbind(e)}}(t,i)),f(window).resize(function(t,i){return function(e){n(t,i)&&f(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";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(o,r,s,a,l){function t(e){e.preventDefault();var n,t=$(e.target).closest(o).find(r).index($(e.target).closest(r)),i=$(e.target).closest(o);return e=t,t=i[0],i=document.querySelectorAll(".pswp")[0],t=c(t),(n=new PhotoSwipe(i,PhotoSwipeUI_Default,t,{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(),0}var c=function(e){var i,n,o=[];return $(e).find(r).each(function(e,t){i=$(t),i.find(s),n={src:(l?i.find("img"):i).attr("src"),w:0,h:0},a&&i.find(a).length&&(n.title=i.find(a).html()),o.push(n)}),o};$(o).on("click",s,function(e){t(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