Issues (1191)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

js/bootstrap.js (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
/*!
2
 * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com)
3
 * Copyright 2011-2016 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
 */
6
7
if (typeof jQuery === 'undefined') {
8
  throw new Error('Bootstrap\'s JavaScript requires jQuery')
9
}
10
11
+function ($) {
12
  var version = $.fn.jquery.split(' ')[0].split('.')
13
  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
14
    throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
15
  }
16
}(jQuery);
17
18
19
+function () {
20
21
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
22
23
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
24
25
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
26
27
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
28
29
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
31
/**
32
 * --------------------------------------------------------------------------
33
 * Bootstrap (v4.0.0-alpha.5): util.js
34
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
35
 * --------------------------------------------------------------------------
36
 */
37
38
var Util = function ($) {
39
40
  /**
41
   * ------------------------------------------------------------------------
42
   * Private TransitionEnd Helpers
43
   * ------------------------------------------------------------------------
44
   */
45
46
  var transition = false;
47
48
  var MAX_UID = 1000000;
49
50
  var TransitionEndEvent = {
51
    WebkitTransition: 'webkitTransitionEnd',
52
    MozTransition: 'transitionend',
53
    OTransition: 'oTransitionEnd otransitionend',
54
    transition: 'transitionend'
55
  };
56
57
  // shoutout AngusCroll (https://goo.gl/pxwQGp)
58
  function toType(obj) {
59
    return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
60
  }
61
62
  function isElement(obj) {
63
    return (obj[0] || obj).nodeType;
64
  }
65
66
  function getSpecialTransitionEndEvent() {
67
    return {
68
      bindType: transition.end,
69
      delegateType: transition.end,
70
      handle: function handle(event) {
71
        if ($(event.target).is(this)) {
72
          return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
73
        }
74
        return undefined;
75
      }
76
    };
77
  }
78
79
  function transitionEndTest() {
80
    if (window.QUnit) {
81
      return false;
82
    }
83
84
    var el = document.createElement('bootstrap');
85
86
    for (var name in TransitionEndEvent) {
0 ignored issues
show
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
87
      if (el.style[name] !== undefined) {
88
        return { end: TransitionEndEvent[name] };
89
      }
90
    }
91
92
    return false;
93
  }
94
95
  function transitionEndEmulator(duration) {
96
    var _this = this;
97
98
    var called = false;
99
100
    $(this).one(Util.TRANSITION_END, function () {
101
      called = true;
102
    });
103
104
    setTimeout(function () {
105
      if (!called) {
106
        Util.triggerTransitionEnd(_this);
107
      }
108
    }, duration);
109
110
    return this;
111
  }
112
113
  function setTransitionEndSupport() {
114
    transition = transitionEndTest();
115
116
    $.fn.emulateTransitionEnd = transitionEndEmulator;
117
118
    if (Util.supportsTransitionEnd()) {
119
      $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
120
    }
121
  }
122
123
  /**
124
   * --------------------------------------------------------------------------
125
   * Public Util Api
126
   * --------------------------------------------------------------------------
127
   */
128
129
  var Util = {
130
131
    TRANSITION_END: 'bsTransitionEnd',
132
133
    getUID: function getUID(prefix) {
134
      do {
135
        /* eslint-disable no-bitwise */
136
        prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
137
        /* eslint-enable no-bitwise */
138
      } while (document.getElementById(prefix));
139
      return prefix;
140
    },
141
    getSelectorFromElement: function getSelectorFromElement(element) {
142
      var selector = element.getAttribute('data-target');
143
144
      if (!selector) {
145
        selector = element.getAttribute('href') || '';
146
        selector = /^#[a-z]/i.test(selector) ? selector : null;
147
      }
148
149
      return selector;
150
    },
151
    reflow: function reflow(element) {
152
      new Function('bs', 'return bs')(element.offsetHeight);
153
    },
154
    triggerTransitionEnd: function triggerTransitionEnd(element) {
155
      $(element).trigger(transition.end);
156
    },
157
    supportsTransitionEnd: function supportsTransitionEnd() {
158
      return Boolean(transition);
159
    },
160
    typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
161
      for (var property in configTypes) {
162
        if (configTypes.hasOwnProperty(property)) {
163
          var expectedTypes = configTypes[property];
164
          var value = config[property];
165
          var valueType = void 0;
166
167
          if (value && isElement(value)) {
168
            valueType = 'element';
169
          } else {
170
            valueType = toType(value);
171
          }
172
173
          if (!new RegExp(expectedTypes).test(valueType)) {
174
            throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
175
          }
176
        }
177
      }
178
    }
179
  };
180
181
  setTransitionEndSupport();
182
183
  return Util;
184
}(jQuery);
185
186
/**
187
 * --------------------------------------------------------------------------
188
 * Bootstrap (v4.0.0-alpha.5): alert.js
189
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
190
 * --------------------------------------------------------------------------
191
 */
192
193
var Alert = function ($) {
194
195
  /**
196
   * ------------------------------------------------------------------------
197
   * Constants
198
   * ------------------------------------------------------------------------
199
   */
200
201
  var NAME = 'alert';
202
  var VERSION = '4.0.0-alpha.5';
203
  var DATA_KEY = 'bs.alert';
204
  var EVENT_KEY = '.' + DATA_KEY;
205
  var DATA_API_KEY = '.data-api';
206
  var JQUERY_NO_CONFLICT = $.fn[NAME];
207
  var TRANSITION_DURATION = 150;
208
209
  var Selector = {
210
    DISMISS: '[data-dismiss="alert"]'
211
  };
212
213
  var Event = {
214
    CLOSE: 'close' + EVENT_KEY,
215
    CLOSED: 'closed' + EVENT_KEY,
216
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
217
  };
218
219
  var ClassName = {
220
    ALERT: 'alert',
221
    FADE: 'fade',
222
    IN: 'in'
223
  };
224
225
  /**
226
   * ------------------------------------------------------------------------
227
   * Class Definition
228
   * ------------------------------------------------------------------------
229
   */
230
231
  var Alert = function () {
232
    function Alert(element) {
233
      _classCallCheck(this, Alert);
234
235
      this._element = element;
236
    }
237
238
    // getters
239
240
    // public
241
242
    Alert.prototype.close = function close(element) {
243
      element = element || this._element;
244
245
      var rootElement = this._getRootElement(element);
246
      var customEvent = this._triggerCloseEvent(rootElement);
247
248
      if (customEvent.isDefaultPrevented()) {
249
        return;
250
      }
251
252
      this._removeElement(rootElement);
253
    };
254
255
    Alert.prototype.dispose = function dispose() {
256
      $.removeData(this._element, DATA_KEY);
257
      this._element = null;
258
    };
259
260
    // private
261
262
    Alert.prototype._getRootElement = function _getRootElement(element) {
263
      var selector = Util.getSelectorFromElement(element);
264
      var parent = false;
265
266
      if (selector) {
267
        parent = $(selector)[0];
268
      }
269
270
      if (!parent) {
271
        parent = $(element).closest('.' + ClassName.ALERT)[0];
272
      }
273
274
      return parent;
275
    };
276
277
    Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) {
278
      var closeEvent = $.Event(Event.CLOSE);
279
280
      $(element).trigger(closeEvent);
281
      return closeEvent;
282
    };
283
284
    Alert.prototype._removeElement = function _removeElement(element) {
285
      $(element).removeClass(ClassName.IN);
286
287
      if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
288
        this._destroyElement(element);
289
        return;
290
      }
291
292
      $(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
293
    };
294
295
    Alert.prototype._destroyElement = function _destroyElement(element) {
296
      $(element).detach().trigger(Event.CLOSED).remove();
297
    };
298
299
    // static
300
301
    Alert._jQueryInterface = function _jQueryInterface(config) {
302
      return this.each(function () {
303
        var $element = $(this);
304
        var data = $element.data(DATA_KEY);
305
306
        if (!data) {
307
          data = new Alert(this);
308
          $element.data(DATA_KEY, data);
309
        }
310
311
        if (config === 'close') {
312
          data[config](this);
313
        }
314
      });
315
    };
316
317
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
318
      return function (event) {
319
        if (event) {
320
          event.preventDefault();
321
        }
322
323
        alertInstance.close(this);
324
      };
325
    };
326
327
    _createClass(Alert, null, [{
328
      key: 'VERSION',
329
      get: function get() {
330
        return VERSION;
331
      }
332
    }]);
333
334
    return Alert;
335
  }();
336
337
  /**
338
   * ------------------------------------------------------------------------
339
   * Data Api implementation
340
   * ------------------------------------------------------------------------
341
   */
342
343
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
344
345
  /**
346
   * ------------------------------------------------------------------------
347
   * jQuery
348
   * ------------------------------------------------------------------------
349
   */
350
351
  $.fn[NAME] = Alert._jQueryInterface;
352
  $.fn[NAME].Constructor = Alert;
353
  $.fn[NAME].noConflict = function () {
354
    $.fn[NAME] = JQUERY_NO_CONFLICT;
355
    return Alert._jQueryInterface;
356
  };
357
358
  return Alert;
359
}(jQuery);
360
361
/**
362
 * --------------------------------------------------------------------------
363
 * Bootstrap (v4.0.0-alpha.5): button.js
364
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
365
 * --------------------------------------------------------------------------
366
 */
367
368
var Button = function ($) {
369
370
  /**
371
   * ------------------------------------------------------------------------
372
   * Constants
373
   * ------------------------------------------------------------------------
374
   */
375
376
  var NAME = 'button';
377
  var VERSION = '4.0.0-alpha.5';
378
  var DATA_KEY = 'bs.button';
379
  var EVENT_KEY = '.' + DATA_KEY;
380
  var DATA_API_KEY = '.data-api';
381
  var JQUERY_NO_CONFLICT = $.fn[NAME];
382
383
  var ClassName = {
384
    ACTIVE: 'active',
385
    BUTTON: 'btn',
386
    FOCUS: 'focus'
387
  };
388
389
  var Selector = {
390
    DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
391
    DATA_TOGGLE: '[data-toggle="buttons"]',
392
    INPUT: 'input',
393
    ACTIVE: '.active',
394
    BUTTON: '.btn'
395
  };
396
397
  var Event = {
398
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
399
    FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
400
  };
401
402
  /**
403
   * ------------------------------------------------------------------------
404
   * Class Definition
405
   * ------------------------------------------------------------------------
406
   */
407
408
  var Button = function () {
409
    function Button(element) {
410
      _classCallCheck(this, Button);
411
412
      this._element = element;
413
    }
414
415
    // getters
416
417
    // public
418
419
    Button.prototype.toggle = function toggle() {
420
      var triggerChangeEvent = true;
421
      var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
422
423
      if (rootElement) {
424
        var input = $(this._element).find(Selector.INPUT)[0];
425
426
        if (input) {
427
          if (input.type === 'radio') {
428
            if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
429
              triggerChangeEvent = false;
430
            } else {
431
              var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
432
433
              if (activeElement) {
434
                $(activeElement).removeClass(ClassName.ACTIVE);
435
              }
436
            }
437
          }
438
439
          if (triggerChangeEvent) {
440
            input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
441
            $(this._element).trigger('change');
442
          }
443
444
          input.focus();
445
        }
446
      } else {
447
        this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
448
      }
449
450
      if (triggerChangeEvent) {
451
        $(this._element).toggleClass(ClassName.ACTIVE);
452
      }
453
    };
454
455
    Button.prototype.dispose = function dispose() {
456
      $.removeData(this._element, DATA_KEY);
457
      this._element = null;
458
    };
459
460
    // static
461
462
    Button._jQueryInterface = function _jQueryInterface(config) {
463
      return this.each(function () {
464
        var data = $(this).data(DATA_KEY);
465
466
        if (!data) {
467
          data = new Button(this);
468
          $(this).data(DATA_KEY, data);
469
        }
470
471
        if (config === 'toggle') {
472
          data[config]();
473
        }
474
      });
475
    };
476
477
    _createClass(Button, null, [{
478
      key: 'VERSION',
479
      get: function get() {
480
        return VERSION;
481
      }
482
    }]);
483
484
    return Button;
485
  }();
486
487
  /**
488
   * ------------------------------------------------------------------------
489
   * Data Api implementation
490
   * ------------------------------------------------------------------------
491
   */
492
493
  $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
494
    event.preventDefault();
495
496
    var button = event.target;
497
498
    if (!$(button).hasClass(ClassName.BUTTON)) {
499
      button = $(button).closest(Selector.BUTTON);
500
    }
501
502
    Button._jQueryInterface.call($(button), 'toggle');
503
  }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
504
    var button = $(event.target).closest(Selector.BUTTON)[0];
505
    $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
506
  });
507
508
  /**
509
   * ------------------------------------------------------------------------
510
   * jQuery
511
   * ------------------------------------------------------------------------
512
   */
513
514
  $.fn[NAME] = Button._jQueryInterface;
515
  $.fn[NAME].Constructor = Button;
516
  $.fn[NAME].noConflict = function () {
517
    $.fn[NAME] = JQUERY_NO_CONFLICT;
518
    return Button._jQueryInterface;
519
  };
520
521
  return Button;
522
}(jQuery);
523
524
/**
525
 * --------------------------------------------------------------------------
526
 * Bootstrap (v4.0.0-alpha.5): carousel.js
527
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
528
 * --------------------------------------------------------------------------
529
 */
530
531
var Carousel = function ($) {
532
533
  /**
534
   * ------------------------------------------------------------------------
535
   * Constants
536
   * ------------------------------------------------------------------------
537
   */
538
539
  var NAME = 'carousel';
540
  var VERSION = '4.0.0-alpha.5';
541
  var DATA_KEY = 'bs.carousel';
542
  var EVENT_KEY = '.' + DATA_KEY;
543
  var DATA_API_KEY = '.data-api';
544
  var JQUERY_NO_CONFLICT = $.fn[NAME];
545
  var TRANSITION_DURATION = 600;
546
  var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
547
  var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
548
549
  var Default = {
550
    interval: 5000,
551
    keyboard: true,
552
    slide: false,
553
    pause: 'hover',
554
    wrap: true
555
  };
556
557
  var DefaultType = {
558
    interval: '(number|boolean)',
559
    keyboard: 'boolean',
560
    slide: '(boolean|string)',
561
    pause: '(string|boolean)',
562
    wrap: 'boolean'
563
  };
564
565
  var Direction = {
566
    NEXT: 'next',
567
    PREVIOUS: 'prev'
568
  };
569
570
  var Event = {
571
    SLIDE: 'slide' + EVENT_KEY,
572
    SLID: 'slid' + EVENT_KEY,
573
    KEYDOWN: 'keydown' + EVENT_KEY,
574
    MOUSEENTER: 'mouseenter' + EVENT_KEY,
575
    MOUSELEAVE: 'mouseleave' + EVENT_KEY,
576
    LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
577
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
578
  };
579
580
  var ClassName = {
581
    CAROUSEL: 'carousel',
582
    ACTIVE: 'active',
583
    SLIDE: 'slide',
584
    RIGHT: 'right',
585
    LEFT: 'left',
586
    ITEM: 'carousel-item'
587
  };
588
589
  var Selector = {
590
    ACTIVE: '.active',
591
    ACTIVE_ITEM: '.active.carousel-item',
592
    ITEM: '.carousel-item',
593
    NEXT_PREV: '.next, .prev',
594
    INDICATORS: '.carousel-indicators',
595
    DATA_SLIDE: '[data-slide], [data-slide-to]',
596
    DATA_RIDE: '[data-ride="carousel"]'
597
  };
598
599
  /**
600
   * ------------------------------------------------------------------------
601
   * Class Definition
602
   * ------------------------------------------------------------------------
603
   */
604
605
  var Carousel = function () {
606
    function Carousel(element, config) {
607
      _classCallCheck(this, Carousel);
608
609
      this._items = null;
610
      this._interval = null;
611
      this._activeElement = null;
612
613
      this._isPaused = false;
614
      this._isSliding = false;
615
616
      this._config = this._getConfig(config);
617
      this._element = $(element)[0];
618
      this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
619
620
      this._addEventListeners();
621
    }
622
623
    // getters
624
625
    // public
626
627
    Carousel.prototype.next = function next() {
628
      if (!this._isSliding) {
629
        this._slide(Direction.NEXT);
630
      }
631
    };
632
633
    Carousel.prototype.nextWhenVisible = function nextWhenVisible() {
634
      // Don't call next when the page isn't visible
635
      if (!document.hidden) {
636
        this.next();
637
      }
638
    };
639
640
    Carousel.prototype.prev = function prev() {
641
      if (!this._isSliding) {
642
        this._slide(Direction.PREVIOUS);
643
      }
644
    };
645
646
    Carousel.prototype.pause = function pause(event) {
647
      if (!event) {
648
        this._isPaused = true;
649
      }
650
651
      if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
652
        Util.triggerTransitionEnd(this._element);
653
        this.cycle(true);
654
      }
655
656
      clearInterval(this._interval);
657
      this._interval = null;
658
    };
659
660
    Carousel.prototype.cycle = function cycle(event) {
661
      if (!event) {
662
        this._isPaused = false;
663
      }
664
665
      if (this._interval) {
666
        clearInterval(this._interval);
667
        this._interval = null;
668
      }
669
670
      if (this._config.interval && !this._isPaused) {
671
        this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval);
672
      }
673
    };
674
675
    Carousel.prototype.to = function to(index) {
676
      var _this2 = this;
677
678
      this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
679
680
      var activeIndex = this._getItemIndex(this._activeElement);
681
682
      if (index > this._items.length - 1 || index < 0) {
683
        return;
684
      }
685
686
      if (this._isSliding) {
687
        $(this._element).one(Event.SLID, function () {
688
          return _this2.to(index);
689
        });
690
        return;
691
      }
692
693
      if (activeIndex === index) {
694
        this.pause();
695
        this.cycle();
696
        return;
697
      }
698
699
      var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
700
701
      this._slide(direction, this._items[index]);
702
    };
703
704
    Carousel.prototype.dispose = function dispose() {
705
      $(this._element).off(EVENT_KEY);
706
      $.removeData(this._element, DATA_KEY);
707
708
      this._items = null;
709
      this._config = null;
710
      this._element = null;
711
      this._interval = null;
712
      this._isPaused = null;
713
      this._isSliding = null;
714
      this._activeElement = null;
715
      this._indicatorsElement = null;
716
    };
717
718
    // private
719
720
    Carousel.prototype._getConfig = function _getConfig(config) {
721
      config = $.extend({}, Default, config);
722
      Util.typeCheckConfig(NAME, config, DefaultType);
723
      return config;
724
    };
725
726
    Carousel.prototype._addEventListeners = function _addEventListeners() {
727
      if (this._config.keyboard) {
728
        $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
729
      }
730
731
      if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
732
        $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
733
      }
734
    };
735
736
    Carousel.prototype._keydown = function _keydown(event) {
737
      event.preventDefault();
738
739
      if (/input|textarea/i.test(event.target.tagName)) {
740
        return;
741
      }
742
743
      switch (event.which) {
744
        case ARROW_LEFT_KEYCODE:
745
          this.prev();
746
          break;
747
        case ARROW_RIGHT_KEYCODE:
748
          this.next();
749
          break;
750
        default:
751
          return;
752
      }
753
    };
754
755
    Carousel.prototype._getItemIndex = function _getItemIndex(element) {
756
      this._items = $.makeArray($(element).parent().find(Selector.ITEM));
757
      return this._items.indexOf(element);
758
    };
759
760
    Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
761
      var isNextDirection = direction === Direction.NEXT;
762
      var isPrevDirection = direction === Direction.PREVIOUS;
763
      var activeIndex = this._getItemIndex(activeElement);
764
      var lastItemIndex = this._items.length - 1;
765
      var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
766
767
      if (isGoingToWrap && !this._config.wrap) {
768
        return activeElement;
769
      }
770
771
      var delta = direction === Direction.PREVIOUS ? -1 : 1;
772
      var itemIndex = (activeIndex + delta) % this._items.length;
773
774
      return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
775
    };
776
777
    Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, directionalClassname) {
778
      var slideEvent = $.Event(Event.SLIDE, {
779
        relatedTarget: relatedTarget,
780
        direction: directionalClassname
781
      });
782
783
      $(this._element).trigger(slideEvent);
784
785
      return slideEvent;
786
    };
787
788
    Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
789
      if (this._indicatorsElement) {
790
        $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
791
792
        var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
793
794
        if (nextIndicator) {
795
          $(nextIndicator).addClass(ClassName.ACTIVE);
796
        }
797
      }
798
    };
799
800
    Carousel.prototype._slide = function _slide(direction, element) {
801
      var _this3 = this;
802
803
      var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
804
      var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
805
806
      var isCycling = Boolean(this._interval);
807
808
      var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
809
810
      if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
811
        this._isSliding = false;
812
        return;
813
      }
814
815
      var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
816
      if (slideEvent.isDefaultPrevented()) {
817
        return;
818
      }
819
820
      if (!activeElement || !nextElement) {
821
        // some weirdness is happening, so we bail
822
        return;
823
      }
824
825
      this._isSliding = true;
826
827
      if (isCycling) {
828
        this.pause();
829
      }
830
831
      this._setActiveIndicatorElement(nextElement);
832
833
      var slidEvent = $.Event(Event.SLID, {
834
        relatedTarget: nextElement,
835
        direction: directionalClassName
836
      });
837
838
      if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
839
840
        $(nextElement).addClass(direction);
841
842
        Util.reflow(nextElement);
843
844
        $(activeElement).addClass(directionalClassName);
845
        $(nextElement).addClass(directionalClassName);
846
847
        $(activeElement).one(Util.TRANSITION_END, function () {
848
          $(nextElement).removeClass(directionalClassName).removeClass(direction);
849
850
          $(nextElement).addClass(ClassName.ACTIVE);
851
852
          $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
853
854
          _this3._isSliding = false;
855
856
          setTimeout(function () {
857
            return $(_this3._element).trigger(slidEvent);
858
          }, 0);
859
        }).emulateTransitionEnd(TRANSITION_DURATION);
860
      } else {
861
        $(activeElement).removeClass(ClassName.ACTIVE);
862
        $(nextElement).addClass(ClassName.ACTIVE);
863
864
        this._isSliding = false;
865
        $(this._element).trigger(slidEvent);
866
      }
867
868
      if (isCycling) {
869
        this.cycle();
870
      }
871
    };
872
873
    // static
874
875
    Carousel._jQueryInterface = function _jQueryInterface(config) {
876
      return this.each(function () {
877
        var data = $(this).data(DATA_KEY);
878
        var _config = $.extend({}, Default, $(this).data());
879
880
        if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
881
          $.extend(_config, config);
882
        }
883
884
        var action = typeof config === 'string' ? config : _config.slide;
885
886
        if (!data) {
887
          data = new Carousel(this, _config);
888
          $(this).data(DATA_KEY, data);
889
        }
890
891
        if (typeof config === 'number') {
892
          data.to(config);
893
        } else if (typeof action === 'string') {
894
          if (data[action] === undefined) {
895
            throw new Error('No method named "' + action + '"');
896
          }
897
          data[action]();
898
        } else if (_config.interval) {
899
          data.pause();
900
          data.cycle();
901
        }
902
      });
903
    };
904
905
    Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
906
      var selector = Util.getSelectorFromElement(this);
907
908
      if (!selector) {
909
        return;
910
      }
911
912
      var target = $(selector)[0];
913
914
      if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
915
        return;
916
      }
917
918
      var config = $.extend({}, $(target).data(), $(this).data());
919
      var slideIndex = this.getAttribute('data-slide-to');
920
921
      if (slideIndex) {
922
        config.interval = false;
923
      }
924
925
      Carousel._jQueryInterface.call($(target), config);
926
927
      if (slideIndex) {
928
        $(target).data(DATA_KEY).to(slideIndex);
929
      }
930
931
      event.preventDefault();
932
    };
933
934
    _createClass(Carousel, null, [{
935
      key: 'VERSION',
936
      get: function get() {
937
        return VERSION;
938
      }
939
    }, {
940
      key: 'Default',
941
      get: function get() {
942
        return Default;
943
      }
944
    }]);
945
946
    return Carousel;
947
  }();
948
949
  /**
950
   * ------------------------------------------------------------------------
951
   * Data Api implementation
952
   * ------------------------------------------------------------------------
953
   */
954
955
  $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
956
957
  $(window).on(Event.LOAD_DATA_API, function () {
958
    $(Selector.DATA_RIDE).each(function () {
959
      var $carousel = $(this);
960
      Carousel._jQueryInterface.call($carousel, $carousel.data());
961
    });
962
  });
963
964
  /**
965
   * ------------------------------------------------------------------------
966
   * jQuery
967
   * ------------------------------------------------------------------------
968
   */
969
970
  $.fn[NAME] = Carousel._jQueryInterface;
971
  $.fn[NAME].Constructor = Carousel;
972
  $.fn[NAME].noConflict = function () {
973
    $.fn[NAME] = JQUERY_NO_CONFLICT;
974
    return Carousel._jQueryInterface;
975
  };
976
977
  return Carousel;
978
}(jQuery);
979
980
/**
981
 * --------------------------------------------------------------------------
982
 * Bootstrap (v4.0.0-alpha.5): collapse.js
983
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
984
 * --------------------------------------------------------------------------
985
 */
986
987
var Collapse = function ($) {
988
989
  /**
990
   * ------------------------------------------------------------------------
991
   * Constants
992
   * ------------------------------------------------------------------------
993
   */
994
995
  var NAME = 'collapse';
996
  var VERSION = '4.0.0-alpha.5';
997
  var DATA_KEY = 'bs.collapse';
998
  var EVENT_KEY = '.' + DATA_KEY;
999
  var DATA_API_KEY = '.data-api';
1000
  var JQUERY_NO_CONFLICT = $.fn[NAME];
1001
  var TRANSITION_DURATION = 600;
1002
1003
  var Default = {
1004
    toggle: true,
1005
    parent: ''
1006
  };
1007
1008
  var DefaultType = {
1009
    toggle: 'boolean',
1010
    parent: 'string'
1011
  };
1012
1013
  var Event = {
1014
    SHOW: 'show' + EVENT_KEY,
1015
    SHOWN: 'shown' + EVENT_KEY,
1016
    HIDE: 'hide' + EVENT_KEY,
1017
    HIDDEN: 'hidden' + EVENT_KEY,
1018
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
1019
  };
1020
1021
  var ClassName = {
1022
    IN: 'in',
1023
    COLLAPSE: 'collapse',
1024
    COLLAPSING: 'collapsing',
1025
    COLLAPSED: 'collapsed'
1026
  };
1027
1028
  var Dimension = {
1029
    WIDTH: 'width',
1030
    HEIGHT: 'height'
1031
  };
1032
1033
  var Selector = {
1034
    ACTIVES: '.card > .in, .card > .collapsing',
1035
    DATA_TOGGLE: '[data-toggle="collapse"]'
1036
  };
1037
1038
  /**
1039
   * ------------------------------------------------------------------------
1040
   * Class Definition
1041
   * ------------------------------------------------------------------------
1042
   */
1043
1044
  var Collapse = function () {
1045
    function Collapse(element, config) {
1046
      _classCallCheck(this, Collapse);
1047
1048
      this._isTransitioning = false;
1049
      this._element = element;
1050
      this._config = this._getConfig(config);
1051
      this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
1052
1053
      this._parent = this._config.parent ? this._getParent() : null;
1054
1055
      if (!this._config.parent) {
1056
        this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1057
      }
1058
1059
      if (this._config.toggle) {
1060
        this.toggle();
1061
      }
1062
    }
1063
1064
    // getters
1065
1066
    // public
1067
1068
    Collapse.prototype.toggle = function toggle() {
1069
      if ($(this._element).hasClass(ClassName.IN)) {
1070
        this.hide();
1071
      } else {
1072
        this.show();
1073
      }
1074
    };
1075
1076
    Collapse.prototype.show = function show() {
1077
      var _this4 = this;
1078
1079
      if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
1080
        return;
1081
      }
1082
1083
      var actives = void 0;
1084
      var activesData = void 0;
1085
1086
      if (this._parent) {
1087
        actives = $.makeArray($(Selector.ACTIVES));
1088
        if (!actives.length) {
1089
          actives = null;
1090
        }
1091
      }
1092
1093
      if (actives) {
1094
        activesData = $(actives).data(DATA_KEY);
1095
        if (activesData && activesData._isTransitioning) {
1096
          return;
1097
        }
1098
      }
1099
1100
      var startEvent = $.Event(Event.SHOW);
1101
      $(this._element).trigger(startEvent);
1102
      if (startEvent.isDefaultPrevented()) {
1103
        return;
1104
      }
1105
1106
      if (actives) {
1107
        Collapse._jQueryInterface.call($(actives), 'hide');
1108
        if (!activesData) {
1109
          $(actives).data(DATA_KEY, null);
1110
        }
1111
      }
1112
1113
      var dimension = this._getDimension();
1114
1115
      $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
1116
1117
      this._element.style[dimension] = 0;
1118
      this._element.setAttribute('aria-expanded', true);
1119
1120
      if (this._triggerArray.length) {
1121
        $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
1122
      }
1123
1124
      this.setTransitioning(true);
1125
1126
      var complete = function complete() {
1127
        $(_this4._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
1128
1129
        _this4._element.style[dimension] = '';
1130
1131
        _this4.setTransitioning(false);
1132
1133
        $(_this4._element).trigger(Event.SHOWN);
1134
      };
1135
1136
      if (!Util.supportsTransitionEnd()) {
1137
        complete();
1138
        return;
1139
      }
1140
1141
      var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1142
      var scrollSize = 'scroll' + capitalizedDimension;
1143
1144
      $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1145
1146
      this._element.style[dimension] = this._element[scrollSize] + 'px';
1147
    };
1148
1149
    Collapse.prototype.hide = function hide() {
1150
      var _this5 = this;
1151
1152
      if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
1153
        return;
1154
      }
1155
1156
      var startEvent = $.Event(Event.HIDE);
1157
      $(this._element).trigger(startEvent);
1158
      if (startEvent.isDefaultPrevented()) {
1159
        return;
1160
      }
1161
1162
      var dimension = this._getDimension();
1163
      var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
1164
1165
      this._element.style[dimension] = this._element[offsetDimension] + 'px';
1166
1167
      Util.reflow(this._element);
1168
1169
      $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
1170
1171
      this._element.setAttribute('aria-expanded', false);
1172
1173
      if (this._triggerArray.length) {
1174
        $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
1175
      }
1176
1177
      this.setTransitioning(true);
1178
1179
      var complete = function complete() {
1180
        _this5.setTransitioning(false);
1181
        $(_this5._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
1182
      };
1183
1184
      this._element.style[dimension] = '';
1185
1186
      if (!Util.supportsTransitionEnd()) {
1187
        complete();
1188
        return;
1189
      }
1190
1191
      $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1192
    };
1193
1194
    Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) {
1195
      this._isTransitioning = isTransitioning;
1196
    };
1197
1198
    Collapse.prototype.dispose = function dispose() {
1199
      $.removeData(this._element, DATA_KEY);
1200
1201
      this._config = null;
1202
      this._parent = null;
1203
      this._element = null;
1204
      this._triggerArray = null;
1205
      this._isTransitioning = null;
1206
    };
1207
1208
    // private
1209
1210
    Collapse.prototype._getConfig = function _getConfig(config) {
1211
      config = $.extend({}, Default, config);
1212
      config.toggle = Boolean(config.toggle); // coerce string values
1213
      Util.typeCheckConfig(NAME, config, DefaultType);
1214
      return config;
1215
    };
1216
1217
    Collapse.prototype._getDimension = function _getDimension() {
1218
      var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
1219
      return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
1220
    };
1221
1222
    Collapse.prototype._getParent = function _getParent() {
1223
      var _this6 = this;
1224
1225
      var parent = $(this._config.parent)[0];
1226
      var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
1227
1228
      $(parent).find(selector).each(function (i, element) {
1229
        _this6._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
1230
      });
1231
1232
      return parent;
1233
    };
1234
1235
    Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
1236
      if (element) {
1237
        var isOpen = $(element).hasClass(ClassName.IN);
1238
        element.setAttribute('aria-expanded', isOpen);
1239
1240
        if (triggerArray.length) {
1241
          $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
1242
        }
1243
      }
1244
    };
1245
1246
    // static
1247
1248
    Collapse._getTargetFromElement = function _getTargetFromElement(element) {
1249
      var selector = Util.getSelectorFromElement(element);
1250
      return selector ? $(selector)[0] : null;
1251
    };
1252
1253
    Collapse._jQueryInterface = function _jQueryInterface(config) {
1254
      return this.each(function () {
1255
        var $this = $(this);
1256
        var data = $this.data(DATA_KEY);
1257
        var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
1258
1259
        if (!data && _config.toggle && /show|hide/.test(config)) {
1260
          _config.toggle = false;
1261
        }
1262
1263
        if (!data) {
1264
          data = new Collapse(this, _config);
1265
          $this.data(DATA_KEY, data);
1266
        }
1267
1268
        if (typeof config === 'string') {
1269
          if (data[config] === undefined) {
1270
            throw new Error('No method named "' + config + '"');
1271
          }
1272
          data[config]();
1273
        }
1274
      });
1275
    };
1276
1277
    _createClass(Collapse, null, [{
1278
      key: 'VERSION',
1279
      get: function get() {
1280
        return VERSION;
1281
      }
1282
    }, {
1283
      key: 'Default',
1284
      get: function get() {
1285
        return Default;
1286
      }
1287
    }]);
1288
1289
    return Collapse;
1290
  }();
1291
1292
  /**
1293
   * ------------------------------------------------------------------------
1294
   * Data Api implementation
1295
   * ------------------------------------------------------------------------
1296
   */
1297
1298
  $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
1299
    event.preventDefault();
1300
1301
    var target = Collapse._getTargetFromElement(this);
1302
    var data = $(target).data(DATA_KEY);
1303
    var config = data ? 'toggle' : $(this).data();
1304
1305
    Collapse._jQueryInterface.call($(target), config);
1306
  });
1307
1308
  /**
1309
   * ------------------------------------------------------------------------
1310
   * jQuery
1311
   * ------------------------------------------------------------------------
1312
   */
1313
1314
  $.fn[NAME] = Collapse._jQueryInterface;
1315
  $.fn[NAME].Constructor = Collapse;
1316
  $.fn[NAME].noConflict = function () {
1317
    $.fn[NAME] = JQUERY_NO_CONFLICT;
1318
    return Collapse._jQueryInterface;
1319
  };
1320
1321
  return Collapse;
1322
}(jQuery);
1323
1324
/**
1325
 * --------------------------------------------------------------------------
1326
 * Bootstrap (v4.0.0-alpha.5): dropdown.js
1327
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1328
 * --------------------------------------------------------------------------
1329
 */
1330
1331
var Dropdown = function ($) {
1332
1333
  /**
1334
   * ------------------------------------------------------------------------
1335
   * Constants
1336
   * ------------------------------------------------------------------------
1337
   */
1338
1339
  var NAME = 'dropdown';
1340
  var VERSION = '4.0.0-alpha.5';
1341
  var DATA_KEY = 'bs.dropdown';
1342
  var EVENT_KEY = '.' + DATA_KEY;
1343
  var DATA_API_KEY = '.data-api';
1344
  var JQUERY_NO_CONFLICT = $.fn[NAME];
1345
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
1346
  var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
1347
  var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
1348
  var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
1349
1350
  var Event = {
1351
    HIDE: 'hide' + EVENT_KEY,
1352
    HIDDEN: 'hidden' + EVENT_KEY,
1353
    SHOW: 'show' + EVENT_KEY,
1354
    SHOWN: 'shown' + EVENT_KEY,
1355
    CLICK: 'click' + EVENT_KEY,
1356
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
1357
    KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
1358
  };
1359
1360
  var ClassName = {
1361
    BACKDROP: 'dropdown-backdrop',
1362
    DISABLED: 'disabled',
1363
    OPEN: 'open'
1364
  };
1365
1366
  var Selector = {
1367
    BACKDROP: '.dropdown-backdrop',
1368
    DATA_TOGGLE: '[data-toggle="dropdown"]',
1369
    FORM_CHILD: '.dropdown form',
1370
    ROLE_MENU: '[role="menu"]',
1371
    ROLE_LISTBOX: '[role="listbox"]',
1372
    NAVBAR_NAV: '.navbar-nav',
1373
    VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
1374
  };
1375
1376
  /**
1377
   * ------------------------------------------------------------------------
1378
   * Class Definition
1379
   * ------------------------------------------------------------------------
1380
   */
1381
1382
  var Dropdown = function () {
1383
    function Dropdown(element) {
1384
      _classCallCheck(this, Dropdown);
1385
1386
      this._element = element;
1387
1388
      this._addEventListeners();
1389
    }
1390
1391
    // getters
1392
1393
    // public
1394
1395
    Dropdown.prototype.toggle = function toggle() {
1396
      if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
1397
        return false;
1398
      }
1399
1400
      var parent = Dropdown._getParentFromElement(this);
1401
      var isActive = $(parent).hasClass(ClassName.OPEN);
1402
1403
      Dropdown._clearMenus();
1404
1405
      if (isActive) {
1406
        return false;
1407
      }
1408
1409
      if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
1410
1411
        // if mobile we use a backdrop because click events don't delegate
1412
        var dropdown = document.createElement('div');
1413
        dropdown.className = ClassName.BACKDROP;
1414
        $(dropdown).insertBefore(this);
1415
        $(dropdown).on('click', Dropdown._clearMenus);
1416
      }
1417
1418
      var relatedTarget = { relatedTarget: this };
1419
      var showEvent = $.Event(Event.SHOW, relatedTarget);
1420
1421
      $(parent).trigger(showEvent);
1422
1423
      if (showEvent.isDefaultPrevented()) {
1424
        return false;
1425
      }
1426
1427
      this.focus();
1428
      this.setAttribute('aria-expanded', 'true');
1429
1430
      $(parent).toggleClass(ClassName.OPEN);
1431
      $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
1432
1433
      return false;
1434
    };
1435
1436
    Dropdown.prototype.dispose = function dispose() {
1437
      $.removeData(this._element, DATA_KEY);
1438
      $(this._element).off(EVENT_KEY);
1439
      this._element = null;
1440
    };
1441
1442
    // private
1443
1444
    Dropdown.prototype._addEventListeners = function _addEventListeners() {
1445
      $(this._element).on(Event.CLICK, this.toggle);
1446
    };
1447
1448
    // static
1449
1450
    Dropdown._jQueryInterface = function _jQueryInterface(config) {
1451
      return this.each(function () {
1452
        var data = $(this).data(DATA_KEY);
1453
1454
        if (!data) {
1455
          $(this).data(DATA_KEY, data = new Dropdown(this));
1456
        }
1457
1458
        if (typeof config === 'string') {
1459
          if (data[config] === undefined) {
1460
            throw new Error('No method named "' + config + '"');
1461
          }
1462
          data[config].call(this);
1463
        }
1464
      });
1465
    };
1466
1467
    Dropdown._clearMenus = function _clearMenus(event) {
1468
      if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
1469
        return;
1470
      }
1471
1472
      var backdrop = $(Selector.BACKDROP)[0];
1473
      if (backdrop) {
1474
        backdrop.parentNode.removeChild(backdrop);
1475
      }
1476
1477
      var toggles = $.makeArray($(Selector.DATA_TOGGLE));
1478
1479
      for (var i = 0; i < toggles.length; i++) {
1480
        var parent = Dropdown._getParentFromElement(toggles[i]);
1481
        var relatedTarget = { relatedTarget: toggles[i] };
1482
1483
        if (!$(parent).hasClass(ClassName.OPEN)) {
1484
          continue;
1485
        }
1486
1487
        if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(parent, event.target)) {
1488
          continue;
1489
        }
1490
1491
        var hideEvent = $.Event(Event.HIDE, relatedTarget);
1492
        $(parent).trigger(hideEvent);
1493
        if (hideEvent.isDefaultPrevented()) {
1494
          continue;
1495
        }
1496
1497
        toggles[i].setAttribute('aria-expanded', 'false');
1498
1499
        $(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
1500
      }
1501
    };
1502
1503
    Dropdown._getParentFromElement = function _getParentFromElement(element) {
1504
      var parent = void 0;
1505
      var selector = Util.getSelectorFromElement(element);
1506
1507
      if (selector) {
1508
        parent = $(selector)[0];
1509
      }
1510
1511
      return parent || element.parentNode;
1512
    };
1513
1514
    Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
1515
      if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
1516
        return;
1517
      }
1518
1519
      event.preventDefault();
1520
      event.stopPropagation();
1521
1522
      if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
1523
        return;
1524
      }
1525
1526
      var parent = Dropdown._getParentFromElement(this);
1527
      var isActive = $(parent).hasClass(ClassName.OPEN);
1528
1529
      if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
1530
1531
        if (event.which === ESCAPE_KEYCODE) {
1532
          var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
1533
          $(toggle).trigger('focus');
1534
        }
1535
1536
        $(this).trigger('click');
1537
        return;
1538
      }
1539
1540
      var items = $.makeArray($(Selector.VISIBLE_ITEMS));
1541
1542
      items = items.filter(function (item) {
1543
        return item.offsetWidth || item.offsetHeight;
1544
      });
1545
1546
      if (!items.length) {
1547
        return;
1548
      }
1549
1550
      var index = items.indexOf(event.target);
1551
1552
      if (event.which === ARROW_UP_KEYCODE && index > 0) {
1553
        // up
1554
        index--;
1555
      }
1556
1557
      if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
1558
        // down
1559
        index++;
1560
      }
1561
1562
      if (index < 0) {
1563
        index = 0;
1564
      }
1565
1566
      items[index].focus();
1567
    };
1568
1569
    _createClass(Dropdown, null, [{
1570
      key: 'VERSION',
1571
      get: function get() {
1572
        return VERSION;
1573
      }
1574
    }]);
1575
1576
    return Dropdown;
1577
  }();
1578
1579
  /**
1580
   * ------------------------------------------------------------------------
1581
   * Data Api implementation
1582
   * ------------------------------------------------------------------------
1583
   */
1584
1585
  $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
1586
    e.stopPropagation();
1587
  });
1588
1589
  /**
1590
   * ------------------------------------------------------------------------
1591
   * jQuery
1592
   * ------------------------------------------------------------------------
1593
   */
1594
1595
  $.fn[NAME] = Dropdown._jQueryInterface;
1596
  $.fn[NAME].Constructor = Dropdown;
1597
  $.fn[NAME].noConflict = function () {
1598
    $.fn[NAME] = JQUERY_NO_CONFLICT;
1599
    return Dropdown._jQueryInterface;
1600
  };
1601
1602
  return Dropdown;
1603
}(jQuery);
1604
1605
/**
1606
 * --------------------------------------------------------------------------
1607
 * Bootstrap (v4.0.0-alpha.5): modal.js
1608
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1609
 * --------------------------------------------------------------------------
1610
 */
1611
1612
var Modal = function ($) {
1613
1614
  /**
1615
   * ------------------------------------------------------------------------
1616
   * Constants
1617
   * ------------------------------------------------------------------------
1618
   */
1619
1620
  var NAME = 'modal';
1621
  var VERSION = '4.0.0-alpha.5';
1622
  var DATA_KEY = 'bs.modal';
1623
  var EVENT_KEY = '.' + DATA_KEY;
1624
  var DATA_API_KEY = '.data-api';
1625
  var JQUERY_NO_CONFLICT = $.fn[NAME];
1626
  var TRANSITION_DURATION = 300;
1627
  var BACKDROP_TRANSITION_DURATION = 150;
1628
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
1629
1630
  var Default = {
1631
    backdrop: true,
1632
    keyboard: true,
1633
    focus: true,
1634
    show: true
1635
  };
1636
1637
  var DefaultType = {
1638
    backdrop: '(boolean|string)',
1639
    keyboard: 'boolean',
1640
    focus: 'boolean',
1641
    show: 'boolean'
1642
  };
1643
1644
  var Event = {
1645
    HIDE: 'hide' + EVENT_KEY,
1646
    HIDDEN: 'hidden' + EVENT_KEY,
1647
    SHOW: 'show' + EVENT_KEY,
1648
    SHOWN: 'shown' + EVENT_KEY,
1649
    FOCUSIN: 'focusin' + EVENT_KEY,
1650
    RESIZE: 'resize' + EVENT_KEY,
1651
    CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
1652
    KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
1653
    MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
1654
    MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
1655
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
1656
  };
1657
1658
  var ClassName = {
1659
    SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
1660
    BACKDROP: 'modal-backdrop',
1661
    OPEN: 'modal-open',
1662
    FADE: 'fade',
1663
    IN: 'in'
1664
  };
1665
1666
  var Selector = {
1667
    DIALOG: '.modal-dialog',
1668
    DATA_TOGGLE: '[data-toggle="modal"]',
1669
    DATA_DISMISS: '[data-dismiss="modal"]',
1670
    FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'
1671
  };
1672
1673
  /**
1674
   * ------------------------------------------------------------------------
1675
   * Class Definition
1676
   * ------------------------------------------------------------------------
1677
   */
1678
1679
  var Modal = function () {
1680
    function Modal(element, config) {
1681
      _classCallCheck(this, Modal);
1682
1683
      this._config = this._getConfig(config);
1684
      this._element = element;
1685
      this._dialog = $(element).find(Selector.DIALOG)[0];
1686
      this._backdrop = null;
1687
      this._isShown = false;
1688
      this._isBodyOverflowing = false;
1689
      this._ignoreBackdropClick = false;
1690
      this._originalBodyPadding = 0;
1691
      this._scrollbarWidth = 0;
1692
    }
1693
1694
    // getters
1695
1696
    // public
1697
1698
    Modal.prototype.toggle = function toggle(relatedTarget) {
1699
      return this._isShown ? this.hide() : this.show(relatedTarget);
1700
    };
1701
1702
    Modal.prototype.show = function show(relatedTarget) {
1703
      var _this7 = this;
1704
1705
      var showEvent = $.Event(Event.SHOW, {
1706
        relatedTarget: relatedTarget
1707
      });
1708
1709
      $(this._element).trigger(showEvent);
1710
1711
      if (this._isShown || showEvent.isDefaultPrevented()) {
1712
        return;
1713
      }
1714
1715
      this._isShown = true;
1716
1717
      this._checkScrollbar();
1718
      this._setScrollbar();
1719
1720
      $(document.body).addClass(ClassName.OPEN);
1721
1722
      this._setEscapeEvent();
1723
      this._setResizeEvent();
1724
1725
      $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
1726
1727
      $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
1728
        $(_this7._element).one(Event.MOUSEUP_DISMISS, function (event) {
1729
          if ($(event.target).is(_this7._element)) {
1730
            _this7._ignoreBackdropClick = true;
1731
          }
1732
        });
1733
      });
1734
1735
      this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
1736
    };
1737
1738
    Modal.prototype.hide = function hide(event) {
1739
      if (event) {
1740
        event.preventDefault();
1741
      }
1742
1743
      var hideEvent = $.Event(Event.HIDE);
1744
1745
      $(this._element).trigger(hideEvent);
1746
1747
      if (!this._isShown || hideEvent.isDefaultPrevented()) {
1748
        return;
1749
      }
1750
1751
      this._isShown = false;
1752
1753
      this._setEscapeEvent();
1754
      this._setResizeEvent();
1755
1756
      $(document).off(Event.FOCUSIN);
1757
1758
      $(this._element).removeClass(ClassName.IN);
1759
1760
      $(this._element).off(Event.CLICK_DISMISS);
1761
      $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
1762
1763
      if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
1764
1765
        $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
1766
      } else {
1767
        this._hideModal();
1768
      }
1769
    };
1770
1771
    Modal.prototype.dispose = function dispose() {
1772
      $.removeData(this._element, DATA_KEY);
1773
1774
      $(window).off(EVENT_KEY);
1775
      $(document).off(EVENT_KEY);
1776
      $(this._element).off(EVENT_KEY);
1777
      $(this._backdrop).off(EVENT_KEY);
1778
1779
      this._config = null;
1780
      this._element = null;
1781
      this._dialog = null;
1782
      this._backdrop = null;
1783
      this._isShown = null;
1784
      this._isBodyOverflowing = null;
1785
      this._ignoreBackdropClick = null;
1786
      this._originalBodyPadding = null;
1787
      this._scrollbarWidth = null;
1788
    };
1789
1790
    // private
1791
1792
    Modal.prototype._getConfig = function _getConfig(config) {
1793
      config = $.extend({}, Default, config);
1794
      Util.typeCheckConfig(NAME, config, DefaultType);
1795
      return config;
1796
    };
1797
1798
    Modal.prototype._showElement = function _showElement(relatedTarget) {
1799
      var _this8 = this;
1800
1801
      var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
1802
1803
      if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
1804
        // don't move modals dom position
1805
        document.body.appendChild(this._element);
1806
      }
1807
1808
      this._element.style.display = 'block';
1809
      this._element.removeAttribute('aria-hidden');
1810
      this._element.scrollTop = 0;
1811
1812
      if (transition) {
1813
        Util.reflow(this._element);
1814
      }
1815
1816
      $(this._element).addClass(ClassName.IN);
1817
1818
      if (this._config.focus) {
1819
        this._enforceFocus();
1820
      }
1821
1822
      var shownEvent = $.Event(Event.SHOWN, {
1823
        relatedTarget: relatedTarget
1824
      });
1825
1826
      var transitionComplete = function transitionComplete() {
1827
        if (_this8._config.focus) {
1828
          _this8._element.focus();
1829
        }
1830
        $(_this8._element).trigger(shownEvent);
1831
      };
1832
1833
      if (transition) {
1834
        $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
1835
      } else {
1836
        transitionComplete();
1837
      }
1838
    };
1839
1840
    Modal.prototype._enforceFocus = function _enforceFocus() {
1841
      var _this9 = this;
1842
1843
      $(document).off(Event.FOCUSIN) // guard against infinite focus loop
1844
      .on(Event.FOCUSIN, function (event) {
1845
        if (document !== event.target && _this9._element !== event.target && !$(_this9._element).has(event.target).length) {
1846
          _this9._element.focus();
1847
        }
1848
      });
1849
    };
1850
1851
    Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
1852
      var _this10 = this;
1853
1854
      if (this._isShown && this._config.keyboard) {
1855
        $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
1856
          if (event.which === ESCAPE_KEYCODE) {
1857
            _this10.hide();
1858
          }
1859
        });
1860
      } else if (!this._isShown) {
1861
        $(this._element).off(Event.KEYDOWN_DISMISS);
1862
      }
1863
    };
1864
1865
    Modal.prototype._setResizeEvent = function _setResizeEvent() {
1866
      if (this._isShown) {
1867
        $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
1868
      } else {
1869
        $(window).off(Event.RESIZE);
1870
      }
1871
    };
1872
1873
    Modal.prototype._hideModal = function _hideModal() {
1874
      var _this11 = this;
1875
1876
      this._element.style.display = 'none';
1877
      this._element.setAttribute('aria-hidden', 'true');
1878
      this._showBackdrop(function () {
1879
        $(document.body).removeClass(ClassName.OPEN);
1880
        _this11._resetAdjustments();
1881
        _this11._resetScrollbar();
1882
        $(_this11._element).trigger(Event.HIDDEN);
1883
      });
1884
    };
1885
1886
    Modal.prototype._removeBackdrop = function _removeBackdrop() {
1887
      if (this._backdrop) {
1888
        $(this._backdrop).remove();
1889
        this._backdrop = null;
1890
      }
1891
    };
1892
1893
    Modal.prototype._showBackdrop = function _showBackdrop(callback) {
1894
      var _this12 = this;
1895
1896
      var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
1897
1898
      if (this._isShown && this._config.backdrop) {
1899
        var doAnimate = Util.supportsTransitionEnd() && animate;
1900
1901
        this._backdrop = document.createElement('div');
1902
        this._backdrop.className = ClassName.BACKDROP;
1903
1904
        if (animate) {
1905
          $(this._backdrop).addClass(animate);
1906
        }
1907
1908
        $(this._backdrop).appendTo(document.body);
1909
1910
        $(this._element).on(Event.CLICK_DISMISS, function (event) {
1911
          if (_this12._ignoreBackdropClick) {
1912
            _this12._ignoreBackdropClick = false;
1913
            return;
1914
          }
1915
          if (event.target !== event.currentTarget) {
1916
            return;
1917
          }
1918
          if (_this12._config.backdrop === 'static') {
1919
            _this12._element.focus();
1920
          } else {
1921
            _this12.hide();
1922
          }
1923
        });
1924
1925
        if (doAnimate) {
1926
          Util.reflow(this._backdrop);
1927
        }
1928
1929
        $(this._backdrop).addClass(ClassName.IN);
1930
1931
        if (!callback) {
1932
          return;
1933
        }
1934
1935
        if (!doAnimate) {
1936
          callback();
1937
          return;
1938
        }
1939
1940
        $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
1941
      } else if (!this._isShown && this._backdrop) {
1942
        $(this._backdrop).removeClass(ClassName.IN);
1943
1944
        var callbackRemove = function callbackRemove() {
1945
          _this12._removeBackdrop();
1946
          if (callback) {
1947
            callback();
1948
          }
1949
        };
1950
1951
        if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
1952
          $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
1953
        } else {
1954
          callbackRemove();
1955
        }
1956
      } else if (callback) {
1957
        callback();
1958
      }
1959
    };
1960
1961
    // ----------------------------------------------------------------------
1962
    // the following methods are used to handle overflowing modals
1963
    // todo (fat): these should probably be refactored out of modal.js
1964
    // ----------------------------------------------------------------------
1965
1966
    Modal.prototype._handleUpdate = function _handleUpdate() {
1967
      this._adjustDialog();
1968
    };
1969
1970
    Modal.prototype._adjustDialog = function _adjustDialog() {
1971
      var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
1972
1973
      if (!this._isBodyOverflowing && isModalOverflowing) {
1974
        this._element.style.paddingLeft = this._scrollbarWidth + 'px';
1975
      }
1976
1977
      if (this._isBodyOverflowing && !isModalOverflowing) {
1978
        this._element.style.paddingRight = this._scrollbarWidth + 'px';
1979
      }
1980
    };
1981
1982
    Modal.prototype._resetAdjustments = function _resetAdjustments() {
1983
      this._element.style.paddingLeft = '';
1984
      this._element.style.paddingRight = '';
1985
    };
1986
1987
    Modal.prototype._checkScrollbar = function _checkScrollbar() {
1988
      this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
1989
      this._scrollbarWidth = this._getScrollbarWidth();
1990
    };
1991
1992
    Modal.prototype._setScrollbar = function _setScrollbar() {
1993
      var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
1994
1995
      this._originalBodyPadding = document.body.style.paddingRight || '';
1996
1997
      if (this._isBodyOverflowing) {
1998
        document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
1999
      }
2000
    };
2001
2002
    Modal.prototype._resetScrollbar = function _resetScrollbar() {
2003
      document.body.style.paddingRight = this._originalBodyPadding;
2004
    };
2005
2006
    Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() {
2007
      // thx d.walsh
2008
      var scrollDiv = document.createElement('div');
2009
      scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
2010
      document.body.appendChild(scrollDiv);
2011
      var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
2012
      document.body.removeChild(scrollDiv);
2013
      return scrollbarWidth;
2014
    };
2015
2016
    // static
2017
2018
    Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
2019
      return this.each(function () {
2020
        var data = $(this).data(DATA_KEY);
2021
        var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
2022
2023
        if (!data) {
2024
          data = new Modal(this, _config);
2025
          $(this).data(DATA_KEY, data);
2026
        }
2027
2028
        if (typeof config === 'string') {
2029
          if (data[config] === undefined) {
2030
            throw new Error('No method named "' + config + '"');
2031
          }
2032
          data[config](relatedTarget);
2033
        } else if (_config.show) {
2034
          data.show(relatedTarget);
2035
        }
2036
      });
2037
    };
2038
2039
    _createClass(Modal, null, [{
2040
      key: 'VERSION',
2041
      get: function get() {
2042
        return VERSION;
2043
      }
2044
    }, {
2045
      key: 'Default',
2046
      get: function get() {
2047
        return Default;
2048
      }
2049
    }]);
2050
2051
    return Modal;
2052
  }();
2053
2054
  /**
2055
   * ------------------------------------------------------------------------
2056
   * Data Api implementation
2057
   * ------------------------------------------------------------------------
2058
   */
2059
2060
  $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
2061
    var _this13 = this;
2062
2063
    var target = void 0;
2064
    var selector = Util.getSelectorFromElement(this);
2065
2066
    if (selector) {
2067
      target = $(selector)[0];
2068
    }
2069
2070
    var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
2071
2072
    if (this.tagName === 'A') {
2073
      event.preventDefault();
2074
    }
2075
2076
    var $target = $(target).one(Event.SHOW, function (showEvent) {
2077
      if (showEvent.isDefaultPrevented()) {
2078
        // only register focus restorer if modal will actually get shown
2079
        return;
2080
      }
2081
2082
      $target.one(Event.HIDDEN, function () {
2083
        if ($(_this13).is(':visible')) {
2084
          _this13.focus();
2085
        }
2086
      });
2087
    });
2088
2089
    Modal._jQueryInterface.call($(target), config, this);
2090
  });
2091
2092
  /**
2093
   * ------------------------------------------------------------------------
2094
   * jQuery
2095
   * ------------------------------------------------------------------------
2096
   */
2097
2098
  $.fn[NAME] = Modal._jQueryInterface;
2099
  $.fn[NAME].Constructor = Modal;
2100
  $.fn[NAME].noConflict = function () {
2101
    $.fn[NAME] = JQUERY_NO_CONFLICT;
2102
    return Modal._jQueryInterface;
2103
  };
2104
2105
  return Modal;
2106
}(jQuery);
2107
2108
/**
2109
 * --------------------------------------------------------------------------
2110
 * Bootstrap (v4.0.0-alpha.5): scrollspy.js
2111
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2112
 * --------------------------------------------------------------------------
2113
 */
2114
2115
var ScrollSpy = function ($) {
2116
2117
  /**
2118
   * ------------------------------------------------------------------------
2119
   * Constants
2120
   * ------------------------------------------------------------------------
2121
   */
2122
2123
  var NAME = 'scrollspy';
2124
  var VERSION = '4.0.0-alpha.5';
2125
  var DATA_KEY = 'bs.scrollspy';
2126
  var EVENT_KEY = '.' + DATA_KEY;
2127
  var DATA_API_KEY = '.data-api';
2128
  var JQUERY_NO_CONFLICT = $.fn[NAME];
2129
2130
  var Default = {
2131
    offset: 10,
2132
    method: 'auto',
2133
    target: ''
2134
  };
2135
2136
  var DefaultType = {
2137
    offset: 'number',
2138
    method: 'string',
2139
    target: '(string|element)'
2140
  };
2141
2142
  var Event = {
2143
    ACTIVATE: 'activate' + EVENT_KEY,
2144
    SCROLL: 'scroll' + EVENT_KEY,
2145
    LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
2146
  };
2147
2148
  var ClassName = {
2149
    DROPDOWN_ITEM: 'dropdown-item',
2150
    DROPDOWN_MENU: 'dropdown-menu',
2151
    NAV_LINK: 'nav-link',
2152
    NAV: 'nav',
2153
    ACTIVE: 'active'
2154
  };
2155
2156
  var Selector = {
2157
    DATA_SPY: '[data-spy="scroll"]',
2158
    ACTIVE: '.active',
2159
    LIST_ITEM: '.list-item',
2160
    LI: 'li',
2161
    LI_DROPDOWN: 'li.dropdown',
2162
    NAV_LINKS: '.nav-link',
2163
    DROPDOWN: '.dropdown',
2164
    DROPDOWN_ITEMS: '.dropdown-item',
2165
    DROPDOWN_TOGGLE: '.dropdown-toggle'
2166
  };
2167
2168
  var OffsetMethod = {
2169
    OFFSET: 'offset',
2170
    POSITION: 'position'
2171
  };
2172
2173
  /**
2174
   * ------------------------------------------------------------------------
2175
   * Class Definition
2176
   * ------------------------------------------------------------------------
2177
   */
2178
2179
  var ScrollSpy = function () {
2180
    function ScrollSpy(element, config) {
2181
      _classCallCheck(this, ScrollSpy);
2182
2183
      this._element = element;
2184
      this._scrollElement = element.tagName === 'BODY' ? window : element;
2185
      this._config = this._getConfig(config);
2186
      this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS);
2187
      this._offsets = [];
2188
      this._targets = [];
2189
      this._activeTarget = null;
2190
      this._scrollHeight = 0;
2191
2192
      $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this));
2193
2194
      this.refresh();
2195
      this._process();
2196
    }
2197
2198
    // getters
2199
2200
    // public
2201
2202
    ScrollSpy.prototype.refresh = function refresh() {
2203
      var _this14 = this;
2204
2205
      var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
2206
2207
      var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
2208
2209
      var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
2210
2211
      this._offsets = [];
2212
      this._targets = [];
2213
2214
      this._scrollHeight = this._getScrollHeight();
2215
2216
      var targets = $.makeArray($(this._selector));
2217
2218
      targets.map(function (element) {
2219
        var target = void 0;
2220
        var targetSelector = Util.getSelectorFromElement(element);
2221
2222
        if (targetSelector) {
2223
          target = $(targetSelector)[0];
2224
        }
2225
2226
        if (target && (target.offsetWidth || target.offsetHeight)) {
2227
          // todo (fat): remove sketch reliance on jQuery position/offset
2228
          return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
2229
        }
2230
        return null;
2231
      }).filter(function (item) {
2232
        return item;
2233
      }).sort(function (a, b) {
2234
        return a[0] - b[0];
2235
      }).forEach(function (item) {
2236
        _this14._offsets.push(item[0]);
2237
        _this14._targets.push(item[1]);
2238
      });
2239
    };
2240
2241
    ScrollSpy.prototype.dispose = function dispose() {
2242
      $.removeData(this._element, DATA_KEY);
2243
      $(this._scrollElement).off(EVENT_KEY);
2244
2245
      this._element = null;
2246
      this._scrollElement = null;
2247
      this._config = null;
2248
      this._selector = null;
2249
      this._offsets = null;
2250
      this._targets = null;
2251
      this._activeTarget = null;
2252
      this._scrollHeight = null;
2253
    };
2254
2255
    // private
2256
2257
    ScrollSpy.prototype._getConfig = function _getConfig(config) {
2258
      config = $.extend({}, Default, config);
2259
2260
      if (typeof config.target !== 'string') {
2261
        var id = $(config.target).attr('id');
2262
        if (!id) {
2263
          id = Util.getUID(NAME);
2264
          $(config.target).attr('id', id);
2265
        }
2266
        config.target = '#' + id;
2267
      }
2268
2269
      Util.typeCheckConfig(NAME, config, DefaultType);
2270
2271
      return config;
2272
    };
2273
2274
    ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
2275
      return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
2276
    };
2277
2278
    ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {
2279
      return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
2280
    };
2281
2282
    ScrollSpy.prototype._process = function _process() {
2283
      var scrollTop = this._getScrollTop() + this._config.offset;
2284
      var scrollHeight = this._getScrollHeight();
2285
      var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
2286
2287
      if (this._scrollHeight !== scrollHeight) {
2288
        this.refresh();
2289
      }
2290
2291
      if (scrollTop >= maxScroll) {
2292
        var target = this._targets[this._targets.length - 1];
2293
2294
        if (this._activeTarget !== target) {
2295
          this._activate(target);
2296
        }
2297
      }
2298
2299
      if (this._activeTarget && scrollTop < this._offsets[0]) {
2300
        this._activeTarget = null;
2301
        this._clear();
2302
        return;
2303
      }
2304
2305
      for (var i = this._offsets.length; i--;) {
2306
        var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
2307
2308
        if (isActiveTarget) {
2309
          this._activate(this._targets[i]);
2310
        }
2311
      }
2312
    };
2313
2314
    ScrollSpy.prototype._activate = function _activate(target) {
2315
      this._activeTarget = target;
2316
2317
      this._clear();
2318
2319
      var queries = this._selector.split(',');
2320
      queries = queries.map(function (selector) {
2321
        return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
2322
      });
2323
2324
      var $link = $(queries.join(','));
2325
2326
      if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
2327
        $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
2328
        $link.addClass(ClassName.ACTIVE);
2329
      } else {
2330
        // todo (fat) this is kinda sus...
2331
        // recursively add actives to tested nav-links
2332
        $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
2333
      }
2334
2335
      $(this._scrollElement).trigger(Event.ACTIVATE, {
2336
        relatedTarget: target
2337
      });
2338
    };
2339
2340
    ScrollSpy.prototype._clear = function _clear() {
2341
      $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
2342
    };
2343
2344
    // static
2345
2346
    ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
2347
      return this.each(function () {
2348
        var data = $(this).data(DATA_KEY);
2349
        var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config || null;
2350
2351
        if (!data) {
2352
          data = new ScrollSpy(this, _config);
2353
          $(this).data(DATA_KEY, data);
2354
        }
2355
2356
        if (typeof config === 'string') {
2357
          if (data[config] === undefined) {
2358
            throw new Error('No method named "' + config + '"');
2359
          }
2360
          data[config]();
2361
        }
2362
      });
2363
    };
2364
2365
    _createClass(ScrollSpy, null, [{
2366
      key: 'VERSION',
2367
      get: function get() {
2368
        return VERSION;
2369
      }
2370
    }, {
2371
      key: 'Default',
2372
      get: function get() {
2373
        return Default;
2374
      }
2375
    }]);
2376
2377
    return ScrollSpy;
2378
  }();
2379
2380
  /**
2381
   * ------------------------------------------------------------------------
2382
   * Data Api implementation
2383
   * ------------------------------------------------------------------------
2384
   */
2385
2386
  $(window).on(Event.LOAD_DATA_API, function () {
2387
    var scrollSpys = $.makeArray($(Selector.DATA_SPY));
2388
2389
    for (var i = scrollSpys.length; i--;) {
2390
      var $spy = $(scrollSpys[i]);
2391
      ScrollSpy._jQueryInterface.call($spy, $spy.data());
2392
    }
2393
  });
2394
2395
  /**
2396
   * ------------------------------------------------------------------------
2397
   * jQuery
2398
   * ------------------------------------------------------------------------
2399
   */
2400
2401
  $.fn[NAME] = ScrollSpy._jQueryInterface;
2402
  $.fn[NAME].Constructor = ScrollSpy;
2403
  $.fn[NAME].noConflict = function () {
2404
    $.fn[NAME] = JQUERY_NO_CONFLICT;
2405
    return ScrollSpy._jQueryInterface;
2406
  };
2407
2408
  return ScrollSpy;
2409
}(jQuery);
2410
2411
/**
2412
 * --------------------------------------------------------------------------
2413
 * Bootstrap (v4.0.0-alpha.5): tab.js
2414
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2415
 * --------------------------------------------------------------------------
2416
 */
2417
2418
var Tab = function ($) {
2419
2420
  /**
2421
   * ------------------------------------------------------------------------
2422
   * Constants
2423
   * ------------------------------------------------------------------------
2424
   */
2425
2426
  var NAME = 'tab';
2427
  var VERSION = '4.0.0-alpha.5';
2428
  var DATA_KEY = 'bs.tab';
2429
  var EVENT_KEY = '.' + DATA_KEY;
2430
  var DATA_API_KEY = '.data-api';
2431
  var JQUERY_NO_CONFLICT = $.fn[NAME];
2432
  var TRANSITION_DURATION = 150;
2433
2434
  var Event = {
2435
    HIDE: 'hide' + EVENT_KEY,
2436
    HIDDEN: 'hidden' + EVENT_KEY,
2437
    SHOW: 'show' + EVENT_KEY,
2438
    SHOWN: 'shown' + EVENT_KEY,
2439
    CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
2440
  };
2441
2442
  var ClassName = {
2443
    DROPDOWN_MENU: 'dropdown-menu',
2444
    ACTIVE: 'active',
2445
    FADE: 'fade',
2446
    IN: 'in'
2447
  };
2448
2449
  var Selector = {
2450
    A: 'a',
2451
    LI: 'li',
2452
    DROPDOWN: '.dropdown',
2453
    UL: 'ul:not(.dropdown-menu)',
2454
    FADE_CHILD: '> .nav-item .fade, > .fade',
2455
    ACTIVE: '.active',
2456
    ACTIVE_CHILD: '> .nav-item > .active, > .active',
2457
    DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
2458
    DROPDOWN_TOGGLE: '.dropdown-toggle',
2459
    DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
2460
  };
2461
2462
  /**
2463
   * ------------------------------------------------------------------------
2464
   * Class Definition
2465
   * ------------------------------------------------------------------------
2466
   */
2467
2468
  var Tab = function () {
2469
    function Tab(element) {
2470
      _classCallCheck(this, Tab);
2471
2472
      this._element = element;
2473
    }
2474
2475
    // getters
2476
2477
    // public
2478
2479
    Tab.prototype.show = function show() {
2480
      var _this15 = this;
2481
2482
      if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) {
2483
        return;
2484
      }
2485
2486
      var target = void 0;
2487
      var previous = void 0;
2488
      var ulElement = $(this._element).closest(Selector.UL)[0];
2489
      var selector = Util.getSelectorFromElement(this._element);
2490
2491
      if (ulElement) {
2492
        previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
2493
        previous = previous[previous.length - 1];
2494
      }
2495
2496
      var hideEvent = $.Event(Event.HIDE, {
2497
        relatedTarget: this._element
2498
      });
2499
2500
      var showEvent = $.Event(Event.SHOW, {
2501
        relatedTarget: previous
2502
      });
2503
2504
      if (previous) {
2505
        $(previous).trigger(hideEvent);
2506
      }
2507
2508
      $(this._element).trigger(showEvent);
2509
2510
      if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
2511
        return;
2512
      }
2513
2514
      if (selector) {
2515
        target = $(selector)[0];
2516
      }
2517
2518
      this._activate(this._element, ulElement);
2519
2520
      var complete = function complete() {
2521
        var hiddenEvent = $.Event(Event.HIDDEN, {
2522
          relatedTarget: _this15._element
2523
        });
2524
2525
        var shownEvent = $.Event(Event.SHOWN, {
2526
          relatedTarget: previous
2527
        });
2528
2529
        $(previous).trigger(hiddenEvent);
2530
        $(_this15._element).trigger(shownEvent);
2531
      };
2532
2533
      if (target) {
2534
        this._activate(target, target.parentNode, complete);
2535
      } else {
2536
        complete();
2537
      }
2538
    };
2539
2540
    Tab.prototype.dispose = function dispose() {
2541
      $.removeClass(this._element, DATA_KEY);
2542
      this._element = null;
2543
    };
2544
2545
    // private
2546
2547
    Tab.prototype._activate = function _activate(element, container, callback) {
2548
      var active = $(container).find(Selector.ACTIVE_CHILD)[0];
2549
      var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
2550
2551
      var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
2552
2553
      if (active && isTransitioning) {
2554
        $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
2555
      } else {
2556
        complete();
2557
      }
2558
2559
      if (active) {
2560
        $(active).removeClass(ClassName.IN);
2561
      }
2562
    };
2563
2564
    Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
2565
      if (active) {
2566
        $(active).removeClass(ClassName.ACTIVE);
2567
2568
        var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
2569
2570
        if (dropdownChild) {
2571
          $(dropdownChild).removeClass(ClassName.ACTIVE);
2572
        }
2573
2574
        active.setAttribute('aria-expanded', false);
2575
      }
2576
2577
      $(element).addClass(ClassName.ACTIVE);
2578
      element.setAttribute('aria-expanded', true);
2579
2580
      if (isTransitioning) {
2581
        Util.reflow(element);
2582
        $(element).addClass(ClassName.IN);
2583
      } else {
2584
        $(element).removeClass(ClassName.FADE);
2585
      }
2586
2587
      if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
2588
2589
        var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
2590
        if (dropdownElement) {
2591
          $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
2592
        }
2593
2594
        element.setAttribute('aria-expanded', true);
2595
      }
2596
2597
      if (callback) {
2598
        callback();
2599
      }
2600
    };
2601
2602
    // static
2603
2604
    Tab._jQueryInterface = function _jQueryInterface(config) {
2605
      return this.each(function () {
2606
        var $this = $(this);
2607
        var data = $this.data(DATA_KEY);
2608
2609
        if (!data) {
2610
          data = data = new Tab(this);
2611
          $this.data(DATA_KEY, data);
2612
        }
2613
2614
        if (typeof config === 'string') {
2615
          if (data[config] === undefined) {
2616
            throw new Error('No method named "' + config + '"');
2617
          }
2618
          data[config]();
2619
        }
2620
      });
2621
    };
2622
2623
    _createClass(Tab, null, [{
2624
      key: 'VERSION',
2625
      get: function get() {
2626
        return VERSION;
2627
      }
2628
    }]);
2629
2630
    return Tab;
2631
  }();
2632
2633
  /**
2634
   * ------------------------------------------------------------------------
2635
   * Data Api implementation
2636
   * ------------------------------------------------------------------------
2637
   */
2638
2639
  $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
2640
    event.preventDefault();
2641
    Tab._jQueryInterface.call($(this), 'show');
2642
  });
2643
2644
  /**
2645
   * ------------------------------------------------------------------------
2646
   * jQuery
2647
   * ------------------------------------------------------------------------
2648
   */
2649
2650
  $.fn[NAME] = Tab._jQueryInterface;
2651
  $.fn[NAME].Constructor = Tab;
2652
  $.fn[NAME].noConflict = function () {
2653
    $.fn[NAME] = JQUERY_NO_CONFLICT;
2654
    return Tab._jQueryInterface;
2655
  };
2656
2657
  return Tab;
2658
}(jQuery);
2659
2660
/* global Tether */
2661
2662
/**
2663
 * --------------------------------------------------------------------------
2664
 * Bootstrap (v4.0.0-alpha.5): tooltip.js
2665
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2666
 * --------------------------------------------------------------------------
2667
 */
2668
2669
var Tooltip = function ($) {
2670
2671
  /**
2672
   * Check for Tether dependency
2673
   * Tether - http://tether.io/
2674
   */
2675
  if (window.Tether === undefined) {
2676
    throw new Error('Bootstrap tooltips require Tether (http://tether.io/)');
2677
  }
2678
2679
  /**
2680
   * ------------------------------------------------------------------------
2681
   * Constants
2682
   * ------------------------------------------------------------------------
2683
   */
2684
2685
  var NAME = 'tooltip';
2686
  var VERSION = '4.0.0-alpha.5';
2687
  var DATA_KEY = 'bs.tooltip';
2688
  var EVENT_KEY = '.' + DATA_KEY;
2689
  var JQUERY_NO_CONFLICT = $.fn[NAME];
2690
  var TRANSITION_DURATION = 150;
2691
  var CLASS_PREFIX = 'bs-tether';
2692
2693
  var Default = {
2694
    animation: true,
2695
    template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>',
2696
    trigger: 'hover focus',
2697
    title: '',
2698
    delay: 0,
2699
    html: false,
2700
    selector: false,
2701
    placement: 'top',
2702
    offset: '0 0',
2703
    constraints: []
2704
  };
2705
2706
  var DefaultType = {
2707
    animation: 'boolean',
2708
    template: 'string',
2709
    title: '(string|element|function)',
2710
    trigger: 'string',
2711
    delay: '(number|object)',
2712
    html: 'boolean',
2713
    selector: '(string|boolean)',
2714
    placement: '(string|function)',
2715
    offset: 'string',
2716
    constraints: 'array'
2717
  };
2718
2719
  var AttachmentMap = {
2720
    TOP: 'bottom center',
2721
    RIGHT: 'middle left',
2722
    BOTTOM: 'top center',
2723
    LEFT: 'middle right'
2724
  };
2725
2726
  var HoverState = {
2727
    IN: 'in',
2728
    OUT: 'out'
2729
  };
2730
2731
  var Event = {
2732
    HIDE: 'hide' + EVENT_KEY,
2733
    HIDDEN: 'hidden' + EVENT_KEY,
2734
    SHOW: 'show' + EVENT_KEY,
2735
    SHOWN: 'shown' + EVENT_KEY,
2736
    INSERTED: 'inserted' + EVENT_KEY,
2737
    CLICK: 'click' + EVENT_KEY,
2738
    FOCUSIN: 'focusin' + EVENT_KEY,
2739
    FOCUSOUT: 'focusout' + EVENT_KEY,
2740
    MOUSEENTER: 'mouseenter' + EVENT_KEY,
2741
    MOUSELEAVE: 'mouseleave' + EVENT_KEY
2742
  };
2743
2744
  var ClassName = {
2745
    FADE: 'fade',
2746
    IN: 'in'
2747
  };
2748
2749
  var Selector = {
2750
    TOOLTIP: '.tooltip',
2751
    TOOLTIP_INNER: '.tooltip-inner'
2752
  };
2753
2754
  var TetherClass = {
2755
    element: false,
2756
    enabled: false
2757
  };
2758
2759
  var Trigger = {
2760
    HOVER: 'hover',
2761
    FOCUS: 'focus',
2762
    CLICK: 'click',
2763
    MANUAL: 'manual'
2764
  };
2765
2766
  /**
2767
   * ------------------------------------------------------------------------
2768
   * Class Definition
2769
   * ------------------------------------------------------------------------
2770
   */
2771
2772
  var Tooltip = function () {
2773
    function Tooltip(element, config) {
2774
      _classCallCheck(this, Tooltip);
2775
2776
      // private
2777
      this._isEnabled = true;
2778
      this._timeout = 0;
2779
      this._hoverState = '';
2780
      this._activeTrigger = {};
2781
      this._tether = null;
2782
2783
      // protected
2784
      this.element = element;
2785
      this.config = this._getConfig(config);
2786
      this.tip = null;
2787
2788
      this._setListeners();
2789
    }
2790
2791
    // getters
2792
2793
    // public
2794
2795
    Tooltip.prototype.enable = function enable() {
2796
      this._isEnabled = true;
2797
    };
2798
2799
    Tooltip.prototype.disable = function disable() {
2800
      this._isEnabled = false;
2801
    };
2802
2803
    Tooltip.prototype.toggleEnabled = function toggleEnabled() {
2804
      this._isEnabled = !this._isEnabled;
2805
    };
2806
2807
    Tooltip.prototype.toggle = function toggle(event) {
2808
      if (event) {
2809
        var dataKey = this.constructor.DATA_KEY;
2810
        var context = $(event.currentTarget).data(dataKey);
2811
2812
        if (!context) {
2813
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
2814
          $(event.currentTarget).data(dataKey, context);
2815
        }
2816
2817
        context._activeTrigger.click = !context._activeTrigger.click;
2818
2819
        if (context._isWithActiveTrigger()) {
2820
          context._enter(null, context);
2821
        } else {
2822
          context._leave(null, context);
2823
        }
2824
      } else {
2825
2826
        if ($(this.getTipElement()).hasClass(ClassName.IN)) {
2827
          this._leave(null, this);
2828
          return;
2829
        }
2830
2831
        this._enter(null, this);
2832
      }
2833
    };
2834
2835
    Tooltip.prototype.dispose = function dispose() {
2836
      clearTimeout(this._timeout);
2837
2838
      this.cleanupTether();
2839
2840
      $.removeData(this.element, this.constructor.DATA_KEY);
2841
2842
      $(this.element).off(this.constructor.EVENT_KEY);
2843
2844
      if (this.tip) {
2845
        $(this.tip).remove();
2846
      }
2847
2848
      this._isEnabled = null;
2849
      this._timeout = null;
2850
      this._hoverState = null;
2851
      this._activeTrigger = null;
2852
      this._tether = null;
2853
2854
      this.element = null;
2855
      this.config = null;
2856
      this.tip = null;
2857
    };
2858
2859
    Tooltip.prototype.show = function show() {
2860
      var _this16 = this;
2861
2862
      var showEvent = $.Event(this.constructor.Event.SHOW);
2863
2864
      if (this.isWithContent() && this._isEnabled) {
2865
        $(this.element).trigger(showEvent);
2866
2867
        var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
2868
2869
        if (showEvent.isDefaultPrevented() || !isInTheDom) {
2870
          return;
2871
        }
2872
2873
        var tip = this.getTipElement();
2874
        var tipId = Util.getUID(this.constructor.NAME);
2875
2876
        tip.setAttribute('id', tipId);
2877
        this.element.setAttribute('aria-describedby', tipId);
2878
2879
        this.setContent();
2880
2881
        if (this.config.animation) {
2882
          $(tip).addClass(ClassName.FADE);
2883
        }
2884
2885
        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
2886
2887
        var attachment = this._getAttachment(placement);
2888
2889
        $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
2890
2891
        $(this.element).trigger(this.constructor.Event.INSERTED);
2892
2893
        this._tether = new Tether({
2894
          attachment: attachment,
2895
          element: tip,
2896
          target: this.element,
2897
          classes: TetherClass,
2898
          classPrefix: CLASS_PREFIX,
2899
          offset: this.config.offset,
2900
          constraints: this.config.constraints,
2901
          addTargetClasses: false
2902
        });
2903
2904
        Util.reflow(tip);
2905
        this._tether.position();
2906
2907
        $(tip).addClass(ClassName.IN);
2908
2909
        var complete = function complete() {
2910
          var prevHoverState = _this16._hoverState;
2911
          _this16._hoverState = null;
2912
2913
          $(_this16.element).trigger(_this16.constructor.Event.SHOWN);
2914
2915
          if (prevHoverState === HoverState.OUT) {
2916
            _this16._leave(null, _this16);
2917
          }
2918
        };
2919
2920
        if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
2921
          $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
2922
          return;
2923
        }
2924
2925
        complete();
2926
      }
2927
    };
2928
2929
    Tooltip.prototype.hide = function hide(callback) {
2930
      var _this17 = this;
2931
2932
      var tip = this.getTipElement();
2933
      var hideEvent = $.Event(this.constructor.Event.HIDE);
2934
      var complete = function complete() {
2935
        if (_this17._hoverState !== HoverState.IN && tip.parentNode) {
2936
          tip.parentNode.removeChild(tip);
2937
        }
2938
2939
        _this17.element.removeAttribute('aria-describedby');
2940
        $(_this17.element).trigger(_this17.constructor.Event.HIDDEN);
2941
        _this17.cleanupTether();
2942
2943
        if (callback) {
2944
          callback();
2945
        }
2946
      };
2947
2948
      $(this.element).trigger(hideEvent);
2949
2950
      if (hideEvent.isDefaultPrevented()) {
2951
        return;
2952
      }
2953
2954
      $(tip).removeClass(ClassName.IN);
2955
2956
      if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
2957
2958
        $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
2959
      } else {
2960
        complete();
2961
      }
2962
2963
      this._hoverState = '';
2964
    };
2965
2966
    // protected
2967
2968
    Tooltip.prototype.isWithContent = function isWithContent() {
2969
      return Boolean(this.getTitle());
2970
    };
2971
2972
    Tooltip.prototype.getTipElement = function getTipElement() {
2973
      return this.tip = this.tip || $(this.config.template)[0];
2974
    };
2975
2976
    Tooltip.prototype.setContent = function setContent() {
2977
      var $tip = $(this.getTipElement());
2978
2979
      this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
2980
2981
      $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
2982
2983
      this.cleanupTether();
2984
    };
2985
2986
    Tooltip.prototype.setElementContent = function setElementContent($element, content) {
2987
      var html = this.config.html;
2988
      if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
2989
        // content is a DOM node or a jQuery
2990
        if (html) {
2991
          if (!$(content).parent().is($element)) {
2992
            $element.empty().append(content);
2993
          }
2994
        } else {
2995
          $element.text($(content).text());
2996
        }
2997
      } else {
2998
        $element[html ? 'html' : 'text'](content);
2999
      }
3000
    };
3001
3002
    Tooltip.prototype.getTitle = function getTitle() {
3003
      var title = this.element.getAttribute('data-original-title');
3004
3005
      if (!title) {
3006
        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
3007
      }
3008
3009
      return title;
3010
    };
3011
3012
    Tooltip.prototype.cleanupTether = function cleanupTether() {
3013
      if (this._tether) {
3014
        this._tether.destroy();
3015
      }
3016
    };
3017
3018
    // private
3019
3020
    Tooltip.prototype._getAttachment = function _getAttachment(placement) {
3021
      return AttachmentMap[placement.toUpperCase()];
3022
    };
3023
3024
    Tooltip.prototype._setListeners = function _setListeners() {
3025
      var _this18 = this;
3026
3027
      var triggers = this.config.trigger.split(' ');
3028
3029
      triggers.forEach(function (trigger) {
3030
        if (trigger === 'click') {
3031
          $(_this18.element).on(_this18.constructor.Event.CLICK, _this18.config.selector, $.proxy(_this18.toggle, _this18));
3032
        } else if (trigger !== Trigger.MANUAL) {
3033
          var eventIn = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSEENTER : _this18.constructor.Event.FOCUSIN;
3034
          var eventOut = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSELEAVE : _this18.constructor.Event.FOCUSOUT;
3035
3036
          $(_this18.element).on(eventIn, _this18.config.selector, $.proxy(_this18._enter, _this18)).on(eventOut, _this18.config.selector, $.proxy(_this18._leave, _this18));
3037
        }
3038
      });
3039
3040
      if (this.config.selector) {
3041
        this.config = $.extend({}, this.config, {
3042
          trigger: 'manual',
3043
          selector: ''
3044
        });
3045
      } else {
3046
        this._fixTitle();
3047
      }
3048
    };
3049
3050
    Tooltip.prototype._fixTitle = function _fixTitle() {
3051
      var titleType = _typeof(this.element.getAttribute('data-original-title'));
3052
      if (this.element.getAttribute('title') || titleType !== 'string') {
3053
        this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
3054
        this.element.setAttribute('title', '');
3055
      }
3056
    };
3057
3058
    Tooltip.prototype._enter = function _enter(event, context) {
3059
      var dataKey = this.constructor.DATA_KEY;
3060
3061
      context = context || $(event.currentTarget).data(dataKey);
3062
3063
      if (!context) {
3064
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3065
        $(event.currentTarget).data(dataKey, context);
3066
      }
3067
3068
      if (event) {
3069
        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
3070
      }
3071
3072
      if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
3073
        context._hoverState = HoverState.IN;
3074
        return;
3075
      }
3076
3077
      clearTimeout(context._timeout);
3078
3079
      context._hoverState = HoverState.IN;
3080
3081
      if (!context.config.delay || !context.config.delay.show) {
3082
        context.show();
3083
        return;
3084
      }
3085
3086
      context._timeout = setTimeout(function () {
3087
        if (context._hoverState === HoverState.IN) {
3088
          context.show();
3089
        }
3090
      }, context.config.delay.show);
3091
    };
3092
3093
    Tooltip.prototype._leave = function _leave(event, context) {
3094
      var dataKey = this.constructor.DATA_KEY;
3095
3096
      context = context || $(event.currentTarget).data(dataKey);
3097
3098
      if (!context) {
3099
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3100
        $(event.currentTarget).data(dataKey, context);
3101
      }
3102
3103
      if (event) {
3104
        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
3105
      }
3106
3107
      if (context._isWithActiveTrigger()) {
3108
        return;
3109
      }
3110
3111
      clearTimeout(context._timeout);
3112
3113
      context._hoverState = HoverState.OUT;
3114
3115
      if (!context.config.delay || !context.config.delay.hide) {
3116
        context.hide();
3117
        return;
3118
      }
3119
3120
      context._timeout = setTimeout(function () {
3121
        if (context._hoverState === HoverState.OUT) {
3122
          context.hide();
3123
        }
3124
      }, context.config.delay.hide);
3125
    };
3126
3127
    Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
3128
      for (var trigger in this._activeTrigger) {
0 ignored issues
show
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
3129
        if (this._activeTrigger[trigger]) {
3130
          return true;
3131
        }
3132
      }
3133
3134
      return false;
3135
    };
3136
3137
    Tooltip.prototype._getConfig = function _getConfig(config) {
3138
      config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
3139
3140
      if (config.delay && typeof config.delay === 'number') {
3141
        config.delay = {
3142
          show: config.delay,
3143
          hide: config.delay
3144
        };
3145
      }
3146
3147
      Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
3148
3149
      return config;
3150
    };
3151
3152
    Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
3153
      var config = {};
3154
3155
      if (this.config) {
3156
        for (var key in this.config) {
0 ignored issues
show
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
3157
          if (this.constructor.Default[key] !== this.config[key]) {
3158
            config[key] = this.config[key];
3159
          }
3160
        }
3161
      }
3162
3163
      return config;
3164
    };
3165
3166
    // static
3167
3168
    Tooltip._jQueryInterface = function _jQueryInterface(config) {
3169
      return this.each(function () {
3170
        var data = $(this).data(DATA_KEY);
3171
        var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
3172
3173
        if (!data && /dispose|hide/.test(config)) {
3174
          return;
3175
        }
3176
3177
        if (!data) {
3178
          data = new Tooltip(this, _config);
3179
          $(this).data(DATA_KEY, data);
3180
        }
3181
3182
        if (typeof config === 'string') {
3183
          if (data[config] === undefined) {
3184
            throw new Error('No method named "' + config + '"');
3185
          }
3186
          data[config]();
3187
        }
3188
      });
3189
    };
3190
3191
    _createClass(Tooltip, null, [{
3192
      key: 'VERSION',
3193
      get: function get() {
3194
        return VERSION;
3195
      }
3196
    }, {
3197
      key: 'Default',
3198
      get: function get() {
3199
        return Default;
3200
      }
3201
    }, {
3202
      key: 'NAME',
3203
      get: function get() {
3204
        return NAME;
3205
      }
3206
    }, {
3207
      key: 'DATA_KEY',
3208
      get: function get() {
3209
        return DATA_KEY;
3210
      }
3211
    }, {
3212
      key: 'Event',
3213
      get: function get() {
3214
        return Event;
3215
      }
3216
    }, {
3217
      key: 'EVENT_KEY',
3218
      get: function get() {
3219
        return EVENT_KEY;
3220
      }
3221
    }, {
3222
      key: 'DefaultType',
3223
      get: function get() {
3224
        return DefaultType;
3225
      }
3226
    }]);
3227
3228
    return Tooltip;
3229
  }();
3230
3231
  /**
3232
   * ------------------------------------------------------------------------
3233
   * jQuery
3234
   * ------------------------------------------------------------------------
3235
   */
3236
3237
  $.fn[NAME] = Tooltip._jQueryInterface;
3238
  $.fn[NAME].Constructor = Tooltip;
3239
  $.fn[NAME].noConflict = function () {
3240
    $.fn[NAME] = JQUERY_NO_CONFLICT;
3241
    return Tooltip._jQueryInterface;
3242
  };
3243
3244
  return Tooltip;
3245
}(jQuery);
3246
3247
/**
3248
 * --------------------------------------------------------------------------
3249
 * Bootstrap (v4.0.0-alpha.5): popover.js
3250
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3251
 * --------------------------------------------------------------------------
3252
 */
3253
3254
var Popover = function ($) {
3255
3256
  /**
3257
   * ------------------------------------------------------------------------
3258
   * Constants
3259
   * ------------------------------------------------------------------------
3260
   */
3261
3262
  var NAME = 'popover';
3263
  var VERSION = '4.0.0-alpha.5';
3264
  var DATA_KEY = 'bs.popover';
3265
  var EVENT_KEY = '.' + DATA_KEY;
3266
  var JQUERY_NO_CONFLICT = $.fn[NAME];
3267
3268
  var Default = $.extend({}, Tooltip.Default, {
3269
    placement: 'right',
3270
    trigger: 'click',
3271
    content: '',
3272
    template: '<div class="popover" role="tooltip">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
3273
  });
3274
3275
  var DefaultType = $.extend({}, Tooltip.DefaultType, {
3276
    content: '(string|element|function)'
3277
  });
3278
3279
  var ClassName = {
3280
    FADE: 'fade',
3281
    IN: 'in'
3282
  };
3283
3284
  var Selector = {
3285
    TITLE: '.popover-title',
3286
    CONTENT: '.popover-content'
3287
  };
3288
3289
  var Event = {
3290
    HIDE: 'hide' + EVENT_KEY,
3291
    HIDDEN: 'hidden' + EVENT_KEY,
3292
    SHOW: 'show' + EVENT_KEY,
3293
    SHOWN: 'shown' + EVENT_KEY,
3294
    INSERTED: 'inserted' + EVENT_KEY,
3295
    CLICK: 'click' + EVENT_KEY,
3296
    FOCUSIN: 'focusin' + EVENT_KEY,
3297
    FOCUSOUT: 'focusout' + EVENT_KEY,
3298
    MOUSEENTER: 'mouseenter' + EVENT_KEY,
3299
    MOUSELEAVE: 'mouseleave' + EVENT_KEY
3300
  };
3301
3302
  /**
3303
   * ------------------------------------------------------------------------
3304
   * Class Definition
3305
   * ------------------------------------------------------------------------
3306
   */
3307
3308
  var Popover = function (_Tooltip) {
3309
    _inherits(Popover, _Tooltip);
3310
3311
    function Popover() {
3312
      _classCallCheck(this, Popover);
3313
3314
      return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments));
3315
    }
3316
3317
    // overrides
3318
3319
    Popover.prototype.isWithContent = function isWithContent() {
3320
      return this.getTitle() || this._getContent();
3321
    };
3322
3323
    Popover.prototype.getTipElement = function getTipElement() {
3324
      return this.tip = this.tip || $(this.config.template)[0];
3325
    };
3326
3327
    Popover.prototype.setContent = function setContent() {
3328
      var $tip = $(this.getTipElement());
3329
3330
      // we use append for html objects to maintain js events
3331
      this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
3332
      this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
3333
3334
      $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
3335
3336
      this.cleanupTether();
3337
    };
3338
3339
    // private
3340
3341
    Popover.prototype._getContent = function _getContent() {
3342
      return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
3343
    };
3344
3345
    // static
3346
3347
    Popover._jQueryInterface = function _jQueryInterface(config) {
3348
      return this.each(function () {
3349
        var data = $(this).data(DATA_KEY);
3350
        var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
3351
3352
        if (!data && /destroy|hide/.test(config)) {
3353
          return;
3354
        }
3355
3356
        if (!data) {
3357
          data = new Popover(this, _config);
3358
          $(this).data(DATA_KEY, data);
3359
        }
3360
3361
        if (typeof config === 'string') {
3362
          if (data[config] === undefined) {
3363
            throw new Error('No method named "' + config + '"');
3364
          }
3365
          data[config]();
3366
        }
3367
      });
3368
    };
3369
3370
    _createClass(Popover, null, [{
3371
      key: 'VERSION',
3372
3373
3374
      // getters
3375
3376
      get: function get() {
3377
        return VERSION;
3378
      }
3379
    }, {
3380
      key: 'Default',
3381
      get: function get() {
3382
        return Default;
3383
      }
3384
    }, {
3385
      key: 'NAME',
3386
      get: function get() {
3387
        return NAME;
3388
      }
3389
    }, {
3390
      key: 'DATA_KEY',
3391
      get: function get() {
3392
        return DATA_KEY;
3393
      }
3394
    }, {
3395
      key: 'Event',
3396
      get: function get() {
3397
        return Event;
3398
      }
3399
    }, {
3400
      key: 'EVENT_KEY',
3401
      get: function get() {
3402
        return EVENT_KEY;
3403
      }
3404
    }, {
3405
      key: 'DefaultType',
3406
      get: function get() {
3407
        return DefaultType;
3408
      }
3409
    }]);
3410
3411
    return Popover;
3412
  }(Tooltip);
3413
3414
  /**
3415
   * ------------------------------------------------------------------------
3416
   * jQuery
3417
   * ------------------------------------------------------------------------
3418
   */
3419
3420
  $.fn[NAME] = Popover._jQueryInterface;
3421
  $.fn[NAME].Constructor = Popover;
3422
  $.fn[NAME].noConflict = function () {
3423
    $.fn[NAME] = JQUERY_NO_CONFLICT;
3424
    return Popover._jQueryInterface;
3425
  };
3426
3427
  return Popover;
3428
}(jQuery);
3429
3430
}();
3431