(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,i){for(var n=0;n/gi.test(e)},isType:function(t,i){if(!a.isValue(t))return!1;if(e(t)===i)return t;if(a.isTag(t)||a.isUrl(t))return!1;if(e(window[t])===i)return window[t];if("string"==typeof t&&-1===t.indexOf("."))return!1;if("string"==typeof t&&-1!==t.indexOf("/"))return!1;if("string"==typeof t&&-1!==t.indexOf(" "))return!1;if("string"==typeof t&&-1!==t.indexOf("("))return!1;if("string"==typeof t&&-1!==t.indexOf("["))return!1;if("number"==typeof t&&"number"!==i.toLowerCase())return!1;var n,r=t.split("."),f=window;for(n=0;n0&&(this.hasIcon=!0),a.find(".branding-bar")&&(this.hasBranding=!0),r.effect.indexOf("hover-")>-1&&(a.addClass("effect-"+r.effect),t.each(s,(function(){var e=t(this);void 0!==e.data("cover")&&i._setCover(e,e.data("cover"),e.data("cover-position"))}))),r.effect.indexOf("animate-")>-1&&o.length>1&&(t.each(o,(function(e){var n=t(this);i.slides.push(this),void 0!==n.data("cover")&&this._setCover(n,n.data("cover"),n.data("cover-position")),e>0&&(["animate-slide-up","animate-slide-down"].indexOf(r.effect)>-1&&n.css("top","100%"),["animate-slide-left","animate-slide-right"].indexOf(r.effect)>-1&&n.css("left","100%"),["animate-fade"].indexOf(r.effect)>-1&&n.css("opacity",0))})),this.currentSlide=0,this._runEffects()),""!==r.cover&&this._setCover(a,r.cover),"image-set"===r.effect){a.addClass("image-set"),t.each(a.children("img"),(function(){var e=document.createElement("img");e.src=this.src,e.srcset=this.srcset,e.alt=this.alt,i.images.push(e),t(this).remove()}));for(var l=this.images.slice(),c=0;c<5;c++){var d=n(0,l.length-1),u=t("
").addClass("img -js-img-"+c).css("background-image","url("+l[d].src+")");a.prepend(u),l.length>1&&l.splice(d,1)}var h=[0,1,4,3,2];setInterval((function(){var t,r=i.images.slice(),o=f.colors(f.PALETTES.ALL);t=o[n(0,o.length-1)],a.css("background-color",t);for(var s=0;s1&&r.splice(l,1)}h=h.reverse()}),5e3)}},this._runEffects=function(){var e=this.options;!1===this.effectInterval&&(this.effectInterval=setInterval((function(){var i,n;i=t(this.slides[this.currentSlide]),this.currentSlide++,this.currentSlide===this.slides.length&&(this.currentSlide=0),n=this.slides[this.currentSlide],"animate-slide-up"===e.effect&&r.slideUp(t(i),t(n),e.effectDuration),"animate-slide-down"===e.effect&&r.slideDown(t(i),t(n),e.effectDuration),"animate-slide-left"===e.effect&&r.slideLeft(t(i),t(n),e.effectDuration),"animate-slide-right"===e.effect&&r.slideRight(t(i),t(n),e.effectDuration),"animate-fade"===e.effect&&r.fade(t(i),t(n),e.effectDuration)}),e.effectInterval))},this._stopEffects=function(){clearInterval(this.effectInterval),this.effectInterval=!1},this.resize=function(){var e=1,t=this.element.parent(".tiles-grid");t.length>0&&t.width(),"wide"==this.options.size&&(e=.5);var i=this.element.width()*e-0;if(this.hasIcon){var n=.33*i,a=this.element.find(".icon");if(a.css("font-size",n+"px"),this.hasBranding){var r=(i+n)/2-(i-this.element.find(".branding-bar").outerHeight())+.1*i;r>0&&a.css("padding-bottom",r+"px")}}},this._setCover=function(e,t,i){a.isValue(i)||(i=this.options.coverPosition),e.css({backgroundImage:"url("+t+")",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:i})},this._createEvents=function(){var e=this.element,i=this.options;e.on("mousedown touchstart",(function(n){var r,f=t(this),o=e.width(),s=e.height(),l=a.pageXY(n).x-f.offset().left,c=a.pageXY(n).y-f.offset().top;!1===a.isRightMouse(n)&&(r=l<1*o/3&&(c<1*s/2||c>1*s/2)?"left":l>2*o/3&&(c<1*s/2||c>1*s/2)?"right":l>1*o/3&&l<2*o/3&&c>s/2?"bottom":"top",!0===i.canTransform&&f.addClass("transform-"+r),null!==i.target&&setTimeout((function(){document.location.href=i.target}),100),a.exec(i.onClick,[r],e[0]),e.trigger("click",{side:r}))})),e.on("mouseup touchend mouseleave",(function(){t(this).removeClass("transform-left").removeClass("transform-right").removeClass("transform-top").removeClass("transform-bottom")})),t(window).on("resize",this._fixSizeCallback),t(this._fixSizeCallback)},this.destroy=function(){var e=this.element;e.off("mousedown touchstart"),e.off("mouseup touchend mouseleave"),t(window).off("resize",this._fixSizeCallback),this._stopEffects()},this.init(e,o)}function s(){t(".tiles-grid").each((function(){var e=t(this),i=e.width()/4-10;e.css({gridTemplateColumns:"repeat(4, "+i+"px)",gridAutoRows:i+"px"})}))}function l(e){e.forEach((function(e){"attributes"==e.type&&"class"==e.attributeName&&(t('*[data-role="tile"]').tile("resize"),s())}))}t.fn.extend({tile:function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a0&&new MutationObserver(l).observe(e[0],{attributes:!0})}))}(jQuery)})();