PageSourceSearch

https://booksrus.fr/local/templates/aspro_max/vendor/js/carousel/owl/owl.carousel.js?165235636591210

js booksrus.fr collected 2026-09-30 02:36:08 UTC 91,210 bytes, 3,489 lines download raw bytes

vendor: 7,420 bytes, lines 1-364
1/**
2 * Owl Carousel v2.3.4
3 * Copyright 2013-2018 David Deutsch
4 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
5 */
6/**
7 * Owl carousel
8 * @version 2.3.4
9 * @author Bartosz Wojciechowski
10 * @author David Deutsch
11 * @license The MIT License (MIT)
12 * @todo Lazy Load Icon
13 * @todo prevent animationend bubling
14 * @todo itemsScaleUp
15 * @todo Test Zepto
16 * @todo stagePadding calculate wrong active classes
17 */
18;(function($, window, document, undefined) {
19
20	/**
21	 * Creates a carousel.
22	 * @class The Owl Carousel.
23	 * @public
24	 * @param {HTMLElement|jQuery} element - The element to create the carousel for.
25	 * @param {Object} [options] - The options
26	 */
27	function Owl(element, options) {
28
29		/**
30		 * Current settings for the carousel.
31		 * @public
32		 */
33		this.settings = null;
34
35		/**
36		 * Current options set by the caller including defaults.
37		 * @public
38		 */
39		this.options = $.extend({}, Owl.Defaults, options);
40
41		/**
42		 * Plugin element.
43		 * @public
44		 */
45		this.$element = $(element);
46
47		/**
48		 * Proxied event handlers.
49		 * @protected
50		 */
51		this._handlers = {};
52
53		/**
54		 * References to the running plugins of this carousel.
55		 * @protected
56		 */
57		this._plugins = {};
58
59		/**
60		 * Currently suppressed events to prevent them from being retriggered.
61		 * @protected
62		 */
63		this._supress = {};
64
65		/**
66		 * Absolute current position.
67		 * @protected
68		 */
69		this._current = null;
70
71		/**
72		 * Animation speed in milliseconds.
73		 * @protected
74		 */
75		this._speed = null;
76
77		/**
78		 * Coordinates of all items in pixel.
79		 * @todo The name of this member is missleading.
80		 * @protected
81		 */
82		this._coordinates = [];
83
84		/**
85		 * Current breakpoint.
86		 * @todo Real media queries would be nice.
87		 * @protected
88		 */
89		this._breakpoint = null;
90
91		/**
92		 * Current width of the plugin element.
93		 */
94		this._width = null;
95
96		/**
97		 * All real items.
98		 * @protected
99		 */
100		this._items = [];
101
102		/**
103		 * All cloned items.
104		 * @protected
105		 */
106		this._clones = [];
107
108		/**
109		 * Merge values of all items.
110		 * @todo Maybe this could be part of a plugin.
111		 * @protected
112		 */
113		this._mergers = [];
114
115		/**
116		 * Widths of all items.
117		 */
118		this._widths = [];
119
120		/**
121		 * Invalidated parts within the update process.
122		 * @protected
123		 */
124		this._invalidated = {};
125
126		/**
127		 * Ordered list of workers for the update process.
128		 * @protected
129		 */
130		this._pipe = [];
131
132		/**
133		 * Current state information for the drag operation.
134		 * @todo #261
135		 * @protected
136		 */
137		this._drag = {
138			time: null,
139			target: null,
140			pointer: null,
141			stage: {
142				start: null,
143				current: null
144			},
145			direction: null
146		};
147
148		/**
149		 * Current state information and their tags.
150		 * @type {Object}
151		 * @protected
152		 */
153		this._states = {
154			current: {},
155			tags: {
156				'initializing': [ 'busy' ],
157				'animating': [ 'busy' ],
158				'dragging': [ 'interacting' ]
159			}
160		};
161
162		$.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
163			this._handlers[handler] = $.proxy(this[handler], this);
164		}, this));
165
166		$.each(Owl.Plugins, $.proxy(function(key, plugin) {
167			this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
168				= new plugin(this);
169		}, this));
170
171		$.each(Owl.Workers, $.proxy(function(priority, worker) {
172			this._pipe.push({
173				'filter': worker.filter,
174				'run': $.proxy(worker.run, this)
175			});
176		}, this));
177
178		this.setup();
179		this.initialize();
180	}
181
182	/**
183	 * Default options for the carousel.
184	 * @public
185	 */
186	Owl.Defaults = {
187		items: 3,
188		loop: false,
189		center: false,
190		rewind: false,
191		checkVisibility: true,
192
193		mouseDrag: true,
194		touchDrag: true,
195		pullDrag: true,
196		freeDrag: false,
197
198		margin: 0,
199		stagePadding: 0,
200
201		merge: false,
202		mergeFit: true,
203		autoWidth: false,
204
205		startPosition: 0,
206		rtl: false,
207
208		smartSpeed: 250,
209		fluidSpeed: false,
210		dragEndSpeed: false,
211
212		responsive: {},
213		responsiveRefreshRate: 200,
214		responsiveBaseElement: window,
215
216		fallbackEasing: 'swing',
217		slideTransition: '',
218
219		info: false,
220
221		nestedItemSelector: false,
222		itemElement: 'div',
223		stageElement: 'div',
224
225		refreshClass: 'owl-refresh',
226		loadedClass: 'owl-loaded',
227		loadingClass: 'owl-loading',
228		rtlClass: 'owl-rtl',
229		responsiveClass: 'owl-responsive',
230		dragClass: 'owl-drag',
231		itemClass: 'owl-item',
232		stageClass: 'owl-stage',
233		stageOuterClass: 'owl-stage-outer',
234		grabClass: 'owl-grab'
235	};
236
237	/**
238	 * Enumeration for width.
239	 * @public
240	 * @readonly
241	 * @enum {String}
242	 */
243	Owl.Width = {
244		Default: 'default',
245		Inner: 'inner',
246		Outer: 'outer'
247	};
248
249	/**
250	 * Enumeration for types.
251	 * @public
252	 * @readonly
253	 * @enum {String}
254	 */
255	Owl.Type = {
256		Event: 'event',
257		State: 'state'
258	};
259
260	/**
261	 * Contains all registered plugins.
262	 * @public
263	 */
264	Owl.Plugins = {};
265
266	/**
267	 * List of workers involved in the update process.
268	 */
269	Owl.Workers = [ {
270		filter: [ 'width', 'settings' ],
271		run: function() {
272			this._width = this.$element.width();
273		}
274	}, {
275		filter: [ 'width', 'items', 'settings' ],
276		run: function(cache) {
277			cache.current = this._items && this._items[this.relative(this._current)];
278		}
279	}, {
280		filter: [ 'items', 'settings' ],
281		run: function() {
282			this.$stage.children('.cloned').remove();
283		}
284	}, {
285		filter: [ 'width', 'items', 'settings' ],
286		run: function(cache) {
287			var margin = this.settings.margin || '',
288				grid = !this.settings.autoWidth,
289				rtl = this.settings.rtl,
290				css = {
291					'width': 'auto',
292					'margin-left': rtl ? margin : '',
293					'margin-right': rtl ? '' : margin
294				};
295
296			!grid && this.$stage.children().css(css);
297
298			cache.css = css;
299		}
300	}, {
301		filter: [ 'width', 'items', 'settings' ],
302		run: function(cache) {
303			var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
304				merge = null,
305				iterator = this._items.length,
306				grid = !this.settings.autoWidth,
307				widths = [];
308
309			cache.items = {
310				merge: false,
311				width: width
312			};
313
314			while (iterator--) {
315				merge = this._mergers[iterator];
316				merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
317
318				cache.items.merge = merge > 1 || cache.items.merge;
319
320				widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
321			}
322
323			this._widths = widths;
324		}
325	}, {
326		filter: [ 'items', 'settings' ],
327		run: function() {
328			var clones = [],
329				items = this._items,
330				settings = this.settings,
331				// TODO: Should be computed from number of min width items in stage
332				view = Math.max(settings.items * 2, 4),
333				size = Math.ceil(items.length / 2) * 2,
334				repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
335				append = '',
336				prepend = '';
337
338			repeat /= 2;
339
340			while (repeat > 0) {
341				// Switch to only using appended clones
342				clones.push(this.normalize(clones.length / 2, true));
343				append = append + items[clones[clones.length - 1]][0].outerHTML;
344				clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
345				prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
346				repeat -= 1;
347			}
348
349			this._clones = clones;
350
351			$(append).addClass('cloned').appendTo(this.$stage);
352			$(prepend).addClass('cloned').prependTo(this.$stage);
353		}
354	}, {
355		filter: [ 'width', 'items', 'settings' ],
356		run: function() {
357			var rtl = this.settings.rtl ? 1 : -1,
358				size = this._clones.length + this._items.length,
359				iterator = -1,
360				previous = 0,
361				current = 0,
362				coordinates = [];
363
364			
vendor: 17,010 bytes, lines 364-989
364/* ASPRO_CUSTOM */
365			var pullToEnd = false;
366			if(this._widths[ this._widths.length - 1 ] < this._width && !this.settings.loop && this.settings.lightDrag) {
367				pullToEnd = this._width - this._widths[ this._widths.length - 1 ];
368			}
369			/* ASPRO_CUSTOM */
370
371			while (++iterator < size) {
372				previous = coordinates[iterator - 1] || 0;
373				current = this._widths[this.relative(iterator)] + this.settings.margin;
374				/* ASPRO_CUSTOM */
375				if(iterator == size - 2 && pullToEnd) {
376					coordinates.push(previous + current * rtl + pullToEnd + this.settings.margin);
377				} else {
378					coordinates.push(previous + current * rtl);
379				}
380				/* ASPRO_CUSTOM */
381			}
382			this._coordinates = coordinates;
383		}
384	}, {
385		filter: [ 'width', 'items', 'settings' ],
386		run: function() {
387			var padding = this.settings.stagePadding,
388				coordinates = this._coordinates,
389				css = {
390					'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
391					'padding-left': padding || '',
392					'padding-right': padding || ''
393				};
394
395			this.$stage.css(css);
396		}
397	}, {
398		filter: [ 'width', 'items', 'settings' ],
399		run: function(cache) {
400			var iterator = this._coordinates.length,
401				grid = !this.settings.autoWidth,
402				items = this.$stage.children();
403
404			if (grid && cache.items.merge) {
405				while (iterator--) {
406					cache.css.width = this._widths[this.relative(iterator)];
407					items.eq(iterator).css(cache.css);
408				}
409			} else if (grid) {
410				cache.css.width = cache.items.width;
411				items.css(cache.css);
412			}
413		}
414	}, {
415		filter: [ 'items' ],
416		run: function() {
417			this._coordinates.length < 1 && this.$stage.removeAttr('style');
418		}
419	}, {
420		filter: [ 'width', 'items', 'settings' ],
421		run: function(cache) {
422			cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
423			cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
424			this.reset(cache.current);
425		}
426	}, {
427		filter: [ 'position' ],
428		run: function() {
429			this.animate(this.coordinates(this._current));
430		}
431	}, {
432		filter: [ 'width', 'position', 'items', 'settings' ],
433		run: function() {
434			var rtl = this.settings.rtl ? 1 : -1,
435				padding = this.settings.stagePadding * 2,
436				begin = this.coordinates(this.current()) + padding,
437				end = begin + this.width() * rtl,
438				inner, outer, matches = [], i, n;
439
440			for (i = 0, n = this._coordinates.length; i < n; i++) {
441				inner = this._coordinates[i - 1] || 0;
442				outer = Math.abs(this._coordinates[i]) + padding * rtl;
443
444				if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
445					|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
446					matches.push(i);
447				}
448			}
449
450			this.$stage.children('.active').removeClass('active');
451			this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
452
453			this.$stage.children('.center').removeClass('center');
454			if (this.settings.center) {
455				this.$stage.children().eq(this.current()).addClass('center');
456			}
457		}
458	} ];
459
460	/**
461	 * Create the stage DOM element
462	 */
463	Owl.prototype.initializeStage = function() {
464		this.$stage = this.$element.find('.' + this.settings.stageClass);
465
466		// if the stage is already in the DOM, grab it and skip stage initialization
467		if (this.$stage.length) {
468			return;
469		}
470
471		this.$element.addClass(this.options.loadingClass);
472
473		// create stage
474		this.$stage = $('<' + this.settings.stageElement + '>', {
475			"class": this.settings.stageClass
476		}).wrap( $( '<div/>', {
477			"class": this.settings.stageOuterClass
478		}));
479
480		// append stage
481		this.$element.append(this.$stage.parent());
482	};
483
484	/**
485	 * Create item DOM elements
486	 */
487	Owl.prototype.initializeItems = function() {
488		var $items = this.$element.find('.owl-item');
489
490		// if the items are already in the DOM, grab them and skip item initialization
491		if ($items.length) {
492			this._items = $items.get().map(function(item) {
493				return $(item);
494			});
495
496			this._mergers = this._items.map(function() {
497				return 1;
498			});
499
500			this.refresh();
501
502			return;
503		}
504
505		// append content
506		this.replace(this.$element.children().not(this.$stage.parent()));
507
508		// check visibility
509		if (this.isVisible()) {
510			// update view
511			this.refresh();
512		} else {
513			// invalidate width
514			this.invalidate('width');
515		}
516
517		this.$element
518			.removeClass(this.options.loadingClass)
519			.addClass(this.options.loadedClass);
520	};
521
522	/**
523	 * Initializes the carousel.
524	 * @protected
525	 */
526	Owl.prototype.initialize = function() {
527		this.enter('initializing');
528		this.trigger('initialize');
529
530		this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
531
532		if (this.settings.autoWidth && !this.is('pre-loading')) {
533			var imgs, nestedSelector, width;
534			imgs = this.$element.find('img');
535			nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
536			width = this.$element.children(nestedSelector).width();
537
538			if (imgs.length && width <= 0) {
539				this.preloadAutoWidthImages(imgs);
540			}
541		}
542
543		this.initializeStage();
544		this.initializeItems();
545
546		// register event handlers
547		this.registerEventHandlers();
548
549		this.leave('initializing');
550		this.trigger('initialized');
551	};
552
553	/**
554	 * @returns {Boolean} visibility of $element
555	 *                    if you know the carousel will always be visible you can set `checkVisibility` to `false` to
556	 *                    prevent the expensive browser layout forced reflow the $element.is(':visible') does
557	 */
558	Owl.prototype.isVisible = function() {
559		return this.settings.checkVisibility
560			? this.$element.is(':visible')
561			: true;
562	};
563
564	/**
565	 * Setups the current settings.
566	 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
567	 * @todo Support for media queries by using `matchMedia` would be nice.
568	 * @public
569	 */
570	Owl.prototype.setup = function() {
571		var viewport = this.viewport(),
572			overwrites = this.options.responsive,
573			match = -1,
574			settings = null;
575
576		if (!overwrites) {
577			settings = $.extend({}, this.options);
578		} else {
579			$.each(overwrites, function(breakpoint) {
580				if (breakpoint <= viewport && breakpoint > match) {
581					match = Number(breakpoint);
582				}
583			});
584
585			settings = $.extend({}, this.options, overwrites[match]);
586			if (typeof settings.stagePadding === 'function') {
587				settings.stagePadding = settings.stagePadding();
588			}
589			delete settings.responsive;
590
591			// responsive class
592			if (settings.responsiveClass) {
593				this.$element.attr('class',
594					this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
595				);
596			}
597		}
598
599		this.trigger('change', { property: { name: 'settings', value: settings } });
600		this._breakpoint = match;
601		this.settings = settings;
602		this.invalidate('settings');
603		this.trigger('changed', { property: { name: 'settings', value: this.settings } });
604	};
605
606	/**
607	 * Updates option logic if necessery.
608	 * @protected
609	 */
610	Owl.prototype.optionsLogic = function() {
611		if (this.settings.autoWidth) {
612			this.settings.stagePadding = false;
613			this.settings.merge = false;
614		}
615	};
616
617	/**
618	 * Prepares an item before add.
619	 * @todo Rename event parameter `content` to `item`.
620	 * @protected
621	 * @returns {jQuery|HTMLElement} - The item container.
622	 */
623	Owl.prototype.prepare = function(item) {
624		var event = this.trigger('prepare', { content: item });
625
626		if (!event.data) {
627			event.data = $('<' + this.settings.itemElement + '/>')
628				.addClass(this.options.itemClass).append(item)
629		}
630
631		this.trigger('prepared', { content: event.data });
632
633		return event.data;
634	};
635
636	/**
637	 * Updates the view.
638	 * @public
639	 */
640	Owl.prototype.update = function() {
641		var i = 0,
642			n = this._pipe.length,
643			filter = $.proxy(function(p) { return this[p] }, this._invalidated),
644			cache = {};
645
646		while (i < n) {
647			if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
648				this._pipe[i].run(cache);
649			}
650			i++;
651		}
652
653		this._invalidated = {};
654
655		!this.is('valid') && this.enter('valid');
656	};
657
658	/**
659	 * Gets the width of the view.
660	 * @public
661	 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
662	 * @returns {Number} - The width of the view in pixel.
663	 */
664	Owl.prototype.width = function(dimension) {
665		dimension = dimension || Owl.Width.Default;
666		switch (dimension) {
667			case Owl.Width.Inner:
668			case Owl.Width.Outer:
669				return this._width;
670			default:
671				return this._width - this.settings.stagePadding * 2 + this.settings.margin;
672		}
673	};
674
675	/**
676	 * Refreshes the carousel primarily for adaptive purposes.
677	 * @public
678	 */
679	Owl.prototype.refresh = function() {
680		this.enter('refreshing');
681		this.trigger('refresh');
682
683		this.setup();
684
685		this.optionsLogic();
686
687		this.$element.addClass(this.options.refreshClass);
688
689		this.update();
690
691		this.$element.removeClass(this.options.refreshClass);
692
693		this.leave('refreshing');
694		this.trigger('refreshed');
695	};
696
697	/**
698	 * Checks window `resize` event.
699	 * @protected
700	 */
701	Owl.prototype.onThrottledResize = function() {
702		window.clearTimeout(this.resizeTimer);
703		this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
704	};
705
706	/**
707	 * Checks window `resize` event.
708	 * @protected
709	 */
710	Owl.prototype.onResize = function() {
711		if (!this._items.length) {
712			return false;
713		}
714
715		if (this._width === this.$element.width()) {
716			return false;
717		}
718
719		if (!this.isVisible()) {
720			return false;
721		}
722
723		this.enter('resizing');
724
725		if (this.trigger('resize').isDefaultPrevented()) {
726			this.leave('resizing');
727			return false;
728		}
729
730		this.invalidate('width');
731
732		this.refresh();
733
734		this.leave('resizing');
735		this.trigger('resized');
736	};
737
738	/**
739	 * Registers event handlers.
740	 * @todo Check `msPointerEnabled`
741	 * @todo #261
742	 * @protected
743	 */
744	Owl.prototype.registerEventHandlers = function() {
745		if ($.support.transition) {
746			this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
747		}
748
749		if (this.settings.responsive !== false) {
750			this.on(window, 'resize', this._handlers.onThrottledResize);
751		}
752
753		if (this.settings.mouseDrag) {
754			this.$element.addClass(this.options.dragClass);
755			this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
756			this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
757		}
758
759		if (this.settings.touchDrag){
760			this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
761			this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
762		}
763	};
764
765	/**
766	 * Handles `touchstart` and `mousedown` events.
767	 * @todo Horizontal swipe threshold as option
768	 * @todo #261
769	 * @protected
770	 * @param {Event} event - The event arguments.
771	 */
772	Owl.prototype.onDragStart = function(event) {
773		var stage = null;
774
775		if (event.which === 3) {
776			return;
777		}
778
779		/* ASPRO CUSTOM */
780		if(this.settings.marginMove) {
781			stage = this.$stage.css('margin-left').replace('px', '');
782			stage = {
783				x: stage,
784				y: 0
785			};
786		/* ASPRO CUSTOM */
787		} else if ($.support.transform) {
788			stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
789			stage = {
790				x: stage[stage.length === 16 ? 12 : 4],
791				y: stage[stage.length === 16 ? 13 : 5]
792			};
793		} else {
794			stage = this.$stage.position();
795			stage = {
796				x: this.settings.rtl ?
797					stage.left + this.$stage.width() - this.width() + this.settings.margin :
798					stage.left,
799				y: stage.top
800			};
801		}
802
803		if (this.is('animating')) {
804			$.support.transform ? this.animate(stage.x) : this.$stage.stop()
805			this.invalidate('position');
806		}
807
808		this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
809
810		this.speed(0);
811
812		this._drag.time = new Date().getTime();
813		this._drag.target = $(event.target);
814		this._drag.stage.start = stage;
815		this._drag.stage.current = stage;
816		this._drag.pointer = this.pointer(event);
817
818		$(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
819
820		$(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
821			var delta = this.difference(this._drag.pointer, this.pointer(event));
822
823			$(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
824
825			if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
826				return;
827			}
828
829			event.preventDefault();
830
831			this.enter('dragging');
832			this.trigger('drag');
833		}, this));
834	};
835
836	/**
837	 * Handles the `touchmove` and `mousemove` events.
838	 * @todo #261
839	 * @protected
840	 * @param {Event} event - The event arguments.
841	 */
842	Owl.prototype.onDragMove = function(event) {
843		var minimum = null,
844			maximum = null,
845			pull = null,
846			delta = this.difference(this._drag.pointer, this.pointer(event)),
847			stage = this.difference(this._drag.stage.start, delta);
848
849		if (!this.is('dragging')) {
850			return;
851		}
852
853		event.preventDefault();
854
855		if (this.settings.loop) {
856			minimum = this.coordinates(this.minimum());
857			maximum = this.coordinates(this.maximum() + 1) - minimum;
858			stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
859		} else {
860			minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
861			maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
862			pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
863			stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
864		}
865
866		this._drag.stage.current = stage;
867
868		this.animate(stage.x);
869	};
870
871	/**
872	 * Handles the `touchend` and `mouseup` events.
873	 * @todo #261
874	 * @todo Threshold for click event
875	 * @protected
876	 * @param {Event} event - The event arguments.
877	 */
878	Owl.prototype.onDragEnd = function(event) {
879		var delta = this.difference(this._drag.pointer, this.pointer(event)),
880			stage = this._drag.stage.current,
881			direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
882
883		$(document).off('.owl.core');
884
885		this.$element.removeClass(this.options.grabClass);
886
887		if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
888			this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
889			this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
890			this.invalidate('position');
891			/* ASPRO CUSTOM */
892			var bUpdate = false;
893			if(!this.settings.loop) {
894				if(this.current() === 0) {
895					bUpdate = stage.x > 0;
896				} else {
897					bUpdate = stage.x < this.coordinates()[this._items.length - 1];
898				}
899			}
900			if(!this.settings.lightDrag || bUpdate) {
901				this.update();
902			}
903			/* ASPRO CUSTOM */
904
905			this._drag.direction = direction;
906
907			if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
908				this._drag.target.one('click.owl.core', function() { return false; });
909			}
910		}
911
912		if (!this.is('dragging')) {
913			return;
914		}
915
916		this.leave('dragging');
917		this.trigger('dragged');
918	};
919
920	/**
921	 * Gets absolute position of the closest item for a coordinate.
922	 * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
923	 * @protected
924	 * @param {Number} coordinate - The coordinate in pixel.
925	 * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
926	 * @return {Number} - The absolute position of the closest item.
927	 */
928	Owl.prototype.closest = function(coordinate, direction) {
929		var position = -1,
930			pull = 30,
931			width = this.width(),
932			coordinates = this.coordinates();
933
934		if (!this.settings.freeDrag) {
935			// check closest item
936			$.each(coordinates, $.proxy(function(index, value) {
937				// on a left pull, check on current index
938				if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
939					position = index;
940				// on a right pull, check on previous index
941				// to do so, subtract width from value and set position = index + 1
942				} else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
943					position = index + 1;
944				} else if (this.op(coordinate, '<', value)
945					&& this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
946					position = direction === 'left' ? index + 1 : index;
947				}
948				return position === -1;
949			}, this));
950		}
951
952		if (!this.settings.loop) {
953			// non loop boundries
954			if (this.op(coordinate, '>', coordinates[this.minimum()])) {
955				position = coordinate = this.minimum();
956			} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
957				position = coordinate = this.maximum();
958			}
959		}
960
961		return position;
962	};
963
964	/**
965	 * Animates the stage.
966	 * @todo #270
967	 * @public
968	 * @param {Number} coordinate - The coordinate in pixels.
969	 */
970	Owl.prototype.animate = function(coordinate) {
971		var animate = this.speed() > 0;
972
973		this.is('animating') && this.onTransitionEnd();
974
975		if (animate) {
976			this.enter('animating');
977			this.trigger('translate');
978		}
979
980		/* ASPRO CUSTOM */
981		if(this.settings.marginMove) {
982			this.$stage.css({
983				'margin-left': coordinate + 'px',
984				transition: (this.speed() / 1000) + 's' + (
985					this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
986				)
987			});
988		/* ASPRO CUSTOM */
989		}
989 else 
vendor: 10,522 bytes, lines 989-1356
989if ($.support.transform3d && $.support.transition) {
990			this.$stage.css({
991				transform: 'translate3d(' + coordinate + 'px,0px,0px)',
992				transition: (this.speed() / 1000) + 's' + (
993					this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
994				)
995			});
996		} else if (animate) {
997			this.$stage.animate({
998				left: coordinate + 'px'
999			}, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
1000		} else {
1001			this.$stage.css({
1002				left: coordinate + 'px'
1003			});
1004		}
1005	};
1006
1007	/**
1008	 * Checks whether the carousel is in a specific state or not.
1009	 * @param {String} state - The state to check.
1010	 * @returns {Boolean} - The flag which indicates if the carousel is busy.
1011	 */
1012	Owl.prototype.is = function(state) {
1013		return this._states.current[state] && this._states.current[state] > 0;
1014	};
1015
1016	/**
1017	 * Sets the absolute position of the current item.
1018	 * @public
1019	 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1020	 * @returns {Number} - The absolute position of the current item.
1021	 */
1022	Owl.prototype.current = function(position) {
1023		if (position === undefined) {
1024			return this._current;
1025		}
1026
1027		if (this._items.length === 0) {
1028			return undefined;
1029		}
1030
1031		position = this.normalize(position);
1032
1033		if (this._current !== position) {
1034			var event = this.trigger('change', { property: { name: 'position', value: position } });
1035
1036			if (event.data !== undefined) {
1037				position = this.normalize(event.data);
1038			}
1039
1040			this._current = position;
1041
1042			this.invalidate('position');
1043
1044			this.trigger('changed', { property: { name: 'position', value: this._current } });
1045		}
1046
1047		return this._current;
1048	};
1049
1050	/**
1051	 * Invalidates the given part of the update routine.
1052	 * @param {String} [part] - The part to invalidate.
1053	 * @returns {Array.<String>} - The invalidated parts.
1054	 */
1055	Owl.prototype.invalidate = function(part) {
1056		if ($.type(part) === 'string') {
1057			this._invalidated[part] = true;
1058			this.is('valid') && this.leave('valid');
1059		}
1060		return $.map(this._invalidated, function(v, i) { return i });
1061	};
1062
1063	/**
1064	 * Resets the absolute position of the current item.
1065	 * @public
1066	 * @param {Number} position - The absolute position of the new item.
1067	 */
1068	Owl.prototype.reset = function(position) {
1069		position = this.normalize(position);
1070
1071		if (position === undefined) {
1072			return;
1073		}
1074
1075		this._speed = 0;
1076		this._current = position;
1077
1078		this.suppress([ 'translate', 'translated' ]);
1079
1080		this.animate(this.coordinates(position));
1081
1082		this.release([ 'translate', 'translated' ]);
1083	};
1084
1085	/**
1086	 * Normalizes an absolute or a relative position of an item.
1087	 * @public
1088	 * @param {Number} position - The absolute or relative position to normalize.
1089	 * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1090	 * @returns {Number} - The normalized position.
1091	 */
1092	Owl.prototype.normalize = function(position, relative) {
1093		var n = this._items.length,
1094			m = relative ? 0 : this._clones.length;
1095
1096		if (!this.isNumeric(position) || n < 1) {
1097			position = undefined;
1098		} else if (position < 0 || position >= n + m) {
1099			position = ((position - m / 2) % n + n) % n + m / 2;
1100		}
1101
1102		return position;
1103	};
1104
1105	/**
1106	 * Converts an absolute position of an item into a relative one.
1107	 * @public
1108	 * @param {Number} position - The absolute position to convert.
1109	 * @returns {Number} - The converted position.
1110	 */
1111	Owl.prototype.relative = function(position) {
1112		position -= this._clones.length / 2;
1113		return this.normalize(position, true);
1114	};
1115
1116	/**
1117	 * Gets the maximum position for the current item.
1118	 * @public
1119	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1120	 * @returns {Number}
1121	 */
1122	Owl.prototype.maximum = function(relative) {
1123		var settings = this.settings,
1124			maximum = this._coordinates.length,
1125			iterator,
1126			reciprocalItemsWidth,
1127			elementWidth;
1128
1129		if (settings.loop) {
1130			maximum = this._clones.length / 2 + this._items.length - 1;
1131		} else if (settings.autoWidth || settings.merge) {
1132			iterator = this._items.length;
1133			if (iterator) {
1134				reciprocalItemsWidth = this._items[--iterator].width();
1135				elementWidth = this.$element.width();
1136				while (iterator--) {
1137					reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
1138					if (reciprocalItemsWidth > elementWidth) {
1139						break;
1140					}
1141				}
1142			}
1143			maximum = iterator + 1;
1144		} else if (settings.center) {
1145			maximum = this._items.length - 1;
1146		} else {
1147			maximum = this._items.length - settings.items;
1148		}
1149
1150		if (relative) {
1151			maximum -= this._clones.length / 2;
1152		}
1153
1154		return Math.max(maximum, 0);
1155	};
1156
1157	/**
1158	 * Gets the minimum position for the current item.
1159	 * @public
1160	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1161	 * @returns {Number}
1162	 */
1163	Owl.prototype.minimum = function(relative) {
1164		return relative ? 0 : this._clones.length / 2;
1165	};
1166
1167	/**
1168	 * Gets an item at the specified relative position.
1169	 * @public
1170	 * @param {Number} [position] - The relative position of the item.
1171	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1172	 */
1173	Owl.prototype.items = function(position) {
1174		if (position === undefined) {
1175			return this._items.slice();
1176		}
1177
1178		position = this.normalize(position, true);
1179		return this._items[position];
1180	};
1181
1182	/**
1183	 * Gets an item at the specified relative position.
1184	 * @public
1185	 * @param {Number} [position] - The relative position of the item.
1186	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1187	 */
1188	Owl.prototype.mergers = function(position) {
1189		if (position === undefined) {
1190			return this._mergers.slice();
1191		}
1192
1193		position = this.normalize(position, true);
1194		return this._mergers[position];
1195	};
1196
1197	/**
1198	 * Gets the absolute positions of clones for an item.
1199	 * @public
1200	 * @param {Number} [position] - The relative position of the item.
1201	 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1202	 */
1203	Owl.prototype.clones = function(position) {
1204		var odd = this._clones.length / 2,
1205			even = odd + this._items.length,
1206			map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
1207
1208		if (position === undefined) {
1209			return $.map(this._clones, function(v, i) { return map(i) });
1210		}
1211
1212		return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1213	};
1214
1215	/**
1216	 * Sets the current animation speed.
1217	 * @public
1218	 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1219	 * @returns {Number} - The current animation speed in milliseconds.
1220	 */
1221	Owl.prototype.speed = function(speed) {
1222		if (speed !== undefined) {
1223			this._speed = speed;
1224		}
1225
1226		return this._speed;
1227	};
1228
1229	/**
1230	 * Gets the coordinate of an item.
1231	 * @todo The name of this method is missleanding.
1232	 * @public
1233	 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1234	 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1235	 */
1236	Owl.prototype.coordinates = function(position) {
1237		var multiplier = 1,
1238			newPosition = position - 1,
1239			coordinate;
1240
1241		if (position === undefined) {
1242			return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1243				return this.coordinates(index);
1244			}, this));
1245		}
1246
1247		if (this.settings.center) {
1248			if (this.settings.rtl) {
1249				multiplier = -1;
1250				newPosition = position + 1;
1251			}
1252
1253			coordinate = this._coordinates[position];
1254			coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
1255		} else {
1256			coordinate = this._coordinates[newPosition] || 0;
1257		}
1258
1259		coordinate = Math.ceil(coordinate);
1260
1261		return coordinate;
1262	};
1263
1264	/**
1265	 * Calculates the speed for a translation.
1266	 * @protected
1267	 * @param {Number} from - The absolute position of the start item.
1268	 * @param {Number} to - The absolute position of the target item.
1269	 * @param {Number} [factor=undefined] - The time factor in milliseconds.
1270	 * @returns {Number} - The time in milliseconds for the translation.
1271	 */
1272	Owl.prototype.duration = function(from, to, factor) {
1273		if (factor === 0) {
1274			return 0;
1275		}
1276
1277		return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1278	};
1279
1280	/**
1281	 * Slides to the specified item.
1282	 * @public
1283	 * @param {Number} position - The position of the item.
1284	 * @param {Number} [speed] - The time in milliseconds for the transition.
1285	 */
1286	Owl.prototype.to = function(position, speed) {
1287		var current = this.current(),
1288			revert = null,
1289			distance = position - this.relative(current),
1290			direction = (distance > 0) - (distance < 0),
1291			items = this._items.length,
1292			minimum = this.minimum(),
1293			maximum = this.maximum();
1294
1295		if (this.settings.loop) {
1296			if (!this.settings.rewind && Math.abs(distance) > items / 2) {
1297				distance += direction * -1 * items;
1298			}
1299
1300			position = current + distance;
1301			revert = ((position - minimum) % items + items) % items + minimum;
1302
1303			if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
1304				current = revert - distance;
1305				position = revert;
1306				this.reset(current);
1307			}
1308		} else if (this.settings.rewind) {
1309			maximum += 1;
1310			position = (position % maximum + maximum) % maximum;
1311		} else {
1312			position = Math.max(minimum, Math.min(maximum, position));
1313		}
1314
1315		this.speed(this.duration(current, position, speed));
1316		this.current(position);
1317
1318		if (this.isVisible()) {
1319			this.update();
1320		}
1321	};
1322
1323	/**
1324	 * Slides to the next item.
1325	 * @public
1326	 * @param {Number} [speed] - The time in milliseconds for the transition.
1327	 */
1328	Owl.prototype.next = function(speed) {
1329		speed = speed || false;
1330		this.to(this.relative(this.current()) + 1, speed);
1331	};
1332
1333	/**
1334	 * Slides to the previous item.
1335	 * @public
1336	 * @param {Number} [speed] - The time in milliseconds for the transition.
1337	 */
1338	Owl.prototype.prev = function(speed) {
1339		speed = speed || false;
1340		this.to(this.relative(this.current()) - 1, speed);
1341	};
1342
1343	/**
1344	 * Handles the end of an animation.
1345	 * @protected
1346	 * @param {Event} event - The event arguments.
1347	 */
1348	Owl.prototype.onTransitionEnd = function(event) {
1349
1350		// if css2 animation then event object is undefined
1351		if (event !== undefined) {
1352			event.stopPropagation();
1353
1354			// Catch only owl-stage transitionEnd event
1355			if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1356				return false;
vendor: 22,957 bytes, lines 1357-2205
1357			}
1358		}
1359
1360		this.leave('animating');
1361		this.trigger('translated');
1362	};
1363
1364	/**
1365	 * Gets viewport width.
1366	 * @protected
1367	 * @return {Number} - The width in pixel.
1368	 */
1369	Owl.prototype.viewport = function() {
1370		var width;
1371		if (this.options.responsiveBaseElement !== window) {
1372			width = $(this.options.responsiveBaseElement).width();
1373		} else if (window.innerWidth) {
1374			width = window.innerWidth;
1375		} else if (document.documentElement && document.documentElement.clientWidth) {
1376			width = document.documentElement.clientWidth;
1377		} else {
1378			console.warn('Can not detect viewport width.');
1379		}
1380		return width;
1381	};
1382
1383	/**
1384	 * Replaces the current content.
1385	 * @public
1386	 * @param {HTMLElement|jQuery|String} content - The new content.
1387	 */
1388	Owl.prototype.replace = function(content) {
1389		this.$stage.empty();
1390		this._items = [];
1391
1392		if (content) {
1393			content = (content instanceof jQuery) ? content : $(content);
1394		}
1395
1396		if (this.settings.nestedItemSelector) {
1397			content = content.find('.' + this.settings.nestedItemSelector);
1398		}
1399
1400		content.filter(function() {
1401			return this.nodeType === 1;
1402		}).each($.proxy(function(index, item) {
1403			item = this.prepare(item);
1404			this.$stage.append(item);
1405			this._items.push(item);
1406			this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1407		}, this));
1408
1409		this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1410
1411		this.invalidate('items');
1412	};
1413
1414	/**
1415	 * Adds an item.
1416	 * @todo Use `item` instead of `content` for the event arguments.
1417	 * @public
1418	 * @param {HTMLElement|jQuery|String} content - The item content to add.
1419	 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1420	 */
1421	Owl.prototype.add = function(content, position) {
1422		var current = this.relative(this._current);
1423
1424		position = position === undefined ? this._items.length : this.normalize(position, true);
1425		content = content instanceof jQuery ? content : $(content);
1426
1427		this.trigger('add', { content: content, position: position });
1428
1429		content = this.prepare(content);
1430
1431		if (this._items.length === 0 || position === this._items.length) {
1432			this._items.length === 0 && this.$stage.append(content);
1433			this._items.length !== 0 && this._items[position - 1].after(content);
1434			this._items.push(content);
1435			this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1436		} else {
1437			this._items[position].before(content);
1438			this._items.splice(position, 0, content);
1439			this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
1440		}
1441
1442		this._items[current] && this.reset(this._items[current].index());
1443
1444		this.invalidate('items');
1445
1446		this.trigger('added', { content: content, position: position });
1447	};
1448
1449	/**
1450	 * Removes an item by its position.
1451	 * @todo Use `item` instead of `content` for the event arguments.
1452	 * @public
1453	 * @param {Number} position - The relative position of the item to remove.
1454	 */
1455	Owl.prototype.remove = function(position) {
1456		position = this.normalize(position, true);
1457
1458		if (position === undefined) {
1459			return;
1460		}
1461
1462		this.trigger('remove', { content: this._items[position], position: position });
1463
1464		this._items[position].remove();
1465		this._items.splice(position, 1);
1466		this._mergers.splice(position, 1);
1467
1468		this.invalidate('items');
1469
1470		this.trigger('removed', { content: null, position: position });
1471	};
1472
1473	/**
1474	 * Preloads images with auto width.
1475	 * @todo Replace by a more generic approach
1476	 * @protected
1477	 */
1478	Owl.prototype.preloadAutoWidthImages = function(images) {
1479		images.each($.proxy(function(i, element) {
1480			this.enter('pre-loading');
1481			element = $(element);
1482			$(new Image()).one('load', $.proxy(function(e) {
1483				element.attr('src', e.target.src);
1484				element.css('opacity', 1);
1485				this.leave('pre-loading');
1486				!this.is('pre-loading') && !this.is('initializing') && this.refresh();
1487			}, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
1488		}, this));
1489	};
1490
1491	/**
1492	 * Destroys the carousel.
1493	 * @public
1494	 */
1495	Owl.prototype.destroy = function() {
1496
1497		this.$element.off('.owl.core');
1498		this.$stage.off('.owl.core');
1499		$(document).off('.owl.core');
1500
1501		if (this.settings.responsive !== false) {
1502			window.clearTimeout(this.resizeTimer);
1503			this.off(window, 'resize', this._handlers.onThrottledResize);
1504		}
1505
1506		for (var i in this._plugins) {
1507			this._plugins[i].destroy();
1508		}
1509
1510		this.$stage.children('.cloned').remove();
1511
1512		this.$stage.unwrap();
1513		this.$stage.children().contents().unwrap();
1514		this.$stage.children().unwrap();
1515		this.$stage.remove();
1516		this.$element
1517			.removeClass(this.options.refreshClass)
1518			.removeClass(this.options.loadingClass)
1519			.removeClass(this.options.loadedClass)
1520			.removeClass(this.options.rtlClass)
1521			.removeClass(this.options.dragClass)
1522			.removeClass(this.options.grabClass)
1523			.attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
1524			.removeData('owl.carousel');
1525	};
1526
1527	/**
1528	 * Operators to calculate right-to-left and left-to-right.
1529	 * @protected
1530	 * @param {Number} [a] - The left side operand.
1531	 * @param {String} [o] - The operator.
1532	 * @param {Number} [b] - The right side operand.
1533	 */
1534	Owl.prototype.op = function(a, o, b) {
1535		var rtl = this.settings.rtl;
1536		switch (o) {
1537			case '<':
1538				return rtl ? a > b : a < b;
1539			case '>':
1540				return rtl ? a < b : a > b;
1541			case '>=':
1542				return rtl ? a <= b : a >= b;
1543			case '<=':
1544				return rtl ? a >= b : a <= b;
1545			default:
1546				break;
1547		}
1548	};
1549
1550	/**
1551	 * Attaches to an internal event.
1552	 * @protected
1553	 * @param {HTMLElement} element - The event source.
1554	 * @param {String} event - The event name.
1555	 * @param {Function} listener - The event handler to attach.
1556	 * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
1557	 */
1558	Owl.prototype.on = function(element, event, listener, capture) {
1559		if (element.addEventListener) {
1560			element.addEventListener(event, listener, capture);
1561		} else if (element.attachEvent) {
1562			element.attachEvent('on' + event, listener);
1563		}
1564	};
1565
1566	/**
1567	 * Detaches from an internal event.
1568	 * @protected
1569	 * @param {HTMLElement} element - The event source.
1570	 * @param {String} event - The event name.
1571	 * @param {Function} listener - The attached event handler to detach.
1572	 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1573	 */
1574	Owl.prototype.off = function(element, event, listener, capture) {
1575		if (element.removeEventListener) {
1576			element.removeEventListener(event, listener, capture);
1577		} else if (element.detachEvent) {
1578			element.detachEvent('on' + event, listener);
1579		}
1580	};
1581
1582	/**
1583	 * Triggers a public event.
1584	 * @todo Remove `status`, `relatedTarget` should be used instead.
1585	 * @protected
1586	 * @param {String} name - The event name.
1587	 * @param {*} [data=null] - The event data.
1588	 * @param {String} [namespace=carousel] - The event namespace.
1589	 * @param {String} [state] - The state which is associated with the event.
1590	 * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
1591	 * @returns {Event} - The event arguments.
1592	 */
1593	Owl.prototype.trigger = function(name, data, namespace, state, enter) {
1594		var status = {
1595			item: { count: this._items.length, index: this.current() }
1596		}, handler = $.camelCase(
1597			$.grep([ 'on', name, namespace ], function(v) { return v })
1598				.join('-').toLowerCase()
1599		), event = $.Event(
1600			[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1601			$.extend({ relatedTarget: this }, status, data)
1602		);
1603
1604		if (!this._supress[name]) {
1605			$.each(this._plugins, function(name, plugin) {
1606				if (plugin.onTrigger) {
1607					plugin.onTrigger(event);
1608				}
1609			});
1610
1611			this.register({ type: Owl.Type.Event, name: name });
1612			this.$element.trigger(event);
1613
1614			if (this.settings && typeof this.settings[handler] === 'function') {
1615				this.settings[handler].call(this, event);
1616			}
1617		}
1618
1619		return event;
1620	};
1621
1622	/**
1623	 * Enters a state.
1624	 * @param name - The state name.
1625	 */
1626	Owl.prototype.enter = function(name) {
1627		$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1628			if (this._states.current[name] === undefined) {
1629				this._states.current[name] = 0;
1630			}
1631
1632			this._states.current[name]++;
1633		}, this));
1634	};
1635
1636	/**
1637	 * Leaves a state.
1638	 * @param name - The state name.
1639	 */
1640	Owl.prototype.leave = function(name) {
1641		$.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
1642			this._states.current[name]--;
1643		}, this));
1644	};
1645
1646	/**
1647	 * Registers an event or state.
1648	 * @public
1649	 * @param {Object} object - The event or state to register.
1650	 */
1651	Owl.prototype.register = function(object) {
1652		if (object.type === Owl.Type.Event) {
1653			if (!$.event.special[object.name]) {
1654				$.event.special[object.name] = {};
1655			}
1656
1657			if (!$.event.special[object.name].owl) {
1658				var _default = $.event.special[object.name]._default;
1659				$.event.special[object.name]._default = function(e) {
1660					if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
1661						return _default.apply(this, arguments);
1662					}
1663					return e.namespace && e.namespace.indexOf('owl') > -1;
1664				};
1665				$.event.special[object.name].owl = true;
1666			}
1667		} else if (object.type === Owl.Type.State) {
1668			if (!this._states.tags[object.name]) {
1669				this._states.tags[object.name] = object.tags;
1670			} else {
1671				this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
1672			}
1673
1674			this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
1675				return $.inArray(tag, this._states.tags[object.name]) === i;
1676			}, this));
1677		}
1678	};
1679
1680	/**
1681	 * Suppresses events.
1682	 * @protected
1683	 * @param {Array.<String>} events - The events to suppress.
1684	 */
1685	Owl.prototype.suppress = function(events) {
1686		$.each(events, $.proxy(function(index, event) {
1687			this._supress[event] = true;
1688		}, this));
1689	};
1690
1691	/**
1692	 * Releases suppressed events.
1693	 * @protected
1694	 * @param {Array.<String>} events - The events to release.
1695	 */
1696	Owl.prototype.release = function(events) {
1697		$.each(events, $.proxy(function(index, event) {
1698			delete this._supress[event];
1699		}, this));
1700	};
1701
1702	/**
1703	 * Gets unified pointer coordinates from event.
1704	 * @todo #261
1705	 * @protected
1706	 * @param {Event} - The `mousedown` or `touchstart` event.
1707	 * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
1708	 */
1709	Owl.prototype.pointer = function(event) {
1710		var result = { x: null, y: null };
1711
1712		event = event.originalEvent || event || window.event;
1713
1714		event = event.touches && event.touches.length ?
1715			event.touches[0] : event.changedTouches && event.changedTouches.length ?
1716				event.changedTouches[0] : event;
1717
1718		if (event.pageX) {
1719			result.x = event.pageX;
1720			result.y = event.pageY;
1721		} else {
1722			result.x = event.clientX;
1723			result.y = event.clientY;
1724		}
1725
1726		return result;
1727	};
1728
1729	/**
1730	 * Determines if the input is a Number or something that can be coerced to a Number
1731	 * @protected
1732	 * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
1733	 * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
1734	 */
1735	Owl.prototype.isNumeric = function(number) {
1736		return !isNaN(parseFloat(number));
1737	};
1738
1739	/**
1740	 * Gets the difference of two vectors.
1741	 * @todo #261
1742	 * @protected
1743	 * @param {Object} - The first vector.
1744	 * @param {Object} - The second vector.
1745	 * @returns {Object} - The difference.
1746	 */
1747	Owl.prototype.difference = function(first, second) {
1748		return {
1749			x: first.x - second.x,
1750			y: first.y - second.y
1751		};
1752	};
1753
1754	/**
1755	 * The jQuery Plugin for the Owl Carousel
1756	 * @todo Navigation plugin `next` and `prev`
1757	 * @public
1758	 */
1759	$.fn.owlCarousel = function(option) {
1760		var args = Array.prototype.slice.call(arguments, 1);
1761
1762		return this.each(function() {
1763			var $this = $(this),
1764				data = $this.data('owl.carousel');
1765
1766			if (!data) {
1767				data = new Owl(this, typeof option == 'object' && option);
1768				$this.data('owl.carousel', data);
1769
1770				$.each([
1771					'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
1772				], function(i, event) {
1773					data.register({ type: Owl.Type.Event, name: event });
1774					data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
1775						if (e.namespace && e.relatedTarget !== this) {
1776							this.suppress([ event ]);
1777							data[event].apply(this, [].slice.call(arguments, 1));
1778							this.release([ event ]);
1779						}
1780					}, data));
1781				});
1782			}
1783
1784			if (typeof option == 'string' && option.charAt(0) !== '_') {
1785				data[option].apply(data, args);
1786			}
1787		});
1788	};
1789
1790	/**
1791	 * The constructor for the jQuery Plugin
1792	 * @public
1793	 */
1794	$.fn.owlCarousel.Constructor = Owl;
1795
1796})(window.Zepto || window.jQuery, window, document);
1797
1798/**
1799 * AutoRefresh Plugin
1800 * @version 2.3.4
1801 * @author Artus Kolanowski
1802 * @author David Deutsch
1803 * @license The MIT License (MIT)
1804 */
1805;(function($, window, document, undefined) {
1806
1807	/**
1808	 * Creates the auto refresh plugin.
1809	 * @class The Auto Refresh Plugin
1810	 * @param {Owl} carousel - The Owl Carousel
1811	 */
1812	var AutoRefresh = function(carousel) {
1813		/**
1814		 * Reference to the core.
1815		 * @protected
1816		 * @type {Owl}
1817		 */
1818		this._core = carousel;
1819
1820		/**
1821		 * Refresh interval.
1822		 * @protected
1823		 * @type {number}
1824		 */
1825		this._interval = null;
1826
1827		/**
1828		 * Whether the element is currently visible or not.
1829		 * @protected
1830		 * @type {Boolean}
1831		 */
1832		this._visible = null;
1833
1834		/**
1835		 * All event handlers.
1836		 * @protected
1837		 * @type {Object}
1838		 */
1839		this._handlers = {
1840			'initialized.owl.carousel': $.proxy(function(e) {
1841				if (e.namespace && this._core.settings.autoRefresh) {
1842					this.watch();
1843				}
1844			}, this)
1845		};
1846
1847		// set default options
1848		this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
1849
1850		// register event handlers
1851		this._core.$element.on(this._handlers);
1852	};
1853
1854	/**
1855	 * Default options.
1856	 * @public
1857	 */
1858	AutoRefresh.Defaults = {
1859		autoRefresh: true,
1860		autoRefreshInterval: 500
1861	};
1862
1863	/**
1864	 * Watches the element.
1865	 */
1866	AutoRefresh.prototype.watch = function() {
1867		if (this._interval) {
1868			return;
1869		}
1870
1871		this._visible = this._core.isVisible();
1872		this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
1873	};
1874
1875	/**
1876	 * Refreshes the element.
1877	 */
1878	AutoRefresh.prototype.refresh = function() {
1879		if (this._core.isVisible() === this._visible) {
1880			return;
1881		}
1882
1883		this._visible = !this._visible;
1884
1885		this._core.$element.toggleClass('owl-hidden', !this._visible);
1886
1887		this._visible && (this._core.invalidate('width') && this._core.refresh());
1888	};
1889
1890	/**
1891	 * Destroys the plugin.
1892	 */
1893	AutoRefresh.prototype.destroy = function() {
1894		var handler, property;
1895
1896		window.clearInterval(this._interval);
1897
1898		for (handler in this._handlers) {
1899			this._core.$element.off(handler, this._handlers[handler]);
1900		}
1901		for (property in Object.getOwnPropertyNames(this)) {
1902			typeof this[property] != 'function' && (this[property] = null);
1903		}
1904	};
1905
1906	$.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
1907
1908})(window.Zepto || window.jQuery, window, document);
1909
1910/**
1911 * Lazy Plugin
1912 * @version 2.3.4
1913 * @author Bartosz Wojciechowski
1914 * @author David Deutsch
1915 * @license The MIT License (MIT)
1916 */
1917;(function($, window, document, undefined) {
1918
1919	/**
1920	 * Creates the lazy plugin.
1921	 * @class The Lazy Plugin
1922	 * @param {Owl} carousel - The Owl Carousel
1923	 */
1924	var Lazy = function(carousel) {
1925
1926		/**
1927		 * Reference to the core.
1928		 * @protected
1929		 * @type {Owl}
1930		 */
1931		this._core = carousel;
1932
1933		/**
1934		 * Already loaded items.
1935		 * @protected
1936		 * @type {Array.<jQuery>}
1937		 */
1938		this._loaded = [];
1939
1940		/**
1941		 * Event handlers.
1942		 * @protected
1943		 * @type {Object}
1944		 */
1945		this._handlers = {
1946			'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
1947				if (!e.namespace) {
1948					return;
1949				}
1950
1951				if (!this._core.settings || !this._core.settings.lazyLoad) {
1952					return;
1953				}
1954
1955				if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1956					var settings = this._core.settings,
1957						n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
1958						i = ((settings.center && n * -1) || 0),
1959						position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
1960						clones = this._core.clones().length,
1961						load = $.proxy(function(i, v) { this.load(v) }, this);
1962					//TODO: Need documentation for this new option
1963					if (settings.lazyLoadEager > 0) {
1964						n += settings.lazyLoadEager;
1965						// If the carousel is looping also preload images that are to the "left"
1966						if (settings.loop) {
1967              position -= settings.lazyLoadEager;
1968              n++;
1969            }
1970					}
1971
1972					while (i++ < n) {
1973						this.load(clones / 2 + this._core.relative(position));
1974						clones && $.each(this._core.clones(this._core.relative(position)), load);
1975						position++;
1976					}
1977				}
1978			}, this)
1979		};
1980
1981		// set the default options
1982		this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1983
1984		// register event handler
1985		this._core.$element.on(this._handlers);
1986	};
1987
1988	/**
1989	 * Default options.
1990	 * @public
1991	 */
1992	Lazy.Defaults = {
1993		lazyLoad: false,
1994		lazyLoadEager: 0
1995	};
1996
1997	/**
1998	 * Loads all resources of an item at the specified position.
1999	 * @param {Number} position - The absolute position of the item.
2000	 * @protected
2001	 */
2002	Lazy.prototype.load = function(position) {
2003		var $item = this._core.$stage.children().eq(position),
2004			$elements = $item && $item.find('.owl-lazy');
2005
2006		if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
2007			return;
2008		}
2009
2010		$elements.each($.proxy(function(index, element) {
2011			var $element = $(element), image,
2012                url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
2013
2014			this._core.trigger('load', { element: $element, url: url }, 'lazy');
2015
2016			if ($element.is('img')) {
2017				$element.one('load.owl.lazy', $.proxy(function() {
2018					$element.css('opacity', 1);
2019					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2020				}, this)).attr('src', url);
2021            } else if ($element.is('source')) {
2022                $element.one('load.owl.lazy', $.proxy(function() {
2023                    this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2024                }, this)).attr('srcset', url);
2025			} else {
2026				image = new Image();
2027				image.onload = $.proxy(function() {
2028					$element.css({
2029						'background-image': 'url("' + url + '")',
2030						'opacity': '1'
2031					});
2032					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
2033				}, this);
2034				image.src = url;
2035			}
2036		}, this));
2037
2038		this._loaded.push($item.get(0));
2039	};
2040
2041	/**
2042	 * Destroys the plugin.
2043	 * @public
2044	 */
2045	Lazy.prototype.destroy = function() {
2046		var handler, property;
2047
2048		for (handler in this.handlers) {
2049			this._core.$element.off(handler, this.handlers[handler]);
2050		}
2051		for (property in Object.getOwnPropertyNames(this)) {
2052			typeof this[property] != 'function' && (this[property] = null);
2053		}
2054	};
2055
2056	$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2057
2058})(window.Zepto || window.jQuery, window, document);
2059
2060/**
2061 * AutoHeight Plugin
2062 * @version 2.3.4
2063 * @author Bartosz Wojciechowski
2064 * @author David Deutsch
2065 * @license The MIT License (MIT)
2066 */
2067;(function($, window, document, undefined) {
2068
2069	/**
2070	 * Creates the auto height plugin.
2071	 * @class The Auto Height Plugin
2072	 * @param {Owl} carousel - The Owl Carousel
2073	 */
2074	var AutoHeight = function(carousel) {
2075		/**
2076		 * Reference to the core.
2077		 * @protected
2078		 * @type {Owl}
2079		 */
2080		this._core = carousel;
2081
2082		this._previousHeight = null;
2083
2084		/**
2085		 * All event handlers.
2086		 * @protected
2087		 * @type {Object}
2088		 */
2089		this._handlers = {
2090			'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
2091				if (e.namespace && this._core.settings.autoHeight) {
2092					this.update();
2093				}
2094			}, this),
2095			'changed.owl.carousel': $.proxy(function(e) {
2096				if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
2097					this.update();
2098				}
2099			}, this),
2100			'loaded.owl.lazy': $.proxy(function(e) {
2101				if (e.namespace && this._core.settings.autoHeight
2102					&& e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
2103					this.update();
2104				}
2105			}, this)
2106		};
2107
2108		// set default options
2109		this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2110
2111		// register event handlers
2112		this._core.$element.on(this._handlers);
2113		this._intervalId = null;
2114		var refThis = this;
2115
2116		// These changes have been taken from a PR by gavrochelegnou proposed in #1575
2117		// and have been made compatible with the latest jQuery version
2118		$(window).on('load', function() {
2119			if (refThis._core.settings.autoHeight) {
2120				refThis.update();
2121			}
2122		});
2123
2124		// Autoresize the height of the carousel when window is resized
2125		// When carousel has images, the height is dependent on the width
2126		// and should also change on resize
2127		$(window).resize(function() {
2128			if (refThis._core.settings.autoHeight) {
2129				if (refThis._intervalId != null) {
2130					clearTimeout(refThis._intervalId);
2131				}
2132
2133				refThis._intervalId = setTimeout(function() {
2134					refThis.update();
2135				}, 250);
2136			}
2137		});
2138
2139	};
2140
2141	/**
2142	 * Default options.
2143	 * @public
2144	 */
2145	AutoHeight.Defaults = {
2146		autoHeight: false,
2147		autoHeightClass: 'owl-height'
2148	};
2149
2150	/**
2151	 * Updates the view.
2152	 */
2153	AutoHeight.prototype.update = function() {
2154		var start = this._core._current,
2155			end = start + this._core.settings.items,
2156			lazyLoadEnabled = this._core.settings.lazyLoad,
2157			visible = this._core.$stage.children().toArray().slice(start, end),
2158			heights = [],
2159			maxheight = 0;
2160
2161		$.each(visible, function(index, item) {
2162			heights.push($(item).height());
2163		});
2164
2165		maxheight = Math.max.apply(null, heights);
2166
2167		if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
2168			maxheight = this._previousHeight;
2169		}
2170
2171		this._previousHeight = maxheight;
2172
2173		this._core.$stage.parent()
2174			.height(maxheight)
2175			.addClass(this._core.settings.autoHeightClass);
2176	};
2177
2178	AutoHeight.prototype.destroy = function() {
2179		var handler, property;
2180
2181		for (handler in this._handlers) {
2182			this._core.$element.off(handler, this._handlers[handler]);
2183		}
2184		for (property in Object.getOwnPropertyNames(this)) {
2185			typeof this[property] !== 'function' && (this[property] = null);
2186		}
2187	};
2188
2189	$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2190
2191})(window.Zepto || window.jQuery, window, document);
2192
2193/**
2194 * Video Plugin
2195 * @version 2.3.4
2196 * @author Bartosz Wojciechowski
2197 * @author David Deutsch
2198 * @license The MIT License (MIT)
2199 */
2200;(function($, window, document, undefined) {
2201
2202	/**
2203	 * Creates the video plugin.
2204	 * @class The Video Plugin
2205	 * @param {Owl} carousel - The Owl Carousel
vendor: 5,347 bytes, lines 2206-2403
2206	 */
2207	var Video = function(carousel) {
2208		/**
2209		 * Reference to the core.
2210		 * @protected
2211		 * @type {Owl}
2212		 */
2213		this._core = carousel;
2214
2215		/**
2216		 * Cache all video URLs.
2217		 * @protected
2218		 * @type {Object}
2219		 */
2220		this._videos = {};
2221
2222		/**
2223		 * Current playing item.
2224		 * @protected
2225		 * @type {jQuery}
2226		 */
2227		this._playing = null;
2228
2229		/**
2230		 * All event handlers.
2231		 * @todo The cloned content removale is too late
2232		 * @protected
2233		 * @type {Object}
2234		 */
2235		this._handlers = {
2236			'initialized.owl.carousel': $.proxy(function(e) {
2237				if (e.namespace) {
2238					this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
2239				}
2240			}, this),
2241			'resize.owl.carousel': $.proxy(function(e) {
2242				if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
2243					e.preventDefault();
2244				}
2245			}, this),
2246			'refreshed.owl.carousel': $.proxy(function(e) {
2247				if (e.namespace && this._core.is('resizing')) {
2248					this._core.$stage.find('.cloned .owl-video-frame').remove();
2249				}
2250			}, this),
2251			'changed.owl.carousel': $.proxy(function(e) {
2252				if (e.namespace && e.property.name === 'position' && this._playing) {
2253					this.stop();
2254				}
2255			}, this),
2256			'prepared.owl.carousel': $.proxy(function(e) {
2257				if (!e.namespace) {
2258					return;
2259				}
2260
2261				var $element = $(e.content).find('.owl-video');
2262
2263				if ($element.length) {
2264					$element.css('display', 'none');
2265					this.fetch($element, $(e.content));
2266				}
2267			}, this)
2268		};
2269
2270		// set default options
2271		this._core.options = $.extend({}, Video.Defaults, this._core.options);
2272
2273		// register event handlers
2274		this._core.$element.on(this._handlers);
2275
2276		this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2277			this.play(e);
2278		}, this));
2279	};
2280
2281	/**
2282	 * Default options.
2283	 * @public
2284	 */
2285	Video.Defaults = {
2286		video: false,
2287		videoHeight: false,
2288		videoWidth: false
2289	};
2290
2291	/**
2292	 * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
2293	 * @protected
2294	 * @param {jQuery} target - The target containing the video data.
2295	 * @param {jQuery} item - The item containing the video.
2296	 */
2297	Video.prototype.fetch = function(target, item) {
2298			var type = (function() {
2299					if (target.attr('data-vimeo-id')) {
2300						return 'vimeo';
2301					} else if (target.attr('data-vzaar-id')) {
2302						return 'vzaar'
2303					} else {
2304						return 'youtube';
2305					}
2306				})(),
2307				id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
2308				width = target.attr('data-width') || this._core.settings.videoWidth,
2309				height = target.attr('data-height') || this._core.settings.videoHeight,
2310				url = target.attr('href');
2311
2312		if (url) {
2313
2314			/*
2315					Parses the id's out of the following urls (and probably more):
2316					https://www.youtube.com/watch?v=:id
2317					https://youtu.be/:id
2318					https://vimeo.com/:id
2319					https://vimeo.com/channels/:channel/:id
2320					https://vimeo.com/groups/:group/videos/:id
2321					https://app.vzaar.com/videos/:id
2322
2323					Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
2324			*/
2325
2326			id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2327
2328			if (id[3].indexOf('youtu') > -1) {
2329				type = 'youtube';
2330			} else if (id[3].indexOf('vimeo') > -1) {
2331				type = 'vimeo';
2332			} else if (id[3].indexOf('vzaar') > -1) {
2333				type = 'vzaar';
2334			} else {
2335				throw new Error('Video URL not supported.');
2336			}
2337			id = id[6];
2338		} else {
2339			throw new Error('Missing video URL.');
2340		}
2341
2342		this._videos[url] = {
2343			type: type,
2344			id: id,
2345			width: width,
2346			height: height
2347		};
2348
2349		item.attr('data-video', url);
2350
2351		this.thumbnail(target, this._videos[url]);
2352	};
2353
2354	/**
2355	 * Creates video thumbnail.
2356	 * @protected
2357	 * @param {jQuery} target - The target containing the video data.
2358	 * @param {Object} info - The video info object.
2359	 * @see `fetch`
2360	 */
2361	Video.prototype.thumbnail = function(target, video) {
2362		var tnLink,
2363			icon,
2364			path,
2365			dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
2366			customTn = target.find('img'),
2367			srcType = 'src',
2368			lazyClass = '',
2369			settings = this._core.settings,
2370			create = function(path) {
2371				icon = '<div class="owl-video-play-icon"></div>';
2372
2373				if (settings.lazyLoad) {
2374					tnLink = $('<div/>',{
2375						"class": 'owl-video-tn ' + lazyClass,
2376						"srcType": path
2377					});
2378				} else {
2379					tnLink = $( '<div/>', {
2380						"class": "owl-video-tn",
2381						"style": 'opacity:1;background-image:url(' + path + ')'
2382					});
2383				}
2384				target.after(tnLink);
2385				target.after(icon);
2386			};
2387
2388		// wrap video content into owl-video-wrapper div
2389		target.wrap( $( '<div/>', {
2390			"class": "owl-video-wrapper",
2391			"style": dimensions
2392		}));
2393
2394		if (this._core.settings.lazyLoad) {
2395			srcType = 'data-src';
2396			lazyClass = 'owl-lazy';
2397		}
2398
2399		// custom thumbnail
2400		if (customTn.length) {
2401			create(customTn.attr(srcType));
2402			customTn.remove();
2403			return false;
vendor: 15,908 bytes, lines 2404-3041
2404		}
2405
2406		if (video.type === 'youtube') {
2407			path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2408			create(path);
2409		} else if (video.type === 'vimeo') {
2410			$.ajax({
2411				type: 'GET',
2412				url: '//vimeo.com/api/v2/video/' + video.id + '.json',
2413				jsonp: 'callback',
2414				dataType: 'jsonp',
2415				success: function(data) {
2416					path = data[0].thumbnail_large;
2417					create(path);
2418				}
2419			});
2420		} else if (video.type === 'vzaar') {
2421			$.ajax({
2422				type: 'GET',
2423				url: '//vzaar.com/api/videos/' + video.id + '.json',
2424				jsonp: 'callback',
2425				dataType: 'jsonp',
2426				success: function(data) {
2427					path = data.framegrab_url;
2428					create(path);
2429				}
2430			});
2431		}
2432	};
2433
2434	/**
2435	 * Stops the current video.
2436	 * @public
2437	 */
2438	Video.prototype.stop = function() {
2439		this._core.trigger('stop', null, 'video');
2440		this._playing.find('.owl-video-frame').remove();
2441		this._playing.removeClass('owl-video-playing');
2442		this._playing = null;
2443		this._core.leave('playing');
2444		this._core.trigger('stopped', null, 'video');
2445	};
2446
2447	/**
2448	 * Starts the current video.
2449	 * @public
2450	 * @param {Event} event - The event arguments.
2451	 */
2452	Video.prototype.play = function(event) {
2453		var target = $(event.target),
2454			item = target.closest('.' + this._core.settings.itemClass),
2455			video = this._videos[item.attr('data-video')],
2456			width = video.width || '100%',
2457			height = video.height || this._core.$stage.height(),
2458			html,
2459			iframe;
2460
2461		if (this._playing) {
2462			return;
2463		}
2464
2465		this._core.enter('playing');
2466		this._core.trigger('play', null, 'video');
2467
2468		item = this._core.items(this._core.relative(item.index()));
2469
2470		this._core.reset(item.index());
2471
2472		html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
2473		html.attr( 'height', height );
2474		html.attr( 'width', width );
2475		if (video.type === 'youtube') {
2476			html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
2477		} else if (video.type === 'vimeo') {
2478			html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
2479		} else if (video.type === 'vzaar') {
2480			html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
2481		}
2482
2483		iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
2484
2485		this._playing = item.addClass('owl-video-playing');
2486	};
2487
2488	/**
2489	 * Checks whether an video is currently in full screen mode or not.
2490	 * @todo Bad style because looks like a readonly method but changes members.
2491	 * @protected
2492	 * @returns {Boolean}
2493	 */
2494	Video.prototype.isInFullScreen = function() {
2495		var element = document.fullscreenElement || document.mozFullScreenElement ||
2496				document.webkitFullscreenElement;
2497
2498		return element && $(element).parent().hasClass('owl-video-frame');
2499	};
2500
2501	/**
2502	 * Destroys the plugin.
2503	 */
2504	Video.prototype.destroy = function() {
2505		var handler, property;
2506
2507		this._core.$element.off('click.owl.video');
2508
2509		for (handler in this._handlers) {
2510			this._core.$element.off(handler, this._handlers[handler]);
2511		}
2512		for (property in Object.getOwnPropertyNames(this)) {
2513			typeof this[property] != 'function' && (this[property] = null);
2514		}
2515	};
2516
2517	$.fn.owlCarousel.Constructor.Plugins.Video = Video;
2518
2519})(window.Zepto || window.jQuery, window, document);
2520
2521/**
2522 * Animate Plugin
2523 * @version 2.3.4
2524 * @author Bartosz Wojciechowski
2525 * @author David Deutsch
2526 * @license The MIT License (MIT)
2527 */
2528;(function($, window, document, undefined) {
2529
2530	/**
2531	 * Creates the animate plugin.
2532	 * @class The Navigation Plugin
2533	 * @param {Owl} scope - The Owl Carousel
2534	 */
2535	var Animate = function(scope) {
2536		this.core = scope;
2537		this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2538		this.swapping = true;
2539		this.previous = undefined;
2540		this.next = undefined;
2541
2542		this.handlers = {
2543			'change.owl.carousel': $.proxy(function(e) {
2544				if (e.namespace && e.property.name == 'position') {
2545					this.previous = this.core.current();
2546					this.next = e.property.value;
2547				}
2548			}, this),
2549			'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2550				if (e.namespace) {
2551					this.swapping = e.type == 'translated';
2552				}
2553			}, this),
2554			'translate.owl.carousel': $.proxy(function(e) {
2555				if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2556					this.swap();
2557				}
2558			}, this)
2559		};
2560
2561		this.core.$element.on(this.handlers);
2562	};
2563
2564	/**
2565	 * Default options.
2566	 * @public
2567	 */
2568	Animate.Defaults = {
2569		animateOut: false,
2570		animateIn: false
2571	};
2572
2573	/**
2574	 * Toggles the animation classes whenever an translations starts.
2575	 * @protected
2576	 * @returns {Boolean|undefined}
2577	 */
2578	Animate.prototype.swap = function() {
2579
2580		if (this.core.settings.items !== 1) {
2581			return;
2582		}
2583
2584		if (!$.support.animation || !$.support.transition) {
2585			return;
2586		}
2587
2588		this.core.speed(0);
2589
2590		var left,
2591			clear = $.proxy(this.clear, this),
2592			previous = this.core.$stage.children().eq(this.previous),
2593			next = this.core.$stage.children().eq(this.next),
2594			incoming = this.core.settings.animateIn,
2595			outgoing = this.core.settings.animateOut;
2596
2597		if (this.core.current() === this.previous) {
2598			return;
2599		}
2600
2601		if (outgoing) {
2602			left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2603			previous.one($.support.animation.end, clear)
2604				.css( { 'left': left + 'px' } )
2605				.addClass('animated owl-animated-out')
2606				.addClass(outgoing);
2607		}
2608
2609		if (incoming) {
2610			next.one($.support.animation.end, clear)
2611				.addClass('animated owl-animated-in')
2612				.addClass(incoming);
2613		}
2614	};
2615
2616	Animate.prototype.clear = function(e) {
2617		$(e.target).css( { 'left': '' } )
2618			.removeClass('animated owl-animated-out owl-animated-in')
2619			.removeClass(this.core.settings.animateIn)
2620			.removeClass(this.core.settings.animateOut);
2621		this.core.onTransitionEnd();
2622	};
2623
2624	/**
2625	 * Destroys the plugin.
2626	 * @public
2627	 */
2628	Animate.prototype.destroy = function() {
2629		var handler, property;
2630
2631		for (handler in this.handlers) {
2632			this.core.$element.off(handler, this.handlers[handler]);
2633		}
2634		for (property in Object.getOwnPropertyNames(this)) {
2635			typeof this[property] != 'function' && (this[property] = null);
2636		}
2637	};
2638
2639	$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2640
2641})(window.Zepto || window.jQuery, window, document);
2642
2643/**
2644 * Autoplay Plugin
2645 * @version 2.3.4
2646 * @author Bartosz Wojciechowski
2647 * @author Artus Kolanowski
2648 * @author David Deutsch
2649 * @author Tom De Caluwé
2650 * @license The MIT License (MIT)
2651 */
2652;(function($, window, document, undefined) {
2653
2654	/**
2655	 * Creates the autoplay plugin.
2656	 * @class The Autoplay Plugin
2657	 * @param {Owl} scope - The Owl Carousel
2658	 */
2659	var Autoplay = function(carousel) {
2660		/**
2661		 * Reference to the core.
2662		 * @protected
2663		 * @type {Owl}
2664		 */
2665		this._core = carousel;
2666
2667		/**
2668		 * The autoplay timeout id.
2669		 * @type {Number}
2670		 */
2671		this._call = null;
2672
2673		/**
2674		 * Depending on the state of the plugin, this variable contains either
2675		 * the start time of the timer or the current timer value if it's
2676		 * paused. Since we start in a paused state we initialize the timer
2677		 * value.
2678		 * @type {Number}
2679		 */
2680		this._time = 0;
2681
2682		/**
2683		 * Stores the timeout currently used.
2684		 * @type {Number}
2685		 */
2686		this._timeout = 0;
2687
2688		/**
2689		 * Indicates whenever the autoplay is paused.
2690		 * @type {Boolean}
2691		 */
2692		this._paused = true;
2693
2694		/**
2695		 * All event handlers.
2696		 * @protected
2697		 * @type {Object}
2698		 */
2699		this._handlers = {
2700			'changed.owl.carousel': $.proxy(function(e) {
2701				if (e.namespace && e.property.name === 'settings') {
2702					if (this._core.settings.autoplay) {
2703						this.play();
2704					} else {
2705						this.stop();
2706					}
2707				} else if (e.namespace && e.property.name === 'position' && this._paused) {
2708					// Reset the timer. This code is triggered when the position
2709					// of the carousel was changed through user interaction.
2710					this._time = 0;
2711				}
2712			}, this),
2713			'initialized.owl.carousel': $.proxy(function(e) {
2714				if (e.namespace && this._core.settings.autoplay) {
2715					this.play();
2716				}
2717			}, this),
2718			'play.owl.autoplay': $.proxy(function(e, t, s) {
2719				if (e.namespace) {
2720					this.play(t, s);
2721				}
2722			}, this),
2723			'stop.owl.autoplay': $.proxy(function(e) {
2724				if (e.namespace) {
2725					this.stop();
2726				}
2727			}, this),
2728			'mouseover.owl.autoplay': $.proxy(function() {
2729				if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2730					this.pause();
2731				}
2732			}, this),
2733			'mouseleave.owl.autoplay': $.proxy(function() {
2734				if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2735					this.play();
2736				}
2737			}, this),
2738			'touchstart.owl.core': $.proxy(function() {
2739				if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
2740					this.pause();
2741				}
2742			}, this),
2743			'touchend.owl.core': $.proxy(function() {
2744				if (this._core.settings.autoplayHoverPause) {
2745					this.play();
2746				}
2747			}, this)
2748		};
2749
2750		// register event handlers
2751		this._core.$element.on(this._handlers);
2752
2753		// set default options
2754		this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
2755	};
2756
2757	/**
2758	 * Default options.
2759	 * @public
2760	 */
2761	Autoplay.Defaults = {
2762		autoplay: false,
2763		autoplayTimeout: 5000,
2764		autoplayHoverPause: false,
2765		autoplaySpeed: false
2766	};
2767
2768	/**
2769	 * Transition to the next slide and set a timeout for the next transition.
2770	 * @private
2771	 * @param {Number} [speed] - The animation speed for the animations.
2772	 */
2773	Autoplay.prototype._next = function(speed) {
2774		this._call = window.setTimeout(
2775			$.proxy(this._next, this, speed),
2776			this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
2777		);
2778
2779		if (this._core.is('interacting') || document.hidden) {
2780			return;
2781		}
2782		this._core.next(speed || this._core.settings.autoplaySpeed);
2783	}
2784
2785	/**
2786	 * Reads the current timer value when the timer is playing.
2787	 * @public
2788	 */
2789	Autoplay.prototype.read = function() {
2790		return new Date().getTime() - this._time;
2791	};
2792
2793	/**
2794	 * Starts the autoplay.
2795	 * @public
2796	 * @param {Number} [timeout] - The interval before the next animation starts.
2797	 * @param {Number} [speed] - The animation speed for the animations.
2798	 */
2799	Autoplay.prototype.play = function(timeout, speed) {
2800		var elapsed;
2801
2802		if (!this._core.is('rotating')) {
2803			this._core.enter('rotating');
2804		}
2805
2806		timeout = timeout || this._core.settings.autoplayTimeout;
2807
2808		// Calculate the elapsed time since the last transition. If the carousel
2809		// wasn't playing this calculation will yield zero.
2810		elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
2811
2812		if (this._paused) {
2813			// Start the clock.
2814			this._time = this.read();
2815			this._paused = false;
2816		} else {
2817			// Clear the active timeout to allow replacement.
2818			window.clearTimeout(this._call);
2819		}
2820
2821		// Adjust the origin of the timer to match the new timeout value.
2822		this._time += this.read() % timeout - elapsed;
2823
2824		this._timeout = timeout;
2825		this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
2826	};
2827
2828	/**
2829	 * Stops the autoplay.
2830	 * @public
2831	 */
2832	Autoplay.prototype.stop = function() {
2833		if (this._core.is('rotating')) {
2834			// Reset the clock.
2835			this._time = 0;
2836			this._paused = true;
2837
2838			window.clearTimeout(this._call);
2839			this._core.leave('rotating');
2840		}
2841	};
2842
2843	/**
2844	 * Pauses the autoplay.
2845	 * @public
2846	 */
2847	Autoplay.prototype.pause = function() {
2848		if (this._core.is('rotating') && !this._paused) {
2849			// Pause the clock.
2850			this._time = this.read();
2851			this._paused = true;
2852
2853			window.clearTimeout(this._call);
2854		}
2855	};
2856
2857	/**
2858	 * Destroys the plugin.
2859	 */
2860	Autoplay.prototype.destroy = function() {
2861		var handler, property;
2862
2863		this.stop();
2864
2865		for (handler in this._handlers) {
2866			this._core.$element.off(handler, this._handlers[handler]);
2867		}
2868		for (property in Object.getOwnPropertyNames(this)) {
2869			typeof this[property] != 'function' && (this[property] = null);
2870		}
2871	};
2872
2873	$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2874
2875})(window.Zepto || window.jQuery, window, document);
2876
2877/**
2878 * Navigation Plugin
2879 * @version 2.3.4
2880 * @author Artus Kolanowski
2881 * @author David Deutsch
2882 * @license The MIT License (MIT)
2883 */
2884;(function($, window, document, undefined) {
2885	'use strict';
2886
2887	/**
2888	 * Creates the navigation plugin.
2889	 * @class The Navigation Plugin
2890	 * @param {Owl} carousel - The Owl Carousel.
2891	 */
2892	var Navigation = function(carousel) {
2893		/**
2894		 * Reference to the core.
2895		 * @protected
2896		 * @type {Owl}
2897		 */
2898		this._core = carousel;
2899
2900		/**
2901		 * Indicates whether the plugin is initialized or not.
2902		 * @protected
2903		 * @type {Boolean}
2904		 */
2905		this._initialized = false;
2906
2907		/**
2908		 * The current paging indexes.
2909		 * @protected
2910		 * @type {Array}
2911		 */
2912		this._pages = [];
2913
2914		/**
2915		 * All DOM elements of the user interface.
2916		 * @protected
2917		 * @type {Object}
2918		 */
2919		this._controls = {};
2920
2921		/**
2922		 * Markup for an indicator.
2923		 * @protected
2924		 * @type {Array.<String>}
2925		 */
2926		this._templates = [];
2927
2928		/**
2929		 * The carousel element.
2930		 * @type {jQuery}
2931		 */
2932		this.$element = this._core.$element;
2933
2934		/**
2935		 * Overridden methods of the carousel.
2936		 * @protected
2937		 * @type {Object}
2938		 */
2939		this._overrides = {
2940			next: this._core.next,
2941			prev: this._core.prev,
2942			to: this._core.to
2943		};
2944
2945		/**
2946		 * All event handlers.
2947		 * @protected
2948		 * @type {Object}
2949		 */
2950		this._handlers = {
2951			'prepared.owl.carousel': $.proxy(function(e) {
2952				if (e.namespace && this._core.settings.dotsData) {
2953					this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
2954						$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
2955				}
2956			}, this),
2957			'added.owl.carousel': $.proxy(function(e) {
2958				if (e.namespace && this._core.settings.dotsData) {
2959					this._templates.splice(e.position, 0, this._templates.pop());
2960				}
2961			}, this),
2962			'remove.owl.carousel': $.proxy(function(e) {
2963				if (e.namespace && this._core.settings.dotsData) {
2964					this._templates.splice(e.position, 1);
2965				}
2966			}, this),
2967			'changed.owl.carousel': $.proxy(function(e) {
2968				if (e.namespace && e.property.name == 'position') {
2969					this.draw();
2970				}
2971			}, this),
2972			'initialized.owl.carousel': $.proxy(function(e) {
2973				if (e.namespace && !this._initialized) {
2974					this._core.trigger('initialize', null, 'navigation');
2975					this.initialize();
2976					this.update();
2977					this.draw();
2978					this._initialized = true;
2979					this._core.trigger('initialized', null, 'navigation');
2980				}
2981			}, this),
2982			'refreshed.owl.carousel': $.proxy(function(e) {
2983				if (e.namespace && this._initialized) {
2984					this._core.trigger('refresh', null, 'navigation');
2985					this.update();
2986					this.draw();
2987					this._core.trigger('refreshed', null, 'navigation');
2988				}
2989			}, this)
2990		};
2991
2992		// set default options
2993		this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2994
2995		// register event handlers
2996		this.$element.on(this._handlers);
2997	};
2998
2999	/**
3000	 * Default options.
3001	 * @public
3002	 * @todo Rename `slideBy` to `navBy`
3003	 */
3004	Navigation.Defaults = {
3005		nav: false,
3006		navText: [
3007			'<span aria-label="' + 'Previous' + '">&#x2039;</span>',
3008			'<span aria-label="' + 'Next' + '">&#x203a;</span>'
3009		],
3010		navSpeed: false,
3011		navElement: 'button type="button" role="presentation"',
3012		navContainer: false,
3013		navContainerClass: 'owl-nav',
3014		navClass: [
3015			'owl-prev',
3016			'owl-next'
3017		],
3018		slideBy: 1,
3019		dotClass: 'owl-dot',
3020		dotsClass: 'owl-dots',
3021		dots: true,
3022		dotsEach: false,
3023		dotsData: false,
3024		dotsSpeed: false,
3025		dotsContainer: false
3026	};
3027
3028	/**
3029	 * Initializes the layout of the plugin and extends the carousel.
3030	 * @protected
3031	 */
3032	Navigation.prototype.initialize = function() {
3033		var override,
3034			settings = this._core.settings;
3035
3036		// create DOM structure for relative navigation
3037		this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
3038			: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
3039
3040		this._controls.$previous = $('<' + settings.navElement + '>')
3041			.addClass(settings.navClass[0])
vendor: 4,756 bytes, lines 3042-3203
3042			.html(settings.navText[0])
3043			.prependTo(this._controls.$relative)
3044			.on('click', $.proxy(function(e) {
3045				this.prev(settings.navSpeed);
3046			}, this));
3047		this._controls.$next = $('<' + settings.navElement + '>')
3048			.addClass(settings.navClass[1])
3049			.html(settings.navText[1])
3050			.appendTo(this._controls.$relative)
3051			.on('click', $.proxy(function(e) {
3052				this.next(settings.navSpeed);
3053			}, this));
3054
3055		// create DOM structure for absolute navigation
3056		if (!settings.dotsData) {
3057			this._templates = [ $('<button role="button">')
3058				.addClass(settings.dotClass)
3059				.append($('<span>'))
3060				.prop('outerHTML') ];
3061		}
3062
3063		this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
3064			: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
3065
3066		this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
3067			var index = $(e.target).parent().is(this._controls.$absolute)
3068				? $(e.target).index() : $(e.target).parent().index();
3069
3070			e.preventDefault();
3071
3072			this.to(index, settings.dotsSpeed);
3073		}, this));
3074
3075		/*$el.on('focusin', function() {
3076			$(document).off(".carousel");
3077
3078			$(document).on('keydown.carousel', function(e) {
3079				if(e.keyCode == 37) {
3080					$el.trigger('prev.owl')
3081				}
3082				if(e.keyCode == 39) {
3083					$el.trigger('next.owl')
3084				}
3085			});
3086		});*/
3087
3088		// override public methods of the carousel
3089		for (override in this._overrides) {
3090			this._core[override] = $.proxy(this[override], this);
3091		}
3092	};
3093
3094	/**
3095	 * Destroys the plugin.
3096	 * @protected
3097	 */
3098	Navigation.prototype.destroy = function() {
3099		var handler, control, property, override, settings;
3100		settings = this._core.settings;
3101
3102		for (handler in this._handlers) {
3103			this.$element.off(handler, this._handlers[handler]);
3104		}
3105		for (control in this._controls) {
3106			if (control === '$relative' && settings.navContainer) {
3107				this._controls[control].html('');
3108			} else {
3109				this._controls[control].remove();
3110			}
3111		}
3112		for (override in this.overides) {
3113			this._core[override] = this._overrides[override];
3114		}
3115		for (property in Object.getOwnPropertyNames(this)) {
3116			typeof this[property] != 'function' && (this[property] = null);
3117		}
3118	};
3119
3120	/**
3121	 * Updates the internal state.
3122	 * @protected
3123	 */
3124	Navigation.prototype.update = function() {
3125		var i, j, k,
3126			lower = this._core.clones().length / 2,
3127			upper = lower + this._core.items().length,
3128			maximum = this._core.maximum(true),
3129			settings = this._core.settings,
3130			size = settings.center || settings.autoWidth || settings.dotsData
3131				? 1 : settings.dotsEach || settings.items;
3132
3133		if (settings.slideBy !== 'page') {
3134			settings.slideBy = Math.min(settings.slideBy, settings.items);
3135		}
3136
3137		if (settings.dots || settings.slideBy == 'page') {
3138			this._pages = [];
3139
3140			for (i = lower, j = 0, k = 0; i < upper; i++) {
3141				if (j >= size || j === 0) {
3142					this._pages.push({
3143						start: Math.min(maximum, i - lower),
3144						end: i - lower + size - 1
3145					});
3146					if (Math.min(maximum, i - lower) === maximum) {
3147						break;
3148					}
3149					j = 0, ++k;
3150				}
3151				j += this._core.mergers(this._core.relative(i));
3152			}
3153		}
3154	};
3155
3156	/**
3157	 * Draws the user interface.
3158	 * @todo The option `dotsData` wont work.
3159	 * @protected
3160	 */
3161	Navigation.prototype.draw = function() {
3162		var difference,
3163			settings = this._core.settings,
3164			disabled = this._core.items().length <= settings.items,
3165			index = this._core.relative(this._core.current()),
3166			loop = settings.loop || settings.rewind;
3167
3168		this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
3169
3170		if (settings.nav) {
3171			this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
3172			this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
3173		}
3174
3175		this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
3176
3177		if (settings.dots) {
3178			difference = this._pages.length - this._controls.$absolute.children().length;
3179
3180			if (settings.dotsData && difference !== 0) {
3181				this._controls.$absolute.html(this._templates.join(''));
3182			} else if (difference > 0) {
3183				this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
3184			} else if (difference < 0) {
3185				this._controls.$absolute.children().slice(difference).remove();
3186			}
3187
3188			this._controls.$absolute.find('.active').removeClass('active');
3189			this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
3190		}
3191	};
3192
3193	/**
3194	 * Extends event data.
3195	 * @protected
3196	 * @param {Event} event - The event object which gets thrown.
3197	 */
3198	Navigation.prototype.onTrigger = function(event) {
3199		var settings = this._core.settings;
3200
3201		event.page = {
3202			index: $.inArray(this.current(), this._pages),
3203			count: this._pages.length,
vendor: 7,284 bytes, lines 3204-3489
3204			size: settings && (settings.center || settings.autoWidth || settings.dotsData
3205				? 1 : settings.dotsEach || settings.items)
3206		};
3207	};
3208
3209	/**
3210	 * Gets the current page position of the carousel.
3211	 * @protected
3212	 * @returns {Number}
3213	 */
3214	Navigation.prototype.current = function() {
3215		var current = this._core.relative(this._core.current());
3216		return $.grep(this._pages, $.proxy(function(page, index) {
3217			return page.start <= current && page.end >= current;
3218		}, this)).pop();
3219	};
3220
3221	/**
3222	 * Gets the current succesor/predecessor position.
3223	 * @protected
3224	 * @returns {Number}
3225	 */
3226	Navigation.prototype.getPosition = function(successor) {
3227		var position, length,
3228			settings = this._core.settings;
3229
3230		if (settings.slideBy == 'page') {
3231			position = $.inArray(this.current(), this._pages);
3232			length = this._pages.length;
3233			successor ? ++position : --position;
3234			position = this._pages[((position % length) + length) % length].start;
3235		} else {
3236			position = this._core.relative(this._core.current());
3237			length = this._core.items().length;
3238			successor ? position += settings.slideBy : position -= settings.slideBy;
3239		}
3240
3241		return position;
3242	};
3243
3244	/**
3245	 * Slides to the next item or page.
3246	 * @public
3247	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
3248	 */
3249	Navigation.prototype.next = function(speed) {
3250		$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3251	};
3252
3253	/**
3254	 * Slides to the previous item or page.
3255	 * @public
3256	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
3257	 */
3258	Navigation.prototype.prev = function(speed) {
3259		$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3260	};
3261
3262	/**
3263	 * Slides to the specified item or page.
3264	 * @public
3265	 * @param {Number} position - The position of the item or page.
3266	 * @param {Number} [speed] - The time in milliseconds for the transition.
3267	 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3268	 */
3269	Navigation.prototype.to = function(position, speed, standard) {
3270		var length;
3271
3272		if (!standard && this._pages.length) {
3273			length = this._pages.length;
3274			$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3275		} else {
3276			$.proxy(this._overrides.to, this._core)(position, speed);
3277		}
3278	};
3279
3280	$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3281
3282})(window.Zepto || window.jQuery, window, document);
3283
3284/**
3285 * Hash Plugin
3286 * @version 2.3.4
3287 * @author Artus Kolanowski
3288 * @author David Deutsch
3289 * @license The MIT License (MIT)
3290 */
3291;(function($, window, document, undefined) {
3292	'use strict';
3293
3294	/**
3295	 * Creates the hash plugin.
3296	 * @class The Hash Plugin
3297	 * @param {Owl} carousel - The Owl Carousel
3298	 */
3299	var Hash = function(carousel) {
3300		/**
3301		 * Reference to the core.
3302		 * @protected
3303		 * @type {Owl}
3304		 */
3305		this._core = carousel;
3306
3307		/**
3308		 * Hash index for the items.
3309		 * @protected
3310		 * @type {Object}
3311		 */
3312		this._hashes = {};
3313
3314		/**
3315		 * The carousel element.
3316		 * @type {jQuery}
3317		 */
3318		this.$element = this._core.$element;
3319
3320		/**
3321		 * All event handlers.
3322		 * @protected
3323		 * @type {Object}
3324		 */
3325		this._handlers = {
3326			'initialized.owl.carousel': $.proxy(function(e) {
3327				if (e.namespace && this._core.settings.startPosition === 'URLHash') {
3328					$(window).trigger('hashchange.owl.navigation');
3329				}
3330			}, this),
3331			'prepared.owl.carousel': $.proxy(function(e) {
3332				if (e.namespace) {
3333					var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
3334
3335					if (!hash) {
3336						return;
3337					}
3338
3339					this._hashes[hash] = e.content;
3340				}
3341			}, this),
3342			'changed.owl.carousel': $.proxy(function(e) {
3343				if (e.namespace && e.property.name === 'position') {
3344					var current = this._core.items(this._core.relative(this._core.current())),
3345						hash = $.map(this._hashes, function(item, hash) {
3346							return item === current ? hash : null;
3347						}).join();
3348
3349					if (!hash || window.location.hash.slice(1) === hash) {
3350						return;
3351					}
3352
3353					window.location.hash = hash;
3354				}
3355			}, this)
3356		};
3357
3358		// set default options
3359		this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3360
3361		// register the event handlers
3362		this.$element.on(this._handlers);
3363
3364		// register event listener for hash navigation
3365		$(window).on('hashchange.owl.navigation', $.proxy(function(e) {
3366			var hash = window.location.hash.substring(1),
3367				items = this._core.$stage.children(),
3368				position = this._hashes[hash] && items.index(this._hashes[hash]);
3369
3370			if (position === undefined || position === this._core.current()) {
3371				return;
3372			}
3373
3374			this._core.to(this._core.relative(position), false, true);
3375		}, this));
3376	};
3377
3378	/**
3379	 * Default options.
3380	 * @public
3381	 */
3382	Hash.Defaults = {
3383		URLhashListener: false
3384	};
3385
3386	/**
3387	 * Destroys the plugin.
3388	 * @public
3389	 */
3390	Hash.prototype.destroy = function() {
3391		var handler, property;
3392
3393		$(window).off('hashchange.owl.navigation');
3394
3395		for (handler in this._handlers) {
3396			this._core.$element.off(handler, this._handlers[handler]);
3397		}
3398		for (property in Object.getOwnPropertyNames(this)) {
3399			typeof this[property] != 'function' && (this[property] = null);
3400		}
3401	};
3402
3403	$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3404
3405})(window.Zepto || window.jQuery, window, document);
3406
3407/**
3408 * Support Plugin
3409 *
3410 * @version 2.3.4
3411 * @author Vivid Planet Software GmbH
3412 * @author Artus Kolanowski
3413 * @author David Deutsch
3414 * @license The MIT License (MIT)
3415 */
3416;(function($, window, document, undefined) {
3417
3418	var style = $('<support>').get(0).style,
3419		prefixes = 'Webkit Moz O ms'.split(' '),
3420		events = {
3421			transition: {
3422				end: {
3423					WebkitTransition: 'webkitTransitionEnd',
3424					MozTransition: 'transitionend',
3425					OTransition: 'oTransitionEnd',
3426					transition: 'transitionend'
3427				}
3428			},
3429			animation: {
3430				end: {
3431					WebkitAnimation: 'webkitAnimationEnd',
3432					MozAnimation: 'animationend',
3433					OAnimation: 'oAnimationEnd',
3434					animation: 'animationend'
3435				}
3436			}
3437		},
3438		tests = {
3439			csstransforms: function() {
3440				return !!test('transform');
3441			},
3442			csstransforms3d: function() {
3443				return !!test('perspective');
3444			},
3445			csstransitions: function() {
3446				return !!test('transition');
3447			},
3448			cssanimations: function() {
3449				return !!test('animation');
3450			}
3451		};
3452
3453	function test(property, prefixed) {
3454		var result = false,
3455			upper = property.charAt(0).toUpperCase() + property.slice(1);
3456
3457		$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
3458			if (style[property] !== undefined) {
3459				result = prefixed ? property : true;
3460				return false;
3461			}
3462		});
3463
3464		return result;
3465	}
3466
3467	function prefixed(property) {
3468		return test(property, true);
3469	}
3470
3471	if (tests.csstransitions()) {
3472		/* jshint -W053 */
3473		$.support.transition = new String(prefixed('transition'))
3474		$.support.transition.end = events.transition.end[ $.support.transition ];
3475	}
3476
3477	if (tests.cssanimations()) {
3478		/* jshint -W053 */
3479		$.support.animation = new String(prefixed('animation'))
3480		$.support.animation.end = events.animation.end[ $.support.animation ];
3481	}
3482
3483	if (tests.csstransforms()) {
3484		/* jshint -W053 */
3485		$.support.transform = new String(prefixed('transform'));
3486		$.support.transform3d = tests.csstransforms3d();
3487	}
3488
3489})(window.Zepto || window.jQuery, window, document);

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.