PageSourceSearch

https://www.funeralocity.com/blog/wp-content/themes/funeralocity/assets/scripts/slick.js

js funeralocity.com collected 2026-09-28 12:02:34 UTC 91,976 bytes, 3,008 lines download raw bytes

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

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.