bootstrap.bundle.js 218 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
XhmikosR's avatar
XhmikosR committed
2
  * Bootstrap v4.3.1 (https://getbootstrap.com/)
Mark Otto's avatar
Mark Otto committed
3
  * Copyright 2011-2019 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
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
Mark Otto's avatar
Mark Otto committed
9
10
  (global = global || self, factory(global.bootstrap = {}, global.jQuery));
}(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
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
72
   * Bootstrap (v4.3.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

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


XhmikosR's avatar
Dist    
XhmikosR committed
160
161
162
163
      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
164

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


XhmikosR's avatar
Dist    
XhmikosR committed
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
      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
196
197
198
          }
        }
      }
Mark Otto's avatar
dist    
Mark Otto committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
    },
    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
221
222
223
    }
  };
  setTransitionEndSupport();
Mark Otto's avatar
dist    
Mark Otto committed
224

XhmikosR's avatar
Dist    
XhmikosR committed
225
226
227
228
229
230
231
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

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

XhmikosR's avatar
Dist    
XhmikosR committed
255
  };
Mark Otto's avatar
dist  
Mark Otto committed
256

XhmikosR's avatar
Dist    
XhmikosR committed
257
258
259
260
261
262
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
263
264


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

XhmikosR's avatar
Dist    
XhmikosR committed
267
268
269
    // Public
    _proto.close = function close(element) {
      var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
270

XhmikosR's avatar
Dist    
XhmikosR committed
271
272
273
      if (element) {
        rootElement = this._getRootElement(element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
274

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

XhmikosR's avatar
Dist    
XhmikosR committed
277
278
279
      if (customEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
280

XhmikosR's avatar
Dist    
XhmikosR committed
281
282
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
283

XhmikosR's avatar
Dist    
XhmikosR committed
284
285
286
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY);
      this._element = null;
Mark Otto's avatar
Mark Otto committed
287
288
    } // Private
    ;
Mark Otto's avatar
dist  
Mark Otto committed
289

XhmikosR's avatar
Dist    
XhmikosR committed
290
291
292
    _proto._getRootElement = function _getRootElement(element) {
      var selector = Util.getSelectorFromElement(element);
      var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
293

XhmikosR's avatar
Dist    
XhmikosR committed
294
295
296
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist  
Mark Otto committed
297

XhmikosR's avatar
Dist    
XhmikosR committed
298
299
300
      if (!parent) {
        parent = $(element).closest("." + ClassName.ALERT)[0];
      }
Mark Otto's avatar
dist  
Mark Otto committed
301

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

XhmikosR's avatar
Dist    
XhmikosR committed
305
306
307
308
309
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
      var closeEvent = $.Event(Event.CLOSE);
      $(element).trigger(closeEvent);
      return closeEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
310

XhmikosR's avatar
Dist    
XhmikosR committed
311
312
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
313

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

XhmikosR's avatar
Dist    
XhmikosR committed
316
317
      if (!$(element).hasClass(ClassName.FADE)) {
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
318

XhmikosR's avatar
Dist    
XhmikosR committed
319
320
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
321

XhmikosR's avatar
Dist    
XhmikosR committed
322
323
324
325
326
      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
327

XhmikosR's avatar
Dist    
XhmikosR committed
328
329
    _proto._destroyElement = function _destroyElement(element) {
      $(element).detach().trigger(Event.CLOSED).remove();
Mark Otto's avatar
Mark Otto committed
330
331
    } // Static
    ;
Mark Otto's avatar
dist  
Mark Otto committed
332

XhmikosR's avatar
Dist    
XhmikosR committed
333
334
335
336
    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
337

XhmikosR's avatar
Dist    
XhmikosR committed
338
339
340
341
        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
342

XhmikosR's avatar
Dist    
XhmikosR committed
343
344
345
346
347
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
348

XhmikosR's avatar
Dist    
XhmikosR committed
349
350
351
352
353
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
354

XhmikosR's avatar
Dist    
XhmikosR committed
355
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
356
      };
XhmikosR's avatar
Dist    
XhmikosR committed
357
    };
Mark Otto's avatar
dist  
Mark Otto committed
358

XhmikosR's avatar
Dist    
XhmikosR committed
359
360
361
362
363
364
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
365

XhmikosR's avatar
Dist    
XhmikosR committed
366
367
368
369
370
371
372
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
373

Mark Otto's avatar
dist    
Mark Otto committed
374

XhmikosR's avatar
Dist    
XhmikosR committed
375
376
377
378
379
380
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
381

XhmikosR's avatar
Dist    
XhmikosR committed
382
383
  $.fn[NAME] = Alert._jQueryInterface;
  $.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
384

XhmikosR's avatar
Dist    
XhmikosR committed
385
386
387
388
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
389

XhmikosR's avatar
Dist    
XhmikosR committed
390
391
392
393
394
395
396
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

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

XhmikosR's avatar
Dist    
XhmikosR committed
423
  };
Mark Otto's avatar
dist  
Mark Otto committed
424

XhmikosR's avatar
Dist    
XhmikosR committed
425
426
427
428
429
430
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
431
432


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

XhmikosR's avatar
Dist    
XhmikosR committed
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
    // 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
450

XhmikosR's avatar
Dist    
XhmikosR committed
451
452
              if (activeElement) {
                $(activeElement).removeClass(ClassName$1.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
453
              }
XhmikosR's avatar
Dist    
XhmikosR committed
454
455
            }
          }
Mark Otto's avatar
dist    
Mark Otto committed
456

XhmikosR's avatar
Dist    
XhmikosR committed
457
458
459
          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
460
            }
Mark Otto's avatar
dist    
Mark Otto committed
461

XhmikosR's avatar
Dist    
XhmikosR committed
462
463
            input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
            $(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
464
465
          }

XhmikosR's avatar
Dist    
XhmikosR committed
466
467
          input.focus();
          addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
468
        }
XhmikosR's avatar
Dist    
XhmikosR committed
469
      }
Mark Otto's avatar
dist  
Mark Otto committed
470

XhmikosR's avatar
Dist    
XhmikosR committed
471
472
473
      if (addAriaPressed) {
        this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
      }
Mark Otto's avatar
dist  
Mark Otto committed
474

XhmikosR's avatar
Dist    
XhmikosR committed
475
476
477
478
      if (triggerChangeEvent) {
        $(this._element).toggleClass(ClassName$1.ACTIVE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
479

XhmikosR's avatar
Dist    
XhmikosR committed
480
481
482
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$1);
      this._element = null;
Mark Otto's avatar
Mark Otto committed
483
484
    } // Static
    ;
Mark Otto's avatar
dist  
Mark Otto committed
485

XhmikosR's avatar
Dist    
XhmikosR committed
486
487
488
    Button._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$1);
Mark Otto's avatar
dist  
Mark Otto committed
489

XhmikosR's avatar
Dist    
XhmikosR committed
490
491
492
493
        if (!data) {
          data = new Button(this);
          $(this).data(DATA_KEY$1, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
494

XhmikosR's avatar
Dist    
XhmikosR committed
495
496
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
497
        }
XhmikosR's avatar
Dist    
XhmikosR committed
498
499
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
500

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

XhmikosR's avatar
Dist    
XhmikosR committed
508
509
510
511
512
513
514
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
515
516


XhmikosR's avatar
Dist    
XhmikosR committed
517
518
519
  $(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
520

XhmikosR's avatar
Dist    
XhmikosR committed
521
522
523
    if (!$(button).hasClass(ClassName$1.BUTTON)) {
      button = $(button).closest(Selector$1.BUTTON);
    }
Mark Otto's avatar
dist    
Mark Otto committed
524

XhmikosR's avatar
Dist    
XhmikosR committed
525
526
527
528
529
530
531
532
533
534
    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
535

XhmikosR's avatar
Dist    
XhmikosR committed
536
537
  $.fn[NAME$1] = Button._jQueryInterface;
  $.fn[NAME$1].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
538

XhmikosR's avatar
Dist    
XhmikosR committed
539
540
541
542
  $.fn[NAME$1].noConflict = function () {
    $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
543
544

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
545
546
547
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
548
   */
Mark Otto's avatar
dist    
Mark Otto committed
549

XhmikosR's avatar
Dist    
XhmikosR committed
550
  var NAME$2 = 'carousel';
XhmikosR's avatar
XhmikosR committed
551
  var VERSION$2 = '4.3.1';
XhmikosR's avatar
Dist    
XhmikosR committed
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
623
624
625
626
  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
627
628
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
629

XhmikosR's avatar
Dist    
XhmikosR committed
630
  };
Mark Otto's avatar
dist    
Mark Otto committed
631

XhmikosR's avatar
Dist    
XhmikosR committed
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
657
658
659
660
  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
661
    };
Mark Otto's avatar
dist  
Mark Otto committed
662

XhmikosR's avatar
Dist    
XhmikosR committed
663
664
665
666
667
668
    _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
669
670
    };

XhmikosR's avatar
Dist    
XhmikosR committed
671
672
673
674
675
    _proto.prev = function prev() {
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
676

XhmikosR's avatar
Dist    
XhmikosR committed
677
678
679
680
    _proto.pause = function pause(event) {
      if (!event) {
        this._isPaused = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
681

XhmikosR's avatar
Dist    
XhmikosR committed
682
683
684
685
      if (this._element.querySelector(Selector$2.NEXT_PREV)) {
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
686

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

XhmikosR's avatar
Dist    
XhmikosR committed
691
692
693
694
    _proto.cycle = function cycle(event) {
      if (!event) {
        this._isPaused = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
695

XhmikosR's avatar
Dist    
XhmikosR committed
696
      if (this._interval) {
Mark Otto's avatar
dist    
Mark Otto committed
697
698
        clearInterval(this._interval);
        this._interval = null;
XhmikosR's avatar
Dist    
XhmikosR committed
699
      }
Mark Otto's avatar
dist  
Mark Otto committed
700

XhmikosR's avatar
Dist    
XhmikosR committed
701
702
703
704
      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
705

XhmikosR's avatar
Dist    
XhmikosR committed
706
707
    _proto.to = function to(index) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
708

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
713
714
715
      if (index > this._items.length - 1 || index < 0) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
716

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

XhmikosR's avatar
Dist    
XhmikosR committed
724
725
726
727
728
      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
729

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

XhmikosR's avatar
Dist    
XhmikosR committed
732
733
      this._slide(direction, this._items[index]);
    };
Mark Otto's avatar
dist  
Mark Otto committed
734

XhmikosR's avatar
Dist    
XhmikosR committed
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;
Mark Otto's avatar
Mark Otto committed
746
747
    } // Private
    ;
XhmikosR's avatar
Dist    
XhmikosR committed
748
749
750
751
752
753

    _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
754

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

XhmikosR's avatar
Dist    
XhmikosR committed
758
759
760
      if (absDeltax <= SWIPE_THRESHOLD) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
761

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

XhmikosR's avatar
Dist    
XhmikosR committed
764
765
766
      if (direction > 0) {
        this.prev();
      } // swipe right
Mark Otto's avatar
dist    
Mark Otto committed
767

Mark Otto's avatar
dist    
Mark Otto committed
768

XhmikosR's avatar
Dist    
XhmikosR committed
769
770
771
772
      if (direction < 0) {
        this.next();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
773

XhmikosR's avatar
Dist    
XhmikosR committed
774
775
    _proto._addEventListeners = function _addEventListeners() {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
776

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

XhmikosR's avatar
Dist    
XhmikosR committed
783
784
785
786
787
788
789
      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
790

Mark Otto's avatar
Mark Otto committed
791
792
793
      if (this._config.touch) {
        this._addTouchEventListeners();
      }
XhmikosR's avatar
Dist    
XhmikosR committed
794
    };
Mark Otto's avatar
dist  
Mark Otto committed
795

XhmikosR's avatar
Dist    
XhmikosR committed
796
797
    _proto._addTouchEventListeners = function _addTouchEventListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
798

XhmikosR's avatar
Dist    
XhmikosR committed
799
800
801
      if (!this._touchSupported) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
802

XhmikosR's avatar
Dist    
XhmikosR committed
803
      var start = function start(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
804
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
805
806
807
          _this3.touchStartX = event.originalEvent.clientX;
        } else if (!_this3._pointerEvent) {
          _this3.touchStartX = event.originalEvent.touches[0].clientX;
Mark Otto's avatar
dist    
Mark Otto committed
808
809
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
810

XhmikosR's avatar
Dist    
XhmikosR committed
811
812
813
814
815
816
817
      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
818
      };
Mark Otto's avatar
dist    
Mark Otto committed
819

XhmikosR's avatar
Dist    
XhmikosR committed
820
      var end = function end(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
821
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
822
823
824
825
          _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
        }

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

XhmikosR's avatar
Dist    
XhmikosR committed
827
828
829
830
831
832
833
834
835
        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
836

XhmikosR's avatar
Dist    
XhmikosR committed
837
838
839
          if (_this3.touchTimeout) {
            clearTimeout(_this3.touchTimeout);
          }
Mark Otto's avatar
dist  
Mark Otto committed
840

XhmikosR's avatar
Dist    
XhmikosR committed
841
842
843
          _this3.touchTimeout = setTimeout(function (event) {
            return _this3.cycle(event);
          }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
Mark Otto's avatar
dist    
Mark Otto committed
844
845
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
846

XhmikosR's avatar
Dist    
XhmikosR committed
847
848
849
      $(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
850

XhmikosR's avatar
Dist    
XhmikosR committed
851
852
853
854
855
856
857
      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
858

XhmikosR's avatar
Dist    
XhmikosR committed
859
860
861
862
        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
863
        });
XhmikosR's avatar
Dist    
XhmikosR committed
864
865
866
867
868
869
870
871
        $(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
872

XhmikosR's avatar
Dist    
XhmikosR committed
873
874
875
876
    _proto._keydown = function _keydown(event) {
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
877

XhmikosR's avatar
Dist    
XhmikosR committed
878
879
880
881
882
      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
883

XhmikosR's avatar
Dist    
XhmikosR committed
884
885
886
887
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
888

XhmikosR's avatar
Dist    
XhmikosR committed
889
890
891
        default:
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
892

XhmikosR's avatar
Dist    
XhmikosR committed
893
894
895
896
    _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
897

XhmikosR's avatar
Dist    
XhmikosR committed
898
899
900
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
901

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
907
908
909
      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
910

XhmikosR's avatar
Dist    
XhmikosR committed
911
912
913
914
      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
915

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
921
922
923
924
925
926
927
928
929
      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
930

XhmikosR's avatar
Dist    
XhmikosR committed
931
932
933
934
    _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
935

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

XhmikosR's avatar
Dist    
XhmikosR committed
938
939
        if (nextIndicator) {
          $(nextIndicator).addClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
940
        }
XhmikosR's avatar
Dist    
XhmikosR committed
941
942
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
943

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

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

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

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
955
956
957
958
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
959

XhmikosR's avatar
Dist    
XhmikosR committed
960
961
962
963
964
965
966
967
968
      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
969

XhmikosR's avatar
Dist    
XhmikosR committed
970
971
972
973
      if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
        this._isSliding = false;
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
974

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

XhmikosR's avatar
Dist    
XhmikosR committed
977
978
979
      if (slideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
980

XhmikosR's avatar
Dist    
XhmikosR committed
981
982
983
984
      if (!activeElement || !nextElement) {
        // Some weirdness is happening, so we bail
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
985

XhmikosR's avatar
Dist    
XhmikosR committed
986
      this._isSliding = true;
Mark Otto's avatar
dist    
Mark Otto committed
987

XhmikosR's avatar
Dist    
XhmikosR committed
988
989
990
      if (isCycling) {
        this.pause();
      }
Mark Otto's avatar
dist  
Mark Otto committed
991

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

XhmikosR's avatar
Dist    
XhmikosR committed
994
995
996
997
998
999
      var slidEvent = $.Event(Event$2.SLID, {
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
Mark Otto's avatar
dist    
Mark Otto committed
1000

For faster browsing, not all history is shown. View entire blame