PageSourceSearch

https://bettershoppingusa.com/ajax/libs/slick-carousel/1.6.0/slick.js

js bettershoppingusa.com collected 2026-10-09 18:29:31 UTC 84,987 bytes, 2,903 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/*
11     _ _      _       _
12 ___| (_) ___| | __  (_)___
13/ __| | |/ __| |/ /  | / __|
14\__ \ | | (__|   < _ | \__ \
15|___/_|_|\___|_|\_(_)/ |___/
16                   |__/
17
18 Version: 1.6.0
19  Author: Ken Wheeler
20 Website: http://kenwheeler.github.io
21    Docs: http://kenwheeler.github.io/slick
22    Repo: http://github.com/kenwheeler/slick
23  Issues: http://github.com/kenwheeler/slick/issues
24
25 */
26/* global window, document, define, jQuery, setInterval, clearInterval */
27(function(factory) {
28    'use strict';
29    if (typeof define === 'function' && define.amd) {
30        define(['jquery'], factory);
31    } else if (typeof exports !== 'undefined') {
32        module.exports = factory(require('jquery'));
33    } else {
34        factory(jQuery);
35    }
36
37}(function($) {
38    'use strict';
39    var Slick = window.Slick || {};
40
41    Slick = (function() {
42
43        var instanceUid = 0;
44
45        function Slick(element, settings) {
46
47            var _ = this, dataSettings;
48
49            _.defaults = {
50                accessibility: true,
51                adaptiveHeight: false,
52                appendArrows: $(element),
53                appendDots: $(element),
54                arrows: true,
55                asNavFor: null,
56                prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
57                nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',
58                autoplay: false,
59                autoplaySpeed: 3000,
60                centerMode: false,
61                centerPadding: '50px',
62                cssEase: 'ease',
63                customPaging: function(slider, i) {
64                    return $('<button type="button" data-role="none" role="button" tabindex="0" />').text(i + 1);
65                },
66                dots: false,
67                dotsClass: 'slick-dots',
68                draggable: true,
69                easing: 'linear',
70                edgeFriction: 0.35,
71                fade: false,
72                focusOnSelect: false,
73                infinite: true,
74                initialSlide: 0,
75                lazyLoad: 'ondemand',
76                mobileFirst: false,
77                pauseOnHover: true,
78                pauseOnFocus: true,
79                pauseOnDotsHover: false,
80                respondTo: 'window',
81                responsive: null,
82                rows: 1,
83                rtl: false,
84                slide: '',
85                slidesPerRow: 1,
86                slidesToShow: 1,
87                slidesToScroll: 1,
88                speed: 500,
89                swipe: true,
90                swipeToSlide: false,
91                touchMove: true,
92                touchThreshold: 5,
93                useCSS: true,
94                useTransform: true,
95                variableWidth: false,
96                vertical: false,
97                verticalSwiping: false,
98                waitForAnimate: true,
99                zIndex: 1000
100            };
101
102            _.initials = {
103                animating: false,
104                dragging: false,
105                autoPlayTimer: null,
106                currentDirection: 0,
107                currentLeft: null,
108                currentSlide: 0,
109                direction: 1,
110                $dots: null,
111                listWidth: null,
112                listHeight: null,
113                loadIndex: 0,
114                $nextArrow: null,
115                $prevArrow: null,
116                slideCount: null,
117                slideWidth: null,
118                $slideTrack: null,
119                $slides: null,
120                sliding: false,
121                slideOffset: 0,
122                swipeLeft: null
vendor: 11,177 bytes, lines 122-505
122,
123                $list: null,
124                touchObject: {},
125                transformsEnabled: false,
126                unslicked: false
127            };
128
129            $.extend(_, _.initials);
130
131            _.activeBreakpoint = null;
132            _.animType = null;
133            _.animProp = null;
134            _.breakpoints = [];
135            _.breakpointSettings = [];
136            _.cssTransitions = false;
137            _.focussed = false;
138            _.interrupted = false;
139            _.hidden = 'hidden';
140            _.paused = true;
141            _.positionProp = null;
142            _.respondTo = null;
143            _.rowCount = 1;
144            _.shouldClick = true;
145            _.$slider = $(element);
146            _.$slidesCache = null;
147            _.transformType = null;
148            _.transitionType = null;
149            _.visibilityChange = 'visibilitychange';
150            _.windowWidth = 0;
151            _.windowTimer = null;
152
153            dataSettings = $(element).data('slick') || {};
154
155            _.options = $.extend({}, _.defaults, settings, dataSettings);
156
157            _.currentSlide = _.options.initialSlide;
158
159            _.originalSettings = _.options;
160
161            if (typeof document.mozHidden !== 'undefined') {
162                _.hidden = 'mozHidden';
163                _.visibilityChange = 'mozvisibilitychange';
164            } else if (typeof document.webkitHidden !== 'undefined') {
165                _.hidden = 'webkitHidden';
166                _.visibilityChange = 'webkitvisibilitychange';
167            }
168
169            _.autoPlay = $.proxy(_.autoPlay, _);
170            _.autoPlayClear = $.proxy(_.autoPlayClear, _);
171            _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
172            _.changeSlide = $.proxy(_.changeSlide, _);
173            _.clickHandler = $.proxy(_.clickHandler, _);
174            _.selectHandler = $.proxy(_.selectHandler, _);
175            _.setPosition = $.proxy(_.setPosition, _);
176            _.swipeHandler = $.proxy(_.swipeHandler, _);
177            _.dragHandler = $.proxy(_.dragHandler, _);
178            _.keyHandler = $.proxy(_.keyHandler, _);
179
180            _.instanceUid = instanceUid++;
181
182            // A simple way to check for HTML strings
183            // Strict HTML recognition (must start with <)
184            // Extracted from jQuery v1.11 source
185            _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
186
187
188            _.registerBreakpoints();
189            _.init(true);
190
191        }
192
193        return Slick;
194
195    }());
196
197    Slick.prototype.activateADA = function() {
198        var _ = this;
199
200        _.$slideTrack.find('.slick-active').attr({
201            'aria-hidden': 'false'
202        }).find('a, input, button, select').attr({
203            'tabindex': '0'
204        });
205
206    };
207
208    Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
209
210        var _ = this;
211
212        if (typeof(index) === 'boolean') {
213            addBefore = index;
214            index = null;
215        } else if (index < 0 || (index >= _.slideCount)) {
216            return false;
217        }
218
219        _.unload();
220
221        if (typeof(index) === 'number') {
222            if (index === 0 && _.$slides.length === 0) {
223                $(markup).appendTo(_.$slideTrack);
224            } else if (addBefore) {
225                $(markup).insertBefore(_.$slides.eq(index));
226            } else {
227                $(markup).insertAfter(_.$slides.eq(index));
228            }
229        } else {
230            if (addBefore === true) {
231                $(markup).prependTo(_.$slideTrack);
232            } else {
233                $(markup).appendTo(_.$slideTrack);
234            }
235        }
236
237        _.$slides = _.$slideTrack.children(this.options.slide);
238
239        _.$slideTrack.children(this.options.slide).detach();
240
241        _.$slideTrack.append(_.$slides);
242
243        _.$slides.each(function(index, element) {
244            $(element).attr('data-slick-index', index);
245        });
246
247        _.$slidesCache = _.$slides;
248
249        _.reinit();
250
251    };
252
253    Slick.prototype.animateHeight = function() {
254        var _ = this;
255        if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
256            var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
257            _.$list.animate({
258                height: targetHeight
259            }, _.options.speed);
260        }
261    };
262
263    Slick.prototype.animateSlide = function(targetLeft, callback) {
264
265        var animProps = {},
266            _ = this;
267
268        _.animateHeight();
269
270        if (_.options.rtl === true && _.options.vertical === false) {
271            targetLeft = -targetLeft;
272        }
273        if (_.transformsEnabled === false) {
274            if (_.options.vertical === false) {
275                _.$slideTrack.animate({
276                    left: targetLeft
277                }, _.options.speed, _.options.easing, callback);
278            } else {
279                _.$slideTrack.animate({
280                    top: targetLeft
281                }, _.options.speed, _.options.easing, callback);
282            }
283
284        } else {
285
286            if (_.cssTransitions === false) {
287                if (_.options.rtl === true) {
288                    _.currentLeft = -(_.currentLeft);
289                }
290                $({
291                    animStart: _.currentLeft
292                }).animate({
293                    animStart: targetLeft
294                }, {
295                    duration: _.options.speed,
296                    easing: _.options.easing,
297                    step: function(now) {
298                        now = Math.ceil(now);
299                        if (_.options.vertical === false) {
300                            animProps[_.animType] = 'translate(' +
301                                now + 'px, 0px)';
302                            _.$slideTrack.css(animProps);
303                        } else {
304                            animProps[_.animType] = 'translate(0px,' +
305                                now + 'px)';
306                            _.$slideTrack.css(animProps);
307                        }
308                    },
309                    complete: function() {
310                        if (callback) {
311                            callback.call();
312                        }
313                    }
314                });
315
316            } else {
317
318                _.applyTransition();
319                targetLeft = Math.ceil(targetLeft);
320
321                if (_.options.vertical === false) {
322                    animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
323                } else {
324                    animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
325                }
326                _.$slideTrack.css(animProps);
327
328                if (callback) {
329                    setTimeout(function() {
330
331                        _.disableTransition();
332
333                        callback.call();
334                    }, _.options.speed);
335                }
336
337            }
338
339        }
340
341    };
342
343    Slick.prototype.getNavTarget = function() {
344
345        var _ = this,
346            asNavFor = _.options.asNavFor;
347
348        if ( asNavFor && asNavFor !== null ) {
349            asNavFor = $(asNavFor).not(_.$slider);
350        }
351
352        return asNavFor;
353
354    };
355
356    Slick.prototype.asNavFor = function(index) {
357
358        var _ = this,
359            asNavFor = _.getNavTarget();
360
361        if ( asNavFor !== null && typeof asNavFor === 'object' ) {
362            asNavFor.each(function() {
363                var target = $(this).slick('getSlick');
364                if(!target.unslicked) {
365                    target.slideHandler(index, true);
366                }
367            });
368        }
369
370    };
371
372    Slick.prototype.applyTransition = function(slide) {
373
374        var _ = this,
375            transition = {};
376
377        if (_.options.fade === false) {
378            transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
379        } else {
380            transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
381        }
382
383        if (_.options.fade === false) {
384            _.$slideTrack.css(transition);
385        } else {
386            _.$slides.eq(slide).css(transition);
387        }
388
389    };
390
391    Slick.prototype.autoPlay = function() {
392
393        var _ = this;
394
395        _.autoPlayClear();
396
397        if ( _.slideCount > _.options.slidesToShow ) {
398            _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
399        }
400
401    };
402
403    Slick.prototype.autoPlayClear = function() {
404
405        var _ = this;
406
407        if (_.autoPlayTimer) {
408            clearInterval(_.autoPlayTimer);
409        }
410
411    };
412
413    Slick.prototype.autoPlayIterator = function() {
414
415        var _ = this,
416            slideTo = _.currentSlide + _.options.slidesToScroll;
417
418        if ( !_.paused && !_.interrupted && !_.focussed ) {
419
420            if ( _.options.infinite === false ) {
421
422                if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
423                    _.direction = 0;
424                }
425
426                else if ( _.direction === 0 ) {
427
428                    slideTo = _.currentSlide - _.options.slidesToScroll;
429
430                    if ( _.currentSlide - 1 === 0 ) {
431                        _.direction = 1;
432                    }
433
434                }
435
436            }
437
438            _.slideHandler( slideTo );
439
440        }
441
442    };
443
444    Slick.prototype.buildArrows = function() {
445
446        var _ = this;
447
448        if (_.options.arrows === true ) {
449
450            _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
451            _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
452
453            if( _.slideCount > _.options.slidesToShow ) {
454
455                _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
456                _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
457
458                if (_.htmlExpr.test(_.options.prevArrow)) {
459                    _.$prevArrow.prependTo(_.options.appendArrows);
460                }
461
462                if (_.htmlExpr.test(_.options.nextArrow)) {
463                    _.$nextArrow.appendTo(_.options.appendArrows);
464                }
465
466                if (_.options.infinite !== true) {
467                    _.$prevArrow
468                        .addClass('slick-disabled')
469                        .attr('aria-disabled', 'true');
470                }
471
472            } else {
473
474                _.$prevArrow.add( _.$nextArrow )
475
476                    .addClass('slick-hidden')
477                    .attr({
478                        'aria-disabled': 'true',
479                        'tabindex': '-1'
480                    });
481
482            }
483
484        }
485
486    };
487
488    Slick.prototype.buildDots = function() {
489
490        var _ = this,
491            i, dot;
492
493        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
494
495            _.$slider.addClass('slick-dotted');
496
497            dot = $('<ul />').addClass(_.options.dotsClass);
498
499            for (i = 0; i <= _.getDotCount(); i += 1) {
500                dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
501            }
502
503            _.$dots = dot.appendTo(_.options.appendDots);
504
505            _.$dots.find('li').first().addClass('slick-active')
vendor: 18,779 bytes, lines 505-1114
505.attr('aria-hidden', 'false');
506
507        }
508
509    };
510
511    Slick.prototype.buildOut = function() {
512
513        var _ = this;
514
515        _.$slides =
516            _.$slider
517                .children( _.options.slide + ':not(.slick-cloned)')
518                .addClass('slick-slide');
519
520        _.slideCount = _.$slides.length;
521
522        _.$slides.each(function(index, element) {
523            $(element)
524                .attr('data-slick-index', index)
525                .data('originalStyling', $(element).attr('style') || '');
526        });
527
528        _.$slider.addClass('slick-slider');
529
530        _.$slideTrack = (_.slideCount === 0) ?
531            $('<div class="slick-track"/>').appendTo(_.$slider) :
532            _.$slides.wrapAll('<div class="slick-track"/>').parent();
533
534        _.$list = _.$slideTrack.wrap(
535            '<div aria-live="polite" class="slick-list"/>').parent();
536        _.$slideTrack.css('opacity', 0);
537
538        if (_.options.centerMode === true || _.options.swipeToSlide === true) {
539            _.options.slidesToScroll = 1;
540        }
541
542        $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
543
544        _.setupInfinite();
545
546        _.buildArrows();
547
548        _.buildDots();
549
550        _.updateDots();
551
552
553        _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
554
555        if (_.options.draggable === true) {
556            _.$list.addClass('draggable');
557        }
558
559    };
560
561    Slick.prototype.buildRows = function() {
562
563        var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
564
565        newSlides = document.createDocumentFragment();
566        originalSlides = _.$slider.children();
567
568        if(_.options.rows > 1) {
569
570            slidesPerSection = _.options.slidesPerRow * _.options.rows;
571            numOfSlides = Math.ceil(
572                originalSlides.length / slidesPerSection
573            );
574
575            for(a = 0; a < numOfSlides; a++){
576                var slide = document.createElement('div');
577                for(b = 0; b < _.options.rows; b++) {
578                    var row = document.createElement('div');
579                    for(c = 0; c < _.options.slidesPerRow; c++) {
580                        var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
581                        if (originalSlides.get(target)) {
582                            row.appendChild(originalSlides.get(target));
583                        }
584                    }
585                    slide.appendChild(row);
586                }
587                newSlides.appendChild(slide);
588            }
589
590            _.$slider.empty().append(newSlides);
591            _.$slider.children().children().children()
592                .css({
593                    'width':(100 / _.options.slidesPerRow) + '%',
594                    'display': 'inline-block'
595                });
596
597        }
598
599    };
600
601    Slick.prototype.checkResponsive = function(initial, forceUpdate) {
602
603        var _ = this,
604            breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
605        var sliderWidth = _.$slider.width();
606        var windowWidth = window.innerWidth || $(window).width();
607
608        if (_.respondTo === 'window') {
609            respondToWidth = windowWidth;
610        } else if (_.respondTo === 'slider') {
611            respondToWidth = sliderWidth;
612        } else if (_.respondTo === 'min') {
613            respondToWidth = Math.min(windowWidth, sliderWidth);
614        }
615
616        if ( _.options.responsive &&
617            _.options.responsive.length &&
618            _.options.responsive !== null) {
619
620            targetBreakpoint = null;
621
622            for (breakpoint in _.breakpoints) {
623                if (_.breakpoints.hasOwnProperty(breakpoint)) {
624                    if (_.originalSettings.mobileFirst === false) {
625                        if (respondToWidth < _.breakpoints[breakpoint]) {
626                            targetBreakpoint = _.breakpoints[breakpoint];
627                        }
628                    } else {
629                        if (respondToWidth > _.breakpoints[breakpoint]) {
630                            targetBreakpoint = _.breakpoints[breakpoint];
631                        }
632                    }
633                }
634            }
635
636            if (targetBreakpoint !== null) {
637                if (_.activeBreakpoint !== null) {
638                    if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
639                        _.activeBreakpoint =
640                            targetBreakpoint;
641                        if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
642                            _.unslick(targetBreakpoint);
643                        } else {
644                            _.options = $.extend({}, _.originalSettings,
645                                _.breakpointSettings[
646                                    targetBreakpoint]);
647                            if (initial === true) {
648                                _.currentSlide = _.options.initialSlide;
649                            }
650                            _.refresh(initial);
651                        }
652                        triggerBreakpoint = targetBreakpoint;
653                    }
654                } else {
655                    _.activeBreakpoint = targetBreakpoint;
656                    if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
657                        _.unslick(targetBreakpoint);
658                    } else {
659                        _.options = $.extend({}, _.originalSettings,
660                            _.breakpointSettings[
661                                targetBreakpoint]);
662                        if (initial === true) {
663                            _.currentSlide = _.options.initialSlide;
664                        }
665                        _.refresh(initial);
666                    }
667                    triggerBreakpoint = targetBreakpoint;
668                }
669            } else {
670                if (_.activeBreakpoint !== null) {
671                    _.activeBreakpoint = null;
672                    _.options = _.originalSettings;
673                    if (initial === true) {
674                        _.currentSlide = _.options.initialSlide;
675                    }
676                    _.refresh(initial);
677                    triggerBreakpoint = targetBreakpoint;
678                }
679            }
680
681            // only trigger breakpoints during an actual break. not on initialize.
682            if( !initial && triggerBreakpoint !== false ) {
683                _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
684            }
685        }
686
687    };
688
689    Slick.prototype.changeSlide = function(event, dontAnimate) {
690
691        var _ = this,
692            $target = $(event.currentTarget),
693            indexOffset, slideOffset, unevenOffset;
694
695        // If target is a link, prevent default action.
696        if($target.is('a')) {
697            event.preventDefault();
698        }
699
700        // If target is not the <li> element (ie: a child), find the <li>.
701        if(!$target.is('li')) {
702            $target = $target.closest('li');
703        }
704
705        unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
706        indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
707
708        switch (event.data.message) {
709
710            case 'previous':
711                slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
712                if (_.slideCount > _.options.slidesToShow) {
713                    _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
714                }
715                break;
716
717            case 'next':
718                slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
719                if (_.slideCount > _.options.slidesToShow) {
720                    _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
721                }
722                break;
723
724            case 'index':
725                var index = event.data.index === 0 ? 0 :
726                    event.data.index || $target.index() * _.options.slidesToScroll;
727
728                _.slideHandler(_.checkNavigable(index), false, dontAnimate);
729                $target.children().trigger('focus');
730                break;
731
732            default:
733                return;
734        }
735
736    };
737
738    Slick.prototype.checkNavigable = function(index) {
739
740        var _ = this,
741            navigables, prevNavigable;
742
743        navigables = _.getNavigableIndexes();
744        prevNavigable = 0;
745        if (index > navigables[navigables.length - 1]) {
746            index = navigables[navigables.length - 1];
747        } else {
748            for (var n in navigables) {
749                if (index < navigables[n]) {
750                    index = prevNavigable;
751                    break;
752                }
753                prevNavigable = navigables[n];
754            }
755        }
756
757        return index;
758    };
759
760    Slick.prototype.cleanUpEvents = function() {
761
762        var _ = this;
763
764        if (_.options.dots && _.$dots !== null) {
765
766            $('li', _.$dots)
767                .off('click.slick', _.changeSlide)
768                .off('mouseenter.slick', $.proxy(_.interrupt, _, true))
769                .off('mouseleave.slick', $.proxy(_.interrupt, _, false));
770
771        }
772
773        _.$slider.off('focus.slick blur.slick');
774
775        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
776            _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
777            _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
778        }
779
780        _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
781        _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
782        _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
783        _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
784
785        _.$list.off('click.slick', _.clickHandler);
786
787        $(document).off(_.visibilityChange, _.visibility);
788
789        _.cleanUpSlideEvents();
790
791        if (_.options.accessibility === true) {
792            _.$list.off('keydown.slick', _.keyHandler);
793        }
794
795        if (_.options.focusOnSelect === true) {
796            $(_.$slideTrack).children().off('click.slick', _.selectHandler);
797        }
798
799        $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
800
801        $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
802
803        $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
804
805        $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
806        $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
807
808    };
809
810    Slick.prototype.cleanUpSlideEvents = function() {
811
812        var _ = this;
813
814        _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
815        _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
816
817    };
818
819    Slick.prototype.cleanUpRows = function() {
820
821        var _ = this, originalSlides;
822
823        if(_.options.rows > 1) {
824            originalSlides = _.$slides.children().children();
825            originalSlides.removeAttr('style');
826            _.$slider.empty().append(originalSlides);
827        }
828
829    };
830
831    Slick.prototype.clickHandler = function(event) {
832
833        var _ = this;
834
835        if (_.shouldClick === false) {
836            event.stopImmediatePropagation();
837            event.stopPropagation();
838            event.preventDefault();
839        }
840
841    };
842
843    Slick.prototype.destroy = function(refresh) {
844
845        var _ = this;
846
847        _.autoPlayClear();
848
849        _.touchObject = {};
850
851        _.cleanUpEvents();
852
853        $('.slick-cloned', _.$slider).detach();
854
855        if (_.$dots) {
856            _.$dots.remove();
857        }
858
859
860        if ( _.$prevArrow && _.$prevArrow.length ) {
861
862            _.$prevArrow
863                .removeClass('slick-disabled slick-arrow slick-hidden')
864                .removeAttr('aria-hidden aria-disabled tabindex')
865                .css('display','');
866
867            if ( _.htmlExpr.test( _.options.prevArrow )) {
868                _.$prevArrow.remove();
869            }
870        }
871
872        if ( _.$nextArrow && _.$nextArrow.length ) {
873
874            _.$nextArrow
875                .removeClass('slick-disabled slick-arrow slick-hidden')
876                .removeAttr('aria-hidden aria-disabled tabindex')
877                .css('display','');
878
879            if ( _.htmlExpr.test( _.options.nextArrow )) {
880                _.$nextArrow.remove();
881            }
882
883        }
884
885
886        if (_.$slides) {
887
888            _.$slides
889                .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
890                .removeAttr('aria-hidden')
891                .removeAttr('data-slick-index')
892                .each(function(){
893                    $(this).attr('style', $(this).data('originalStyling'));
894                });
895
896            _.$slideTrack.children(this.options.slide).detach();
897
898            _.$slideTrack.detach();
899
900            _.$list.detach();
901
902            _.$slider.append(_.$slides);
903        }
904
905        _.cleanUpRows();
906
907        _.$slider.removeClass('slick-slider');
908        _.$slider.removeClass('slick-initialized');
909        _.$slider.removeClass('slick-dotted');
910
911        _.unslicked = true;
912
913        if(!refresh) {
914            _.$slider.trigger('destroy', [_]);
915        }
916
917    };
918
919    Slick.prototype.disableTransition = function(slide) {
920
921        var _ = this,
922            transition = {};
923
924        transition[_.transitionType] = '';
925
926        if (_.options.fade === false) {
927            _.$slideTrack.css(transition);
928        } else {
929            _.$slides.eq(slide).css(transition);
930        }
931
932    };
933
934    Slick.prototype.fadeSlide = function(slideIndex, callback) {
935
936        var _ = this;
937
938        if (_.cssTransitions === false) {
939
940            _.$slides.eq(slideIndex).css({
941                zIndex: _.options.zIndex
942            });
943
944            _.$slides.eq(slideIndex).animate({
945                opacity: 1
946            }, _.options.speed, _.options.easing, callback);
947
948        } else {
949
950            _.applyTransition(slideIndex);
951
952            _.$slides.eq(slideIndex).css({
953                opacity: 1,
954                zIndex: _.options.zIndex
955            });
956
957            if (callback) {
958                setTimeout(function() {
959
960                    _.disableTransition(slideIndex);
961
962                    callback.call();
963                }, _.options.speed);
964            }
965
966        }
967
968    };
969
970    Slick.prototype.fadeSlideOut = function(slideIndex) {
971
972        var _ = this;
973
974        if (_.cssTransitions === false) {
975
976            _.$slides.eq(slideIndex).animate({
977                opacity: 0,
978                zIndex: _.options.zIndex - 2
979            }, _.options.speed, _.options.easing);
980
981        } else {
982
983            _.applyTransition(slideIndex);
984
985            _.$slides.eq(slideIndex).css({
986                opacity: 0,
987                zIndex: _.options.zIndex - 2
988            });
989
990        }
991
992    };
993
994    Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
995
996        var _ = this;
997
998        if (filter !== null) {
999
1000            _.$slidesCache = _.$slides;
1001
1002            _.unload();
1003
1004            _.$slideTrack.children(this.options.slide).detach();
1005
1006            _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
1007
1008            _.reinit();
1009
1010        }
1011
1012    };
1013
1014    Slick.prototype.focusHandler = function() {
1015
1016        var _ = this;
1017
1018        _.$slider
1019            .off('focus.slick blur.slick')
1020            .on('focus.slick blur.slick',
1021                '*:not(.slick-arrow)', function(event) {
1022
1023            event.stopImmediatePropagation();
1024            var $sf = $(this);
1025
1026            setTimeout(function() {
1027
1028                if( _.options.pauseOnFocus ) {
1029                    _.focussed = $sf.is(':focus');
1030                    _.autoPlay();
1031                }
1032
1033            }, 0);
1034
1035        });
1036    };
1037
1038    Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
1039
1040        var _ = this;
1041        return _.currentSlide;
1042
1043    };
1044
1045    Slick.prototype.getDotCount = function() {
1046
1047        var _ = this;
1048
1049        var breakPoint = 0;
1050        var counter = 0;
1051        var pagerQty = 0;
1052
1053        if (_.options.infinite === true) {
1054            while (breakPoint < _.slideCount) {
1055                ++pagerQty;
1056                breakPoint = counter + _.options.slidesToScroll;
1057                counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1058            }
1059        } else if (_.options.centerMode === true) {
1060            pagerQty = _.slideCount;
1061        } else if(!_.options.asNavFor) {
1062            pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
1063        }else {
1064            while (breakPoint < _.slideCount) {
1065                ++pagerQty;
1066                breakPoint = counter + _.options.slidesToScroll;
1067                counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1068            }
1069        }
1070
1071        return pagerQty - 1;
1072
1073    };
1074
1075    Slick.prototype.getLeft = function(slideIndex) {
1076
1077        var _ = this,
1078            targetLeft,
1079            verticalHeight,
1080            verticalOffset = 0,
1081            targetSlide;
1082
1083        _.slideOffset = 0;
1084        verticalHeight = _.$slides.first().outerHeight(true);
1085
1086        if (_.options.infinite === true) {
1087            if (_.slideCount > _.options.slidesToShow) {
1088                _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
1089                verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
1090            }
1091            if (_.slideCount % _.options.slidesToScroll !== 0) {
1092                if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
1093                    if (slideIndex > _.slideCount) {
1094                        _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
1095                        verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
1096                    } else {
1097                        _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
1098                        verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
1099                    }
1100                }
1101            }
1102        } else {
1103            if (slideIndex + _.options.slidesToShow > _.slideCount) {
1104                _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
1105                verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
1106            }
1107        }
1108
1109        if (_.slideCount <= _.options.slidesToShow) {
1110            _.slideOffset = 0;
1111            verticalOffset = 0;
1112        }
1113
1114       
vendor: 5,167 bytes, lines 1114-1287
1114 if (_.options.centerMode === true && _.options.infinite === true) {
1115            _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1116        } else if (_.options.centerMode === true) {
1117            _.slideOffset = 0;
1118            _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1119        }
1120
1121        if (_.options.vertical === false) {
1122            targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
1123        } else {
1124            targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
1125        }
1126
1127        if (_.options.variableWidth === true) {
1128
1129            if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1130                targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1131            } else {
1132                targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
1133            }
1134
1135            if (_.options.rtl === true) {
1136                if (targetSlide[0]) {
1137                    targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1138                } else {
1139                    targetLeft =  0;
1140                }
1141            } else {
1142                targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1143            }
1144
1145            if (_.options.centerMode === true) {
1146                if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1147                    targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1148                } else {
1149                    targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
1150                }
1151
1152                if (_.options.rtl === true) {
1153                    if (targetSlide[0]) {
1154                        targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1155                    } else {
1156                        targetLeft =  0;
1157                    }
1158                } else {
1159                    targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1160                }
1161
1162                targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1163            }
1164        }
1165
1166        return targetLeft;
1167
1168    };
1169
1170    Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
1171
1172        var _ = this;
1173
1174        return _.options[option];
1175
1176    };
1177
1178    Slick.prototype.getNavigableIndexes = function() {
1179
1180        var _ = this,
1181            breakPoint = 0,
1182            counter = 0,
1183            indexes = [],
1184            max;
1185
1186        if (_.options.infinite === false) {
1187            max = _.slideCount;
1188        } else {
1189            breakPoint = _.options.slidesToScroll * -1;
1190            counter = _.options.slidesToScroll * -1;
1191            max = _.slideCount * 2;
1192        }
1193
1194        while (breakPoint < max) {
1195            indexes.push(breakPoint);
1196            breakPoint = counter + _.options.slidesToScroll;
1197            counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1198        }
1199
1200        return indexes;
1201
1202    };
1203
1204    Slick.prototype.getSlick = function() {
1205
1206        return this;
1207
1208    };
1209
1210    Slick.prototype.getSlideCount = function() {
1211
1212        var _ = this,
1213            slidesTraversed, swipedSlide, centerOffset;
1214
1215        centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1216
1217        if (_.options.swipeToSlide === true) {
1218            _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1219                if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1220                    swipedSlide = slide;
1221                    return false;
1222                }
1223            });
1224
1225            slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
1226
1227            return slidesTraversed;
1228
1229        } else {
1230            return _.options.slidesToScroll;
1231        }
1232
1233    };
1234
1235    Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
1236
1237        var _ = this;
1238
1239        _.changeSlide({
1240            data: {
1241                message: 'index',
1242                index: parseInt(slide)
1243            }
1244        }, dontAnimate);
1245
1246    };
1247
1248    Slick.prototype.init = function(creation) {
1249
1250        var _ = this;
1251
1252        if (!$(_.$slider).hasClass('slick-initialized')) {
1253
1254            $(_.$slider).addClass('slick-initialized');
1255
1256            _.buildRows();
1257            _.buildOut();
1258            _.setProps();
1259            _.startLoad();
1260            _.loadSlider();
1261            _.initializeEvents();
1262            _.updateArrows();
1263            _.updateDots();
1264            _.checkResponsive(true);
1265            _.focusHandler();
1266
1267        }
1268
1269        if (creation) {
1270            _.$slider.trigger('init', [_]);
1271        }
1272
1273        if (_.options.accessibility === true) {
1274            _.initADA();
1275        }
1276
1277        if ( _.options.autoplay ) {
1278
1279            _.paused = false;
1280            _.autoPlay();
1281
1282        }
1283
1284    };
1285
1286    Slick.prototype.initADA = function() {
1287        var _ = this
1287;
1288        _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
1289            'aria-hidden': 'true',
1290            'tabindex': '-1'
1291        }).find('a, input, button, select').attr({
1292            'tabindex': '-1'
1293        });
1294
1295        _.$slideTrack.attr('role', 'listbox');
1296
1297        _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
1298            $(this).attr({
1299                'role': 'option',
1300                'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
1301            });
1302        });
1303
1304        if (_.$dots !== null) {
1305            _.$dots.attr('role', 'tablist').find('li').each(function(i) {
1306                $(this).attr({
1307                    'role': 'presentation',
1308                    'aria-selected': 'false',
1309                    'aria-controls': 'navigation' + _.instanceUid + i + '',
1310                    'id': 'slick-slide' + _.instanceUid + i + ''
1311                });
1312            })
1313                .first().attr('aria-selected', 'true').end()
1314                .find('button').attr('role', 'button').end()
1315                .closest('div').attr('role', 'toolbar');
1316        }
1317        _.activateADA();
1318
1319    };
1320
1321    Slick.prototype.initArrowEvents = function() {
1322
1323        var _ = this;
1324
1325        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1326            _.$prevArrow
1327               .off('click.slick')
1328               .on('click.slick', {
1329                    message: 'previous'
1330               }, _.changeSlide);
1331            _.$nextArrow
1332               .off('click.slick')
1333               .on('click.slick', {
1334                    message: 'next'
1335               }, _.changeSlide);
1336        }
1337
1338    };
1339
1340    Slick.prototype.initDotEvents = function() {
1341
1342        var _ = this;
1343
1344        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1345            $('li', _.$dots).on('click.slick', {
1346                message: 'index'
1347            }, _.changeSlide);
1348        }
1349
1350        if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
1351
1352            $('li', _.$dots)
1353                .on('mouseenter.slick', $.proxy(_.interrupt, _, true))
1354                .on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1355
1356        }
1357
1358    };
1359
1360    Slick.prototype.initSlideEvents = function() {
1361
1362        var _ = this;
1363
1364        if ( _.options.pauseOnHover ) {
1365
1366            _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
1367            _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1368
1369        }
1370
1371    };
1372
1373    Slick.prototype.initializeEvents = function() {
1374
1375        var _ = this;
1376
1377        _.initArrowEvents();
1378
1379        _.initDotEvents();
1380        _.initSlideEvents();
1381
1382        _.$list.on('touchstart.slick mousedown.slick', {
1383            action: 'start'
1384        }, _.swipeHandler);
1385        _.$list.on('touchmove.slick mousemove.slick', {
1386            action: 'move'
1387        }, _.swipeHandler);
1388        _.$list.on('touchend.slick mouseup.slick', {
1389            action: 'end'
1390        }, _.swipeHandler);
vendor: 10,240 bytes, lines 1391-1768
1391        _.$list.on('touchcancel.slick mouseleave.slick', {
1392            action: 'end'
1393        }, _.swipeHandler);
1394
1395        _.$list.on('click.slick', _.clickHandler);
1396
1397        $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1398
1399        if (_.options.accessibility === true) {
1400            _.$list.on('keydown.slick', _.keyHandler);
1401        }
1402
1403        if (_.options.focusOnSelect === true) {
1404            $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1405        }
1406
1407        $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1408
1409        $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1410
1411        $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1412
1413        $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1414        $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
1415
1416    };
1417
1418    Slick.prototype.initUI = function() {
1419
1420        var _ = this;
1421
1422        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1423
1424            _.$prevArrow.show();
1425            _.$nextArrow.show();
1426
1427        }
1428
1429        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1430
1431            _.$dots.show();
1432
1433        }
1434
1435    };
1436
1437    Slick.prototype.keyHandler = function(event) {
1438
1439        var _ = this;
1440         //Dont slide if the cursor is inside the form fields and arrow keys are pressed
1441        if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
1442            if (event.keyCode === 37 && _.options.accessibility === true) {
1443                _.changeSlide({
1444                    data: {
1445                        message: _.options.rtl === true ? 'next' :  'previous'
1446                    }
1447                });
1448            } else if (event.keyCode === 39 && _.options.accessibility === true) {
1449                _.changeSlide({
1450                    data: {
1451                        message: _.options.rtl === true ? 'previous' : 'next'
1452                    }
1453                });
1454            }
1455        }
1456
1457    };
1458
1459    Slick.prototype.lazyLoad = function() {
1460
1461        var _ = this,
1462            loadRange, cloneRange, rangeStart, rangeEnd;
1463
1464        function loadImages(imagesScope) {
1465
1466            $('img[data-lazy]', imagesScope).each(function() {
1467
1468                var image = $(this),
1469                    imageSource = $(this).attr('data-lazy'),
1470                    imageToLoad = document.createElement('img');
1471
1472                imageToLoad.onload = function() {
1473
1474                    image
1475                        .animate({ opacity: 0 }, 100, function() {
1476                            image
1477                                .attr('src', imageSource)
1478                                .animate({ opacity: 1 }, 200, function() {
1479                                    image
1480                                        .removeAttr('data-lazy')
1481                                        .removeClass('slick-loading');
1482                                });
1483                            _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
1484                        });
1485
1486                };
1487
1488                imageToLoad.onerror = function() {
1489
1490                    image
1491                        .removeAttr( 'data-lazy' )
1492                        .removeClass( 'slick-loading' )
1493                        .addClass( 'slick-lazyload-error' );
1494
1495                    _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1496
1497                };
1498
1499                imageToLoad.src = imageSource;
1500
1501            });
1502
1503        }
1504
1505        if (_.options.centerMode === true) {
1506            if (_.options.infinite === true) {
1507                rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
1508                rangeEnd = rangeStart + _.options.slidesToShow + 2;
1509            } else {
1510                rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
1511                rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
1512            }
1513        } else {
1514            rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1515            rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
1516            if (_.options.fade === true) {
1517                if (rangeStart > 0) rangeStart--;
1518                if (rangeEnd <= _.slideCount) rangeEnd++;
1519            }
1520        }
1521
1522        loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1523        loadImages(loadRange);
1524
1525        if (_.slideCount <= _.options.slidesToShow) {
1526            cloneRange = _.$slider.find('.slick-slide');
1527            loadImages(cloneRange);
1528        } else
1529        if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1530            cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1531            loadImages(cloneRange);
1532        } else if (_.currentSlide === 0) {
1533            cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1534            loadImages(cloneRange);
1535        }
1536
1537    };
1538
1539    Slick.prototype.loadSlider = function() {
1540
1541        var _ = this;
1542
1543        _.setPosition();
1544
1545        _.$slideTrack.css({
1546            opacity: 1
1547        });
1548
1549        _.$slider.removeClass('slick-loading');
1550
1551        _.initUI();
1552
1553        if (_.options.lazyLoad === 'progressive') {
1554            _.progressiveLazyLoad();
1555        }
1556
1557    };
1558
1559    Slick.prototype.next = Slick.prototype.slickNext = function() {
1560
1561        var _ = this;
1562
1563        _.changeSlide({
1564            data: {
1565                message: 'next'
1566            }
1567        });
1568
1569    };
1570
1571    Slick.prototype.orientationChange = function() {
1572
1573        var _ = this;
1574
1575        _.checkResponsive();
1576        _.setPosition();
1577
1578    };
1579
1580    Slick.prototype.pause = Slick.prototype.slickPause = function() {
1581
1582        var _ = this;
1583
1584        _.autoPlayClear();
1585        _.paused = true;
1586
1587    };
1588
1589    Slick.prototype.play = Slick.prototype.slickPlay = function() {
1590
1591        var _ = this;
1592
1593        _.autoPlay();
1594        _.options.autoplay = true;
1595        _.paused = false;
1596        _.focussed = false;
1597        _.interrupted = false;
1598
1599    };
1600
1601    Slick.prototype.postSlide = function(index) {
1602
1603        var _ = this;
1604
1605        if( !_.unslicked ) {
1606
1607            _.$slider.trigger('afterChange', [_, index]);
1608
1609            _.animating = false;
1610
1611            _.setPosition();
1612
1613            _.swipeLeft = null;
1614
1615            if ( _.options.autoplay ) {
1616                _.autoPlay();
1617            }
1618
1619            if (_.options.accessibility === true) {
1620                _.initADA();
1621            }
1622
1623        }
1624
1625    };
1626
1627    Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1628
1629        var _ = this;
1630
1631        _.changeSlide({
1632            data: {
1633                message: 'previous'
1634            }
1635        });
1636
1637    };
1638
1639    Slick.prototype.preventDefault = function(event) {
1640
1641        event.preventDefault();
1642
1643    };
1644
1645    Slick.prototype.progressiveLazyLoad = function( tryCount ) {
1646
1647        tryCount = tryCount || 1;
1648
1649        var _ = this,
1650            $imgsToLoad = $( 'img[data-lazy]', _.$slider ),
1651            image,
1652            imageSource,
1653            imageToLoad;
1654
1655        if ( $imgsToLoad.length ) {
1656
1657            image = $imgsToLoad.first();
1658            imageSource = image.attr('data-lazy');
1659            imageToLoad = document.createElement('img');
1660
1661            imageToLoad.onload = function() {
1662
1663                image
1664                    .attr( 'src', imageSource )
1665                    .removeAttr('data-lazy')
1666                    .removeClass('slick-loading');
1667
1668                if ( _.options.adaptiveHeight === true ) {
1669                    _.setPosition();
1670                }
1671
1672                _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
1673                _.progressiveLazyLoad();
1674
1675            };
1676
1677            imageToLoad.onerror = function() {
1678
1679                if ( tryCount < 3 ) {
1680
1681                    /**
1682                     * try to load the image 3 times,
1683                     * leave a slight delay so we don't get
1684                     * servers blocking the request.
1685                     */
1686                    setTimeout( function() {
1687                        _.progressiveLazyLoad( tryCount + 1 );
1688                    }, 500 );
1689
1690                } else {
1691
1692                    image
1693                        .removeAttr( 'data-lazy' )
1694                        .removeClass( 'slick-loading' )
1695                        .addClass( 'slick-lazyload-error' );
1696
1697                    _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1698
1699                    _.progressiveLazyLoad();
1700
1701                }
1702
1703            };
1704
1705            imageToLoad.src = imageSource;
1706
1707        } else {
1708
1709            _.$slider.trigger('allImagesLoaded', [ _ ]);
1710
1711        }
1712
1713    };
1714
1715    Slick.prototype.refresh = function( initializing ) {
1716
1717        var _ = this, currentSlide, lastVisibleIndex;
1718
1719        lastVisibleIndex = _.slideCount - _.options.slidesToShow;
1720
1721        // in non-infinite sliders, we don't want to go past the
1722        // last visible index.
1723        if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
1724            _.currentSlide = lastVisibleIndex;
1725        }
1726
1727        // if less slides than to show, go to start.
1728        if ( _.slideCount <= _.options.slidesToShow ) {
1729            _.currentSlide = 0;
1730
1731        }
1732
1733        currentSlide = _.currentSlide;
1734
1735        _.destroy(true);
1736
1737        $.extend(_, _.initials, { currentSlide: currentSlide });
1738
1739        _.init();
1740
1741        if( !initializing ) {
1742
1743            _.changeSlide({
1744                data: {
1745                    message: 'index',
1746                    index: currentSlide
1747                }
1748            }, false);
1749
1750        }
1751
1752    };
1753
1754    Slick.prototype.registerBreakpoints = function() {
1755
1756        var _ = this, breakpoint, currentBreakpoint, l,
1757            responsiveSettings = _.options.responsive || null;
1758
1759        if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
1760
1761            _.respondTo = _.options.respondTo || 'window';
1762
1763            for ( breakpoint in responsiveSettings ) {
1764
1765                l = _.breakpoints.length-1;
1766                currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
1767
1768                if (responsiveSettings.hasOwnProperty(breakpoint)) {
vendor: 12,466 bytes, lines 1768-2201
1768
1769
1770                    // loop through the breakpoints and cut out any existing
1771                    // ones with the same breakpoint number, we don't want dupes.
1772                    while( l >= 0 ) {
1773                        if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
1774                            _.breakpoints.splice(l,1);
1775                        }
1776                        l--;
1777                    }
1778
1779                    _.breakpoints.push(currentBreakpoint);
1780                    _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
1781
1782                }
1783
1784            }
1785
1786            _.breakpoints.sort(function(a, b) {
1787                return ( _.options.mobileFirst ) ? a-b : b-a;
1788            });
1789
1790        }
1791
1792    };
1793
1794    Slick.prototype.reinit = function() {
1795
1796        var _ = this;
1797
1798        _.$slides =
1799            _.$slideTrack
1800                .children(_.options.slide)
1801                .addClass('slick-slide');
1802
1803        _.slideCount = _.$slides.length;
1804
1805        if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1806            _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1807        }
1808
1809        if (_.slideCount <= _.options.slidesToShow) {
1810            _.currentSlide = 0;
1811        }
1812
1813        _.registerBreakpoints();
1814
1815        _.setProps();
1816        _.setupInfinite();
1817        _.buildArrows();
1818        _.updateArrows();
1819        _.initArrowEvents();
1820        _.buildDots();
1821        _.updateDots();
1822        _.initDotEvents();
1823        _.cleanUpSlideEvents();
1824        _.initSlideEvents();
1825
1826        _.checkResponsive(false, true);
1827
1828        if (_.options.focusOnSelect === true) {
1829            $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1830        }
1831
1832        _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
1833
1834        _.setPosition();
1835        _.focusHandler();
1836
1837        _.paused = !_.options.autoplay;
1838        _.autoPlay();
1839
1840        _.$slider.trigger('reInit', [_]);
1841
1842    };
1843
1844    Slick.prototype.resize = function() {
1845
1846        var _ = this;
1847
1848        if ($(window).width() !== _.windowWidth) {
1849            clearTimeout(_.windowDelay);
1850            _.windowDelay = window.setTimeout(function() {
1851                _.windowWidth = $(window).width();
1852                _.checkResponsive();
1853                if( !_.unslicked ) { _.setPosition(); }
1854            }, 50);
1855        }
1856    };
1857
1858    Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1859
1860        var _ = this;
1861
1862        if (typeof(index) === 'boolean') {
1863            removeBefore = index;
1864            index = removeBefore === true ? 0 : _.slideCount - 1;
1865        } else {
1866            index = removeBefore === true ? --index : index;
1867        }
1868
1869        if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1870            return false;
1871        }
1872
1873        _.unload();
1874
1875        if (removeAll === true) {
1876            _.$slideTrack.children().remove();
1877        } else {
1878            _.$slideTrack.children(this.options.slide).eq(index).remove();
1879        }
1880
1881        _.$slides = _.$slideTrack.children(this.options.slide);
1882
1883        _.$slideTrack.children(this.options.slide).detach();
1884
1885        _.$slideTrack.append(_.$slides);
1886
1887        _.$slidesCache = _.$slides;
1888
1889        _.reinit();
1890
1891    };
1892
1893    Slick.prototype.setCSS = function(position) {
1894
1895        var _ = this,
1896            positionProps = {},
1897            x, y;
1898
1899        if (_.options.rtl === true) {
1900            position = -position;
1901        }
1902        x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
1903        y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
1904
1905        positionProps[_.positionProp] = position;
1906
1907        if (_.transformsEnabled === false) {
1908            _.$slideTrack.css(positionProps);
1909        } else {
1910            positionProps = {};
1911            if (_.cssTransitions === false) {
1912                positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1913                _.$slideTrack.css(positionProps);
1914            } else {
1915                positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1916                _.$slideTrack.css(positionProps);
1917            }
1918        }
1919
1920    };
1921
1922    Slick.prototype.setDimensions = function() {
1923
1924        var _ = this;
1925
1926        if (_.options.vertical === false) {
1927            if (_.options.centerMode === true) {
1928                _.$list.css({
1929                    padding: ('0px ' + _.options.centerPadding)
1930                });
1931            }
1932        } else {
1933            _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1934            if (_.options.centerMode === true) {
1935                _.$list.css({
1936                    padding: (_.options.centerPadding + ' 0px')
1937                });
1938            }
1939        }
1940
1941        _.listWidth = _.$list.width();
1942        _.listHeight = _.$list.height();
1943
1944
1945        if (_.options.vertical === false && _.options.variableWidth === false) {
1946            _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1947            _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1948
1949        } else if (_.options.variableWidth === true) {
1950            _.$slideTrack.width(5000 * _.slideCount);
1951        } else {
1952            _.slideWidth = Math.ceil(_.listWidth);
1953            _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1954        }
1955
1956        var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1957        if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1958
1959    };
1960
1961    Slick.prototype.setFade = function() {
1962
1963        var _ = this,
1964            targetLeft;
1965
1966        _.$slides.each(function(index, element) {
1967            targetLeft = (_.slideWidth * index) * -1;
1968            if (_.options.rtl === true) {
1969                $(element).css({
1970                    position: 'relative',
1971                    right: targetLeft,
1972                    top: 0,
1973                    zIndex: _.options.zIndex - 2,
1974                    opacity: 0
1975                });
1976            } else {
1977                $(element).css({
1978                    position: 'relative',
1979                    left: targetLeft,
1980                    top: 0,
1981                    zIndex: _.options.zIndex - 2,
1982                    opacity: 0
1983                });
1984            }
1985        });
1986
1987        _.$slides.eq(_.currentSlide).css({
1988            zIndex: _.options.zIndex - 1,
1989            opacity: 1
1990        });
1991
1992    };
1993
1994    Slick.prototype.setHeight = function() {
1995
1996        var _ = this;
1997
1998        if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
1999            var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
2000            _.$list.css('height', targetHeight);
2001        }
2002
2003    };
2004
2005    Slick.prototype.setOption =
2006    Slick.prototype.slickSetOption = function() {
2007
2008        /**
2009         * accepts arguments in format of:
2010         *
2011         *  - for changing a single option's value:
2012         *     .slick("setOption", option, value, refresh )
2013         *
2014         *  - for changing a set of responsive options:
2015         *     .slick("setOption", 'responsive', [{}, ...], refresh )
2016         *
2017         *  - for updating multiple values at once (not responsive)
2018         *     .slick("setOption", { 'option': value, ... }, refresh )
2019         */
2020
2021        var _ = this, l, item, option, value, refresh = false, type;
2022
2023        if( $.type( arguments[0] ) === 'object' ) {
2024
2025            option =  arguments[0];
2026            refresh = arguments[1];
2027            type = 'multiple';
2028
2029        } else if ( $.type( arguments[0] ) === 'string' ) {
2030
2031            option =  arguments[0];
2032            value = arguments[1];
2033            refresh = arguments[2];
2034
2035            if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
2036
2037                type = 'responsive';
2038
2039            } else if ( typeof arguments[1] !== 'undefined' ) {
2040
2041                type = 'single';
2042
2043            }
2044
2045        }
2046
2047        if ( type === 'single' ) {
2048
2049            _.options[option] = value;
2050
2051
2052        } else if ( type === 'multiple' ) {
2053
2054            $.each( option , function( opt, val ) {
2055
2056                _.options[opt] = val;
2057
2058            });
2059
2060
2061        } else if ( type === 'responsive' ) {
2062
2063            for ( item in value ) {
2064
2065                if( $.type( _.options.responsive ) !== 'array' ) {
2066
2067                    _.options.responsive = [ value[item] ];
2068
2069                } else {
2070
2071                    l = _.options.responsive.length-1;
2072
2073                    // loop through the responsive object and splice out duplicates.
2074                    while( l >= 0 ) {
2075
2076                        if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
2077
2078                            _.options.responsive.splice(l,1);
2079
2080                        }
2081
2082                        l--;
2083
2084                    }
2085
2086                    _.options.responsive.push( value[item] );
2087
2088                }
2089
2090            }
2091
2092        }
2093
2094        if ( refresh ) {
2095
2096            _.unload();
2097            _.reinit();
2098
2099        }
2100
2101    };
2102
2103    Slick.prototype.setPosition = function() {
2104
2105        var _ = this;
2106
2107        _.setDimensions();
2108
2109        _.setHeight();
2110
2111        if (_.options.fade === false) {
2112            _.setCSS(_.getLeft(_.currentSlide));
2113        } else {
2114            _.setFade();
2115        }
2116
2117        _.$slider.trigger('setPosition', [_]);
2118
2119    };
2120
2121    Slick.prototype.setProps = function() {
2122
2123        var _ = this,
2124            bodyStyle = document.body.style;
2125
2126        _.positionProp = _.options.vertical === true ? 'top' : 'left';
2127
2128        if (_.positionProp === 'top') {
2129            _.$slider.addClass('slick-vertical');
2130        } else {
2131            _.$slider.removeClass('slick-vertical');
2132        }
2133
2134        if (bodyStyle.WebkitTransition !== undefined ||
2135            bodyStyle.MozTransition !== undefined ||
2136            bodyStyle.msTransition !== undefined) {
2137            if (_.options.useCSS === true) {
2138                _.cssTransitions = true;
2139            }
2140        }
2141
2142        if ( _.options.fade ) {
2143            if ( typeof _.options.zIndex === 'number' ) {
2144                if( _.options.zIndex < 3 ) {
2145                    _.options.zIndex = 3;
2146                }
2147            } else {
2148                _.options.zIndex = _.defaults.zIndex;
2149            }
2150        }
2151
2152        if (bodyStyle.OTransform !== undefined) {
2153            _.animType = 'OTransform';
2154            _.transformType = '-o-transform';
2155            _.transitionType = 'OTransition';
2156            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2157        }
2158        if (bodyStyle.MozTransform !== undefined) {
2159            _.animType = 'MozTransform';
2160            _.transformType = '-moz-transform';
2161            _.transitionType = 'MozTransition';
2162            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
2163        }
2164        if (bodyStyle.webkitTransform !== undefined) {
2165            _.animType = 'webkitTransform';
2166            _.transformType = '-webkit-transform';
2167            _.transitionType = 'webkitTransition';
2168            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2169        }
2170        if (bodyStyle.msTransform !== undefined) {
2171            _.animType = 'msTransform';
2172            _.transformType = '-ms-transform';
2173            _.transitionType = 'msTransition';
2174            if (bodyStyle.msTransform === undefined) _.animType = false;
2175        }
2176        if (bodyStyle.transform !== undefined && _.animType !== false) {
2177            _.animType = 'transform';
2178            _.transformType = 'transform';
2179            _.transitionType = 'transition';
2180        }
2181        _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
2182    };
2183
2184
2185    Slick.prototype.setSlideClasses = function(index) {
2186
2187        var _ = this,
2188            centerOffset, allSlides, indexOffset, remainder;
2189
2190        allSlides = _.$slider
2191            .find('.slick-slide')
2192            .removeClass('slick-active slick-center slick-current')
2193            .attr('aria-hidden', 'true');
2194
2195        _.$slides
2196            .eq(index)
2197            .addClass('slick-current');
2198
2199        if (_.options.centerMode === true) {
2200
2201            
vendor: 19,732 bytes, lines 2201-2903
2201centerOffset = Math.floor(_.options.slidesToShow / 2);
2202
2203            if (_.options.infinite === true) {
2204
2205                if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
2206
2207                    _.$slides
2208                        .slice(index - centerOffset, index + centerOffset + 1)
2209                        .addClass('slick-active')
2210                        .attr('aria-hidden', 'false');
2211
2212                } else {
2213
2214                    indexOffset = _.options.slidesToShow + index;
2215                    allSlides
2216                        .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
2217                        .addClass('slick-active')
2218                        .attr('aria-hidden', 'false');
2219
2220                }
2221
2222                if (index === 0) {
2223
2224                    allSlides
2225                        .eq(allSlides.length - 1 - _.options.slidesToShow)
2226                        .addClass('slick-center');
2227
2228                } else if (index === _.slideCount - 1) {
2229
2230                    allSlides
2231                        .eq(_.options.slidesToShow)
2232                        .addClass('slick-center');
2233
2234                }
2235
2236            }
2237
2238            _.$slides
2239                .eq(index)
2240                .addClass('slick-center');
2241
2242        } else {
2243
2244            if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
2245
2246                _.$slides
2247                    .slice(index, index + _.options.slidesToShow)
2248                    .addClass('slick-active')
2249                    .attr('aria-hidden', 'false');
2250
2251            } else if (allSlides.length <= _.options.slidesToShow) {
2252
2253                allSlides
2254                    .addClass('slick-active')
2255                    .attr('aria-hidden', 'false');
2256
2257            } else {
2258
2259                remainder = _.slideCount % _.options.slidesToShow;
2260                indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
2261
2262                if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
2263
2264                    allSlides
2265                        .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
2266                        .addClass('slick-active')
2267                        .attr('aria-hidden', 'false');
2268
2269                } else {
2270
2271                    allSlides
2272                        .slice(indexOffset, indexOffset + _.options.slidesToShow)
2273                        .addClass('slick-active')
2274                        .attr('aria-hidden', 'false');
2275
2276                }
2277
2278            }
2279
2280        }
2281
2282        if (_.options.lazyLoad === 'ondemand') {
2283            _.lazyLoad();
2284        }
2285
2286    };
2287
2288    Slick.prototype.setupInfinite = function() {
2289
2290        var _ = this,
2291            i, slideIndex, infiniteCount;
2292
2293        if (_.options.fade === true) {
2294            _.options.centerMode = false;
2295        }
2296
2297        if (_.options.infinite === true && _.options.fade === false) {
2298
2299            slideIndex = null;
2300
2301            if (_.slideCount > _.options.slidesToShow) {
2302
2303                if (_.options.centerMode === true) {
2304                    infiniteCount = _.options.slidesToShow + 1;
2305                } else {
2306                    infiniteCount = _.options.slidesToShow;
2307                }
2308
2309                for (i = _.slideCount; i > (_.slideCount -
2310                        infiniteCount); i -= 1) {
2311                    slideIndex = i - 1;
2312                    $(_.$slides[slideIndex]).clone(true).attr('id', '')
2313                        .attr('data-slick-index', slideIndex - _.slideCount)
2314                        .prependTo(_.$slideTrack).addClass('slick-cloned');
2315                }
2316                for (i = 0; i < infiniteCount; i += 1) {
2317                    slideIndex = i;
2318                    $(_.$slides[slideIndex]).clone(true).attr('id', '')
2319                        .attr('data-slick-index', slideIndex + _.slideCount)
2320                        .appendTo(_.$slideTrack).addClass('slick-cloned');
2321                }
2322                _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
2323                    $(this).attr('id', '');
2324                });
2325
2326            }
2327
2328        }
2329
2330    };
2331
2332    Slick.prototype.interrupt = function( toggle ) {
2333
2334        var _ = this;
2335
2336        if( !toggle ) {
2337            _.autoPlay();
2338        }
2339        _.interrupted = toggle;
2340
2341    };
2342
2343    Slick.prototype.selectHandler = function(event) {
2344
2345        var _ = this;
2346
2347        var targetElement =
2348            $(event.target).is('.slick-slide') ?
2349                $(event.target) :
2350                $(event.target).parents('.slick-slide');
2351
2352        var index = parseInt(targetElement.attr('data-slick-index'));
2353
2354        if (!index) index = 0;
2355
2356        if (_.slideCount <= _.options.slidesToShow) {
2357
2358            _.setSlideClasses(index);
2359            _.asNavFor(index);
2360            return;
2361
2362        }
2363
2364        _.slideHandler(index);
2365
2366    };
2367
2368    Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
2369
2370        var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
2371            _ = this, navTarget;
2372
2373        sync = sync || false;
2374
2375        if (_.animating === true && _.options.waitForAnimate === true) {
2376            return;
2377        }
2378
2379        if (_.options.fade === true && _.currentSlide === index) {
2380            return;
2381        }
2382
2383        if (_.slideCount <= _.options.slidesToShow) {
2384            return;
2385        }
2386
2387        if (sync === false) {
2388            _.asNavFor(index);
2389        }
2390
2391        targetSlide = index;
2392        targetLeft = _.getLeft(targetSlide);
2393        slideLeft = _.getLeft(_.currentSlide);
2394
2395        _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
2396
2397        if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
2398            if (_.options.fade === false) {
2399                targetSlide = _.currentSlide;
2400                if (dontAnimate !== true) {
2401                    _.animateSlide(slideLeft, function() {
2402                        _.postSlide(targetSlide);
2403                    });
2404                } else {
2405                    _.postSlide(targetSlide);
2406                }
2407            }
2408            return;
2409        } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
2410            if (_.options.fade === false) {
2411                targetSlide = _.currentSlide;
2412                if (dontAnimate !== true) {
2413                    _.animateSlide(slideLeft, function() {
2414                        _.postSlide(targetSlide);
2415                    });
2416                } else {
2417                    _.postSlide(targetSlide);
2418                }
2419            }
2420            return;
2421        }
2422
2423        if ( _.options.autoplay ) {
2424            clearInterval(_.autoPlayTimer);
2425        }
2426
2427        if (targetSlide < 0) {
2428            if (_.slideCount % _.options.slidesToScroll !== 0) {
2429                animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
2430            } else {
2431                animSlide = _.slideCount + targetSlide;
2432            }
2433        } else if (targetSlide >= _.slideCount) {
2434            if (_.slideCount % _.options.slidesToScroll !== 0) {
2435                animSlide = 0;
2436            } else {
2437                animSlide = targetSlide - _.slideCount;
2438            }
2439        } else {
2440            animSlide = targetSlide;
2441        }
2442
2443        _.animating = true;
2444
2445        _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
2446
2447        oldSlide = _.currentSlide;
2448        _.currentSlide = animSlide;
2449
2450        _.setSlideClasses(_.currentSlide);
2451
2452        if ( _.options.asNavFor ) {
2453
2454            navTarget = _.getNavTarget();
2455            navTarget = navTarget.slick('getSlick');
2456
2457            if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
2458                navTarget.setSlideClasses(_.currentSlide);
2459            }
2460
2461        }
2462
2463        _.updateDots();
2464        _.updateArrows();
2465
2466        if (_.options.fade === true) {
2467            if (dontAnimate !== true) {
2468
2469                _.fadeSlideOut(oldSlide);
2470
2471                _.fadeSlide(animSlide, function() {
2472                    _.postSlide(animSlide);
2473                });
2474
2475            } else {
2476                _.postSlide(animSlide);
2477            }
2478            _.animateHeight();
2479            return;
2480        }
2481
2482        if (dontAnimate !== true) {
2483            _.animateSlide(targetLeft, function() {
2484                _.postSlide(animSlide);
2485            });
2486        } else {
2487            _.postSlide(animSlide);
2488        }
2489
2490    };
2491
2492    Slick.prototype.startLoad = function() {
2493
2494        var _ = this;
2495
2496        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2497
2498            _.$prevArrow.hide();
2499            _.$nextArrow.hide();
2500
2501        }
2502
2503        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2504
2505            _.$dots.hide();
2506
2507        }
2508
2509        _.$slider.addClass('slick-loading');
2510
2511    };
2512
2513    Slick.prototype.swipeDirection = function() {
2514
2515        var xDist, yDist, r, swipeAngle, _ = this;
2516
2517        xDist = _.touchObject.startX - _.touchObject.curX;
2518        yDist = _.touchObject.startY - _.touchObject.curY;
2519        r = Math.atan2(yDist, xDist);
2520
2521        swipeAngle = Math.round(r * 180 / Math.PI);
2522        if (swipeAngle < 0) {
2523            swipeAngle = 360 - Math.abs(swipeAngle);
2524        }
2525
2526        if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
2527            return (_.options.rtl === false ? 'left' : 'right');
2528        }
2529        if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
2530            return (_.options.rtl === false ? 'left' : 'right');
2531        }
2532        if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
2533            return (_.options.rtl === false ? 'right' : 'left');
2534        }
2535        if (_.options.verticalSwiping === true) {
2536            if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
2537                return 'down';
2538            } else {
2539                return 'up';
2540            }
2541        }
2542
2543        return 'vertical';
2544
2545    };
2546
2547    Slick.prototype.swipeEnd = function(event) {
2548
2549        var _ = this,
2550            slideCount,
2551            direction;
2552
2553        _.dragging = false;
2554        _.interrupted = false;
2555        _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
2556
2557        if ( _.touchObject.curX === undefined ) {
2558            return false;
2559        }
2560
2561        if ( _.touchObject.edgeHit === true ) {
2562            _.$slider.trigger('edge', [_, _.swipeDirection() ]);
2563        }
2564
2565        if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
2566
2567            direction = _.swipeDirection();
2568
2569            switch ( direction ) {
2570
2571                case 'left':
2572                case 'down':
2573
2574                    slideCount =
2575                        _.options.swipeToSlide ?
2576                            _.checkNavigable( _.currentSlide + _.getSlideCount() ) :
2577                            _.currentSlide + _.getSlideCount();
2578
2579                    _.currentDirection = 0;
2580
2581                    break;
2582
2583                case 'right':
2584                case 'up':
2585
2586                    slideCount =
2587                        _.options.swipeToSlide ?
2588                            _.checkNavigable( _.currentSlide - _.getSlideCount() ) :
2589                            _.currentSlide - _.getSlideCount();
2590
2591                    _.currentDirection = 1;
2592
2593                    break;
2594
2595                default:
2596
2597
2598            }
2599
2600            if( direction != 'vertical' ) {
2601
2602                _.slideHandler( slideCount );
2603                _.touchObject = {};
2604                _.$slider.trigger('swipe', [_, direction ]);
2605
2606            }
2607
2608        } else {
2609
2610            if ( _.touchObject.startX !== _.touchObject.curX ) {
2611
2612                _.slideHandler( _.currentSlide );
2613                _.touchObject = {};
2614
2615            }
2616
2617        }
2618
2619    };
2620
2621    Slick.prototype.swipeHandler = function(event) {
2622
2623        var _ = this;
2624
2625        if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
2626            return;
2627        } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
2628            return;
2629        }
2630
2631        _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
2632            event.originalEvent.touches.length : 1;
2633
2634        _.touchObject.minSwipe = _.listWidth / _.options
2635            .touchThreshold;
2636
2637        if (_.options.verticalSwiping === true) {
2638            _.touchObject.minSwipe = _.listHeight / _.options
2639                .touchThreshold;
2640        }
2641
2642        switch (event.data.action) {
2643
2644            case 'start':
2645                _.swipeStart(event);
2646                break;
2647
2648            case 'move':
2649                _.swipeMove(event);
2650                break;
2651
2652            case 'end':
2653                _.swipeEnd(event);
2654                break;
2655
2656        }
2657
2658    };
2659
2660    Slick.prototype.swipeMove = function(event) {
2661
2662        var _ = this,
2663            edgeWasHit = false,
2664            curLeft, swipeDirection, swipeLength, positionOffset, touches;
2665
2666        touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
2667
2668        if (!_.dragging || touches && touches.length !== 1) {
2669            return false;
2670        }
2671
2672        curLeft = _.getLeft(_.currentSlide);
2673
2674        _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
2675        _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
2676
2677        _.touchObject.swipeLength = Math.round(Math.sqrt(
2678            Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
2679
2680        if (_.options.verticalSwiping === true) {
2681            _.touchObject.swipeLength = Math.round(Math.sqrt(
2682                Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
2683        }
2684
2685        swipeDirection = _.swipeDirection();
2686
2687        if (swipeDirection === 'vertical') {
2688            return;
2689        }
2690
2691        if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
2692            event.preventDefault();
2693        }
2694
2695        positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
2696        if (_.options.verticalSwiping === true) {
2697            positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
2698        }
2699
2700
2701        swipeLength = _.touchObject.swipeLength;
2702
2703        _.touchObject.edgeHit = false;
2704
2705        if (_.options.infinite === false) {
2706            if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
2707                swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
2708                _.touchObject.edgeHit = true;
2709            }
2710        }
2711
2712        if (_.options.vertical === false) {
2713            _.swipeLeft = curLeft + swipeLength * positionOffset;
2714        } else {
2715            _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2716        }
2717        if (_.options.verticalSwiping === true) {
2718            _.swipeLeft = curLeft + swipeLength * positionOffset;
2719        }
2720
2721        if (_.options.fade === true || _.options.touchMove === false) {
2722            return false;
2723        }
2724
2725        if (_.animating === true) {
2726            _.swipeLeft = null;
2727            return false;
2728        }
2729
2730        _.setCSS(_.swipeLeft);
2731
2732    };
2733
2734    Slick.prototype.swipeStart = function(event) {
2735
2736        var _ = this,
2737            touches;
2738
2739        _.interrupted = true;
2740
2741        if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2742            _.touchObject = {};
2743            return false;
2744        }
2745
2746        if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2747            touches = event.originalEvent.touches[0];
2748        }
2749
2750        _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2751        _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2752
2753        _.dragging = true;
2754
2755    };
2756
2757    Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2758
2759        var _ = this;
2760
2761        if (_.$slidesCache !== null) {
2762
2763            _.unload();
2764
2765            _.$slideTrack.children(this.options.slide).detach();
2766
2767            _.$slidesCache.appendTo(_.$slideTrack);
2768
2769            _.reinit();
2770
2771        }
2772
2773    };
2774
2775    Slick.prototype.unload = function() {
2776
2777        var _ = this;
2778
2779        $('.slick-cloned', _.$slider).remove();
2780
2781        if (_.$dots) {
2782            _.$dots.remove();
2783        }
2784
2785        if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
2786            _.$prevArrow.remove();
2787        }
2788
2789        if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
2790            _.$nextArrow.remove();
2791        }
2792
2793        _.$slides
2794            .removeClass('slick-slide slick-active slick-visible slick-current')
2795            .attr('aria-hidden', 'true')
2796            .css('width', '');
2797
2798    };
2799
2800    Slick.prototype.unslick = function(fromBreakpoint) {
2801
2802        var _ = this;
2803        _.$slider.trigger('unslick', [_, fromBreakpoint]);
2804        _.destroy();
2805
2806    };
2807
2808    Slick.prototype.updateArrows = function() {
2809
2810        var _ = this,
2811            centerOffset;
2812
2813        centerOffset = Math.floor(_.options.slidesToShow / 2);
2814
2815        if ( _.options.arrows === true &&
2816            _.slideCount > _.options.slidesToShow &&
2817            !_.options.infinite ) {
2818
2819            _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2820            _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2821
2822            if (_.currentSlide === 0) {
2823
2824                _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2825                _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2826
2827            } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2828
2829                _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2830                _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2831
2832            } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2833
2834                _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2835                _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2836
2837            }
2838
2839        }
2840
2841    };
2842
2843    Slick.prototype.updateDots = function() {
2844
2845        var _ = this;
2846
2847        if (_.$dots !== null) {
2848
2849            _.$dots
2850                .find('li')
2851                .removeClass('slick-active')
2852                .attr('aria-hidden', 'true');
2853
2854            _.$dots
2855                .find('li')
2856                .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
2857                .addClass('slick-active')
2858                .attr('aria-hidden', 'false');
2859
2860        }
2861
2862    };
2863
2864    Slick.prototype.visibility = function() {
2865
2866        var _ = this;
2867
2868        if ( _.options.autoplay ) {
2869
2870            if ( document[_.hidden] ) {
2871
2872                _.interrupted = true;
2873
2874            } else {
2875
2876                _.interrupted = false;
2877
2878            }
2879
2880        }
2881
2882    };
2883
2884    $.fn.slick = function() {
2885        var _ = this,
2886            opt = arguments[0],
2887            args = Array.prototype.slice.call(arguments, 1),
2888            l = _.length,
2889            i,
2890            ret;
2891        for (i = 0; i < l; i++) {
2892            if (typeof opt == 'object' || typeof opt == 'undefined')
2893                _[i].slick = new Slick(_[i], opt);
2894            else
2895                ret = _[i].slick[opt].apply(_[i].slick, args);
2896            if (typeof ret != 'undefined') return ret;
2897        }
2898        return _;
2899    };
2900
2901}));
2902
2903}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.