bootstrap.bundle.js 212 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
Mark Otto's avatar
Mark Otto committed
2
  * Bootstrap v4.2.1 (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.2.1): 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
   */
XhmikosR's avatar
Dist    
XhmikosR committed
76
77
78
79
80
  /**
   * ------------------------------------------------------------------------
   * Private TransitionEnd Helpers
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
81

XhmikosR's avatar
Dist    
XhmikosR committed
82
83
84
  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
85

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

XhmikosR's avatar
Dist    
XhmikosR committed
90
91
92
93
94
95
96
  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
97
        }
Mark Otto's avatar
dist  
Mark Otto committed
98

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    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
128
129


XhmikosR's avatar
Dist    
XhmikosR committed
130
131
132
133
134
135
136
  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
137

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
148
149
150
151
152
153
      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
154
155


XhmikosR's avatar
Dist    
XhmikosR committed
156
157
158
159
      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
160

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


XhmikosR's avatar
Dist    
XhmikosR committed
166
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
      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
192
193
194
          }
        }
      }
Mark Otto's avatar
dist    
Mark Otto committed
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
    },
    findShadowRoot: function findShadowRoot(element) {
      if (!document.documentElement.attachShadow) {
        return null;
      } // Can find the shadow root otherwise it'll return the document


      if (typeof element.getRootNode === 'function') {
        var root = element.getRootNode();
        return root instanceof ShadowRoot ? root : null;
      }

      if (element instanceof ShadowRoot) {
        return element;
      } // when we don't find a shadow root


      if (!element.parentNode) {
        return null;
      }

      return Util.findShadowRoot(element.parentNode);
XhmikosR's avatar
Dist    
XhmikosR committed
217
218
219
    }
  };
  setTransitionEndSupport();
Mark Otto's avatar
dist    
Mark Otto committed
220

XhmikosR's avatar
Dist    
XhmikosR committed
221
222
223
224
225
226
227
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'alert';
Mark Otto's avatar
Mark Otto committed
228
  var VERSION = '4.2.1';
XhmikosR's avatar
Dist    
XhmikosR committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
  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
245
246
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
247
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
248
249
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
250

XhmikosR's avatar
Dist    
XhmikosR committed
251
  };
Mark Otto's avatar
dist  
Mark Otto committed
252

XhmikosR's avatar
Dist    
XhmikosR committed
253
254
255
256
257
258
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
259
260


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

XhmikosR's avatar
Dist    
XhmikosR committed
263
264
265
    // Public
    _proto.close = function close(element) {
      var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
266

XhmikosR's avatar
Dist    
XhmikosR committed
267
268
269
      if (element) {
        rootElement = this._getRootElement(element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
270

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

XhmikosR's avatar
Dist    
XhmikosR committed
273
274
275
      if (customEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
276

XhmikosR's avatar
Dist    
XhmikosR committed
277
278
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
279

XhmikosR's avatar
Dist    
XhmikosR committed
280
281
282
283
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
284
285


XhmikosR's avatar
Dist    
XhmikosR committed
286
287
288
    _proto._getRootElement = function _getRootElement(element) {
      var selector = Util.getSelectorFromElement(element);
      var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
289

XhmikosR's avatar
Dist    
XhmikosR committed
290
291
292
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist  
Mark Otto committed
293

XhmikosR's avatar
Dist    
XhmikosR committed
294
295
296
      if (!parent) {
        parent = $(element).closest("." + ClassName.ALERT)[0];
      }
Mark Otto's avatar
dist  
Mark Otto committed
297

XhmikosR's avatar
Dist    
XhmikosR committed
298
299
      return parent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
300

XhmikosR's avatar
Dist    
XhmikosR committed
301
302
303
304
305
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
      var closeEvent = $.Event(Event.CLOSE);
      $(element).trigger(closeEvent);
      return closeEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
306

XhmikosR's avatar
Dist    
XhmikosR committed
307
308
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
309

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

XhmikosR's avatar
Dist    
XhmikosR committed
312
313
      if (!$(element).hasClass(ClassName.FADE)) {
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
314

XhmikosR's avatar
Dist    
XhmikosR committed
315
316
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
317

XhmikosR's avatar
Dist    
XhmikosR committed
318
319
320
321
322
      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
323

XhmikosR's avatar
Dist    
XhmikosR committed
324
325
326
    _proto._destroyElement = function _destroyElement(element) {
      $(element).detach().trigger(Event.CLOSED).remove();
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
327
328


XhmikosR's avatar
Dist    
XhmikosR committed
329
330
331
332
    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
333

XhmikosR's avatar
Dist    
XhmikosR committed
334
335
336
337
        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
338

XhmikosR's avatar
Dist    
XhmikosR committed
339
340
341
342
343
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
344

XhmikosR's avatar
Dist    
XhmikosR committed
345
346
347
348
349
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
350

XhmikosR's avatar
Dist    
XhmikosR committed
351
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
352
      };
XhmikosR's avatar
Dist    
XhmikosR committed
353
    };
Mark Otto's avatar
dist  
Mark Otto committed
354

XhmikosR's avatar
Dist    
XhmikosR committed
355
356
357
358
359
360
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
361

XhmikosR's avatar
Dist    
XhmikosR committed
362
363
364
365
366
367
368
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
369

Mark Otto's avatar
dist    
Mark Otto committed
370

XhmikosR's avatar
Dist    
XhmikosR committed
371
372
373
374
375
376
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
377

XhmikosR's avatar
Dist    
XhmikosR committed
378
379
  $.fn[NAME] = Alert._jQueryInterface;
  $.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
380

XhmikosR's avatar
Dist    
XhmikosR committed
381
382
383
384
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
385

XhmikosR's avatar
Dist    
XhmikosR committed
386
387
388
389
390
391
392
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$1 = 'button';
Mark Otto's avatar
Mark Otto committed
393
  var VERSION$1 = '4.2.1';
XhmikosR's avatar
Dist    
XhmikosR committed
394
395
396
397
398
399
400
401
402
403
404
405
  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"]',
Mark Otto's avatar
dist    
Mark Otto committed
406
    INPUT: 'input:not([type="hidden"])',
XhmikosR's avatar
Dist    
XhmikosR committed
407
408
409
410
411
412
    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
413
414
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
415
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
416
417
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
418

XhmikosR's avatar
Dist    
XhmikosR committed
419
  };
Mark Otto's avatar
dist  
Mark Otto committed
420

XhmikosR's avatar
Dist    
XhmikosR committed
421
422
423
424
425
426
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
427
428


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

XhmikosR's avatar
Dist    
XhmikosR committed
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
    // 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
446

XhmikosR's avatar
Dist    
XhmikosR committed
447
448
              if (activeElement) {
                $(activeElement).removeClass(ClassName$1.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
449
              }
XhmikosR's avatar
Dist    
XhmikosR committed
450
451
            }
          }
Mark Otto's avatar
dist    
Mark Otto committed
452

XhmikosR's avatar
Dist    
XhmikosR committed
453
454
455
          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
456
            }
Mark Otto's avatar
dist    
Mark Otto committed
457

XhmikosR's avatar
Dist    
XhmikosR committed
458
459
            input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
            $(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
460
461
          }

XhmikosR's avatar
Dist    
XhmikosR committed
462
463
          input.focus();
          addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
464
        }
XhmikosR's avatar
Dist    
XhmikosR committed
465
      }
Mark Otto's avatar
dist  
Mark Otto committed
466

XhmikosR's avatar
Dist    
XhmikosR committed
467
468
469
      if (addAriaPressed) {
        this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
      }
Mark Otto's avatar
dist  
Mark Otto committed
470

XhmikosR's avatar
Dist    
XhmikosR committed
471
472
473
474
      if (triggerChangeEvent) {
        $(this._element).toggleClass(ClassName$1.ACTIVE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
475

XhmikosR's avatar
Dist    
XhmikosR committed
476
477
478
479
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$1);
      this._element = null;
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
480
481


XhmikosR's avatar
Dist    
XhmikosR committed
482
483
484
    Button._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$1);
Mark Otto's avatar
dist  
Mark Otto committed
485

XhmikosR's avatar
Dist    
XhmikosR committed
486
487
488
489
        if (!data) {
          data = new Button(this);
          $(this).data(DATA_KEY$1, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
490

XhmikosR's avatar
Dist    
XhmikosR committed
491
492
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
493
        }
XhmikosR's avatar
Dist    
XhmikosR committed
494
495
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
496

XhmikosR's avatar
Dist    
XhmikosR committed
497
498
499
500
501
502
    _createClass(Button, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$1;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
503

XhmikosR's avatar
Dist    
XhmikosR committed
504
505
506
507
508
509
510
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
511
512


XhmikosR's avatar
Dist    
XhmikosR committed
513
514
515
  $(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
516

XhmikosR's avatar
Dist    
XhmikosR committed
517
518
519
    if (!$(button).hasClass(ClassName$1.BUTTON)) {
      button = $(button).closest(Selector$1.BUTTON);
    }
Mark Otto's avatar
dist    
Mark Otto committed
520

XhmikosR's avatar
Dist    
XhmikosR committed
521
522
523
524
525
526
527
528
529
530
    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
531

XhmikosR's avatar
Dist    
XhmikosR committed
532
533
  $.fn[NAME$1] = Button._jQueryInterface;
  $.fn[NAME$1].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
534

XhmikosR's avatar
Dist    
XhmikosR committed
535
536
537
538
  $.fn[NAME$1].noConflict = function () {
    $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
539
540

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
541
542
543
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
544
   */
Mark Otto's avatar
dist    
Mark Otto committed
545

XhmikosR's avatar
Dist    
XhmikosR committed
546
  var NAME$2 = 'carousel';
Mark Otto's avatar
Mark Otto committed
547
  var VERSION$2 = '4.2.1';
XhmikosR's avatar
Dist    
XhmikosR committed
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
619
620
621
622
  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,
    POINTERUP: "pointerup" + 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
623
624
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
625

XhmikosR's avatar
Dist    
XhmikosR committed
626
  };
Mark Otto's avatar
dist    
Mark Otto committed
627

XhmikosR's avatar
Dist    
XhmikosR committed
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
653
654
655
656
  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
657
    };
Mark Otto's avatar
dist  
Mark Otto committed
658

XhmikosR's avatar
Dist    
XhmikosR committed
659
660
661
662
663
664
    _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
665
666
    };

XhmikosR's avatar
Dist    
XhmikosR committed
667
668
669
670
671
    _proto.prev = function prev() {
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
672

XhmikosR's avatar
Dist    
XhmikosR committed
673
674
675
676
    _proto.pause = function pause(event) {
      if (!event) {
        this._isPaused = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
677

XhmikosR's avatar
Dist    
XhmikosR committed
678
679
680
681
      if (this._element.querySelector(Selector$2.NEXT_PREV)) {
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
682

XhmikosR's avatar
Dist    
XhmikosR committed
683
684
685
      clearInterval(this._interval);
      this._interval = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
686

XhmikosR's avatar
Dist    
XhmikosR committed
687
688
689
690
    _proto.cycle = function cycle(event) {
      if (!event) {
        this._isPaused = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
691

XhmikosR's avatar
Dist    
XhmikosR committed
692
      if (this._interval) {
Mark Otto's avatar
dist    
Mark Otto committed
693
694
        clearInterval(this._interval);
        this._interval = null;
XhmikosR's avatar
Dist    
XhmikosR committed
695
      }
Mark Otto's avatar
dist  
Mark Otto committed
696

XhmikosR's avatar
Dist    
XhmikosR committed
697
698
699
700
      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
701

XhmikosR's avatar
Dist    
XhmikosR committed
702
703
    _proto.to = function to(index) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
704

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
709
710
711
      if (index > this._items.length - 1 || index < 0) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
712

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

XhmikosR's avatar
Dist    
XhmikosR committed
720
721
722
723
724
      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
725

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

XhmikosR's avatar
Dist    
XhmikosR committed
728
729
      this._slide(direction, this._items[index]);
    };
Mark Otto's avatar
dist  
Mark Otto committed
730

XhmikosR's avatar
Dist    
XhmikosR committed
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
    _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
750

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

XhmikosR's avatar
Dist    
XhmikosR committed
754
755
756
      if (absDeltax <= SWIPE_THRESHOLD) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
757

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

XhmikosR's avatar
Dist    
XhmikosR committed
760
761
762
      if (direction > 0) {
        this.prev();
      } // swipe right
Mark Otto's avatar
dist    
Mark Otto committed
763

Mark Otto's avatar
dist    
Mark Otto committed
764

XhmikosR's avatar
Dist    
XhmikosR committed
765
766
767
768
      if (direction < 0) {
        this.next();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
769

XhmikosR's avatar
Dist    
XhmikosR committed
770
771
    _proto._addEventListeners = function _addEventListeners() {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
772

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

XhmikosR's avatar
Dist    
XhmikosR committed
779
780
781
782
783
784
785
      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
786

XhmikosR's avatar
Dist    
XhmikosR committed
787
788
      this._addTouchEventListeners();
    };
Mark Otto's avatar
dist  
Mark Otto committed
789

XhmikosR's avatar
Dist    
XhmikosR committed
790
791
    _proto._addTouchEventListeners = function _addTouchEventListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
792

XhmikosR's avatar
Dist    
XhmikosR committed
793
794
795
      if (!this._touchSupported) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
796

XhmikosR's avatar
Dist    
XhmikosR committed
797
      var start = function start(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
798
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
799
800
801
          _this3.touchStartX = event.originalEvent.clientX;
        } else if (!_this3._pointerEvent) {
          _this3.touchStartX = event.originalEvent.touches[0].clientX;
Mark Otto's avatar
dist    
Mark Otto committed
802
803
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
804

XhmikosR's avatar
Dist    
XhmikosR committed
805
806
807
808
809
810
811
      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
812
      };
Mark Otto's avatar
dist    
Mark Otto committed
813

XhmikosR's avatar
Dist    
XhmikosR committed
814
      var end = function end(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
815
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
816
817
818
819
          _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
        }

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

XhmikosR's avatar
Dist    
XhmikosR committed
821
822
823
824
825
826
827
828
829
        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
830

XhmikosR's avatar
Dist    
XhmikosR committed
831
832
833
          if (_this3.touchTimeout) {
            clearTimeout(_this3.touchTimeout);
          }
Mark Otto's avatar
dist  
Mark Otto committed
834

XhmikosR's avatar
Dist    
XhmikosR committed
835
836
837
          _this3.touchTimeout = setTimeout(function (event) {
            return _this3.cycle(event);
          }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
Mark Otto's avatar
dist    
Mark Otto committed
838
839
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
840

XhmikosR's avatar
Dist    
XhmikosR committed
841
842
843
      $(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
844

XhmikosR's avatar
Dist    
XhmikosR committed
845
846
847
848
849
850
851
      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
852

XhmikosR's avatar
Dist    
XhmikosR committed
853
854
855
856
        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
857
        });
XhmikosR's avatar
Dist    
XhmikosR committed
858
859
860
861
862
863
864
865
        $(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
866

XhmikosR's avatar
Dist    
XhmikosR committed
867
868
869
870
    _proto._keydown = function _keydown(event) {
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
871

XhmikosR's avatar
Dist    
XhmikosR committed
872
873
874
875
876
      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
877

XhmikosR's avatar
Dist    
XhmikosR committed
878
879
880
881
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
882

XhmikosR's avatar
Dist    
XhmikosR committed
883
884
885
        default:
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
886

XhmikosR's avatar
Dist    
XhmikosR committed
887
888
889
890
    _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
891

XhmikosR's avatar
Dist    
XhmikosR committed
892
893
894
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
895

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
901
902
903
      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
904

XhmikosR's avatar
Dist    
XhmikosR committed
905
906
907
908
      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
909

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
915
916
917
918
919
920
921
922
923
      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
924

XhmikosR's avatar
Dist    
XhmikosR committed
925
926
927
928
    _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
929

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

XhmikosR's avatar
Dist    
XhmikosR committed
932
933
        if (nextIndicator) {
          $(nextIndicator).addClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
934
        }
XhmikosR's avatar
Dist    
XhmikosR committed
935
936
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
937

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

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

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

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
949
950
951
952
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
953

XhmikosR's avatar
Dist    
XhmikosR committed
954
955
956
957
958
959
960
961
962
      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
963

XhmikosR's avatar
Dist    
XhmikosR committed
964
965
966
967
      if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
        this._isSliding = false;
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
968

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

XhmikosR's avatar
Dist    
XhmikosR committed
971
972
973
      if (slideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
974

XhmikosR's avatar
Dist    
XhmikosR committed
975
976
977
978
      if (!activeElement || !nextElement) {
        // Some weirdness is happening, so we bail
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
979

XhmikosR's avatar
Dist    
XhmikosR committed
980
      this._isSliding = true;
Mark Otto's avatar
dist    
Mark Otto committed
981

XhmikosR's avatar
Dist    
XhmikosR committed
982
983
984
      if (isCycling) {
        this.pause();
      }
Mark Otto's avatar
dist  
Mark Otto committed
985

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
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);
For faster browsing, not all history is shown. View entire blame