!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.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())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
;!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return c.raw?e:encodeURIComponent(e)}function i(e){return c.raw?e:decodeURIComponent(e)}function o(e){return n(c.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(u," ")),c.json?JSON.parse(e):e}catch(n){}}function t(n,i){var o=c.raw?n:r(n);return e.isFunction(i)?i(o):o}var u=/\+/g,c=e.cookie=function(r,u,f){if(u!==undefined&&!e.isFunction(u)){if("number"==typeof(f=e.extend({},c.defaults,f)).expires){var d=f.expires,a=f.expires=new Date;a.setTime(+a+864e5*d)}return document.cookie=[n(r),"=",o(u),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?undefined:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;m<x;m++){var k=s[m].split("="),l=i(k.shift()),j=k.join("=");if(r&&r===l){p=t(j,u);break}r||(j=t(j))===undefined||(p[l]=j)}return p};c.defaults={},e.removeCookie=function(n,i){return e.cookie(n)!==undefined&&(e.cookie(n,"",e.extend({},i,{expires:-1})),!e.cookie(n))}});
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
var PIXWELL_CORE_SCRIPT=(function (Module, $){
"use strict";
Module.init=function (){
let self=this;
this._body=$('body');
$(window).trigger('RB:CountBookmark');
this.darkModeID=pixwellCoreParams.darkModeID||'RubyDarkMode';
this.isCMode=document.body.classList.contains("is-cmode");
self.newsLetterSubmit();
self.initDarkModeCookie();
self.rbCookie();
self.headerStrip();
self.bookMarkCounter();
self.bookmarkList();
self.removeBookmarkList();
self.removeBookMark();
self.newsLetterPopup();
self.switchDarkMode();
self.noteToggle();
self.accordion();
};
Module.initReaction=function (){
this.clickReaction();
this.loadReactions();
}
Module.rbBookMarks=function (){
this.loadBookMarks();
this.addBookMark();
};
Module.newsLetterSubmit=function (){
$('.rb-newsletter-form').submit(function (e){
e.preventDefault();
e.stopPropagation();
let target=$(this);
let responseWrap=target.closest('.rb-newsletter').find('.newsletter-response');
responseWrap.find('.is-show').removeClass('is-show');
let subscribeEmail=target.find('input[name="rb_email_subscribe"]').val();
if(!subscribeEmail){
responseWrap.find('.email-error').addClass('is-show');
responseWrap.find('.email-error').addClass('showing');
return false;
}
let postData={
action: 'rb_submit_newsletter',
email: subscribeEmail
};
let privacy=target.find(':checkbox[name="rb_privacy"]');
if(privacy!=null&&privacy.length > 0){
let privacyVal=privacy.prop('checked');
if(!privacyVal){
responseWrap.find('.privacy-error').addClass('is-show showing');
return false;
}else{
postData.privacy=privacyVal;
}}
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: postData,
success: function (response){
responseWrap.find('.' + response.notice).addClass('is-show');
responseWrap.find('.' + response.notice).addClass('showing');
}});
return false;
});
};
Module.newsLetterPopup=function (){
if($(window).width() < 768){
return;
}
let targetID='#rb-newsletter-popup';
if($(targetID).length > 0&&'1'!==$.cookie('ruby_newsletter_popup')){
let delay=$(targetID).data('delay');
if(!delay){
delay=2000;
}
setTimeout(function (){
if(PIXWELL_MAIN_SCRIPTS&&true===PIXWELL_MAIN_SCRIPTS.siteAccessFlag){
return;
}
$.magnificPopup.open({
type: 'inline',
preloader: false,
closeBtnInside: true,
removalDelay: 300,
showCloseBtn: true,
closeOnBgClick: false,
disableOn: 992,
items: {
src: targetID,
type: 'inline'
},
mainClass: 'rb-popup-effect',
fixedBgPos: true,
fixedContentPos: true,
closeMarkup: '<button id="rb-close-newsletter" title="%title%" aria-label="%title%" class="mfp-close"><i class="rbi rbi-move"></i></button>',
callbacks: {
close: function (){
let expiresTime=$(targetID).data('expired');
$.cookie('ruby_newsletter_popup', '1', {expires: parseInt(expiresTime), path: '/'});
}}
});
}, delay);
}};
Module.noteToggle=function (){
$('.yes-toggle > .note-header').on('click', function (){
let wrapper=$(this).parent();
let timing=wrapper.hasClass('is-inline') ? 0:300;
wrapper.toggleClass('explain');
wrapper.find('.note-content').slideToggle(timing);
});
}
Module.sharesAction=function (){
$('a.share-action').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
window.open($(this).attr('href'), '_blank', 'width=600, height=350');
return false;
})
};
Module.rbCookie=function (){
let rbCookie=$('#rb-cookie');
if(rbCookie.length > 0){
if($.cookie('ruby_cookie_popup')!=='1'){
rbCookie.css('display', 'block');
setTimeout(function (){
rbCookie.addClass('is-show');
}, 10)
}
$('#cookie-accept').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
$.cookie('ruby_cookie_popup', '1', {expires: 30, path: '/'});
rbCookie.removeClass('is-show');
setTimeout(function (){
rbCookie.css('display', 'none');
}, 500)
})
}};
Module.headerStrip=function (){
let headerStrips=$('.rb-headerstrip');
if(headerStrips.length > 0){
headerStrips.each(function (){
let headerStrip=$(this);
let id=headerStrip.attr('id');
if($.cookie(id)!=='1'){
headerStrip.css('display', 'block');
}});
}
$('.headerstrip-submit').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
let wrap=$(this).parents('.rb-headerstrip');
let expired=wrap.data('headerstrip');
if(!expired){
expired=30;
}
let id=wrap.attr('id');
$.cookie(id, '1', {expires: expired, path: '/'});
wrap.slideUp(300, function (){
wrap.remove();
});
});
};
Module.addBookMark=function (){
let self=this;
$('.read-it-later').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
let target=$(this);
let postID=target.data('bookmarkid');
if(!postID){
return;
}
let dataBookMark=$.cookie('RBBookmarkData');
if(dataBookMark){
dataBookMark=JSON.parse(dataBookMark);
}
if(typeof dataBookMark!='object'||null==dataBookMark||!dataBookMark){
dataBookMark=[];
}
dataBookMark=self.toggleArrayItem(target, dataBookMark, postID);
$.cookie('RBBookmarkData', JSON.stringify(dataBookMark), {expires: 30, path: '/'});
$(window).trigger('RB:CountBookmark');
});
};
Module.toggleArrayItem=function (target, data, value){
let i=$.inArray(value, data);
if(i===-1){
$('[data-bookmarkid=' + value + ']').addClass('added');
data.push(value);
}else{
$('[data-bookmarkid=' + value + ']').removeClass('added');
data.splice(i, 1);
}
return data;
};
Module.removeBookmarkList=function (){
$('#remove-bookmark-list').on('click', function (e){
e.preventDefault();
e.stopPropagation();
$.removeCookie('RBBookmarkData', {path: '/'});
window.location.reload();
})
};
Module.loadBookMarks=function (){
let dataBookMark=$.cookie('RBBookmarkData');
if(dataBookMark){
dataBookMark=JSON.parse(dataBookMark);
}
$('.read-it-later:not(.loaded)').each(function (){
let target=$(this);
target.addClass('loaded');
let postID=target.data('bookmarkid');
if(!postID){
return;
}
let i=$.inArray(postID, dataBookMark);
if(i!==-1){
target.addClass('added');
}});
$(window).trigger('RB:CountBookmark');
};
Module.removeBookMark=function (){
let removeID=$('.rb-remove-bookmark').data('bookmarkid');
if(removeID){
let dataBookMark=$.cookie('RBBookmarkData');
if(dataBookMark){
dataBookMark=JSON.parse(dataBookMark);
}
if(typeof dataBookMark!='object'){
return;
}
let i=$.inArray(removeID, dataBookMark);
if(i!=-1){
dataBookMark.splice(i, 1);
}
$.cookie('RBBookmarkData', JSON.stringify(dataBookMark), {expires: 30, path: '/'});
}};
Module.bookMarkCounter=function (){
$(window).on('RB:CountBookmark', function (){
let dataBookMark=$.cookie('RBBookmarkData');
if(dataBookMark){
dataBookMark=JSON.parse(dataBookMark);
if(dataBookMark!=null&&dataBookMark.length > 0){
$('.bookmark-counter').fadeOut(0).html(dataBookMark.length).fadeIn(200);
}}
});
};
Module.bookmarkList=function (){
let bookmarkList=$('#bookmarks-list');
if(null==bookmarkList||bookmarkList.length < 1){
return;
}
let dataBookMark=$.cookie('RBBookmarkData');
if(dataBookMark){
dataBookMark=JSON.parse(dataBookMark);
}
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'rb_bookmark',
ids: dataBookMark
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
$('#bookmarks-list').html(data);
$(window).trigger('load');
}});
};
Module.setDarkModeCookie=function (id, value){
if(this.isCMode){
var date=new Date()
date.setTime(date.getTime() + 5184000000);
document.cookie=id + '=' + value + '; path=/; expires=' + date.toGMTString() + ';';
}}
Module.initDarkModeCookie=function (){
if(this.isCMode&&!$.cookie(this.darkModeID)){
$.cookie(this.darkModeID, document.body.getAttribute('data-theme'), {expires: 60, path: '/'});
}}
Module.switchDarkMode=function (){
let self=this;
let darkModeID=pixwellCoreParams.darkModeID;
$('.dark-mode-toggle').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
if(!$(this).hasClass('trigged')){
$(this).addClass('trigged')
}
let iconDefault=$('.mode-icon-default');
let iconDark=$('.mode-icon-dark');
let currentMode=localStorage.getItem(darkModeID);
if(null===currentMode){
currentMode=self._body.data('theme');
}
self._body.addClass('switch-smooth');
if(null===currentMode||'default'===currentMode){
localStorage.setItem(darkModeID, 'dark');
self._body.attr('data-theme', 'dark');
iconDefault.removeClass('activated');
iconDark.addClass('activated');
self.setDarkModeCookie(darkModeID, 'dark');
}else{
localStorage.setItem(darkModeID, 'default');
self._body.attr('data-theme', 'default');
iconDefault.addClass('activated');
iconDark.removeClass('activated');
self.setDarkModeCookie(darkModeID, 'default');
}})
};
Module.loadReactions=function (){
let self=this;
self.reaction=$('.rb-reaction');
if(self.reaction.length < 1){
return;
}
self.reactionProcessing=false;
self.reaction.each(function (){
let currentReaction=$(this);
let uid=currentReaction.data('reaction_uid');
if(!currentReaction.hasClass('data-loaded')){
self.loadCurrentReaction(currentReaction, uid);
}});
};
Module.loadCurrentReaction=function (currentReaction, uid){
let self=this;
self.reactionProcessing=true;
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'rb_load_reaction',
uid: uid
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
$.each(data, function (index, val){
currentReaction.find('[data-reaction=' + val + ']').addClass('active');
});
currentReaction.addClass('data-loaded');
self.reactionProcessing=false;
}});
};
Module.clickReaction=function (){
let self=this;
$('.reaction').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
let target=$(this);
let reaction=target.data('reaction');
let uid=target.data('reaction_uid');
let push=1;
if(self.reactionProcessing){
return;
}
target.addClass('loading');
self.reactionProcessing=true;
let reactionCount=target.find('.reaction-count');
let total=parseInt(reactionCount.html());
if(target.hasClass('active')){
total--;
push='-1';
}else{
total++;
}
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'rb_add_reaction',
uid: uid,
reaction: reaction,
push: push
},
success: function (data){
if(true!==data){
let oldReactions=target.siblings('.active');
if(oldReactions.length > 0){
$.each(oldReactions, function (){
$(this).removeClass('active');
let oldReactionCount=$(this).find('.reaction-count');
let oldTotal=parseInt(oldReactionCount.html()) - 1;
oldReactionCount.hide().html(oldTotal).fadeIn(300);
});
}}
reactionCount.hide().html(total).fadeIn(300);
target.toggleClass('active');
target.removeClass('loading');
self.reactionProcessing=false;
}});
return false;
});
};
Module.accordion=function (){
$('.gb-accordion').each(function (){
const accordion=$(this);
const accordionItems=accordion.find('.gb-accordion-item');
if(accordion.hasClass('yes-open')){
accordionItems.first().addClass('active');
}
accordionItems.on('click', function (){
const item=$(this);
const isActive=item.hasClass('active');
if(!isActive){
const activeItem=accordionItems.filter('.active');
activeItem.removeClass('active').find('.accordion-item-content').slideUp(250, function (){
$(this).css('display', 'none');
});
item.addClass('active').find('.accordion-item-content').slideDown(250, function (){
$(this).css('display', 'block');
});
}else{
item.removeClass('active').find('.accordion-item-content').slideUp(250, function (){
$(this).css('display', 'none');
});
}});
});
};
return Module;
}(PIXWELL_CORE_SCRIPT||{}, jQuery));
jQuery(document).ready(function (){
PIXWELL_CORE_SCRIPT.init();
});
jQuery(window).on('load', function (){
PIXWELL_CORE_SCRIPT.sharesAction();
PIXWELL_CORE_SCRIPT.rbBookMarks();
PIXWELL_CORE_SCRIPT.initReaction();
});
var omShortcodes={init:function(modules){if(typeof(modules)!='undefined'){for(var i=0;i<modules.length;i++){if(typeof(this.modules[modules[i]])!='undefined')
this.modules[modules[i]].init()}}},modules:{}};omShortcodes.modules.buttons={init:function(){jQuery('.omsc-button.omsc-custom-hover').each(function(){jQuery(this).data('def-bg-color',jQuery(this).css('background-color'));jQuery(this).data('def-text-color',jQuery(this).css('color'));jQuery(this).data('def-border-color',jQuery(this).css('border-top-color'))}).hover(function(){var color;color=jQuery(this).data('hover-bg-color');if(color)
jQuery(this).css('background-color',color);color=jQuery(this).data('hover-text-color');if(color)
jQuery(this).css('color',color);color=jQuery(this).data('hover-border-color');if(color)
jQuery(this).css('border-color',color)},function(){jQuery(this).css('background-color',jQuery(this).data('def-bg-color'));jQuery(this).css('border-color',jQuery(this).data('def-border-color'));jQuery(this).css('color',jQuery(this).data('def-text-color'))})}}
omShortcodes.modules.tooltips={init:function(){jQuery('.omsc-add-tooltip').each(function(){var text=jQuery(this).data('tooltip');if(typeof(text)=='undefined')
return;jQuery(this).mouseenter(function(){var $tt=jQuery(this).data('omsc-tooltip');if($tt){$tt.stop()}else{var pos=jQuery(this).offset();$tt=jQuery('<div class="omsc-tooltip"><div class="omsc-tooltip-inner"></div></div>');$tt.find('.omsc-tooltip-inner').text(text);jQuery(this).data('omsc-tooltip',$tt);$tt.appendTo('body');$tt.css('left',pos.left+Math.round(jQuery(this).outerWidth()/2));$tt.css('top',pos.top-$tt.outerHeight())}
$tt.show();$tt.animate({opacity:1,marginTop:'-13px'},200)});jQuery(this).mouseleave(function(){var $this=jQuery(this);var $tt=$this.data('omsc-tooltip');if($tt){$tt.stop().animate({opacity:0,marginTop:'-22px'},200,function(){jQuery(this).remove();$this.data('omsc-tooltip',!1)})}})})}}
omShortcodes.modules.responsivebox={init:function(){jQuery('.omsc-responsive-box').each(function(){var $obj=jQuery(this).children(':first');if($obj.length){var w=parseInt($obj.attr('width'));var h=parseInt($obj.attr('height'));if(!isNaN(w)&&!isNaN(h)&&w>0&&h>0){var r=h/w;jQuery(this).css('padding-bottom',(r*100)+'%')}}})}};
;!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var n in t){var r=t[n];for(var s in this.waypoints[n]){var a,l,h,p,u,c=this.waypoints[n][s],d=c.options.offset,f=c.triggerPoint,w=0,y=null==f;c.element!==c.element.window&&(w=c.adapter.offset()[r.offsetProp]),"function"==typeof d?d=d.apply(c):"string"==typeof d&&(d=parseFloat(d),c.options.offset.indexOf("%")>-1&&(d=Math.ceil(r.contextDimension*d/100))),a=r.contextScroll-r.contextOffset,c.triggerPoint=w+a-d,l=f<r.oldScroll,h=c.triggerPoint>=r.oldScroll,p=l&&h,u=!l&&!h,!y&&p?(c.queueTrigger(r.backward),o[c.group.id]=c.group):!y&&u?(c.queueTrigger(r.forward),o[c.group.id]=c.group):y&&r.oldScroll>=c.triggerPoint&&(c.queueTrigger(r.forward),o[c.group.id]=c.group)}}for(var g in o)o[g].flushTriggers();return this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('jquery-bridget/jquery-bridget',[ 'jquery' ], function(jQuery){
return factory(window, jQuery);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('jquery')
);
}else{
window.jQueryBridget=factory(
window,
window.jQuery
);
}}(window, function factory(window, jQuery){
'use strict';
var arraySlice=Array.prototype.slice;
var console=window.console;
var logError=typeof console=='undefined' ? function(){} :
function(message){
console.error(message);
};
function jQueryBridget(namespace, PluginClass, $){
$=$||jQuery||window.jQuery;
if(!$){
return;
}
if(!PluginClass.prototype.option){
PluginClass.prototype.option=function(opts){
if(!$.isPlainObject(opts) ){
return;
}
this.options=$.extend(true, this.options, opts);
};}
$.fn[ namespace ]=function(arg0 ){
if(typeof arg0=='string'){
var args=arraySlice.call(arguments, 1);
return methodCall(this, arg0, args);
}
plainCall(this, arg0);
return this;
};
function methodCall($elems, methodName, args){
var returnValue;
var pluginMethodStr='$().' + namespace + '("' + methodName + '")';
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(!instance){
logError(namespace + ' not initialized. Cannot call methods, i.e. ' +
pluginMethodStr);
return;
}
var method=instance[ methodName ];
if(!method||methodName.charAt(0)=='_'){
logError(pluginMethodStr + ' is not a valid method');
return;
}
var value=method.apply(instance, args);
returnValue=returnValue===undefined ? value:returnValue;
});
return returnValue!==undefined ? returnValue:$elems;
}
function plainCall($elems, options){
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(instance){
instance.option(options);
instance._init();
}else{
instance=new PluginClass(elem, options);
$.data(elem, namespace, instance);
}});
}
updateJQuery($);
}
function updateJQuery($){
if(!$||($&&$.bridget) ){
return;
}
$.bridget=jQueryBridget;
}
updateJQuery(jQuery||window.jQuery);
return jQueryBridget;
}));
(function(global, factory){
if(typeof define=='function'&&define.amd){
define('ev-emitter/ev-emitter',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
global.EvEmitter=factory();
}}(typeof window!='undefined' ? window:this, function(){
function EvEmitter(){}
var proto=EvEmitter.prototype;
proto.on=function(eventName, listener){
if(!eventName||!listener){
return;
}
var events=this._events=this._events||{};
var listeners=events[ eventName ]=events[ eventName ]||[];
if(listeners.indexOf(listener)==-1){
listeners.push(listener);
}
return this;
};
proto.once=function(eventName, listener){
if(!eventName||!listener){
return;
}
this.on(eventName, listener);
var onceEvents=this._onceEvents=this._onceEvents||{};
var onceListeners=onceEvents[ eventName ]=onceEvents[ eventName ]||{};
onceListeners[ listener ]=true;
return this;
};
proto.off=function(eventName, listener){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
var index=listeners.indexOf(listener);
if(index!=-1){
listeners.splice(index, 1);
}
return this;
};
proto.emitEvent=function(eventName, args){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
listeners=listeners.slice(0);
args=args||[];
var onceListeners=this._onceEvents&&this._onceEvents[ eventName ];
for(var i=0; i < listeners.length; i++){
var listener=listeners[i]
var isOnce=onceListeners&&onceListeners[ listener ];
if(isOnce){
this.off(eventName, listener);
delete onceListeners[ listener ];
}
listener.apply(this, args);
}
return this;
};
proto.allOff=function(){
delete this._events;
delete this._onceEvents;
};
return EvEmitter;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('get-size/get-size',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.getSize=factory();
}})(window, function factory(){
'use strict';
function getStyleSize(value){
var num=parseFloat(value);
var isValid=value.indexOf('%')==-1&&!isNaN(num);
return isValid&&num;
}
function noop(){}
var logError=typeof console=='undefined' ? noop :
function(message){
console.error(message);
};
var measurements=[
'paddingLeft',
'paddingRight',
'paddingTop',
'paddingBottom',
'marginLeft',
'marginRight',
'marginTop',
'marginBottom',
'borderLeftWidth',
'borderRightWidth',
'borderTopWidth',
'borderBottomWidth'
];
var measurementsLength=measurements.length;
function getZeroSize(){
var size={
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0
};
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
size[ measurement ]=0;
}
return size;
}
function getStyle(elem){
var style=getComputedStyle(elem);
if(!style){
logError('Style returned ' + style +
'. Are you running this code in a hidden iframe on Firefox? ' +
'See https://bit.ly/getsizebug1');
}
return style;
}
var isSetup=false;
var isBoxSizeOuter;
function setup(){
if(isSetup){
return;
}
isSetup=true;
var div=document.createElement('div');
div.style.width='200px';
div.style.padding='1px 2px 3px 4px';
div.style.borderStyle='solid';
div.style.borderWidth='1px 2px 3px 4px';
div.style.boxSizing='border-box';
var body=document.body||document.documentElement;
body.appendChild(div);
var style=getStyle(div);
isBoxSizeOuter=Math.round(getStyleSize(style.width) )==200;
getSize.isBoxSizeOuter=isBoxSizeOuter;
body.removeChild(div);
}
function getSize(elem){
setup();
if(typeof elem=='string'){
elem=document.querySelector(elem);
}
if(!elem||typeof elem!='object'||!elem.nodeType){
return;
}
var style=getStyle(elem);
if(style.display=='none'){
return getZeroSize();
}
var size={};
size.width=elem.offsetWidth;
size.height=elem.offsetHeight;
var isBorderBox=size.isBorderBox=style.boxSizing=='border-box';
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
var value=style[ measurement ];
var num=parseFloat(value);
size[ measurement ] = !isNaN(num) ? num:0;
}
var paddingWidth=size.paddingLeft + size.paddingRight;
var paddingHeight=size.paddingTop + size.paddingBottom;
var marginWidth=size.marginLeft + size.marginRight;
var marginHeight=size.marginTop + size.marginBottom;
var borderWidth=size.borderLeftWidth + size.borderRightWidth;
var borderHeight=size.borderTopWidth + size.borderBottomWidth;
var isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter;
var styleWidth=getStyleSize(style.width);
if(styleWidth!==false){
size.width=styleWidth +
(isBorderBoxSizeOuter ? 0:paddingWidth + borderWidth);
}
var styleHeight=getStyleSize(style.height);
if(styleHeight!==false){
size.height=styleHeight +
(isBorderBoxSizeOuter ? 0:paddingHeight + borderHeight);
}
size.innerWidth=size.width -(paddingWidth + borderWidth);
size.innerHeight=size.height -(paddingHeight + borderHeight);
size.outerWidth=size.width + marginWidth;
size.outerHeight=size.height + marginHeight;
return size;
}
return getSize;
});
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('desandro-matches-selector/matches-selector',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.matchesSelector=factory();
}}(window, function factory(){
'use strict';
var matchesMethod=(function(){
var ElemProto=window.Element.prototype;
if(ElemProto.matches){
return 'matches';
}
if(ElemProto.matchesSelector){
return 'matchesSelector';
}
var prefixes=[ 'webkit', 'moz', 'ms', 'o' ];
for(var i=0; i < prefixes.length; i++){
var prefix=prefixes[i];
var method=prefix + 'MatchesSelector';
if(ElemProto[ method ]){
return method;
}}
})();
return function matchesSelector(elem, selector){
return elem[ matchesMethod ](selector);
};}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('fizzy-ui-utils/utils',[
'desandro-matches-selector/matches-selector'
], function(matchesSelector){
return factory(window, matchesSelector);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('desandro-matches-selector')
);
}else{
window.fizzyUIUtils=factory(
window,
window.matchesSelector
);
}}(window, function factory(window, matchesSelector){
var utils={};
utils.extend=function(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
};
utils.modulo=function(num, div){
return(( num % div) + div) % div;
};
var arraySlice=Array.prototype.slice;
utils.makeArray=function(obj){
if(Array.isArray(obj) ){
return obj;
}
if(obj===null||obj===undefined){
return [];
}
var isArrayLike=typeof obj=='object'&&typeof obj.length=='number';
if(isArrayLike){
return arraySlice.call(obj);
}
return [ obj ];
};
utils.removeFrom=function(ary, obj){
var index=ary.indexOf(obj);
if(index!=-1){
ary.splice(index, 1);
}};
utils.getParent=function(elem, selector){
while(elem.parentNode&&elem!=document.body){
elem=elem.parentNode;
if(matchesSelector(elem, selector) ){
return elem;
}}
};
utils.getQueryElement=function(elem){
if(typeof elem=='string'){
return document.querySelector(elem);
}
return elem;
};
utils.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
utils.filterFindElements=function(elems, selector){
elems=utils.makeArray(elems);
var ffElems=[];
elems.forEach(function(elem){
if(!(elem instanceof HTMLElement) ){
return;
}
if(!selector){
ffElems.push(elem);
return;
}
if(matchesSelector(elem, selector) ){
ffElems.push(elem);
}
var childElems=elem.querySelectorAll(selector);
for(var i=0; i < childElems.length; i++){
ffElems.push(childElems[i]);
}});
return ffElems;
};
utils.debounceMethod=function(_class, methodName, threshold){
threshold=threshold||100;
var method=_class.prototype[ methodName ];
var timeoutName=methodName + 'Timeout';
_class.prototype[ methodName ]=function(){
var timeout=this[ timeoutName ];
clearTimeout(timeout);
var args=arguments;
var _this=this;
this[ timeoutName ]=setTimeout(function(){
method.apply(_this, args);
delete _this[ timeoutName ];
}, threshold);
};};
utils.docReady=function(callback){
var readyState=document.readyState;
if(readyState=='complete'||readyState=='interactive'){
setTimeout(callback);
}else{
document.addEventListener('DOMContentLoaded', callback);
}};
utils.toDashed=function(str){
return str.replace(/(.)([A-Z])/g, function(match, $1, $2){
return $1 + '-' + $2;
}).toLowerCase();
};
var console=window.console;
utils.htmlInit=function(WidgetClass, namespace){
utils.docReady(function(){
var dashedNamespace=utils.toDashed(namespace);
var dataAttr='data-' + dashedNamespace;
var dataAttrElems=document.querySelectorAll('[' + dataAttr + ']');
var jsDashElems=document.querySelectorAll('.js-' + dashedNamespace);
var elems=utils.makeArray(dataAttrElems)
.concat(utils.makeArray(jsDashElems) );
var dataOptionsAttr=dataAttr + '-options';
var jQuery=window.jQuery;
elems.forEach(function(elem){
var attr=elem.getAttribute(dataAttr) ||
elem.getAttribute(dataOptionsAttr);
var options;
try {
options=attr&&JSON.parse(attr);
} catch(error){
if(console){
console.error('Error parsing ' + dataAttr + ' on ' + elem.className +
': ' + error);
}
return;
}
var instance=new WidgetClass(elem, options);
if(jQuery){
jQuery.data(elem, namespace, instance);
}});
});
};
return utils;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('outlayer/item',[
'ev-emitter/ev-emitter',
'get-size/get-size'
],
factory
);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('ev-emitter'),
require('get-size')
);
}else{
window.Outlayer={};
window.Outlayer.Item=factory(
window.EvEmitter,
window.getSize
);
}}(window, function factory(EvEmitter, getSize){
'use strict';
function isEmptyObj(obj){
for(var prop in obj){
return false;
}
prop=null;
return true;
}
var docElemStyle=document.documentElement.style;
var transitionProperty=typeof docElemStyle.transition=='string' ?
'transition':'WebkitTransition';
var transformProperty=typeof docElemStyle.transform=='string' ?
'transform':'WebkitTransform';
var transitionEndEvent={
WebkitTransition: 'webkitTransitionEnd',
transition: 'transitionend'
}[ transitionProperty ];
var vendorProperties={
transform: transformProperty,
transition: transitionProperty,
transitionDuration: transitionProperty + 'Duration',
transitionProperty: transitionProperty + 'Property',
transitionDelay: transitionProperty + 'Delay'
};
function Item(element, layout){
if(!element){
return;
}
this.element=element;
this.layout=layout;
this.position={
x: 0,
y: 0
};
this._create();
}
var proto=Item.prototype=Object.create(EvEmitter.prototype);
proto.constructor=Item;
proto._create=function(){
this._transn={
ingProperties: {},
clean: {},
onEnd: {}};
this.css({
position: 'absolute'
});
};
proto.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
proto.getSize=function(){
this.size=getSize(this.element);
};
proto.css=function(style){
var elemStyle=this.element.style;
for(var prop in style){
var supportedProp=vendorProperties[ prop ]||prop;
elemStyle[ supportedProp ]=style[ prop ];
}};
proto.getPosition=function(){
var style=getComputedStyle(this.element);
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
var xValue=style[ isOriginLeft ? 'left':'right' ];
var yValue=style[ isOriginTop ? 'top':'bottom' ];
var x=parseFloat(xValue);
var y=parseFloat(yValue);
var layoutSize=this.layout.size;
if(xValue.indexOf('%')!=-1){
x=(x / 100) * layoutSize.width;
}
if(yValue.indexOf('%')!=-1){
y=(y / 100) * layoutSize.height;
}
x=isNaN(x) ? 0:x;
y=isNaN(y) ? 0:y;
x -=isOriginLeft ? layoutSize.paddingLeft:layoutSize.paddingRight;
y -=isOriginTop ? layoutSize.paddingTop:layoutSize.paddingBottom;
this.position.x=x;
this.position.y=y;
};
proto.layoutPosition=function(){
var layoutSize=this.layout.size;
var style={};
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
var xPadding=isOriginLeft ? 'paddingLeft':'paddingRight';
var xProperty=isOriginLeft ? 'left':'right';
var xResetProperty=isOriginLeft ? 'right':'left';
var x=this.position.x + layoutSize[ xPadding ];
style[ xProperty ]=this.getXValue(x);
style[ xResetProperty ]='';
var yPadding=isOriginTop ? 'paddingTop':'paddingBottom';
var yProperty=isOriginTop ? 'top':'bottom';
var yResetProperty=isOriginTop ? 'bottom':'top';
var y=this.position.y + layoutSize[ yPadding ];
style[ yProperty ]=this.getYValue(y);
style[ yResetProperty ]='';
this.css(style);
this.emitEvent('layout', [ this ]);
};
proto.getXValue=function(x){
var isHorizontal=this.layout._getOption('horizontal');
return this.layout.options.percentPosition&&!isHorizontal ?
(( x / this.layout.size.width) * 100) + '%':x + 'px';
};
proto.getYValue=function(y){
var isHorizontal=this.layout._getOption('horizontal');
return this.layout.options.percentPosition&&isHorizontal ?
(( y / this.layout.size.height) * 100) + '%':y + 'px';
};
proto._transitionTo=function(x, y){
this.getPosition();
var curX=this.position.x;
var curY=this.position.y;
var didNotMove=x==this.position.x&&y==this.position.y;
this.setPosition(x, y);
if(didNotMove&&!this.isTransitioning){
this.layoutPosition();
return;
}
var transX=x - curX;
var transY=y - curY;
var transitionStyle={};
transitionStyle.transform=this.getTranslate(transX, transY);
this.transition({
to: transitionStyle,
onTransitionEnd: {
transform: this.layoutPosition
},
isCleaning: true
});
};
proto.getTranslate=function(x, y){
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
x=isOriginLeft ? x:-x;
y=isOriginTop ? y:-y;
return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
};
proto.goTo=function(x, y){
this.setPosition(x, y);
this.layoutPosition();
};
proto.moveTo=proto._transitionTo;
proto.setPosition=function(x, y){
this.position.x=parseFloat(x);
this.position.y=parseFloat(y);
};
proto._nonTransition=function(args){
this.css(args.to);
if(args.isCleaning){
this._removeStyles(args.to);
}
for(var prop in args.onTransitionEnd){
args.onTransitionEnd[ prop ].call(this);
}};
proto.transition=function(args){
if(!parseFloat(this.layout.options.transitionDuration) ){
this._nonTransition(args);
return;
}
var _transition=this._transn;
for(var prop in args.onTransitionEnd){
_transition.onEnd[ prop ]=args.onTransitionEnd[ prop ];
}
for(prop in args.to){
_transition.ingProperties[ prop ]=true;
if(args.isCleaning){
_transition.clean[ prop ]=true;
}}
if(args.from){
this.css(args.from);
var h=this.element.offsetHeight;
h=null;
}
this.enableTransition(args.to);
this.css(args.to);
this.isTransitioning=true;
};
function toDashedAll(str){
return str.replace(/([A-Z])/g, function($1){
return '-' + $1.toLowerCase();
});
}
var transitionProps='opacity,' + toDashedAll(transformProperty);
proto.enableTransition=function(){
if(this.isTransitioning){
return;
}
var duration=this.layout.options.transitionDuration;
duration=typeof duration=='number' ? duration + 'ms':duration;
this.css({
transitionProperty: transitionProps,
transitionDuration: duration,
transitionDelay: this.staggerDelay||0
});
this.element.addEventListener(transitionEndEvent, this, false);
};
proto.onwebkitTransitionEnd=function(event){
this.ontransitionend(event);
};
proto.onotransitionend=function(event){
this.ontransitionend(event);
};
var dashedVendorProperties={
'-webkit-transform': 'transform'
};
proto.ontransitionend=function(event){
if(event.target!==this.element){
return;
}
var _transition=this._transn;
var propertyName=dashedVendorProperties[ event.propertyName ]||event.propertyName;
delete _transition.ingProperties[ propertyName ];
if(isEmptyObj(_transition.ingProperties) ){
this.disableTransition();
}
if(propertyName in _transition.clean){
this.element.style[ event.propertyName ]='';
delete _transition.clean[ propertyName ];
}
if(propertyName in _transition.onEnd){
var onTransitionEnd=_transition.onEnd[ propertyName ];
onTransitionEnd.call(this);
delete _transition.onEnd[ propertyName ];
}
this.emitEvent('transitionEnd', [ this ]);
};
proto.disableTransition=function(){
this.removeTransitionStyles();
this.element.removeEventListener(transitionEndEvent, this, false);
this.isTransitioning=false;
};
proto._removeStyles=function(style){
var cleanStyle={};
for(var prop in style){
cleanStyle[ prop ]='';
}
this.css(cleanStyle);
};
var cleanTransitionStyle={
transitionProperty: '',
transitionDuration: '',
transitionDelay: ''
};
proto.removeTransitionStyles=function(){
this.css(cleanTransitionStyle);
};
proto.stagger=function(delay){
delay=isNaN(delay) ? 0:delay;
this.staggerDelay=delay + 'ms';
};
proto.removeElem=function(){
this.element.parentNode.removeChild(this.element);
this.css({ display: '' });
this.emitEvent('remove', [ this ]);
};
proto.remove=function(){
if(!transitionProperty||!parseFloat(this.layout.options.transitionDuration) ){
this.removeElem();
return;
}
this.once('transitionEnd', function(){
this.removeElem();
});
this.hide();
};
proto.reveal=function(){
delete this.isHidden;
this.css({ display: '' });
var options=this.layout.options;
var onTransitionEnd={};
var transitionEndProperty=this.getHideRevealTransitionEndProperty('visibleStyle');
onTransitionEnd[ transitionEndProperty ]=this.onRevealTransitionEnd;
this.transition({
from: options.hiddenStyle,
to: options.visibleStyle,
isCleaning: true,
onTransitionEnd: onTransitionEnd
});
};
proto.onRevealTransitionEnd=function(){
if(!this.isHidden){
this.emitEvent('reveal');
}};
proto.getHideRevealTransitionEndProperty=function(styleProperty){
var optionStyle=this.layout.options[ styleProperty ];
if(optionStyle.opacity){
return 'opacity';
}
for(var prop in optionStyle){
return prop;
}};
proto.hide=function(){
this.isHidden=true;
this.css({ display: '' });
var options=this.layout.options;
var onTransitionEnd={};
var transitionEndProperty=this.getHideRevealTransitionEndProperty('hiddenStyle');
onTransitionEnd[ transitionEndProperty ]=this.onHideTransitionEnd;
this.transition({
from: options.visibleStyle,
to: options.hiddenStyle,
isCleaning: true,
onTransitionEnd: onTransitionEnd
});
};
proto.onHideTransitionEnd=function(){
if(this.isHidden){
this.css({ display: 'none' });
this.emitEvent('hide');
}};
proto.destroy=function(){
this.css({
position: '',
left: '',
right: '',
top: '',
bottom: '',
transition: '',
transform: ''
});
};
return Item;
}));
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('outlayer/outlayer',[
'ev-emitter/ev-emitter',
'get-size/get-size',
'fizzy-ui-utils/utils',
'./item'
],
function(EvEmitter, getSize, utils, Item){
return factory(window, EvEmitter, getSize, utils, Item);
}
);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('ev-emitter'),
require('get-size'),
require('fizzy-ui-utils'),
require('./item')
);
}else{
window.Outlayer=factory(
window,
window.EvEmitter,
window.getSize,
window.fizzyUIUtils,
window.Outlayer.Item
);
}}(window, function factory(window, EvEmitter, getSize, utils, Item){
'use strict';
var console=window.console;
var jQuery=window.jQuery;
var noop=function(){};
var GUID=0;
var instances={};
function Outlayer(element, options){
var queryElement=utils.getQueryElement(element);
if(!queryElement){
if(console){
console.error('Bad element for ' + this.constructor.namespace +
': ' +(queryElement||element) );
}
return;
}
this.element=queryElement;
if(jQuery){
this.$element=jQuery(this.element);
}
this.options=utils.extend({}, this.constructor.defaults);
this.option(options);
var id=++GUID;
this.element.outlayerGUID=id;
instances[ id ]=this;
this._create();
var isInitLayout=this._getOption('initLayout');
if(isInitLayout){
this.layout();
}}
Outlayer.namespace='outlayer';
Outlayer.Item=Item;
Outlayer.defaults={
containerStyle: {
position: 'relative'
},
initLayout: true,
originLeft: true,
originTop: true,
resize: true,
resizeContainer: true,
transitionDuration: '0.4s',
hiddenStyle: {
opacity: 0,
transform: 'scale(0.001)'
},
visibleStyle: {
opacity: 1,
transform: 'scale(1)'
}};
var proto=Outlayer.prototype;
utils.extend(proto, EvEmitter.prototype);
proto.option=function(opts){
utils.extend(this.options, opts);
};
proto._getOption=function(option){
var oldOption=this.constructor.compatOptions[ option ];
return oldOption&&this.options[ oldOption ]!==undefined ?
this.options[ oldOption ]:this.options[ option ];
};
Outlayer.compatOptions={
initLayout: 'isInitLayout',
horizontal: 'isHorizontal',
layoutInstant: 'isLayoutInstant',
originLeft: 'isOriginLeft',
originTop: 'isOriginTop',
resize: 'isResizeBound',
resizeContainer: 'isResizingContainer'
};
proto._create=function(){
this.reloadItems();
this.stamps=[];
this.stamp(this.options.stamp);
utils.extend(this.element.style, this.options.containerStyle);
var canBindResize=this._getOption('resize');
if(canBindResize){
this.bindResize();
}};
proto.reloadItems=function(){
this.items=this._itemize(this.element.children);
};
proto._itemize=function(elems){
var itemElems=this._filterFindItemElements(elems);
var Item=this.constructor.Item;
var items=[];
for(var i=0; i < itemElems.length; i++){
var elem=itemElems[i];
var item=new Item(elem, this);
items.push(item);
}
return items;
};
proto._filterFindItemElements=function(elems){
return utils.filterFindElements(elems, this.options.itemSelector);
};
proto.getItemElements=function(){
return this.items.map(function(item){
return item.element;
});
};
proto.layout=function(){
this._resetLayout();
this._manageStamps();
var layoutInstant=this._getOption('layoutInstant');
var isInstant=layoutInstant!==undefined ?
layoutInstant:!this._isLayoutInited;
this.layoutItems(this.items, isInstant);
this._isLayoutInited=true;
};
proto._init=proto.layout;
proto._resetLayout=function(){
this.getSize();
};
proto.getSize=function(){
this.size=getSize(this.element);
};
proto._getMeasurement=function(measurement, size){
var option=this.options[ measurement ];
var elem;
if(!option){
this[ measurement ]=0;
}else{
if(typeof option=='string'){
elem=this.element.querySelector(option);
}else if(option instanceof HTMLElement){
elem=option;
}
this[ measurement ]=elem ? getSize(elem)[ size ]:option;
}};
proto.layoutItems=function(items, isInstant){
items=this._getItemsForLayout(items);
this._layoutItems(items, isInstant);
this._postLayout();
};
proto._getItemsForLayout=function(items){
return items.filter(function(item){
return !item.isIgnored;
});
};
proto._layoutItems=function(items, isInstant){
this._emitCompleteOnItems('layout', items);
if(!items||!items.length){
return;
}
var queue=[];
items.forEach(function(item){
var position=this._getItemLayoutPosition(item);
position.item=item;
position.isInstant=isInstant||item.isLayoutInstant;
queue.push(position);
}, this);
this._processLayoutQueue(queue);
};
proto._getItemLayoutPosition=function(){
return {
x: 0,
y: 0
};};
proto._processLayoutQueue=function(queue){
this.updateStagger();
queue.forEach(function(obj, i){
this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i);
}, this);
};
proto.updateStagger=function(){
var stagger=this.options.stagger;
if(stagger===null||stagger===undefined){
this.stagger=0;
return;
}
this.stagger=getMilliseconds(stagger);
return this.stagger;
};
proto._positionItem=function(item, x, y, isInstant, i){
if(isInstant){
item.goTo(x, y);
}else{
item.stagger(i * this.stagger);
item.moveTo(x, y);
}};
proto._postLayout=function(){
this.resizeContainer();
};
proto.resizeContainer=function(){
var isResizingContainer=this._getOption('resizeContainer');
if(!isResizingContainer){
return;
}
var size=this._getContainerSize();
if(size){
this._setContainerMeasure(size.width, true);
this._setContainerMeasure(size.height, false);
}};
proto._getContainerSize=noop;
proto._setContainerMeasure=function(measure, isWidth){
if(measure===undefined){
return;
}
var elemSize=this.size;
if(elemSize.isBorderBox){
measure +=isWidth ? elemSize.paddingLeft + elemSize.paddingRight +
elemSize.borderLeftWidth + elemSize.borderRightWidth :
elemSize.paddingBottom + elemSize.paddingTop +
elemSize.borderTopWidth + elemSize.borderBottomWidth;
}
measure=Math.max(measure, 0);
this.element.style[ isWidth ? 'width':'height' ]=measure + 'px';
};
proto._emitCompleteOnItems=function(eventName, items){
var _this=this;
function onComplete(){
_this.dispatchEvent(eventName + 'Complete', null, [ items ]);
}
var count=items.length;
if(!items||!count){
onComplete();
return;
}
var doneCount=0;
function tick(){
doneCount++;
if(doneCount==count){
onComplete();
}}
items.forEach(function(item){
item.once(eventName, tick);
});
};
proto.dispatchEvent=function(type, event, args){
var emitArgs=event ? [ event ].concat(args):args;
this.emitEvent(type, emitArgs);
if(jQuery){
this.$element=this.$element||jQuery(this.element);
if(event){
var $event=jQuery.Event(event);
$event.type=type;
this.$element.trigger($event, args);
}else{
this.$element.trigger(type, args);
}}
};
proto.ignore=function(elem){
var item=this.getItem(elem);
if(item){
item.isIgnored=true;
}};
proto.unignore=function(elem){
var item=this.getItem(elem);
if(item){
delete item.isIgnored;
}};
proto.stamp=function(elems){
elems=this._find(elems);
if(!elems){
return;
}
this.stamps=this.stamps.concat(elems);
elems.forEach(this.ignore, this);
};
proto.unstamp=function(elems){
elems=this._find(elems);
if(!elems){
return;
}
elems.forEach(function(elem){
utils.removeFrom(this.stamps, elem);
this.unignore(elem);
}, this);
};
proto._find=function(elems){
if(!elems){
return;
}
if(typeof elems=='string'){
elems=this.element.querySelectorAll(elems);
}
elems=utils.makeArray(elems);
return elems;
};
proto._manageStamps=function(){
if(!this.stamps||!this.stamps.length){
return;
}
this._getBoundingRect();
this.stamps.forEach(this._manageStamp, this);
};
proto._getBoundingRect=function(){
var boundingRect=this.element.getBoundingClientRect();
var size=this.size;
this._boundingRect={
left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
top: boundingRect.top + size.paddingTop + size.borderTopWidth,
right: boundingRect.right -(size.paddingRight + size.borderRightWidth),
bottom: boundingRect.bottom -(size.paddingBottom + size.borderBottomWidth)
};};
proto._manageStamp=noop;
proto._getElementOffset=function(elem){
var boundingRect=elem.getBoundingClientRect();
var thisRect=this._boundingRect;
var size=getSize(elem);
var offset={
left: boundingRect.left - thisRect.left - size.marginLeft,
top: boundingRect.top - thisRect.top - size.marginTop,
right: thisRect.right - boundingRect.right - size.marginRight,
bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
};
return offset;
};
proto.handleEvent=utils.handleEvent;
proto.bindResize=function(){
window.addEventListener('resize', this);
this.isResizeBound=true;
};
proto.unbindResize=function(){
window.removeEventListener('resize', this);
this.isResizeBound=false;
};
proto.onresize=function(){
this.resize();
};
utils.debounceMethod(Outlayer, 'onresize', 100);
proto.resize=function(){
if(!this.isResizeBound||!this.needsResizeLayout()){
return;
}
this.layout();
};
proto.needsResizeLayout=function(){
var size=getSize(this.element);
var hasSizes=this.size&&size;
return hasSizes&&size.innerWidth!==this.size.innerWidth;
};
proto.addItems=function(elems){
var items=this._itemize(elems);
if(items.length){
this.items=this.items.concat(items);
}
return items;
};
proto.appended=function(elems){
var items=this.addItems(elems);
if(!items.length){
return;
}
this.layoutItems(items, true);
this.reveal(items);
};
proto.prepended=function(elems){
var items=this._itemize(elems);
if(!items.length){
return;
}
var previousItems=this.items.slice(0);
this.items=items.concat(previousItems);
this._resetLayout();
this._manageStamps();
this.layoutItems(items, true);
this.reveal(items);
this.layoutItems(previousItems);
};
proto.reveal=function(items){
this._emitCompleteOnItems('reveal', items);
if(!items||!items.length){
return;
}
var stagger=this.updateStagger();
items.forEach(function(item, i){
item.stagger(i * stagger);
item.reveal();
});
};
proto.hide=function(items){
this._emitCompleteOnItems('hide', items);
if(!items||!items.length){
return;
}
var stagger=this.updateStagger();
items.forEach(function(item, i){
item.stagger(i * stagger);
item.hide();
});
};
proto.revealItemElements=function(elems){
var items=this.getItems(elems);
this.reveal(items);
};
proto.hideItemElements=function(elems){
var items=this.getItems(elems);
this.hide(items);
};
proto.getItem=function(elem){
for(var i=0; i < this.items.length; i++){
var item=this.items[i];
if(item.element==elem){
return item;
}}
};
proto.getItems=function(elems){
elems=utils.makeArray(elems);
var items=[];
elems.forEach(function(elem){
var item=this.getItem(elem);
if(item){
items.push(item);
}}, this);
return items;
};
proto.remove=function(elems){
var removeItems=this.getItems(elems);
this._emitCompleteOnItems('remove', removeItems);
if(!removeItems||!removeItems.length){
return;
}
removeItems.forEach(function(item){
item.remove();
utils.removeFrom(this.items, item);
}, this);
};
proto.destroy=function(){
var style=this.element.style;
style.height='';
style.position='';
style.width='';
this.items.forEach(function(item){
item.destroy();
});
this.unbindResize();
var id=this.element.outlayerGUID;
delete instances[ id ];
delete this.element.outlayerGUID;
if(jQuery){
jQuery.removeData(this.element, this.constructor.namespace);
}};
Outlayer.data=function(elem){
elem=utils.getQueryElement(elem);
var id=elem&&elem.outlayerGUID;
return id&&instances[ id ];
};
Outlayer.create=function(namespace, options){
var Layout=subclass(Outlayer);
Layout.defaults=utils.extend({}, Outlayer.defaults);
utils.extend(Layout.defaults, options);
Layout.compatOptions=utils.extend({}, Outlayer.compatOptions);
Layout.namespace=namespace;
Layout.data=Outlayer.data;
Layout.Item=subclass(Item);
utils.htmlInit(Layout, namespace);
if(jQuery&&jQuery.bridget){
jQuery.bridget(namespace, Layout);
}
return Layout;
};
function subclass(Parent){
function SubClass(){
Parent.apply(this, arguments);
}
SubClass.prototype=Object.create(Parent.prototype);
SubClass.prototype.constructor=SubClass;
return SubClass;
}
var msUnits={
ms: 1,
s: 1000
};
function getMilliseconds(time){
if(typeof time=='number'){
return time;
}
var matches=time.match(/(^\d*\.?\d*)(\w*)/);
var num=matches&&matches[1];
var unit=matches&&matches[2];
if(!num.length){
return 0;
}
num=parseFloat(num);
var mult=msUnits[ unit ]||1;
return num * mult;
}
Outlayer.Item=Item;
return Outlayer;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('isotope-layout/js/item',[
'outlayer/outlayer'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('outlayer')
);
}else{
window.Isotope=window.Isotope||{};
window.Isotope.Item=factory(
window.Outlayer
);
}}(window, function factory(Outlayer){
'use strict';
function Item(){
Outlayer.Item.apply(this, arguments);
}
var proto=Item.prototype=Object.create(Outlayer.Item.prototype);
var _create=proto._create;
proto._create=function(){
this.id=this.layout.itemGUID++;
_create.call(this);
this.sortData={};};
proto.updateSortData=function(){
if(this.isIgnored){
return;
}
this.sortData.id=this.id;
this.sortData['original-order']=this.id;
this.sortData.random=Math.random();
var getSortData=this.layout.options.getSortData;
var sorters=this.layout._sorters;
for(var key in getSortData){
var sorter=sorters[ key ];
this.sortData[ key ]=sorter(this.element, this);
}};
var _destroy=proto.destroy;
proto.destroy=function(){
_destroy.apply(this, arguments);
this.css({
display: ''
});
};
return Item;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('isotope-layout/js/layout-mode',[
'get-size/get-size',
'outlayer/outlayer'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('get-size'),
require('outlayer')
);
}else{
window.Isotope=window.Isotope||{};
window.Isotope.LayoutMode=factory(
window.getSize,
window.Outlayer
);
}}(window, function factory(getSize, Outlayer){
'use strict';
function LayoutMode(isotope){
this.isotope=isotope;
if(isotope){
this.options=isotope.options[ this.namespace ];
this.element=isotope.element;
this.items=isotope.filteredItems;
this.size=isotope.size;
}}
var proto=LayoutMode.prototype;
var facadeMethods=[
'_resetLayout',
'_getItemLayoutPosition',
'_manageStamp',
'_getContainerSize',
'_getElementOffset',
'needsResizeLayout',
'_getOption'
];
facadeMethods.forEach(function(methodName){
proto[ methodName ]=function(){
return Outlayer.prototype[ methodName ].apply(this.isotope, arguments);
};});
proto.needsVerticalResizeLayout=function(){
var size=getSize(this.isotope.element);
var hasSizes=this.isotope.size&&size;
return hasSizes&&size.innerHeight!=this.isotope.size.innerHeight;
};
proto._getMeasurement=function(){
this.isotope._getMeasurement.apply(this, arguments);
};
proto.getColumnWidth=function(){
this.getSegmentSize('column', 'Width');
};
proto.getRowHeight=function(){
this.getSegmentSize('row', 'Height');
};
proto.getSegmentSize=function(segment, size){
var segmentName=segment + size;
var outerSize='outer' + size;
this._getMeasurement(segmentName, outerSize);
if(this[ segmentName ]){
return;
}
var firstItemSize=this.getFirstItemSize();
this[ segmentName ]=firstItemSize&&firstItemSize[ outerSize ] ||
this.isotope.size[ 'inner' + size ];
};
proto.getFirstItemSize=function(){
var firstItem=this.isotope.filteredItems[0];
return firstItem&&firstItem.element&&getSize(firstItem.element);
};
proto.layout=function(){
this.isotope.layout.apply(this.isotope, arguments);
};
proto.getSize=function(){
this.isotope.getSize();
this.size=this.isotope.size;
};
LayoutMode.modes={};
LayoutMode.create=function(namespace, options){
function Mode(){
LayoutMode.apply(this, arguments);
}
Mode.prototype=Object.create(proto);
Mode.prototype.constructor=Mode;
if(options){
Mode.options=options;
}
Mode.prototype.namespace=namespace;
LayoutMode.modes[ namespace ]=Mode;
return Mode;
};
return LayoutMode;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('masonry-layout/masonry',[
'outlayer/outlayer',
'get-size/get-size'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('outlayer'),
require('get-size')
);
}else{
window.Masonry=factory(
window.Outlayer,
window.getSize
);
}}(window, function factory(Outlayer, getSize){
var Masonry=Outlayer.create('masonry');
Masonry.compatOptions.fitWidth='isFitWidth';
var proto=Masonry.prototype;
proto._resetLayout=function(){
this.getSize();
this._getMeasurement('columnWidth', 'outerWidth');
this._getMeasurement('gutter', 'outerWidth');
this.measureColumns();
this.colYs=[];
for(var i=0; i < this.cols; i++){
this.colYs.push(0);
}
this.maxY=0;
this.horizontalColIndex=0;
};
proto.measureColumns=function(){
this.getContainerWidth();
if(!this.columnWidth){
var firstItem=this.items[0];
var firstItemElem=firstItem&&firstItem.element;
this.columnWidth=firstItemElem&&getSize(firstItemElem).outerWidth ||
this.containerWidth;
}
var columnWidth=this.columnWidth +=this.gutter;
var containerWidth=this.containerWidth + this.gutter;
var cols=containerWidth / columnWidth;
var excess=columnWidth - containerWidth % columnWidth;
var mathMethod=excess&&excess < 1 ? 'round':'floor';
cols=Math[ mathMethod ](cols);
this.cols=Math.max(cols, 1);
};
proto.getContainerWidth=function(){
var isFitWidth=this._getOption('fitWidth');
var container=isFitWidth ? this.element.parentNode:this.element;
var size=getSize(container);
this.containerWidth=size&&size.innerWidth;
};
proto._getItemLayoutPosition=function(item){
item.getSize();
var remainder=item.size.outerWidth % this.columnWidth;
var mathMethod=remainder&&remainder < 1 ? 'round':'ceil';
var colSpan=Math[ mathMethod ](item.size.outerWidth / this.columnWidth);
colSpan=Math.min(colSpan, this.cols);
var colPosMethod=this.options.horizontalOrder ?
'_getHorizontalColPosition':'_getTopColPosition';
var colPosition=this[ colPosMethod ](colSpan, item);
var position={
x: this.columnWidth * colPosition.col,
y: colPosition.y
};
var setHeight=colPosition.y + item.size.outerHeight;
var setMax=colSpan + colPosition.col;
for(var i=colPosition.col; i < setMax; i++){
this.colYs[i]=setHeight;
}
return position;
};
proto._getTopColPosition=function(colSpan){
var colGroup=this._getTopColGroup(colSpan);
var minimumY=Math.min.apply(Math, colGroup);
return {
col: colGroup.indexOf(minimumY),
y: minimumY,
};};
proto._getTopColGroup=function(colSpan){
if(colSpan < 2){
return this.colYs;
}
var colGroup=[];
var groupCount=this.cols + 1 - colSpan;
for(var i=0; i < groupCount; i++){
colGroup[i]=this._getColGroupY(i, colSpan);
}
return colGroup;
};
proto._getColGroupY=function(col, colSpan){
if(colSpan < 2){
return this.colYs[ col ];
}
var groupColYs=this.colYs.slice(col, col + colSpan);
return Math.max.apply(Math, groupColYs);
};
proto._getHorizontalColPosition=function(colSpan, item){
var col=this.horizontalColIndex % this.cols;
var isOver=colSpan > 1&&col + colSpan > this.cols;
col=isOver ? 0:col;
var hasSize=item.size.outerWidth&&item.size.outerHeight;
this.horizontalColIndex=hasSize ? col + colSpan:this.horizontalColIndex;
return {
col: col,
y: this._getColGroupY(col, colSpan),
};};
proto._manageStamp=function(stamp){
var stampSize=getSize(stamp);
var offset=this._getElementOffset(stamp);
var isOriginLeft=this._getOption('originLeft');
var firstX=isOriginLeft ? offset.left:offset.right;
var lastX=firstX + stampSize.outerWidth;
var firstCol=Math.floor(firstX / this.columnWidth);
firstCol=Math.max(0, firstCol);
var lastCol=Math.floor(lastX / this.columnWidth);
lastCol -=lastX % this.columnWidth ? 0:1;
lastCol=Math.min(this.cols - 1, lastCol);
var isOriginTop=this._getOption('originTop');
var stampMaxY=(isOriginTop ? offset.top:offset.bottom) +
stampSize.outerHeight;
for(var i=firstCol; i <=lastCol; i++){
this.colYs[i]=Math.max(stampMaxY, this.colYs[i]);
}};
proto._getContainerSize=function(){
this.maxY=Math.max.apply(Math, this.colYs);
var size={
height: this.maxY
};
if(this._getOption('fitWidth')){
size.width=this._getContainerFitWidth();
}
return size;
};
proto._getContainerFitWidth=function(){
var unusedCols=0;
var i=this.cols;
while(--i){
if(this.colYs[i]!==0){
break;
}
unusedCols++;
}
return(this.cols - unusedCols) * this.columnWidth - this.gutter;
};
proto.needsResizeLayout=function(){
var previousWidth=this.containerWidth;
this.getContainerWidth();
return previousWidth!=this.containerWidth;
};
return Masonry;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('isotope-layout/js/layout-modes/masonry',[
'../layout-mode',
'masonry-layout/masonry'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('../layout-mode'),
require('masonry-layout')
);
}else{
factory(
window.Isotope.LayoutMode,
window.Masonry
);
}}(window, function factory(LayoutMode, Masonry){
'use strict';
var MasonryMode=LayoutMode.create('masonry');
var proto=MasonryMode.prototype;
var keepModeMethods={
_getElementOffset: true,
layout: true,
_getMeasurement: true
};
for(var method in Masonry.prototype){
if(!keepModeMethods[ method ]){
proto[ method ]=Masonry.prototype[ method ];
}}
var measureColumns=proto.measureColumns;
proto.measureColumns=function(){
this.items=this.isotope.filteredItems;
measureColumns.call(this);
};
var _getOption=proto._getOption;
proto._getOption=function(option){
if(option=='fitWidth'){
return this.options.isFitWidth!==undefined ?
this.options.isFitWidth:this.options.fitWidth;
}
return _getOption.apply(this.isotope, arguments);
};
return MasonryMode;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('isotope-layout/js/layout-modes/fit-rows',[
'../layout-mode'
],
factory);
}else if(typeof exports=='object'){
module.exports=factory(
require('../layout-mode')
);
}else{
factory(
window.Isotope.LayoutMode
);
}}(window, function factory(LayoutMode){
'use strict';
var FitRows=LayoutMode.create('fitRows');
var proto=FitRows.prototype;
proto._resetLayout=function(){
this.x=0;
this.y=0;
this.maxY=0;
this._getMeasurement('gutter', 'outerWidth');
};
proto._getItemLayoutPosition=function(item){
item.getSize();
var itemWidth=item.size.outerWidth + this.gutter;
var containerWidth=this.isotope.size.innerWidth + this.gutter;
if(this.x!==0&&itemWidth + this.x > containerWidth){
this.x=0;
this.y=this.maxY;
}
var position={
x: this.x,
y: this.y
};
this.maxY=Math.max(this.maxY, this.y + item.size.outerHeight);
this.x +=itemWidth;
return position;
};
proto._getContainerSize=function(){
return { height: this.maxY };};
return FitRows;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('isotope-layout/js/layout-modes/vertical',[
'../layout-mode'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('../layout-mode')
);
}else{
factory(
window.Isotope.LayoutMode
);
}}(window, function factory(LayoutMode){
'use strict';
var Vertical=LayoutMode.create('vertical', {
horizontalAlignment: 0
});
var proto=Vertical.prototype;
proto._resetLayout=function(){
this.y=0;
};
proto._getItemLayoutPosition=function(item){
item.getSize();
var x=(this.isotope.size.innerWidth - item.size.outerWidth) *
this.options.horizontalAlignment;
var y=this.y;
this.y +=item.size.outerHeight;
return { x: x, y: y };};
proto._getContainerSize=function(){
return { height: this.y };};
return Vertical;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define([
'outlayer/outlayer',
'get-size/get-size',
'desandro-matches-selector/matches-selector',
'fizzy-ui-utils/utils',
'isotope-layout/js/item',
'isotope-layout/js/layout-mode',
'isotope-layout/js/layout-modes/masonry',
'isotope-layout/js/layout-modes/fit-rows',
'isotope-layout/js/layout-modes/vertical'
],
function(Outlayer, getSize, matchesSelector, utils, Item, LayoutMode){
return factory(window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('outlayer'),
require('get-size'),
require('desandro-matches-selector'),
require('fizzy-ui-utils'),
require('isotope-layout/js/item'),
require('isotope-layout/js/layout-mode'),
require('isotope-layout/js/layout-modes/masonry'),
require('isotope-layout/js/layout-modes/fit-rows'),
require('isotope-layout/js/layout-modes/vertical')
);
}else{
window.Isotope=factory(
window,
window.Outlayer,
window.getSize,
window.matchesSelector,
window.fizzyUIUtils,
window.Isotope.Item,
window.Isotope.LayoutMode
);
}}(window, function factory(window, Outlayer, getSize, matchesSelector, utils,
Item, LayoutMode){
var jQuery=window.jQuery;
var trim=String.prototype.trim ?
function(str){
return str.trim();
} :
function(str){
return str.replace(/^\s+|\s+$/g, '');
};
var Isotope=Outlayer.create('isotope', {
layoutMode: 'masonry',
isJQueryFiltering: true,
sortAscending: true
});
Isotope.Item=Item;
Isotope.LayoutMode=LayoutMode;
var proto=Isotope.prototype;
proto._create=function(){
this.itemGUID=0;
this._sorters={};
this._getSorters();
Outlayer.prototype._create.call(this);
this.modes={};
this.filteredItems=this.items;
this.sortHistory=[ 'original-order' ];
for(var name in LayoutMode.modes){
this._initLayoutMode(name);
}};
proto.reloadItems=function(){
this.itemGUID=0;
Outlayer.prototype.reloadItems.call(this);
};
proto._itemize=function(){
var items=Outlayer.prototype._itemize.apply(this, arguments);
for(var i=0; i < items.length; i++){
var item=items[i];
item.id=this.itemGUID++;
}
this._updateItemsSortData(items);
return items;
};
proto._initLayoutMode=function(name){
var Mode=LayoutMode.modes[ name ];
var initialOpts=this.options[ name ]||{};
this.options[ name ]=Mode.options ?
utils.extend(Mode.options, initialOpts):initialOpts;
this.modes[ name ]=new Mode(this);
};
proto.layout=function(){
if(!this._isLayoutInited&&this._getOption('initLayout')){
this.arrange();
return;
}
this._layout();
};
proto._layout=function(){
var isInstant=this._getIsInstant();
this._resetLayout();
this._manageStamps();
this.layoutItems(this.filteredItems, isInstant);
this._isLayoutInited=true;
};
proto.arrange=function(opts){
this.option(opts);
this._getIsInstant();
var filtered=this._filter(this.items);
this.filteredItems=filtered.matches;
this._bindArrangeComplete();
if(this._isInstant){
this._noTransition(this._hideReveal, [ filtered ]);
}else{
this._hideReveal(filtered);
}
this._sort();
this._layout();
};
proto._init=proto.arrange;
proto._hideReveal=function(filtered){
this.reveal(filtered.needReveal);
this.hide(filtered.needHide);
};
proto._getIsInstant=function(){
var isLayoutInstant=this._getOption('layoutInstant');
var isInstant=isLayoutInstant!==undefined ? isLayoutInstant :
!this._isLayoutInited;
this._isInstant=isInstant;
return isInstant;
};
proto._bindArrangeComplete=function(){
var isLayoutComplete, isHideComplete, isRevealComplete;
var _this=this;
function arrangeParallelCallback(){
if(isLayoutComplete&&isHideComplete&&isRevealComplete){
_this.dispatchEvent('arrangeComplete', null, [ _this.filteredItems ]);
}}
this.once('layoutComplete', function(){
isLayoutComplete=true;
arrangeParallelCallback();
});
this.once('hideComplete', function(){
isHideComplete=true;
arrangeParallelCallback();
});
this.once('revealComplete', function(){
isRevealComplete=true;
arrangeParallelCallback();
});
};
proto._filter=function(items){
var filter=this.options.filter;
filter=filter||'*';
var matches=[];
var hiddenMatched=[];
var visibleUnmatched=[];
var test=this._getFilterTest(filter);
for(var i=0; i < items.length; i++){
var item=items[i];
if(item.isIgnored){
continue;
}
var isMatched=test(item);
if(isMatched){
matches.push(item);
}
if(isMatched&&item.isHidden){
hiddenMatched.push(item);
}else if(!isMatched&&!item.isHidden){
visibleUnmatched.push(item);
}}
return {
matches: matches,
needReveal: hiddenMatched,
needHide: visibleUnmatched
};};
proto._getFilterTest=function(filter){
if(jQuery&&this.options.isJQueryFiltering){
return function(item){
return jQuery(item.element).is(filter);
};}
if(typeof filter=='function'){
return function(item){
return filter(item.element);
};}
return function(item){
return matchesSelector(item.element, filter);
};};
proto.updateSortData=function(elems){
var items;
if(elems){
elems=utils.makeArray(elems);
items=this.getItems(elems);
}else{
items=this.items;
}
this._getSorters();
this._updateItemsSortData(items);
};
proto._getSorters=function(){
var getSortData=this.options.getSortData;
for(var key in getSortData){
var sorter=getSortData[ key ];
this._sorters[ key ]=mungeSorter(sorter);
}};
proto._updateItemsSortData=function(items){
var len=items&&items.length;
for(var i=0; len&&i < len; i++){
var item=items[i];
item.updateSortData();
}};
var mungeSorter=(function(){
function mungeSorter(sorter){
if(typeof sorter!='string'){
return sorter;
}
var args=trim(sorter).split(' ');
var query=args[0];
var attrMatch=query.match(/^\[(.+)\]$/);
var attr=attrMatch&&attrMatch[1];
var getValue=getValueGetter(attr, query);
var parser=Isotope.sortDataParsers[ args[1] ];
sorter=parser ? function(elem){
return elem&&parser(getValue(elem) );
} :
function(elem){
return elem&&getValue(elem);
};
return sorter;
}
function getValueGetter(attr, query){
if(attr){
return function getAttribute(elem){
return elem.getAttribute(attr);
};}
return function getChildText(elem){
var child=elem.querySelector(query);
return child&&child.textContent;
};}
return mungeSorter;
})();
Isotope.sortDataParsers={
'parseInt': function(val){
return parseInt(val, 10);
},
'parseFloat': function(val){
return parseFloat(val);
}};
proto._sort=function(){
if(!this.options.sortBy){
return;
}
var sortBys=utils.makeArray(this.options.sortBy);
if(!this._getIsSameSortBy(sortBys) ){
this.sortHistory=sortBys.concat(this.sortHistory);
}
var itemSorter=getItemSorter(this.sortHistory, this.options.sortAscending);
this.filteredItems.sort(itemSorter);
};
proto._getIsSameSortBy=function(sortBys){
for(var i=0; i < sortBys.length; i++){
if(sortBys[i]!=this.sortHistory[i]){
return false;
}}
return true;
};
function getItemSorter(sortBys, sortAsc){
return function sorter(itemA, itemB){
for(var i=0; i < sortBys.length; i++){
var sortBy=sortBys[i];
var a=itemA.sortData[ sortBy ];
var b=itemB.sortData[ sortBy ];
if(a > b||a < b){
var isAscending=sortAsc[ sortBy ]!==undefined ? sortAsc[ sortBy ]:sortAsc;
var direction=isAscending ? 1:-1;
return(a > b ? 1:-1) * direction;
}}
return 0;
};}
proto._mode=function(){
var layoutMode=this.options.layoutMode;
var mode=this.modes[ layoutMode ];
if(!mode){
throw new Error('No layout mode: ' + layoutMode);
}
mode.options=this.options[ layoutMode ];
return mode;
};
proto._resetLayout=function(){
Outlayer.prototype._resetLayout.call(this);
this._mode()._resetLayout();
};
proto._getItemLayoutPosition=function(item){
return this._mode()._getItemLayoutPosition(item);
};
proto._manageStamp=function(stamp){
this._mode()._manageStamp(stamp);
};
proto._getContainerSize=function(){
return this._mode()._getContainerSize();
};
proto.needsResizeLayout=function(){
return this._mode().needsResizeLayout();
};
proto.appended=function(elems){
var items=this.addItems(elems);
if(!items.length){
return;
}
var filteredItems=this._filterRevealAdded(items);
this.filteredItems=this.filteredItems.concat(filteredItems);
};
proto.prepended=function(elems){
var items=this._itemize(elems);
if(!items.length){
return;
}
this._resetLayout();
this._manageStamps();
var filteredItems=this._filterRevealAdded(items);
this.layoutItems(this.filteredItems);
this.filteredItems=filteredItems.concat(this.filteredItems);
this.items=items.concat(this.items);
};
proto._filterRevealAdded=function(items){
var filtered=this._filter(items);
this.hide(filtered.needHide);
this.reveal(filtered.matches);
this.layoutItems(filtered.matches, true);
return filtered.matches;
};
proto.insert=function(elems){
var items=this.addItems(elems);
if(!items.length){
return;
}
var i, item;
var len=items.length;
for(i=0; i < len; i++){
item=items[i];
this.element.appendChild(item.element);
}
var filteredInsertItems=this._filter(items).matches;
for(i=0; i < len; i++){
items[i].isLayoutInstant=true;
}
this.arrange();
for(i=0; i < len; i++){
delete items[i].isLayoutInstant;
}
this.reveal(filteredInsertItems);
};
var _remove=proto.remove;
proto.remove=function(elems){
elems=utils.makeArray(elems);
var removeItems=this.getItems(elems);
_remove.call(this, elems);
var len=removeItems&&removeItems.length;
for(var i=0; len&&i < len; i++){
var item=removeItems[i];
utils.removeFrom(this.filteredItems, item);
}};
proto.shuffle=function(){
for(var i=0; i < this.items.length; i++){
var item=this.items[i];
item.sortData.random=Math.random();
}
this.options.sortBy='random';
this._sort();
this._layout();
};
proto._noTransition=function(fn, args){
var transitionDuration=this.options.transitionDuration;
this.options.transitionDuration=0;
var returnValue=fn.apply(this, args);
this.options.transitionDuration=transitionDuration;
return returnValue;
};
proto.getFilteredItemElements=function(){
return this.filteredItems.map(function(item){
return item.element;
});
};
return Isotope;
}));
!function(t,e,i,s){function n(e,i){this.settings=null,this.options=t.extend({},n.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy(function(e,i){this._handlers[i]=t.proxy(this[i],this)},this)),t.each(n.Plugins,t.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),t.each(n.Workers,t.proxy(function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})},this)),this.setup(),this.initialize()}n.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},n.Width={Default:"default",Inner:"inner",Outer:"outer"},n.Type={Event:"event",State:"state"},n.Plugins={},n.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,n={width:"auto","margin-left":s?e:"","margin-right":s?"":e};!i&&this.$stage.children().css(n),t.css=n}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,s=this._items.length,n=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};s--;)i=this._mergers[s],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[s]=n?e*i:this._items[s].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,s=this.settings,n=Math.max(2*s.items,4),o=2*Math.ceil(i.length/2),r=s.loop&&i.length?s.rewind?n:Math.max(n,o):0,a="",h="";for(r/=2;r>0;)e.push(this.normalize(e.length/2,!0)),a+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),h=i[e[e.length-1]][0].outerHTML+h,r-=1;this._clones=e,t(a).addClass("cloned").appendTo(this.$stage),t(h).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=0,n=0,o=[];++i<e;)s=o[i-1]||0,n=this._widths[this.relative(i)]+this.settings.margin,o.push(s+n*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for(i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],n.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(t("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},n.prototype.initializeItems=function(){var e=this.$element.find(".owl-item");if(e.length)return this._items=e.get().map(function(e){return t(e)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},n.prototype.initialize=function(){var t,e,i;(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading"))&&(t=this.$element.find("img"),e=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:void 0,i=this.$element.children(e).width(),t.length&&i<=0&&this.preloadAutoWidthImages(t));this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},n.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},n.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,s=-1,n=null;i?(t.each(i,function(t){t<=e&&t>s&&(s=Number(t))}),"function"==typeof(n=t.extend({},this.options,i[s])).stagePadding&&(n.stagePadding=n.stagePadding()),delete n.responsive,n.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+s))):n=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:n}}),this._breakpoint=s,this.settings=n,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},n.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},n.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},n.prototype.update=function(){for(var e=0,i=this._pipe.length,s=t.proxy(function(t){return this[t]},this._invalidated),n={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,s).length>0)&&this._pipe[e].run(n),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},n.prototype.width=function(t){switch(t=t||n.Width.Default){case n.Width.Inner:case n.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},n.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},n.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},n.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},n.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},n.prototype.onDragStart=function(e){var s=null;3!==e.which&&(t.support.transform?s={x:(s=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===s.length?12:4],y:s[16===s.length?13:5]}:(s=this.$stage.position(),s={x:this.settings.rtl?s.left+this.$stage.width()-this.width()+this.settings.margin:s.left,y:s.top}),this.is("animating")&&(t.support.transform?this.animate(s.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=s,this._drag.stage.current=s,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy(function(e){var s=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(s.x)<Math.abs(s.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},n.prototype.onDragMove=function(t){var e=null,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),s=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,e+s),i+s)),this._drag.stage.current=o,this.animate(o.x))},n.prototype.onDragEnd=function(e){var s=this.difference(this._drag.pointer,this.pointer(e)),n=this._drag.stage.current,o=s.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==s.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(n.x,0!==s.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(s.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},n.prototype.closest=function(e,i){var s=-1,n=this.width(),o=this.coordinates();return this.settings.freeDrag||t.each(o,t.proxy(function(t,r){return"left"===i&&e>r-30&&e<r+30?s=t:"right"===i&&e>r-n-30&&e<r-n+30?s=t+1:this.op(e,"<",r)&&this.op(e,">",void 0!==o[t+1]?o[t+1]:r-n)&&(s="left"===i?t+1:t),-1===s},this)),this.settings.loop||(this.op(e,">",o[this.minimum()])?s=e=this.minimum():this.op(e,"<",o[this.maximum()])&&(s=e=this.maximum())),s},n.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},n.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},n.prototype.current=function(t){if(void 0===t)return this._current;if(0!==this._items.length){if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});void 0!==e.data&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current}},n.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,function(t,e){return e})},n.prototype.reset=function(t){void 0!==(t=this.normalize(t))&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},n.prototype.normalize=function(t,e){var i=this._items.length,s=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=void 0:(t<0||t>=i+s)&&(t=((t-s/2)%i+i)%i+s/2),t},n.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},n.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>s););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},n.prototype.minimum=function(t){return t?0:this._clones.length/2},n.prototype.items=function(t){return void 0===t?this._items.slice():(t=this.normalize(t,!0),this._items[t])},n.prototype.mergers=function(t){return void 0===t?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},n.prototype.clones=function(e){var i=this._clones.length/2,s=i+this._items.length,n=function(t){return t%2==0?s+t/2:i-(t+1)/2};return void 0===e?t.map(this._clones,function(t,e){return n(e)}):t.map(this._clones,function(t,i){return t===e?n(i):null})},n.prototype.speed=function(t){return void 0!==t&&(this._speed=t),this._speed},n.prototype.coordinates=function(e){var i,s=1,n=e-1;return void 0===e?t.map(this._coordinates,t.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(s=-1,n=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[n]||0))/2*s):i=this._coordinates[n]||0,i=Math.ceil(i))},n.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},n.prototype.to=function(t,e){var i=this.current(),s=null,n=t-this.relative(i),o=(n>0)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(s=(((t=i+n)-a)%r+r)%r+a)!==t&&s-n<=h&&s-n>0&&(i=s-n,t=s,this.reset(i))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(i,t,e)),this.current(t),this.isVisible()&&this.update()},n.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},n.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},n.prototype.onTransitionEnd=function(t){if(void 0!==t&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},n.prototype.viewport=function(){var s;return this.options.responsiveBaseElement!==e?s=t(this.options.responsiveBaseElement).width():e.innerWidth?s=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?s=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),s},n.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter(function(){return 1===this.nodeType}).each(t.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},n.prototype.add=function(e,i){var s=this.relative(this._current);i=void 0===i?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[s]&&this.reset(this._items[s].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},n.prototype.remove=function(t){void 0!==(t=this.normalize(t,!0))&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},n.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy(function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy(function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))},this))},n.prototype.destroy=function(){for(var s in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[s].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},n.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?t>i:t<i;case">":return s?t<i:t>i;case">=":return s?t<=i:t>=i;case"<=":return s?t>=i:t<=i}},n.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},n.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},n.prototype.trigger=function(e,i,s,o,r){var a={item:{count:this._items.length,index:this.current()}},h=t.camelCase(t.grep(["on",e,s],function(t){return t}).join("-").toLowerCase()),l=t.Event([e,"owl",s||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},a,i));return this._supress[e]||(t.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(l)}),this.register({type:n.Type.Event,name:e}),this.$element.trigger(l),this.settings&&"function"==typeof this.settings[h]&&this.settings[h].call(this,l)),l},n.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){void 0===this._states.current[e]&&(this._states.current[e]=0),this._states.current[e]++},this))},n.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){this._states.current[e]--},this))},n.prototype.register=function(e){if(e.type===n.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===n.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy(function(i,s){return t.inArray(i,this._states.tags[e.name])===s},this)))},n.prototype.suppress=function(e){t.each(e,t.proxy(function(t,e){this._supress[e]=!0},this))},n.prototype.release=function(e){t.each(e,t.proxy(function(t,e){delete this._supress[e]},this))},n.prototype.pointer=function(t){var i={x:null,y:null};return(t=(t=t.originalEvent||t||e.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},n.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),o=s.data("owl.carousel");o||(o=new n(this,"object"==typeof e&&e),s.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(e,i){o.register({type:n.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))},o))})),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)})},t.fn.owlCarousel.Constructor=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={autoRefresh:!0,autoRefreshInterval:500},n.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},n.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},n.prototype.destroy=function(){var t,i;for(t in e.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type)){var i=this._core.settings,s=i.center&&Math.ceil(i.items/2)||i.items,n=i.center&&-1*s||0,o=(e.property&&void 0!==e.property.value?e.property.value:this._core.current())+n,r=this._core.clones().length,a=t.proxy(function(t,e){this.load(e)},this);for(i.lazyLoadEager>0&&(s+=i.lazyLoadEager,i.loop&&(o-=i.lazyLoadEager,s++));n++<s;)this.load(r/2+this._core.relative(o)),r&&t.each(this._core.clones(this._core.relative(o)),a),o++}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers)};n.Defaults={lazyLoad:!1,lazyLoadEager:0},n.prototype.load=function(i){var s=this._core.$stage.children().eq(i),n=s&&s.find(".owl-lazy");!n||t.inArray(s.get(0),this._loaded)>-1||(n.each(t.proxy(function(i,s){var n,o=t(s),r=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src")||o.attr("data-srcset");this._core.trigger("load",{element:o,url:r},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy(function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("src",r):o.is("source")?o.one("load.owl.lazy",t.proxy(function(){this._core.trigger("loaded",{element:o,url:r},"lazy")},this)).attr("srcset",r):((n=new Image).onload=t.proxy(function(){o.css({"background-image":'url("'+r+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:r},"lazy")},this),n.src=r)},this)),this._loaded.push(s.get(0)))},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(i){this._core=i,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var s=this;t(e).on("load",function(){s._core.settings.autoHeight&&s.update()}),t(e).resize(function(){s._core.settings.autoHeight&&(null!=s._intervalId&&clearTimeout(s._intervalId),s._intervalId=setTimeout(function(){s.update()},250))})};n.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},n.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,s=this._core.settings.lazyLoad,n=this._core.$stage.children().toArray().slice(e,i),o=[],r=0;t.each(n,function(e,i){o.push(t(i).height())}),(r=Math.max.apply(null,o))<=1&&s&&this._previousHeight&&(r=this._previousHeight),this._previousHeight=r,this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass)},n.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy(function(t){this.play(t)},this))};n.Defaults={video:!1,videoHeight:!1,videoWidth:!1},n.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if((s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(s[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(s[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},n.prototype.thumbnail=function(e,i){var s,n,o=i.width&&i.height?"width:"+i.width+"px;height:"+i.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings,c=function(i){'<div class="owl-video-play-icon"></div>',s=l.lazyLoad?t("<div/>",{class:"owl-video-tn "+h,srcType:i}):t("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+i+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')};if(e.wrap(t("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return c(r.attr(a)),r.remove(),!1;"youtube"===i.type?(n="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",c(n)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,c(n)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,c(n)}})},n.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},n.prototype.play=function(e){var i,s=t(e.target).closest("."+this._core.settings.itemClass),n=this._videos[s.attr("data-video")],o=n.width||"100%",r=n.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),s=this._core.items(this._core.relative(s.index())),this._core.reset(s.index()),(i=t('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",r),i.attr("width",o),"youtube"===n.type?i.attr("src","//www.youtube.com/embed/"+n.id+"?autoplay=1&rel=0&v="+n.id):"vimeo"===n.type?i.attr("src","//player.vimeo.com/video/"+n.id+"?autoplay=1"):"vzaar"===n.type&&i.attr("src","//view.vzaar.com/"+n.id+"/player?autoplay=true"),t(i).wrap('<div class="owl-video-frame" />').insertAfter(s.find(".owl-video")),this._playing=s.addClass("owl-video-playing"))},n.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},n.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this.core=e,this.core.options=t.extend({},n.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":t.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};n.Defaults={animateOut:!1,animateIn:!1},n.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),s=this.core.$stage.children().eq(this.previous),n=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,r=this.core.settings.animateOut;this.core.current()!==this.previous&&(r&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),s.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(r)),o&&n.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},n.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},n.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=function(e){this._core=e,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":t.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":t.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":t.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},n.Defaults,this._core.options)};n.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},n.prototype._next=function(s){this._call=e.setTimeout(t.proxy(this._next,this,s),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||i.hidden||this._core.next(s||this._core.settings.autoplaySpeed)},n.prototype.read=function(){return(new Date).getTime()-this._time},n.prototype.play=function(i,s){var n;this._core.is("rotating")||this._core.enter("rotating"),i=i||this._core.settings.autoplayTimeout,n=Math.min(this._time%(this._timeout||i),i),this._paused?(this._time=this.read(),this._paused=!1):e.clearTimeout(this._call),this._time+=this.read()%i-n,this._timeout=i,this._call=e.setTimeout(t.proxy(this._next,this,s),i-n)},n.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,e.clearTimeout(this._call),this._core.leave("rotating"))},n.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,e.clearTimeout(this._call))},n.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){var i=t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot");this._templates.push('<div class="'+this._core.settings.dotClass+' ruby-dot">'+t(e.content).find("."+i).html()+"</div>")}},this),"added.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers)};n.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},n.prototype.initialize=function(){var e,i=this._core.settings;for(e in this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.dotsData||(this._templates=[t('<button role="button">').addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button, div",t.proxy(function(e){var s=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(s,i.dotsSpeed)},this)),this._overrides)this._core[e]=t.proxy(this[e],this)},n.prototype.destroy=function(){var t,e,i,s,n;for(t in n=this._core.settings,this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},n.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<s;t++){if(e>=r||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},n.prototype.draw=function(){var e,i=this._core.settings,s=this._core.items().length<=i.items,n=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||s),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&n<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&n>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||s),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},n.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},n.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},n.prototype.getPosition=function(e){var i,s,n=this._core.settings;return"page"==n.slideBy?(i=t.inArray(this.current(),this._pages),s=this._pages.length,e?++i:--i,i=this._pages[(i%s+s)%s].start):(i=this._core.relative(this._core.current()),s=this._core.items().length,e?i+=n.slideBy:i-=n.slideBy),i},n.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},n.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},n.prototype.to=function(e,i,s){var n;!s&&this._pages.length?(n=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%n+n)%n].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){"use strict";var n=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var s=this._core.items(this._core.relative(this._core.current())),n=t.map(this._hashes,function(t,e){return t===s?e:null}).join();if(!n||e.location.hash.slice(1)===n)return;e.location.hash=n}},this)},this._core.options=t.extend({},n.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),s=this._core.$stage.children(),n=this._hashes[i]&&s.index(this._hashes[i]);void 0!==n&&n!==this._core.current()&&this._core.to(this._core.relative(n),!1,!0)},this))};n.Defaults={URLhashListener:!1},n.prototype.destroy=function(){var i,s;for(i in t(e).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(i,this._handlers[i]);for(s in Object.getOwnPropertyNames(this))"function"!=typeof this[s]&&(this[s]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=n}(window.Zepto||window.jQuery,window,document),function(t,e,i,s){var n=t("<support>").get(0).style,o="Webkit Moz O ms".split(" "),r={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},a=function(){return!!c("transform")},h=function(){return!!c("perspective")},l=function(){return!!c("animation")};function c(e,i){var r=!1,a=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+o.join(a+" ")+a).split(" "),function(t,e){if(n[e]!==s)return r=!i||e,!1}),r}function p(t){return c(t,!0)}(function(){return!!c("transition")})()&&(t.support.transition=new String(p("transition")),t.support.transition.end=r.transition.end[t.support.transition]),l()&&(t.support.animation=new String(p("animation")),t.support.animation.end=r.animation.end[t.support.animation]),a()&&(t.support.transform=new String(p("transform")),t.support.transform3d=h())}(window.Zepto||window.jQuery,window,document);
;var RubyStickySidebar=function(t,o){"use strict";return t.$sections=[],t.$lastHeight=0,t.$delay=1,t.$isEnabled=!1,t.$topSpacing=0,t.$smartSticky=!1,t.$wHeight=o(window).height(),t.$scrolling="down",t.init=function(){var t=this;t.topSpacing(),t.reCalcSections(),window.addEventListener?(window.addEventListener("scroll",function(){clearTimeout(t.lastScrollEvent),t.$delay%2==1?(t.checkEventScroll(),t.$delay=1):t.$delay++,t.lastScrollEvent=setTimeout(function(){t.reCalcSections(),t.checkEventScroll()},30)},!1),window.addEventListener("resize",function(){t.reload()},!1)):window.attachEvent&&(window.attachEvent("onscroll",function(){clearTimeout(t.lastScrollEvent),t.$delay%2==1?(t.checkEventScroll(),t.$delay=1):t.$delay++,t.lastScrollEvent=setTimeout(function(){t.reCalcSections(),t.checkEventScroll()},30)}),window.attachEvent("onresize",function(){t.reload()}))},t.topSpacing=function(){var t=o("body");t.hasClass("smart-sticky")&&(this.$smartSticky=!0);var n=0,e=0;o("#wpadminbar").length&&(n=o("#wpadminbar").height()),t.hasClass("sticky-nav")&&o(".navbar-wrap")&&(e=o(".navbar-wrap").height()),this.$topSpacing=e+n},t.stick=function(t){var n=this;991>o(window).width()?(n.$isEnabled=!1,n.restoreCSS()):n.$isEnabled=!0,t.length>0&&t.each(function(){var t=o(this);n.addSection(t)}),n.init()},t.addSection=function(t){var o=this.createSection(t);void 0!==o&&(this.addClearFix(o),o.contentTop=0,o.contentBottom=0,o.sidebarTop=0,o.sidebarBottom=0,o.status="top_content",this.sectionPos(o),this.$sections.push(o))},t.createSection=function(t){var o={};if(o.sidebar=t.find(".sidebar-inner"),o.content=t.parent().find(".rbc-content"),void 0!==o.content)return o},t.addClearFix=function(t){t.content.parent().addClass("clearfix"),t.sidebar.after('<div class="clearfix"></div>')},t.sectionPos=function(t){return t.contentTop=t.content.offset().top,t.contentHeight=t.content.height(),t.contentBottom=t.contentTop+t.contentHeight,t.sidebarHeight=t.sidebar.height()+this.$topSpacing,t.sidebarWidth=t.sidebar.parent().width(),t},t.sidebarPos=function(t){return t.sidebarTop=t.sidebar.offset().top,t.sidebarBottom=t.sidebarTop+t.sidebarHeight,t},t.sectionStatus=function(t,o){var n=this.$scrolling,e=this.$wHeight+o;return t.sidebarHeight+60>=t.contentHeight?t.status="content_small":t.sidebarHeight<=this.$wHeight?o<t.contentTop?t.status="top_content":t.contentBottom-t.sidebarHeight>=o?(t.status="fixed_top",t.scrollStatus=n):t.status="bottom_content":(t.sidebarBottom<o?t.status="bottom_content":t.sidebarBottom<=e&&t.sidebarBottom<t.contentBottom&&"down"==n&&t.contentBottom>e?t.status="fixed_bottom":t.sidebarTop<=t.contentTop&&"up"==n&&t.contentBottom>=e?t.status="top_content":t.contentBottom<=t.sidebarBottom&&"down"==n||t.contentBottom<e?t.status="bottom_content":o<=t.sidebarTop&&"up"==n&&t.contentTop<=o&&(t.status="fixed_top"),("up"==n&&"fixed_bottom"==t.status||"fixed_top"==t.status&&"down"==n)&&(t.status="absolute")),t.status},t.checkEventScroll=function(){if(this.$isEnabled){var n=o(window).scrollTop();n!=this.$lastHeight&&n>this.$lastHeight?this.$scrolling="down":n!=this.$lastHeight&&n<this.$lastHeight&&(this.$scrolling="up"),this.$lastHeight=n;for(var e=0;e<this.$sections.length;e++){var i=this.$sections[e];this.sidebarPos(i),i.status=this.sectionStatus(i,n),t.calcCSS(i)}}},t.restoreCSS=function(){for(var t=0;t<this.$sections.length;t++)this.$sections[t].sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"})},t.calcCSS=function(t){switch(t.status){case"fixed_bottom":if(!0===t.fixed_bottom_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!0,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"fixed",top:"auto",bottom:"0","z-index":"100"});break;case"top_content":if(!0===t.top_content_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!0,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"});break;case"bottom_content":if(!0===t.bottom_content_run_once&&t.bottom_content_last_sidebar_height==t.sidebarHeight&&t.bottom_content_last_content_height==t.contentHeight)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!0,t.absolute_run_once=!1,t.content_small_run_once=!1,t.bottom_content_last_sidebar_height=t.sidebarHeight,t.bottom_content_last_content_height=t.contentHeight,t.sidebar.css({width:t.sidebarWidth,position:"absolute",top:t.contentBottom-t.sidebarHeight-t.contentTop+this.$topSpacing,bottom:"auto"});break;case"fixed_top":if(!0===t.fixed_top_run_once)break;t.fixed_top_run_once=!0,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"fixed",top:0+this.$topSpacing,bottom:"auto"}),this.$smartSticky&&t.scrollStatus&&"down"==t.scrollStatus&&t.sidebar.css("top","0");break;case"absolute":if(!0===t.absolute_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!0,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"absolute",top:t.sidebarTop-t.contentTop+this.$topSpacing,bottom:"auto"});break;case"content_small":if(!0===t.content_small_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!0,t.sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"})}},t.resetFlags=function(){for(var t=0;t<this.$sections.length;t++)this.$sections[t].fixed_top_run_once=!1,this.$sections[t].fixed_bottom_run_once=!1,this.$sections[t].top_content_run_once=!1,this.$sections[t].bottom_content_run_once=!1,this.$sections[t].absolute_run_once=!1,this.$sections[t].content_small_run_once=!1,this.$sections[t].bottom_content_last_sidebar_height=0,this.$sections[t].bottom_content_last_contentHeight=0},t.reload=function(){991>o(window).width()?(this.$isEnabled=!1,this.restoreCSS()):this.$isEnabled=!0},t.reCalcSections=function(){for(var t=0;t<this.$sections.length;t++)this.sectionPos(this.$sections[t])},t}(RubyStickySidebar||{},jQuery);
!function(t){function i(t,i){return"function"==typeof t?t.call(i):t}function e(t){for(;t=t.parentNode;)if(t==document)return!0;return!1}function s(i,e){this.$element=t(i),this.options=e,this.enabled=!0,this.fixTitle()}s.prototype={show:function(){var e=this.getTitle();if(e&&this.enabled){var s=this.tip();s.find(".tipsy-inner")[this.options.html?"html":"text"](e),s[0].className="tipsy",s.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var n,o=t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),l=s[0].offsetWidth,a=s[0].offsetHeight,f=i(this.options.gravity,this.$element[0]);switch(f.charAt(0)){case"n":n={top:o.top+o.height+this.options.offset,left:o.left+o.width/2-l/2};break;case"s":n={top:o.top-a-this.options.offset,left:o.left+o.width/2-l/2};break;case"e":n={top:o.top+o.height/2-a/2,left:o.left-l-this.options.offset};break;case"w":n={top:o.top+o.height/2-a/2,left:o.left+o.width+this.options.offset}}2==f.length&&("w"==f.charAt(1)?n.left=o.left+o.width/2-15:n.left=o.left+o.width/2-l+15),s.css(n).addClass("tipsy-"+f),s.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+f.charAt(0),this.options.className&&s.addClass(i(this.options.className,this.$element[0])),this.options.fade?s.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):s.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){t(this).remove()}):this.tip().remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("original-title"))&&t.attr("original-title",t.attr("title")||"").removeAttr("title")},getTitle:function(){var t,i=this.$element,e=this.options;this.fixTitle();var t,e=this.options;return"string"==typeof e.title?t=i.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(t=e.title.call(i[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||e.fallback},tip:function(){return this.$tip||(this.$tip=t('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},t.fn.tipsy=function(i){function e(e){var n=t.data(e,"tipsy");return n||(n=new s(e,t.fn.tipsy.elementOptions(e,i)),t.data(e,"tipsy",n)),n}function n(){var t=e(this);t.hoverState="in",0==i.delayIn?t.show():(t.fixTitle(),setTimeout(function(){"in"==t.hoverState&&t.show()},i.delayIn))}function o(){var t=e(this);t.hoverState="out",0==i.delayOut?t.hide():setTimeout(function(){"out"==t.hoverState&&t.hide()},i.delayOut)}if(i===!0)return this.data("tipsy");if("string"==typeof i){var l=this.data("tipsy");return l&&l[i](),this}if(i=t.extend({},t.fn.tipsy.defaults,i),i.live||this.each(function(){e(this)}),"manual"!=i.trigger){var a=i.live?"live":"bind",f="hover"==i.trigger?"mouseenter":"focus",h="hover"==i.trigger?"mouseleave":"blur";this[a](f,n)[a](h,o)}return this},t.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},t.fn.tipsy.revalidate=function(){t(".tipsy").each(function(){var i=t.data(this,"tipsy-pointee");i&&e(i)||t(this).remove()})},t.fn.tipsy.elementOptions=function(i,e){return t.metadata?t.extend({},e,t(i).metadata()):e},t.fn.tipsy.autoNS=function(){return t(this).offset().top>t(document).scrollTop()+t(window).height()/2?"s":"n"},t.fn.tipsy.autoWE=function(){return t(this).offset().left>t(document).scrollLeft()+t(window).width()/2?"e":"w"},t.fn.tipsy.autoBounds=function(i,e){return function(){var s={ns:e[0],ew:e.length>1?e[1]:!1},n=t(document).scrollTop()+i,o=t(document).scrollLeft()+i,l=t(this);return l.offset().top<n&&(s.ns="n"),l.offset().left<o&&(s.ew="w"),t(window).width()+t(document).scrollLeft()-l.offset().left<i&&(s.ew="e"),t(window).height()+t(document).scrollTop()-l.offset().top<i&&(s.ns="s"),s.ns+(s.ew?s.ew:"")}}}(jQuery);
;jQuery.extend(jQuery.easing,{easeInQuad:function(n,t,e,u,a){return u*(t/=a)*t+e},easeOutQuad:function(n,t,e,u,a){return-u*(t/=a)*(t-2)+e},easeInOutQuad:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t+e:-u/2*(--t*(t-2)-1)+e},easeInCubic:function(n,t,e,u,a){return u*(t/=a)*t*t+e},easeOutCubic:function(n,t,e,u,a){return u*((t=t/a-1)*t*t+1)+e},easeInOutCubic:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t+e:u/2*((t-=2)*t*t+2)+e},easeInQuart:function(n,t,e,u,a){return u*(t/=a)*t*t*t+e},easeOutQuart:function(n,t,e,u,a){return-u*((t=t/a-1)*t*t*t-1)+e},easeInOutQuart:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t*t+e:-u/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(n,t,e,u,a){return u*(t/=a)*t*t*t*t+e},easeOutQuint:function(n,t,e,u,a){return u*((t=t/a-1)*t*t*t*t+1)+e},easeInOutQuint:function(n,t,e,u,a){return(t/=a/2)<1?u/2*t*t*t*t*t+e:u/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(n,t,e,u,a){return-u*Math.cos(t/a*(Math.PI/2))+u+e},easeOutSine:function(n,t,e,u,a){return u*Math.sin(t/a*(Math.PI/2))+e},easeInOutSine:function(n,t,e,u,a){return-u/2*(Math.cos(Math.PI*t/a)-1)+e},easeInExpo:function(n,t,e,u,a){return 0==t?e:u*Math.pow(2,10*(t/a-1))+e},easeOutExpo:function(n,t,e,u,a){return t==a?e+u:u*(-Math.pow(2,-10*t/a)+1)+e},easeInOutExpo:function(n,t,e,u,a){return 0==t?e:t==a?e+u:(t/=a/2)<1?u/2*Math.pow(2,10*(t-1))+e:u/2*(-Math.pow(2,-10*--t)+2)+e},easeInCirc:function(n,t,e,u,a){return-u*(Math.sqrt(1-(t/=a)*t)-1)+e},easeOutCirc:function(n,t,e,u,a){return u*Math.sqrt(1-(t=t/a-1)*t)+e},easeInOutCirc:function(n,t,e,u,a){return(t/=a/2)<1?-u/2*(Math.sqrt(1-t*t)-1)+e:u/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;if(0==t)return e;if(1==(t/=a))return e+u;if(i||(i=.3*a),s<Math.abs(u)){s=u;var r=i/4}else var r=i/(2*Math.PI)*Math.asin(u/s);return-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(t*a-r)*Math.PI/i))+e},easeOutElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;if(0==t)return e;if(1==(t/=a))return e+u;if(i||(i=.3*a),s<Math.abs(u)){s=u;var r=i/4}else var r=i/(2*Math.PI)*Math.asin(u/s);return s*Math.pow(2,-10*t)*Math.sin(2*(t*a-r)*Math.PI/i)+u+e},easeInOutElastic:function(n,t,e,u,a){var r=1.70158,i=0,s=u;if(0==t)return e;if(2==(t/=a/2))return e+u;if(i||(i=.3*a*1.5),s<Math.abs(u)){s=u;var r=i/4}else var r=i/(2*Math.PI)*Math.asin(u/s);return 1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(t*a-r)*Math.PI/i)+e:s*Math.pow(2,-10*(t-=1))*Math.sin(2*(t*a-r)*Math.PI/i)*.5+u+e},easeInBack:function(n,t,e,u,a,r){return void 0==r&&(r=1.70158),u*(t/=a)*t*((r+1)*t-r)+e},easeOutBack:function(n,t,e,u,a,r){return void 0==r&&(r=1.70158),u*((t=t/a-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(n,t,e,u,a,r){return void 0==r&&(r=1.70158),(t/=a/2)<1?u/2*t*t*(((r*=1.525)+1)*t-r)+e:u/2*((t-=2)*t*(((r*=1.525)+1)*t+r)+2)+e},easeInBounce:function(n,t,e,u,a){return u-jQuery.easing.easeOutBounce(n,a-t,0,u,a)+e},easeOutBounce:function(n,t,e,u,a){return(t/=a)<1/2.75?7.5625*u*t*t+e:2/2.75>t?u*(7.5625*(t-=1.5/2.75)*t+.75)+e:2.5/2.75>t?u*(7.5625*(t-=2.25/2.75)*t+.9375)+e:u*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(n,t,e,u,a){return a/2>t?.5*jQuery.easing.easeInBounce(n,2*t,0,u,a)+e:.5*jQuery.easing.easeOutBounce(n,2*t-a,0,u,a)+.5*u+e}});
;!function(n){n.fn.UItoTop=function(e){var o={text:"To Top",min:200,inDelay:600,outDelay:400,containerID:"toTop",containerHoverID:"toTopHover",scrollSpeed:1200,easingType:"linear"},t=n.extend(o,e),i="#"+t.containerID,a="#"+t.containerHoverID;n("body").append('<a href="#" aria-label="back to top" id="'+t.containerID+'">'+t.text+"</a>"),n(i).hide().on("click.UItoTop",function(){return n("html, body").animate({scrollTop:0},t.scrollSpeed,t.easingType),n("#"+t.containerHoverID,this).stop().animate({opacity:0},t.inDelay,t.easingType),!1}).prepend('<span id="'+t.containerHoverID+'"></span>').hover(function(){n(a,this).stop().animate({opacity:1},600,"linear")},function(){n(a,this).stop().animate({opacity:0},700,"linear")}),n(window).scroll(function(){var e=n(window).scrollTop();"undefined"==typeof document.body.style.maxHeight&&n(i).css({position:"absolute",top:e+n(window).height()-50}),e>t.min?n(i).fadeIn(t.inDelay):n(i).fadeOut(t.Outdelay)})}}(jQuery);
var PIXWELL_MAIN_SCRIPTS=(function (Module, $){
'use strict';
Module.$body=$('body');
Module.$ios=/(iPad|iPhone|iPod)/g.test(navigator.userAgent);
Module.$document=$(document);
Module.$html=$('html, body');
Module.$window=$(window);
Module.$ajax={};
Module.wPoint={};
Module.$singleScrollDelay=1;
Module.$stickyScrollDelay=1;
Module.$lastPos=0;
Module.siteAccessFlag=false;
Module.init=function (){
this.getSettings();
this.mainMenuPos();
this.reCalcMenuPos();
this.calcFullScreenFeat();
this.stickyNavigation();
this.touchNavigation();
this.quickFilter();
this.carouselSlider();
this.carouselWideSlider();
this.bigSlider();
this.bigNavSlider();
this.toggleOffCanvas();
this.stickySidebar();
this.searchBoxToggle();
this.bodyImageLoaded();
this.backTop();
this.siteAccessDetector();
this.smoothScrollTOC();
this.tocToggle();
this.offCanvasLoad();
this.navLiveSearch();
this.subMenuEffects();
this.categoryHeaderBg();
this.singleInfiniteLoadNext();
this.mobileStickyNav();
this.masonryPPCol3();
this.masonryPPCol4();
this.masonryFwP1();
this.rbGallery();
this.documentReload();
};
Module.documentReload=function (){
this.paginationNextPrev();
this.loadMore();
this.paginationInfinite();
this.scrollUpdateProcess();
this.videoAutoPlay();
this.showPostComment();
this.replyReview();
this.scrollToComment();
this.showSingleFeat();
this.singleParallaxFeat();
this.postGallerySlider();
this.postGalleryLightBox();
this.tooltips();
this.productQuantity();
this.bookMarkTipsy();
this.masonryFW1();
this.masonryCT1();
this.usersRating();
};
Module.getSettings=function (){
this.$themeSettings=$.parseJSON(themeSettings);
this.slidePrev='<i class="rbi rbi-angle-left"></i><span>' + this.$themeSettings.textPrev + '</span>';
this.slideNext='<i class="rbi rbi-angle-right"></i><span>' + this.$themeSettings.textNext + '</span>';
};
Module.getRTL=function (){
return this.$body.hasClass('rtl');
};
Module.backTop=function (){
if(this.$body.hasClass('is-backtop')){
$().UItoTop({
containerID: 'back-top',
easingType: 'easeOutQuart',
text: '<i class="rbi rbi-arrow-up"></i>',
containerHoverID: 'back-top-inner',
scrollSpeed: 800
});
}};
Module.smoothScrollTOC=function (){
var TOC=$('#ruby-table-contents');
if(TOC.hasClass('rb-smooth-scroll')){
this.$html.css('scroll-behavior', 'smooth');
}}
Module.tocToggle=function (){
this.$document.on('click', '.ruby-toc-toggle', function (e){
e.preventDefault();
e.stopPropagation();
var target=$(this);
var content=target.parents('.rbtoc').find('.inner');
target.toggleClass('activate');
content.toggle('250');
})
}
Module.stickyNavigation=function (){
var self=this;
var stickyNav=$('#sticky-nav');
var navOuter=$('.navbar-outer');
if(self.$body.hasClass('sticky-nav')&&stickyNav.length > 0&&navOuter.length > 0&&self.$window.width() >=992){
var smartSticky=false;
var showPos=navOuter.offset().top + navOuter.height() + 70;
stickyNav.css('top', '-' + stickyNav.height() + 'px');
if(self.$body.hasClass('smart-sticky')){
smartSticky=true;
}
if(window.addEventListener){
window.addEventListener('scroll', function (){
self.stickyProcess(stickyNav, showPos, smartSticky);
}, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', function (){
self.stickyProcess(stickyNav, showPos, smartSticky);
});
}}
};
Module.isTouchDevice=function (){
if(this.$ios){
return true;
}
return 'ontouchstart' in window||window.DocumentTouch&&document instanceof DocumentTouch||navigator.maxTouchPoints > 0||navigator.msMaxTouchPoints > 0;
};
Module.touchNavigation=function (){
var self=this;
if(self.isTouchDevice()&&self.$window.width() > 991){
var hasSubLink=$('.navbar-wrap .menu-item-has-children > a, .topbar-wrap .menu-item-has-children > a');
hasSubLink.find('span').append('<span class="touch-smenu"></span>');
var explainTag=$('.navbar-wrap, .topbar-wrap').find('.touch-smenu');
explainTag.on('click||tap', function (e){
e.preventDefault();
e.stopPropagation();
var itemparent=$(this).closest('.menu-item-has-children');
itemparent.addClass('show-smenu');
return false;
});
self.$document.on('click||tap', function (e){
if($(e.target).is('.touch-smenu')===false){
$(".menu-item-has-children").removeClass('show-smenu');
}});
}};
Module.mobileStickyNav=function (){
var self=this;
var mobileStickyNav=$('#mobile-sticky-nav');
var navOuter=$('.navbar-outer');
if(self.$body.hasClass('sticky-nav')&&mobileStickyNav.length > 0&&self.$window.width() < 992){
var smartSticky=false;
var showPos=navOuter.offset().top + navOuter.height() + 70;
mobileStickyNav.css('top', '-' + mobileStickyNav.height() + 'px');
if(self.$body.hasClass('smart-sticky')){
smartSticky=true;
}
if(window.addEventListener){
window.addEventListener('scroll', function (){
self.stickyProcess(mobileStickyNav, showPos, smartSticky);
}, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', function (){
self.stickyProcess(mobileStickyNav, showPos, smartSticky);
});
}}
};
Module.stickyProcess=function (stickyNav, showPos, smartSticky){
if(this.$stickyScrollDelay % 3==1){
var scrollTop=this.$window.scrollTop();
if(!smartSticky){
if(scrollTop > showPos&&!stickyNav.hasClass('is-show')){
stickyNav.addClass('is-show');
}else if(scrollTop < showPos&&stickyNav.hasClass('is-show')){
stickyNav.removeClass('is-show');
}}else{
var direction;
if(scrollTop!==this.lastPos){
if(scrollTop > this.lastPos){
direction='down';
}else{
direction='up';
}
this.lastPos=scrollTop;
}
if(scrollTop > showPos){
if(direction=='up'&&!stickyNav.hasClass('is-show')){
stickyNav.addClass('is-show');
}else if(direction=='down'&&stickyNav.hasClass('is-show')){
stickyNav.removeClass('is-show');
}}else if(scrollTop < showPos&&stickyNav.hasClass('is-show')){
stickyNav.removeClass('is-show');
}}
this.$stickyScrollDelay=1;
}else{
this.$stickyScrollDelay++;
}};
Module.carouselSlider=function (){
var self=this;
var elements=$('.carousel-feat-3, .carousel-feat-7, .carousel-feat-10');
if(elements.length > 0){
var config={
items: 3,
loop: true,
center: true,
dots: self.$themeSettings.sliderDot,
navText: [self.slidePrev, self.slideNext],
autoplay: self.$themeSettings.sliderPlay,
autoplayTimeout: self.$themeSettings.sliderSpeed,
navElement: 'div role="presentation"',
autoplayHoverPause: true,
nav: true,
rtl: self.getRTL(),
navClass: [
'rb-owl-prev',
'rb-owl-next'
],
autoplaySpeed: 500,
responsive: {
0: {items: 1},
768: {items: 2},
992: {items: 3}}
};
elements.each(function (){
var el=$(this);
if(el.width() > 1599){
config.responsive={
0: {items: 1},
768: {items: 2},
992: {items: 3},
1500: {items: 5}}
}
el.on('initialized.owl.carousel', function (){
el.prev('.load-animation').fadeOut(150, function (){
$(this).remove();
el.removeClass('per-load');
});
});
el.on('changed.owl.carousel', function (event){
$(event.target).find('.active').addClass('loaded');
});
el.owlCarousel(config);
})
}};
Module.carouselWideSlider=function (){
var self=this;
var elements=$('.carousel-feat-9, .carousel-feat-12');
if(elements.length > 0){
var config={
items: 5,
loop: true,
center: false,
dots: self.$themeSettings.sliderDot,
navText: [self.slidePrev, self.slideNext],
autoplay: self.$themeSettings.sliderPlay,
autoplayTimeout: self.$themeSettings.sliderSpeed,
navElement: 'div role="presentation"',
autoplayHoverPause: true,
nav: true,
rtl: self.getRTL(),
navClass: [
'rb-owl-prev',
'rb-owl-next'
],
autoplaySpeed: 500,
responsive: {
0: {items: 1},
768: {items: 2},
992: {items: 3},
1024: {items: 4},
1500: {items: 5}}
};
elements.each(function (){
var el=$(this);
el.on('initialized.owl.carousel', function (){
el.prev('.load-animation').fadeOut(150, function (){
$(this).remove();
el.removeClass('per-load');
});
});
el.on('changed.owl.carousel', function (event){
$(event.target).find('.active').addClass('loaded');
});
el.owlCarousel(config);
})
}};
Module.subMenuEffects=function (){
var self=this;
if(self.isTouchDevice()){
return false;
}
var rbMenus=$('.rb-menu');
if(rbMenus.length > 0){
rbMenus.each(function (){
var menu=$(this);
var subMegaItems=menu.children('.is-mega-menu');
subMegaItems.find('.sub-menu, .menu-item-has-children').addBack().addClass('mega-tree');
var subParents=menu.find('.menu-item-has-children');
subParents.not('.mega-tree').addClass('animation-menu');
var subMenus=menu.find('.sub-menu');
if(subMenus.length > 0){
$(subMenus).each(function (){
var subItem=$(this);
if(!subItem.hasClass('mega-tree')){
var itemItem=subItem.children('li').children('a');
var index=0;
$(itemItem).each(function (){
var item=$(this);
var delay=200 + 35 * index;
item.css('transition-delay', delay + 'ms');
item.css('-webkit-transition-delay', delay + 'ms');
index++;
});
}});
}
if(!menu.hasClass('is-clicked')){
subParents.on('mouseenter', function (){
var self=$(this);
if(self.hasClass('animation-menu')){
self.addClass('hovering-menu');
self.removeClass('no-delay');
}
return false;
}).on('mouseleave', function (){
var self=$(this);
if(self.hasClass('animation-menu')){
self.removeClass('hovering-menu');
self.addClass('no-delay');
}
return false;
});
}});
}};
Module.bigSlider=function (){
var self=this;
var elements=$('.slider-feat-4, .slider-feat-5, .slider-feat-14, .slider-feat-15');
if(elements.length > 0){
var config={
items: 1,
loop: true,
dots: self.$themeSettings.sliderDot,
navText: [self.slidePrev, self.slideNext],
autoplay: self.$themeSettings.sliderPlay,
autoplayTimeout: self.$themeSettings.sliderSpeed,
autoplayHoverPause: true,
nav: false,
rtl: self.getRTL(),
navClass: [
'rb-owl-prev',
'rb-owl-next'
],
navElement: 'div role="presentation"',
autoplaySpeed: 500,
responsive: {
768: {
nav: true
}}
};
if(self.$themeSettings.sliderAnimation){
config.animateOut='fadeOut';
}
elements.each(function (){
var el=$(this);
el.on('initialized.owl.carousel', function (){
el.prev('.load-animation').fadeOut(150, function (){
$(this).remove();
el.removeClass('per-load');
});
});
el.owlCarousel(config);
})
}};
Module.bigNavSlider=function (){
var self=this;
var elements=$('.slider-feat-13');
if(elements.length > 0){
var config={
items: 1,
loop: true,
dots: self.$themeSettings.sliderDot,
dotsData: true,
autoplay: self.$themeSettings.sliderPlay,
autoplayTimeout: self.$themeSettings.sliderSpeed,
autoplayHoverPause: true,
nav: false,
animateOut: 'rb-slideout',
rtl: self.getRTL(),
autoplaySpeed: 500
};
if(self.$themeSettings.sliderAnimation){
config.animateOut='fadeOut';
}
elements.each(function (){
var el=$(this);
el.on('initialized.owl.carousel', function (){
el.prev('.load-animation').fadeOut(150, function (){
$(this).remove();
el.removeClass('per-load');
});
});
el.on('changed.owl.carousel', function (event){
$(event.target).find('.active').addClass('loaded');
});
el.owlCarousel(config);
})
}};
Module.offCanvasLoad=function (){
$('#off-canvas-section').removeClass('is-hidden');
};
Module.toggleOffCanvas=function (){
var self=this;
var triggerBtn=$('.off-canvas-trigger');
var closeBtn=$('#off-canvas-close-btn');
var siteMask=$('.site-mask');
triggerBtn.on('click||tap', function (e){
e.preventDefault();
e.stopPropagation();
self.$body.toggleClass('mobile-js-menu');
return false;
});
siteMask.on('click||tap', function (){
self.$body.toggleClass('mobile-js-menu');
return false;
});
closeBtn.on('click||tap', function (){
self.$body.toggleClass('mobile-js-menu');
return false;
});
var nav=$('.off-canvas-menu');
var navSub=nav.find('li.menu-item-has-children > a');
navSub.append('<aside class="explain-menu"><i class="rbi rbi-angle-down"></i></aside>');
$('.explain-menu').on('click', function (){
var item=$(this).closest('.menu-item-has-children');
item.children('.sub-menu').slideToggle(200);
setTimeout(function (){
item.toggleClass('hovering-menu');
if(item.hasClass('hovering-menu')){
item.removeClass('no-delay');
}else{
item.addClass('no-delay');
item.find('.sub-menu').hide();
}}, 150);
return false;
});
};
Module.searchBoxToggle=function (){
var self=this;
$('.nav-search-link').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var target=$(this).next('.navbar-search-popup');
self.$body.find('.show-searchform').not(target).removeClass('show-searchform');
target.toggleClass('show-searchform');
});
};
Module.stickySidebar=function (){
var sidebars=$('.sidebar-sticky').not('.sb-infinite');
if(sidebars.length > 0){
this.$body.imagesLoaded(function (){
RubyStickySidebar.stick(sidebars);
});
}};
Module.tooltips=function (){
var self=this;
if(self.$body.hasClass('is-tooltips')&&false===self.$ios){
if(self.$body.hasClass('is-tooltips-touch')){
if(false===self.ios){
self.tooltipsProcess()
}}else{
self.tooltipsProcess()
}}
};
Module.tooltipsProcess=function (){
if(window.innerWidth < 992){
return false;
}
var self=this;
var tooltips_n=self.$body.find('.tooltips-n');
var tooltips_w=self.$body.find('.tooltips-w');
var tooltips_s=self.$body.find('.tooltips-s');
var tooltips_e=self.$body.find('.tooltips-e');
var tooltipsCart=self.$body.find('.cart-tooltips .add-to-cart');
var direct_e='e';
var direct_w='w';
if(this.getRTL()){
direct_e='w';
direct_w='e';
}
if(tooltips_n.length > 0){
tooltips_n.each(function (){
var current=$(this);
if(!current.hasClass('tipsy-loaded')){
current.children('a, .tipsy-el').tipsy({
fade: true,
opacity: 1,
trigger: 'hover',
gravity: 'n'
});
current.addClass('tipsy-loaded')
}})
}
if(tooltips_w.length > 0){
tooltips_w.each(function (){
var current=$(this);
if(!current.hasClass('tipsy-loaded')){
current.children('a').tipsy({
fade: true,
opacity: 1,
trigger: 'hover',
gravity: direct_w
});
current.addClass('tipsy-loaded')
}})
}
if(tooltips_s.length > 0){
tooltips_s.each(function (){
var current=$(this);
if(!current.hasClass('tipsy-loaded')){
current.children('a').tipsy({
fade: true,
opacity: 1,
trigger: 'hover',
gravity: 's'
});
current.addClass('tipsy-loaded')
}})
}
if(tooltips_e.length > 0){
tooltips_e.each(function (){
var current=$(this);
if(!current.hasClass('tipsy-loaded')){
current.children('a').tipsy({
fade: true,
opacity: 1,
trigger: 'hover',
gravity: direct_e
});
current.addClass('tipsy-loaded')
}})
}
if(!tooltipsCart.hasClass('tipsy-loaded')&&window.innerWidth > 992){
tooltipsCart.tipsy({
trigger: 'hover',
fade: true, opacity: 1, gravity: direct_e, title: function (){
var added=$(this).find('.added_to_cart');
if(added.length > 0){
return added.text();
}
return $(this).find('.ajax_add_to_cart').text();
}});
tooltipsCart.addClass('tipsy-loaded')
}};
Module.bookMarkTipsy=function (){
var tipsyBookmarks=$('.read-it-later');
tipsyBookmarks.each(function (){
var current=$(this);
if(!current.hasClass('tipsy-loaded')){
current.tipsy({
fade: true,
opacity: 1,
gravity: 's',
title: function (){
return $(this).data('title');
}});
current.addClass('tipsy-loaded');
}});
};
Module.categoryHeaderBg=function (){
var self=this;
var headerBGWrap=$('#category-header-bg');
if(headerBGWrap.length > 0){
var background=headerBGWrap.data('background');
var wrapper=headerBGWrap.parent('.header-holder');
var topPos=wrapper.offset().top;
var headerHeight=wrapper.height();
if(background){
headerBGWrap.css('background-image', 'url(' + background + ')');
setTimeout(function (){
headerBGWrap.addClass('is-show');
}, 1);
self.initParallax(headerBGWrap, topPos, headerHeight, 3);
if(window.addEventListener){
window.addEventListener('scroll', function (){
self.parallaxCalcAnimation(headerBGWrap, topPos, headerHeight, 3);
}, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', function (){
self.parallaxCalcAnimation(headerBGWrap, topPos, headerHeight, 3);
});
}}
}};
Module.initParallax=function (wrapper, posTop, elHeight, percent){
if(!this.$body.hasClass('is-parallax-feat')||wrapper.hasClass('parallax-init')){
return;
}
var scrollTop=this.$document.scrollTop();
if(Math.abs(scrollTop - posTop) <=elHeight){
var parallaxMove=Math.round((scrollTop - posTop) / percent);
wrapper.css('transform', 'translate3d(0,' + parallaxMove + 'px, 0)');
wrapper.css('-webkit-transform', 'translate3d(0,' + parallaxMove + 'px, 0)');
}};
Module.parallaxCalcAnimation=function (wrapper, posTop, elHeight, percent){
var scrollTop=this.$document.scrollTop();
if(Math.abs(scrollTop - posTop) <=elHeight){
var parallaxMove=Math.round((scrollTop - posTop) / percent);
wrapper.css('transform', 'translate3d(0,' + parallaxMove + 'px, 0)');
wrapper.css('-webkit-transform', 'translate3d(0,' + parallaxMove + 'px, 0)');
}};
Module.singleParallaxFeat=function (){
var self=this;
if(!self.$body.hasClass('is-parallax-feat')){
return;
}
var singleParallax=$('.parallax-thumb');
if(singleParallax.length > 0){
singleParallax.each(function (){
var el=$(this);
if(!el.hasClass('loaded-parallax')){
var wrapper=el.find('.rb-iwrap');
var posTop=el.offset().top;
var elHeight=el.height();
self.initParallax(wrapper, posTop, elHeight, 4);
setTimeout(function (){
el.addClass('loaded-parallax');
}, 500);
if(window.addEventListener){
window.addEventListener('scroll', function (){
self.parallaxCalcAnimation(wrapper, posTop, elHeight, 4);
}, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', function (){
self.parallaxCalcAnimation(wrapper, posTop, elHeight, 4);
});
}}
})
}};
Module.showSingleFeat=function (){
var singleParallax=$('.parallax-thumb');
if(singleParallax.length > 0){
singleParallax.each(function (){
var el=$(this);
el.imagesLoaded(function (){
if(!el.hasClass('feat-loaded')){
el.addClass('feat-loaded')
}});
});
}};
Module.calcFullScreenFeat=function (){
var self=this;
var singleParallax=$('.parallax-thumb');
var winHeight=this.$window.height();
if(singleParallax.length > 0){
singleParallax.each(function (){
var el=$(this);
var wrapper=el.find('.rb-iwrap');
var topOffset=el.offset().top;
if(el.hasClass('is-fullscreen')&&!el.hasClass('h-added')){
el.addClass('h-added');
if(topOffset < winHeight){
el.css('height', 'calc(100vh - ' + el.offset().top + 'px)');
}else{
el.css('height', '100vh');
}}
var elHeight=el.height();
self.initParallax(wrapper, topOffset, elHeight, 4);
wrapper.addClass('parallax-init');
});
}};
Module.postGallerySlider=function (){
var self=this;
var elements=$('.p-gallery-slider');
if(elements.length > 0){
var config={
items: 1,
loop: true,
dots: self.$themeSettings.sliderDot,
navText: [self.slidePrev, self.slideNext],
autoplay: self.$themeSettings.sliderPlay,
autoplayTimeout: self.$themeSettings.sliderSpeed,
nav: true,
autoplayHoverPause: true,
rtl: self.getRTL(),
navClass: [
'rb-owl-prev',
'rb-owl-next'
],
navElement: 'div role="presentation"',
autoplaySpeed: 500
};
elements.each(function (){
var el=$(this);
el.on('initialized.owl.carousel', function (){
el.prev('.load-animation').fadeOut(150, function (){
$(this).remove();
el.removeClass('per-load');
});
});
el.imagesLoaded(function (){
el.owlCarousel(config);
});
})
}};
Module.siteAccessDetector=async function (){
var self=this;
var template=$('#tmpl-rb-site-access');
if(!template.length){
return;
}
const googleAdUrl='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
const isAdBlocked=await (async ()=> {
try {
const controller=new AbortController();
const timeoutId=setTimeout(()=> controller.abort(), 3000);
await fetch(googleAdUrl, {method: 'HEAD', signal: controller.signal});
clearTimeout(timeoutId);
return false;
} catch (error){
return true;
}})();
if(isAdBlocked){
self.siteAccessFlag=true;
self.siteAccessPopup();
}};
Module.siteAccessPopup=function (){
this.siteAccessFlag=true;
$.magnificPopup.close();
$.magnificPopup.open({
type: 'inline',
preloader: false,
showCloseBtn: false,
closeBtnInside: false,
enableEscapeKey: false,
removalDelay: 999999,
closeOnBgClick: false,
items: {
src: $('#tmpl-rb-site-access').html(),
type: 'inline'
},
mainClass: 'popup-animation site-access-popup',
fixedBgPos: true,
fixedContentPos: true
});
};
Module.postGalleryLightBox=function (){
var self=this;
$('.gallery-popup-link, .rb-gallery-link').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var target=$(this);
var data=[];
var galleryID=target.data('gallery');
var slideIndex=target.data('index');
var galleries=$(galleryID).find('.gallery-el');
galleries.each(function (){
data.push({
title: $(this).find('.image-title').html(),
rbgallery: $(this).html()
});
});
$.magnificPopup.open({
type: 'inline',
mainClass: 'rb-gallery-popup rb-popup-effect mfp-animation',
closeMarkup: '<button title="%title%" class="mfp-close"><i class="rbi rbi-move"></i></button>',
closeOnBgClick: false,
removalDelay: 500,
showCloseBtn: true,
preloader: false,
gallery: {
enabled: true,
preload: [0, 2],
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"><i class="rbi rbi-angle-%dir%"></i></button>',
tCounter: '<span>%curr% / %total%</span>'
},
callbacks: {
open: function (){
$.magnificPopup.instance.goTo(slideIndex);
self.$document.on('click', '.gallery-popup-select', function (e){
e.preventDefault();
e.stopPropagation();
var index=$(this).data('index');
$.magnificPopup.instance.goTo(index);
});
},
buildControls: function (){
if(this.arrowLeft&&this.arrowRight){
this.contentContainer.find('.gallery-popup-nav').append(this.arrowLeft.add(this.arrowRight));
}}
},
inline: {
markup: '<div class="gallery-popup-header is-light-text">' +
'<h3 class="mfp-title"></h3>' +
'<div class="header-right"><div class="mfp-counter"></div><div class="gallery-popup-nav"></div><div class="mfp-close"></div></div>' +
'</div>' +
'<div class="gallery-popup-content"><div class="mfp-rbgallery"></div></div>'
},
items: data
});
return false;
});
};
Module.videoAutoPlay=function (){
var self=this;
var videos=$('.post-video-outer');
var nonResIframe=$('.entry-content > iframe');
if(videos!=null&&videos.length > 0){
videos.each(function (){
var el=$(this);
if(el.hasClass('is-autoplay')&&!el.hasClass('added-autoplay')){
self.wPoint['iframe']=new Waypoint({
element: el,
handler: function (){
var iframe=el.find('iframe');
self.initAutoPlay(iframe);
el.addClass('autoplay-added');
this.destroy();
},
offset: '60%'
});
}})
}
if(nonResIframe!=null&&nonResIframe.length > 0){
nonResIframe.each(function (){
var el=$(this);
if(!el.hasClass('is-loaded')){
var iURL=el.attr('src');
if(iURL.indexOf('youtube.com') > 0||iURL.indexOf('youtu.be') > 0||iURL.indexOf('vimeo.com') > 0){
el.wrap('<div class="rb-ires is-loaded"></div>');
}}
})
}};
Module.initAutoPlay=function (item){
if(item.length > 0&&'undefined'!=item[0]){
var src=item[0].src;
if(src.indexOf('?') > -1){
item[0].src +="&autoplay=1";
}else{
item[0].src +="?autoplay=1";
}}
};
Module.bodyImageLoaded=function (){
this.$body.imagesLoaded(function (){
$('.image-caption.is-overlay').removeClass('is-hide');
})
};
Module.showPostComment=function (){
$('.show-post-comment').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
$(this).parent().next('.comment-box-content').removeClass('is-hidden');
$(this).fadeOut(400, function (){
$(this).remove();
})
});
};
Module.scrollToComment=function (){
var commentBtn=$('.show-post-comment');
var self=this;
if(commentBtn.length > 0){
var hash=window.location.hash;
if('#respond'==hash||'#comment'==hash.substring(0, 8)){
commentBtn.trigger('click');
self.$html.scrollTop(commentBtn.offset().top);
}}
};
Module.replyReview=function (){
var replyLink=$('.comment-reply-link');
replyLink.on('click', function (){
var target=$(this);
var wrapper=target.parents('.rb-reviews-area');
if(wrapper.length > 0){
var cancelLink=$('#cancel-comment-reply-link');
wrapper.find('.rb-form-rating').addClass('is-hidden');
cancelLink.on('click', function (){
wrapper.find('.rb-form-rating').removeClass('is-hidden');
});
}});
};
Module.productQuantity=function (){
this.$document.on('click', '.quantity .quantity-btn', function (e){
e.preventDefault();
var button=$(this);
var step=1;
var input=button.parent().find('input');
var min=1;
var max=9999;
var value_old=parseInt(input.val());
var value_new=parseInt(input.val());
if(input.attr('step')){
step=parseInt(input.attr('step'));
}
if(input.attr('min')){
min=parseInt(input.attr('min'));
}
if(input.attr('max')){
max=parseInt(input.attr('max'));
}
if(button.hasClass('up')){
if(value_old < max){
value_new=value_old + step;
}else{
value_new=max;
}}else if(button.hasClass('down')){
if(value_old > min){
value_new=value_old - step;
}else{
value_new=min;
}}
if(!input.attr('disabled')){
input.val(value_new).change();
}});
};
Module.mainMenuPos=function (){
if(window.innerWidth < 991){
return false;
}
var defaultSubs=$('.rb-menu .sub-menu:not(sub-mega)');
var megaColItems=$('.is-mega-menu.type-column');
if(defaultSubs.length > 0){
defaultSubs.each(function (){
var item=$(this);
var wrap=item.parents('.navbar-inner');
if(wrap.length > 0){
var wrapRightOffset=wrap.offset().left + wrap.width();
var rightOffset=item.offset().left + item.width();
if(rightOffset > wrapRightOffset){
item.addClass('left-direction');
item.parents('.sub-menu').addClass('left-direction is-left-child');
}}
});
}
if(megaColItems.length > 0){
megaColItems.each(function (){
var item=$(this);
item.imagesLoaded(function (){
var parent=item.parents('.navbar-inner');
var sub=item.children('.mega-col.sub-menu');
var rightSpacing=parent.offset().left + parent.width() - (item.offset().left + item.width());
var leftSpacing=item.offset().left - parent.offset().left;
if(sub.length > 0){
var subWidth=sub.width();
var subHaftWidth=parseInt(subWidth / 2);
if(subHaftWidth > leftSpacing){
sub.css('left', '-' + leftSpacing + 'px');
sub.css('right', 'auto');
}else if(subHaftWidth > rightSpacing){
sub.css('right', '-' + rightSpacing + 'px');
sub.css('left', 'auto');
}else{
sub.css('left', '-' + parseInt(subHaftWidth - parseInt(item.width() / 2)) + 'px');
sub.css('right', 'auto');
}}
});
})
}};
Module.reCalcMenuPos=function (){
var self=this;
var delay;
this.$window.on('resize', function (){
clearTimeout(delay);
delay=setTimeout(function (){
self.mainMenuPos();
}, 300);
})
};
Module.masonryFW1=function (){
var self=this;
var wrapper=$('.fw-masonry-1.is-masonry');
if(wrapper.length > 0){
wrapper.each(function (){
var el=$(this);
var inner=el.find('.content-inner').eq(0);
$(inner).isotope({
itemSelector: '.fw-mh-1',
percentPosition: true,
masonry: {
columnWidth: '.fw-ms-1'
}});
self.$window.on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
self.$body.imagesLoaded(function (){
setTimeout(function (){
$(inner).isotope('layout');
}, 20)
});
});
}};
Module.masonryCT1=function (){
var self=this;
var wrapper=$('.ct-masonry-1.is-masonry');
if(wrapper.length > 0){
wrapper.each(function (){
var el=$(this);
var inner=el.find('.content-inner').eq(0);
$(inner).isotope({
itemSelector: '.ct-mh-1',
percentPosition: true,
masonry: {
columnWidth: '.ct-ms-1'
}});
self.$window.on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
self.$body.imagesLoaded(function (){
setTimeout(function (){
$(inner).isotope('layout');
}, 20)
});
});
}};
Module.masonryPPCol3=function (){
var self=this;
var wrapper=$('.pp-archive-m3.is-masonry');
if(wrapper.length > 0){
wrapper.each(function (){
var el=$(this);
var inner=el.find('.content-inner').eq(0);
$(inner).isotope({
itemSelector: '.fw-mh-1',
percentPosition: true,
masonry: {
columnWidth: '.fw-ms-1'
}});
self.$window.on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
self.$body.imagesLoaded(function (){
setTimeout(function (){
$(inner).isotope('layout');
}, 20)
});
});
}};
Module.masonryPPCol4=function (){
var self=this;
var wrapper=$('.pp-archive-m4.is-masonry');
if(wrapper.length > 0){
wrapper.each(function (){
var el=$(this);
var inner=el.find('.content-inner').eq(0);
$(inner).isotope({
itemSelector: '.fw-mh-c4',
percentPosition: true,
masonry: {
columnWidth: '.fw-ms-c4'
}});
self.$window.on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
self.$body.imagesLoaded(function (){
setTimeout(function (){
$(inner).isotope('layout');
}, 20)
});
});
}};
Module.masonryFwP1=function (){
var self=this;
var wrapper=$('.fw-portfolio-1.is-masonry');
if(wrapper.length > 0){
wrapper.each(function (){
var el=$(this);
var inner=el.find('.content-inner').eq(0);
var portfolioFW1=$(inner).isotope({
itemSelector: '.fw-mh-1',
percentPosition: true,
filter: '*',
masonry: {
columnWidth: '.fw-ms-1'
}});
self.$window.on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
self.$body.imagesLoaded(function (){
setTimeout(function (){
$(inner).isotope('layout');
}, 20)
});
var filterBtn=el.find('.pp-filter-el');
filterBtn.on('click', function (){
var target=$(this);
var filterValue=target.attr('data-filter');
target.addClass('active').siblings().removeClass('active');
$(inner).isotope({filter: filterValue});
})
});
}};
Module.rbGallery=function (){
let gallery=$('.rb-gallery-wrap');
if(gallery.length > 0){
gallery.each(function (){
let el=$(this);
let inner=el.find('.gallery-inner').eq(0);
$(inner).isotope({
itemSelector: '.rb-gallery-el',
percentPosition: true,
masonry: {
columnWidth: inner.find('.rb-gallery-el')[0]
}});
$(window).on('RB:LazyLoaded', function (){
inner.imagesLoaded().progress(function (){
$(inner).isotope('layout');
});
});
$('body').imagesLoaded(function (){
$(inner).isotope('layout');
});
setTimeout(function (){
inner.removeClass('gallery-loading');
}, 2000);
inner.imagesLoaded(function (){
inner.removeClass('gallery-loading');
});
});
}};
Module.usersRating=function (){
var self=this;
var reviewsForm=this.$body.find('.rb-reviews-form');
if(reviewsForm.length > 0){
reviewsForm.each(function (){
var reviewForm=$(this);
if(!reviewForm.hasClass('is-loaded')){
reviewForm.addClass('is-loaded');
var ratingForm=reviewForm.find('.rb-form-rating');
var target=reviewForm.find('.rb-rating-selection');
target.hide();
target.before('<div class="rb-review-stars">\
<span>\
<a class="star" data-rating="1" href="#"><i class="rbi rbi-star"></i></a>\
<a class="star" data-rating="2" href="#"><i class="rbi rbi-star"></i></a>\
<a class="star" data-rating="3" href="#"><i class="rbi rbi-star"></i></a>\
<a class="star" data-rating="4" href="#"><i class="rbi rbi-star"></i></a>\
<a class="star" data-rating="5" href="#"><i class="rbi rbi-star"></i></a>\
</span>\
</div>'
);
ratingForm.on('click', 'a.star', function (e){
e.preventDefault();
e.stopPropagation();
var star=$(this);
var rating=star.closest('#respond').find('.rb-rating-selection');
rating.val(star.data('rating'));
star.siblings('a').removeClass('active');
star.addClass('active');
ratingForm.addClass('selected');
});
reviewForm.on('click', '#respond #submit', function (){
var ratingEl=$(this).closest('.rb-reviews-form').find('.rb-rating-selection');
var text=$(this).closest('.rb-reviews-form').find('.rating-alert').html();
var rating=ratingEl.val();
if(ratingEl.length > 0&&!rating){
window.alert(text);
return false;
}});
}});
}};
Module.reinitiateFunctions=function (){
this.$html.off();
this.$document.off();
this.$window.trigger('load');
this.documentReload();
};
Module.$cacheAjax={
data: {},
get: function (id){
return this.data[id];
},
set: function (id, data){
this.remove(id);
this.data[id]=data;
},
remove: function (id){
delete this.data[id];
},
exist: function (id){
return this.data.hasOwnProperty(id)&&this.data[id]!==null;
}};
Module.getAjaxData=function (block){
return {
uuid: block.data('uuid'),
name: block.data('name'),
posts_per_page: block.data('posts_per_page'),
page_max: block.data('page_max'),
page_current: block.data('page_current'),
category: block.data('category'),
categories: block.data('categories'),
orderby: block.data('orderby'),
author: block.data('author'),
tags: block.data('tags'),
post_not_in: block.data('post_not_in'),
format: block.data('format'),
offset: block.data('offset'),
quick_filter: block.data('quick_filter'),
tag_not_in: block.data('tag_not_in'),
layout: block.data('layout')
};};
Module.checkPagination=function (block){
var settings=this.getAjaxData(block);
if(settings.page_current >=settings.page_max||settings.page_max <=1){
block.find('.loadmore-link').hide();
block.find('.loadmore-animation').hide();
block.find('.pagination-infinite').addClass('disable-pagination');
block.find('.pagination-loadmore').addClass('disable-pagination');
}else{
block.find('.loadmore-link').show();
block.find('.loadmore-link').css('opacity', 1);
block.find('.loadmore-animation').hide();
block.find('.pagination-infinite').removeClass('disable-pagination');
block.find('.pagination-loadmore').removeClass('disable-pagination');
}
if(settings.page_max < 2){
block.find('.pagination-link').addClass('is-disable');
}
if(settings.page_current >=settings.page_max){
block.find('.ajax-next').addClass('is-disable');
}
if(settings.page_current <=1){
block.find('.ajax-prev').addClass('is-disable');
}};
Module.quickFilter=function (){
var self=this;
$('.quick-filter-link').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var link=$(this);
var block=link.parents('.block-wrap');
var uuid=block.attr('id');
if(true==self.$ajax[uuid + '_processing']){
return;
}
self.$ajax[uuid + '_processing']=true;
var filterVal=link.data('ajax_filter_val');
block.find('.quick-filter-link').removeClass('is-active');
block.find('.quick-filter-link').not(this).addClass('is-deactivate');
link.addClass('is-active');
self.animationStart(block, 'replace');
var settings=self.getAjaxData(block);
self.resetQuickFilter(block, settings, filterVal);
setTimeout(function (){
self.quickFilterProcess(block, settings);
}, 400);
});
Module.resetQuickFilter=function (block, settings, filterVal){
var self=this;
var uuid=block.attr('id');
settings.page_current=1;
block.data('page_current', 1);
if('category'==settings.quick_filter){
if('undefined'==typeof (self.$ajax[uuid + '_category'])){
self.$ajax[uuid + '_category']=0;
}
if(0==filterVal){
settings.category=self.$ajax[uuid + '_category'];
settings.categories=self.$ajax[uuid + '_categories'];
block.data('category', self.$ajax[uuid + '_category']);
block.data('categories', self.$ajax[uuid + '_categories']);
}else{
settings.category=filterVal;
settings.categories=0;
block.data('category', filterVal);
block.data('categories', 0);
}}
if('tag'==settings.quick_filter){
settings.tags=filterVal;
block.data('tags', filterVal);
}};
Module.quickFilterProcess=function (block, settings){
var self=this;
var cacheSettings=settings;
delete cacheSettings.page_max;
var cacheID=JSON.stringify(cacheSettings);
if(self.$cacheAjax.exist(cacheID)){
var data=self.$cacheAjax.get(cacheID);
if('undefined'!=typeof data.page_max){
block.data('page_max', data.page_max);
}
self.animationEnd(block, data.content, 'replace');
return false;
}else{
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'pixwell_quick_filter',
data: settings
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
if('undefined'!=typeof data.page_max){
block.data('page_max', data.page_max);
}
self.$cacheAjax.set(cacheID, data);
self.animationEnd(block, data.content, 'replace');
}});
}};
Module.paginationNextPrev=function (){
var self=this;
$('.pagination-link').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var link=$(this);
var block=link.parents('.block-wrap');
var uuid=block.attr('id');
if(true==self.$ajax[uuid + '_processing']){
return;
}
self.$ajax[uuid + '_processing']=true;
var type=link.data('type');
var settings=self.getAjaxData(block);
self.animationStart(block, 'replace');
self.paginationNextPrevProcess(block, settings, type);
});
};
Module.paginationNextPrevProcess=function (block, settings, type){
if('prev'==type){
settings.page_next=parseInt(settings.page_current) - 1;
}else{
settings.page_next=parseInt(settings.page_current) + 1;
}
var cacheSettings=settings;
delete cacheSettings.page_max;
cacheSettings.page_current=settings.page_next;
var cacheID=JSON.stringify(cacheSettings);
if(self.$cacheAjax.exist(cacheID)){
var data=self.$cacheAjax.get(cacheID);
if('undefined'!=typeof data.page_current){
block.data('page_current', data.page_current);
}
self.animationEnd(block, data.content, 'replace');
return false;
}else{
$.ajax({
type: 'POST',
url: pixwellCoreParams.ajaxurl,
data: {
action: 'pixwell_live_pagination',
data: settings
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
if('undefined'!=typeof data.page_current){
block.data('page_current', data.page_current);
}
self.$cacheAjax.set(cacheID, data);
self.animationEnd(block, data.content, 'replace');
}});
}};
Module.loadMore=function (){
var self=this;
$('.loadmore-link').off('click').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var link=$(this);
var block=link.parents('.block-wrap');
var uuid=block.attr('id');
if(true==self.$ajax[uuid + '_processing']){
return;
}
self.$ajax[uuid + '_processing']=true;
var settings=self.getAjaxData(block);
if(settings.page_current >=settings.page_max){
return;
}
self.animationStart(block, 'append');
self.loadmoreProcess(block, settings);
})
};
Module.loadmoreProcess=function (block, settings){
settings.page_next=parseInt(settings.page_current) + 1;
if(settings.page_next <=settings.page_max){
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'pixwell_live_pagination',
data: settings
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
if('undefined'!=data.page_current){
block.data('page_current', data.page_current);
}
if('undefined'!=data.notice){
data.content=data.content + data.notice;
}
self.animationEnd(block, data.content, 'append');
}});
}};
Module.paginationInfinite=function (){
var self=this;
var infiniteElements=$('.pagination-infinite');
if(infiniteElements.length > 0){
infiniteElements.each(function (){
var element=$(this);
if(!element.hasClass('disable-pagination')){
var animation=element.find('.loadmore-animation');
var block=element.parents('.block-wrap');
var uuid=block.attr('id');
var wPointID='infinite' + uuid;
var settings=self.getAjaxData(block);
self.wPoint[wPointID]=new Waypoint({
element: element,
handler: function (direction){
if('down'==direction){
if(true==self.$ajax[uuid + '_processing']){
return;
}
self.$ajax[uuid + '_processing']=true;
self.animationStart(block, 'append');
Module.loadmoreProcess(block, settings);
setTimeout(function (){
self.wPoint[wPointID].destroy();
}, 10);
}},
offset: '99%'
})
}});
}};
Module.animationStart=function (block, action){
var wrapper=block.find('.content-wrap');
var inner=wrapper.find('.content-inner');
block.find('.ajax-link').addClass('is-disable');
inner.stop();
if('replace'==action){
wrapper.css('height', wrapper.outerHeight());
wrapper.prepend('<div class="load-animation"></div>');
inner.addClass('is-overflow');
inner.fadeTo('200', 0.05);
}else{
block.find('.loadmore-link').addClass('loading').animate({opacity: 0}, 200);
block.find('.loadmore-animation').css({'display': 'block'}).delay(300).animate({opacity: 1}, 200);
}};
Module.animationEnd=function (block, content, action){
var self=this;
block.delay(100).queue(function (){
var uuid=block.attr('id');
var wrapper=block.find('.content-wrap');
var inner=block.find('.content-inner');
block.find('.filter-link').removeClass('is-deactivate');
block.find('.ajax-link').removeClass('is-disable');
inner.stop();
if('replace'==action){
wrapper.find('.load-animation').remove();
inner.html(content);
if(inner.hasClass('mega-content-inner')){
inner.imagesLoaded(function (){
setTimeout(function (){
inner.removeClass('is-overflow');
wrapper.css('height', 'auto');
setTimeout(function (){
inner.fadeTo(300, 1);
}, 300);
}, 100)
});
}else{
inner.removeClass('is-overflow');
wrapper.css('height', 'auto');
setTimeout(function (){
inner.fadeTo(300, 1);
}, 300);
}}else{
content=$(content);
content.addClass('is-hide');
content.addClass('opacity-animate');
inner.append(content);
block.find('.loadmore-animation').animate({opacity: 0}, 200, function (){
$(this).css({'display': 'none'});
});
setTimeout(function (){
content.removeClass('is-hide');
}, 300);
block.find('.loadmore-link').removeClass('loading').delay(300).animate({opacity: 1}, 200);
}
if(inner.hasClass('is-masonry-reload')){
$(inner).isotope('reloadItems');
self.$window.on('RB:LazyLoaded', function (){
$(inner).isotope('reloadItems');
});
}
self.checkPagination(block);
block.dequeue();
setTimeout(function (){
self.$ajax[uuid + '_processing']=false;
self.reinitiateFunctions();
}, 50);
});
}};
Module.navLiveSearch=function (){
var navSearch=$('.nav-search-live');
if(navSearch.length==0){
return;
}
navSearch.each(function (){
var navSearchEl=$(this);
var input=navSearchEl.find('input[type="search"]');
var contentWrap=navSearchEl.find('.navbar-search-response');
var animation=navSearchEl.find('.live-search-animation');
var submitIcon=navSearchEl.find('.search-form');
input.attr('autocomplete', 'off');
var delay=(function (){
var timer=0;
return function (callback, ms){
clearTimeout(timer);
timer=setTimeout(callback, ms);
};})();
input.keyup(function (){
var param=$(this).val();
delay(function (){
if(param){
submitIcon.addClass('loading');
setTimeout(function (){
animation.fadeIn(250);
}, 250);
$.ajax({
type: 'POST',
url: pixwellParams.ajaxurl,
data: {
action: 'pixwell_live_search',
s: param
},
success: function (data){
data=$.parseJSON(JSON.stringify(data));
animation.fadeOut(250);
setTimeout(function (){
submitIcon.removeClass('loading');
}, 300);
contentWrap.hide().empty().css('height', contentWrap.height());
contentWrap.html(data);
contentWrap.css('height', 'auto').fadeIn(250);
$(window).trigger('load');
}});
}else{
contentWrap.fadeOut(300, function (){
contentWrap.empty().css('height', 'auto');
});
}}, 300);
})
});
};
Module.singleInfiniteLoadNext=function (){
var self=this;
var infiniteWrapper=$('#single-post-infinite');
var infiniteLoadPoint=$('#single-infinite-point');
var animationIcon=infiniteLoadPoint.find('.loadmore-animation');
if(infiniteWrapper.length==0||infiniteLoadPoint.length==0){
return;
}
infiniteWrapper.imagesLoaded(function (){
self.wPoint['ajaxSingle']=new Waypoint({
element: infiniteLoadPoint,
offset: 'bottom-in-view',
handler: function (direction){
if(true==self.$ajax['singleProcessing']||'up'==direction){
return;
}
var nextPostURL=infiniteWrapper.data('nextposturl');
if(nextPostURL.indexOf('?')!=-1||nextPostURL.indexOf('#')!=-1){
nextPostURL=nextPostURL + '&rbsnp=1';
}else{
nextPostURL=nextPostURL + '?rbsnp=1';
}
self.$ajax['singleProcessing']=true;
animationIcon.css({'display': 'block'}).delay(300).animate({opacity: 1}, 300);
$.ajax({
type: 'GET',
url: nextPostURL,
dataType: 'html',
success: function (response){
response=$.parseJSON(JSON.stringify(response));
response=$('<div id="temp-dom"></div>').append($.parseHTML(response));
response=response.find('.single-p-outer');
var nextPostURL=response.data('nextposturl');
if('undefined'!=typeof (nextPostURL)&&nextPostURL.length > 0){
infiniteWrapper.data('nextposturl', nextPostURL);
}else{
infiniteWrapper.removeAttr('id');
infiniteLoadPoint.remove();
}
animationIcon.animate({opacity: 0}, 300).delay(300).css({'display': 'none'});
var googleAds=$(response).find('.adsbygoogle');
var instEmbed=$(response).find('.instagram-media');
infiniteWrapper.append(response);
self.$ajax['singleProcessing']=false;
setTimeout(function (){
Waypoint.refreshAll();
self.reinitiateFunctions();
self.loadGoogleAds(googleAds);
self.loadInstagram(instEmbed)
}, 1);
}});
}});
});
};
Module.scrollUpdateProcess=function (){
var self=this;
var scroll;
var articleData=[];
var infiniteWrapper=$('#single-post-infinite');
if(infiniteWrapper.length==0){
return;
}
var articleOuter=infiniteWrapper.find('.single-p-outer');
if(articleOuter.length > 0){
articleOuter.each(function (){
var article=$(this);
articleData.push({
postID: article.data('postid'),
postURL: article.data('postlink'),
postTitle: article.find('h1.entry-title').text(),
top: article.offset().top,
bottom: article.offset().top + article.outerHeight(true)
});
});
if(window.addEventListener){
window.addEventListener('scroll', function (){
if(self.$singleScrollDelay % 3==1){
self.scrollUpdateAction(articleData);
self.$singleScrollDelay=1;
}else{
self.$singleScrollDelay++;
}}, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', function (){
if(self.$singleScrollDelay % 3==0){
self.scrollUpdateAction(articleData);
self.$singleScrollDelay=1;
}else{
self.$singleScrollDelay++;
}});
}}
};
Module.scrollUpdateAction=function (articleData){
var self=this;
var scrollTop=self.$window.scrollTop();
articleData.every(function (element){
if(scrollTop > element.top&&scrollTop < element.bottom){
if(element.postID!=self.currentArticleID){
self.currentArticleID=element.postID;
self.updateLocationHref(element.postURL, element.postTitle);
}
return false;
}
return true;
});
};
Module.updateLocationHref=function (url, title){
var self=this;
if(window.location.href!==url){
if(url!==''){
history.replaceState(null, null, url);
document.title=title;
}
self.updateGA(url);
}};
Module.updateGA=function (url){
url=url.replace(/https?:\/\/[^\/]+/i, '');
if(typeof _gaq!=='undefined'&&_gaq!==null){
_gaq.push(['_trackPageview', url]);
}
if(typeof ga!=='undefined'&&ga!==null){
ga('send', 'pageview', url);
}
if(typeof __gaTracker!=='undefined'&&__gaTracker!==null){
__gaTracker('send', 'pageview', url);
}
if(typeof googletag!=='undefined'){
googletag.pubads().refresh();
}};
Module.loadGoogleAds=function (googleAds){
if(typeof window.adsbygoogle!=='undefined'&&googleAds.length){
var adsbygoogle;
googleAds.each(function (){
(adsbygoogle=window.adsbygoogle||[]).push({});
});
}};
Module.loadInstagram=function (instEmbed){
if('undefined'!==typeof window.instgrm){
window.instgrm.Embeds.process();
}else if(instEmbed.length&&'undefined'===typeof window.instgrm){
var embedJS=document.createElement('script');
embedJS.src='//platform.instagram.com/en_US/embeds.js';
embedJS.onload=function (){
window.instgrm.Embeds.process();
};
this.$body.append(embedJS);
}};
Module.loadElementor=function (){
PIXWELL_MAIN_SCRIPTS.$themeSettings.sliderPlay=0;
PIXWELL_MAIN_SCRIPTS.bigSlider();
PIXWELL_MAIN_SCRIPTS.carouselSlider();
PIXWELL_MAIN_SCRIPTS.carouselWideSlider();
PIXWELL_MAIN_SCRIPTS.bigNavSlider();
};
return Module;
}(PIXWELL_MAIN_SCRIPTS||{}, jQuery));
jQuery(document).ready(function (){
PIXWELL_MAIN_SCRIPTS.init();
});
jQuery(window).on('elementor/frontend/init', function (){
if(window.elementor){
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-4.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-5.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-14.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-15.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-3.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-7.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-9.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-10.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-12.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
elementorFrontend.hooks.addAction('frontend/element_ready/fw-feat-13.default', PIXWELL_MAIN_SCRIPTS.loadElementor);
}});