'use strict';
!function(factory) {
if ("function" == typeof define && define.amd) {
define(["jquery"], factory);
} else {
if ("undefined" != typeof exports) {
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}
}(function($) {
var Slick = window.Slick || {};
/**
* @return {undefined}
*/
(Slick = function() {
/** @type {number} */
var instanceUid = 0;
return function(element, settings) {
var dataSettings;
var _ = this;
_.defaults = {
accessibility : true,
adaptiveHeight : false,
appendArrows : $(element),
appendDots : $(element),
arrows : true,
asNavFor : null,
prevArrow : '',
nextArrow : '',
autoplay : false,
autoplaySpeed : 3e3,
centerMode : false,
centerPadding : "50px",
cssEase : "ease",
customPaging : function(slider, i) {
return $('').text(i + 1);
},
dots : false,
dotsClass : "slick-dots",
draggable : true,
easing : "linear",
edgeFriction : .35,
fade : false,
focusOnSelect : false,
focusOnChange : false,
infinite : true,
initialSlide : 0,
lazyLoad : "ondemand",
mobileFirst : false,
pauseOnHover : true,
pauseOnFocus : true,
pauseOnDotsHover : false,
respondTo : "window",
responsive : null,
rows : 1,
rtl : false,
slide : "",
slidesPerRow : 1,
slidesToShow : 1,
slidesToScroll : 1,
speed : 500,
swipe : true,
swipeToSlide : false,
touchMove : true,
touchThreshold : 5,
useCSS : true,
useTransform : true,
variableWidth : false,
vertical : false,
verticalSwiping : false,
waitForAnimate : true,
zIndex : 1e3
};
_.initials = {
animating : false,
dragging : false,
autoPlayTimer : null,
currentDirection : 0,
currentLeft : null,
currentSlide : 0,
direction : 1,
$dots : null,
listWidth : null,
listHeight : null,
loadIndex : 0,
$nextArrow : null,
$prevArrow : null,
scrolling : false,
slideCount : null,
slideWidth : null,
$slideTrack : null,
$slides : null,
sliding : false,
slideOffset : 0,
swipeLeft : null,
swiping : false,
$list : null,
touchObject : {},
transformsEnabled : false,
unslicked : false
};
$.extend(_, _.initials);
/** @type {null} */
_.activeBreakpoint = null;
/** @type {null} */
_.animType = null;
/** @type {null} */
_.animProp = null;
/** @type {!Array} */
_.breakpoints = [];
/** @type {!Array} */
_.breakpointSettings = [];
/** @type {boolean} */
_.cssTransitions = false;
/** @type {boolean} */
_.focussed = false;
/** @type {boolean} */
_.interrupted = false;
/** @type {string} */
_.hidden = "hidden";
/** @type {boolean} */
_.paused = true;
/** @type {null} */
_.positionProp = null;
/** @type {null} */
_.respondTo = null;
/** @type {number} */
_.rowCount = 1;
/** @type {boolean} */
_.shouldClick = true;
_.$slider = $(element);
/** @type {null} */
_.$slidesCache = null;
/** @type {null} */
_.transformType = null;
/** @type {null} */
_.transitionType = null;
/** @type {string} */
_.visibilityChange = "visibilitychange";
/** @type {number} */
_.windowWidth = 0;
/** @type {null} */
_.windowTimer = null;
dataSettings = $(element).data("slick") || {};
_.options = $.extend({}, _.defaults, settings, dataSettings);
_.currentSlide = _.options.initialSlide;
_.originalSettings = _.options;
if (void 0 !== document.mozHidden) {
/** @type {string} */
_.hidden = "mozHidden";
/** @type {string} */
_.visibilityChange = "mozvisibilitychange";
} else {
if (void 0 !== document.webkitHidden) {
/** @type {string} */
_.hidden = "webkitHidden";
/** @type {string} */
_.visibilityChange = "webkitvisibilitychange";
}
}
_.autoPlay = $.proxy(_.autoPlay, _);
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
_.changeSlide = $.proxy(_.changeSlide, _);
_.clickHandler = $.proxy(_.clickHandler, _);
_.selectHandler = $.proxy(_.selectHandler, _);
_.setPosition = $.proxy(_.setPosition, _);
_.swipeHandler = $.proxy(_.swipeHandler, _);
_.dragHandler = $.proxy(_.dragHandler, _);
_.keyHandler = $.proxy(_.keyHandler, _);
/** @type {number} */
_.instanceUid = instanceUid++;
/** @type {!RegExp} */
_.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
_.registerBreakpoints();
_.init(true);
};
}()).prototype.activateADA = function() {
this.$slideTrack.find(".slick-active").attr({
"aria-hidden" : "false"
}).find("a, input, button, select").attr({
tabindex : "0"
});
};
/** @type {function(?, number, boolean): ?} */
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
var _ = this;
if ("boolean" == typeof index) {
/** @type {number} */
addBefore = index;
/** @type {null} */
index = null;
} else {
if (index < 0 || index >= _.slideCount) {
return false;
}
}
_.unload();
if ("number" == typeof index) {
if (0 === index && 0 === _.$slides.length) {
$(markup).appendTo(_.$slideTrack);
} else {
if (addBefore) {
$(markup).insertBefore(_.$slides.eq(index));
} else {
$(markup).insertAfter(_.$slides.eq(index));
}
}
} else {
if (true === addBefore) {
$(markup).prependTo(_.$slideTrack);
} else {
$(markup).appendTo(_.$slideTrack);
}
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slides.each(function(inSelectOnClick, clicked_el) {
$(clicked_el).attr("data-slick-index", inSelectOnClick);
});
_.$slidesCache = _.$slides;
_.reinit();
};
/**
* @return {undefined}
*/
Slick.prototype.animateHeight = function() {
var _ = this;
if (1 === _.options.slidesToShow && true === _.options.adaptiveHeight && false === _.options.vertical) {
var dxdydust = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.animate({
height : dxdydust
}, _.options.speed);
}
};
/**
* @param {number} targetLeft
* @param {!Function} callback
* @return {undefined}
*/
Slick.prototype.animateSlide = function(targetLeft, callback) {
var positionProps = {};
var _ = this;
_.animateHeight();
if (true === _.options.rtl && false === _.options.vertical) {
/** @type {number} */
targetLeft = -targetLeft;
}
if (false === _.transformsEnabled) {
if (false === _.options.vertical) {
_.$slideTrack.animate({
left : targetLeft
}, _.options.speed, _.options.easing, callback);
} else {
_.$slideTrack.animate({
top : targetLeft
}, _.options.speed, _.options.easing, callback);
}
} else {
if (false === _.cssTransitions) {
if (true === _.options.rtl) {
/** @type {number} */
_.currentLeft = -_.currentLeft;
}
$({
animStart : _.currentLeft
}).animate({
animStart : targetLeft
}, {
duration : _.options.speed,
easing : _.options.easing,
step : function(num) {
/** @type {number} */
num = Math.ceil(num);
if (false === _.options.vertical) {
/** @type {string} */
positionProps[_.animType] = "translate(" + num + "px, 0px)";
_.$slideTrack.css(positionProps);
} else {
/** @type {string} */
positionProps[_.animType] = "translate(0px," + num + "px)";
_.$slideTrack.css(positionProps);
}
},
complete : function() {
if (callback) {
callback.call();
}
}
});
} else {
_.applyTransition();
/** @type {number} */
targetLeft = Math.ceil(targetLeft);
if (false === _.options.vertical) {
/** @type {string} */
positionProps[_.animType] = "translate3d(" + targetLeft + "px, 0px, 0px)";
} else {
/** @type {string} */
positionProps[_.animType] = "translate3d(0px," + targetLeft + "px, 0px)";
}
_.$slideTrack.css(positionProps);
if (callback) {
setTimeout(function() {
_.disableTransition();
callback.call();
}, _.options.speed);
}
}
}
};
/**
* @return {?}
*/
Slick.prototype.getNavTarget = function() {
var _ = this;
var asNavFor = _.options.asNavFor;
return asNavFor && null !== asNavFor && (asNavFor = $(asNavFor).not(_.$slider)), asNavFor;
};
/**
* @param {number} index
* @return {undefined}
*/
Slick.prototype.asNavFor = function(index) {
var options = this.getNavTarget();
if (null !== options && "object" == typeof options) {
options.each(function() {
var target = $(this).slick("getSlick");
if (!target.unslicked) {
target.slideHandler(index, true);
}
});
}
};
/**
* @param {!Object} slide
* @return {undefined}
*/
Slick.prototype.applyTransition = function(slide) {
var _ = this;
var transition = {};
if (false === _.options.fade) {
/** @type {string} */
transition[_.transitionType] = _.transformType + " " + _.options.speed + "ms " + _.options.cssEase;
} else {
/** @type {string} */
transition[_.transitionType] = "opacity " + _.options.speed + "ms " + _.options.cssEase;
}
if (false === _.options.fade) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
/**
* @return {undefined}
*/
Slick.prototype.autoPlay = function() {
var _ = this;
_.autoPlayClear();
if (_.slideCount > _.options.slidesToShow) {
/** @type {number} */
_.autoPlayTimer = setInterval(_.autoPlayIterator, _.options.autoplaySpeed);
}
};
/**
* @return {undefined}
*/
Slick.prototype.autoPlayClear = function() {
var _ = this;
if (_.autoPlayTimer) {
clearInterval(_.autoPlayTimer);
}
};
/**
* @return {undefined}
*/
Slick.prototype.autoPlayIterator = function() {
var _ = this;
var slideCount = _.currentSlide + _.options.slidesToScroll;
if (!(_.paused || _.interrupted || _.focussed)) {
if (false === _.options.infinite) {
if (1 === _.direction && _.currentSlide + 1 === _.slideCount - 1) {
/** @type {number} */
_.direction = 0;
} else {
if (0 === _.direction) {
/** @type {number} */
slideCount = _.currentSlide - _.options.slidesToScroll;
if (_.currentSlide - 1 == 0) {
/** @type {number} */
_.direction = 1;
}
}
}
}
_.slideHandler(slideCount);
}
};
/**
* @return {undefined}
*/
Slick.prototype.buildArrows = function() {
var _ = this;
if (true === _.options.arrows) {
_.$prevArrow = $(_.options.prevArrow).addClass("slick-arrow");
_.$nextArrow = $(_.options.nextArrow).addClass("slick-arrow");
if (_.slideCount > _.options.slidesToShow) {
_.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");
_.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");
if (_.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.prependTo(_.options.appendArrows);
}
if (_.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.appendTo(_.options.appendArrows);
}
if (true !== _.options.infinite) {
_.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true");
}
} else {
_.$prevArrow.add(_.$nextArrow).addClass("slick-hidden").attr({
"aria-disabled" : "true",
tabindex : "-1"
});
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.buildDots = function() {
var i;
var dot;
var _ = this;
if (true === _.options.dots) {
_.$slider.addClass("slick-dotted");
dot = $("
").addClass(_.options.dotsClass);
/** @type {number} */
i = 0;
for (; i <= _.getDotCount(); i = i + 1) {
dot.append($("").append(_.options.customPaging.call(this, _, i)));
}
_.$dots = dot.appendTo(_.options.appendDots);
_.$dots.find("li").first().addClass("slick-active");
}
};
/**
* @return {undefined}
*/
Slick.prototype.buildOut = function() {
var _ = this;
_.$slides = _.$slider.children(_.options.slide + ":not(.slick-cloned)").addClass("slick-slide");
_.slideCount = _.$slides.length;
_.$slides.each(function(group_id, clicked_el) {
$(clicked_el).attr("data-slick-index", group_id).data("originalStyling", $(clicked_el).attr("style") || "");
});
_.$slider.addClass("slick-slider");
_.$slideTrack = 0 === _.slideCount ? $('').appendTo(_.$slider) : _.$slides.wrapAll('').parent();
_.$list = _.$slideTrack.wrap('').parent();
_.$slideTrack.css("opacity", 0);
if (!(true !== _.options.centerMode && true !== _.options.swipeToSlide)) {
/** @type {number} */
_.options.slidesToScroll = 1;
}
$("img[data-lazy]", _.$slider).not("[src]").addClass("slick-loading");
_.setupInfinite();
_.buildArrows();
_.buildDots();
_.updateDots();
_.setSlideClasses("number" == typeof _.currentSlide ? _.currentSlide : 0);
if (true === _.options.draggable) {
_.$list.addClass("draggable");
}
};
/**
* @return {undefined}
*/
Slick.prototype.buildRows = function() {
var a;
var b;
var c;
var t;
var Del;
var n;
var slidesPerSection;
var _ = this;
if (t = document.createDocumentFragment(), n = _.$slider.children(), _.options.rows > 1) {
/** @type {number} */
slidesPerSection = _.options.slidesPerRow * _.options.rows;
/** @type {number} */
Del = Math.ceil(n.length / slidesPerSection);
/** @type {number} */
a = 0;
for (; a < Del; a++) {
/** @type {!Element} */
var d = document.createElement("div");
/** @type {number} */
b = 0;
for (; b < _.options.rows; b++) {
/** @type {!Element} */
var a = document.createElement("div");
/** @type {number} */
c = 0;
for (; c < _.options.slidesPerRow; c++) {
/** @type {number} */
var cls = a * slidesPerSection + (b * _.options.slidesPerRow + c);
if (n.get(cls)) {
a.appendChild(n.get(cls));
}
}
d.appendChild(a);
}
t.appendChild(d);
}
_.$slider.empty().append(t);
_.$slider.children().children().children().css({
width : 100 / _.options.slidesPerRow + "%",
display : "inline-block"
});
}
};
/**
* @param {boolean} initial
* @param {boolean} forceUpdate
* @return {undefined}
*/
Slick.prototype.checkResponsive = function(initial, forceUpdate) {
var breakpoint;
var targetBreakpoint;
var respondToWidth;
var _ = this;
/** @type {boolean} */
var triggerBreakpoint = false;
var sliderWidth = _.$slider.width();
var windowWidth = window.innerWidth || $(window).width();
if ("window" === _.respondTo ? respondToWidth = windowWidth : "slider" === _.respondTo ? respondToWidth = sliderWidth : "min" === _.respondTo && (respondToWidth = Math.min(windowWidth, sliderWidth)), _.options.responsive && _.options.responsive.length && null !== _.options.responsive) {
/** @type {null} */
targetBreakpoint = null;
for (breakpoint in _.breakpoints) {
if (_.breakpoints.hasOwnProperty(breakpoint)) {
if (false === _.originalSettings.mobileFirst) {
if (respondToWidth < _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
} else {
if (respondToWidth > _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
}
}
}
if (null !== targetBreakpoint) {
if (null !== _.activeBreakpoint) {
if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
_.activeBreakpoint = targetBreakpoint;
if ("unslick" === _.breakpointSettings[targetBreakpoint]) {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings, _.breakpointSettings[targetBreakpoint]);
if (true === initial) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint = targetBreakpoint;
}
} else {
/** @type {null} */
_.activeBreakpoint = targetBreakpoint;
if ("unslick" === _.breakpointSettings[targetBreakpoint]) {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings, _.breakpointSettings[targetBreakpoint]);
if (true === initial) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
/** @type {null} */
triggerBreakpoint = targetBreakpoint;
}
} else {
if (null !== _.activeBreakpoint) {
/** @type {null} */
_.activeBreakpoint = null;
_.options = _.originalSettings;
if (true === initial) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
/** @type {null} */
triggerBreakpoint = targetBreakpoint;
}
}
if (!(initial || false === triggerBreakpoint)) {
_.$slider.trigger("breakpoint", [_, triggerBreakpoint]);
}
}
};
/**
* @param {!Object} event
* @param {boolean} dontAnimate
* @return {undefined}
*/
Slick.prototype.changeSlide = function(event, dontAnimate) {
var indexOffset;
var slideOffset;
var unevenOffset;
var _ = this;
var $lis = $(event.currentTarget);
switch($lis.is("a") && event.preventDefault(), $lis.is("li") || ($lis = $lis.closest("li")), unevenOffset = _.slideCount % _.options.slidesToScroll != 0, indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll, event.data.message) {
case "previous":
slideOffset = 0 === indexOffset ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
}
break;
case "next":
slideOffset = 0 === indexOffset ? _.options.slidesToScroll : indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
}
break;
case "index":
var index = 0 === event.data.index ? 0 : event.data.index || $lis.index() * _.options.slidesToScroll;
_.slideHandler(_.checkNavigable(index), false, dontAnimate);
$lis.children().trigger("focus");
break;
default:
return;
}
};
/**
* @param {number} index
* @return {?}
*/
Slick.prototype.checkNavigable = function(index) {
var navigables;
var prevNavigable;
if (navigables = this.getNavigableIndexes(), prevNavigable = 0, index > navigables[navigables.length - 1]) {
index = navigables[navigables.length - 1];
} else {
var n;
for (n in navigables) {
if (index < navigables[n]) {
index = prevNavigable;
break;
}
prevNavigable = navigables[n];
}
}
return index;
};
/**
* @return {undefined}
*/
Slick.prototype.cleanUpEvents = function() {
var _ = this;
if (_.options.dots && null !== _.$dots) {
$("li", _.$dots).off("click.slick", _.changeSlide).off("mouseenter.slick", $.proxy(_.interrupt, _, true)).off("mouseleave.slick", $.proxy(_.interrupt, _, false));
if (true === _.options.accessibility) {
_.$dots.off("keydown.slick", _.keyHandler);
}
}
_.$slider.off("focus.slick blur.slick");
if (true === _.options.arrows && _.slideCount > _.options.slidesToShow) {
if (_.$prevArrow) {
_.$prevArrow.off("click.slick", _.changeSlide);
}
if (_.$nextArrow) {
_.$nextArrow.off("click.slick", _.changeSlide);
}
if (true === _.options.accessibility) {
if (_.$prevArrow) {
_.$prevArrow.off("keydown.slick", _.keyHandler);
}
if (_.$nextArrow) {
_.$nextArrow.off("keydown.slick", _.keyHandler);
}
}
}
_.$list.off("touchstart.slick mousedown.slick", _.swipeHandler);
_.$list.off("touchmove.slick mousemove.slick", _.swipeHandler);
_.$list.off("touchend.slick mouseup.slick", _.swipeHandler);
_.$list.off("touchcancel.slick mouseleave.slick", _.swipeHandler);
_.$list.off("click.slick", _.clickHandler);
$(document).off(_.visibilityChange, _.visibility);
_.cleanUpSlideEvents();
if (true === _.options.accessibility) {
_.$list.off("keydown.slick", _.keyHandler);
}
if (true === _.options.focusOnSelect) {
$(_.$slideTrack).children().off("click.slick", _.selectHandler);
}
$(window).off("orientationchange.slick.slick-" + _.instanceUid, _.orientationChange);
$(window).off("resize.slick.slick-" + _.instanceUid, _.resize);
$("[draggable!=true]", _.$slideTrack).off("dragstart", _.preventDefault);
$(window).off("load.slick.slick-" + _.instanceUid, _.setPosition);
};
/**
* @return {undefined}
*/
Slick.prototype.cleanUpSlideEvents = function() {
var self = this;
self.$list.off("mouseenter.slick", $.proxy(self.interrupt, self, true));
self.$list.off("mouseleave.slick", $.proxy(self.interrupt, self, false));
};
/**
* @return {undefined}
*/
Slick.prototype.cleanUpRows = function() {
var photoText;
var _ = this;
if (_.options.rows > 1) {
(photoText = _.$slides.children().children()).removeAttr("style");
_.$slider.empty().append(photoText);
}
};
/**
* @param {!Event} event
* @return {undefined}
*/
Slick.prototype.clickHandler = function(event) {
if (false === this.shouldClick) {
event.stopImmediatePropagation();
event.stopPropagation();
event.preventDefault();
}
};
/**
* @param {boolean} keepPosition
* @return {undefined}
*/
Slick.prototype.destroy = function(keepPosition) {
var _ = this;
_.autoPlayClear();
_.touchObject = {};
_.cleanUpEvents();
$(".slick-cloned", _.$slider).detach();
if (_.$dots) {
_.$dots.remove();
}
if (_.$prevArrow && _.$prevArrow.length) {
_.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", "");
if (_.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.remove();
}
}
if (_.$nextArrow && _.$nextArrow.length) {
_.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", "");
if (_.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.remove();
}
}
if (_.$slides) {
_.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function() {
$(this).attr("style", $(this).data("originalStyling"));
});
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.detach();
_.$list.detach();
_.$slider.append(_.$slides);
}
_.cleanUpRows();
_.$slider.removeClass("slick-slider");
_.$slider.removeClass("slick-initialized");
_.$slider.removeClass("slick-dotted");
/** @type {boolean} */
_.unslicked = true;
if (!keepPosition) {
_.$slider.trigger("destroy", [_]);
}
};
/**
* @param {!Object} slide
* @return {undefined}
*/
Slick.prototype.disableTransition = function(slide) {
var _ = this;
var transition = {};
/** @type {string} */
transition[_.transitionType] = "";
if (false === _.options.fade) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
/**
* @param {!Object} slideIndex
* @param {!Function} callback
* @return {undefined}
*/
Slick.prototype.fadeSlide = function(slideIndex, callback) {
var _ = this;
if (false === _.cssTransitions) {
_.$slides.eq(slideIndex).css({
zIndex : _.options.zIndex
});
_.$slides.eq(slideIndex).animate({
opacity : 1
}, _.options.speed, _.options.easing, callback);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity : 1,
zIndex : _.options.zIndex
});
if (callback) {
setTimeout(function() {
_.disableTransition(slideIndex);
callback.call();
}, _.options.speed);
}
}
};
/**
* @param {!Object} slideIndex
* @return {undefined}
*/
Slick.prototype.fadeSlideOut = function(slideIndex) {
var _ = this;
if (false === _.cssTransitions) {
_.$slides.eq(slideIndex).animate({
opacity : 0,
zIndex : _.options.zIndex - 2
}, _.options.speed, _.options.easing);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity : 0,
zIndex : _.options.zIndex - 2
});
}
};
/** @type {function(number): undefined} */
Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
var _ = this;
if (null !== filter) {
_.$slidesCache = _.$slides;
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
_.reinit();
}
};
/**
* @return {undefined}
*/
Slick.prototype.focusHandler = function() {
var _ = this;
_.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*", function(event) {
event.stopImmediatePropagation();
var $passwordList = $(this);
setTimeout(function() {
if (_.options.pauseOnFocus) {
_.focussed = $passwordList.is(":focus");
_.autoPlay();
}
}, 0);
});
};
/** @type {function(): ?} */
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
return this.currentSlide;
};
/**
* @return {?}
*/
Slick.prototype.getDotCount = function() {
var _ = this;
/** @type {number} */
var breakPoint = 0;
/** @type {number} */
var counter = 0;
/** @type {number} */
var pagerQty = 0;
if (true === _.options.infinite) {
if (_.slideCount <= _.options.slidesToShow) {
++pagerQty;
} else {
for (; breakPoint < _.slideCount;) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter = counter + (_.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow);
}
}
} else {
if (true === _.options.centerMode) {
pagerQty = _.slideCount;
} else {
if (_.options.asNavFor) {
for (; breakPoint < _.slideCount;) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter = counter + (_.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow);
}
} else {
/** @type {number} */
pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
}
}
}
return pagerQty - 1;
};
/**
* @param {number} slideIndex
* @return {?}
*/
Slick.prototype.getLeft = function(slideIndex) {
var i;
var verticalHeight;
var c;
var HeaderContentBonusMultiplier;
var _ = this;
/** @type {number} */
var headerScore = 0;
return _.slideOffset = 0, verticalHeight = _.$slides.first().outerHeight(true), true === _.options.infinite ? (_.slideCount > _.options.slidesToShow && (_.slideOffset = _.slideWidth * _.options.slidesToShow * -1, HeaderContentBonusMultiplier = -1, true === _.options.vertical && true === _.options.centerMode && (2 === _.options.slidesToShow ? HeaderContentBonusMultiplier = -1.5 : 1 === _.options.slidesToShow && (HeaderContentBonusMultiplier = -2)), headerScore = verticalHeight * _.options.slidesToShow *
HeaderContentBonusMultiplier), _.slideCount % _.options.slidesToScroll != 0 && slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow && (slideIndex > _.slideCount ? (_.slideOffset = (_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth * -1, headerScore = (_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight * -1) : (_.slideOffset = _.slideCount % _.options.slidesToScroll * _.slideWidth * -1, headerScore = _.slideCount %
_.options.slidesToScroll * verticalHeight * -1))) : slideIndex + _.options.slidesToShow > _.slideCount && (_.slideOffset = (slideIndex + _.options.slidesToShow - _.slideCount) * _.slideWidth, headerScore = (slideIndex + _.options.slidesToShow - _.slideCount) * verticalHeight), _.slideCount <= _.options.slidesToShow && (_.slideOffset = 0, headerScore = 0), true === _.options.centerMode && _.slideCount <= _.options.slidesToShow ? _.slideOffset = _.slideWidth * Math.floor(_.options.slidesToShow) /
2 - _.slideWidth * _.slideCount / 2 : true === _.options.centerMode && true === _.options.infinite ? _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth : true === _.options.centerMode && (_.slideOffset = 0, _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2)), i = false === _.options.vertical ? slideIndex * _.slideWidth * -1 + _.slideOffset : slideIndex * verticalHeight * -1 + headerScore, true === _.options.variableWidth && (c = _.slideCount <=
_.options.slidesToShow || false === _.options.infinite ? _.$slideTrack.children(".slick-slide").eq(slideIndex) : _.$slideTrack.children(".slick-slide").eq(slideIndex + _.options.slidesToShow), i = true === _.options.rtl ? c[0] ? -1 * (_.$slideTrack.width() - c[0].offsetLeft - c.width()) : 0 : c[0] ? -1 * c[0].offsetLeft : 0, true === _.options.centerMode && (c = _.slideCount <= _.options.slidesToShow || false === _.options.infinite ? _.$slideTrack.children(".slick-slide").eq(slideIndex) : _.$slideTrack.children(".slick-slide").eq(slideIndex +
_.options.slidesToShow + 1), i = true === _.options.rtl ? c[0] ? -1 * (_.$slideTrack.width() - c[0].offsetLeft - c.width()) : 0 : c[0] ? -1 * c[0].offsetLeft : 0, i = i + (_.$list.width() - c.outerWidth()) / 2)), i;
};
/** @type {function(?): ?} */
Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
return this.options[option];
};
/**
* @return {?}
*/
Slick.prototype.getNavigableIndexes = function() {
var pagerQty;
var _ = this;
/** @type {number} */
var i = 0;
/** @type {number} */
var counter = 0;
/** @type {!Array} */
var indexes = [];
if (false === _.options.infinite) {
pagerQty = _.slideCount;
} else {
/** @type {number} */
i = -1 * _.options.slidesToScroll;
/** @type {number} */
counter = -1 * _.options.slidesToScroll;
/** @type {number} */
pagerQty = 2 * _.slideCount;
}
for (; i < pagerQty;) {
indexes.push(i);
i = counter + _.options.slidesToScroll;
counter = counter + (_.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow);
}
return indexes;
};
/**
* @return {?}
*/
Slick.prototype.getSlick = function() {
return this;
};
/**
* @return {?}
*/
Slick.prototype.getSlideCount = function() {
var currentPage;
var p;
var _ = this;
return p = true === _.options.centerMode ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0, true === _.options.swipeToSlide ? (_.$slideTrack.find(".slick-slide").each(function(s, n) {
if (n.offsetLeft - p + $(n).outerWidth() / 2 > -1 * _.swipeLeft) {
return currentPage = n, false;
}
}), Math.abs($(currentPage).attr("data-slick-index") - _.currentSlide) || 1) : _.options.slidesToScroll;
};
/** @type {function(?, boolean): undefined} */
Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
this.changeSlide({
data : {
message : "index",
index : parseInt(slide)
}
}, dontAnimate);
};
/**
* @param {boolean} e
* @return {undefined}
*/
Slick.prototype.init = function(e) {
var _ = this;
if (!$(_.$slider).hasClass("slick-initialized")) {
$(_.$slider).addClass("slick-initialized");
_.buildRows();
_.buildOut();
_.setProps();
_.startLoad();
_.loadSlider();
_.initializeEvents();
_.updateArrows();
_.updateDots();
_.checkResponsive(true);
_.focusHandler();
}
if (e) {
_.$slider.trigger("init", [_]);
}
if (true === _.options.accessibility) {
_.initADA();
}
if (_.options.autoplay) {
/** @type {boolean} */
_.paused = false;
_.autoPlay();
}
};
/**
* @return {undefined}
*/
Slick.prototype.initADA = function() {
var _ = this;
/** @type {number} */
var userName = Math.ceil(_.slideCount / _.options.slidesToShow);
var info = _.getNavigableIndexes().filter(function(i) {
return i >= 0 && i < _.slideCount;
});
_.$slides.add(_.$slideTrack.find(".slick-cloned")).attr({
"aria-hidden" : "true",
tabindex : "-1"
}).find("a, input, button, select").attr({
tabindex : "-1"
});
if (null !== _.$dots) {
_.$slides.not(_.$slideTrack.find(".slick-cloned")).each(function(i) {
var $sendIcon = info.indexOf(i);
$(this).attr({
role : "tabpanel",
id : "slick-slide" + _.instanceUid + i,
tabindex : -1
});
if (-1 !== $sendIcon) {
$(this).attr({
"aria-describedby" : "slick-slide-control" + _.instanceUid + $sendIcon
});
}
});
_.$dots.attr("role", "tablist").find("li").each(function(hash) {
var i = info[hash];
$(this).attr({
role : "presentation"
});
$(this).find("button").first().attr({
role : "tab",
id : "slick-slide-control" + _.instanceUid + hash,
"aria-controls" : "slick-slide" + _.instanceUid + i,
"aria-label" : hash + 1 + " of " + userName,
"aria-selected" : null,
tabindex : "-1"
});
}).eq(_.currentSlide).find("button").attr({
"aria-selected" : "true",
tabindex : "0"
}).end();
}
var index = _.currentSlide;
var listIndex = index + _.options.slidesToShow;
for (; index < listIndex; index++) {
_.$slides.eq(index).attr("tabindex", 0);
}
_.activateADA();
};
/**
* @return {undefined}
*/
Slick.prototype.initArrowEvents = function() {
var _ = this;
if (true === _.options.arrows && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.off("click.slick").on("click.slick", {
message : "previous"
}, _.changeSlide);
_.$nextArrow.off("click.slick").on("click.slick", {
message : "next"
}, _.changeSlide);
if (true === _.options.accessibility) {
_.$prevArrow.on("keydown.slick", _.keyHandler);
_.$nextArrow.on("keydown.slick", _.keyHandler);
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.initDotEvents = function() {
var _ = this;
if (true === _.options.dots) {
$("li", _.$dots).on("click.slick", {
message : "index"
}, _.changeSlide);
if (true === _.options.accessibility) {
_.$dots.on("keydown.slick", _.keyHandler);
}
}
if (true === _.options.dots && true === _.options.pauseOnDotsHover) {
$("li", _.$dots).on("mouseenter.slick", $.proxy(_.interrupt, _, true)).on("mouseleave.slick", $.proxy(_.interrupt, _, false));
}
};
/**
* @return {undefined}
*/
Slick.prototype.initSlideEvents = function() {
var self = this;
if (self.options.pauseOnHover) {
self.$list.on("mouseenter.slick", $.proxy(self.interrupt, self, true));
self.$list.on("mouseleave.slick", $.proxy(self.interrupt, self, false));
}
};
/**
* @return {undefined}
*/
Slick.prototype.initializeEvents = function() {
var _ = this;
_.initArrowEvents();
_.initDotEvents();
_.initSlideEvents();
_.$list.on("touchstart.slick mousedown.slick", {
action : "start"
}, _.swipeHandler);
_.$list.on("touchmove.slick mousemove.slick", {
action : "move"
}, _.swipeHandler);
_.$list.on("touchend.slick mouseup.slick", {
action : "end"
}, _.swipeHandler);
_.$list.on("touchcancel.slick mouseleave.slick", {
action : "end"
}, _.swipeHandler);
_.$list.on("click.slick", _.clickHandler);
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
if (true === _.options.accessibility) {
_.$list.on("keydown.slick", _.keyHandler);
}
if (true === _.options.focusOnSelect) {
$(_.$slideTrack).children().on("click.slick", _.selectHandler);
}
$(window).on("orientationchange.slick.slick-" + _.instanceUid, $.proxy(_.orientationChange, _));
$(window).on("resize.slick.slick-" + _.instanceUid, $.proxy(_.resize, _));
$("[draggable!=true]", _.$slideTrack).on("dragstart", _.preventDefault);
$(window).on("load.slick.slick-" + _.instanceUid, _.setPosition);
$(_.setPosition);
};
/**
* @return {undefined}
*/
Slick.prototype.initUI = function() {
var _ = this;
if (true === _.options.arrows && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.show();
_.$nextArrow.show();
}
if (true === _.options.dots && _.slideCount > _.options.slidesToShow) {
_.$dots.show();
}
};
/**
* @param {!Event} event
* @return {undefined}
*/
Slick.prototype.keyHandler = function(event) {
var _ = this;
if (!event.target.tagName.match("TEXTAREA|INPUT|SELECT")) {
if (37 === event.keyCode && true === _.options.accessibility) {
_.changeSlide({
data : {
message : true === _.options.rtl ? "next" : "previous"
}
});
} else {
if (39 === event.keyCode && true === _.options.accessibility) {
_.changeSlide({
data : {
message : true === _.options.rtl ? "previous" : "next"
}
});
}
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.lazyLoad = function() {
/**
* @param {!Object} imagesScope
* @return {undefined}
*/
function loadImages(imagesScope) {
$("img[data-lazy]", imagesScope).each(function() {
var image = $(this);
var imageSource = $(this).attr("data-lazy");
var imageSrcSet = $(this).attr("data-srcset");
var toggleImageSource = $(this).attr("data-sizes") || _.$slider.attr("data-sizes");
/** @type {!Element} */
var imageToLoad = document.createElement("img");
/**
* @return {undefined}
*/
imageToLoad.onload = function() {
image.animate({
opacity : 0
}, 100, function() {
if (imageSrcSet) {
image.attr("srcset", imageSrcSet);
if (toggleImageSource) {
image.attr("sizes", toggleImageSource);
}
}
image.attr("src", imageSource).animate({
opacity : 1
}, 200, function() {
image.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");
});
_.$slider.trigger("lazyLoaded", [_, image, imageSource]);
});
};
/**
* @return {undefined}
*/
imageToLoad.onerror = function() {
image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");
_.$slider.trigger("lazyLoadError", [_, image, imageSource]);
};
imageToLoad.src = imageSource;
});
}
var loadRange;
var rangeStart;
var rangeEnd;
var _ = this;
if (true === _.options.centerMode ? true === _.options.infinite ? rangeEnd = (rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1)) + _.options.slidesToShow + 2 : (rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)), rangeEnd = _.options.slidesToShow / 2 + 1 + 2 + _.currentSlide) : (rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide, rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow), true === _.options.fade && (rangeStart >
0 && rangeStart--, rangeEnd <= _.slideCount && rangeEnd++)), loadRange = _.$slider.find(".slick-slide").slice(rangeStart, rangeEnd), "anticipated" === _.options.lazyLoad) {
/** @type {number} */
var prevSlide = rangeStart - 1;
var nextSlide = rangeEnd;
var $slides = _.$slider.find(".slick-slide");
/** @type {number} */
var i = 0;
for (; i < _.options.slidesToScroll; i++) {
if (prevSlide < 0) {
/** @type {number} */
prevSlide = _.slideCount - 1;
}
loadRange = (loadRange = loadRange.add($slides.eq(prevSlide))).add($slides.eq(nextSlide));
prevSlide--;
nextSlide++;
}
}
loadImages(loadRange);
if (_.slideCount <= _.options.slidesToShow) {
loadImages(_.$slider.find(".slick-slide"));
} else {
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
loadImages(_.$slider.find(".slick-cloned").slice(0, _.options.slidesToShow));
} else {
if (0 === _.currentSlide) {
loadImages(_.$slider.find(".slick-cloned").slice(-1 * _.options.slidesToShow));
}
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.loadSlider = function() {
var _ = this;
_.setPosition();
_.$slideTrack.css({
opacity : 1
});
_.$slider.removeClass("slick-loading");
_.initUI();
if ("progressive" === _.options.lazyLoad) {
_.progressiveLazyLoad();
}
};
/** @type {function(): undefined} */
Slick.prototype.next = Slick.prototype.slickNext = function() {
this.changeSlide({
data : {
message : "next"
}
});
};
/**
* @return {undefined}
*/
Slick.prototype.orientationChange = function() {
var _ = this;
_.checkResponsive();
_.setPosition();
};
/** @type {function(): undefined} */
Slick.prototype.pause = Slick.prototype.slickPause = function() {
var _ = this;
_.autoPlayClear();
/** @type {boolean} */
_.paused = true;
};
/** @type {function(): undefined} */
Slick.prototype.play = Slick.prototype.slickPlay = function() {
var _ = this;
_.autoPlay();
/** @type {boolean} */
_.options.autoplay = true;
/** @type {boolean} */
_.paused = false;
/** @type {boolean} */
_.focussed = false;
/** @type {boolean} */
_.interrupted = false;
};
/**
* @param {!Object} index
* @return {undefined}
*/
Slick.prototype.postSlide = function(index) {
var _ = this;
if (!_.unslicked) {
_.$slider.trigger("afterChange", [_, index]);
/** @type {boolean} */
_.animating = false;
if (_.slideCount > _.options.slidesToShow) {
_.setPosition();
}
/** @type {null} */
_.swipeLeft = null;
if (_.options.autoplay) {
_.autoPlay();
}
if (true === _.options.accessibility) {
_.initADA();
if (_.options.focusOnChange) {
$(_.$slides.get(_.currentSlide)).attr("tabindex", 0).focus();
}
}
}
};
/** @type {function(): undefined} */
Slick.prototype.prev = Slick.prototype.slickPrev = function() {
this.changeSlide({
data : {
message : "previous"
}
});
};
/**
* @param {!Event} event
* @return {undefined}
*/
Slick.prototype.preventDefault = function(event) {
event.preventDefault();
};
/**
* @param {number} tryCount
* @return {undefined}
*/
Slick.prototype.progressiveLazyLoad = function(tryCount) {
tryCount = tryCount || 1;
var image;
var imageSource;
var imageSrcSet;
var toggleImageSource;
var imageToLoad;
var _ = this;
var waitingIssues = $("img[data-lazy]", _.$slider);
if (waitingIssues.length) {
image = waitingIssues.first();
imageSource = image.attr("data-lazy");
imageSrcSet = image.attr("data-srcset");
toggleImageSource = image.attr("data-sizes") || _.$slider.attr("data-sizes");
/**
* @return {undefined}
*/
(imageToLoad = document.createElement("img")).onload = function() {
if (imageSrcSet) {
image.attr("srcset", imageSrcSet);
if (toggleImageSource) {
image.attr("sizes", toggleImageSource);
}
}
image.attr("src", imageSource).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");
if (true === _.options.adaptiveHeight) {
_.setPosition();
}
_.$slider.trigger("lazyLoaded", [_, image, imageSource]);
_.progressiveLazyLoad();
};
/**
* @return {undefined}
*/
imageToLoad.onerror = function() {
if (tryCount < 3) {
setTimeout(function() {
_.progressiveLazyLoad(tryCount + 1);
}, 500);
} else {
image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");
_.$slider.trigger("lazyLoadError", [_, image, imageSource]);
_.progressiveLazyLoad();
}
};
imageToLoad.src = imageSource;
} else {
_.$slider.trigger("allImagesLoaded", [_]);
}
};
/**
* @param {boolean} height
* @return {undefined}
*/
Slick.prototype.refresh = function(height) {
var currentSlide;
var firstVisible;
var _ = this;
/** @type {number} */
firstVisible = _.slideCount - _.options.slidesToShow;
if (!_.options.infinite && _.currentSlide > firstVisible) {
/** @type {number} */
_.currentSlide = firstVisible;
}
if (_.slideCount <= _.options.slidesToShow) {
/** @type {number} */
_.currentSlide = 0;
}
currentSlide = _.currentSlide;
_.destroy(true);
$.extend(_, _.initials, {
currentSlide : currentSlide
});
_.init();
if (!height) {
_.changeSlide({
data : {
message : "index",
index : currentSlide
}
}, false);
}
};
/**
* @return {undefined}
*/
Slick.prototype.registerBreakpoints = function() {
var breakpoint;
var currentBreakpoint;
var l;
var _ = this;
var responsiveSettings = _.options.responsive || null;
if ("array" === $.type(responsiveSettings) && responsiveSettings.length) {
_.respondTo = _.options.respondTo || "window";
for (breakpoint in responsiveSettings) {
if (l = _.breakpoints.length - 1, responsiveSettings.hasOwnProperty(breakpoint)) {
currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
for (; l >= 0;) {
if (_.breakpoints[l] && _.breakpoints[l] === currentBreakpoint) {
_.breakpoints.splice(l, 1);
}
l--;
}
_.breakpoints.push(currentBreakpoint);
_.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
}
}
_.breakpoints.sort(function(a, b) {
return _.options.mobileFirst ? a - b : b - a;
});
}
};
/**
* @return {undefined}
*/
Slick.prototype.reinit = function() {
var _ = this;
_.$slides = _.$slideTrack.children(_.options.slide).addClass("slick-slide");
_.slideCount = _.$slides.length;
if (_.currentSlide >= _.slideCount && 0 !== _.currentSlide) {
/** @type {number} */
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
}
if (_.slideCount <= _.options.slidesToShow) {
/** @type {number} */
_.currentSlide = 0;
}
_.registerBreakpoints();
_.setProps();
_.setupInfinite();
_.buildArrows();
_.updateArrows();
_.initArrowEvents();
_.buildDots();
_.updateDots();
_.initDotEvents();
_.cleanUpSlideEvents();
_.initSlideEvents();
_.checkResponsive(false, true);
if (true === _.options.focusOnSelect) {
$(_.$slideTrack).children().on("click.slick", _.selectHandler);
}
_.setSlideClasses("number" == typeof _.currentSlide ? _.currentSlide : 0);
_.setPosition();
_.focusHandler();
/** @type {boolean} */
_.paused = !_.options.autoplay;
_.autoPlay();
_.$slider.trigger("reInit", [_]);
};
/**
* @return {undefined}
*/
Slick.prototype.resize = function() {
var _ = this;
if ($(window).width() !== _.windowWidth) {
clearTimeout(_.windowDelay);
_.windowDelay = window.setTimeout(function() {
_.windowWidth = $(window).width();
_.checkResponsive();
if (!_.unslicked) {
_.setPosition();
}
}, 50);
}
};
/** @type {function(number, (number|string), (number|string)): ?} */
Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(val, index, removeBefore) {
var _ = this;
if (val = "boolean" == typeof val ? true === (index = val) ? 0 : _.slideCount - 1 : true === index ? --val : val, _.slideCount < 1 || val < 0 || val > _.slideCount - 1) {
return false;
}
_.unload();
if (true === removeBefore) {
_.$slideTrack.children().remove();
} else {
_.$slideTrack.children(this.options.slide).eq(val).remove();
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slidesCache = _.$slides;
_.reinit();
};
/**
* @param {number} position
* @return {undefined}
*/
Slick.prototype.setCSS = function(position) {
var e;
var t;
var _ = this;
var positionProps = {};
if (true === _.options.rtl) {
/** @type {number} */
position = -position;
}
/** @type {string} */
e = "left" == _.positionProp ? Math.ceil(position) + "px" : "0px";
/** @type {string} */
t = "top" == _.positionProp ? Math.ceil(position) + "px" : "0px";
/** @type {number} */
positionProps[_.positionProp] = position;
if (false === _.transformsEnabled) {
_.$slideTrack.css(positionProps);
} else {
positionProps = {};
if (false === _.cssTransitions) {
/** @type {string} */
positionProps[_.animType] = "translate(" + e + ", " + t + ")";
_.$slideTrack.css(positionProps);
} else {
/** @type {string} */
positionProps[_.animType] = "translate3d(" + e + ", " + t + ", 0px)";
_.$slideTrack.css(positionProps);
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.setDimensions = function() {
var _ = this;
if (false === _.options.vertical) {
if (true === _.options.centerMode) {
_.$list.css({
padding : "0px " + _.options.centerPadding
});
}
} else {
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
if (true === _.options.centerMode) {
_.$list.css({
padding : _.options.centerPadding + " 0px"
});
}
}
_.listWidth = _.$list.width();
_.listHeight = _.$list.height();
if (false === _.options.vertical && false === _.options.variableWidth) {
/** @type {number} */
_.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
_.$slideTrack.width(Math.ceil(_.slideWidth * _.$slideTrack.children(".slick-slide").length));
} else {
if (true === _.options.variableWidth) {
_.$slideTrack.width(5E3 * _.slideCount);
} else {
/** @type {number} */
_.slideWidth = Math.ceil(_.listWidth);
_.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true) * _.$slideTrack.children(".slick-slide").length));
}
}
/** @type {number} */
var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
if (false === _.options.variableWidth) {
_.$slideTrack.children(".slick-slide").width(_.slideWidth - offset);
}
};
/**
* @return {undefined}
*/
Slick.prototype.setFade = function() {
var stringOrNumberPropType;
var _ = this;
_.$slides.each(function(index, entryEl) {
/** @type {number} */
stringOrNumberPropType = _.slideWidth * index * -1;
if (true === _.options.rtl) {
$(entryEl).css({
position : "relative",
right : stringOrNumberPropType,
top : 0,
zIndex : _.options.zIndex - 2,
opacity : 0
});
} else {
$(entryEl).css({
position : "relative",
left : stringOrNumberPropType,
top : 0,
zIndex : _.options.zIndex - 2,
opacity : 0
});
}
});
_.$slides.eq(_.currentSlide).css({
zIndex : _.options.zIndex - 1,
opacity : 1
});
};
/**
* @return {undefined}
*/
Slick.prototype.setHeight = function() {
var _ = this;
if (1 === _.options.slidesToShow && true === _.options.adaptiveHeight && false === _.options.vertical) {
var meterPos = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.css("height", meterPos);
}
};
/** @type {function(): undefined} */
Slick.prototype.setOption = Slick.prototype.slickSetOption = function() {
var l;
var c;
var i;
var s;
var type;
var _ = this;
/** @type {boolean} */
var bits = false;
if ("object" === $.type(arguments[0]) ? (i = arguments[0], bits = arguments[1], type = "multiple") : "string" === $.type(arguments[0]) && (i = arguments[0], s = arguments[1], bits = arguments[2], "responsive" === arguments[0] && "array" === $.type(arguments[1]) ? type = "responsive" : void 0 !== arguments[1] && (type = "single")), "single" === type) {
_.options[i] = s;
} else {
if ("multiple" === type) {
$.each(i, function(id, envId) {
_.options[id] = envId;
});
} else {
if ("responsive" === type) {
for (c in s) {
if ("array" !== $.type(_.options.responsive)) {
/** @type {!Array} */
_.options.responsive = [s[c]];
} else {
/** @type {number} */
l = _.options.responsive.length - 1;
for (; l >= 0;) {
if (_.options.responsive[l].breakpoint === s[c].breakpoint) {
_.options.responsive.splice(l, 1);
}
l--;
}
_.options.responsive.push(s[c]);
}
}
}
}
}
if (bits) {
_.unload();
_.reinit();
}
};
/**
* @return {undefined}
*/
Slick.prototype.setPosition = function() {
var _ = this;
_.setDimensions();
_.setHeight();
if (false === _.options.fade) {
_.setCSS(_.getLeft(_.currentSlide));
} else {
_.setFade();
}
_.$slider.trigger("setPosition", [_]);
};
/**
* @return {undefined}
*/
Slick.prototype.setProps = function() {
var _ = this;
/** @type {!CSSStyleDeclaration} */
var bodyStyle = document.body.style;
/** @type {string} */
_.positionProp = true === _.options.vertical ? "top" : "left";
if ("top" === _.positionProp) {
_.$slider.addClass("slick-vertical");
} else {
_.$slider.removeClass("slick-vertical");
}
if (!(void 0 === bodyStyle.WebkitTransition && void 0 === bodyStyle.MozTransition && void 0 === bodyStyle.msTransition)) {
if (true === _.options.useCSS) {
/** @type {boolean} */
_.cssTransitions = true;
}
}
if (_.options.fade) {
if ("number" == typeof _.options.zIndex) {
if (_.options.zIndex < 3) {
/** @type {number} */
_.options.zIndex = 3;
}
} else {
_.options.zIndex = _.defaults.zIndex;
}
}
if (void 0 !== bodyStyle.OTransform) {
/** @type {string} */
_.animType = "OTransform";
/** @type {string} */
_.transformType = "-o-transform";
/** @type {string} */
_.transitionType = "OTransition";
if (void 0 === bodyStyle.perspectiveProperty && void 0 === bodyStyle.webkitPerspective) {
/** @type {boolean} */
_.animType = false;
}
}
if (void 0 !== bodyStyle.MozTransform) {
/** @type {string} */
_.animType = "MozTransform";
/** @type {string} */
_.transformType = "-moz-transform";
/** @type {string} */
_.transitionType = "MozTransition";
if (void 0 === bodyStyle.perspectiveProperty && void 0 === bodyStyle.MozPerspective) {
/** @type {boolean} */
_.animType = false;
}
}
if (void 0 !== bodyStyle.webkitTransform) {
/** @type {string} */
_.animType = "webkitTransform";
/** @type {string} */
_.transformType = "-webkit-transform";
/** @type {string} */
_.transitionType = "webkitTransition";
if (void 0 === bodyStyle.perspectiveProperty && void 0 === bodyStyle.webkitPerspective) {
/** @type {boolean} */
_.animType = false;
}
}
if (void 0 !== bodyStyle.msTransform) {
/** @type {string} */
_.animType = "msTransform";
/** @type {string} */
_.transformType = "-ms-transform";
/** @type {string} */
_.transitionType = "msTransition";
if (void 0 === bodyStyle.msTransform) {
/** @type {boolean} */
_.animType = false;
}
}
if (void 0 !== bodyStyle.transform && false !== _.animType) {
/** @type {string} */
_.animType = "transform";
/** @type {string} */
_.transformType = "transform";
/** @type {string} */
_.transitionType = "transition";
}
_.transformsEnabled = _.options.useTransform && null !== _.animType && false !== _.animType;
};
/**
* @param {number} index
* @return {undefined}
*/
Slick.prototype.setSlideClasses = function(index) {
var centerOffset;
var allSlides;
var indexOffset;
var remainder;
var _ = this;
if (allSlides = _.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), _.$slides.eq(index).addClass("slick-current"), true === _.options.centerMode) {
/** @type {number} */
var x1 = _.options.slidesToShow % 2 == 0 ? 1 : 0;
/** @type {number} */
centerOffset = Math.floor(_.options.slidesToShow / 2);
if (true === _.options.infinite) {
if (index >= centerOffset && index <= _.slideCount - 1 - centerOffset) {
_.$slides.slice(index - centerOffset + x1, index + centerOffset + 1).addClass("slick-active").attr("aria-hidden", "false");
} else {
indexOffset = _.options.slidesToShow + index;
allSlides.slice(indexOffset - centerOffset + 1 + x1, indexOffset + centerOffset + 2).addClass("slick-active").attr("aria-hidden", "false");
}
if (0 === index) {
allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass("slick-center");
} else {
if (index === _.slideCount - 1) {
allSlides.eq(_.options.slidesToShow).addClass("slick-center");
}
}
}
_.$slides.eq(index).addClass("slick-center");
} else {
if (index >= 0 && index <= _.slideCount - _.options.slidesToShow) {
_.$slides.slice(index, index + _.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false");
} else {
if (allSlides.length <= _.options.slidesToShow) {
allSlides.addClass("slick-active").attr("aria-hidden", "false");
} else {
/** @type {number} */
remainder = _.slideCount % _.options.slidesToShow;
indexOffset = true === _.options.infinite ? _.options.slidesToShow + index : index;
if (_.options.slidesToShow == _.options.slidesToScroll && _.slideCount - index < _.options.slidesToShow) {
allSlides.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder).addClass("slick-active").attr("aria-hidden", "false");
} else {
allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false");
}
}
}
}
if (!("ondemand" !== _.options.lazyLoad && "anticipated" !== _.options.lazyLoad)) {
_.lazyLoad();
}
};
/**
* @return {undefined}
*/
Slick.prototype.setupInfinite = function() {
var i;
var slideIndex;
var index;
var _ = this;
if (true === _.options.fade && (_.options.centerMode = false), true === _.options.infinite && false === _.options.fade && (slideIndex = null, _.slideCount > _.options.slidesToShow)) {
index = true === _.options.centerMode ? _.options.slidesToShow + 1 : _.options.slidesToShow;
i = _.slideCount;
for (; i > _.slideCount - index; i = i - 1) {
/** @type {number} */
slideIndex = i - 1;
$(_.$slides[slideIndex]).clone(true).attr("id", "").attr("data-slick-index", slideIndex - _.slideCount).prependTo(_.$slideTrack).addClass("slick-cloned");
}
/** @type {number} */
i = 0;
for (; i < index + _.slideCount; i = i + 1) {
/** @type {number} */
slideIndex = i;
$(_.$slides[slideIndex]).clone(true).attr("id", "").attr("data-slick-index", slideIndex + _.slideCount).appendTo(_.$slideTrack).addClass("slick-cloned");
}
_.$slideTrack.find(".slick-cloned").find("[id]").each(function() {
$(this).attr("id", "");
});
}
};
/**
* @param {boolean} toggle
* @return {undefined}
*/
Slick.prototype.interrupt = function(toggle) {
var _ = this;
if (!toggle) {
_.autoPlay();
}
/** @type {boolean} */
_.interrupted = toggle;
};
/**
* @param {!Event} event
* @return {undefined}
*/
Slick.prototype.selectHandler = function(event) {
var asNavFor = this;
var targetElement = $(event.target).is(".slick-slide") ? $(event.target) : $(event.target).parents(".slick-slide");
/** @type {number} */
var index = parseInt(targetElement.attr("data-slick-index"));
if (!index) {
/** @type {number} */
index = 0;
}
if (asNavFor.slideCount <= asNavFor.options.slidesToShow) {
asNavFor.slideHandler(index, false, true);
} else {
asNavFor.slideHandler(index);
}
};
/**
* @param {number} index
* @param {boolean} sync
* @param {boolean} dontAnimate
* @return {?}
*/
Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
var targetSlide;
var animSlide;
var oldSlide;
var slideLeft;
var navTarget;
/** @type {null} */
var targetLeft = null;
var _ = this;
if (sync = sync || false, !(true === _.animating && true === _.options.waitForAnimate || true === _.options.fade && _.currentSlide === index)) {
if (false === sync && _.asNavFor(index), targetSlide = index, targetLeft = _.getLeft(targetSlide), slideLeft = _.getLeft(_.currentSlide), _.currentLeft = null === _.swipeLeft ? slideLeft : _.swipeLeft, false === _.options.infinite && false === _.options.centerMode && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
if (false === _.options.fade) {
targetSlide = _.currentSlide;
if (true !== dontAnimate) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
} else {
if (false === _.options.infinite && true === _.options.centerMode && (index < 0 || index > _.slideCount - _.options.slidesToScroll)) {
if (false === _.options.fade) {
targetSlide = _.currentSlide;
if (true !== dontAnimate) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
} else {
if (_.options.autoplay && clearInterval(_.autoPlayTimer), animSlide = targetSlide < 0 ? _.slideCount % _.options.slidesToScroll != 0 ? _.slideCount - _.slideCount % _.options.slidesToScroll : _.slideCount + targetSlide : targetSlide >= _.slideCount ? _.slideCount % _.options.slidesToScroll != 0 ? 0 : targetSlide - _.slideCount : targetSlide, _.animating = true, _.$slider.trigger("beforeChange", [_, _.currentSlide, animSlide]), oldSlide = _.currentSlide, _.currentSlide = animSlide, _.setSlideClasses(_.currentSlide),
_.options.asNavFor && (navTarget = (navTarget = _.getNavTarget()).slick("getSlick")).slideCount <= navTarget.options.slidesToShow && navTarget.setSlideClasses(_.currentSlide), _.updateDots(), _.updateArrows(), true === _.options.fade) {
return true !== dontAnimate ? (_.fadeSlideOut(oldSlide), _.fadeSlide(animSlide, function() {
_.postSlide(animSlide);
})) : _.postSlide(animSlide), void _.animateHeight();
}
if (true !== dontAnimate) {
_.animateSlide(targetLeft, function() {
_.postSlide(animSlide);
});
} else {
_.postSlide(animSlide);
}
}
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.startLoad = function() {
var _ = this;
if (true === _.options.arrows && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.hide();
_.$nextArrow.hide();
}
if (true === _.options.dots && _.slideCount > _.options.slidesToShow) {
_.$dots.hide();
}
_.$slider.addClass("slick-loading");
};
/**
* @return {?}
*/
Slick.prototype.swipeDirection = function() {
var y;
var i;
var val;
var utcDayCalib;
var _ = this;
return y = _.touchObject.startX - _.touchObject.curX, i = _.touchObject.startY - _.touchObject.curY, val = Math.atan2(i, y), (utcDayCalib = Math.round(180 * val / Math.PI)) < 0 && (utcDayCalib = 360 - Math.abs(utcDayCalib)), utcDayCalib <= 45 && utcDayCalib >= 0 ? false === _.options.rtl ? "left" : "right" : utcDayCalib <= 360 && utcDayCalib >= 315 ? false === _.options.rtl ? "left" : "right" : utcDayCalib >= 135 && utcDayCalib <= 225 ? false === _.options.rtl ? "right" : "left" : true === _.options.verticalSwiping ?
utcDayCalib >= 35 && utcDayCalib <= 135 ? "down" : "up" : "vertical";
};
/**
* @param {!Object} event
* @return {?}
*/
Slick.prototype.swipeEnd = function(event) {
var slideCount;
var lhNavActions;
var _ = this;
if (_.dragging = false, _.swiping = false, _.scrolling) {
return _.scrolling = false, false;
}
if (_.interrupted = false, _.shouldClick = !(_.touchObject.swipeLength > 10), void 0 === _.touchObject.curX) {
return false;
}
if (true === _.touchObject.edgeHit && _.$slider.trigger("edge", [_, _.swipeDirection()]), _.touchObject.swipeLength >= _.touchObject.minSwipe) {
switch(lhNavActions = _.swipeDirection()) {
case "left":
case "down":
slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
/** @type {number} */
_.currentDirection = 0;
break;
case "right":
case "up":
slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
/** @type {number} */
_.currentDirection = 1;
}
if ("vertical" != lhNavActions) {
_.slideHandler(slideCount);
_.touchObject = {};
_.$slider.trigger("swipe", [_, lhNavActions]);
}
} else {
if (_.touchObject.startX !== _.touchObject.curX) {
_.slideHandler(_.currentSlide);
_.touchObject = {};
}
}
};
/**
* @param {!Object} event
* @return {undefined}
*/
Slick.prototype.swipeHandler = function(event) {
var _ = this;
if (!(false === _.options.swipe || "ontouchend" in document && false === _.options.swipe || false === _.options.draggable && -1 !== event.type.indexOf("mouse"))) {
switch(_.touchObject.fingerCount = event.originalEvent && void 0 !== event.originalEvent.touches ? event.originalEvent.touches.length : 1, _.touchObject.minSwipe = _.listWidth / _.options.touchThreshold, true === _.options.verticalSwiping && (_.touchObject.minSwipe = _.listHeight / _.options.touchThreshold), event.data.action) {
case "start":
_.swipeStart(event);
break;
case "move":
_.swipeMove(event);
break;
case "end":
_.swipeEnd(event);
}
}
};
/**
* @param {!Object} event
* @return {?}
*/
Slick.prototype.swipeMove = function(event) {
var curLeft;
var anchorX;
var swipeLength;
var positionOffset;
var undefined;
var verticalSwipeLength;
var _ = this;
return undefined = void 0 !== event.originalEvent ? event.originalEvent.touches : null, !(!_.dragging || _.scrolling || undefined && 1 !== undefined.length) && (curLeft = _.getLeft(_.currentSlide), _.touchObject.curX = void 0 !== undefined ? undefined[0].pageX : event.clientX, _.touchObject.curY = void 0 !== undefined ? undefined[0].pageY : event.clientY, _.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(_.touchObject.curX - _.touchObject.startX, 2))), verticalSwipeLength = Math.round(Math.sqrt(Math.pow(_.touchObject.curY -
_.touchObject.startY, 2))), !_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4 ? (_.scrolling = true, false) : (true === _.options.verticalSwiping && (_.touchObject.swipeLength = verticalSwipeLength), anchorX = _.swipeDirection(), void 0 !== event.originalEvent && _.touchObject.swipeLength > 4 && (_.swiping = true, event.preventDefault()), positionOffset = (false === _.options.rtl ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1), true === _.options.verticalSwiping &&
(positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1), swipeLength = _.touchObject.swipeLength, _.touchObject.edgeHit = false, false === _.options.infinite && (0 === _.currentSlide && "right" === anchorX || _.currentSlide >= _.getDotCount() && "left" === anchorX) && (swipeLength = _.touchObject.swipeLength * _.options.edgeFriction, _.touchObject.edgeHit = true), false === _.options.vertical ? _.swipeLeft = curLeft + swipeLength * positionOffset : _.swipeLeft = curLeft + swipeLength *
(_.$list.height() / _.listWidth) * positionOffset, true === _.options.verticalSwiping && (_.swipeLeft = curLeft + swipeLength * positionOffset), true !== _.options.fade && false !== _.options.touchMove && (true === _.animating ? (_.swipeLeft = null, false) : void _.setCSS(_.swipeLeft))));
};
/**
* @param {!Object} event
* @return {?}
*/
Slick.prototype.swipeStart = function(event) {
var undefined;
var _ = this;
if (_.interrupted = true, 1 !== _.touchObject.fingerCount || _.slideCount <= _.options.slidesToShow) {
return _.touchObject = {}, false;
}
if (void 0 !== event.originalEvent && void 0 !== event.originalEvent.touches) {
undefined = event.originalEvent.touches[0];
}
_.touchObject.startX = _.touchObject.curX = void 0 !== undefined ? undefined.pageX : event.clientX;
_.touchObject.startY = _.touchObject.curY = void 0 !== undefined ? undefined.pageY : event.clientY;
/** @type {boolean} */
_.dragging = true;
};
/** @type {function(): undefined} */
Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
var _ = this;
if (null !== _.$slidesCache) {
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.appendTo(_.$slideTrack);
_.reinit();
}
};
/**
* @return {undefined}
*/
Slick.prototype.unload = function() {
var _ = this;
$(".slick-cloned", _.$slider).remove();
if (_.$dots) {
_.$dots.remove();
}
if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.remove();
}
if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.remove();
}
_.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "");
};
/**
* @param {!Object} fromBreakpoint
* @return {undefined}
*/
Slick.prototype.unslick = function(fromBreakpoint) {
var _ = this;
_.$slider.trigger("unslick", [_, fromBreakpoint]);
_.destroy();
};
/**
* @return {undefined}
*/
Slick.prototype.updateArrows = function() {
var _ = this;
Math.floor(_.options.slidesToShow / 2);
if (true === _.options.arrows && _.slideCount > _.options.slidesToShow && !_.options.infinite) {
_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false");
_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false");
if (0 === _.currentSlide) {
_.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true");
_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false");
} else {
if (_.currentSlide >= _.slideCount - _.options.slidesToShow && false === _.options.centerMode) {
_.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true");
_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false");
} else {
if (_.currentSlide >= _.slideCount - 1 && true === _.options.centerMode) {
_.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true");
_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false");
}
}
}
}
};
/**
* @return {undefined}
*/
Slick.prototype.updateDots = function() {
var _ = this;
if (null !== _.$dots) {
_.$dots.find("li").removeClass("slick-active").end();
_.$dots.find("li").eq(Math.floor(_.currentSlide / _.options.slidesToScroll)).addClass("slick-active");
}
};
/**
* @return {undefined}
*/
Slick.prototype.visibility = function() {
var _ = this;
if (_.options.autoplay) {
if (document[_.hidden]) {
/** @type {boolean} */
_.interrupted = true;
} else {
/** @type {boolean} */
_.interrupted = false;
}
}
};
/**
* @return {?}
*/
$.fn.slick = function() {
var i;
var ret;
var _ = this;
var opt = arguments[0];
/** @type {!Array>} */
var fargs = Array.prototype.slice.call(arguments, 1);
var r = _.length;
/** @type {number} */
i = 0;
for (; i < r; i++) {
if ("object" == typeof opt || void 0 === opt ? _[i].slick = new Slick(_[i], opt) : ret = _[i].slick[opt].apply(_[i].slick, fargs), void 0 !== ret) {
return ret;
}
}
return _;
};
});