2 * Bootstrap v4.1.3 (https://getbootstrap.com/)
3 * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 (function (global, factory) {
7 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
8 typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
9 (factory((global.bootstrap = {}),global.jQuery));
10 }(this, (function (exports,$) { 'use strict';
12 $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
14 function _defineProperties(target, props) {
15 for (var i = 0; i < props.length; i++) {
16 var descriptor = props[i];
17 descriptor.enumerable = descriptor.enumerable || false;
18 descriptor.configurable = true;
19 if ("value" in descriptor) descriptor.writable = true;
20 Object.defineProperty(target, descriptor.key, descriptor);
24 function _createClass(Constructor, protoProps, staticProps) {
25 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
26 if (staticProps) _defineProperties(Constructor, staticProps);
30 function _defineProperty(obj, key, value) {
32 Object.defineProperty(obj, key, {
45 function _objectSpread(target) {
46 for (var i = 1; i < arguments.length; i++) {
47 var source = arguments[i] != null ? arguments[i] : {};
48 var ownKeys = Object.keys(source);
50 if (typeof Object.getOwnPropertySymbols === 'function') {
51 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
52 return Object.getOwnPropertyDescriptor(source, sym).enumerable;
56 ownKeys.forEach(function (key) {
57 _defineProperty(target, key, source[key]);
64 function _inheritsLoose(subClass, superClass) {
65 subClass.prototype = Object.create(superClass.prototype);
66 subClass.prototype.constructor = subClass;
67 subClass.__proto__ = superClass;
71 * --------------------------------------------------------------------------
72 * Bootstrap (v4.1.3): util.js
73 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
74 * --------------------------------------------------------------------------
77 var Util = function ($$$1) {
79 * ------------------------------------------------------------------------
80 * Private TransitionEnd Helpers
81 * ------------------------------------------------------------------------
83 var TRANSITION_END = 'transitionend';
84 var MAX_UID = 1000000;
85 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
87 function toType(obj) {
88 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
91 function getSpecialTransitionEndEvent() {
93 bindType: TRANSITION_END,
94 delegateType: TRANSITION_END,
95 handle: function handle(event) {
96 if ($$$1(event.target).is(this)) {
97 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
100 return undefined; // eslint-disable-line no-undefined
105 function transitionEndEmulator(duration) {
109 $$$1(this).one(Util.TRANSITION_END, function () {
112 setTimeout(function () {
114 Util.triggerTransitionEnd(_this);
120 function setTransitionEndSupport() {
121 $$$1.fn.emulateTransitionEnd = transitionEndEmulator;
122 $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
125 * --------------------------------------------------------------------------
127 * --------------------------------------------------------------------------
132 TRANSITION_END: 'bsTransitionEnd',
133 getUID: function getUID(prefix) {
135 // eslint-disable-next-line no-bitwise
136 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
137 } while (document.getElementById(prefix));
141 getSelectorFromElement: function getSelectorFromElement(element) {
142 var selector = element.getAttribute('data-target');
144 if (!selector || selector === '#') {
145 selector = element.getAttribute('href') || '';
149 return document.querySelector(selector) ? selector : null;
154 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
157 } // Get transition-duration of the element
160 var transitionDuration = $$$1(element).css('transition-duration');
161 var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found
163 if (!floatTransitionDuration) {
165 } // If multiple durations are defined, take the first
168 transitionDuration = transitionDuration.split(',')[0];
169 return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
171 reflow: function reflow(element) {
172 return element.offsetHeight;
174 triggerTransitionEnd: function triggerTransitionEnd(element) {
175 $$$1(element).trigger(TRANSITION_END);
177 // TODO: Remove in v5
178 supportsTransitionEnd: function supportsTransitionEnd() {
179 return Boolean(TRANSITION_END);
181 isElement: function isElement(obj) {
182 return (obj[0] || obj).nodeType;
184 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
185 for (var property in configTypes) {
186 if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
187 var expectedTypes = configTypes[property];
188 var value = config[property];
189 var valueType = value && Util.isElement(value) ? 'element' : toType(value);
191 if (!new RegExp(expectedTypes).test(valueType)) {
192 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
198 setTransitionEndSupport();
203 * --------------------------------------------------------------------------
204 * Bootstrap (v4.1.3): alert.js
205 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
206 * --------------------------------------------------------------------------
209 var Alert = function ($$$1) {
211 * ------------------------------------------------------------------------
213 * ------------------------------------------------------------------------
216 var VERSION = '4.1.3';
217 var DATA_KEY = 'bs.alert';
218 var EVENT_KEY = "." + DATA_KEY;
219 var DATA_API_KEY = '.data-api';
220 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
222 DISMISS: '[data-dismiss="alert"]'
225 CLOSE: "close" + EVENT_KEY,
226 CLOSED: "closed" + EVENT_KEY,
227 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
234 * ------------------------------------------------------------------------
236 * ------------------------------------------------------------------------
244 function Alert(element) {
245 this._element = element;
249 var _proto = Alert.prototype;
252 _proto.close = function close(element) {
253 var rootElement = this._element;
256 rootElement = this._getRootElement(element);
259 var customEvent = this._triggerCloseEvent(rootElement);
261 if (customEvent.isDefaultPrevented()) {
265 this._removeElement(rootElement);
268 _proto.dispose = function dispose() {
269 $$$1.removeData(this._element, DATA_KEY);
270 this._element = null;
274 _proto._getRootElement = function _getRootElement(element) {
275 var selector = Util.getSelectorFromElement(element);
279 parent = document.querySelector(selector);
283 parent = $$$1(element).closest("." + ClassName.ALERT)[0];
289 _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
290 var closeEvent = $$$1.Event(Event.CLOSE);
291 $$$1(element).trigger(closeEvent);
295 _proto._removeElement = function _removeElement(element) {
298 $$$1(element).removeClass(ClassName.SHOW);
300 if (!$$$1(element).hasClass(ClassName.FADE)) {
301 this._destroyElement(element);
306 var transitionDuration = Util.getTransitionDurationFromElement(element);
307 $$$1(element).one(Util.TRANSITION_END, function (event) {
308 return _this._destroyElement(element, event);
309 }).emulateTransitionEnd(transitionDuration);
312 _proto._destroyElement = function _destroyElement(element) {
313 $$$1(element).detach().trigger(Event.CLOSED).remove();
317 Alert._jQueryInterface = function _jQueryInterface(config) {
318 return this.each(function () {
319 var $element = $$$1(this);
320 var data = $element.data(DATA_KEY);
323 data = new Alert(this);
324 $element.data(DATA_KEY, data);
327 if (config === 'close') {
333 Alert._handleDismiss = function _handleDismiss(alertInstance) {
334 return function (event) {
336 event.preventDefault();
339 alertInstance.close(this);
343 _createClass(Alert, null, [{
345 get: function get() {
353 * ------------------------------------------------------------------------
354 * Data Api implementation
355 * ------------------------------------------------------------------------
359 $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
361 * ------------------------------------------------------------------------
363 * ------------------------------------------------------------------------
366 $$$1.fn[NAME] = Alert._jQueryInterface;
367 $$$1.fn[NAME].Constructor = Alert;
369 $$$1.fn[NAME].noConflict = function () {
370 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
371 return Alert._jQueryInterface;
378 * --------------------------------------------------------------------------
379 * Bootstrap (v4.1.3): button.js
380 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
381 * --------------------------------------------------------------------------
384 var Button = function ($$$1) {
386 * ------------------------------------------------------------------------
388 * ------------------------------------------------------------------------
391 var VERSION = '4.1.3';
392 var DATA_KEY = 'bs.button';
393 var EVENT_KEY = "." + DATA_KEY;
394 var DATA_API_KEY = '.data-api';
395 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
402 DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
403 DATA_TOGGLE: '[data-toggle="buttons"]',
409 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
410 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
412 * ------------------------------------------------------------------------
414 * ------------------------------------------------------------------------
422 function Button(element) {
423 this._element = element;
427 var _proto = Button.prototype;
430 _proto.toggle = function toggle() {
431 var triggerChangeEvent = true;
432 var addAriaPressed = true;
433 var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
436 var input = this._element.querySelector(Selector.INPUT);
439 if (input.type === 'radio') {
440 if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
441 triggerChangeEvent = false;
443 var activeElement = rootElement.querySelector(Selector.ACTIVE);
446 $$$1(activeElement).removeClass(ClassName.ACTIVE);
451 if (triggerChangeEvent) {
452 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
456 input.checked = !this._element.classList.contains(ClassName.ACTIVE);
457 $$$1(input).trigger('change');
461 addAriaPressed = false;
465 if (addAriaPressed) {
466 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
469 if (triggerChangeEvent) {
470 $$$1(this._element).toggleClass(ClassName.ACTIVE);
474 _proto.dispose = function dispose() {
475 $$$1.removeData(this._element, DATA_KEY);
476 this._element = null;
480 Button._jQueryInterface = function _jQueryInterface(config) {
481 return this.each(function () {
482 var data = $$$1(this).data(DATA_KEY);
485 data = new Button(this);
486 $$$1(this).data(DATA_KEY, data);
489 if (config === 'toggle') {
495 _createClass(Button, null, [{
497 get: function get() {
505 * ------------------------------------------------------------------------
506 * Data Api implementation
507 * ------------------------------------------------------------------------
511 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
512 event.preventDefault();
513 var button = event.target;
515 if (!$$$1(button).hasClass(ClassName.BUTTON)) {
516 button = $$$1(button).closest(Selector.BUTTON);
519 Button._jQueryInterface.call($$$1(button), 'toggle');
520 }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
521 var button = $$$1(event.target).closest(Selector.BUTTON)[0];
522 $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
525 * ------------------------------------------------------------------------
527 * ------------------------------------------------------------------------
530 $$$1.fn[NAME] = Button._jQueryInterface;
531 $$$1.fn[NAME].Constructor = Button;
533 $$$1.fn[NAME].noConflict = function () {
534 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
535 return Button._jQueryInterface;
542 * --------------------------------------------------------------------------
543 * Bootstrap (v4.1.3): carousel.js
544 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
545 * --------------------------------------------------------------------------
548 var Carousel = function ($$$1) {
550 * ------------------------------------------------------------------------
552 * ------------------------------------------------------------------------
554 var NAME = 'carousel';
555 var VERSION = '4.1.3';
556 var DATA_KEY = 'bs.carousel';
557 var EVENT_KEY = "." + DATA_KEY;
558 var DATA_API_KEY = '.data-api';
559 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
560 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
562 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
564 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
574 interval: '(number|boolean)',
576 slide: '(boolean|string)',
577 pause: '(string|boolean)',
587 SLIDE: "slide" + EVENT_KEY,
588 SLID: "slid" + EVENT_KEY,
589 KEYDOWN: "keydown" + EVENT_KEY,
590 MOUSEENTER: "mouseenter" + EVENT_KEY,
591 MOUSELEAVE: "mouseleave" + EVENT_KEY,
592 TOUCHEND: "touchend" + EVENT_KEY,
593 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
594 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
597 CAROUSEL: 'carousel',
600 RIGHT: 'carousel-item-right',
601 LEFT: 'carousel-item-left',
602 NEXT: 'carousel-item-next',
603 PREV: 'carousel-item-prev',
604 ITEM: 'carousel-item'
608 ACTIVE_ITEM: '.active.carousel-item',
609 ITEM: '.carousel-item',
610 NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
611 INDICATORS: '.carousel-indicators',
612 DATA_SLIDE: '[data-slide], [data-slide-to]',
613 DATA_RIDE: '[data-ride="carousel"]'
615 * ------------------------------------------------------------------------
617 * ------------------------------------------------------------------------
625 function Carousel(element, config) {
627 this._interval = null;
628 this._activeElement = null;
629 this._isPaused = false;
630 this._isSliding = false;
631 this.touchTimeout = null;
632 this._config = this._getConfig(config);
633 this._element = $$$1(element)[0];
634 this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
636 this._addEventListeners();
640 var _proto = Carousel.prototype;
643 _proto.next = function next() {
644 if (!this._isSliding) {
645 this._slide(Direction.NEXT);
649 _proto.nextWhenVisible = function nextWhenVisible() {
650 // Don't call next when the page isn't visible
651 // or the carousel or its parent isn't visible
652 if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
657 _proto.prev = function prev() {
658 if (!this._isSliding) {
659 this._slide(Direction.PREV);
663 _proto.pause = function pause(event) {
665 this._isPaused = true;
668 if (this._element.querySelector(Selector.NEXT_PREV)) {
669 Util.triggerTransitionEnd(this._element);
673 clearInterval(this._interval);
674 this._interval = null;
677 _proto.cycle = function cycle(event) {
679 this._isPaused = false;
682 if (this._interval) {
683 clearInterval(this._interval);
684 this._interval = null;
687 if (this._config.interval && !this._isPaused) {
688 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
692 _proto.to = function to(index) {
695 this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
697 var activeIndex = this._getItemIndex(this._activeElement);
699 if (index > this._items.length - 1 || index < 0) {
703 if (this._isSliding) {
704 $$$1(this._element).one(Event.SLID, function () {
705 return _this.to(index);
710 if (activeIndex === index) {
716 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
718 this._slide(direction, this._items[index]);
721 _proto.dispose = function dispose() {
722 $$$1(this._element).off(EVENT_KEY);
723 $$$1.removeData(this._element, DATA_KEY);
726 this._element = null;
727 this._interval = null;
728 this._isPaused = null;
729 this._isSliding = null;
730 this._activeElement = null;
731 this._indicatorsElement = null;
735 _proto._getConfig = function _getConfig(config) {
736 config = _objectSpread({}, Default, config);
737 Util.typeCheckConfig(NAME, config, DefaultType);
741 _proto._addEventListeners = function _addEventListeners() {
744 if (this._config.keyboard) {
745 $$$1(this._element).on(Event.KEYDOWN, function (event) {
746 return _this2._keydown(event);
750 if (this._config.pause === 'hover') {
751 $$$1(this._element).on(Event.MOUSEENTER, function (event) {
752 return _this2.pause(event);
753 }).on(Event.MOUSELEAVE, function (event) {
754 return _this2.cycle(event);
757 if ('ontouchstart' in document.documentElement) {
758 // If it's a touch-enabled device, mouseenter/leave are fired as
759 // part of the mouse compatibility events on first tap - the carousel
760 // would stop cycling until user tapped out of it;
761 // here, we listen for touchend, explicitly pause the carousel
762 // (as if it's the second time we tap on it, mouseenter compat event
763 // is NOT fired) and after a timeout (to allow for mouse compatibility
764 // events to fire) we explicitly restart cycling
765 $$$1(this._element).on(Event.TOUCHEND, function () {
768 if (_this2.touchTimeout) {
769 clearTimeout(_this2.touchTimeout);
772 _this2.touchTimeout = setTimeout(function (event) {
773 return _this2.cycle(event);
774 }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
780 _proto._keydown = function _keydown(event) {
781 if (/input|textarea/i.test(event.target.tagName)) {
785 switch (event.which) {
786 case ARROW_LEFT_KEYCODE:
787 event.preventDefault();
791 case ARROW_RIGHT_KEYCODE:
792 event.preventDefault();
800 _proto._getItemIndex = function _getItemIndex(element) {
801 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
802 return this._items.indexOf(element);
805 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
806 var isNextDirection = direction === Direction.NEXT;
807 var isPrevDirection = direction === Direction.PREV;
809 var activeIndex = this._getItemIndex(activeElement);
811 var lastItemIndex = this._items.length - 1;
812 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
814 if (isGoingToWrap && !this._config.wrap) {
815 return activeElement;
818 var delta = direction === Direction.PREV ? -1 : 1;
819 var itemIndex = (activeIndex + delta) % this._items.length;
820 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
823 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
824 var targetIndex = this._getItemIndex(relatedTarget);
826 var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
828 var slideEvent = $$$1.Event(Event.SLIDE, {
829 relatedTarget: relatedTarget,
830 direction: eventDirectionName,
834 $$$1(this._element).trigger(slideEvent);
838 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
839 if (this._indicatorsElement) {
840 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
841 $$$1(indicators).removeClass(ClassName.ACTIVE);
843 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
846 $$$1(nextIndicator).addClass(ClassName.ACTIVE);
851 _proto._slide = function _slide(direction, element) {
854 var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
856 var activeElementIndex = this._getItemIndex(activeElement);
858 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
860 var nextElementIndex = this._getItemIndex(nextElement);
862 var isCycling = Boolean(this._interval);
863 var directionalClassName;
865 var eventDirectionName;
867 if (direction === Direction.NEXT) {
868 directionalClassName = ClassName.LEFT;
869 orderClassName = ClassName.NEXT;
870 eventDirectionName = Direction.LEFT;
872 directionalClassName = ClassName.RIGHT;
873 orderClassName = ClassName.PREV;
874 eventDirectionName = Direction.RIGHT;
877 if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
878 this._isSliding = false;
882 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
884 if (slideEvent.isDefaultPrevented()) {
888 if (!activeElement || !nextElement) {
889 // Some weirdness is happening, so we bail
893 this._isSliding = true;
899 this._setActiveIndicatorElement(nextElement);
901 var slidEvent = $$$1.Event(Event.SLID, {
902 relatedTarget: nextElement,
903 direction: eventDirectionName,
904 from: activeElementIndex,
908 if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
909 $$$1(nextElement).addClass(orderClassName);
910 Util.reflow(nextElement);
911 $$$1(activeElement).addClass(directionalClassName);
912 $$$1(nextElement).addClass(directionalClassName);
913 var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
914 $$$1(activeElement).one(Util.TRANSITION_END, function () {
915 $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
916 $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
917 _this3._isSliding = false;
918 setTimeout(function () {
919 return $$$1(_this3._element).trigger(slidEvent);
921 }).emulateTransitionEnd(transitionDuration);
923 $$$1(activeElement).removeClass(ClassName.ACTIVE);
924 $$$1(nextElement).addClass(ClassName.ACTIVE);
925 this._isSliding = false;
926 $$$1(this._element).trigger(slidEvent);
935 Carousel._jQueryInterface = function _jQueryInterface(config) {
936 return this.each(function () {
937 var data = $$$1(this).data(DATA_KEY);
939 var _config = _objectSpread({}, Default, $$$1(this).data());
941 if (typeof config === 'object') {
942 _config = _objectSpread({}, _config, config);
945 var action = typeof config === 'string' ? config : _config.slide;
948 data = new Carousel(this, _config);
949 $$$1(this).data(DATA_KEY, data);
952 if (typeof config === 'number') {
954 } else if (typeof action === 'string') {
955 if (typeof data[action] === 'undefined') {
956 throw new TypeError("No method named \"" + action + "\"");
960 } else if (_config.interval) {
967 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
968 var selector = Util.getSelectorFromElement(this);
974 var target = $$$1(selector)[0];
976 if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
980 var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
982 var slideIndex = this.getAttribute('data-slide-to');
985 config.interval = false;
988 Carousel._jQueryInterface.call($$$1(target), config);
991 $$$1(target).data(DATA_KEY).to(slideIndex);
994 event.preventDefault();
997 _createClass(Carousel, null, [{
999 get: function get() {
1004 get: function get() {
1012 * ------------------------------------------------------------------------
1013 * Data Api implementation
1014 * ------------------------------------------------------------------------
1018 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
1019 $$$1(window).on(Event.LOAD_DATA_API, function () {
1020 var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
1022 for (var i = 0, len = carousels.length; i < len; i++) {
1023 var $carousel = $$$1(carousels[i]);
1025 Carousel._jQueryInterface.call($carousel, $carousel.data());
1029 * ------------------------------------------------------------------------
1031 * ------------------------------------------------------------------------
1034 $$$1.fn[NAME] = Carousel._jQueryInterface;
1035 $$$1.fn[NAME].Constructor = Carousel;
1037 $$$1.fn[NAME].noConflict = function () {
1038 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
1039 return Carousel._jQueryInterface;
1046 * --------------------------------------------------------------------------
1047 * Bootstrap (v4.1.3): collapse.js
1048 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1049 * --------------------------------------------------------------------------
1052 var Collapse = function ($$$1) {
1054 * ------------------------------------------------------------------------
1056 * ------------------------------------------------------------------------
1058 var NAME = 'collapse';
1059 var VERSION = '4.1.3';
1060 var DATA_KEY = 'bs.collapse';
1061 var EVENT_KEY = "." + DATA_KEY;
1062 var DATA_API_KEY = '.data-api';
1063 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
1070 parent: '(string|element)'
1073 SHOW: "show" + EVENT_KEY,
1074 SHOWN: "shown" + EVENT_KEY,
1075 HIDE: "hide" + EVENT_KEY,
1076 HIDDEN: "hidden" + EVENT_KEY,
1077 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
1081 COLLAPSE: 'collapse',
1082 COLLAPSING: 'collapsing',
1083 COLLAPSED: 'collapsed'
1090 ACTIVES: '.show, .collapsing',
1091 DATA_TOGGLE: '[data-toggle="collapse"]'
1093 * ------------------------------------------------------------------------
1095 * ------------------------------------------------------------------------
1103 function Collapse(element, config) {
1104 this._isTransitioning = false;
1105 this._element = element;
1106 this._config = this._getConfig(config);
1107 this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
1108 var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
1110 for (var i = 0, len = toggleList.length; i < len; i++) {
1111 var elem = toggleList[i];
1112 var selector = Util.getSelectorFromElement(elem);
1113 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
1114 return foundElem === element;
1117 if (selector !== null && filterElement.length > 0) {
1118 this._selector = selector;
1120 this._triggerArray.push(elem);
1124 this._parent = this._config.parent ? this._getParent() : null;
1126 if (!this._config.parent) {
1127 this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1130 if (this._config.toggle) {
1136 var _proto = Collapse.prototype;
1139 _proto.toggle = function toggle() {
1140 if ($$$1(this._element).hasClass(ClassName.SHOW)) {
1147 _proto.show = function show() {
1150 if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
1158 actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
1159 return elem.getAttribute('data-parent') === _this._config.parent;
1162 if (actives.length === 0) {
1168 activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
1170 if (activesData && activesData._isTransitioning) {
1175 var startEvent = $$$1.Event(Event.SHOW);
1176 $$$1(this._element).trigger(startEvent);
1178 if (startEvent.isDefaultPrevented()) {
1183 Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
1186 $$$1(actives).data(DATA_KEY, null);
1190 var dimension = this._getDimension();
1192 $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
1193 this._element.style[dimension] = 0;
1195 if (this._triggerArray.length) {
1196 $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
1199 this.setTransitioning(true);
1201 var complete = function complete() {
1202 $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
1203 _this._element.style[dimension] = '';
1205 _this.setTransitioning(false);
1207 $$$1(_this._element).trigger(Event.SHOWN);
1210 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1211 var scrollSize = "scroll" + capitalizedDimension;
1212 var transitionDuration = Util.getTransitionDurationFromElement(this._element);
1213 $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
1214 this._element.style[dimension] = this._element[scrollSize] + "px";
1217 _proto.hide = function hide() {
1220 if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
1224 var startEvent = $$$1.Event(Event.HIDE);
1225 $$$1(this._element).trigger(startEvent);
1227 if (startEvent.isDefaultPrevented()) {
1231 var dimension = this._getDimension();
1233 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
1234 Util.reflow(this._element);
1235 $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
1236 var triggerArrayLength = this._triggerArray.length;
1238 if (triggerArrayLength > 0) {
1239 for (var i = 0; i < triggerArrayLength; i++) {
1240 var trigger = this._triggerArray[i];
1241 var selector = Util.getSelectorFromElement(trigger);
1243 if (selector !== null) {
1244 var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));
1246 if (!$elem.hasClass(ClassName.SHOW)) {
1247 $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
1253 this.setTransitioning(true);
1255 var complete = function complete() {
1256 _this2.setTransitioning(false);
1258 $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
1261 this._element.style[dimension] = '';
1262 var transitionDuration = Util.getTransitionDurationFromElement(this._element);
1263 $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
1266 _proto.setTransitioning = function setTransitioning(isTransitioning) {
1267 this._isTransitioning = isTransitioning;
1270 _proto.dispose = function dispose() {
1271 $$$1.removeData(this._element, DATA_KEY);
1272 this._config = null;
1273 this._parent = null;
1274 this._element = null;
1275 this._triggerArray = null;
1276 this._isTransitioning = null;
1280 _proto._getConfig = function _getConfig(config) {
1281 config = _objectSpread({}, Default, config);
1282 config.toggle = Boolean(config.toggle); // Coerce string values
1284 Util.typeCheckConfig(NAME, config, DefaultType);
1288 _proto._getDimension = function _getDimension() {
1289 var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
1290 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
1293 _proto._getParent = function _getParent() {
1298 if (Util.isElement(this._config.parent)) {
1299 parent = this._config.parent; // It's a jQuery object
1301 if (typeof this._config.parent.jquery !== 'undefined') {
1302 parent = this._config.parent[0];
1305 parent = document.querySelector(this._config.parent);
1308 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
1309 var children = [].slice.call(parent.querySelectorAll(selector));
1310 $$$1(children).each(function (i, element) {
1311 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
1316 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
1318 var isOpen = $$$1(element).hasClass(ClassName.SHOW);
1320 if (triggerArray.length) {
1321 $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
1327 Collapse._getTargetFromElement = function _getTargetFromElement(element) {
1328 var selector = Util.getSelectorFromElement(element);
1329 return selector ? document.querySelector(selector) : null;
1332 Collapse._jQueryInterface = function _jQueryInterface(config) {
1333 return this.each(function () {
1334 var $this = $$$1(this);
1335 var data = $this.data(DATA_KEY);
1337 var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
1339 if (!data && _config.toggle && /show|hide/.test(config)) {
1340 _config.toggle = false;
1344 data = new Collapse(this, _config);
1345 $this.data(DATA_KEY, data);
1348 if (typeof config === 'string') {
1349 if (typeof data[config] === 'undefined') {
1350 throw new TypeError("No method named \"" + config + "\"");
1358 _createClass(Collapse, null, [{
1360 get: function get() {
1365 get: function get() {
1373 * ------------------------------------------------------------------------
1374 * Data Api implementation
1375 * ------------------------------------------------------------------------
1379 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
1380 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
1381 if (event.currentTarget.tagName === 'A') {
1382 event.preventDefault();
1385 var $trigger = $$$1(this);
1386 var selector = Util.getSelectorFromElement(this);
1387 var selectors = [].slice.call(document.querySelectorAll(selector));
1388 $$$1(selectors).each(function () {
1389 var $target = $$$1(this);
1390 var data = $target.data(DATA_KEY);
1391 var config = data ? 'toggle' : $trigger.data();
1393 Collapse._jQueryInterface.call($target, config);
1397 * ------------------------------------------------------------------------
1399 * ------------------------------------------------------------------------
1402 $$$1.fn[NAME] = Collapse._jQueryInterface;
1403 $$$1.fn[NAME].Constructor = Collapse;
1405 $$$1.fn[NAME].noConflict = function () {
1406 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
1407 return Collapse._jQueryInterface;
1414 * @fileOverview Kickass library to create and place poppers near their reference elements.
1417 * Copyright (c) 2016 Federico Zivolo and contributors
1419 * Permission is hereby granted, free of charge, to any person obtaining a copy
1420 * of this software and associated documentation files (the "Software"), to deal
1421 * in the Software without restriction, including without limitation the rights
1422 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1423 * copies of the Software, and to permit persons to whom the Software is
1424 * furnished to do so, subject to the following conditions:
1426 * The above copyright notice and this permission notice shall be included in all
1427 * copies or substantial portions of the Software.
1429 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1430 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1431 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1432 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1433 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1434 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1437 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
1439 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
1440 var timeoutDuration = 0;
1441 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
1442 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
1443 timeoutDuration = 1;
1448 function microtaskDebounce(fn) {
1450 return function () {
1455 window.Promise.resolve().then(function () {
1462 function taskDebounce(fn) {
1463 var scheduled = false;
1464 return function () {
1467 setTimeout(function () {
1470 }, timeoutDuration);
1475 var supportsMicroTasks = isBrowser && window.Promise;
1478 * Create a debounced version of a method, that's asynchronously deferred
1479 * but called in the minimum time possible.
1482 * @memberof Popper.Utils
1483 * @argument {Function} fn
1484 * @returns {Function}
1486 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
1489 * Check if the given variable is a function
1491 * @memberof Popper.Utils
1492 * @argument {Any} functionToCheck - variable to check
1493 * @returns {Boolean} answer to: is a function?
1495 function isFunction(functionToCheck) {
1497 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1501 * Get CSS computed property of the given element
1503 * @memberof Popper.Utils
1504 * @argument {Eement} element
1505 * @argument {String} property
1507 function getStyleComputedProperty(element, property) {
1508 if (element.nodeType !== 1) {
1511 // NOTE: 1 DOM access here
1512 var css = getComputedStyle(element, null);
1513 return property ? css[property] : css;
1517 * Returns the parentNode or the host of the element
1519 * @memberof Popper.Utils
1520 * @argument {Element} element
1521 * @returns {Element} parent
1523 function getParentNode(element) {
1524 if (element.nodeName === 'HTML') {
1527 return element.parentNode || element.host;
1531 * Returns the scrolling parent of the given element
1533 * @memberof Popper.Utils
1534 * @argument {Element} element
1535 * @returns {Element} scroll parent
1537 function getScrollParent(element) {
1538 // Return body, `getScroll` will take care to get the correct `scrollTop` from it
1540 return document.body;
1543 switch (element.nodeName) {
1546 return element.ownerDocument.body;
1548 return element.body;
1551 // Firefox want us to check `-x` and `-y` variations as well
1553 var _getStyleComputedProp = getStyleComputedProperty(element),
1554 overflow = _getStyleComputedProp.overflow,
1555 overflowX = _getStyleComputedProp.overflowX,
1556 overflowY = _getStyleComputedProp.overflowY;
1558 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
1562 return getScrollParent(getParentNode(element));
1565 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
1566 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
1569 * Determines if the browser is Internet Explorer
1571 * @memberof Popper.Utils
1572 * @param {Number} version to check
1573 * @returns {Boolean} isIE
1575 function isIE(version) {
1576 if (version === 11) {
1579 if (version === 10) {
1582 return isIE11 || isIE10;
1586 * Returns the offset parent of the given element
1588 * @memberof Popper.Utils
1589 * @argument {Element} element
1590 * @returns {Element} offset parent
1592 function getOffsetParent(element) {
1594 return document.documentElement;
1597 var noOffsetParent = isIE(10) ? document.body : null;
1599 // NOTE: 1 DOM access here
1600 var offsetParent = element.offsetParent;
1601 // Skip hidden elements which don't have an offsetParent
1602 while (offsetParent === noOffsetParent && element.nextElementSibling) {
1603 offsetParent = (element = element.nextElementSibling).offsetParent;
1606 var nodeName = offsetParent && offsetParent.nodeName;
1608 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
1609 return element ? element.ownerDocument.documentElement : document.documentElement;
1612 // .offsetParent will return the closest TD or TABLE in case
1613 // no offsetParent is present, I hate this job...
1614 if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
1615 return getOffsetParent(offsetParent);
1618 return offsetParent;
1621 function isOffsetContainer(element) {
1622 var nodeName = element.nodeName;
1624 if (nodeName === 'BODY') {
1627 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
1631 * Finds the root node (document, shadowDOM root) of the given element
1633 * @memberof Popper.Utils
1634 * @argument {Element} node
1635 * @returns {Element} root node
1637 function getRoot(node) {
1638 if (node.parentNode !== null) {
1639 return getRoot(node.parentNode);
1646 * Finds the offset parent common to the two provided nodes
1648 * @memberof Popper.Utils
1649 * @argument {Element} element1
1650 * @argument {Element} element2
1651 * @returns {Element} common offset parent
1653 function findCommonOffsetParent(element1, element2) {
1654 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
1655 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
1656 return document.documentElement;
1659 // Here we make sure to give as "start" the element that comes first in the DOM
1660 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
1661 var start = order ? element1 : element2;
1662 var end = order ? element2 : element1;
1664 // Get common ancestor container
1665 var range = document.createRange();
1666 range.setStart(start, 0);
1667 range.setEnd(end, 0);
1668 var commonAncestorContainer = range.commonAncestorContainer;
1670 // Both nodes are inside #document
1672 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
1673 if (isOffsetContainer(commonAncestorContainer)) {
1674 return commonAncestorContainer;
1677 return getOffsetParent(commonAncestorContainer);
1680 // one of the nodes is inside shadowDOM, find which one
1681 var element1root = getRoot(element1);
1682 if (element1root.host) {
1683 return findCommonOffsetParent(element1root.host, element2);
1685 return findCommonOffsetParent(element1, getRoot(element2).host);
1690 * Gets the scroll value of the given element in the given side (top and left)
1692 * @memberof Popper.Utils
1693 * @argument {Element} element
1694 * @argument {String} side `top` or `left`
1695 * @returns {number} amount of scrolled pixels
1697 function getScroll(element) {
1698 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
1700 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
1701 var nodeName = element.nodeName;
1703 if (nodeName === 'BODY' || nodeName === 'HTML') {
1704 var html = element.ownerDocument.documentElement;
1705 var scrollingElement = element.ownerDocument.scrollingElement || html;
1706 return scrollingElement[upperSide];
1709 return element[upperSide];
1713 * Sum or subtract the element scroll values (left and top) from a given rect object
1715 * @memberof Popper.Utils
1716 * @param {Object} rect - Rect object you want to change
1717 * @param {HTMLElement} element - The element from the function reads the scroll values
1718 * @param {Boolean} subtract - set to true if you want to subtract the scroll values
1719 * @return {Object} rect - The modifier rect object
1721 function includeScroll(rect, element) {
1722 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1724 var scrollTop = getScroll(element, 'top');
1725 var scrollLeft = getScroll(element, 'left');
1726 var modifier = subtract ? -1 : 1;
1727 rect.top += scrollTop * modifier;
1728 rect.bottom += scrollTop * modifier;
1729 rect.left += scrollLeft * modifier;
1730 rect.right += scrollLeft * modifier;
1735 * Helper to detect borders of a given element
1737 * @memberof Popper.Utils
1738 * @param {CSSStyleDeclaration} styles
1739 * Result of `getStyleComputedProperty` on the given element
1740 * @param {String} axis - `x` or `y`
1741 * @return {number} borders - The borders size of the given axis
1744 function getBordersSize(styles, axis) {
1745 var sideA = axis === 'x' ? 'Left' : 'Top';
1746 var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
1748 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
1751 function getSize(axis, body, html, computedStyle) {
1752 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
1755 function getWindowSizes() {
1756 var body = document.body;
1757 var html = document.documentElement;
1758 var computedStyle = isIE(10) && getComputedStyle(html);
1761 height: getSize('Height', body, html, computedStyle),
1762 width: getSize('Width', body, html, computedStyle)
1766 var classCallCheck = function (instance, Constructor) {
1767 if (!(instance instanceof Constructor)) {
1768 throw new TypeError("Cannot call a class as a function");
1772 var createClass = function () {
1773 function defineProperties(target, props) {
1774 for (var i = 0; i < props.length; i++) {
1775 var descriptor = props[i];
1776 descriptor.enumerable = descriptor.enumerable || false;
1777 descriptor.configurable = true;
1778 if ("value" in descriptor) descriptor.writable = true;
1779 Object.defineProperty(target, descriptor.key, descriptor);
1783 return function (Constructor, protoProps, staticProps) {
1784 if (protoProps) defineProperties(Constructor.prototype, protoProps);
1785 if (staticProps) defineProperties(Constructor, staticProps);
1794 var defineProperty = function (obj, key, value) {
1796 Object.defineProperty(obj, key, {
1809 var _extends = Object.assign || function (target) {
1810 for (var i = 1; i < arguments.length; i++) {
1811 var source = arguments[i];
1813 for (var key in source) {
1814 if (Object.prototype.hasOwnProperty.call(source, key)) {
1815 target[key] = source[key];
1824 * Given element offsets, generate an output similar to getBoundingClientRect
1826 * @memberof Popper.Utils
1827 * @argument {Object} offsets
1828 * @returns {Object} ClientRect like output
1830 function getClientRect(offsets) {
1831 return _extends({}, offsets, {
1832 right: offsets.left + offsets.width,
1833 bottom: offsets.top + offsets.height
1838 * Get bounding client rect of given element
1840 * @memberof Popper.Utils
1841 * @param {HTMLElement} element
1842 * @return {Object} client rect
1844 function getBoundingClientRect(element) {
1847 // IE10 10 FIX: Please, don't ask, the element isn't
1848 // considered in DOM in some circumstances...
1849 // This isn't reproducible in IE10 compatibility mode of IE11
1852 rect = element.getBoundingClientRect();
1853 var scrollTop = getScroll(element, 'top');
1854 var scrollLeft = getScroll(element, 'left');
1855 rect.top += scrollTop;
1856 rect.left += scrollLeft;
1857 rect.bottom += scrollTop;
1858 rect.right += scrollLeft;
1860 rect = element.getBoundingClientRect();
1867 width: rect.right - rect.left,
1868 height: rect.bottom - rect.top
1871 // subtract scrollbar size from sizes
1872 var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
1873 var width = sizes.width || element.clientWidth || result.right - result.left;
1874 var height = sizes.height || element.clientHeight || result.bottom - result.top;
1876 var horizScrollbar = element.offsetWidth - width;
1877 var vertScrollbar = element.offsetHeight - height;
1879 // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
1880 // we make this check conditional for performance reasons
1881 if (horizScrollbar || vertScrollbar) {
1882 var styles = getStyleComputedProperty(element);
1883 horizScrollbar -= getBordersSize(styles, 'x');
1884 vertScrollbar -= getBordersSize(styles, 'y');
1886 result.width -= horizScrollbar;
1887 result.height -= vertScrollbar;
1890 return getClientRect(result);
1893 function getOffsetRectRelativeToArbitraryNode(children, parent) {
1894 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1896 var isIE10 = isIE(10);
1897 var isHTML = parent.nodeName === 'HTML';
1898 var childrenRect = getBoundingClientRect(children);
1899 var parentRect = getBoundingClientRect(parent);
1900 var scrollParent = getScrollParent(children);
1902 var styles = getStyleComputedProperty(parent);
1903 var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
1904 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
1906 // In cases where the parent is fixed, we must ignore negative scroll in offset calc
1907 if (fixedPosition && parent.nodeName === 'HTML') {
1908 parentRect.top = Math.max(parentRect.top, 0);
1909 parentRect.left = Math.max(parentRect.left, 0);
1911 var offsets = getClientRect({
1912 top: childrenRect.top - parentRect.top - borderTopWidth,
1913 left: childrenRect.left - parentRect.left - borderLeftWidth,
1914 width: childrenRect.width,
1915 height: childrenRect.height
1917 offsets.marginTop = 0;
1918 offsets.marginLeft = 0;
1920 // Subtract margins of documentElement in case it's being used as parent
1921 // we do this only on HTML because it's the only element that behaves
1922 // differently when margins are applied to it. The margins are included in
1923 // the box of the documentElement, in the other cases not.
1924 if (!isIE10 && isHTML) {
1925 var marginTop = parseFloat(styles.marginTop, 10);
1926 var marginLeft = parseFloat(styles.marginLeft, 10);
1928 offsets.top -= borderTopWidth - marginTop;
1929 offsets.bottom -= borderTopWidth - marginTop;
1930 offsets.left -= borderLeftWidth - marginLeft;
1931 offsets.right -= borderLeftWidth - marginLeft;
1933 // Attach marginTop and marginLeft because in some circumstances we may need them
1934 offsets.marginTop = marginTop;
1935 offsets.marginLeft = marginLeft;
1938 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
1939 offsets = includeScroll(offsets, parent);
1945 function getViewportOffsetRectRelativeToArtbitraryNode(element) {
1946 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1948 var html = element.ownerDocument.documentElement;
1949 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
1950 var width = Math.max(html.clientWidth, window.innerWidth || 0);
1951 var height = Math.max(html.clientHeight, window.innerHeight || 0);
1953 var scrollTop = !excludeScroll ? getScroll(html) : 0;
1954 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
1957 top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
1958 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
1963 return getClientRect(offset);
1967 * Check if the given element is fixed or is inside a fixed parent
1969 * @memberof Popper.Utils
1970 * @argument {Element} element
1971 * @argument {Element} customContainer
1972 * @returns {Boolean} answer to "isFixed?"
1974 function isFixed(element) {
1975 var nodeName = element.nodeName;
1976 if (nodeName === 'BODY' || nodeName === 'HTML') {
1979 if (getStyleComputedProperty(element, 'position') === 'fixed') {
1982 return isFixed(getParentNode(element));
1986 * Finds the first parent of an element that has a transformed property defined
1988 * @memberof Popper.Utils
1989 * @argument {Element} element
1990 * @returns {Element} first transformed parent or documentElement
1993 function getFixedPositionOffsetParent(element) {
1994 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
1995 if (!element || !element.parentElement || isIE()) {
1996 return document.documentElement;
1998 var el = element.parentElement;
1999 while (el && getStyleComputedProperty(el, 'transform') === 'none') {
2000 el = el.parentElement;
2002 return el || document.documentElement;
2006 * Computed the boundaries limits and return them
2008 * @memberof Popper.Utils
2009 * @param {HTMLElement} popper
2010 * @param {HTMLElement} reference
2011 * @param {number} padding
2012 * @param {HTMLElement} boundariesElement - Element used to define the boundaries
2013 * @param {Boolean} fixedPosition - Is in fixed position mode
2014 * @returns {Object} Coordinates of the boundaries
2016 function getBoundaries(popper, reference, padding, boundariesElement) {
2017 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
2019 // NOTE: 1 DOM access here
2021 var boundaries = { top: 0, left: 0 };
2022 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
2024 // Handle viewport case
2025 if (boundariesElement === 'viewport') {
2026 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
2028 // Handle other cases based on DOM element used as boundaries
2029 var boundariesNode = void 0;
2030 if (boundariesElement === 'scrollParent') {
2031 boundariesNode = getScrollParent(getParentNode(reference));
2032 if (boundariesNode.nodeName === 'BODY') {
2033 boundariesNode = popper.ownerDocument.documentElement;
2035 } else if (boundariesElement === 'window') {
2036 boundariesNode = popper.ownerDocument.documentElement;
2038 boundariesNode = boundariesElement;
2041 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
2043 // In case of HTML, we need a different computation
2044 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
2045 var _getWindowSizes = getWindowSizes(),
2046 height = _getWindowSizes.height,
2047 width = _getWindowSizes.width;
2049 boundaries.top += offsets.top - offsets.marginTop;
2050 boundaries.bottom = height + offsets.top;
2051 boundaries.left += offsets.left - offsets.marginLeft;
2052 boundaries.right = width + offsets.left;
2054 // for all the other DOM elements, this one is good
2055 boundaries = offsets;
2060 boundaries.left += padding;
2061 boundaries.top += padding;
2062 boundaries.right -= padding;
2063 boundaries.bottom -= padding;
2068 function getArea(_ref) {
2069 var width = _ref.width,
2070 height = _ref.height;
2072 return width * height;
2076 * Utility used to transform the `auto` placement to the placement with more
2079 * @memberof Popper.Utils
2080 * @argument {Object} data - The data object generated by update method
2081 * @argument {Object} options - Modifiers configuration and options
2082 * @returns {Object} The data object, properly modified
2084 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
2085 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
2087 if (placement.indexOf('auto') === -1) {
2091 var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
2095 width: boundaries.width,
2096 height: refRect.top - boundaries.top
2099 width: boundaries.right - refRect.right,
2100 height: boundaries.height
2103 width: boundaries.width,
2104 height: boundaries.bottom - refRect.bottom
2107 width: refRect.left - boundaries.left,
2108 height: boundaries.height
2112 var sortedAreas = Object.keys(rects).map(function (key) {
2116 area: getArea(rects[key])
2118 }).sort(function (a, b) {
2119 return b.area - a.area;
2122 var filteredAreas = sortedAreas.filter(function (_ref2) {
2123 var width = _ref2.width,
2124 height = _ref2.height;
2125 return width >= popper.clientWidth && height >= popper.clientHeight;
2128 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
2130 var variation = placement.split('-')[1];
2132 return computedPlacement + (variation ? '-' + variation : '');
2136 * Get offsets to the reference element
2138 * @memberof Popper.Utils
2139 * @param {Object} state
2140 * @param {Element} popper - the popper element
2141 * @param {Element} reference - the reference element (the popper will be relative to this)
2142 * @param {Element} fixedPosition - is in fixed position mode
2143 * @returns {Object} An object containing the offsets which will be applied to the popper
2145 function getReferenceOffsets(state, popper, reference) {
2146 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
2148 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
2149 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
2153 * Get the outer sizes of the given element (offset size + margins)
2155 * @memberof Popper.Utils
2156 * @argument {Element} element
2157 * @returns {Object} object containing width and height properties
2159 function getOuterSizes(element) {
2160 var styles = getComputedStyle(element);
2161 var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
2162 var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
2164 width: element.offsetWidth + y,
2165 height: element.offsetHeight + x
2171 * Get the opposite placement of the given one
2173 * @memberof Popper.Utils
2174 * @argument {String} placement
2175 * @returns {String} flipped placement
2177 function getOppositePlacement(placement) {
2178 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
2179 return placement.replace(/left|right|bottom|top/g, function (matched) {
2180 return hash[matched];
2185 * Get offsets to the popper
2187 * @memberof Popper.Utils
2188 * @param {Object} position - CSS position the Popper will get applied
2189 * @param {HTMLElement} popper - the popper element
2190 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
2191 * @param {String} placement - one of the valid placement options
2192 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
2194 function getPopperOffsets(popper, referenceOffsets, placement) {
2195 placement = placement.split('-')[0];
2197 // Get popper node sizes
2198 var popperRect = getOuterSizes(popper);
2200 // Add position, width and height to our offsets object
2201 var popperOffsets = {
2202 width: popperRect.width,
2203 height: popperRect.height
2206 // depending by the popper placement we have to compute its offsets slightly differently
2207 var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
2208 var mainSide = isHoriz ? 'top' : 'left';
2209 var secondarySide = isHoriz ? 'left' : 'top';
2210 var measurement = isHoriz ? 'height' : 'width';
2211 var secondaryMeasurement = !isHoriz ? 'height' : 'width';
2213 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
2214 if (placement === secondarySide) {
2215 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
2217 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
2220 return popperOffsets;
2224 * Mimics the `find` method of Array
2226 * @memberof Popper.Utils
2227 * @argument {Array} arr
2230 * @returns index or -1
2232 function find(arr, check) {
2233 // use native find if supported
2234 if (Array.prototype.find) {
2235 return arr.find(check);
2238 // use `filter` to obtain the same behavior of `find`
2239 return arr.filter(check)[0];
2243 * Return the index of the matching object
2245 * @memberof Popper.Utils
2246 * @argument {Array} arr
2249 * @returns index or -1
2251 function findIndex(arr, prop, value) {
2252 // use native findIndex if supported
2253 if (Array.prototype.findIndex) {
2254 return arr.findIndex(function (cur) {
2255 return cur[prop] === value;
2259 // use `find` + `indexOf` if `findIndex` isn't supported
2260 var match = find(arr, function (obj) {
2261 return obj[prop] === value;
2263 return arr.indexOf(match);
2267 * Loop trough the list of modifiers and run them in order,
2268 * each of them will then edit the data object.
2270 * @memberof Popper.Utils
2271 * @param {dataObject} data
2272 * @param {Array} modifiers
2273 * @param {String} ends - Optional modifier name used as stopper
2274 * @returns {dataObject}
2276 function runModifiers(modifiers, data, ends) {
2277 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
2279 modifiersToRun.forEach(function (modifier) {
2280 if (modifier['function']) {
2281 // eslint-disable-line dot-notation
2282 console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
2284 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
2285 if (modifier.enabled && isFunction(fn)) {
2286 // Add properties to offsets to make them a complete clientRect object
2287 // we do this before each modifier to make sure the previous one doesn't
2288 // mess with these values
2289 data.offsets.popper = getClientRect(data.offsets.popper);
2290 data.offsets.reference = getClientRect(data.offsets.reference);
2292 data = fn(data, modifier);
2300 * Updates the position of the popper, computing the new offsets and applying
2301 * the new style.<br />
2302 * Prefer `scheduleUpdate` over `update` because of performance reasons.
2307 // if popper is destroyed, don't perform any further update
2308 if (this.state.isDestroyed) {
2321 // compute reference element offsets
2322 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
2324 // compute auto placement, store placement inside the data object,
2325 // modifiers will be able to edit `placement` if needed
2326 // and refer to originalPlacement to know the original value
2327 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
2329 // store the computed placement inside `originalPlacement`
2330 data.originalPlacement = data.placement;
2332 data.positionFixed = this.options.positionFixed;
2334 // compute the popper offsets
2335 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
2337 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
2339 // run the modifiers
2340 data = runModifiers(this.modifiers, data);
2342 // the first `update` will call `onCreate` callback
2343 // the other ones will call `onUpdate` callback
2344 if (!this.state.isCreated) {
2345 this.state.isCreated = true;
2346 this.options.onCreate(data);
2348 this.options.onUpdate(data);
2353 * Helper used to know if the given modifier is enabled.
2355 * @memberof Popper.Utils
2356 * @returns {Boolean}
2358 function isModifierEnabled(modifiers, modifierName) {
2359 return modifiers.some(function (_ref) {
2360 var name = _ref.name,
2361 enabled = _ref.enabled;
2362 return enabled && name === modifierName;
2367 * Get the prefixed supported property name
2369 * @memberof Popper.Utils
2370 * @argument {String} property (camelCase)
2371 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
2373 function getSupportedPropertyName(property) {
2374 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
2375 var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
2377 for (var i = 0; i < prefixes.length; i++) {
2378 var prefix = prefixes[i];
2379 var toCheck = prefix ? '' + prefix + upperProp : property;
2380 if (typeof document.body.style[toCheck] !== 'undefined') {
2388 * Destroy the popper
2392 function destroy() {
2393 this.state.isDestroyed = true;
2395 // touch DOM only if `applyStyle` modifier is enabled
2396 if (isModifierEnabled(this.modifiers, 'applyStyle')) {
2397 this.popper.removeAttribute('x-placement');
2398 this.popper.style.position = '';
2399 this.popper.style.top = '';
2400 this.popper.style.left = '';
2401 this.popper.style.right = '';
2402 this.popper.style.bottom = '';
2403 this.popper.style.willChange = '';
2404 this.popper.style[getSupportedPropertyName('transform')] = '';
2407 this.disableEventListeners();
2409 // remove the popper if user explicity asked for the deletion on destroy
2410 // do not use `remove` because IE11 doesn't support it
2411 if (this.options.removeOnDestroy) {
2412 this.popper.parentNode.removeChild(this.popper);
2418 * Get the window associated with the element
2419 * @argument {Element} element
2422 function getWindow(element) {
2423 var ownerDocument = element.ownerDocument;
2424 return ownerDocument ? ownerDocument.defaultView : window;
2427 function attachToScrollParents(scrollParent, event, callback, scrollParents) {
2428 var isBody = scrollParent.nodeName === 'BODY';
2429 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
2430 target.addEventListener(event, callback, { passive: true });
2433 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
2435 scrollParents.push(target);
2439 * Setup needed event listeners used to update the popper position
2441 * @memberof Popper.Utils
2444 function setupEventListeners(reference, options, state, updateBound) {
2445 // Resize event listener on window
2446 state.updateBound = updateBound;
2447 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
2449 // Scroll event listener on scroll parents
2450 var scrollElement = getScrollParent(reference);
2451 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
2452 state.scrollElement = scrollElement;
2453 state.eventsEnabled = true;
2459 * It will add resize/scroll events and start recalculating
2460 * position of the popper element when they are triggered.
2464 function enableEventListeners() {
2465 if (!this.state.eventsEnabled) {
2466 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
2471 * Remove event listeners used to update the popper position
2473 * @memberof Popper.Utils
2476 function removeEventListeners(reference, state) {
2477 // Remove resize event listener on window
2478 getWindow(reference).removeEventListener('resize', state.updateBound);
2480 // Remove scroll event listener on scroll parents
2481 state.scrollParents.forEach(function (target) {
2482 target.removeEventListener('scroll', state.updateBound);
2486 state.updateBound = null;
2487 state.scrollParents = [];
2488 state.scrollElement = null;
2489 state.eventsEnabled = false;
2494 * It will remove resize/scroll events and won't recalculate popper position
2495 * when they are triggered. It also won't trigger onUpdate callback anymore,
2496 * unless you call `update` method manually.
2500 function disableEventListeners() {
2501 if (this.state.eventsEnabled) {
2502 cancelAnimationFrame(this.scheduleUpdate);
2503 this.state = removeEventListeners(this.reference, this.state);
2508 * Tells if a given input is a number
2510 * @memberof Popper.Utils
2511 * @param {*} input to check
2514 function isNumeric(n) {
2515 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
2519 * Set the style to the given popper
2521 * @memberof Popper.Utils
2522 * @argument {Element} element - Element to apply the style to
2523 * @argument {Object} styles
2524 * Object with a list of properties and values which will be applied to the element
2526 function setStyles(element, styles) {
2527 Object.keys(styles).forEach(function (prop) {
2529 // add unit if the value is numeric and is one of the following
2530 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
2533 element.style[prop] = styles[prop] + unit;
2538 * Set the attributes to the given popper
2540 * @memberof Popper.Utils
2541 * @argument {Element} element - Element to apply the attributes to
2542 * @argument {Object} styles
2543 * Object with a list of properties and values which will be applied to the element
2545 function setAttributes(element, attributes) {
2546 Object.keys(attributes).forEach(function (prop) {
2547 var value = attributes[prop];
2548 if (value !== false) {
2549 element.setAttribute(prop, attributes[prop]);
2551 element.removeAttribute(prop);
2558 * @memberof Modifiers
2559 * @argument {Object} data - The data object generated by `update` method
2560 * @argument {Object} data.styles - List of style properties - values to apply to popper element
2561 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
2562 * @argument {Object} options - Modifiers configuration and options
2563 * @returns {Object} The same data object
2565 function applyStyle(data) {
2566 // any property present in `data.styles` will be applied to the popper,
2567 // in this way we can make the 3rd party modifiers add custom styles to it
2568 // Be aware, modifiers could override the properties defined in the previous
2569 // lines of this modifier!
2570 setStyles(data.instance.popper, data.styles);
2572 // any property present in `data.attributes` will be applied to the popper,
2573 // they will be set as HTML attributes of the element
2574 setAttributes(data.instance.popper, data.attributes);
2576 // if arrowElement is defined and arrowStyles has some properties
2577 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
2578 setStyles(data.arrowElement, data.arrowStyles);
2585 * Set the x-placement attribute before everything else because it could be used
2586 * to add margins to the popper margins needs to be calculated to get the
2587 * correct popper offsets.
2589 * @memberof Popper.modifiers
2590 * @param {HTMLElement} reference - The reference element used to position the popper
2591 * @param {HTMLElement} popper - The HTML element used as popper
2592 * @param {Object} options - Popper.js options
2594 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
2595 // compute reference element offsets
2596 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
2598 // compute auto placement, store placement inside the data object,
2599 // modifiers will be able to edit `placement` if needed
2600 // and refer to originalPlacement to know the original value
2601 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
2603 popper.setAttribute('x-placement', placement);
2605 // Apply `position` to popper before anything else because
2606 // without the position applied we can't guarantee correct computations
2607 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
2614 * @memberof Modifiers
2615 * @argument {Object} data - The data object generated by `update` method
2616 * @argument {Object} options - Modifiers configuration and options
2617 * @returns {Object} The data object, properly modified
2619 function computeStyle(data, options) {
2622 var popper = data.offsets.popper;
2624 // Remove this legacy support in Popper.js v2
2626 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
2627 return modifier.name === 'applyStyle';
2629 if (legacyGpuAccelerationOption !== undefined) {
2630 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
2632 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
2634 var offsetParent = getOffsetParent(data.instance.popper);
2635 var offsetParentRect = getBoundingClientRect(offsetParent);
2639 position: popper.position
2642 // Avoid blurry text by using full pixel integers.
2643 // For pixel-perfect positioning, top/bottom prefers rounded
2644 // values, while left/right prefers floored values.
2646 left: Math.floor(popper.left),
2647 top: Math.round(popper.top),
2648 bottom: Math.round(popper.bottom),
2649 right: Math.floor(popper.right)
2652 var sideA = x === 'bottom' ? 'top' : 'bottom';
2653 var sideB = y === 'right' ? 'left' : 'right';
2655 // if gpuAcceleration is set to `true` and transform is supported,
2656 // we use `translate3d` to apply the position to the popper we
2657 // automatically use the supported prefixed version if needed
2658 var prefixedProperty = getSupportedPropertyName('transform');
2660 // now, let's make a step back and look at this code closely (wtf?)
2661 // If the content of the popper grows once it's been positioned, it
2662 // may happen that the popper gets misplaced because of the new content
2663 // overflowing its reference element
2664 // To avoid this problem, we provide two options (x and y), which allow
2665 // the consumer to define the offset origin.
2666 // If we position a popper on top of a reference element, we can set
2667 // `x` to `top` to make the popper grow towards its top instead of
2671 if (sideA === 'bottom') {
2672 top = -offsetParentRect.height + offsets.bottom;
2676 if (sideB === 'right') {
2677 left = -offsetParentRect.width + offsets.right;
2679 left = offsets.left;
2681 if (gpuAcceleration && prefixedProperty) {
2682 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2685 styles.willChange = 'transform';
2687 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
2688 var invertTop = sideA === 'bottom' ? -1 : 1;
2689 var invertLeft = sideB === 'right' ? -1 : 1;
2690 styles[sideA] = top * invertTop;
2691 styles[sideB] = left * invertLeft;
2692 styles.willChange = sideA + ', ' + sideB;
2697 'x-placement': data.placement
2700 // Update `data` attributes, styles and arrowStyles
2701 data.attributes = _extends({}, attributes, data.attributes);
2702 data.styles = _extends({}, styles, data.styles);
2703 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
2709 * Helper used to know if the given modifier depends from another one.<br />
2710 * It checks if the needed modifier is listed and enabled.
2712 * @memberof Popper.Utils
2713 * @param {Array} modifiers - list of modifiers
2714 * @param {String} requestingName - name of requesting modifier
2715 * @param {String} requestedName - name of requested modifier
2716 * @returns {Boolean}
2718 function isModifierRequired(modifiers, requestingName, requestedName) {
2719 var requesting = find(modifiers, function (_ref) {
2720 var name = _ref.name;
2721 return name === requestingName;
2724 var isRequired = !!requesting && modifiers.some(function (modifier) {
2725 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
2729 var _requesting = '`' + requestingName + '`';
2730 var requested = '`' + requestedName + '`';
2731 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
2738 * @memberof Modifiers
2739 * @argument {Object} data - The data object generated by update method
2740 * @argument {Object} options - Modifiers configuration and options
2741 * @returns {Object} The data object, properly modified
2743 function arrow(data, options) {
2744 var _data$offsets$arrow;
2746 // arrow depends on keepTogether in order to work
2747 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
2751 var arrowElement = options.element;
2753 // if arrowElement is a string, suppose it's a CSS selector
2754 if (typeof arrowElement === 'string') {
2755 arrowElement = data.instance.popper.querySelector(arrowElement);
2757 // if arrowElement is not found, don't run the modifier
2758 if (!arrowElement) {
2762 // if the arrowElement isn't a query selector we must check that the
2763 // provided DOM node is child of its popper node
2764 if (!data.instance.popper.contains(arrowElement)) {
2765 console.warn('WARNING: `arrow.element` must be child of its popper element!');
2770 var placement = data.placement.split('-')[0];
2771 var _data$offsets = data.offsets,
2772 popper = _data$offsets.popper,
2773 reference = _data$offsets.reference;
2775 var isVertical = ['left', 'right'].indexOf(placement) !== -1;
2777 var len = isVertical ? 'height' : 'width';
2778 var sideCapitalized = isVertical ? 'Top' : 'Left';
2779 var side = sideCapitalized.toLowerCase();
2780 var altSide = isVertical ? 'left' : 'top';
2781 var opSide = isVertical ? 'bottom' : 'right';
2782 var arrowElementSize = getOuterSizes(arrowElement)[len];
2785 // extends keepTogether behavior making sure the popper and its
2786 // reference have enough pixels in conjuction
2790 if (reference[opSide] - arrowElementSize < popper[side]) {
2791 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
2793 // bottom/right side
2794 if (reference[side] + arrowElementSize > popper[opSide]) {
2795 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
2797 data.offsets.popper = getClientRect(data.offsets.popper);
2799 // compute center of the popper
2800 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
2802 // Compute the sideValue using the updated popper offsets
2803 // take popper margin in account because we don't have this info available
2804 var css = getStyleComputedProperty(data.instance.popper);
2805 var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
2806 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
2807 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
2809 // prevent arrowElement from being placed not contiguously to its popper
2810 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
2812 data.arrowElement = arrowElement;
2813 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
2819 * Get the opposite placement variation of the given one
2821 * @memberof Popper.Utils
2822 * @argument {String} placement variation
2823 * @returns {String} flipped placement variation
2825 function getOppositeVariation(variation) {
2826 if (variation === 'end') {
2828 } else if (variation === 'start') {
2835 * List of accepted placements to use as values of the `placement` option.<br />
2836 * Valid placements are:
2843 * Each placement can have a variation from this list:
2847 * Variations are interpreted easily if you think of them as the left to right
2848 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
2850 * Vertically (`left` and `right`), `start` is top and `end` is bottom.
2852 * Some valid examples are:
2853 * - `top-end` (on top of reference, right aligned)
2854 * - `right-start` (on right of reference, top aligned)
2855 * - `bottom` (on bottom, centered)
2856 * - `auto-right` (on the side with more space available, alignment depends by placement)
2862 * @method placements
2865 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
2867 // Get rid of `auto` `auto-start` and `auto-end`
2868 var validPlacements = placements.slice(3);
2871 * Given an initial placement, returns all the subsequent placements
2872 * clockwise (or counter-clockwise).
2875 * @memberof Popper.Utils
2876 * @argument {String} placement - A valid placement (it accepts variations)
2877 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
2878 * @returns {Array} placements including their variations
2880 function clockwise(placement) {
2881 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2883 var index = validPlacements.indexOf(placement);
2884 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
2885 return counter ? arr.reverse() : arr;
2890 CLOCKWISE: 'clockwise',
2891 COUNTERCLOCKWISE: 'counterclockwise'
2896 * @memberof Modifiers
2897 * @argument {Object} data - The data object generated by update method
2898 * @argument {Object} options - Modifiers configuration and options
2899 * @returns {Object} The data object, properly modified
2901 function flip(data, options) {
2902 // if `inner` modifier is enabled, we can't use the `flip` modifier
2903 if (isModifierEnabled(data.instance.modifiers, 'inner')) {
2907 if (data.flipped && data.placement === data.originalPlacement) {
2908 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
2912 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
2914 var placement = data.placement.split('-')[0];
2915 var placementOpposite = getOppositePlacement(placement);
2916 var variation = data.placement.split('-')[1] || '';
2920 switch (options.behavior) {
2921 case BEHAVIORS.FLIP:
2922 flipOrder = [placement, placementOpposite];
2924 case BEHAVIORS.CLOCKWISE:
2925 flipOrder = clockwise(placement);
2927 case BEHAVIORS.COUNTERCLOCKWISE:
2928 flipOrder = clockwise(placement, true);
2931 flipOrder = options.behavior;
2934 flipOrder.forEach(function (step, index) {
2935 if (placement !== step || flipOrder.length === index + 1) {
2939 placement = data.placement.split('-')[0];
2940 placementOpposite = getOppositePlacement(placement);
2942 var popperOffsets = data.offsets.popper;
2943 var refOffsets = data.offsets.reference;
2945 // using floor because the reference offsets may contain decimals we are not going to consider here
2946 var floor = Math.floor;
2947 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
2949 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
2950 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
2951 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
2952 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
2954 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
2956 // flip the variation if required
2957 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
2958 var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
2960 if (overlapsRef || overflowsBoundaries || flippedVariation) {
2961 // this boolean to detect any flip loop
2962 data.flipped = true;
2964 if (overlapsRef || overflowsBoundaries) {
2965 placement = flipOrder[index + 1];
2968 if (flippedVariation) {
2969 variation = getOppositeVariation(variation);
2972 data.placement = placement + (variation ? '-' + variation : '');
2974 // this object contains `position`, we want to preserve it along with
2975 // any additional property we may add in the future
2976 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
2978 data = runModifiers(data.instance.modifiers, data, 'flip');
2986 * @memberof Modifiers
2987 * @argument {Object} data - The data object generated by update method
2988 * @argument {Object} options - Modifiers configuration and options
2989 * @returns {Object} The data object, properly modified
2991 function keepTogether(data) {
2992 var _data$offsets = data.offsets,
2993 popper = _data$offsets.popper,
2994 reference = _data$offsets.reference;
2996 var placement = data.placement.split('-')[0];
2997 var floor = Math.floor;
2998 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
2999 var side = isVertical ? 'right' : 'bottom';
3000 var opSide = isVertical ? 'left' : 'top';
3001 var measurement = isVertical ? 'width' : 'height';
3003 if (popper[side] < floor(reference[opSide])) {
3004 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
3006 if (popper[opSide] > floor(reference[side])) {
3007 data.offsets.popper[opSide] = floor(reference[side]);
3014 * Converts a string containing value + unit into a px value number
3016 * @memberof {modifiers~offset}
3018 * @argument {String} str - Value + unit string
3019 * @argument {String} measurement - `height` or `width`
3020 * @argument {Object} popperOffsets
3021 * @argument {Object} referenceOffsets
3022 * @returns {Number|String}
3023 * Value in pixels, or original string if no values were extracted
3025 function toValue(str, measurement, popperOffsets, referenceOffsets) {
3026 // separate value from unit
3027 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
3028 var value = +split[1];
3029 var unit = split[2];
3031 // If it's not a number it's an operator, I guess
3036 if (unit.indexOf('%') === 0) {
3037 var element = void 0;
3040 element = popperOffsets;
3045 element = referenceOffsets;
3048 var rect = getClientRect(element);
3049 return rect[measurement] / 100 * value;
3050 } else if (unit === 'vh' || unit === 'vw') {
3051 // if is a vh or vw, we calculate the size based on the viewport
3053 if (unit === 'vh') {
3054 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
3056 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
3058 return size / 100 * value;
3060 // if is an explicit pixel unit, we get rid of the unit and keep the value
3061 // if is an implicit unit, it's px, and we return just the value
3067 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
3069 * @memberof {modifiers~offset}
3071 * @argument {String} offset
3072 * @argument {Object} popperOffsets
3073 * @argument {Object} referenceOffsets
3074 * @argument {String} basePlacement
3075 * @returns {Array} a two cells array with x and y offsets in numbers
3077 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
3078 var offsets = [0, 0];
3080 // Use height if placement is left or right and index is 0 otherwise use width
3081 // in this way the first offset will use an axis and the second one
3082 // will use the other one
3083 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
3085 // Split the offset string to obtain a list of values and operands
3086 // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
3087 var fragments = offset.split(/(\+|\-)/).map(function (frag) {
3091 // Detect if the offset string contains a pair of values or a single one
3092 // they could be separated by comma or space
3093 var divider = fragments.indexOf(find(fragments, function (frag) {
3094 return frag.search(/,|\s/) !== -1;
3097 if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
3098 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
3101 // If divider is found, we divide the list of values and operands to divide
3102 // them by ofset X and Y.
3103 var splitRegex = /\s*,\s*|\s+/;
3104 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
3106 // Convert the values with units to absolute pixels to allow our computations
3107 ops = ops.map(function (op, index) {
3108 // Most of the units rely on the orientation of the popper
3109 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
3110 var mergeWithPrevious = false;
3112 // This aggregates any `+` or `-` sign that aren't considered operators
3113 // e.g.: 10 + +5 => [10, +, +5]
3114 .reduce(function (a, b) {
3115 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
3116 a[a.length - 1] = b;
3117 mergeWithPrevious = true;
3119 } else if (mergeWithPrevious) {
3120 a[a.length - 1] += b;
3121 mergeWithPrevious = false;
3127 // Here we convert the string values into number values (in px)
3128 .map(function (str) {
3129 return toValue(str, measurement, popperOffsets, referenceOffsets);
3133 // Loop trough the offsets arrays and execute the operations
3134 ops.forEach(function (op, index) {
3135 op.forEach(function (frag, index2) {
3136 if (isNumeric(frag)) {
3137 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
3146 * @memberof Modifiers
3147 * @argument {Object} data - The data object generated by update method
3148 * @argument {Object} options - Modifiers configuration and options
3149 * @argument {Number|String} options.offset=0
3150 * The offset value as described in the modifier description
3151 * @returns {Object} The data object, properly modified
3153 function offset(data, _ref) {
3154 var offset = _ref.offset;
3155 var placement = data.placement,
3156 _data$offsets = data.offsets,
3157 popper = _data$offsets.popper,
3158 reference = _data$offsets.reference;
3160 var basePlacement = placement.split('-')[0];
3162 var offsets = void 0;
3163 if (isNumeric(+offset)) {
3164 offsets = [+offset, 0];
3166 offsets = parseOffset(offset, popper, reference, basePlacement);
3169 if (basePlacement === 'left') {
3170 popper.top += offsets[0];
3171 popper.left -= offsets[1];
3172 } else if (basePlacement === 'right') {
3173 popper.top += offsets[0];
3174 popper.left += offsets[1];
3175 } else if (basePlacement === 'top') {
3176 popper.left += offsets[0];
3177 popper.top -= offsets[1];
3178 } else if (basePlacement === 'bottom') {
3179 popper.left += offsets[0];
3180 popper.top += offsets[1];
3183 data.popper = popper;
3189 * @memberof Modifiers
3190 * @argument {Object} data - The data object generated by `update` method
3191 * @argument {Object} options - Modifiers configuration and options
3192 * @returns {Object} The data object, properly modified
3194 function preventOverflow(data, options) {
3195 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
3197 // If offsetParent is the reference element, we really want to
3198 // go one step up and use the next offsetParent as reference to
3199 // avoid to make this modifier completely useless and look like broken
3200 if (data.instance.reference === boundariesElement) {
3201 boundariesElement = getOffsetParent(boundariesElement);
3204 // NOTE: DOM access here
3205 // resets the popper's position so that the document size can be calculated excluding
3206 // the size of the popper element itself
3207 var transformProp = getSupportedPropertyName('transform');
3208 var popperStyles = data.instance.popper.style; // assignment to help minification
3209 var top = popperStyles.top,
3210 left = popperStyles.left,
3211 transform = popperStyles[transformProp];
3213 popperStyles.top = '';
3214 popperStyles.left = '';
3215 popperStyles[transformProp] = '';
3217 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
3219 // NOTE: DOM access here
3220 // restores the original style properties after the offsets have been computed
3221 popperStyles.top = top;
3222 popperStyles.left = left;
3223 popperStyles[transformProp] = transform;
3225 options.boundaries = boundaries;
3227 var order = options.priority;
3228 var popper = data.offsets.popper;
3231 primary: function primary(placement) {
3232 var value = popper[placement];
3233 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
3234 value = Math.max(popper[placement], boundaries[placement]);
3236 return defineProperty({}, placement, value);
3238 secondary: function secondary(placement) {
3239 var mainSide = placement === 'right' ? 'left' : 'top';
3240 var value = popper[mainSide];
3241 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
3242 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
3244 return defineProperty({}, mainSide, value);
3248 order.forEach(function (placement) {
3249 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
3250 popper = _extends({}, popper, check[side](placement));
3253 data.offsets.popper = popper;
3260 * @memberof Modifiers
3261 * @argument {Object} data - The data object generated by `update` method
3262 * @argument {Object} options - Modifiers configuration and options
3263 * @returns {Object} The data object, properly modified
3265 function shift(data) {
3266 var placement = data.placement;
3267 var basePlacement = placement.split('-')[0];
3268 var shiftvariation = placement.split('-')[1];
3270 // if shift shiftvariation is specified, run the modifier
3271 if (shiftvariation) {
3272 var _data$offsets = data.offsets,
3273 reference = _data$offsets.reference,
3274 popper = _data$offsets.popper;
3276 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
3277 var side = isVertical ? 'left' : 'top';
3278 var measurement = isVertical ? 'width' : 'height';
3280 var shiftOffsets = {
3281 start: defineProperty({}, side, reference[side]),
3282 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
3285 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
3293 * @memberof Modifiers
3294 * @argument {Object} data - The data object generated by update method
3295 * @argument {Object} options - Modifiers configuration and options
3296 * @returns {Object} The data object, properly modified
3298 function hide(data) {
3299 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
3303 var refRect = data.offsets.reference;
3304 var bound = find(data.instance.modifiers, function (modifier) {
3305 return modifier.name === 'preventOverflow';
3308 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
3309 // Avoid unnecessary DOM access if visibility hasn't changed
3310 if (data.hide === true) {
3315 data.attributes['x-out-of-boundaries'] = '';
3317 // Avoid unnecessary DOM access if visibility hasn't changed
3318 if (data.hide === false) {
3323 data.attributes['x-out-of-boundaries'] = false;
3331 * @memberof Modifiers
3332 * @argument {Object} data - The data object generated by `update` method
3333 * @argument {Object} options - Modifiers configuration and options
3334 * @returns {Object} The data object, properly modified
3336 function inner(data) {
3337 var placement = data.placement;
3338 var basePlacement = placement.split('-')[0];
3339 var _data$offsets = data.offsets,
3340 popper = _data$offsets.popper,
3341 reference = _data$offsets.reference;
3343 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
3345 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
3347 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
3349 data.placement = getOppositePlacement(placement);
3350 data.offsets.popper = getClientRect(popper);
3356 * Modifier function, each modifier can have a function of this type assigned
3357 * to its `fn` property.<br />
3358 * These functions will be called on each update, this means that you must
3359 * make sure they are performant enough to avoid performance bottlenecks.
3361 * @function ModifierFn
3362 * @argument {dataObject} data - The data object generated by `update` method
3363 * @argument {Object} options - Modifiers configuration and options
3364 * @returns {dataObject} The data object, properly modified
3368 * Modifiers are plugins used to alter the behavior of your poppers.<br />
3369 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
3370 * needed by the library.
3372 * Usually you don't want to override the `order`, `fn` and `onLoad` props.
3373 * All the other properties are configurations that could be tweaked.
3374 * @namespace modifiers
3378 * Modifier used to shift the popper on the start or end of its reference
3380 * It will read the variation of the `placement` property.<br />
3381 * It can be one either `-end` or `-start`.
3382 * @memberof modifiers
3386 /** @prop {number} order=100 - Index used to define the order of execution */
3388 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3390 /** @prop {ModifierFn} */
3395 * The `offset` modifier can shift your popper on both its axis.
3397 * It accepts the following units:
3398 * - `px` or unitless, interpreted as pixels
3399 * - `%` or `%r`, percentage relative to the length of the reference element
3400 * - `%p`, percentage relative to the length of the popper element
3401 * - `vw`, CSS viewport width unit
3402 * - `vh`, CSS viewport height unit
3404 * For length is intended the main axis relative to the placement of the popper.<br />
3405 * This means that if the placement is `top` or `bottom`, the length will be the
3406 * `width`. In case of `left` or `right`, it will be the height.
3408 * You can provide a single value (as `Number` or `String`), or a pair of values
3409 * as `String` divided by a comma or one (or more) white spaces.<br />
3410 * The latter is a deprecated method because it leads to confusion and will be
3411 * removed in v2.<br />
3412 * Additionally, it accepts additions and subtractions between different units.
3413 * Note that multiplications and divisions aren't supported.
3415 * Valid examples are:
3423 * '-10px + 5vh, 5px - 6%'
3425 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
3426 * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
3427 * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)
3429 * @memberof modifiers
3433 /** @prop {number} order=200 - Index used to define the order of execution */
3435 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3437 /** @prop {ModifierFn} */
3439 /** @prop {Number|String} offset=0
3440 * The offset value as described in the modifier description
3446 * Modifier used to prevent the popper from being positioned outside the boundary.
3448 * An scenario exists where the reference itself is not within the boundaries.<br />
3449 * We can say it has "escaped the boundaries" — or just "escaped".<br />
3450 * In this case we need to decide whether the popper should either:
3452 * - detach from the reference and remain "trapped" in the boundaries, or
3453 * - if it should ignore the boundary and "escape with its reference"
3455 * When `escapeWithReference` is set to`true` and reference is completely
3456 * outside its boundaries, the popper will overflow (or completely leave)
3457 * the boundaries in order to remain attached to the edge of the reference.
3459 * @memberof modifiers
3463 /** @prop {number} order=300 - Index used to define the order of execution */
3465 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3467 /** @prop {ModifierFn} */
3468 fn: preventOverflow,
3470 * @prop {Array} [priority=['left','right','top','bottom']]
3471 * Popper will try to prevent overflow following these priorities by default,
3472 * then, it could overflow on the left and on top of the `boundariesElement`
3474 priority: ['left', 'right', 'top', 'bottom'],
3476 * @prop {number} padding=5
3477 * Amount of pixel used to define a minimum distance between the boundaries
3478 * and the popper this makes sure the popper has always a little padding
3479 * between the edges of its container
3483 * @prop {String|HTMLElement} boundariesElement='scrollParent'
3484 * Boundaries used by the modifier, can be `scrollParent`, `window`,
3485 * `viewport` or any DOM element.
3487 boundariesElement: 'scrollParent'
3491 * Modifier used to make sure the reference and its popper stay near eachothers
3492 * without leaving any gap between the two. Expecially useful when the arrow is
3493 * enabled and you want to assure it to point to its reference element.
3494 * It cares only about the first axis, you can still have poppers with margin
3495 * between the popper and its reference element.
3496 * @memberof modifiers
3500 /** @prop {number} order=400 - Index used to define the order of execution */
3502 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3504 /** @prop {ModifierFn} */
3509 * This modifier is used to move the `arrowElement` of the popper to make
3510 * sure it is positioned between the reference element and its popper element.
3511 * It will read the outer size of the `arrowElement` node to detect how many
3512 * pixels of conjuction are needed.
3514 * It has no effect if no `arrowElement` is provided.
3515 * @memberof modifiers
3519 /** @prop {number} order=500 - Index used to define the order of execution */
3521 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3523 /** @prop {ModifierFn} */
3525 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
3526 element: '[x-arrow]'
3530 * Modifier used to flip the popper's placement when it starts to overlap its
3531 * reference element.
3533 * Requires the `preventOverflow` modifier before it in order to work.
3535 * **NOTE:** this modifier will interrupt the current update cycle and will
3536 * restart it if it detects the need to flip the placement.
3537 * @memberof modifiers
3541 /** @prop {number} order=600 - Index used to define the order of execution */
3543 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3545 /** @prop {ModifierFn} */
3548 * @prop {String|Array} behavior='flip'
3549 * The behavior used to change the popper's placement. It can be one of
3550 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
3551 * placements (with optional variations).
3555 * @prop {number} padding=5
3556 * The popper will flip if it hits the edges of the `boundariesElement`
3560 * @prop {String|HTMLElement} boundariesElement='viewport'
3561 * The element which will define the boundaries of the popper position,
3562 * the popper will never be placed outside of the defined boundaries
3563 * (except if keepTogether is enabled)
3565 boundariesElement: 'viewport'
3569 * Modifier used to make the popper flow toward the inner of the reference element.
3570 * By default, when this modifier is disabled, the popper will be placed outside
3571 * the reference element.
3572 * @memberof modifiers
3576 /** @prop {number} order=700 - Index used to define the order of execution */
3578 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
3580 /** @prop {ModifierFn} */
3585 * Modifier used to hide the popper when its reference element is outside of the
3586 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
3587 * be used to hide with a CSS selector the popper when its reference is
3588 * out of boundaries.
3590 * Requires the `preventOverflow` modifier before it in order to work.
3591 * @memberof modifiers
3595 /** @prop {number} order=800 - Index used to define the order of execution */
3597 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3599 /** @prop {ModifierFn} */
3604 * Computes the style that will be applied to the popper element to gets
3605 * properly positioned.
3607 * Note that this modifier will not touch the DOM, it just prepares the styles
3608 * so that `applyStyle` modifier can apply it. This separation is useful
3609 * in case you need to replace `applyStyle` with a custom implementation.
3611 * This modifier has `850` as `order` value to maintain backward compatibility
3612 * with previous versions of Popper.js. Expect the modifiers ordering method
3613 * to change in future major versions of the library.
3615 * @memberof modifiers
3619 /** @prop {number} order=850 - Index used to define the order of execution */
3621 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3623 /** @prop {ModifierFn} */
3626 * @prop {Boolean} gpuAcceleration=true
3627 * If true, it uses the CSS 3d transformation to position the popper.
3628 * Otherwise, it will use the `top` and `left` properties.
3630 gpuAcceleration: true,
3632 * @prop {string} [x='bottom']
3633 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
3634 * Change this if your popper should grow in a direction different from `bottom`
3638 * @prop {string} [x='left']
3639 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
3640 * Change this if your popper should grow in a direction different from `right`
3646 * Applies the computed styles to the popper element.
3648 * All the DOM manipulations are limited to this modifier. This is useful in case
3649 * you want to integrate Popper.js inside a framework or view library and you
3650 * want to delegate all the DOM manipulations to it.
3652 * Note that if you disable this modifier, you must make sure the popper element
3653 * has its position set to `absolute` before Popper.js can do its work!
3655 * Just disable this modifier and define you own to achieve the desired effect.
3657 * @memberof modifiers
3661 /** @prop {number} order=900 - Index used to define the order of execution */
3663 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3665 /** @prop {ModifierFn} */
3667 /** @prop {Function} */
3668 onLoad: applyStyleOnLoad,
3670 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
3671 * @prop {Boolean} gpuAcceleration=true
3672 * If true, it uses the CSS 3d transformation to position the popper.
3673 * Otherwise, it will use the `top` and `left` properties.
3675 gpuAcceleration: undefined
3680 * The `dataObject` is an object containing all the informations used by Popper.js
3681 * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
3683 * @property {Object} data.instance The Popper.js instance
3684 * @property {String} data.placement Placement applied to popper
3685 * @property {String} data.originalPlacement Placement originally defined on init
3686 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
3687 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
3688 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
3689 * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
3690 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)
3691 * @property {Object} data.boundaries Offsets of the popper boundaries
3692 * @property {Object} data.offsets The measurements of popper, reference and arrow elements.
3693 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
3694 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
3695 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
3699 * Default options provided to Popper.js constructor.<br />
3700 * These can be overriden using the `options` argument of Popper.js.<br />
3701 * To override an option, simply pass as 3rd argument an object with the same
3702 * structure of this object, example:
3704 * new Popper(ref, pop, {
3706 * preventOverflow: { enabled: false }
3716 * Popper's placement
3717 * @prop {Popper.placements} placement='bottom'
3719 placement: 'bottom',
3722 * Set this to true if you want popper to position it self in 'fixed' mode
3723 * @prop {Boolean} positionFixed=false
3725 positionFixed: false,
3728 * Whether events (resize, scroll) are initially enabled
3729 * @prop {Boolean} eventsEnabled=true
3731 eventsEnabled: true,
3734 * Set to true if you want to automatically remove the popper when
3735 * you call the `destroy` method.
3736 * @prop {Boolean} removeOnDestroy=false
3738 removeOnDestroy: false,
3741 * Callback called when the popper is created.<br />
3742 * By default, is set to no-op.<br />
3743 * Access Popper.js instance with `data.instance`.
3746 onCreate: function onCreate() {},
3749 * Callback called when the popper is updated, this callback is not called
3750 * on the initialization/creation of the popper, but only on subsequent
3752 * By default, is set to no-op.<br />
3753 * Access Popper.js instance with `data.instance`.
3756 onUpdate: function onUpdate() {},
3759 * List of modifiers used to modify the offsets before they are applied to the popper.
3760 * They provide most of the functionalities of Popper.js
3763 modifiers: modifiers
3767 * @callback onCreate
3768 * @param {dataObject} data
3772 * @callback onUpdate
3773 * @param {dataObject} data
3778 var Popper = function () {
3780 * Create a new Popper.js instance
3782 * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
3783 * @param {HTMLElement} popper - The HTML element used as popper.
3784 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
3785 * @return {Object} instance - The generated Popper.js instance
3787 function Popper(reference, popper) {
3790 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3791 classCallCheck(this, Popper);
3793 this.scheduleUpdate = function () {
3794 return requestAnimationFrame(_this.update);
3797 // make update() debounced, so that it only runs at most once-per-tick
3798 this.update = debounce(this.update.bind(this));
3800 // with {} we create a new object with the options inside it
3801 this.options = _extends({}, Popper.Defaults, options);
3810 // get reference and popper elements (allow jQuery wrappers)
3811 this.reference = reference && reference.jquery ? reference[0] : reference;
3812 this.popper = popper && popper.jquery ? popper[0] : popper;
3814 // Deep merge modifiers options
3815 this.options.modifiers = {};
3816 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
3817 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
3820 // Refactoring modifiers' list (Object => Array)
3821 this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
3824 }, _this.options.modifiers[name]);
3826 // sort the modifiers by order
3827 .sort(function (a, b) {
3828 return a.order - b.order;
3831 // modifiers have the ability to execute arbitrary code when Popper.js get inited
3832 // such code is executed in the same order of its modifier
3833 // they could add new properties to their options configuration
3834 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
3835 this.modifiers.forEach(function (modifierOptions) {
3836 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
3837 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
3841 // fire the first update to position the popper in the right place
3844 var eventsEnabled = this.options.eventsEnabled;
3845 if (eventsEnabled) {
3846 // setup event listeners, they will take care of update the position in specific situations
3847 this.enableEventListeners();
3850 this.state.eventsEnabled = eventsEnabled;
3853 // We can't use class properties because they don't get listed in the
3854 // class prototype and break stuff like Sinon stubs
3857 createClass(Popper, [{
3859 value: function update$$1() {
3860 return update.call(this);
3864 value: function destroy$$1() {
3865 return destroy.call(this);
3868 key: 'enableEventListeners',
3869 value: function enableEventListeners$$1() {
3870 return enableEventListeners.call(this);
3873 key: 'disableEventListeners',
3874 value: function disableEventListeners$$1() {
3875 return disableEventListeners.call(this);
3879 * Schedule an update, it will run on the next UI update available
3880 * @method scheduleUpdate
3886 * Collection of utilities useful when writing custom modifiers.
3887 * Starting from version 1.7, this method is available only if you
3888 * include `popper-utils.js` before `popper.js`.
3890 * **DEPRECATION**: This way to access PopperUtils is deprecated
3891 * and will be removed in v2! Use the PopperUtils module directly instead.
3892 * Due to the high instability of the methods contained in Utils, we can't
3893 * guarantee them to follow semver. Use them at your own risk!
3897 * @deprecated since version 1.8
3907 * The `referenceObject` is an object that provides an interface compatible with Popper.js
3908 * and lets you use it as replacement of a real DOM node.<br />
3909 * You can use this method to position a popper relatively to a set of coordinates
3910 * in case you don't have a DOM node to use as reference.
3913 * new Popper(referenceObject, popperNode);
3916 * NB: This feature isn't supported in Internet Explorer 10
3917 * @name referenceObject
3918 * @property {Function} data.getBoundingClientRect
3919 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
3920 * @property {number} data.clientWidth
3921 * An ES6 getter that will return the width of the virtual reference element.
3922 * @property {number} data.clientHeight
3923 * An ES6 getter that will return the height of the virtual reference element.
3927 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
3928 Popper.placements = placements;
3929 Popper.Defaults = Defaults;
3932 * --------------------------------------------------------------------------
3933 * Bootstrap (v4.1.3): dropdown.js
3934 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3935 * --------------------------------------------------------------------------
3938 var Dropdown = function ($$$1) {
3940 * ------------------------------------------------------------------------
3942 * ------------------------------------------------------------------------
3944 var NAME = 'dropdown';
3945 var VERSION = '4.1.3';
3946 var DATA_KEY = 'bs.dropdown';
3947 var EVENT_KEY = "." + DATA_KEY;
3948 var DATA_API_KEY = '.data-api';
3949 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
3950 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
3952 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
3954 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
3956 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
3958 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
3960 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
3962 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
3964 HIDE: "hide" + EVENT_KEY,
3965 HIDDEN: "hidden" + EVENT_KEY,
3966 SHOW: "show" + EVENT_KEY,
3967 SHOWN: "shown" + EVENT_KEY,
3968 CLICK: "click" + EVENT_KEY,
3969 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
3970 KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
3971 KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
3974 DISABLED: 'disabled',
3977 DROPRIGHT: 'dropright',
3978 DROPLEFT: 'dropleft',
3979 MENURIGHT: 'dropdown-menu-right',
3980 MENULEFT: 'dropdown-menu-left',
3981 POSITION_STATIC: 'position-static'
3984 DATA_TOGGLE: '[data-toggle="dropdown"]',
3985 FORM_CHILD: '.dropdown form',
3986 MENU: '.dropdown-menu',
3987 NAVBAR_NAV: '.navbar-nav',
3988 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
3990 var AttachmentMap = {
3993 BOTTOM: 'bottom-start',
3994 BOTTOMEND: 'bottom-end',
3995 RIGHT: 'right-start',
3996 RIGHTEND: 'right-end',
4003 boundary: 'scrollParent',
4004 reference: 'toggle',
4008 offset: '(number|string|function)',
4010 boundary: '(string|element)',
4011 reference: '(string|element)',
4014 * ------------------------------------------------------------------------
4016 * ------------------------------------------------------------------------
4024 function Dropdown(element, config) {
4025 this._element = element;
4026 this._popper = null;
4027 this._config = this._getConfig(config);
4028 this._menu = this._getMenuElement();
4029 this._inNavbar = this._detectNavbar();
4031 this._addEventListeners();
4035 var _proto = Dropdown.prototype;
4038 _proto.toggle = function toggle() {
4039 if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
4043 var parent = Dropdown._getParentFromElement(this._element);
4045 var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
4047 Dropdown._clearMenus();
4053 var relatedTarget = {
4054 relatedTarget: this._element
4056 var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
4057 $$$1(parent).trigger(showEvent);
4059 if (showEvent.isDefaultPrevented()) {
4061 } // Disable totally Popper.js for Dropdown in Navbar
4064 if (!this._inNavbar) {
4066 * Check for Popper dependency
4067 * Popper - https://popper.js.org
4069 if (typeof Popper === 'undefined') {
4070 throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
4073 var referenceElement = this._element;
4075 if (this._config.reference === 'parent') {
4076 referenceElement = parent;
4077 } else if (Util.isElement(this._config.reference)) {
4078 referenceElement = this._config.reference; // Check if it's jQuery element
4080 if (typeof this._config.reference.jquery !== 'undefined') {
4081 referenceElement = this._config.reference[0];
4083 } // If boundary is not `scrollParent`, then set position to `static`
4084 // to allow the menu to "escape" the scroll parent's boundaries
4085 // https://github.com/twbs/bootstrap/issues/24251
4088 if (this._config.boundary !== 'scrollParent') {
4089 $$$1(parent).addClass(ClassName.POSITION_STATIC);
4092 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
4093 } // If this is a touch-enabled device we add extra
4094 // empty mouseover listeners to the body's immediate children;
4095 // only needed because of broken event delegation on iOS
4096 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
4099 if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
4100 $$$1(document.body).children().on('mouseover', null, $$$1.noop);
4103 this._element.focus();
4105 this._element.setAttribute('aria-expanded', true);
4107 $$$1(this._menu).toggleClass(ClassName.SHOW);
4108 $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
4111 _proto.dispose = function dispose() {
4112 $$$1.removeData(this._element, DATA_KEY);
4113 $$$1(this._element).off(EVENT_KEY);
4114 this._element = null;
4117 if (this._popper !== null) {
4118 this._popper.destroy();
4120 this._popper = null;
4124 _proto.update = function update() {
4125 this._inNavbar = this._detectNavbar();
4127 if (this._popper !== null) {
4128 this._popper.scheduleUpdate();
4133 _proto._addEventListeners = function _addEventListeners() {
4136 $$$1(this._element).on(Event.CLICK, function (event) {
4137 event.preventDefault();
4138 event.stopPropagation();
4144 _proto._getConfig = function _getConfig(config) {
4145 config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
4146 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
4150 _proto._getMenuElement = function _getMenuElement() {
4152 var parent = Dropdown._getParentFromElement(this._element);
4155 this._menu = parent.querySelector(Selector.MENU);
4162 _proto._getPlacement = function _getPlacement() {
4163 var $parentDropdown = $$$1(this._element.parentNode);
4164 var placement = AttachmentMap.BOTTOM; // Handle dropup
4166 if ($parentDropdown.hasClass(ClassName.DROPUP)) {
4167 placement = AttachmentMap.TOP;
4169 if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
4170 placement = AttachmentMap.TOPEND;
4172 } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
4173 placement = AttachmentMap.RIGHT;
4174 } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
4175 placement = AttachmentMap.LEFT;
4176 } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
4177 placement = AttachmentMap.BOTTOMEND;
4183 _proto._detectNavbar = function _detectNavbar() {
4184 return $$$1(this._element).closest('.navbar').length > 0;
4187 _proto._getPopperConfig = function _getPopperConfig() {
4190 var offsetConf = {};
4192 if (typeof this._config.offset === 'function') {
4193 offsetConf.fn = function (data) {
4194 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
4198 offsetConf.offset = this._config.offset;
4201 var popperConfig = {
4202 placement: this._getPlacement(),
4206 enabled: this._config.flip
4209 boundariesElement: this._config.boundary
4211 } // Disable Popper.js if we have a static display
4215 if (this._config.display === 'static') {
4216 popperConfig.modifiers.applyStyle = {
4221 return popperConfig;
4225 Dropdown._jQueryInterface = function _jQueryInterface(config) {
4226 return this.each(function () {
4227 var data = $$$1(this).data(DATA_KEY);
4229 var _config = typeof config === 'object' ? config : null;
4232 data = new Dropdown(this, _config);
4233 $$$1(this).data(DATA_KEY, data);
4236 if (typeof config === 'string') {
4237 if (typeof data[config] === 'undefined') {
4238 throw new TypeError("No method named \"" + config + "\"");
4246 Dropdown._clearMenus = function _clearMenus(event) {
4247 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
4251 var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
4253 for (var i = 0, len = toggles.length; i < len; i++) {
4254 var parent = Dropdown._getParentFromElement(toggles[i]);
4256 var context = $$$1(toggles[i]).data(DATA_KEY);
4257 var relatedTarget = {
4258 relatedTarget: toggles[i]
4261 if (event && event.type === 'click') {
4262 relatedTarget.clickEvent = event;
4269 var dropdownMenu = context._menu;
4271 if (!$$$1(parent).hasClass(ClassName.SHOW)) {
4275 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
4279 var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
4280 $$$1(parent).trigger(hideEvent);
4282 if (hideEvent.isDefaultPrevented()) {
4284 } // If this is a touch-enabled device we remove the extra
4285 // empty mouseover listeners we added for iOS support
4288 if ('ontouchstart' in document.documentElement) {
4289 $$$1(document.body).children().off('mouseover', null, $$$1.noop);
4292 toggles[i].setAttribute('aria-expanded', 'false');
4293 $$$1(dropdownMenu).removeClass(ClassName.SHOW);
4294 $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
4298 Dropdown._getParentFromElement = function _getParentFromElement(element) {
4300 var selector = Util.getSelectorFromElement(element);
4303 parent = document.querySelector(selector);
4306 return parent || element.parentNode;
4307 }; // eslint-disable-next-line complexity
4310 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
4311 // If not input/textarea:
4312 // - And not a key in REGEXP_KEYDOWN => not a dropdown command
4313 // If input/textarea:
4314 // - If space key => not a dropdown command
4315 // - If key is other than escape
4316 // - If key is not up or down => not a dropdown command
4317 // - If trigger inside the menu => not a dropdown command
4318 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
4322 event.preventDefault();
4323 event.stopPropagation();
4325 if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
4329 var parent = Dropdown._getParentFromElement(this);
4331 var isActive = $$$1(parent).hasClass(ClassName.SHOW);
4333 if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
4334 if (event.which === ESCAPE_KEYCODE) {
4335 var toggle = parent.querySelector(Selector.DATA_TOGGLE);
4336 $$$1(toggle).trigger('focus');
4339 $$$1(this).trigger('click');
4343 var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
4345 if (items.length === 0) {
4349 var index = items.indexOf(event.target);
4351 if (event.which === ARROW_UP_KEYCODE && index > 0) {
4356 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
4365 items[index].focus();
4368 _createClass(Dropdown, null, [{
4370 get: function get() {
4375 get: function get() {
4380 get: function get() {
4388 * ------------------------------------------------------------------------
4389 * Data Api implementation
4390 * ------------------------------------------------------------------------
4394 $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
4395 event.preventDefault();
4396 event.stopPropagation();
4398 Dropdown._jQueryInterface.call($$$1(this), 'toggle');
4399 }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
4400 e.stopPropagation();
4403 * ------------------------------------------------------------------------
4405 * ------------------------------------------------------------------------
4408 $$$1.fn[NAME] = Dropdown._jQueryInterface;
4409 $$$1.fn[NAME].Constructor = Dropdown;
4411 $$$1.fn[NAME].noConflict = function () {
4412 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
4413 return Dropdown._jQueryInterface;
4420 * --------------------------------------------------------------------------
4421 * Bootstrap (v4.1.3): modal.js
4422 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4423 * --------------------------------------------------------------------------
4426 var Modal = function ($$$1) {
4428 * ------------------------------------------------------------------------
4430 * ------------------------------------------------------------------------
4433 var VERSION = '4.1.3';
4434 var DATA_KEY = 'bs.modal';
4435 var EVENT_KEY = "." + DATA_KEY;
4436 var DATA_API_KEY = '.data-api';
4437 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
4438 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
4447 backdrop: '(boolean|string)',
4448 keyboard: 'boolean',
4453 HIDE: "hide" + EVENT_KEY,
4454 HIDDEN: "hidden" + EVENT_KEY,
4455 SHOW: "show" + EVENT_KEY,
4456 SHOWN: "shown" + EVENT_KEY,
4457 FOCUSIN: "focusin" + EVENT_KEY,
4458 RESIZE: "resize" + EVENT_KEY,
4459 CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
4460 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
4461 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
4462 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
4463 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
4466 SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
4467 BACKDROP: 'modal-backdrop',
4473 DIALOG: '.modal-dialog',
4474 DATA_TOGGLE: '[data-toggle="modal"]',
4475 DATA_DISMISS: '[data-dismiss="modal"]',
4476 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
4477 STICKY_CONTENT: '.sticky-top'
4479 * ------------------------------------------------------------------------
4481 * ------------------------------------------------------------------------
4489 function Modal(element, config) {
4490 this._config = this._getConfig(config);
4491 this._element = element;
4492 this._dialog = element.querySelector(Selector.DIALOG);
4493 this._backdrop = null;
4494 this._isShown = false;
4495 this._isBodyOverflowing = false;
4496 this._ignoreBackdropClick = false;
4497 this._scrollbarWidth = 0;
4501 var _proto = Modal.prototype;
4504 _proto.toggle = function toggle(relatedTarget) {
4505 return this._isShown ? this.hide() : this.show(relatedTarget);
4508 _proto.show = function show(relatedTarget) {
4511 if (this._isTransitioning || this._isShown) {
4515 if ($$$1(this._element).hasClass(ClassName.FADE)) {
4516 this._isTransitioning = true;
4519 var showEvent = $$$1.Event(Event.SHOW, {
4520 relatedTarget: relatedTarget
4522 $$$1(this._element).trigger(showEvent);
4524 if (this._isShown || showEvent.isDefaultPrevented()) {
4528 this._isShown = true;
4530 this._checkScrollbar();
4532 this._setScrollbar();
4534 this._adjustDialog();
4536 $$$1(document.body).addClass(ClassName.OPEN);
4538 this._setEscapeEvent();
4540 this._setResizeEvent();
4542 $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
4543 return _this.hide(event);
4545 $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
4546 $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
4547 if ($$$1(event.target).is(_this._element)) {
4548 _this._ignoreBackdropClick = true;
4553 this._showBackdrop(function () {
4554 return _this._showElement(relatedTarget);
4558 _proto.hide = function hide(event) {
4562 event.preventDefault();
4565 if (this._isTransitioning || !this._isShown) {
4569 var hideEvent = $$$1.Event(Event.HIDE);
4570 $$$1(this._element).trigger(hideEvent);
4572 if (!this._isShown || hideEvent.isDefaultPrevented()) {
4576 this._isShown = false;
4577 var transition = $$$1(this._element).hasClass(ClassName.FADE);
4580 this._isTransitioning = true;
4583 this._setEscapeEvent();
4585 this._setResizeEvent();
4587 $$$1(document).off(Event.FOCUSIN);
4588 $$$1(this._element).removeClass(ClassName.SHOW);
4589 $$$1(this._element).off(Event.CLICK_DISMISS);
4590 $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
4593 var transitionDuration = Util.getTransitionDurationFromElement(this._element);
4594 $$$1(this._element).one(Util.TRANSITION_END, function (event) {
4595 return _this2._hideModal(event);
4596 }).emulateTransitionEnd(transitionDuration);
4602 _proto.dispose = function dispose() {
4603 $$$1.removeData(this._element, DATA_KEY);
4604 $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
4605 this._config = null;
4606 this._element = null;
4607 this._dialog = null;
4608 this._backdrop = null;
4609 this._isShown = null;
4610 this._isBodyOverflowing = null;
4611 this._ignoreBackdropClick = null;
4612 this._scrollbarWidth = null;
4615 _proto.handleUpdate = function handleUpdate() {
4616 this._adjustDialog();
4620 _proto._getConfig = function _getConfig(config) {
4621 config = _objectSpread({}, Default, config);
4622 Util.typeCheckConfig(NAME, config, DefaultType);
4626 _proto._showElement = function _showElement(relatedTarget) {
4629 var transition = $$$1(this._element).hasClass(ClassName.FADE);
4631 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
4632 // Don't move modal's DOM position
4633 document.body.appendChild(this._element);
4636 this._element.style.display = 'block';
4638 this._element.removeAttribute('aria-hidden');
4640 this._element.scrollTop = 0;
4643 Util.reflow(this._element);
4646 $$$1(this._element).addClass(ClassName.SHOW);
4648 if (this._config.focus) {
4649 this._enforceFocus();
4652 var shownEvent = $$$1.Event(Event.SHOWN, {
4653 relatedTarget: relatedTarget
4656 var transitionComplete = function transitionComplete() {
4657 if (_this3._config.focus) {
4658 _this3._element.focus();
4661 _this3._isTransitioning = false;
4662 $$$1(_this3._element).trigger(shownEvent);
4666 var transitionDuration = Util.getTransitionDurationFromElement(this._element);
4667 $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
4669 transitionComplete();
4673 _proto._enforceFocus = function _enforceFocus() {
4676 $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
4677 .on(Event.FOCUSIN, function (event) {
4678 if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
4679 _this4._element.focus();
4684 _proto._setEscapeEvent = function _setEscapeEvent() {
4687 if (this._isShown && this._config.keyboard) {
4688 $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
4689 if (event.which === ESCAPE_KEYCODE) {
4690 event.preventDefault();
4695 } else if (!this._isShown) {
4696 $$$1(this._element).off(Event.KEYDOWN_DISMISS);
4700 _proto._setResizeEvent = function _setResizeEvent() {
4703 if (this._isShown) {
4704 $$$1(window).on(Event.RESIZE, function (event) {
4705 return _this6.handleUpdate(event);
4708 $$$1(window).off(Event.RESIZE);
4712 _proto._hideModal = function _hideModal() {
4715 this._element.style.display = 'none';
4717 this._element.setAttribute('aria-hidden', true);
4719 this._isTransitioning = false;
4721 this._showBackdrop(function () {
4722 $$$1(document.body).removeClass(ClassName.OPEN);
4724 _this7._resetAdjustments();
4726 _this7._resetScrollbar();
4728 $$$1(_this7._element).trigger(Event.HIDDEN);
4732 _proto._removeBackdrop = function _removeBackdrop() {
4733 if (this._backdrop) {
4734 $$$1(this._backdrop).remove();
4735 this._backdrop = null;
4739 _proto._showBackdrop = function _showBackdrop(callback) {
4742 var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
4744 if (this._isShown && this._config.backdrop) {
4745 this._backdrop = document.createElement('div');
4746 this._backdrop.className = ClassName.BACKDROP;
4749 this._backdrop.classList.add(animate);
4752 $$$1(this._backdrop).appendTo(document.body);
4753 $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
4754 if (_this8._ignoreBackdropClick) {
4755 _this8._ignoreBackdropClick = false;
4759 if (event.target !== event.currentTarget) {
4763 if (_this8._config.backdrop === 'static') {
4764 _this8._element.focus();
4771 Util.reflow(this._backdrop);
4774 $$$1(this._backdrop).addClass(ClassName.SHOW);
4785 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
4786 $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
4787 } else if (!this._isShown && this._backdrop) {
4788 $$$1(this._backdrop).removeClass(ClassName.SHOW);
4790 var callbackRemove = function callbackRemove() {
4791 _this8._removeBackdrop();
4798 if ($$$1(this._element).hasClass(ClassName.FADE)) {
4799 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
4801 $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
4805 } else if (callback) {
4808 }; // ----------------------------------------------------------------------
4809 // the following methods are used to handle overflowing modals
4810 // todo (fat): these should probably be refactored out of modal.js
4811 // ----------------------------------------------------------------------
4814 _proto._adjustDialog = function _adjustDialog() {
4815 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4817 if (!this._isBodyOverflowing && isModalOverflowing) {
4818 this._element.style.paddingLeft = this._scrollbarWidth + "px";
4821 if (this._isBodyOverflowing && !isModalOverflowing) {
4822 this._element.style.paddingRight = this._scrollbarWidth + "px";
4826 _proto._resetAdjustments = function _resetAdjustments() {
4827 this._element.style.paddingLeft = '';
4828 this._element.style.paddingRight = '';
4831 _proto._checkScrollbar = function _checkScrollbar() {
4832 var rect = document.body.getBoundingClientRect();
4833 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
4834 this._scrollbarWidth = this._getScrollbarWidth();
4837 _proto._setScrollbar = function _setScrollbar() {
4840 if (this._isBodyOverflowing) {
4841 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
4842 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
4843 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
4844 var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
4846 $$$1(fixedContent).each(function (index, element) {
4847 var actualPadding = element.style.paddingRight;
4848 var calculatedPadding = $$$1(element).css('padding-right');
4849 $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
4850 }); // Adjust sticky content margin
4852 $$$1(stickyContent).each(function (index, element) {
4853 var actualMargin = element.style.marginRight;
4854 var calculatedMargin = $$$1(element).css('margin-right');
4855 $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
4856 }); // Adjust body padding
4858 var actualPadding = document.body.style.paddingRight;
4859 var calculatedPadding = $$$1(document.body).css('padding-right');
4860 $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
4864 _proto._resetScrollbar = function _resetScrollbar() {
4865 // Restore fixed content padding
4866 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
4867 $$$1(fixedContent).each(function (index, element) {
4868 var padding = $$$1(element).data('padding-right');
4869 $$$1(element).removeData('padding-right');
4870 element.style.paddingRight = padding ? padding : '';
4871 }); // Restore sticky content
4873 var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
4874 $$$1(elements).each(function (index, element) {
4875 var margin = $$$1(element).data('margin-right');
4877 if (typeof margin !== 'undefined') {
4878 $$$1(element).css('margin-right', margin).removeData('margin-right');
4880 }); // Restore body padding
4882 var padding = $$$1(document.body).data('padding-right');
4883 $$$1(document.body).removeData('padding-right');
4884 document.body.style.paddingRight = padding ? padding : '';
4887 _proto._getScrollbarWidth = function _getScrollbarWidth() {
4889 var scrollDiv = document.createElement('div');
4890 scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
4891 document.body.appendChild(scrollDiv);
4892 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
4893 document.body.removeChild(scrollDiv);
4894 return scrollbarWidth;
4898 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
4899 return this.each(function () {
4900 var data = $$$1(this).data(DATA_KEY);
4902 var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});
4905 data = new Modal(this, _config);
4906 $$$1(this).data(DATA_KEY, data);
4909 if (typeof config === 'string') {
4910 if (typeof data[config] === 'undefined') {
4911 throw new TypeError("No method named \"" + config + "\"");
4914 data[config](relatedTarget);
4915 } else if (_config.show) {
4916 data.show(relatedTarget);
4921 _createClass(Modal, null, [{
4923 get: function get() {
4928 get: function get() {
4936 * ------------------------------------------------------------------------
4937 * Data Api implementation
4938 * ------------------------------------------------------------------------
4942 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
4946 var selector = Util.getSelectorFromElement(this);
4949 target = document.querySelector(selector);
4952 var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
4954 if (this.tagName === 'A' || this.tagName === 'AREA') {
4955 event.preventDefault();
4958 var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
4959 if (showEvent.isDefaultPrevented()) {
4960 // Only register focus restorer if modal will actually get shown
4964 $target.one(Event.HIDDEN, function () {
4965 if ($$$1(_this10).is(':visible')) {
4971 Modal._jQueryInterface.call($$$1(target), config, this);
4974 * ------------------------------------------------------------------------
4976 * ------------------------------------------------------------------------
4979 $$$1.fn[NAME] = Modal._jQueryInterface;
4980 $$$1.fn[NAME].Constructor = Modal;
4982 $$$1.fn[NAME].noConflict = function () {
4983 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
4984 return Modal._jQueryInterface;
4991 * --------------------------------------------------------------------------
4992 * Bootstrap (v4.1.3): tooltip.js
4993 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4994 * --------------------------------------------------------------------------
4997 var Tooltip = function ($$$1) {
4999 * ------------------------------------------------------------------------
5001 * ------------------------------------------------------------------------
5003 var NAME = 'tooltip';
5004 var VERSION = '4.1.3';
5005 var DATA_KEY = 'bs.tooltip';
5006 var EVENT_KEY = "." + DATA_KEY;
5007 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
5008 var CLASS_PREFIX = 'bs-tooltip';
5009 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
5011 animation: 'boolean',
5013 title: '(string|element|function)',
5015 delay: '(number|object)',
5017 selector: '(string|boolean)',
5018 placement: '(string|function)',
5019 offset: '(number|string)',
5020 container: '(string|element|boolean)',
5021 fallbackPlacement: '(string|array)',
5022 boundary: '(string|element)'
5024 var AttachmentMap = {
5033 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
5034 trigger: 'hover focus',
5042 fallbackPlacement: 'flip',
5043 boundary: 'scrollParent'
5050 HIDE: "hide" + EVENT_KEY,
5051 HIDDEN: "hidden" + EVENT_KEY,
5052 SHOW: "show" + EVENT_KEY,
5053 SHOWN: "shown" + EVENT_KEY,
5054 INSERTED: "inserted" + EVENT_KEY,
5055 CLICK: "click" + EVENT_KEY,
5056 FOCUSIN: "focusin" + EVENT_KEY,
5057 FOCUSOUT: "focusout" + EVENT_KEY,
5058 MOUSEENTER: "mouseenter" + EVENT_KEY,
5059 MOUSELEAVE: "mouseleave" + EVENT_KEY
5066 TOOLTIP: '.tooltip',
5067 TOOLTIP_INNER: '.tooltip-inner',
5076 * ------------------------------------------------------------------------
5078 * ------------------------------------------------------------------------
5086 function Tooltip(element, config) {
5088 * Check for Popper dependency
5089 * Popper - https://popper.js.org
5091 if (typeof Popper === 'undefined') {
5092 throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
5096 this._isEnabled = true;
5098 this._hoverState = '';
5099 this._activeTrigger = {};
5100 this._popper = null; // Protected
5102 this.element = element;
5103 this.config = this._getConfig(config);
5106 this._setListeners();
5110 var _proto = Tooltip.prototype;
5113 _proto.enable = function enable() {
5114 this._isEnabled = true;
5117 _proto.disable = function disable() {
5118 this._isEnabled = false;
5121 _proto.toggleEnabled = function toggleEnabled() {
5122 this._isEnabled = !this._isEnabled;
5125 _proto.toggle = function toggle(event) {
5126 if (!this._isEnabled) {
5131 var dataKey = this.constructor.DATA_KEY;
5132 var context = $$$1(event.currentTarget).data(dataKey);
5135 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5136 $$$1(event.currentTarget).data(dataKey, context);
5139 context._activeTrigger.click = !context._activeTrigger.click;
5141 if (context._isWithActiveTrigger()) {
5142 context._enter(null, context);
5144 context._leave(null, context);
5147 if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {
5148 this._leave(null, this);
5153 this._enter(null, this);
5157 _proto.dispose = function dispose() {
5158 clearTimeout(this._timeout);
5159 $$$1.removeData(this.element, this.constructor.DATA_KEY);
5160 $$$1(this.element).off(this.constructor.EVENT_KEY);
5161 $$$1(this.element).closest('.modal').off('hide.bs.modal');
5164 $$$1(this.tip).remove();
5167 this._isEnabled = null;
5168 this._timeout = null;
5169 this._hoverState = null;
5170 this._activeTrigger = null;
5172 if (this._popper !== null) {
5173 this._popper.destroy();
5176 this._popper = null;
5177 this.element = null;
5182 _proto.show = function show() {
5185 if ($$$1(this.element).css('display') === 'none') {
5186 throw new Error('Please use show on visible elements');
5189 var showEvent = $$$1.Event(this.constructor.Event.SHOW);
5191 if (this.isWithContent() && this._isEnabled) {
5192 $$$1(this.element).trigger(showEvent);
5193 var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
5195 if (showEvent.isDefaultPrevented() || !isInTheDom) {
5199 var tip = this.getTipElement();
5200 var tipId = Util.getUID(this.constructor.NAME);
5201 tip.setAttribute('id', tipId);
5202 this.element.setAttribute('aria-describedby', tipId);
5205 if (this.config.animation) {
5206 $$$1(tip).addClass(ClassName.FADE);
5209 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
5211 var attachment = this._getAttachment(placement);
5213 this.addAttachmentClass(attachment);
5214 var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container);
5215 $$$1(tip).data(this.constructor.DATA_KEY, this);
5217 if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
5218 $$$1(tip).appendTo(container);
5221 $$$1(this.element).trigger(this.constructor.Event.INSERTED);
5222 this._popper = new Popper(this.element, tip, {
5223 placement: attachment,
5226 offset: this.config.offset
5229 behavior: this.config.fallbackPlacement
5232 element: Selector.ARROW
5235 boundariesElement: this.config.boundary
5238 onCreate: function onCreate(data) {
5239 if (data.originalPlacement !== data.placement) {
5240 _this._handlePopperPlacementChange(data);
5243 onUpdate: function onUpdate(data) {
5244 _this._handlePopperPlacementChange(data);
5247 $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
5248 // empty mouseover listeners to the body's immediate children;
5249 // only needed because of broken event delegation on iOS
5250 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
5252 if ('ontouchstart' in document.documentElement) {
5253 $$$1(document.body).children().on('mouseover', null, $$$1.noop);
5256 var complete = function complete() {
5257 if (_this.config.animation) {
5258 _this._fixTransition();
5261 var prevHoverState = _this._hoverState;
5262 _this._hoverState = null;
5263 $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
5265 if (prevHoverState === HoverState.OUT) {
5266 _this._leave(null, _this);
5270 if ($$$1(this.tip).hasClass(ClassName.FADE)) {
5271 var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
5272 $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
5279 _proto.hide = function hide(callback) {
5282 var tip = this.getTipElement();
5283 var hideEvent = $$$1.Event(this.constructor.Event.HIDE);
5285 var complete = function complete() {
5286 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
5287 tip.parentNode.removeChild(tip);
5290 _this2._cleanTipClass();
5292 _this2.element.removeAttribute('aria-describedby');
5294 $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
5296 if (_this2._popper !== null) {
5297 _this2._popper.destroy();
5305 $$$1(this.element).trigger(hideEvent);
5307 if (hideEvent.isDefaultPrevented()) {
5311 $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
5312 // empty mouseover listeners we added for iOS support
5314 if ('ontouchstart' in document.documentElement) {
5315 $$$1(document.body).children().off('mouseover', null, $$$1.noop);
5318 this._activeTrigger[Trigger.CLICK] = false;
5319 this._activeTrigger[Trigger.FOCUS] = false;
5320 this._activeTrigger[Trigger.HOVER] = false;
5322 if ($$$1(this.tip).hasClass(ClassName.FADE)) {
5323 var transitionDuration = Util.getTransitionDurationFromElement(tip);
5324 $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
5329 this._hoverState = '';
5332 _proto.update = function update() {
5333 if (this._popper !== null) {
5334 this._popper.scheduleUpdate();
5339 _proto.isWithContent = function isWithContent() {
5340 return Boolean(this.getTitle());
5343 _proto.addAttachmentClass = function addAttachmentClass(attachment) {
5344 $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
5347 _proto.getTipElement = function getTipElement() {
5348 this.tip = this.tip || $$$1(this.config.template)[0];
5352 _proto.setContent = function setContent() {
5353 var tip = this.getTipElement();
5354 this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
5355 $$$1(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
5358 _proto.setElementContent = function setElementContent($element, content) {
5359 var html = this.config.html;
5361 if (typeof content === 'object' && (content.nodeType || content.jquery)) {
5362 // Content is a DOM node or a jQuery
5364 if (!$$$1(content).parent().is($element)) {
5365 $element.empty().append(content);
5368 $element.text($$$1(content).text());
5371 $element[html ? 'html' : 'text'](content);
5375 _proto.getTitle = function getTitle() {
5376 var title = this.element.getAttribute('data-original-title');
5379 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
5386 _proto._getAttachment = function _getAttachment(placement) {
5387 return AttachmentMap[placement.toUpperCase()];
5390 _proto._setListeners = function _setListeners() {
5393 var triggers = this.config.trigger.split(' ');
5394 triggers.forEach(function (trigger) {
5395 if (trigger === 'click') {
5396 $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
5397 return _this3.toggle(event);
5399 } else if (trigger !== Trigger.MANUAL) {
5400 var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
5401 var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
5402 $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {
5403 return _this3._enter(event);
5404 }).on(eventOut, _this3.config.selector, function (event) {
5405 return _this3._leave(event);
5409 $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {
5410 return _this3.hide();
5414 if (this.config.selector) {
5415 this.config = _objectSpread({}, this.config, {
5424 _proto._fixTitle = function _fixTitle() {
5425 var titleType = typeof this.element.getAttribute('data-original-title');
5427 if (this.element.getAttribute('title') || titleType !== 'string') {
5428 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
5429 this.element.setAttribute('title', '');
5433 _proto._enter = function _enter(event, context) {
5434 var dataKey = this.constructor.DATA_KEY;
5435 context = context || $$$1(event.currentTarget).data(dataKey);
5438 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5439 $$$1(event.currentTarget).data(dataKey, context);
5443 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
5446 if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
5447 context._hoverState = HoverState.SHOW;
5451 clearTimeout(context._timeout);
5452 context._hoverState = HoverState.SHOW;
5454 if (!context.config.delay || !context.config.delay.show) {
5459 context._timeout = setTimeout(function () {
5460 if (context._hoverState === HoverState.SHOW) {
5463 }, context.config.delay.show);
5466 _proto._leave = function _leave(event, context) {
5467 var dataKey = this.constructor.DATA_KEY;
5468 context = context || $$$1(event.currentTarget).data(dataKey);
5471 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5472 $$$1(event.currentTarget).data(dataKey, context);
5476 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
5479 if (context._isWithActiveTrigger()) {
5483 clearTimeout(context._timeout);
5484 context._hoverState = HoverState.OUT;
5486 if (!context.config.delay || !context.config.delay.hide) {
5491 context._timeout = setTimeout(function () {
5492 if (context._hoverState === HoverState.OUT) {
5495 }, context.config.delay.hide);
5498 _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
5499 for (var trigger in this._activeTrigger) {
5500 if (this._activeTrigger[trigger]) {
5508 _proto._getConfig = function _getConfig(config) {
5509 config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {});
5511 if (typeof config.delay === 'number') {
5518 if (typeof config.title === 'number') {
5519 config.title = config.title.toString();
5522 if (typeof config.content === 'number') {
5523 config.content = config.content.toString();
5526 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
5530 _proto._getDelegateConfig = function _getDelegateConfig() {
5534 for (var key in this.config) {
5535 if (this.constructor.Default[key] !== this.config[key]) {
5536 config[key] = this.config[key];
5544 _proto._cleanTipClass = function _cleanTipClass() {
5545 var $tip = $$$1(this.getTipElement());
5546 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
5548 if (tabClass !== null && tabClass.length) {
5549 $tip.removeClass(tabClass.join(''));
5553 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
5554 var popperInstance = popperData.instance;
5555 this.tip = popperInstance.popper;
5557 this._cleanTipClass();
5559 this.addAttachmentClass(this._getAttachment(popperData.placement));
5562 _proto._fixTransition = function _fixTransition() {
5563 var tip = this.getTipElement();
5564 var initConfigAnimation = this.config.animation;
5566 if (tip.getAttribute('x-placement') !== null) {
5570 $$$1(tip).removeClass(ClassName.FADE);
5571 this.config.animation = false;
5574 this.config.animation = initConfigAnimation;
5578 Tooltip._jQueryInterface = function _jQueryInterface(config) {
5579 return this.each(function () {
5580 var data = $$$1(this).data(DATA_KEY);
5582 var _config = typeof config === 'object' && config;
5584 if (!data && /dispose|hide/.test(config)) {
5589 data = new Tooltip(this, _config);
5590 $$$1(this).data(DATA_KEY, data);
5593 if (typeof config === 'string') {
5594 if (typeof data[config] === 'undefined') {
5595 throw new TypeError("No method named \"" + config + "\"");
5603 _createClass(Tooltip, null, [{
5605 get: function get() {
5610 get: function get() {
5615 get: function get() {
5620 get: function get() {
5625 get: function get() {
5630 get: function get() {
5635 get: function get() {
5643 * ------------------------------------------------------------------------
5645 * ------------------------------------------------------------------------
5649 $$$1.fn[NAME] = Tooltip._jQueryInterface;
5650 $$$1.fn[NAME].Constructor = Tooltip;
5652 $$$1.fn[NAME].noConflict = function () {
5653 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
5654 return Tooltip._jQueryInterface;
5661 * --------------------------------------------------------------------------
5662 * Bootstrap (v4.1.3): popover.js
5663 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5664 * --------------------------------------------------------------------------
5667 var Popover = function ($$$1) {
5669 * ------------------------------------------------------------------------
5671 * ------------------------------------------------------------------------
5673 var NAME = 'popover';
5674 var VERSION = '4.1.3';
5675 var DATA_KEY = 'bs.popover';
5676 var EVENT_KEY = "." + DATA_KEY;
5677 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
5678 var CLASS_PREFIX = 'bs-popover';
5679 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
5681 var Default = _objectSpread({}, Tooltip.Default, {
5685 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
5688 var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
5689 content: '(string|element|function)'
5697 TITLE: '.popover-header',
5698 CONTENT: '.popover-body'
5701 HIDE: "hide" + EVENT_KEY,
5702 HIDDEN: "hidden" + EVENT_KEY,
5703 SHOW: "show" + EVENT_KEY,
5704 SHOWN: "shown" + EVENT_KEY,
5705 INSERTED: "inserted" + EVENT_KEY,
5706 CLICK: "click" + EVENT_KEY,
5707 FOCUSIN: "focusin" + EVENT_KEY,
5708 FOCUSOUT: "focusout" + EVENT_KEY,
5709 MOUSEENTER: "mouseenter" + EVENT_KEY,
5710 MOUSELEAVE: "mouseleave" + EVENT_KEY
5712 * ------------------------------------------------------------------------
5714 * ------------------------------------------------------------------------
5721 function (_Tooltip) {
5722 _inheritsLoose(Popover, _Tooltip);
5724 function Popover() {
5725 return _Tooltip.apply(this, arguments) || this;
5728 var _proto = Popover.prototype;
5731 _proto.isWithContent = function isWithContent() {
5732 return this.getTitle() || this._getContent();
5735 _proto.addAttachmentClass = function addAttachmentClass(attachment) {
5736 $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
5739 _proto.getTipElement = function getTipElement() {
5740 this.tip = this.tip || $$$1(this.config.template)[0];
5744 _proto.setContent = function setContent() {
5745 var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
5747 this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
5749 var content = this._getContent();
5751 if (typeof content === 'function') {
5752 content = content.call(this.element);
5755 this.setElementContent($tip.find(Selector.CONTENT), content);
5756 $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
5760 _proto._getContent = function _getContent() {
5761 return this.element.getAttribute('data-content') || this.config.content;
5764 _proto._cleanTipClass = function _cleanTipClass() {
5765 var $tip = $$$1(this.getTipElement());
5766 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
5768 if (tabClass !== null && tabClass.length > 0) {
5769 $tip.removeClass(tabClass.join(''));
5774 Popover._jQueryInterface = function _jQueryInterface(config) {
5775 return this.each(function () {
5776 var data = $$$1(this).data(DATA_KEY);
5778 var _config = typeof config === 'object' ? config : null;
5780 if (!data && /destroy|hide/.test(config)) {
5785 data = new Popover(this, _config);
5786 $$$1(this).data(DATA_KEY, data);
5789 if (typeof config === 'string') {
5790 if (typeof data[config] === 'undefined') {
5791 throw new TypeError("No method named \"" + config + "\"");
5799 _createClass(Popover, null, [{
5802 get: function get() {
5807 get: function get() {
5812 get: function get() {
5817 get: function get() {
5822 get: function get() {
5827 get: function get() {
5832 get: function get() {
5840 * ------------------------------------------------------------------------
5842 * ------------------------------------------------------------------------
5846 $$$1.fn[NAME] = Popover._jQueryInterface;
5847 $$$1.fn[NAME].Constructor = Popover;
5849 $$$1.fn[NAME].noConflict = function () {
5850 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
5851 return Popover._jQueryInterface;
5858 * --------------------------------------------------------------------------
5859 * Bootstrap (v4.1.3): scrollspy.js
5860 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5861 * --------------------------------------------------------------------------
5864 var ScrollSpy = function ($$$1) {
5866 * ------------------------------------------------------------------------
5868 * ------------------------------------------------------------------------
5870 var NAME = 'scrollspy';
5871 var VERSION = '4.1.3';
5872 var DATA_KEY = 'bs.scrollspy';
5873 var EVENT_KEY = "." + DATA_KEY;
5874 var DATA_API_KEY = '.data-api';
5875 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
5884 target: '(string|element)'
5887 ACTIVATE: "activate" + EVENT_KEY,
5888 SCROLL: "scroll" + EVENT_KEY,
5889 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
5892 DROPDOWN_ITEM: 'dropdown-item',
5893 DROPDOWN_MENU: 'dropdown-menu',
5897 DATA_SPY: '[data-spy="scroll"]',
5899 NAV_LIST_GROUP: '.nav, .list-group',
5900 NAV_LINKS: '.nav-link',
5901 NAV_ITEMS: '.nav-item',
5902 LIST_ITEMS: '.list-group-item',
5903 DROPDOWN: '.dropdown',
5904 DROPDOWN_ITEMS: '.dropdown-item',
5905 DROPDOWN_TOGGLE: '.dropdown-toggle'
5907 var OffsetMethod = {
5909 POSITION: 'position'
5911 * ------------------------------------------------------------------------
5913 * ------------------------------------------------------------------------
5921 function ScrollSpy(element, config) {
5924 this._element = element;
5925 this._scrollElement = element.tagName === 'BODY' ? window : element;
5926 this._config = this._getConfig(config);
5927 this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
5930 this._activeTarget = null;
5931 this._scrollHeight = 0;
5932 $$$1(this._scrollElement).on(Event.SCROLL, function (event) {
5933 return _this._process(event);
5941 var _proto = ScrollSpy.prototype;
5944 _proto.refresh = function refresh() {
5947 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
5948 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
5949 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
5952 this._scrollHeight = this._getScrollHeight();
5953 var targets = [].slice.call(document.querySelectorAll(this._selector));
5954 targets.map(function (element) {
5956 var targetSelector = Util.getSelectorFromElement(element);
5958 if (targetSelector) {
5959 target = document.querySelector(targetSelector);
5963 var targetBCR = target.getBoundingClientRect();
5965 if (targetBCR.width || targetBCR.height) {
5966 // TODO (fat): remove sketch reliance on jQuery position/offset
5967 return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
5972 }).filter(function (item) {
5974 }).sort(function (a, b) {
5976 }).forEach(function (item) {
5977 _this2._offsets.push(item[0]);
5979 _this2._targets.push(item[1]);
5983 _proto.dispose = function dispose() {
5984 $$$1.removeData(this._element, DATA_KEY);
5985 $$$1(this._scrollElement).off(EVENT_KEY);
5986 this._element = null;
5987 this._scrollElement = null;
5988 this._config = null;
5989 this._selector = null;
5990 this._offsets = null;
5991 this._targets = null;
5992 this._activeTarget = null;
5993 this._scrollHeight = null;
5997 _proto._getConfig = function _getConfig(config) {
5998 config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
6000 if (typeof config.target !== 'string') {
6001 var id = $$$1(config.target).attr('id');
6004 id = Util.getUID(NAME);
6005 $$$1(config.target).attr('id', id);
6008 config.target = "#" + id;
6011 Util.typeCheckConfig(NAME, config, DefaultType);
6015 _proto._getScrollTop = function _getScrollTop() {
6016 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
6019 _proto._getScrollHeight = function _getScrollHeight() {
6020 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
6023 _proto._getOffsetHeight = function _getOffsetHeight() {
6024 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
6027 _proto._process = function _process() {
6028 var scrollTop = this._getScrollTop() + this._config.offset;
6030 var scrollHeight = this._getScrollHeight();
6032 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
6034 if (this._scrollHeight !== scrollHeight) {
6038 if (scrollTop >= maxScroll) {
6039 var target = this._targets[this._targets.length - 1];
6041 if (this._activeTarget !== target) {
6042 this._activate(target);
6048 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
6049 this._activeTarget = null;
6056 var offsetLength = this._offsets.length;
6058 for (var i = offsetLength; i--;) {
6059 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
6061 if (isActiveTarget) {
6062 this._activate(this._targets[i]);
6067 _proto._activate = function _activate(target) {
6068 this._activeTarget = target;
6072 var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
6075 queries = queries.map(function (selector) {
6076 return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
6078 var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(','))));
6080 if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
6081 $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
6082 $link.addClass(ClassName.ACTIVE);
6084 // Set triggered link as active
6085 $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
6086 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
6088 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
6090 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
6093 $$$1(this._scrollElement).trigger(Event.ACTIVATE, {
6094 relatedTarget: target
6098 _proto._clear = function _clear() {
6099 var nodes = [].slice.call(document.querySelectorAll(this._selector));
6100 $$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
6104 ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
6105 return this.each(function () {
6106 var data = $$$1(this).data(DATA_KEY);
6108 var _config = typeof config === 'object' && config;
6111 data = new ScrollSpy(this, _config);
6112 $$$1(this).data(DATA_KEY, data);
6115 if (typeof config === 'string') {
6116 if (typeof data[config] === 'undefined') {
6117 throw new TypeError("No method named \"" + config + "\"");
6125 _createClass(ScrollSpy, null, [{
6127 get: function get() {
6132 get: function get() {
6140 * ------------------------------------------------------------------------
6141 * Data Api implementation
6142 * ------------------------------------------------------------------------
6146 $$$1(window).on(Event.LOAD_DATA_API, function () {
6147 var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
6148 var scrollSpysLength = scrollSpys.length;
6150 for (var i = scrollSpysLength; i--;) {
6151 var $spy = $$$1(scrollSpys[i]);
6153 ScrollSpy._jQueryInterface.call($spy, $spy.data());
6157 * ------------------------------------------------------------------------
6159 * ------------------------------------------------------------------------
6162 $$$1.fn[NAME] = ScrollSpy._jQueryInterface;
6163 $$$1.fn[NAME].Constructor = ScrollSpy;
6165 $$$1.fn[NAME].noConflict = function () {
6166 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
6167 return ScrollSpy._jQueryInterface;
6174 * --------------------------------------------------------------------------
6175 * Bootstrap (v4.1.3): tab.js
6176 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6177 * --------------------------------------------------------------------------
6180 var Tab = function ($$$1) {
6182 * ------------------------------------------------------------------------
6184 * ------------------------------------------------------------------------
6187 var VERSION = '4.1.3';
6188 var DATA_KEY = 'bs.tab';
6189 var EVENT_KEY = "." + DATA_KEY;
6190 var DATA_API_KEY = '.data-api';
6191 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
6193 HIDE: "hide" + EVENT_KEY,
6194 HIDDEN: "hidden" + EVENT_KEY,
6195 SHOW: "show" + EVENT_KEY,
6196 SHOWN: "shown" + EVENT_KEY,
6197 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
6200 DROPDOWN_MENU: 'dropdown-menu',
6202 DISABLED: 'disabled',
6207 DROPDOWN: '.dropdown',
6208 NAV_LIST_GROUP: '.nav, .list-group',
6210 ACTIVE_UL: '> li > .active',
6211 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
6212 DROPDOWN_TOGGLE: '.dropdown-toggle',
6213 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
6215 * ------------------------------------------------------------------------
6217 * ------------------------------------------------------------------------
6225 function Tab(element) {
6226 this._element = element;
6230 var _proto = Tab.prototype;
6233 _proto.show = function show() {
6236 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
6242 var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
6243 var selector = Util.getSelectorFromElement(this._element);
6246 var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
6247 previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
6248 previous = previous[previous.length - 1];
6251 var hideEvent = $$$1.Event(Event.HIDE, {
6252 relatedTarget: this._element
6254 var showEvent = $$$1.Event(Event.SHOW, {
6255 relatedTarget: previous
6259 $$$1(previous).trigger(hideEvent);
6262 $$$1(this._element).trigger(showEvent);
6264 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
6269 target = document.querySelector(selector);
6272 this._activate(this._element, listElement);
6274 var complete = function complete() {
6275 var hiddenEvent = $$$1.Event(Event.HIDDEN, {
6276 relatedTarget: _this._element
6278 var shownEvent = $$$1.Event(Event.SHOWN, {
6279 relatedTarget: previous
6281 $$$1(previous).trigger(hiddenEvent);
6282 $$$1(_this._element).trigger(shownEvent);
6286 this._activate(target, target.parentNode, complete);
6292 _proto.dispose = function dispose() {
6293 $$$1.removeData(this._element, DATA_KEY);
6294 this._element = null;
6298 _proto._activate = function _activate(element, container, callback) {
6303 if (container.nodeName === 'UL') {
6304 activeElements = $$$1(container).find(Selector.ACTIVE_UL);
6306 activeElements = $$$1(container).children(Selector.ACTIVE);
6309 var active = activeElements[0];
6310 var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);
6312 var complete = function complete() {
6313 return _this2._transitionComplete(element, active, callback);
6316 if (active && isTransitioning) {
6317 var transitionDuration = Util.getTransitionDurationFromElement(active);
6318 $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
6324 _proto._transitionComplete = function _transitionComplete(element, active, callback) {
6326 $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
6327 var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
6329 if (dropdownChild) {
6330 $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
6333 if (active.getAttribute('role') === 'tab') {
6334 active.setAttribute('aria-selected', false);
6338 $$$1(element).addClass(ClassName.ACTIVE);
6340 if (element.getAttribute('role') === 'tab') {
6341 element.setAttribute('aria-selected', true);
6344 Util.reflow(element);
6345 $$$1(element).addClass(ClassName.SHOW);
6347 if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
6348 var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];
6350 if (dropdownElement) {
6351 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
6352 $$$1(dropdownToggleList).addClass(ClassName.ACTIVE);
6355 element.setAttribute('aria-expanded', true);
6364 Tab._jQueryInterface = function _jQueryInterface(config) {
6365 return this.each(function () {
6366 var $this = $$$1(this);
6367 var data = $this.data(DATA_KEY);
6370 data = new Tab(this);
6371 $this.data(DATA_KEY, data);
6374 if (typeof config === 'string') {
6375 if (typeof data[config] === 'undefined') {
6376 throw new TypeError("No method named \"" + config + "\"");
6384 _createClass(Tab, null, [{
6386 get: function get() {
6394 * ------------------------------------------------------------------------
6395 * Data Api implementation
6396 * ------------------------------------------------------------------------
6400 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
6401 event.preventDefault();
6403 Tab._jQueryInterface.call($$$1(this), 'show');
6406 * ------------------------------------------------------------------------
6408 * ------------------------------------------------------------------------
6411 $$$1.fn[NAME] = Tab._jQueryInterface;
6412 $$$1.fn[NAME].Constructor = Tab;
6414 $$$1.fn[NAME].noConflict = function () {
6415 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
6416 return Tab._jQueryInterface;
6423 * --------------------------------------------------------------------------
6424 * Bootstrap (v4.1.3): index.js
6425 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6426 * --------------------------------------------------------------------------
6430 if (typeof $$$1 === 'undefined') {
6431 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
6434 var version = $$$1.fn.jquery.split(' ')[0].split('.');
6441 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
6442 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
6446 exports.Util = Util;
6447 exports.Alert = Alert;
6448 exports.Button = Button;
6449 exports.Carousel = Carousel;
6450 exports.Collapse = Collapse;
6451 exports.Dropdown = Dropdown;
6452 exports.Modal = Modal;
6453 exports.Popover = Popover;
6454 exports.Scrollspy = ScrollSpy;
6456 exports.Tooltip = Tooltip;
6458 Object.defineProperty(exports, '__esModule', { value: true });
6461 //# sourceMappingURL=bootstrap.bundle.js.map