bootstrap.bundle.js 213 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
Mark Otto's avatar
Mark Otto committed
2
  * Bootstrap v4.1.3 (https://getbootstrap.com/)
Mark Otto's avatar
dist    
Mark Otto committed
3
  * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
Mark Otto's avatar
dist  
Mark Otto committed
4
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
Mark Otto's avatar
dist    
Mark Otto committed
6
(function (global, factory) {
Mark Otto's avatar
dist    
Mark Otto committed
7
8
9
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  (factory((global.bootstrap = {}),global.jQuery));
Mark Otto's avatar
dist    
Mark Otto committed
10
}(this, (function (exports,$) { 'use strict';
Mark Otto's avatar
dist  
Mark Otto committed
11

Mark Otto's avatar
dist    
Mark Otto committed
12
  $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
Mark Otto's avatar
dist  
Mark Otto committed
13

Mark Otto's avatar
dist    
Mark Otto committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
Mark Otto's avatar
Mark Otto committed
28
29
  }

Mark Otto's avatar
dist    
Mark Otto committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }
Mark Otto's avatar
Mark Otto committed
44

Mark Otto's avatar
dist    
Mark Otto committed
45
  function _objectSpread(target) {
Mark Otto's avatar
dist    
Mark Otto committed
46
    for (var i = 1; i < arguments.length; i++) {
Mark Otto's avatar
dist    
Mark Otto committed
47
48
      var source = arguments[i] != null ? arguments[i] : {};
      var ownKeys = Object.keys(source);
Mark Otto's avatar
dist    
Mark Otto committed
49

Mark Otto's avatar
dist    
Mark Otto committed
50
51
52
53
      if (typeof Object.getOwnPropertySymbols === 'function') {
        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        }));
Mark Otto's avatar
dist    
Mark Otto committed
54
      }
Mark Otto's avatar
dist    
Mark Otto committed
55
56
57
58

      ownKeys.forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
59
60
61
    }

    return target;
Mark Otto's avatar
dist    
Mark Otto committed
62
  }
Mark Otto's avatar
Mark Otto committed
63

Mark Otto's avatar
dist    
Mark Otto committed
64
65
66
67
68
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }
Mark Otto's avatar
dist  
Mark Otto committed
69
70

  /**
Mark Otto's avatar
dist    
Mark Otto committed
71
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
72
   * Bootstrap (v4.1.3): util.js
Mark Otto's avatar
dist    
Mark Otto committed
73
74
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
75
   */
Mark Otto's avatar
dist    
Mark Otto committed
76

XhmikosR's avatar
Dist    
XhmikosR committed
77
78
79
80
81
  /**
   * ------------------------------------------------------------------------
   * Private TransitionEnd Helpers
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
82

XhmikosR's avatar
Dist    
XhmikosR committed
83
84
85
  var TRANSITION_END = 'transitionend';
  var MAX_UID = 1000000;
  var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
Mark Otto's avatar
dist  
Mark Otto committed
86

XhmikosR's avatar
Dist    
XhmikosR committed
87
88
89
  function toType(obj) {
    return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  }
Mark Otto's avatar
dist  
Mark Otto committed
90

XhmikosR's avatar
Dist    
XhmikosR committed
91
92
93
94
95
96
97
  function getSpecialTransitionEndEvent() {
    return {
      bindType: TRANSITION_END,
      delegateType: TRANSITION_END,
      handle: function handle(event) {
        if ($(event.target).is(this)) {
          return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
Mark Otto's avatar
dist    
Mark Otto committed
98
        }
Mark Otto's avatar
dist  
Mark Otto committed
99

XhmikosR's avatar
Dist    
XhmikosR committed
100
101
102
103
        return undefined; // eslint-disable-line no-undefined
      }
    };
  }
Mark Otto's avatar
dist  
Mark Otto committed
104

XhmikosR's avatar
Dist    
XhmikosR committed
105
106
  function transitionEndEmulator(duration) {
    var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
107

XhmikosR's avatar
Dist    
XhmikosR committed
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
    var called = false;
    $(this).one(Util.TRANSITION_END, function () {
      called = true;
    });
    setTimeout(function () {
      if (!called) {
        Util.triggerTransitionEnd(_this);
      }
    }, duration);
    return this;
  }

  function setTransitionEndSupport() {
    $.fn.emulateTransitionEnd = transitionEndEmulator;
    $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  }
  /**
   * --------------------------------------------------------------------------
   * Public Util Api
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
129
130


XhmikosR's avatar
Dist    
XhmikosR committed
131
132
133
134
135
136
137
  var Util = {
    TRANSITION_END: 'bsTransitionEnd',
    getUID: function getUID(prefix) {
      do {
        // eslint-disable-next-line no-bitwise
        prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
      } while (document.getElementById(prefix));
Mark Otto's avatar
dist    
Mark Otto committed
138

XhmikosR's avatar
Dist    
XhmikosR committed
139
140
141
142
      return prefix;
    },
    getSelectorFromElement: function getSelectorFromElement(element) {
      var selector = element.getAttribute('data-target');
Mark Otto's avatar
dist    
Mark Otto committed
143

XhmikosR's avatar
Dist    
XhmikosR committed
144
145
146
147
      if (!selector || selector === '#') {
        var hrefAttr = element.getAttribute('href');
        selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
      }
Mark Otto's avatar
dist    
Mark Otto committed
148

XhmikosR's avatar
Dist    
XhmikosR committed
149
150
151
152
153
154
      return selector && document.querySelector(selector) ? selector : null;
    },
    getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
      if (!element) {
        return 0;
      } // Get transition-duration of the element
Mark Otto's avatar
dist    
Mark Otto committed
155
156


XhmikosR's avatar
Dist    
XhmikosR committed
157
158
159
160
      var transitionDuration = $(element).css('transition-duration');
      var transitionDelay = $(element).css('transition-delay');
      var floatTransitionDuration = parseFloat(transitionDuration);
      var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
Mark Otto's avatar
dist    
Mark Otto committed
161

XhmikosR's avatar
Dist    
XhmikosR committed
162
163
164
      if (!floatTransitionDuration && !floatTransitionDelay) {
        return 0;
      } // If multiple durations are defined, take the first
Mark Otto's avatar
dist    
Mark Otto committed
165
166


XhmikosR's avatar
Dist    
XhmikosR committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
      transitionDuration = transitionDuration.split(',')[0];
      transitionDelay = transitionDelay.split(',')[0];
      return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
    },
    reflow: function reflow(element) {
      return element.offsetHeight;
    },
    triggerTransitionEnd: function triggerTransitionEnd(element) {
      $(element).trigger(TRANSITION_END);
    },
    // TODO: Remove in v5
    supportsTransitionEnd: function supportsTransitionEnd() {
      return Boolean(TRANSITION_END);
    },
    isElement: function isElement(obj) {
      return (obj[0] || obj).nodeType;
    },
    typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
      for (var property in configTypes) {
        if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
          var expectedTypes = configTypes[property];
          var value = config[property];
          var valueType = value && Util.isElement(value) ? 'element' : toType(value);

          if (!new RegExp(expectedTypes).test(valueType)) {
            throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
Mark Otto's avatar
dist  
Mark Otto committed
193
194
195
          }
        }
      }
XhmikosR's avatar
Dist    
XhmikosR committed
196
197
198
    }
  };
  setTransitionEndSupport();
Mark Otto's avatar
dist    
Mark Otto committed
199

Mark Otto's avatar
dist  
Mark Otto committed
200
  /**
Mark Otto's avatar
dist    
Mark Otto committed
201
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
202
   * Bootstrap (v4.1.3): alert.js
Mark Otto's avatar
dist    
Mark Otto committed
203
204
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
205
   */
Mark Otto's avatar
dist    
Mark Otto committed
206

XhmikosR's avatar
Dist    
XhmikosR committed
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'alert';
  var VERSION = '4.1.3';
  var DATA_KEY = 'bs.alert';
  var EVENT_KEY = "." + DATA_KEY;
  var DATA_API_KEY = '.data-api';
  var JQUERY_NO_CONFLICT = $.fn[NAME];
  var Selector = {
    DISMISS: '[data-dismiss="alert"]'
  };
  var Event = {
    CLOSE: "close" + EVENT_KEY,
    CLOSED: "closed" + EVENT_KEY,
    CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  };
  var ClassName = {
    ALERT: 'alert',
    FADE: 'fade',
    SHOW: 'show'
Mark Otto's avatar
dist    
Mark Otto committed
231
232
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
233
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
234
235
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
236

XhmikosR's avatar
Dist    
XhmikosR committed
237
  };
Mark Otto's avatar
dist  
Mark Otto committed
238

XhmikosR's avatar
Dist    
XhmikosR committed
239
240
241
242
243
244
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
245
246


XhmikosR's avatar
Dist    
XhmikosR committed
247
    var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
248

XhmikosR's avatar
Dist    
XhmikosR committed
249
250
251
    // Public
    _proto.close = function close(element) {
      var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
252

XhmikosR's avatar
Dist    
XhmikosR committed
253
254
255
      if (element) {
        rootElement = this._getRootElement(element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
256

XhmikosR's avatar
Dist    
XhmikosR committed
257
      var customEvent = this._triggerCloseEvent(rootElement);
Mark Otto's avatar
dist  
Mark Otto committed
258

XhmikosR's avatar
Dist    
XhmikosR committed
259
260
261
      if (customEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
262

XhmikosR's avatar
Dist    
XhmikosR committed
263
264
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
265

XhmikosR's avatar
Dist    
XhmikosR committed
266
267
268
269
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
270
271


XhmikosR's avatar
Dist    
XhmikosR committed
272
273
274
    _proto._getRootElement = function _getRootElement(element) {
      var selector = Util.getSelectorFromElement(element);
      var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
275

XhmikosR's avatar
Dist    
XhmikosR committed
276
277
278
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist  
Mark Otto committed
279

XhmikosR's avatar
Dist    
XhmikosR committed
280
281
282
      if (!parent) {
        parent = $(element).closest("." + ClassName.ALERT)[0];
      }
Mark Otto's avatar
dist  
Mark Otto committed
283

XhmikosR's avatar
Dist    
XhmikosR committed
284
285
      return parent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
286

XhmikosR's avatar
Dist    
XhmikosR committed
287
288
289
290
291
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
      var closeEvent = $.Event(Event.CLOSE);
      $(element).trigger(closeEvent);
      return closeEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
292

XhmikosR's avatar
Dist    
XhmikosR committed
293
294
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
295

XhmikosR's avatar
Dist    
XhmikosR committed
296
      $(element).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
297

XhmikosR's avatar
Dist    
XhmikosR committed
298
299
      if (!$(element).hasClass(ClassName.FADE)) {
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
300

XhmikosR's avatar
Dist    
XhmikosR committed
301
302
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
303

XhmikosR's avatar
Dist    
XhmikosR committed
304
305
306
307
308
      var transitionDuration = Util.getTransitionDurationFromElement(element);
      $(element).one(Util.TRANSITION_END, function (event) {
        return _this._destroyElement(element, event);
      }).emulateTransitionEnd(transitionDuration);
    };
Mark Otto's avatar
dist  
Mark Otto committed
309

XhmikosR's avatar
Dist    
XhmikosR committed
310
311
312
    _proto._destroyElement = function _destroyElement(element) {
      $(element).detach().trigger(Event.CLOSED).remove();
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
313
314


XhmikosR's avatar
Dist    
XhmikosR committed
315
316
317
318
    Alert._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $element = $(this);
        var data = $element.data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
319

XhmikosR's avatar
Dist    
XhmikosR committed
320
321
322
323
        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
324

XhmikosR's avatar
Dist    
XhmikosR committed
325
326
327
328
329
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
330

XhmikosR's avatar
Dist    
XhmikosR committed
331
332
333
334
335
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
336

XhmikosR's avatar
Dist    
XhmikosR committed
337
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
338
      };
XhmikosR's avatar
Dist    
XhmikosR committed
339
    };
Mark Otto's avatar
dist  
Mark Otto committed
340

XhmikosR's avatar
Dist    
XhmikosR committed
341
342
343
344
345
346
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
347

XhmikosR's avatar
Dist    
XhmikosR committed
348
349
350
351
352
353
354
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
355

Mark Otto's avatar
dist    
Mark Otto committed
356

XhmikosR's avatar
Dist    
XhmikosR committed
357
358
359
360
361
362
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
363

XhmikosR's avatar
Dist    
XhmikosR committed
364
365
  $.fn[NAME] = Alert._jQueryInterface;
  $.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
366

XhmikosR's avatar
Dist    
XhmikosR committed
367
368
369
370
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
371
372

  /**
Mark Otto's avatar
dist    
Mark Otto committed
373
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
374
   * Bootstrap (v4.1.3): button.js
Mark Otto's avatar
dist    
Mark Otto committed
375
376
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
377
   */
Mark Otto's avatar
dist    
Mark Otto committed
378

XhmikosR's avatar
Dist    
XhmikosR committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$1 = 'button';
  var VERSION$1 = '4.1.3';
  var DATA_KEY$1 = 'bs.button';
  var EVENT_KEY$1 = "." + DATA_KEY$1;
  var DATA_API_KEY$1 = '.data-api';
  var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  var ClassName$1 = {
    ACTIVE: 'active',
    BUTTON: 'btn',
    FOCUS: 'focus'
  };
  var Selector$1 = {
    DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
    DATA_TOGGLE: '[data-toggle="buttons"]',
    INPUT: 'input',
    ACTIVE: '.active',
    BUTTON: '.btn'
  };
  var Event$1 = {
    CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
    FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
Mark Otto's avatar
dist    
Mark Otto committed
406
407
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
408
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
409
410
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
411

XhmikosR's avatar
Dist    
XhmikosR committed
412
  };
Mark Otto's avatar
dist  
Mark Otto committed
413

XhmikosR's avatar
Dist    
XhmikosR committed
414
415
416
417
418
419
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
420
421


XhmikosR's avatar
Dist    
XhmikosR committed
422
    var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
423

XhmikosR's avatar
Dist    
XhmikosR committed
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
    // Public
    _proto.toggle = function toggle() {
      var triggerChangeEvent = true;
      var addAriaPressed = true;
      var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];

      if (rootElement) {
        var input = this._element.querySelector(Selector$1.INPUT);

        if (input) {
          if (input.type === 'radio') {
            if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
              triggerChangeEvent = false;
            } else {
              var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
439

XhmikosR's avatar
Dist    
XhmikosR committed
440
441
              if (activeElement) {
                $(activeElement).removeClass(ClassName$1.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
442
              }
XhmikosR's avatar
Dist    
XhmikosR committed
443
444
            }
          }
Mark Otto's avatar
dist    
Mark Otto committed
445

XhmikosR's avatar
Dist    
XhmikosR committed
446
447
448
          if (triggerChangeEvent) {
            if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
              return;
Mark Otto's avatar
dist  
Mark Otto committed
449
            }
Mark Otto's avatar
dist    
Mark Otto committed
450

XhmikosR's avatar
Dist    
XhmikosR committed
451
452
            input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
            $(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
453
454
          }

XhmikosR's avatar
Dist    
XhmikosR committed
455
456
          input.focus();
          addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
457
        }
XhmikosR's avatar
Dist    
XhmikosR committed
458
      }
Mark Otto's avatar
dist  
Mark Otto committed
459

XhmikosR's avatar
Dist    
XhmikosR committed
460
461
462
      if (addAriaPressed) {
        this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
      }
Mark Otto's avatar
dist  
Mark Otto committed
463

XhmikosR's avatar
Dist    
XhmikosR committed
464
465
466
467
      if (triggerChangeEvent) {
        $(this._element).toggleClass(ClassName$1.ACTIVE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
468

XhmikosR's avatar
Dist    
XhmikosR committed
469
470
471
472
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$1);
      this._element = null;
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
473
474


XhmikosR's avatar
Dist    
XhmikosR committed
475
476
477
    Button._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$1);
Mark Otto's avatar
dist  
Mark Otto committed
478

XhmikosR's avatar
Dist    
XhmikosR committed
479
480
481
482
        if (!data) {
          data = new Button(this);
          $(this).data(DATA_KEY$1, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
483

XhmikosR's avatar
Dist    
XhmikosR committed
484
485
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
486
        }
XhmikosR's avatar
Dist    
XhmikosR committed
487
488
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
489

XhmikosR's avatar
Dist    
XhmikosR committed
490
491
492
493
494
495
    _createClass(Button, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$1;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
496

XhmikosR's avatar
Dist    
XhmikosR committed
497
498
499
500
501
502
503
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
504
505


XhmikosR's avatar
Dist    
XhmikosR committed
506
507
508
  $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
    event.preventDefault();
    var button = event.target;
Mark Otto's avatar
dist  
Mark Otto committed
509

XhmikosR's avatar
Dist    
XhmikosR committed
510
511
512
    if (!$(button).hasClass(ClassName$1.BUTTON)) {
      button = $(button).closest(Selector$1.BUTTON);
    }
Mark Otto's avatar
dist    
Mark Otto committed
513

XhmikosR's avatar
Dist    
XhmikosR committed
514
515
516
517
518
519
520
521
522
523
    Button._jQueryInterface.call($(button), 'toggle');
  }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
    var button = $(event.target).closest(Selector$1.BUTTON)[0];
    $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
524

XhmikosR's avatar
Dist    
XhmikosR committed
525
526
  $.fn[NAME$1] = Button._jQueryInterface;
  $.fn[NAME$1].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
527

XhmikosR's avatar
Dist    
XhmikosR committed
528
529
530
531
  $.fn[NAME$1].noConflict = function () {
    $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
532
533

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
534
535
536
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
537
   */
Mark Otto's avatar
dist    
Mark Otto committed
538

XhmikosR's avatar
Dist    
XhmikosR committed
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
  var NAME$2 = 'carousel';
  var VERSION$2 = '4.1.3';
  var DATA_KEY$2 = 'bs.carousel';
  var EVENT_KEY$2 = "." + DATA_KEY$2;
  var DATA_API_KEY$2 = '.data-api';
  var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key

  var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key

  var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch

  var SWIPE_THRESHOLD = 40;
  var Default = {
    interval: 5000,
    keyboard: true,
    slide: false,
    pause: 'hover',
    wrap: true,
    touch: true
  };
  var DefaultType = {
    interval: '(number|boolean)',
    keyboard: 'boolean',
    slide: '(boolean|string)',
    pause: '(string|boolean)',
    wrap: 'boolean',
    touch: 'boolean'
  };
  var Direction = {
    NEXT: 'next',
    PREV: 'prev',
    LEFT: 'left',
    RIGHT: 'right'
  };
  var Event$2 = {
    SLIDE: "slide" + EVENT_KEY$2,
    SLID: "slid" + EVENT_KEY$2,
    KEYDOWN: "keydown" + EVENT_KEY$2,
    MOUSEENTER: "mouseenter" + EVENT_KEY$2,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
    TOUCHSTART: "touchstart" + EVENT_KEY$2,
    TOUCHMOVE: "touchmove" + EVENT_KEY$2,
    TOUCHEND: "touchend" + EVENT_KEY$2,
    POINTERDOWN: "pointerdown" + EVENT_KEY$2,
    POINTERMOVE: "pointermove" + EVENT_KEY$2,
    POINTERUP: "pointerup" + EVENT_KEY$2,
    POINTERLEAVE: "pointerleave" + EVENT_KEY$2,
    POINTERCANCEL: "pointercancel" + EVENT_KEY$2,
    DRAG_START: "dragstart" + EVENT_KEY$2,
    LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
    CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  };
  var ClassName$2 = {
    CAROUSEL: 'carousel',
    ACTIVE: 'active',
    SLIDE: 'slide',
    RIGHT: 'carousel-item-right',
    LEFT: 'carousel-item-left',
    NEXT: 'carousel-item-next',
    PREV: 'carousel-item-prev',
    ITEM: 'carousel-item',
    POINTER_EVENT: 'pointer-event'
  };
  var Selector$2 = {
    ACTIVE: '.active',
    ACTIVE_ITEM: '.active.carousel-item',
    ITEM: '.carousel-item',
    ITEM_IMG: '.carousel-item img',
    NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
    INDICATORS: '.carousel-indicators',
    DATA_SLIDE: '[data-slide], [data-slide-to]',
    DATA_RIDE: '[data-ride="carousel"]'
  };
  var PointerType = {
    TOUCH: 'touch',
    PEN: 'pen'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
619
620
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
621

XhmikosR's avatar
Dist    
XhmikosR committed
622
  };
Mark Otto's avatar
dist    
Mark Otto committed
623

XhmikosR's avatar
Dist    
XhmikosR committed
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
  var Carousel =
  /*#__PURE__*/
  function () {
    function Carousel(element, config) {
      this._items = null;
      this._interval = null;
      this._activeElement = null;
      this._isPaused = false;
      this._isSliding = false;
      this.touchTimeout = null;
      this.touchStartX = 0;
      this.touchDeltaX = 0;
      this._config = this._getConfig(config);
      this._element = element;
      this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
      this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
      this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);

      this._addEventListeners();
    } // Getters


    var _proto = Carousel.prototype;

    // Public
    _proto.next = function next() {
      if (!this._isSliding) {
        this._slide(Direction.NEXT);
      }
Mark Otto's avatar
dist    
Mark Otto committed
653
    };
Mark Otto's avatar
dist  
Mark Otto committed
654

XhmikosR's avatar
Dist    
XhmikosR committed
655
656
657
658
659
660
    _proto.nextWhenVisible = function nextWhenVisible() {
      // Don't call next when the page isn't visible
      // or the carousel or its parent isn't visible
      if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
        this.next();
      }
Mark Otto's avatar
dist  
Mark Otto committed
661
662
    };

XhmikosR's avatar
Dist    
XhmikosR committed
663
664
665
666
667
    _proto.prev = function prev() {
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
668

XhmikosR's avatar
Dist    
XhmikosR committed
669
670
671
672
    _proto.pause = function pause(event) {
      if (!event) {
        this._isPaused = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
673

XhmikosR's avatar
Dist    
XhmikosR committed
674
675
676
677
      if (this._element.querySelector(Selector$2.NEXT_PREV)) {
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
678

XhmikosR's avatar
Dist    
XhmikosR committed
679
680
681
      clearInterval(this._interval);
      this._interval = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
682

XhmikosR's avatar
Dist    
XhmikosR committed
683
684
685
686
    _proto.cycle = function cycle(event) {
      if (!event) {
        this._isPaused = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
687

XhmikosR's avatar
Dist    
XhmikosR committed
688
      if (this._interval) {
Mark Otto's avatar
dist    
Mark Otto committed
689
690
        clearInterval(this._interval);
        this._interval = null;
XhmikosR's avatar
Dist    
XhmikosR committed
691
      }
Mark Otto's avatar
dist  
Mark Otto committed
692

XhmikosR's avatar
Dist    
XhmikosR committed
693
694
695
696
      if (this._config.interval && !this._isPaused) {
        this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
697

XhmikosR's avatar
Dist    
XhmikosR committed
698
699
    _proto.to = function to(index) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
700

XhmikosR's avatar
Dist    
XhmikosR committed
701
      this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist    
Mark Otto committed
702

XhmikosR's avatar
Dist    
XhmikosR committed
703
      var activeIndex = this._getItemIndex(this._activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
704

XhmikosR's avatar
Dist    
XhmikosR committed
705
706
707
      if (index > this._items.length - 1 || index < 0) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
708

XhmikosR's avatar
Dist    
XhmikosR committed
709
710
711
712
713
714
      if (this._isSliding) {
        $(this._element).one(Event$2.SLID, function () {
          return _this.to(index);
        });
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
715

XhmikosR's avatar
Dist    
XhmikosR committed
716
717
718
719
720
      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
721

XhmikosR's avatar
Dist    
XhmikosR committed
722
      var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
Mark Otto's avatar
dist  
Mark Otto committed
723

XhmikosR's avatar
Dist    
XhmikosR committed
724
725
      this._slide(direction, this._items[index]);
    };
Mark Otto's avatar
dist  
Mark Otto committed
726

XhmikosR's avatar
Dist    
XhmikosR committed
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
    _proto.dispose = function dispose() {
      $(this._element).off(EVENT_KEY$2);
      $.removeData(this._element, DATA_KEY$2);
      this._items = null;
      this._config = null;
      this._element = null;
      this._interval = null;
      this._isPaused = null;
      this._isSliding = null;
      this._activeElement = null;
      this._indicatorsElement = null;
    }; // Private


    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default, config);
      Util.typeCheckConfig(NAME$2, config, DefaultType);
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
746

XhmikosR's avatar
Dist    
XhmikosR committed
747
748
    _proto._handleSwipe = function _handleSwipe() {
      var absDeltax = Math.abs(this.touchDeltaX);
Mark Otto's avatar
dist    
Mark Otto committed
749

XhmikosR's avatar
Dist    
XhmikosR committed
750
751
752
      if (absDeltax <= SWIPE_THRESHOLD) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
753

XhmikosR's avatar
Dist    
XhmikosR committed
754
      var direction = absDeltax / this.touchDeltaX; // swipe left
Mark Otto's avatar
dist    
Mark Otto committed
755

XhmikosR's avatar
Dist    
XhmikosR committed
756
757
758
      if (direction > 0) {
        this.prev();
      } // swipe right
Mark Otto's avatar
dist    
Mark Otto committed
759

Mark Otto's avatar
dist    
Mark Otto committed
760

XhmikosR's avatar
Dist    
XhmikosR committed
761
762
763
764
      if (direction < 0) {
        this.next();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
765

XhmikosR's avatar
Dist    
XhmikosR committed
766
767
    _proto._addEventListeners = function _addEventListeners() {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
768

XhmikosR's avatar
Dist    
XhmikosR committed
769
770
771
772
773
      if (this._config.keyboard) {
        $(this._element).on(Event$2.KEYDOWN, function (event) {
          return _this2._keydown(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
774

XhmikosR's avatar
Dist    
XhmikosR committed
775
776
777
778
779
780
781
      if (this._config.pause === 'hover') {
        $(this._element).on(Event$2.MOUSEENTER, function (event) {
          return _this2.pause(event);
        }).on(Event$2.MOUSELEAVE, function (event) {
          return _this2.cycle(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
782

XhmikosR's avatar
Dist    
XhmikosR committed
783
784
      this._addTouchEventListeners();
    };
Mark Otto's avatar
dist  
Mark Otto committed
785

XhmikosR's avatar
Dist    
XhmikosR committed
786
787
    _proto._addTouchEventListeners = function _addTouchEventListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
788

XhmikosR's avatar
Dist    
XhmikosR committed
789
790
791
      if (!this._touchSupported) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
792

XhmikosR's avatar
Dist    
XhmikosR committed
793
794
795
796
797
      var start = function start(event) {
        if (_this3._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
          _this3.touchStartX = event.originalEvent.clientX;
        } else if (!_this3._pointerEvent) {
          _this3.touchStartX = event.originalEvent.touches[0].clientX;
Mark Otto's avatar
dist    
Mark Otto committed
798
799
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
800

XhmikosR's avatar
Dist    
XhmikosR committed
801
802
803
804
805
806
807
      var move = function move(event) {
        // ensure swiping with one touch and not pinching
        if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
          _this3.touchDeltaX = 0;
        } else {
          _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
        }
Mark Otto's avatar
dist    
Mark Otto committed
808
      };
Mark Otto's avatar
dist    
Mark Otto committed
809

XhmikosR's avatar
Dist    
XhmikosR committed
810
811
812
813
814
815
      var end = function end(event) {
        if (_this3._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
          _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
        }

        _this3._handleSwipe();
Mark Otto's avatar
dist    
Mark Otto committed
816

XhmikosR's avatar
Dist    
XhmikosR committed
817
818
819
820
821
822
823
824
825
        if (_this3._config.pause === 'hover') {
          // If it's a touch-enabled device, mouseenter/leave are fired as
          // part of the mouse compatibility events on first tap - the carousel
          // would stop cycling until user tapped out of it;
          // here, we listen for touchend, explicitly pause the carousel
          // (as if it's the second time we tap on it, mouseenter compat event
          // is NOT fired) and after a timeout (to allow for mouse compatibility
          // events to fire) we explicitly restart cycling
          _this3.pause();
Mark Otto's avatar
dist  
Mark Otto committed
826

XhmikosR's avatar
Dist    
XhmikosR committed
827
828
829
          if (_this3.touchTimeout) {
            clearTimeout(_this3.touchTimeout);
          }
Mark Otto's avatar
dist  
Mark Otto committed
830

XhmikosR's avatar
Dist    
XhmikosR committed
831
832
833
          _this3.touchTimeout = setTimeout(function (event) {
            return _this3.cycle(event);
          }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
Mark Otto's avatar
dist    
Mark Otto committed
834
835
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
836

XhmikosR's avatar
Dist    
XhmikosR committed
837
838
839
      $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
        return e.preventDefault();
      });
Mark Otto's avatar
dist    
Mark Otto committed
840

XhmikosR's avatar
Dist    
XhmikosR committed
841
842
843
844
845
846
847
      if (this._pointerEvent) {
        $(this._element).on(Event$2.POINTERDOWN, function (event) {
          return start(event);
        });
        $(this._element).on(Event$2.POINTERUP, function (event) {
          return end(event);
        });
Mark Otto's avatar
dist    
Mark Otto committed
848

XhmikosR's avatar
Dist    
XhmikosR committed
849
850
851
852
        this._element.classList.add(ClassName$2.POINTER_EVENT);
      } else {
        $(this._element).on(Event$2.TOUCHSTART, function (event) {
          return start(event);
Mark Otto's avatar
dist    
Mark Otto committed
853
        });
XhmikosR's avatar
Dist    
XhmikosR committed
854
855
856
857
858
859
860
861
        $(this._element).on(Event$2.TOUCHMOVE, function (event) {
          return move(event);
        });
        $(this._element).on(Event$2.TOUCHEND, function (event) {
          return end(event);
        });
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
862

XhmikosR's avatar
Dist    
XhmikosR committed
863
864
865
866
    _proto._keydown = function _keydown(event) {
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
867

XhmikosR's avatar
Dist    
XhmikosR committed
868
869
870
871
872
      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
873

XhmikosR's avatar
Dist    
XhmikosR committed
874
875
876
877
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
878

XhmikosR's avatar
Dist    
XhmikosR committed
879
880
881
        default:
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
882

XhmikosR's avatar
Dist    
XhmikosR committed
883
884
885
886
    _proto._getItemIndex = function _getItemIndex(element) {
      this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
      return this._items.indexOf(element);
    };
Mark Otto's avatar
dist    
Mark Otto committed
887

XhmikosR's avatar
Dist    
XhmikosR committed
888
889
890
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
891

XhmikosR's avatar
Dist    
XhmikosR committed
892
      var activeIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
893

XhmikosR's avatar
Dist    
XhmikosR committed
894
895
      var lastItemIndex = this._items.length - 1;
      var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
Mark Otto's avatar
dist  
Mark Otto committed
896

XhmikosR's avatar
Dist    
XhmikosR committed
897
898
899
      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
900

XhmikosR's avatar
Dist    
XhmikosR committed
901
902
903
904
      var delta = direction === Direction.PREV ? -1 : 1;
      var itemIndex = (activeIndex + delta) % this._items.length;
      return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
    };
Mark Otto's avatar
dist  
Mark Otto committed
905

XhmikosR's avatar
Dist    
XhmikosR committed
906
907
    _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
      var targetIndex = this._getItemIndex(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
908

XhmikosR's avatar
Dist    
XhmikosR committed
909
      var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
Mark Otto's avatar
dist    
Mark Otto committed
910

XhmikosR's avatar
Dist    
XhmikosR committed
911
912
913
914
915
916
917
918
919
      var slideEvent = $.Event(Event$2.SLIDE, {
        relatedTarget: relatedTarget,
        direction: eventDirectionName,
        from: fromIndex,
        to: targetIndex
      });
      $(this._element).trigger(slideEvent);
      return slideEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
920

XhmikosR's avatar
Dist    
XhmikosR committed
921
922
923
924
    _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
      if (this._indicatorsElement) {
        var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
        $(indicators).removeClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
925

XhmikosR's avatar
Dist    
XhmikosR committed
926
        var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
Mark Otto's avatar
dist  
Mark Otto committed
927

XhmikosR's avatar
Dist    
XhmikosR committed
928
929
        if (nextIndicator) {
          $(nextIndicator).addClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
930
        }
XhmikosR's avatar
Dist    
XhmikosR committed
931
932
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
933

XhmikosR's avatar
Dist    
XhmikosR committed
934
935
    _proto._slide = function _slide(direction, element) {
      var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
936

XhmikosR's avatar
Dist    
XhmikosR committed
937
      var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist  
Mark Otto committed
938

XhmikosR's avatar
Dist    
XhmikosR committed
939
      var activeElementIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
940

XhmikosR's avatar
Dist    
XhmikosR committed
941
      var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
942

XhmikosR's avatar
Dist    
XhmikosR committed
943
      var nextElementIndex = this._getItemIndex(nextElement);
Mark Otto's avatar
dist  
Mark Otto committed
944

XhmikosR's avatar
Dist    
XhmikosR committed
945
946
947
948
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
949

XhmikosR's avatar
Dist    
XhmikosR committed
950
951
952
953
954
955
956
957
958
      if (direction === Direction.NEXT) {
        directionalClassName = ClassName$2.LEFT;
        orderClassName = ClassName$2.NEXT;
        eventDirectionName = Direction.LEFT;
      } else {
        directionalClassName = ClassName$2.RIGHT;
        orderClassName = ClassName$2.PREV;
        eventDirectionName = Direction.RIGHT;
      }
Mark Otto's avatar
dist  
Mark Otto committed
959

XhmikosR's avatar
Dist    
XhmikosR committed
960
961
962
963
      if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
        this._isSliding = false;
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
964

XhmikosR's avatar
Dist    
XhmikosR committed
965
      var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
Mark Otto's avatar
dist  
Mark Otto committed
966

XhmikosR's avatar
Dist    
XhmikosR committed
967
968
969
      if (slideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
970

XhmikosR's avatar
Dist    
XhmikosR committed
971
972
973
974
      if (!activeElement || !nextElement) {
        // Some weirdness is happening, so we bail
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
975

XhmikosR's avatar
Dist    
XhmikosR committed
976
      this._isSliding = true;
Mark Otto's avatar
dist    
Mark Otto committed
977

XhmikosR's avatar
Dist    
XhmikosR committed
978
979
980
      if (isCycling) {
        this.pause();
      }
Mark Otto's avatar
dist  
Mark Otto committed
981

XhmikosR's avatar
Dist    
XhmikosR committed
982
      this._setActiveIndicatorElement(nextElement);
Mark Otto's avatar
dist    
Mark Otto committed
983

XhmikosR's avatar
Dist    
XhmikosR committed
984
985
986
987
988
989
      var slidEvent = $.Event(Event$2.SLID, {
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
Mark Otto's avatar
dist    
Mark Otto committed
990

XhmikosR's avatar
Dist    
XhmikosR committed
991
992
993
994
995
996
997
998
999
1000
      if ($(this._element).hasClass(ClassName$2.SLIDE)) {
        $(nextElement).addClass(orderClassName);
        Util.reflow(nextElement);
        $(activeElement).addClass(directionalClassName);
        $(nextElement).addClass(directionalClassName);
        var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);

        if (nextElementInterval) {
          this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
          this._config.interval = nextElementInterval;
For faster browsing, not all history is shown. View entire blame