LaravelTest
6972 строки · 225.1 Кб
1/*!
2* Bootstrap v4.6.1 (https://getbootstrap.com/)
3* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5*/
6(function (global, factory) {7typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :8typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :9(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery));10})(this, (function (exports, $) { 'use strict';11
12function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }13
14var $__default = /*#__PURE__*/_interopDefaultLegacy($);15
16function _defineProperties(target, props) {17for (var i = 0; i < props.length; i++) {18var descriptor = props[i];19descriptor.enumerable = descriptor.enumerable || false;20descriptor.configurable = true;21if ("value" in descriptor) descriptor.writable = true;22Object.defineProperty(target, descriptor.key, descriptor);23}24}25
26function _createClass(Constructor, protoProps, staticProps) {27if (protoProps) _defineProperties(Constructor.prototype, protoProps);28if (staticProps) _defineProperties(Constructor, staticProps);29return Constructor;30}31
32function _extends$1() {33_extends$1 = Object.assign || function (target) {34for (var i = 1; i < arguments.length; i++) {35var source = arguments[i];36
37for (var key in source) {38if (Object.prototype.hasOwnProperty.call(source, key)) {39target[key] = source[key];40}41}42}43
44return target;45};46
47return _extends$1.apply(this, arguments);48}49
50function _inheritsLoose(subClass, superClass) {51subClass.prototype = Object.create(superClass.prototype);52subClass.prototype.constructor = subClass;53
54_setPrototypeOf(subClass, superClass);55}56
57function _setPrototypeOf(o, p) {58_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {59o.__proto__ = p;60return o;61};62
63return _setPrototypeOf(o, p);64}65
66/**67* --------------------------------------------------------------------------
68* Bootstrap (v4.6.1): util.js
69* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
70* --------------------------------------------------------------------------
71*/
72/**73* Private TransitionEnd Helpers
74*/
75
76var TRANSITION_END = 'transitionend';77var MAX_UID = 1000000;78var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)79
80function toType(obj) {81if (obj === null || typeof obj === 'undefined') {82return "" + obj;83}84
85return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();86}87
88function getSpecialTransitionEndEvent() {89return {90bindType: TRANSITION_END,91delegateType: TRANSITION_END,92handle: function handle(event) {93if ($__default["default"](event.target).is(this)) {94return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params95}96
97return undefined;98}99};100}101
102function transitionEndEmulator(duration) {103var _this = this;104
105var called = false;106$__default["default"](this).one(Util.TRANSITION_END, function () {107called = true;108});109setTimeout(function () {110if (!called) {111Util.triggerTransitionEnd(_this);112}113}, duration);114return this;115}116
117function setTransitionEndSupport() {118$__default["default"].fn.emulateTransitionEnd = transitionEndEmulator;119$__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();120}121/**122* Public Util API
123*/
124
125
126var Util = {127TRANSITION_END: 'bsTransitionEnd',128getUID: function getUID(prefix) {129do {130// eslint-disable-next-line no-bitwise131prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here132} while (document.getElementById(prefix));133
134return prefix;135},136getSelectorFromElement: function getSelectorFromElement(element) {137var selector = element.getAttribute('data-target');138
139if (!selector || selector === '#') {140var hrefAttr = element.getAttribute('href');141selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';142}143
144try {145return document.querySelector(selector) ? selector : null;146} catch (_) {147return null;148}149},150getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {151if (!element) {152return 0;153} // Get transition-duration of the element154
155
156var transitionDuration = $__default["default"](element).css('transition-duration');157var transitionDelay = $__default["default"](element).css('transition-delay');158var floatTransitionDuration = parseFloat(transitionDuration);159var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found160
161if (!floatTransitionDuration && !floatTransitionDelay) {162return 0;163} // If multiple durations are defined, take the first164
165
166transitionDuration = transitionDuration.split(',')[0];167transitionDelay = transitionDelay.split(',')[0];168return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;169},170reflow: function reflow(element) {171return element.offsetHeight;172},173triggerTransitionEnd: function triggerTransitionEnd(element) {174$__default["default"](element).trigger(TRANSITION_END);175},176supportsTransitionEnd: function supportsTransitionEnd() {177return Boolean(TRANSITION_END);178},179isElement: function isElement(obj) {180return (obj[0] || obj).nodeType;181},182typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {183for (var property in configTypes) {184if (Object.prototype.hasOwnProperty.call(configTypes, property)) {185var expectedTypes = configTypes[property];186var value = config[property];187var valueType = value && Util.isElement(value) ? 'element' : toType(value);188
189if (!new RegExp(expectedTypes).test(valueType)) {190throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));191}192}193}194},195findShadowRoot: function findShadowRoot(element) {196if (!document.documentElement.attachShadow) {197return null;198} // Can find the shadow root otherwise it'll return the document199
200
201if (typeof element.getRootNode === 'function') {202var root = element.getRootNode();203return root instanceof ShadowRoot ? root : null;204}205
206if (element instanceof ShadowRoot) {207return element;208} // when we don't find a shadow root209
210
211if (!element.parentNode) {212return null;213}214
215return Util.findShadowRoot(element.parentNode);216},217jQueryDetection: function jQueryDetection() {218if (typeof $__default["default"] === 'undefined') {219throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');220}221
222var version = $__default["default"].fn.jquery.split(' ')[0].split('.');223var minMajor = 1;224var ltMajor = 2;225var minMinor = 9;226var minPatch = 1;227var maxMajor = 4;228
229if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {230throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');231}232}233};234Util.jQueryDetection();235setTransitionEndSupport();236
237/**238* Constants
239*/
240
241var NAME$a = 'alert';242var VERSION$a = '4.6.1';243var DATA_KEY$a = 'bs.alert';244var EVENT_KEY$a = "." + DATA_KEY$a;245var DATA_API_KEY$7 = '.data-api';246var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a];247var CLASS_NAME_ALERT = 'alert';248var CLASS_NAME_FADE$5 = 'fade';249var CLASS_NAME_SHOW$7 = 'show';250var EVENT_CLOSE = "close" + EVENT_KEY$a;251var EVENT_CLOSED = "closed" + EVENT_KEY$a;252var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7;253var SELECTOR_DISMISS = '[data-dismiss="alert"]';254/**255* Class definition
256*/
257
258var Alert = /*#__PURE__*/function () {259function Alert(element) {260this._element = element;261} // Getters262
263
264var _proto = Alert.prototype;265
266// Public267_proto.close = function close(element) {268var rootElement = this._element;269
270if (element) {271rootElement = this._getRootElement(element);272}273
274var customEvent = this._triggerCloseEvent(rootElement);275
276if (customEvent.isDefaultPrevented()) {277return;278}279
280this._removeElement(rootElement);281};282
283_proto.dispose = function dispose() {284$__default["default"].removeData(this._element, DATA_KEY$a);285this._element = null;286} // Private287;288
289_proto._getRootElement = function _getRootElement(element) {290var selector = Util.getSelectorFromElement(element);291var parent = false;292
293if (selector) {294parent = document.querySelector(selector);295}296
297if (!parent) {298parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0];299}300
301return parent;302};303
304_proto._triggerCloseEvent = function _triggerCloseEvent(element) {305var closeEvent = $__default["default"].Event(EVENT_CLOSE);306$__default["default"](element).trigger(closeEvent);307return closeEvent;308};309
310_proto._removeElement = function _removeElement(element) {311var _this = this;312
313$__default["default"](element).removeClass(CLASS_NAME_SHOW$7);314
315if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) {316this._destroyElement(element);317
318return;319}320
321var transitionDuration = Util.getTransitionDurationFromElement(element);322$__default["default"](element).one(Util.TRANSITION_END, function (event) {323return _this._destroyElement(element, event);324}).emulateTransitionEnd(transitionDuration);325};326
327_proto._destroyElement = function _destroyElement(element) {328$__default["default"](element).detach().trigger(EVENT_CLOSED).remove();329} // Static330;331
332Alert._jQueryInterface = function _jQueryInterface(config) {333return this.each(function () {334var $element = $__default["default"](this);335var data = $element.data(DATA_KEY$a);336
337if (!data) {338data = new Alert(this);339$element.data(DATA_KEY$a, data);340}341
342if (config === 'close') {343data[config](this);344}345});346};347
348Alert._handleDismiss = function _handleDismiss(alertInstance) {349return function (event) {350if (event) {351event.preventDefault();352}353
354alertInstance.close(this);355};356};357
358_createClass(Alert, null, [{359key: "VERSION",360get: function get() {361return VERSION$a;362}363}]);364
365return Alert;366}();367/**368* Data API implementation
369*/
370
371
372$__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));373/**374* jQuery
375*/
376
377$__default["default"].fn[NAME$a] = Alert._jQueryInterface;378$__default["default"].fn[NAME$a].Constructor = Alert;379
380$__default["default"].fn[NAME$a].noConflict = function () {381$__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a;382return Alert._jQueryInterface;383};384
385/**386* Constants
387*/
388
389var NAME$9 = 'button';390var VERSION$9 = '4.6.1';391var DATA_KEY$9 = 'bs.button';392var EVENT_KEY$9 = "." + DATA_KEY$9;393var DATA_API_KEY$6 = '.data-api';394var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9];395var CLASS_NAME_ACTIVE$3 = 'active';396var CLASS_NAME_BUTTON = 'btn';397var CLASS_NAME_FOCUS = 'focus';398var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6;399var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6);400var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6;401var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';402var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';403var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]';404var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';405var SELECTOR_INPUT = 'input:not([type="hidden"])';406var SELECTOR_ACTIVE$2 = '.active';407var SELECTOR_BUTTON = '.btn';408/**409* Class definition
410*/
411
412var Button = /*#__PURE__*/function () {413function Button(element) {414this._element = element;415this.shouldAvoidTriggerChange = false;416} // Getters417
418
419var _proto = Button.prototype;420
421// Public422_proto.toggle = function toggle() {423var triggerChangeEvent = true;424var addAriaPressed = true;425var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0];426
427if (rootElement) {428var input = this._element.querySelector(SELECTOR_INPUT);429
430if (input) {431if (input.type === 'radio') {432if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) {433triggerChangeEvent = false;434} else {435var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2);436
437if (activeElement) {438$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3);439}440}441}442
443if (triggerChangeEvent) {444// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input445if (input.type === 'checkbox' || input.type === 'radio') {446input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3);447}448
449if (!this.shouldAvoidTriggerChange) {450$__default["default"](input).trigger('change');451}452}453
454input.focus();455addAriaPressed = false;456}457}458
459if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {460if (addAriaPressed) {461this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3));462}463
464if (triggerChangeEvent) {465$__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3);466}467}468};469
470_proto.dispose = function dispose() {471$__default["default"].removeData(this._element, DATA_KEY$9);472this._element = null;473} // Static474;475
476Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {477return this.each(function () {478var $element = $__default["default"](this);479var data = $element.data(DATA_KEY$9);480
481if (!data) {482data = new Button(this);483$element.data(DATA_KEY$9, data);484}485
486data.shouldAvoidTriggerChange = avoidTriggerChange;487
488if (config === 'toggle') {489data[config]();490}491});492};493
494_createClass(Button, null, [{495key: "VERSION",496get: function get() {497return VERSION$9;498}499}]);500
501return Button;502}();503/**504* Data API implementation
505*/
506
507
508$__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) {509var button = event.target;510var initialButton = button;511
512if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) {513button = $__default["default"](button).closest(SELECTOR_BUTTON)[0];514}515
516if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {517event.preventDefault(); // work around Firefox bug #1540995518} else {519var inputBtn = button.querySelector(SELECTOR_INPUT);520
521if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {522event.preventDefault(); // work around Firefox bug #1540995523
524return;525}526
527if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {528Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT');529}530}531}).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {532var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0];533$__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));534});535$__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () {536// ensure correct active class is set to match the controls' actual values/states537// find all checkboxes/readio buttons inside data-toggle groups538var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));539
540for (var i = 0, len = buttons.length; i < len; i++) {541var button = buttons[i];542var input = button.querySelector(SELECTOR_INPUT);543
544if (input.checked || input.hasAttribute('checked')) {545button.classList.add(CLASS_NAME_ACTIVE$3);546} else {547button.classList.remove(CLASS_NAME_ACTIVE$3);548}549} // find all button toggles550
551
552buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4));553
554for (var _i = 0, _len = buttons.length; _i < _len; _i++) {555var _button = buttons[_i];556
557if (_button.getAttribute('aria-pressed') === 'true') {558_button.classList.add(CLASS_NAME_ACTIVE$3);559} else {560_button.classList.remove(CLASS_NAME_ACTIVE$3);561}562}563});564/**565* jQuery
566*/
567
568$__default["default"].fn[NAME$9] = Button._jQueryInterface;569$__default["default"].fn[NAME$9].Constructor = Button;570
571$__default["default"].fn[NAME$9].noConflict = function () {572$__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9;573return Button._jQueryInterface;574};575
576/**577* Constants
578*/
579
580var NAME$8 = 'carousel';581var VERSION$8 = '4.6.1';582var DATA_KEY$8 = 'bs.carousel';583var EVENT_KEY$8 = "." + DATA_KEY$8;584var DATA_API_KEY$5 = '.data-api';585var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8];586var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key587
588var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key589
590var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch591
592var SWIPE_THRESHOLD = 40;593var CLASS_NAME_CAROUSEL = 'carousel';594var CLASS_NAME_ACTIVE$2 = 'active';595var CLASS_NAME_SLIDE = 'slide';596var CLASS_NAME_RIGHT = 'carousel-item-right';597var CLASS_NAME_LEFT = 'carousel-item-left';598var CLASS_NAME_NEXT = 'carousel-item-next';599var CLASS_NAME_PREV = 'carousel-item-prev';600var CLASS_NAME_POINTER_EVENT = 'pointer-event';601var DIRECTION_NEXT = 'next';602var DIRECTION_PREV = 'prev';603var DIRECTION_LEFT = 'left';604var DIRECTION_RIGHT = 'right';605var EVENT_SLIDE = "slide" + EVENT_KEY$8;606var EVENT_SLID = "slid" + EVENT_KEY$8;607var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8;608var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8;609var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8;610var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8;611var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8;612var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8;613var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8;614var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8;615var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8;616var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5;617var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5;618var SELECTOR_ACTIVE$1 = '.active';619var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';620var SELECTOR_ITEM = '.carousel-item';621var SELECTOR_ITEM_IMG = '.carousel-item img';622var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';623var SELECTOR_INDICATORS = '.carousel-indicators';624var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';625var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';626var Default$7 = {627interval: 5000,628keyboard: true,629slide: false,630pause: 'hover',631wrap: true,632touch: true633};634var DefaultType$7 = {635interval: '(number|boolean)',636keyboard: 'boolean',637slide: '(boolean|string)',638pause: '(string|boolean)',639wrap: 'boolean',640touch: 'boolean'641};642var PointerType = {643TOUCH: 'touch',644PEN: 'pen'645};646/**647* Class definition
648*/
649
650var Carousel = /*#__PURE__*/function () {651function Carousel(element, config) {652this._items = null;653this._interval = null;654this._activeElement = null;655this._isPaused = false;656this._isSliding = false;657this.touchTimeout = null;658this.touchStartX = 0;659this.touchDeltaX = 0;660this._config = this._getConfig(config);661this._element = element;662this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);663this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;664this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);665
666this._addEventListeners();667} // Getters668
669
670var _proto = Carousel.prototype;671
672// Public673_proto.next = function next() {674if (!this._isSliding) {675this._slide(DIRECTION_NEXT);676}677};678
679_proto.nextWhenVisible = function nextWhenVisible() {680var $element = $__default["default"](this._element); // Don't call next when the page isn't visible681// or the carousel or its parent isn't visible682
683if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {684this.next();685}686};687
688_proto.prev = function prev() {689if (!this._isSliding) {690this._slide(DIRECTION_PREV);691}692};693
694_proto.pause = function pause(event) {695if (!event) {696this._isPaused = true;697}698
699if (this._element.querySelector(SELECTOR_NEXT_PREV)) {700Util.triggerTransitionEnd(this._element);701this.cycle(true);702}703
704clearInterval(this._interval);705this._interval = null;706};707
708_proto.cycle = function cycle(event) {709if (!event) {710this._isPaused = false;711}712
713if (this._interval) {714clearInterval(this._interval);715this._interval = null;716}717
718if (this._config.interval && !this._isPaused) {719this._updateInterval();720
721this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);722}723};724
725_proto.to = function to(index) {726var _this = this;727
728this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);729
730var activeIndex = this._getItemIndex(this._activeElement);731
732if (index > this._items.length - 1 || index < 0) {733return;734}735
736if (this._isSliding) {737$__default["default"](this._element).one(EVENT_SLID, function () {738return _this.to(index);739});740return;741}742
743if (activeIndex === index) {744this.pause();745this.cycle();746return;747}748
749var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;750
751this._slide(direction, this._items[index]);752};753
754_proto.dispose = function dispose() {755$__default["default"](this._element).off(EVENT_KEY$8);756$__default["default"].removeData(this._element, DATA_KEY$8);757this._items = null;758this._config = null;759this._element = null;760this._interval = null;761this._isPaused = null;762this._isSliding = null;763this._activeElement = null;764this._indicatorsElement = null;765} // Private766;767
768_proto._getConfig = function _getConfig(config) {769config = _extends$1({}, Default$7, config);770Util.typeCheckConfig(NAME$8, config, DefaultType$7);771return config;772};773
774_proto._handleSwipe = function _handleSwipe() {775var absDeltax = Math.abs(this.touchDeltaX);776
777if (absDeltax <= SWIPE_THRESHOLD) {778return;779}780
781var direction = absDeltax / this.touchDeltaX;782this.touchDeltaX = 0; // swipe left783
784if (direction > 0) {785this.prev();786} // swipe right787
788
789if (direction < 0) {790this.next();791}792};793
794_proto._addEventListeners = function _addEventListeners() {795var _this2 = this;796
797if (this._config.keyboard) {798$__default["default"](this._element).on(EVENT_KEYDOWN, function (event) {799return _this2._keydown(event);800});801}802
803if (this._config.pause === 'hover') {804$__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) {805return _this2.pause(event);806}).on(EVENT_MOUSELEAVE, function (event) {807return _this2.cycle(event);808});809}810
811if (this._config.touch) {812this._addTouchEventListeners();813}814};815
816_proto._addTouchEventListeners = function _addTouchEventListeners() {817var _this3 = this;818
819if (!this._touchSupported) {820return;821}822
823var start = function start(event) {824if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {825_this3.touchStartX = event.originalEvent.clientX;826} else if (!_this3._pointerEvent) {827_this3.touchStartX = event.originalEvent.touches[0].clientX;828}829};830
831var move = function move(event) {832// ensure swiping with one touch and not pinching833_this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX;834};835
836var end = function end(event) {837if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {838_this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;839}840
841_this3._handleSwipe();842
843if (_this3._config.pause === 'hover') {844// If it's a touch-enabled device, mouseenter/leave are fired as845// part of the mouse compatibility events on first tap - the carousel846// would stop cycling until user tapped out of it;847// here, we listen for touchend, explicitly pause the carousel848// (as if it's the second time we tap on it, mouseenter compat event849// is NOT fired) and after a timeout (to allow for mouse compatibility850// events to fire) we explicitly restart cycling851_this3.pause();852
853if (_this3.touchTimeout) {854clearTimeout(_this3.touchTimeout);855}856
857_this3.touchTimeout = setTimeout(function (event) {858return _this3.cycle(event);859}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);860}861};862
863$__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {864return e.preventDefault();865});866
867if (this._pointerEvent) {868$__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) {869return start(event);870});871$__default["default"](this._element).on(EVENT_POINTERUP, function (event) {872return end(event);873});874
875this._element.classList.add(CLASS_NAME_POINTER_EVENT);876} else {877$__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) {878return start(event);879});880$__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) {881return move(event);882});883$__default["default"](this._element).on(EVENT_TOUCHEND, function (event) {884return end(event);885});886}887};888
889_proto._keydown = function _keydown(event) {890if (/input|textarea/i.test(event.target.tagName)) {891return;892}893
894switch (event.which) {895case ARROW_LEFT_KEYCODE:896event.preventDefault();897this.prev();898break;899
900case ARROW_RIGHT_KEYCODE:901event.preventDefault();902this.next();903break;904}905};906
907_proto._getItemIndex = function _getItemIndex(element) {908this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];909return this._items.indexOf(element);910};911
912_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {913var isNextDirection = direction === DIRECTION_NEXT;914var isPrevDirection = direction === DIRECTION_PREV;915
916var activeIndex = this._getItemIndex(activeElement);917
918var lastItemIndex = this._items.length - 1;919var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;920
921if (isGoingToWrap && !this._config.wrap) {922return activeElement;923}924
925var delta = direction === DIRECTION_PREV ? -1 : 1;926var itemIndex = (activeIndex + delta) % this._items.length;927return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];928};929
930_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {931var targetIndex = this._getItemIndex(relatedTarget);932
933var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));934
935var slideEvent = $__default["default"].Event(EVENT_SLIDE, {936relatedTarget: relatedTarget,937direction: eventDirectionName,938from: fromIndex,939to: targetIndex940});941$__default["default"](this._element).trigger(slideEvent);942return slideEvent;943};944
945_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {946if (this._indicatorsElement) {947var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));948$__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2);949
950var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];951
952if (nextIndicator) {953$__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2);954}955}956};957
958_proto._updateInterval = function _updateInterval() {959var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM);960
961if (!element) {962return;963}964
965var elementInterval = parseInt(element.getAttribute('data-interval'), 10);966
967if (elementInterval) {968this._config.defaultInterval = this._config.defaultInterval || this._config.interval;969this._config.interval = elementInterval;970} else {971this._config.interval = this._config.defaultInterval || this._config.interval;972}973};974
975_proto._slide = function _slide(direction, element) {976var _this4 = this;977
978var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);979
980var activeElementIndex = this._getItemIndex(activeElement);981
982var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);983
984var nextElementIndex = this._getItemIndex(nextElement);985
986var isCycling = Boolean(this._interval);987var directionalClassName;988var orderClassName;989var eventDirectionName;990
991if (direction === DIRECTION_NEXT) {992directionalClassName = CLASS_NAME_LEFT;993orderClassName = CLASS_NAME_NEXT;994eventDirectionName = DIRECTION_LEFT;995} else {996directionalClassName = CLASS_NAME_RIGHT;997orderClassName = CLASS_NAME_PREV;998eventDirectionName = DIRECTION_RIGHT;999}1000
1001if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) {1002this._isSliding = false;1003return;1004}1005
1006var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);1007
1008if (slideEvent.isDefaultPrevented()) {1009return;1010}1011
1012if (!activeElement || !nextElement) {1013// Some weirdness is happening, so we bail1014return;1015}1016
1017this._isSliding = true;1018
1019if (isCycling) {1020this.pause();1021}1022
1023this._setActiveIndicatorElement(nextElement);1024
1025this._activeElement = nextElement;1026var slidEvent = $__default["default"].Event(EVENT_SLID, {1027relatedTarget: nextElement,1028direction: eventDirectionName,1029from: activeElementIndex,1030to: nextElementIndex1031});1032
1033if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) {1034$__default["default"](nextElement).addClass(orderClassName);1035Util.reflow(nextElement);1036$__default["default"](activeElement).addClass(directionalClassName);1037$__default["default"](nextElement).addClass(directionalClassName);1038var transitionDuration = Util.getTransitionDurationFromElement(activeElement);1039$__default["default"](activeElement).one(Util.TRANSITION_END, function () {1040$__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2);1041$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName);1042_this4._isSliding = false;1043setTimeout(function () {1044return $__default["default"](_this4._element).trigger(slidEvent);1045}, 0);1046}).emulateTransitionEnd(transitionDuration);1047} else {1048$__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2);1049$__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2);1050this._isSliding = false;1051$__default["default"](this._element).trigger(slidEvent);1052}1053
1054if (isCycling) {1055this.cycle();1056}1057} // Static1058;1059
1060Carousel._jQueryInterface = function _jQueryInterface(config) {1061return this.each(function () {1062var data = $__default["default"](this).data(DATA_KEY$8);1063
1064var _config = _extends$1({}, Default$7, $__default["default"](this).data());1065
1066if (typeof config === 'object') {1067_config = _extends$1({}, _config, config);1068}1069
1070var action = typeof config === 'string' ? config : _config.slide;1071
1072if (!data) {1073data = new Carousel(this, _config);1074$__default["default"](this).data(DATA_KEY$8, data);1075}1076
1077if (typeof config === 'number') {1078data.to(config);1079} else if (typeof action === 'string') {1080if (typeof data[action] === 'undefined') {1081throw new TypeError("No method named \"" + action + "\"");1082}1083
1084data[action]();1085} else if (_config.interval && _config.ride) {1086data.pause();1087data.cycle();1088}1089});1090};1091
1092Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {1093var selector = Util.getSelectorFromElement(this);1094
1095if (!selector) {1096return;1097}1098
1099var target = $__default["default"](selector)[0];1100
1101if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) {1102return;1103}1104
1105var config = _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data());1106
1107var slideIndex = this.getAttribute('data-slide-to');1108
1109if (slideIndex) {1110config.interval = false;1111}1112
1113Carousel._jQueryInterface.call($__default["default"](target), config);1114
1115if (slideIndex) {1116$__default["default"](target).data(DATA_KEY$8).to(slideIndex);1117}1118
1119event.preventDefault();1120};1121
1122_createClass(Carousel, null, [{1123key: "VERSION",1124get: function get() {1125return VERSION$8;1126}1127}, {1128key: "Default",1129get: function get() {1130return Default$7;1131}1132}]);1133
1134return Carousel;1135}();1136/**1137* Data API implementation
1138*/
1139
1140
1141$__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);1142$__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () {1143var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));1144
1145for (var i = 0, len = carousels.length; i < len; i++) {1146var $carousel = $__default["default"](carousels[i]);1147
1148Carousel._jQueryInterface.call($carousel, $carousel.data());1149}1150});1151/**1152* jQuery
1153*/
1154
1155$__default["default"].fn[NAME$8] = Carousel._jQueryInterface;1156$__default["default"].fn[NAME$8].Constructor = Carousel;1157
1158$__default["default"].fn[NAME$8].noConflict = function () {1159$__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8;1160return Carousel._jQueryInterface;1161};1162
1163/**1164* Constants
1165*/
1166
1167var NAME$7 = 'collapse';1168var VERSION$7 = '4.6.1';1169var DATA_KEY$7 = 'bs.collapse';1170var EVENT_KEY$7 = "." + DATA_KEY$7;1171var DATA_API_KEY$4 = '.data-api';1172var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7];1173var CLASS_NAME_SHOW$6 = 'show';1174var CLASS_NAME_COLLAPSE = 'collapse';1175var CLASS_NAME_COLLAPSING = 'collapsing';1176var CLASS_NAME_COLLAPSED = 'collapsed';1177var DIMENSION_WIDTH = 'width';1178var DIMENSION_HEIGHT = 'height';1179var EVENT_SHOW$4 = "show" + EVENT_KEY$7;1180var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7;1181var EVENT_HIDE$4 = "hide" + EVENT_KEY$7;1182var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7;1183var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4;1184var SELECTOR_ACTIVES = '.show, .collapsing';1185var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]';1186var Default$6 = {1187toggle: true,1188parent: ''1189};1190var DefaultType$6 = {1191toggle: 'boolean',1192parent: '(string|element)'1193};1194/**1195* Class definition
1196*/
1197
1198var Collapse = /*#__PURE__*/function () {1199function Collapse(element, config) {1200this._isTransitioning = false;1201this._element = element;1202this._config = this._getConfig(config);1203this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));1204var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3));1205
1206for (var i = 0, len = toggleList.length; i < len; i++) {1207var elem = toggleList[i];1208var selector = Util.getSelectorFromElement(elem);1209var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {1210return foundElem === element;1211});1212
1213if (selector !== null && filterElement.length > 0) {1214this._selector = selector;1215
1216this._triggerArray.push(elem);1217}1218}1219
1220this._parent = this._config.parent ? this._getParent() : null;1221
1222if (!this._config.parent) {1223this._addAriaAndCollapsedClass(this._element, this._triggerArray);1224}1225
1226if (this._config.toggle) {1227this.toggle();1228}1229} // Getters1230
1231
1232var _proto = Collapse.prototype;1233
1234// Public1235_proto.toggle = function toggle() {1236if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {1237this.hide();1238} else {1239this.show();1240}1241};1242
1243_proto.show = function show() {1244var _this = this;1245
1246if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {1247return;1248}1249
1250var actives;1251var activesData;1252
1253if (this._parent) {1254actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {1255if (typeof _this._config.parent === 'string') {1256return elem.getAttribute('data-parent') === _this._config.parent;1257}1258
1259return elem.classList.contains(CLASS_NAME_COLLAPSE);1260});1261
1262if (actives.length === 0) {1263actives = null;1264}1265}1266
1267if (actives) {1268activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7);1269
1270if (activesData && activesData._isTransitioning) {1271return;1272}1273}1274
1275var startEvent = $__default["default"].Event(EVENT_SHOW$4);1276$__default["default"](this._element).trigger(startEvent);1277
1278if (startEvent.isDefaultPrevented()) {1279return;1280}1281
1282if (actives) {1283Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide');1284
1285if (!activesData) {1286$__default["default"](actives).data(DATA_KEY$7, null);1287}1288}1289
1290var dimension = this._getDimension();1291
1292$__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);1293this._element.style[dimension] = 0;1294
1295if (this._triggerArray.length) {1296$__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);1297}1298
1299this.setTransitioning(true);1300
1301var complete = function complete() {1302$__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6);1303_this._element.style[dimension] = '';1304
1305_this.setTransitioning(false);1306
1307$__default["default"](_this._element).trigger(EVENT_SHOWN$4);1308};1309
1310var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);1311var scrollSize = "scroll" + capitalizedDimension;1312var transitionDuration = Util.getTransitionDurationFromElement(this._element);1313$__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);1314this._element.style[dimension] = this._element[scrollSize] + "px";1315};1316
1317_proto.hide = function hide() {1318var _this2 = this;1319
1320if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {1321return;1322}1323
1324var startEvent = $__default["default"].Event(EVENT_HIDE$4);1325$__default["default"](this._element).trigger(startEvent);1326
1327if (startEvent.isDefaultPrevented()) {1328return;1329}1330
1331var dimension = this._getDimension();1332
1333this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";1334Util.reflow(this._element);1335$__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6);1336var triggerArrayLength = this._triggerArray.length;1337
1338if (triggerArrayLength > 0) {1339for (var i = 0; i < triggerArrayLength; i++) {1340var trigger = this._triggerArray[i];1341var selector = Util.getSelectorFromElement(trigger);1342
1343if (selector !== null) {1344var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector)));1345
1346if (!$elem.hasClass(CLASS_NAME_SHOW$6)) {1347$__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);1348}1349}1350}1351}1352
1353this.setTransitioning(true);1354
1355var complete = function complete() {1356_this2.setTransitioning(false);1357
1358$__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4);1359};1360
1361this._element.style[dimension] = '';1362var transitionDuration = Util.getTransitionDurationFromElement(this._element);1363$__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);1364};1365
1366_proto.setTransitioning = function setTransitioning(isTransitioning) {1367this._isTransitioning = isTransitioning;1368};1369
1370_proto.dispose = function dispose() {1371$__default["default"].removeData(this._element, DATA_KEY$7);1372this._config = null;1373this._parent = null;1374this._element = null;1375this._triggerArray = null;1376this._isTransitioning = null;1377} // Private1378;1379
1380_proto._getConfig = function _getConfig(config) {1381config = _extends$1({}, Default$6, config);1382config.toggle = Boolean(config.toggle); // Coerce string values1383
1384Util.typeCheckConfig(NAME$7, config, DefaultType$6);1385return config;1386};1387
1388_proto._getDimension = function _getDimension() {1389var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH);1390return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;1391};1392
1393_proto._getParent = function _getParent() {1394var _this3 = this;1395
1396var parent;1397
1398if (Util.isElement(this._config.parent)) {1399parent = this._config.parent; // It's a jQuery object1400
1401if (typeof this._config.parent.jquery !== 'undefined') {1402parent = this._config.parent[0];1403}1404} else {1405parent = document.querySelector(this._config.parent);1406}1407
1408var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";1409var children = [].slice.call(parent.querySelectorAll(selector));1410$__default["default"](children).each(function (i, element) {1411_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);1412});1413return parent;1414};1415
1416_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {1417var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6);1418
1419if (triggerArray.length) {1420$__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);1421}1422} // Static1423;1424
1425Collapse._getTargetFromElement = function _getTargetFromElement(element) {1426var selector = Util.getSelectorFromElement(element);1427return selector ? document.querySelector(selector) : null;1428};1429
1430Collapse._jQueryInterface = function _jQueryInterface(config) {1431return this.each(function () {1432var $element = $__default["default"](this);1433var data = $element.data(DATA_KEY$7);1434
1435var _config = _extends$1({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {});1436
1437if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {1438_config.toggle = false;1439}1440
1441if (!data) {1442data = new Collapse(this, _config);1443$element.data(DATA_KEY$7, data);1444}1445
1446if (typeof config === 'string') {1447if (typeof data[config] === 'undefined') {1448throw new TypeError("No method named \"" + config + "\"");1449}1450
1451data[config]();1452}1453});1454};1455
1456_createClass(Collapse, null, [{1457key: "VERSION",1458get: function get() {1459return VERSION$7;1460}1461}, {1462key: "Default",1463get: function get() {1464return Default$6;1465}1466}]);1467
1468return Collapse;1469}();1470/**1471* Data API implementation
1472*/
1473
1474
1475$__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {1476// preventDefault only for <a> elements (which change the URL) not inside the collapsible element1477if (event.currentTarget.tagName === 'A') {1478event.preventDefault();1479}1480
1481var $trigger = $__default["default"](this);1482var selector = Util.getSelectorFromElement(this);1483var selectors = [].slice.call(document.querySelectorAll(selector));1484$__default["default"](selectors).each(function () {1485var $target = $__default["default"](this);1486var data = $target.data(DATA_KEY$7);1487var config = data ? 'toggle' : $trigger.data();1488
1489Collapse._jQueryInterface.call($target, config);1490});1491});1492/**1493* jQuery
1494*/
1495
1496$__default["default"].fn[NAME$7] = Collapse._jQueryInterface;1497$__default["default"].fn[NAME$7].Constructor = Collapse;1498
1499$__default["default"].fn[NAME$7].noConflict = function () {1500$__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7;1501return Collapse._jQueryInterface;1502};1503
1504/**!1505* @fileOverview Kickass library to create and place poppers near their reference elements.
1506* @version 1.16.1
1507* @license
1508* Copyright (c) 2016 Federico Zivolo and contributors
1509*
1510* Permission is hereby granted, free of charge, to any person obtaining a copy
1511* of this software and associated documentation files (the "Software"), to deal
1512* in the Software without restriction, including without limitation the rights
1513* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1514* copies of the Software, and to permit persons to whom the Software is
1515* furnished to do so, subject to the following conditions:
1516*
1517* The above copyright notice and this permission notice shall be included in all
1518* copies or substantial portions of the Software.
1519*
1520* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1521* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1522* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1523* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1524* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1525* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1526* SOFTWARE.
1527*/
1528var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';1529
1530var timeoutDuration = function () {1531var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];1532for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {1533if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {1534return 1;1535}1536}1537return 0;1538}();1539
1540function microtaskDebounce(fn) {1541var called = false;1542return function () {1543if (called) {1544return;1545}1546called = true;1547window.Promise.resolve().then(function () {1548called = false;1549fn();1550});1551};1552}1553
1554function taskDebounce(fn) {1555var scheduled = false;1556return function () {1557if (!scheduled) {1558scheduled = true;1559setTimeout(function () {1560scheduled = false;1561fn();1562}, timeoutDuration);1563}1564};1565}1566
1567var supportsMicroTasks = isBrowser && window.Promise;1568
1569/**1570* Create a debounced version of a method, that's asynchronously deferred
1571* but called in the minimum time possible.
1572*
1573* @method
1574* @memberof Popper.Utils
1575* @argument {Function} fn
1576* @returns {Function}
1577*/
1578var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;1579
1580/**1581* Check if the given variable is a function
1582* @method
1583* @memberof Popper.Utils
1584* @argument {Any} functionToCheck - variable to check
1585* @returns {Boolean} answer to: is a function?
1586*/
1587function isFunction(functionToCheck) {1588var getType = {};1589return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';1590}1591
1592/**1593* Get CSS computed property of the given element
1594* @method
1595* @memberof Popper.Utils
1596* @argument {Eement} element
1597* @argument {String} property
1598*/
1599function getStyleComputedProperty(element, property) {1600if (element.nodeType !== 1) {1601return [];1602}1603// NOTE: 1 DOM access here1604var window = element.ownerDocument.defaultView;1605var css = window.getComputedStyle(element, null);1606return property ? css[property] : css;1607}1608
1609/**1610* Returns the parentNode or the host of the element
1611* @method
1612* @memberof Popper.Utils
1613* @argument {Element} element
1614* @returns {Element} parent
1615*/
1616function getParentNode(element) {1617if (element.nodeName === 'HTML') {1618return element;1619}1620return element.parentNode || element.host;1621}1622
1623/**1624* Returns the scrolling parent of the given element
1625* @method
1626* @memberof Popper.Utils
1627* @argument {Element} element
1628* @returns {Element} scroll parent
1629*/
1630function getScrollParent(element) {1631// Return body, `getScroll` will take care to get the correct `scrollTop` from it1632if (!element) {1633return document.body;1634}1635
1636switch (element.nodeName) {1637case 'HTML':1638case 'BODY':1639return element.ownerDocument.body;1640case '#document':1641return element.body;1642}1643
1644// Firefox want us to check `-x` and `-y` variations as well1645
1646var _getStyleComputedProp = getStyleComputedProperty(element),1647overflow = _getStyleComputedProp.overflow,1648overflowX = _getStyleComputedProp.overflowX,1649overflowY = _getStyleComputedProp.overflowY;1650
1651if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {1652return element;1653}1654
1655return getScrollParent(getParentNode(element));1656}1657
1658/**1659* Returns the reference node of the reference object, or the reference object itself.
1660* @method
1661* @memberof Popper.Utils
1662* @param {Element|Object} reference - the reference element (the popper will be relative to this)
1663* @returns {Element} parent
1664*/
1665function getReferenceNode(reference) {1666return reference && reference.referenceNode ? reference.referenceNode : reference;1667}1668
1669var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);1670var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);1671
1672/**1673* Determines if the browser is Internet Explorer
1674* @method
1675* @memberof Popper.Utils
1676* @param {Number} version to check
1677* @returns {Boolean} isIE
1678*/
1679function isIE(version) {1680if (version === 11) {1681return isIE11;1682}1683if (version === 10) {1684return isIE10;1685}1686return isIE11 || isIE10;1687}1688
1689/**1690* Returns the offset parent of the given element
1691* @method
1692* @memberof Popper.Utils
1693* @argument {Element} element
1694* @returns {Element} offset parent
1695*/
1696function getOffsetParent(element) {1697if (!element) {1698return document.documentElement;1699}1700
1701var noOffsetParent = isIE(10) ? document.body : null;1702
1703// NOTE: 1 DOM access here1704var offsetParent = element.offsetParent || null;1705// Skip hidden elements which don't have an offsetParent1706while (offsetParent === noOffsetParent && element.nextElementSibling) {1707offsetParent = (element = element.nextElementSibling).offsetParent;1708}1709
1710var nodeName = offsetParent && offsetParent.nodeName;1711
1712if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {1713return element ? element.ownerDocument.documentElement : document.documentElement;1714}1715
1716// .offsetParent will return the closest TH, TD or TABLE in case1717// no offsetParent is present, I hate this job...1718if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {1719return getOffsetParent(offsetParent);1720}1721
1722return offsetParent;1723}1724
1725function isOffsetContainer(element) {1726var nodeName = element.nodeName;1727
1728if (nodeName === 'BODY') {1729return false;1730}1731return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;1732}1733
1734/**1735* Finds the root node (document, shadowDOM root) of the given element
1736* @method
1737* @memberof Popper.Utils
1738* @argument {Element} node
1739* @returns {Element} root node
1740*/
1741function getRoot(node) {1742if (node.parentNode !== null) {1743return getRoot(node.parentNode);1744}1745
1746return node;1747}1748
1749/**1750* Finds the offset parent common to the two provided nodes
1751* @method
1752* @memberof Popper.Utils
1753* @argument {Element} element1
1754* @argument {Element} element2
1755* @returns {Element} common offset parent
1756*/
1757function findCommonOffsetParent(element1, element2) {1758// This check is needed to avoid errors in case one of the elements isn't defined for any reason1759if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {1760return document.documentElement;1761}1762
1763// Here we make sure to give as "start" the element that comes first in the DOM1764var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;1765var start = order ? element1 : element2;1766var end = order ? element2 : element1;1767
1768// Get common ancestor container1769var range = document.createRange();1770range.setStart(start, 0);1771range.setEnd(end, 0);1772var commonAncestorContainer = range.commonAncestorContainer;1773
1774// Both nodes are inside #document1775
1776if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {1777if (isOffsetContainer(commonAncestorContainer)) {1778return commonAncestorContainer;1779}1780
1781return getOffsetParent(commonAncestorContainer);1782}1783
1784// one of the nodes is inside shadowDOM, find which one1785var element1root = getRoot(element1);1786if (element1root.host) {1787return findCommonOffsetParent(element1root.host, element2);1788} else {1789return findCommonOffsetParent(element1, getRoot(element2).host);1790}1791}1792
1793/**1794* Gets the scroll value of the given element in the given side (top and left)
1795* @method
1796* @memberof Popper.Utils
1797* @argument {Element} element
1798* @argument {String} side `top` or `left`
1799* @returns {number} amount of scrolled pixels
1800*/
1801function getScroll(element) {1802var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';1803
1804var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';1805var nodeName = element.nodeName;1806
1807if (nodeName === 'BODY' || nodeName === 'HTML') {1808var html = element.ownerDocument.documentElement;1809var scrollingElement = element.ownerDocument.scrollingElement || html;1810return scrollingElement[upperSide];1811}1812
1813return element[upperSide];1814}1815
1816/*1817* Sum or subtract the element scroll values (left and top) from a given rect object
1818* @method
1819* @memberof Popper.Utils
1820* @param {Object} rect - Rect object you want to change
1821* @param {HTMLElement} element - The element from the function reads the scroll values
1822* @param {Boolean} subtract - set to true if you want to subtract the scroll values
1823* @return {Object} rect - The modifier rect object
1824*/
1825function includeScroll(rect, element) {1826var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;1827
1828var scrollTop = getScroll(element, 'top');1829var scrollLeft = getScroll(element, 'left');1830var modifier = subtract ? -1 : 1;1831rect.top += scrollTop * modifier;1832rect.bottom += scrollTop * modifier;1833rect.left += scrollLeft * modifier;1834rect.right += scrollLeft * modifier;1835return rect;1836}1837
1838/*1839* Helper to detect borders of a given element
1840* @method
1841* @memberof Popper.Utils
1842* @param {CSSStyleDeclaration} styles
1843* Result of `getStyleComputedProperty` on the given element
1844* @param {String} axis - `x` or `y`
1845* @return {number} borders - The borders size of the given axis
1846*/
1847
1848function getBordersSize(styles, axis) {1849var sideA = axis === 'x' ? 'Left' : 'Top';1850var sideB = sideA === 'Left' ? 'Right' : 'Bottom';1851
1852return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);1853}1854
1855function getSize(axis, body, html, computedStyle) {1856return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);1857}1858
1859function getWindowSizes(document) {1860var body = document.body;1861var html = document.documentElement;1862var computedStyle = isIE(10) && getComputedStyle(html);1863
1864return {1865height: getSize('Height', body, html, computedStyle),1866width: getSize('Width', body, html, computedStyle)1867};1868}1869
1870var classCallCheck = function (instance, Constructor) {1871if (!(instance instanceof Constructor)) {1872throw new TypeError("Cannot call a class as a function");1873}1874};1875
1876var createClass = function () {1877function defineProperties(target, props) {1878for (var i = 0; i < props.length; i++) {1879var descriptor = props[i];1880descriptor.enumerable = descriptor.enumerable || false;1881descriptor.configurable = true;1882if ("value" in descriptor) descriptor.writable = true;1883Object.defineProperty(target, descriptor.key, descriptor);1884}1885}1886
1887return function (Constructor, protoProps, staticProps) {1888if (protoProps) defineProperties(Constructor.prototype, protoProps);1889if (staticProps) defineProperties(Constructor, staticProps);1890return Constructor;1891};1892}();1893
1894
1895
1896
1897
1898var defineProperty = function (obj, key, value) {1899if (key in obj) {1900Object.defineProperty(obj, key, {1901value: value,1902enumerable: true,1903configurable: true,1904writable: true1905});1906} else {1907obj[key] = value;1908}1909
1910return obj;1911};1912
1913var _extends = Object.assign || function (target) {1914for (var i = 1; i < arguments.length; i++) {1915var source = arguments[i];1916
1917for (var key in source) {1918if (Object.prototype.hasOwnProperty.call(source, key)) {1919target[key] = source[key];1920}1921}1922}1923
1924return target;1925};1926
1927/**1928* Given element offsets, generate an output similar to getBoundingClientRect
1929* @method
1930* @memberof Popper.Utils
1931* @argument {Object} offsets
1932* @returns {Object} ClientRect like output
1933*/
1934function getClientRect(offsets) {1935return _extends({}, offsets, {1936right: offsets.left + offsets.width,1937bottom: offsets.top + offsets.height1938});1939}1940
1941/**1942* Get bounding client rect of given element
1943* @method
1944* @memberof Popper.Utils
1945* @param {HTMLElement} element
1946* @return {Object} client rect
1947*/
1948function getBoundingClientRect(element) {1949var rect = {};1950
1951// IE10 10 FIX: Please, don't ask, the element isn't1952// considered in DOM in some circumstances...1953// This isn't reproducible in IE10 compatibility mode of IE111954try {1955if (isIE(10)) {1956rect = element.getBoundingClientRect();1957var scrollTop = getScroll(element, 'top');1958var scrollLeft = getScroll(element, 'left');1959rect.top += scrollTop;1960rect.left += scrollLeft;1961rect.bottom += scrollTop;1962rect.right += scrollLeft;1963} else {1964rect = element.getBoundingClientRect();1965}1966} catch (e) {}1967
1968var result = {1969left: rect.left,1970top: rect.top,1971width: rect.right - rect.left,1972height: rect.bottom - rect.top1973};1974
1975// subtract scrollbar size from sizes1976var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};1977var width = sizes.width || element.clientWidth || result.width;1978var height = sizes.height || element.clientHeight || result.height;1979
1980var horizScrollbar = element.offsetWidth - width;1981var vertScrollbar = element.offsetHeight - height;1982
1983// if an hypothetical scrollbar is detected, we must be sure it's not a `border`1984// we make this check conditional for performance reasons1985if (horizScrollbar || vertScrollbar) {1986var styles = getStyleComputedProperty(element);1987horizScrollbar -= getBordersSize(styles, 'x');1988vertScrollbar -= getBordersSize(styles, 'y');1989
1990result.width -= horizScrollbar;1991result.height -= vertScrollbar;1992}1993
1994return getClientRect(result);1995}1996
1997function getOffsetRectRelativeToArbitraryNode(children, parent) {1998var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;1999
2000var isIE10 = isIE(10);2001var isHTML = parent.nodeName === 'HTML';2002var childrenRect = getBoundingClientRect(children);2003var parentRect = getBoundingClientRect(parent);2004var scrollParent = getScrollParent(children);2005
2006var styles = getStyleComputedProperty(parent);2007var borderTopWidth = parseFloat(styles.borderTopWidth);2008var borderLeftWidth = parseFloat(styles.borderLeftWidth);2009
2010// In cases where the parent is fixed, we must ignore negative scroll in offset calc2011if (fixedPosition && isHTML) {2012parentRect.top = Math.max(parentRect.top, 0);2013parentRect.left = Math.max(parentRect.left, 0);2014}2015var offsets = getClientRect({2016top: childrenRect.top - parentRect.top - borderTopWidth,2017left: childrenRect.left - parentRect.left - borderLeftWidth,2018width: childrenRect.width,2019height: childrenRect.height2020});2021offsets.marginTop = 0;2022offsets.marginLeft = 0;2023
2024// Subtract margins of documentElement in case it's being used as parent2025// we do this only on HTML because it's the only element that behaves2026// differently when margins are applied to it. The margins are included in2027// the box of the documentElement, in the other cases not.2028if (!isIE10 && isHTML) {2029var marginTop = parseFloat(styles.marginTop);2030var marginLeft = parseFloat(styles.marginLeft);2031
2032offsets.top -= borderTopWidth - marginTop;2033offsets.bottom -= borderTopWidth - marginTop;2034offsets.left -= borderLeftWidth - marginLeft;2035offsets.right -= borderLeftWidth - marginLeft;2036
2037// Attach marginTop and marginLeft because in some circumstances we may need them2038offsets.marginTop = marginTop;2039offsets.marginLeft = marginLeft;2040}2041
2042if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {2043offsets = includeScroll(offsets, parent);2044}2045
2046return offsets;2047}2048
2049function getViewportOffsetRectRelativeToArtbitraryNode(element) {2050var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;2051
2052var html = element.ownerDocument.documentElement;2053var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);2054var width = Math.max(html.clientWidth, window.innerWidth || 0);2055var height = Math.max(html.clientHeight, window.innerHeight || 0);2056
2057var scrollTop = !excludeScroll ? getScroll(html) : 0;2058var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;2059
2060var offset = {2061top: scrollTop - relativeOffset.top + relativeOffset.marginTop,2062left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,2063width: width,2064height: height2065};2066
2067return getClientRect(offset);2068}2069
2070/**2071* Check if the given element is fixed or is inside a fixed parent
2072* @method
2073* @memberof Popper.Utils
2074* @argument {Element} element
2075* @argument {Element} customContainer
2076* @returns {Boolean} answer to "isFixed?"
2077*/
2078function isFixed(element) {2079var nodeName = element.nodeName;2080if (nodeName === 'BODY' || nodeName === 'HTML') {2081return false;2082}2083if (getStyleComputedProperty(element, 'position') === 'fixed') {2084return true;2085}2086var parentNode = getParentNode(element);2087if (!parentNode) {2088return false;2089}2090return isFixed(parentNode);2091}2092
2093/**2094* Finds the first parent of an element that has a transformed property defined
2095* @method
2096* @memberof Popper.Utils
2097* @argument {Element} element
2098* @returns {Element} first transformed parent or documentElement
2099*/
2100
2101function getFixedPositionOffsetParent(element) {2102// This check is needed to avoid errors in case one of the elements isn't defined for any reason2103if (!element || !element.parentElement || isIE()) {2104return document.documentElement;2105}2106var el = element.parentElement;2107while (el && getStyleComputedProperty(el, 'transform') === 'none') {2108el = el.parentElement;2109}2110return el || document.documentElement;2111}2112
2113/**2114* Computed the boundaries limits and return them
2115* @method
2116* @memberof Popper.Utils
2117* @param {HTMLElement} popper
2118* @param {HTMLElement} reference
2119* @param {number} padding
2120* @param {HTMLElement} boundariesElement - Element used to define the boundaries
2121* @param {Boolean} fixedPosition - Is in fixed position mode
2122* @returns {Object} Coordinates of the boundaries
2123*/
2124function getBoundaries(popper, reference, padding, boundariesElement) {2125var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;2126
2127// NOTE: 1 DOM access here2128
2129var boundaries = { top: 0, left: 0 };2130var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));2131
2132// Handle viewport case2133if (boundariesElement === 'viewport') {2134boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);2135} else {2136// Handle other cases based on DOM element used as boundaries2137var boundariesNode = void 0;2138if (boundariesElement === 'scrollParent') {2139boundariesNode = getScrollParent(getParentNode(reference));2140if (boundariesNode.nodeName === 'BODY') {2141boundariesNode = popper.ownerDocument.documentElement;2142}2143} else if (boundariesElement === 'window') {2144boundariesNode = popper.ownerDocument.documentElement;2145} else {2146boundariesNode = boundariesElement;2147}2148
2149var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);2150
2151// In case of HTML, we need a different computation2152if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {2153var _getWindowSizes = getWindowSizes(popper.ownerDocument),2154height = _getWindowSizes.height,2155width = _getWindowSizes.width;2156
2157boundaries.top += offsets.top - offsets.marginTop;2158boundaries.bottom = height + offsets.top;2159boundaries.left += offsets.left - offsets.marginLeft;2160boundaries.right = width + offsets.left;2161} else {2162// for all the other DOM elements, this one is good2163boundaries = offsets;2164}2165}2166
2167// Add paddings2168padding = padding || 0;2169var isPaddingNumber = typeof padding === 'number';2170boundaries.left += isPaddingNumber ? padding : padding.left || 0;2171boundaries.top += isPaddingNumber ? padding : padding.top || 0;2172boundaries.right -= isPaddingNumber ? padding : padding.right || 0;2173boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;2174
2175return boundaries;2176}2177
2178function getArea(_ref) {2179var width = _ref.width,2180height = _ref.height;2181
2182return width * height;2183}2184
2185/**2186* Utility used to transform the `auto` placement to the placement with more
2187* available space.
2188* @method
2189* @memberof Popper.Utils
2190* @argument {Object} data - The data object generated by update method
2191* @argument {Object} options - Modifiers configuration and options
2192* @returns {Object} The data object, properly modified
2193*/
2194function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {2195var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;2196
2197if (placement.indexOf('auto') === -1) {2198return placement;2199}2200
2201var boundaries = getBoundaries(popper, reference, padding, boundariesElement);2202
2203var rects = {2204top: {2205width: boundaries.width,2206height: refRect.top - boundaries.top2207},2208right: {2209width: boundaries.right - refRect.right,2210height: boundaries.height2211},2212bottom: {2213width: boundaries.width,2214height: boundaries.bottom - refRect.bottom2215},2216left: {2217width: refRect.left - boundaries.left,2218height: boundaries.height2219}2220};2221
2222var sortedAreas = Object.keys(rects).map(function (key) {2223return _extends({2224key: key2225}, rects[key], {2226area: getArea(rects[key])2227});2228}).sort(function (a, b) {2229return b.area - a.area;2230});2231
2232var filteredAreas = sortedAreas.filter(function (_ref2) {2233var width = _ref2.width,2234height = _ref2.height;2235return width >= popper.clientWidth && height >= popper.clientHeight;2236});2237
2238var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;2239
2240var variation = placement.split('-')[1];2241
2242return computedPlacement + (variation ? '-' + variation : '');2243}2244
2245/**2246* Get offsets to the reference element
2247* @method
2248* @memberof Popper.Utils
2249* @param {Object} state
2250* @param {Element} popper - the popper element
2251* @param {Element} reference - the reference element (the popper will be relative to this)
2252* @param {Element} fixedPosition - is in fixed position mode
2253* @returns {Object} An object containing the offsets which will be applied to the popper
2254*/
2255function getReferenceOffsets(state, popper, reference) {2256var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;2257
2258var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));2259return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);2260}2261
2262/**2263* Get the outer sizes of the given element (offset size + margins)
2264* @method
2265* @memberof Popper.Utils
2266* @argument {Element} element
2267* @returns {Object} object containing width and height properties
2268*/
2269function getOuterSizes(element) {2270var window = element.ownerDocument.defaultView;2271var styles = window.getComputedStyle(element);2272var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);2273var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);2274var result = {2275width: element.offsetWidth + y,2276height: element.offsetHeight + x2277};2278return result;2279}2280
2281/**2282* Get the opposite placement of the given one
2283* @method
2284* @memberof Popper.Utils
2285* @argument {String} placement
2286* @returns {String} flipped placement
2287*/
2288function getOppositePlacement(placement) {2289var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };2290return placement.replace(/left|right|bottom|top/g, function (matched) {2291return hash[matched];2292});2293}2294
2295/**2296* Get offsets to the popper
2297* @method
2298* @memberof Popper.Utils
2299* @param {Object} position - CSS position the Popper will get applied
2300* @param {HTMLElement} popper - the popper element
2301* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
2302* @param {String} placement - one of the valid placement options
2303* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
2304*/
2305function getPopperOffsets(popper, referenceOffsets, placement) {2306placement = placement.split('-')[0];2307
2308// Get popper node sizes2309var popperRect = getOuterSizes(popper);2310
2311// Add position, width and height to our offsets object2312var popperOffsets = {2313width: popperRect.width,2314height: popperRect.height2315};2316
2317// depending by the popper placement we have to compute its offsets slightly differently2318var isHoriz = ['right', 'left'].indexOf(placement) !== -1;2319var mainSide = isHoriz ? 'top' : 'left';2320var secondarySide = isHoriz ? 'left' : 'top';2321var measurement = isHoriz ? 'height' : 'width';2322var secondaryMeasurement = !isHoriz ? 'height' : 'width';2323
2324popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;2325if (placement === secondarySide) {2326popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];2327} else {2328popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];2329}2330
2331return popperOffsets;2332}2333
2334/**2335* Mimics the `find` method of Array
2336* @method
2337* @memberof Popper.Utils
2338* @argument {Array} arr
2339* @argument prop
2340* @argument value
2341* @returns index or -1
2342*/
2343function find(arr, check) {2344// use native find if supported2345if (Array.prototype.find) {2346return arr.find(check);2347}2348
2349// use `filter` to obtain the same behavior of `find`2350return arr.filter(check)[0];2351}2352
2353/**2354* Return the index of the matching object
2355* @method
2356* @memberof Popper.Utils
2357* @argument {Array} arr
2358* @argument prop
2359* @argument value
2360* @returns index or -1
2361*/
2362function findIndex(arr, prop, value) {2363// use native findIndex if supported2364if (Array.prototype.findIndex) {2365return arr.findIndex(function (cur) {2366return cur[prop] === value;2367});2368}2369
2370// use `find` + `indexOf` if `findIndex` isn't supported2371var match = find(arr, function (obj) {2372return obj[prop] === value;2373});2374return arr.indexOf(match);2375}2376
2377/**2378* Loop trough the list of modifiers and run them in order,
2379* each of them will then edit the data object.
2380* @method
2381* @memberof Popper.Utils
2382* @param {dataObject} data
2383* @param {Array} modifiers
2384* @param {String} ends - Optional modifier name used as stopper
2385* @returns {dataObject}
2386*/
2387function runModifiers(modifiers, data, ends) {2388var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));2389
2390modifiersToRun.forEach(function (modifier) {2391if (modifier['function']) {2392// eslint-disable-line dot-notation2393console.warn('`modifier.function` is deprecated, use `modifier.fn`!');2394}2395var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation2396if (modifier.enabled && isFunction(fn)) {2397// Add properties to offsets to make them a complete clientRect object2398// we do this before each modifier to make sure the previous one doesn't2399// mess with these values2400data.offsets.popper = getClientRect(data.offsets.popper);2401data.offsets.reference = getClientRect(data.offsets.reference);2402
2403data = fn(data, modifier);2404}2405});2406
2407return data;2408}2409
2410/**2411* Updates the position of the popper, computing the new offsets and applying
2412* the new style.<br />
2413* Prefer `scheduleUpdate` over `update` because of performance reasons.
2414* @method
2415* @memberof Popper
2416*/
2417function update() {2418// if popper is destroyed, don't perform any further update2419if (this.state.isDestroyed) {2420return;2421}2422
2423var data = {2424instance: this,2425styles: {},2426arrowStyles: {},2427attributes: {},2428flipped: false,2429offsets: {}2430};2431
2432// compute reference element offsets2433data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);2434
2435// compute auto placement, store placement inside the data object,2436// modifiers will be able to edit `placement` if needed2437// and refer to originalPlacement to know the original value2438data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);2439
2440// store the computed placement inside `originalPlacement`2441data.originalPlacement = data.placement;2442
2443data.positionFixed = this.options.positionFixed;2444
2445// compute the popper offsets2446data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);2447
2448data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';2449
2450// run the modifiers2451data = runModifiers(this.modifiers, data);2452
2453// the first `update` will call `onCreate` callback2454// the other ones will call `onUpdate` callback2455if (!this.state.isCreated) {2456this.state.isCreated = true;2457this.options.onCreate(data);2458} else {2459this.options.onUpdate(data);2460}2461}2462
2463/**2464* Helper used to know if the given modifier is enabled.
2465* @method
2466* @memberof Popper.Utils
2467* @returns {Boolean}
2468*/
2469function isModifierEnabled(modifiers, modifierName) {2470return modifiers.some(function (_ref) {2471var name = _ref.name,2472enabled = _ref.enabled;2473return enabled && name === modifierName;2474});2475}2476
2477/**2478* Get the prefixed supported property name
2479* @method
2480* @memberof Popper.Utils
2481* @argument {String} property (camelCase)
2482* @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
2483*/
2484function getSupportedPropertyName(property) {2485var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];2486var upperProp = property.charAt(0).toUpperCase() + property.slice(1);2487
2488for (var i = 0; i < prefixes.length; i++) {2489var prefix = prefixes[i];2490var toCheck = prefix ? '' + prefix + upperProp : property;2491if (typeof document.body.style[toCheck] !== 'undefined') {2492return toCheck;2493}2494}2495return null;2496}2497
2498/**2499* Destroys the popper.
2500* @method
2501* @memberof Popper
2502*/
2503function destroy() {2504this.state.isDestroyed = true;2505
2506// touch DOM only if `applyStyle` modifier is enabled2507if (isModifierEnabled(this.modifiers, 'applyStyle')) {2508this.popper.removeAttribute('x-placement');2509this.popper.style.position = '';2510this.popper.style.top = '';2511this.popper.style.left = '';2512this.popper.style.right = '';2513this.popper.style.bottom = '';2514this.popper.style.willChange = '';2515this.popper.style[getSupportedPropertyName('transform')] = '';2516}2517
2518this.disableEventListeners();2519
2520// remove the popper if user explicitly asked for the deletion on destroy2521// do not use `remove` because IE11 doesn't support it2522if (this.options.removeOnDestroy) {2523this.popper.parentNode.removeChild(this.popper);2524}2525return this;2526}2527
2528/**2529* Get the window associated with the element
2530* @argument {Element} element
2531* @returns {Window}
2532*/
2533function getWindow(element) {2534var ownerDocument = element.ownerDocument;2535return ownerDocument ? ownerDocument.defaultView : window;2536}2537
2538function attachToScrollParents(scrollParent, event, callback, scrollParents) {2539var isBody = scrollParent.nodeName === 'BODY';2540var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;2541target.addEventListener(event, callback, { passive: true });2542
2543if (!isBody) {2544attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);2545}2546scrollParents.push(target);2547}2548
2549/**2550* Setup needed event listeners used to update the popper position
2551* @method
2552* @memberof Popper.Utils
2553* @private
2554*/
2555function setupEventListeners(reference, options, state, updateBound) {2556// Resize event listener on window2557state.updateBound = updateBound;2558getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });2559
2560// Scroll event listener on scroll parents2561var scrollElement = getScrollParent(reference);2562attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);2563state.scrollElement = scrollElement;2564state.eventsEnabled = true;2565
2566return state;2567}2568
2569/**2570* It will add resize/scroll events and start recalculating
2571* position of the popper element when they are triggered.
2572* @method
2573* @memberof Popper
2574*/
2575function enableEventListeners() {2576if (!this.state.eventsEnabled) {2577this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);2578}2579}2580
2581/**2582* Remove event listeners used to update the popper position
2583* @method
2584* @memberof Popper.Utils
2585* @private
2586*/
2587function removeEventListeners(reference, state) {2588// Remove resize event listener on window2589getWindow(reference).removeEventListener('resize', state.updateBound);2590
2591// Remove scroll event listener on scroll parents2592state.scrollParents.forEach(function (target) {2593target.removeEventListener('scroll', state.updateBound);2594});2595
2596// Reset state2597state.updateBound = null;2598state.scrollParents = [];2599state.scrollElement = null;2600state.eventsEnabled = false;2601return state;2602}2603
2604/**2605* It will remove resize/scroll events and won't recalculate popper position
2606* when they are triggered. It also won't trigger `onUpdate` callback anymore,
2607* unless you call `update` method manually.
2608* @method
2609* @memberof Popper
2610*/
2611function disableEventListeners() {2612if (this.state.eventsEnabled) {2613cancelAnimationFrame(this.scheduleUpdate);2614this.state = removeEventListeners(this.reference, this.state);2615}2616}2617
2618/**2619* Tells if a given input is a number
2620* @method
2621* @memberof Popper.Utils
2622* @param {*} input to check
2623* @return {Boolean}
2624*/
2625function isNumeric(n) {2626return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);2627}2628
2629/**2630* Set the style to the given popper
2631* @method
2632* @memberof Popper.Utils
2633* @argument {Element} element - Element to apply the style to
2634* @argument {Object} styles
2635* Object with a list of properties and values which will be applied to the element
2636*/
2637function setStyles(element, styles) {2638Object.keys(styles).forEach(function (prop) {2639var unit = '';2640// add unit if the value is numeric and is one of the following2641if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {2642unit = 'px';2643}2644element.style[prop] = styles[prop] + unit;2645});2646}2647
2648/**2649* Set the attributes to the given popper
2650* @method
2651* @memberof Popper.Utils
2652* @argument {Element} element - Element to apply the attributes to
2653* @argument {Object} styles
2654* Object with a list of properties and values which will be applied to the element
2655*/
2656function setAttributes(element, attributes) {2657Object.keys(attributes).forEach(function (prop) {2658var value = attributes[prop];2659if (value !== false) {2660element.setAttribute(prop, attributes[prop]);2661} else {2662element.removeAttribute(prop);2663}2664});2665}2666
2667/**2668* @function
2669* @memberof Modifiers
2670* @argument {Object} data - The data object generated by `update` method
2671* @argument {Object} data.styles - List of style properties - values to apply to popper element
2672* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
2673* @argument {Object} options - Modifiers configuration and options
2674* @returns {Object} The same data object
2675*/
2676function applyStyle(data) {2677// any property present in `data.styles` will be applied to the popper,2678// in this way we can make the 3rd party modifiers add custom styles to it2679// Be aware, modifiers could override the properties defined in the previous2680// lines of this modifier!2681setStyles(data.instance.popper, data.styles);2682
2683// any property present in `data.attributes` will be applied to the popper,2684// they will be set as HTML attributes of the element2685setAttributes(data.instance.popper, data.attributes);2686
2687// if arrowElement is defined and arrowStyles has some properties2688if (data.arrowElement && Object.keys(data.arrowStyles).length) {2689setStyles(data.arrowElement, data.arrowStyles);2690}2691
2692return data;2693}2694
2695/**2696* Set the x-placement attribute before everything else because it could be used
2697* to add margins to the popper margins needs to be calculated to get the
2698* correct popper offsets.
2699* @method
2700* @memberof Popper.modifiers
2701* @param {HTMLElement} reference - The reference element used to position the popper
2702* @param {HTMLElement} popper - The HTML element used as popper
2703* @param {Object} options - Popper.js options
2704*/
2705function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {2706// compute reference element offsets2707var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);2708
2709// compute auto placement, store placement inside the data object,2710// modifiers will be able to edit `placement` if needed2711// and refer to originalPlacement to know the original value2712var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);2713
2714popper.setAttribute('x-placement', placement);2715
2716// Apply `position` to popper before anything else because2717// without the position applied we can't guarantee correct computations2718setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });2719
2720return options;2721}2722
2723/**2724* @function
2725* @memberof Popper.Utils
2726* @argument {Object} data - The data object generated by `update` method
2727* @argument {Boolean} shouldRound - If the offsets should be rounded at all
2728* @returns {Object} The popper's position offsets rounded
2729*
2730* The tale of pixel-perfect positioning. It's still not 100% perfect, but as
2731* good as it can be within reason.
2732* Discussion here: https://github.com/FezVrasta/popper.js/pull/715
2733*
2734* Low DPI screens cause a popper to be blurry if not using full pixels (Safari
2735* as well on High DPI screens).
2736*
2737* Firefox prefers no rounding for positioning and does not have blurriness on
2738* high DPI screens.
2739*
2740* Only horizontal placement and left/right values need to be considered.
2741*/
2742function getRoundedOffsets(data, shouldRound) {2743var _data$offsets = data.offsets,2744popper = _data$offsets.popper,2745reference = _data$offsets.reference;2746var round = Math.round,2747floor = Math.floor;2748
2749var noRound = function noRound(v) {2750return v;2751};2752
2753var referenceWidth = round(reference.width);2754var popperWidth = round(popper.width);2755
2756var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;2757var isVariation = data.placement.indexOf('-') !== -1;2758var sameWidthParity = referenceWidth % 2 === popperWidth % 2;2759var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;2760
2761var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;2762var verticalToInteger = !shouldRound ? noRound : round;2763
2764return {2765left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),2766top: verticalToInteger(popper.top),2767bottom: verticalToInteger(popper.bottom),2768right: horizontalToInteger(popper.right)2769};2770}2771
2772var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);2773
2774/**2775* @function
2776* @memberof Modifiers
2777* @argument {Object} data - The data object generated by `update` method
2778* @argument {Object} options - Modifiers configuration and options
2779* @returns {Object} The data object, properly modified
2780*/
2781function computeStyle(data, options) {2782var x = options.x,2783y = options.y;2784var popper = data.offsets.popper;2785
2786// Remove this legacy support in Popper.js v22787
2788var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {2789return modifier.name === 'applyStyle';2790}).gpuAcceleration;2791if (legacyGpuAccelerationOption !== undefined) {2792console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');2793}2794var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;2795
2796var offsetParent = getOffsetParent(data.instance.popper);2797var offsetParentRect = getBoundingClientRect(offsetParent);2798
2799// Styles2800var styles = {2801position: popper.position2802};2803
2804var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);2805
2806var sideA = x === 'bottom' ? 'top' : 'bottom';2807var sideB = y === 'right' ? 'left' : 'right';2808
2809// if gpuAcceleration is set to `true` and transform is supported,2810// we use `translate3d` to apply the position to the popper we2811// automatically use the supported prefixed version if needed2812var prefixedProperty = getSupportedPropertyName('transform');2813
2814// now, let's make a step back and look at this code closely (wtf?)2815// If the content of the popper grows once it's been positioned, it2816// may happen that the popper gets misplaced because of the new content2817// overflowing its reference element2818// To avoid this problem, we provide two options (x and y), which allow2819// the consumer to define the offset origin.2820// If we position a popper on top of a reference element, we can set2821// `x` to `top` to make the popper grow towards its top instead of2822// its bottom.2823var left = void 0,2824top = void 0;2825if (sideA === 'bottom') {2826// when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)2827// and not the bottom of the html element2828if (offsetParent.nodeName === 'HTML') {2829top = -offsetParent.clientHeight + offsets.bottom;2830} else {2831top = -offsetParentRect.height + offsets.bottom;2832}2833} else {2834top = offsets.top;2835}2836if (sideB === 'right') {2837if (offsetParent.nodeName === 'HTML') {2838left = -offsetParent.clientWidth + offsets.right;2839} else {2840left = -offsetParentRect.width + offsets.right;2841}2842} else {2843left = offsets.left;2844}2845if (gpuAcceleration && prefixedProperty) {2846styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';2847styles[sideA] = 0;2848styles[sideB] = 0;2849styles.willChange = 'transform';2850} else {2851// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties2852var invertTop = sideA === 'bottom' ? -1 : 1;2853var invertLeft = sideB === 'right' ? -1 : 1;2854styles[sideA] = top * invertTop;2855styles[sideB] = left * invertLeft;2856styles.willChange = sideA + ', ' + sideB;2857}2858
2859// Attributes2860var attributes = {2861'x-placement': data.placement2862};2863
2864// Update `data` attributes, styles and arrowStyles2865data.attributes = _extends({}, attributes, data.attributes);2866data.styles = _extends({}, styles, data.styles);2867data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);2868
2869return data;2870}2871
2872/**2873* Helper used to know if the given modifier depends from another one.<br />
2874* It checks if the needed modifier is listed and enabled.
2875* @method
2876* @memberof Popper.Utils
2877* @param {Array} modifiers - list of modifiers
2878* @param {String} requestingName - name of requesting modifier
2879* @param {String} requestedName - name of requested modifier
2880* @returns {Boolean}
2881*/
2882function isModifierRequired(modifiers, requestingName, requestedName) {2883var requesting = find(modifiers, function (_ref) {2884var name = _ref.name;2885return name === requestingName;2886});2887
2888var isRequired = !!requesting && modifiers.some(function (modifier) {2889return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;2890});2891
2892if (!isRequired) {2893var _requesting = '`' + requestingName + '`';2894var requested = '`' + requestedName + '`';2895console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');2896}2897return isRequired;2898}2899
2900/**2901* @function
2902* @memberof Modifiers
2903* @argument {Object} data - The data object generated by update method
2904* @argument {Object} options - Modifiers configuration and options
2905* @returns {Object} The data object, properly modified
2906*/
2907function arrow(data, options) {2908var _data$offsets$arrow;2909
2910// arrow depends on keepTogether in order to work2911if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {2912return data;2913}2914
2915var arrowElement = options.element;2916
2917// if arrowElement is a string, suppose it's a CSS selector2918if (typeof arrowElement === 'string') {2919arrowElement = data.instance.popper.querySelector(arrowElement);2920
2921// if arrowElement is not found, don't run the modifier2922if (!arrowElement) {2923return data;2924}2925} else {2926// if the arrowElement isn't a query selector we must check that the2927// provided DOM node is child of its popper node2928if (!data.instance.popper.contains(arrowElement)) {2929console.warn('WARNING: `arrow.element` must be child of its popper element!');2930return data;2931}2932}2933
2934var placement = data.placement.split('-')[0];2935var _data$offsets = data.offsets,2936popper = _data$offsets.popper,2937reference = _data$offsets.reference;2938
2939var isVertical = ['left', 'right'].indexOf(placement) !== -1;2940
2941var len = isVertical ? 'height' : 'width';2942var sideCapitalized = isVertical ? 'Top' : 'Left';2943var side = sideCapitalized.toLowerCase();2944var altSide = isVertical ? 'left' : 'top';2945var opSide = isVertical ? 'bottom' : 'right';2946var arrowElementSize = getOuterSizes(arrowElement)[len];2947
2948//2949// extends keepTogether behavior making sure the popper and its2950// reference have enough pixels in conjunction2951//2952
2953// top/left side2954if (reference[opSide] - arrowElementSize < popper[side]) {2955data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);2956}2957// bottom/right side2958if (reference[side] + arrowElementSize > popper[opSide]) {2959data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];2960}2961data.offsets.popper = getClientRect(data.offsets.popper);2962
2963// compute center of the popper2964var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;2965
2966// Compute the sideValue using the updated popper offsets2967// take popper margin in account because we don't have this info available2968var css = getStyleComputedProperty(data.instance.popper);2969var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);2970var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);2971var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;2972
2973// prevent arrowElement from being placed not contiguously to its popper2974sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);2975
2976data.arrowElement = arrowElement;2977data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);2978
2979return data;2980}2981
2982/**2983* Get the opposite placement variation of the given one
2984* @method
2985* @memberof Popper.Utils
2986* @argument {String} placement variation
2987* @returns {String} flipped placement variation
2988*/
2989function getOppositeVariation(variation) {2990if (variation === 'end') {2991return 'start';2992} else if (variation === 'start') {2993return 'end';2994}2995return variation;2996}2997
2998/**2999* List of accepted placements to use as values of the `placement` option.<br />
3000* Valid placements are:
3001* - `auto`
3002* - `top`
3003* - `right`
3004* - `bottom`
3005* - `left`
3006*
3007* Each placement can have a variation from this list:
3008* - `-start`
3009* - `-end`
3010*
3011* Variations are interpreted easily if you think of them as the left to right
3012* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
3013* is right.<br />
3014* Vertically (`left` and `right`), `start` is top and `end` is bottom.
3015*
3016* Some valid examples are:
3017* - `top-end` (on top of reference, right aligned)
3018* - `right-start` (on right of reference, top aligned)
3019* - `bottom` (on bottom, centered)
3020* - `auto-end` (on the side with more space available, alignment depends by placement)
3021*
3022* @static
3023* @type {Array}
3024* @enum {String}
3025* @readonly
3026* @method placements
3027* @memberof Popper
3028*/
3029var 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'];3030
3031// Get rid of `auto` `auto-start` and `auto-end`3032var validPlacements = placements.slice(3);3033
3034/**3035* Given an initial placement, returns all the subsequent placements
3036* clockwise (or counter-clockwise).
3037*
3038* @method
3039* @memberof Popper.Utils
3040* @argument {String} placement - A valid placement (it accepts variations)
3041* @argument {Boolean} counter - Set to true to walk the placements counterclockwise
3042* @returns {Array} placements including their variations
3043*/
3044function clockwise(placement) {3045var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;3046
3047var index = validPlacements.indexOf(placement);3048var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));3049return counter ? arr.reverse() : arr;3050}3051
3052var BEHAVIORS = {3053FLIP: 'flip',3054CLOCKWISE: 'clockwise',3055COUNTERCLOCKWISE: 'counterclockwise'3056};3057
3058/**3059* @function
3060* @memberof Modifiers
3061* @argument {Object} data - The data object generated by update method
3062* @argument {Object} options - Modifiers configuration and options
3063* @returns {Object} The data object, properly modified
3064*/
3065function flip(data, options) {3066// if `inner` modifier is enabled, we can't use the `flip` modifier3067if (isModifierEnabled(data.instance.modifiers, 'inner')) {3068return data;3069}3070
3071if (data.flipped && data.placement === data.originalPlacement) {3072// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides3073return data;3074}3075
3076var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);3077
3078var placement = data.placement.split('-')[0];3079var placementOpposite = getOppositePlacement(placement);3080var variation = data.placement.split('-')[1] || '';3081
3082var flipOrder = [];3083
3084switch (options.behavior) {3085case BEHAVIORS.FLIP:3086flipOrder = [placement, placementOpposite];3087break;3088case BEHAVIORS.CLOCKWISE:3089flipOrder = clockwise(placement);3090break;3091case BEHAVIORS.COUNTERCLOCKWISE:3092flipOrder = clockwise(placement, true);3093break;3094default:3095flipOrder = options.behavior;3096}3097
3098flipOrder.forEach(function (step, index) {3099if (placement !== step || flipOrder.length === index + 1) {3100return data;3101}3102
3103placement = data.placement.split('-')[0];3104placementOpposite = getOppositePlacement(placement);3105
3106var popperOffsets = data.offsets.popper;3107var refOffsets = data.offsets.reference;3108
3109// using floor because the reference offsets may contain decimals we are not going to consider here3110var floor = Math.floor;3111var 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);3112
3113var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);3114var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);3115var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);3116var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);3117
3118var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;3119
3120// flip the variation if required3121var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;3122
3123// flips variation if reference element overflows boundaries3124var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);3125
3126// flips variation if popper content overflows boundaries3127var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);3128
3129var flippedVariation = flippedVariationByRef || flippedVariationByContent;3130
3131if (overlapsRef || overflowsBoundaries || flippedVariation) {3132// this boolean to detect any flip loop3133data.flipped = true;3134
3135if (overlapsRef || overflowsBoundaries) {3136placement = flipOrder[index + 1];3137}3138
3139if (flippedVariation) {3140variation = getOppositeVariation(variation);3141}3142
3143data.placement = placement + (variation ? '-' + variation : '');3144
3145// this object contains `position`, we want to preserve it along with3146// any additional property we may add in the future3147data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));3148
3149data = runModifiers(data.instance.modifiers, data, 'flip');3150}3151});3152return data;3153}3154
3155/**3156* @function
3157* @memberof Modifiers
3158* @argument {Object} data - The data object generated by update method
3159* @argument {Object} options - Modifiers configuration and options
3160* @returns {Object} The data object, properly modified
3161*/
3162function keepTogether(data) {3163var _data$offsets = data.offsets,3164popper = _data$offsets.popper,3165reference = _data$offsets.reference;3166
3167var placement = data.placement.split('-')[0];3168var floor = Math.floor;3169var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;3170var side = isVertical ? 'right' : 'bottom';3171var opSide = isVertical ? 'left' : 'top';3172var measurement = isVertical ? 'width' : 'height';3173
3174if (popper[side] < floor(reference[opSide])) {3175data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];3176}3177if (popper[opSide] > floor(reference[side])) {3178data.offsets.popper[opSide] = floor(reference[side]);3179}3180
3181return data;3182}3183
3184/**3185* Converts a string containing value + unit into a px value number
3186* @function
3187* @memberof {modifiers~offset}
3188* @private
3189* @argument {String} str - Value + unit string
3190* @argument {String} measurement - `height` or `width`
3191* @argument {Object} popperOffsets
3192* @argument {Object} referenceOffsets
3193* @returns {Number|String}
3194* Value in pixels, or original string if no values were extracted
3195*/
3196function toValue(str, measurement, popperOffsets, referenceOffsets) {3197// separate value from unit3198var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);3199var value = +split[1];3200var unit = split[2];3201
3202// If it's not a number it's an operator, I guess3203if (!value) {3204return str;3205}3206
3207if (unit.indexOf('%') === 0) {3208var element = void 0;3209switch (unit) {3210case '%p':3211element = popperOffsets;3212break;3213case '%':3214case '%r':3215default:3216element = referenceOffsets;3217}3218
3219var rect = getClientRect(element);3220return rect[measurement] / 100 * value;3221} else if (unit === 'vh' || unit === 'vw') {3222// if is a vh or vw, we calculate the size based on the viewport3223var size = void 0;3224if (unit === 'vh') {3225size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);3226} else {3227size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);3228}3229return size / 100 * value;3230} else {3231// if is an explicit pixel unit, we get rid of the unit and keep the value3232// if is an implicit unit, it's px, and we return just the value3233return value;3234}3235}3236
3237/**3238* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
3239* @function
3240* @memberof {modifiers~offset}
3241* @private
3242* @argument {String} offset
3243* @argument {Object} popperOffsets
3244* @argument {Object} referenceOffsets
3245* @argument {String} basePlacement
3246* @returns {Array} a two cells array with x and y offsets in numbers
3247*/
3248function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {3249var offsets = [0, 0];3250
3251// Use height if placement is left or right and index is 0 otherwise use width3252// in this way the first offset will use an axis and the second one3253// will use the other one3254var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;3255
3256// Split the offset string to obtain a list of values and operands3257// The regex addresses values with the plus or minus sign in front (+10, -20, etc)3258var fragments = offset.split(/(\+|\-)/).map(function (frag) {3259return frag.trim();3260});3261
3262// Detect if the offset string contains a pair of values or a single one3263// they could be separated by comma or space3264var divider = fragments.indexOf(find(fragments, function (frag) {3265return frag.search(/,|\s/) !== -1;3266}));3267
3268if (fragments[divider] && fragments[divider].indexOf(',') === -1) {3269console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');3270}3271
3272// If divider is found, we divide the list of values and operands to divide3273// them by ofset X and Y.3274var splitRegex = /\s*,\s*|\s+/;3275var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];3276
3277// Convert the values with units to absolute pixels to allow our computations3278ops = ops.map(function (op, index) {3279// Most of the units rely on the orientation of the popper3280var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';3281var mergeWithPrevious = false;3282return op3283// This aggregates any `+` or `-` sign that aren't considered operators3284// e.g.: 10 + +5 => [10, +, +5]3285.reduce(function (a, b) {3286if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {3287a[a.length - 1] = b;3288mergeWithPrevious = true;3289return a;3290} else if (mergeWithPrevious) {3291a[a.length - 1] += b;3292mergeWithPrevious = false;3293return a;3294} else {3295return a.concat(b);3296}3297}, [])3298// Here we convert the string values into number values (in px)3299.map(function (str) {3300return toValue(str, measurement, popperOffsets, referenceOffsets);3301});3302});3303
3304// Loop trough the offsets arrays and execute the operations3305ops.forEach(function (op, index) {3306op.forEach(function (frag, index2) {3307if (isNumeric(frag)) {3308offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);3309}3310});3311});3312return offsets;3313}3314
3315/**3316* @function
3317* @memberof Modifiers
3318* @argument {Object} data - The data object generated by update method
3319* @argument {Object} options - Modifiers configuration and options
3320* @argument {Number|String} options.offset=0
3321* The offset value as described in the modifier description
3322* @returns {Object} The data object, properly modified
3323*/
3324function offset(data, _ref) {3325var offset = _ref.offset;3326var placement = data.placement,3327_data$offsets = data.offsets,3328popper = _data$offsets.popper,3329reference = _data$offsets.reference;3330
3331var basePlacement = placement.split('-')[0];3332
3333var offsets = void 0;3334if (isNumeric(+offset)) {3335offsets = [+offset, 0];3336} else {3337offsets = parseOffset(offset, popper, reference, basePlacement);3338}3339
3340if (basePlacement === 'left') {3341popper.top += offsets[0];3342popper.left -= offsets[1];3343} else if (basePlacement === 'right') {3344popper.top += offsets[0];3345popper.left += offsets[1];3346} else if (basePlacement === 'top') {3347popper.left += offsets[0];3348popper.top -= offsets[1];3349} else if (basePlacement === 'bottom') {3350popper.left += offsets[0];3351popper.top += offsets[1];3352}3353
3354data.popper = popper;3355return data;3356}3357
3358/**3359* @function
3360* @memberof Modifiers
3361* @argument {Object} data - The data object generated by `update` method
3362* @argument {Object} options - Modifiers configuration and options
3363* @returns {Object} The data object, properly modified
3364*/
3365function preventOverflow(data, options) {3366var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);3367
3368// If offsetParent is the reference element, we really want to3369// go one step up and use the next offsetParent as reference to3370// avoid to make this modifier completely useless and look like broken3371if (data.instance.reference === boundariesElement) {3372boundariesElement = getOffsetParent(boundariesElement);3373}3374
3375// NOTE: DOM access here3376// resets the popper's position so that the document size can be calculated excluding3377// the size of the popper element itself3378var transformProp = getSupportedPropertyName('transform');3379var popperStyles = data.instance.popper.style; // assignment to help minification3380var top = popperStyles.top,3381left = popperStyles.left,3382transform = popperStyles[transformProp];3383
3384popperStyles.top = '';3385popperStyles.left = '';3386popperStyles[transformProp] = '';3387
3388var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);3389
3390// NOTE: DOM access here3391// restores the original style properties after the offsets have been computed3392popperStyles.top = top;3393popperStyles.left = left;3394popperStyles[transformProp] = transform;3395
3396options.boundaries = boundaries;3397
3398var order = options.priority;3399var popper = data.offsets.popper;3400
3401var check = {3402primary: function primary(placement) {3403var value = popper[placement];3404if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {3405value = Math.max(popper[placement], boundaries[placement]);3406}3407return defineProperty({}, placement, value);3408},3409secondary: function secondary(placement) {3410var mainSide = placement === 'right' ? 'left' : 'top';3411var value = popper[mainSide];3412if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {3413value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));3414}3415return defineProperty({}, mainSide, value);3416}3417};3418
3419order.forEach(function (placement) {3420var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';3421popper = _extends({}, popper, check[side](placement));3422});3423
3424data.offsets.popper = popper;3425
3426return data;3427}3428
3429/**3430* @function
3431* @memberof Modifiers
3432* @argument {Object} data - The data object generated by `update` method
3433* @argument {Object} options - Modifiers configuration and options
3434* @returns {Object} The data object, properly modified
3435*/
3436function shift(data) {3437var placement = data.placement;3438var basePlacement = placement.split('-')[0];3439var shiftvariation = placement.split('-')[1];3440
3441// if shift shiftvariation is specified, run the modifier3442if (shiftvariation) {3443var _data$offsets = data.offsets,3444reference = _data$offsets.reference,3445popper = _data$offsets.popper;3446
3447var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;3448var side = isVertical ? 'left' : 'top';3449var measurement = isVertical ? 'width' : 'height';3450
3451var shiftOffsets = {3452start: defineProperty({}, side, reference[side]),3453end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])3454};3455
3456data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);3457}3458
3459return data;3460}3461
3462/**3463* @function
3464* @memberof Modifiers
3465* @argument {Object} data - The data object generated by update method
3466* @argument {Object} options - Modifiers configuration and options
3467* @returns {Object} The data object, properly modified
3468*/
3469function hide(data) {3470if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {3471return data;3472}3473
3474var refRect = data.offsets.reference;3475var bound = find(data.instance.modifiers, function (modifier) {3476return modifier.name === 'preventOverflow';3477}).boundaries;3478
3479if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {3480// Avoid unnecessary DOM access if visibility hasn't changed3481if (data.hide === true) {3482return data;3483}3484
3485data.hide = true;3486data.attributes['x-out-of-boundaries'] = '';3487} else {3488// Avoid unnecessary DOM access if visibility hasn't changed3489if (data.hide === false) {3490return data;3491}3492
3493data.hide = false;3494data.attributes['x-out-of-boundaries'] = false;3495}3496
3497return data;3498}3499
3500/**3501* @function
3502* @memberof Modifiers
3503* @argument {Object} data - The data object generated by `update` method
3504* @argument {Object} options - Modifiers configuration and options
3505* @returns {Object} The data object, properly modified
3506*/
3507function inner(data) {3508var placement = data.placement;3509var basePlacement = placement.split('-')[0];3510var _data$offsets = data.offsets,3511popper = _data$offsets.popper,3512reference = _data$offsets.reference;3513
3514var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;3515
3516var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;3517
3518popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);3519
3520data.placement = getOppositePlacement(placement);3521data.offsets.popper = getClientRect(popper);3522
3523return data;3524}3525
3526/**3527* Modifier function, each modifier can have a function of this type assigned
3528* to its `fn` property.<br />
3529* These functions will be called on each update, this means that you must
3530* make sure they are performant enough to avoid performance bottlenecks.
3531*
3532* @function ModifierFn
3533* @argument {dataObject} data - The data object generated by `update` method
3534* @argument {Object} options - Modifiers configuration and options
3535* @returns {dataObject} The data object, properly modified
3536*/
3537
3538/**3539* Modifiers are plugins used to alter the behavior of your poppers.<br />
3540* Popper.js uses a set of 9 modifiers to provide all the basic functionalities
3541* needed by the library.
3542*
3543* Usually you don't want to override the `order`, `fn` and `onLoad` props.
3544* All the other properties are configurations that could be tweaked.
3545* @namespace modifiers
3546*/
3547var modifiers = {3548/**3549* Modifier used to shift the popper on the start or end of its reference
3550* element.<br />
3551* It will read the variation of the `placement` property.<br />
3552* It can be one either `-end` or `-start`.
3553* @memberof modifiers
3554* @inner
3555*/
3556shift: {3557/** @prop {number} order=100 - Index used to define the order of execution */3558order: 100,3559/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3560enabled: true,3561/** @prop {ModifierFn} */3562fn: shift3563},3564
3565/**3566* The `offset` modifier can shift your popper on both its axis.
3567*
3568* It accepts the following units:
3569* - `px` or unit-less, interpreted as pixels
3570* - `%` or `%r`, percentage relative to the length of the reference element
3571* - `%p`, percentage relative to the length of the popper element
3572* - `vw`, CSS viewport width unit
3573* - `vh`, CSS viewport height unit
3574*
3575* For length is intended the main axis relative to the placement of the popper.<br />
3576* This means that if the placement is `top` or `bottom`, the length will be the
3577* `width`. In case of `left` or `right`, it will be the `height`.
3578*
3579* You can provide a single value (as `Number` or `String`), or a pair of values
3580* as `String` divided by a comma or one (or more) white spaces.<br />
3581* The latter is a deprecated method because it leads to confusion and will be
3582* removed in v2.<br />
3583* Additionally, it accepts additions and subtractions between different units.
3584* Note that multiplications and divisions aren't supported.
3585*
3586* Valid examples are:
3587* ```
3588* 10
3589* '10%'
3590* '10, 10'
3591* '10%, 10'
3592* '10 + 10%'
3593* '10 - 5vh + 3%'
3594* '-10px + 5vh, 5px - 6%'
3595* ```
3596* > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
3597* > with their reference element, unfortunately, you will have to disable the `flip` modifier.
3598* > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
3599*
3600* @memberof modifiers
3601* @inner
3602*/
3603offset: {3604/** @prop {number} order=200 - Index used to define the order of execution */3605order: 200,3606/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3607enabled: true,3608/** @prop {ModifierFn} */3609fn: offset,3610/** @prop {Number|String} offset=03611* The offset value as described in the modifier description
3612*/
3613offset: 03614},3615
3616/**3617* Modifier used to prevent the popper from being positioned outside the boundary.
3618*
3619* A scenario exists where the reference itself is not within the boundaries.<br />
3620* We can say it has "escaped the boundaries" — or just "escaped".<br />
3621* In this case we need to decide whether the popper should either:
3622*
3623* - detach from the reference and remain "trapped" in the boundaries, or
3624* - if it should ignore the boundary and "escape with its reference"
3625*
3626* When `escapeWithReference` is set to`true` and reference is completely
3627* outside its boundaries, the popper will overflow (or completely leave)
3628* the boundaries in order to remain attached to the edge of the reference.
3629*
3630* @memberof modifiers
3631* @inner
3632*/
3633preventOverflow: {3634/** @prop {number} order=300 - Index used to define the order of execution */3635order: 300,3636/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3637enabled: true,3638/** @prop {ModifierFn} */3639fn: preventOverflow,3640/**3641* @prop {Array} [priority=['left','right','top','bottom']]
3642* Popper will try to prevent overflow following these priorities by default,
3643* then, it could overflow on the left and on top of the `boundariesElement`
3644*/
3645priority: ['left', 'right', 'top', 'bottom'],3646/**3647* @prop {number} padding=5
3648* Amount of pixel used to define a minimum distance between the boundaries
3649* and the popper. This makes sure the popper always has a little padding
3650* between the edges of its container
3651*/
3652padding: 5,3653/**3654* @prop {String|HTMLElement} boundariesElement='scrollParent'
3655* Boundaries used by the modifier. Can be `scrollParent`, `window`,
3656* `viewport` or any DOM element.
3657*/
3658boundariesElement: 'scrollParent'3659},3660
3661/**3662* Modifier used to make sure the reference and its popper stay near each other
3663* without leaving any gap between the two. Especially useful when the arrow is
3664* enabled and you want to ensure that it points to its reference element.
3665* It cares only about the first axis. You can still have poppers with margin
3666* between the popper and its reference element.
3667* @memberof modifiers
3668* @inner
3669*/
3670keepTogether: {3671/** @prop {number} order=400 - Index used to define the order of execution */3672order: 400,3673/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3674enabled: true,3675/** @prop {ModifierFn} */3676fn: keepTogether3677},3678
3679/**3680* This modifier is used to move the `arrowElement` of the popper to make
3681* sure it is positioned between the reference element and its popper element.
3682* It will read the outer size of the `arrowElement` node to detect how many
3683* pixels of conjunction are needed.
3684*
3685* It has no effect if no `arrowElement` is provided.
3686* @memberof modifiers
3687* @inner
3688*/
3689arrow: {3690/** @prop {number} order=500 - Index used to define the order of execution */3691order: 500,3692/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3693enabled: true,3694/** @prop {ModifierFn} */3695fn: arrow,3696/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */3697element: '[x-arrow]'3698},3699
3700/**3701* Modifier used to flip the popper's placement when it starts to overlap its
3702* reference element.
3703*
3704* Requires the `preventOverflow` modifier before it in order to work.
3705*
3706* **NOTE:** this modifier will interrupt the current update cycle and will
3707* restart it if it detects the need to flip the placement.
3708* @memberof modifiers
3709* @inner
3710*/
3711flip: {3712/** @prop {number} order=600 - Index used to define the order of execution */3713order: 600,3714/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3715enabled: true,3716/** @prop {ModifierFn} */3717fn: flip,3718/**3719* @prop {String|Array} behavior='flip'
3720* The behavior used to change the popper's placement. It can be one of
3721* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
3722* placements (with optional variations)
3723*/
3724behavior: 'flip',3725/**3726* @prop {number} padding=5
3727* The popper will flip if it hits the edges of the `boundariesElement`
3728*/
3729padding: 5,3730/**3731* @prop {String|HTMLElement} boundariesElement='viewport'
3732* The element which will define the boundaries of the popper position.
3733* The popper will never be placed outside of the defined boundaries
3734* (except if `keepTogether` is enabled)
3735*/
3736boundariesElement: 'viewport',3737/**3738* @prop {Boolean} flipVariations=false
3739* The popper will switch placement variation between `-start` and `-end` when
3740* the reference element overlaps its boundaries.
3741*
3742* The original placement should have a set variation.
3743*/
3744flipVariations: false,3745/**3746* @prop {Boolean} flipVariationsByContent=false
3747* The popper will switch placement variation between `-start` and `-end` when
3748* the popper element overlaps its reference boundaries.
3749*
3750* The original placement should have a set variation.
3751*/
3752flipVariationsByContent: false3753},3754
3755/**3756* Modifier used to make the popper flow toward the inner of the reference element.
3757* By default, when this modifier is disabled, the popper will be placed outside
3758* the reference element.
3759* @memberof modifiers
3760* @inner
3761*/
3762inner: {3763/** @prop {number} order=700 - Index used to define the order of execution */3764order: 700,3765/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */3766enabled: false,3767/** @prop {ModifierFn} */3768fn: inner3769},3770
3771/**3772* Modifier used to hide the popper when its reference element is outside of the
3773* popper boundaries. It will set a `x-out-of-boundaries` attribute which can
3774* be used to hide with a CSS selector the popper when its reference is
3775* out of boundaries.
3776*
3777* Requires the `preventOverflow` modifier before it in order to work.
3778* @memberof modifiers
3779* @inner
3780*/
3781hide: {3782/** @prop {number} order=800 - Index used to define the order of execution */3783order: 800,3784/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3785enabled: true,3786/** @prop {ModifierFn} */3787fn: hide3788},3789
3790/**3791* Computes the style that will be applied to the popper element to gets
3792* properly positioned.
3793*
3794* Note that this modifier will not touch the DOM, it just prepares the styles
3795* so that `applyStyle` modifier can apply it. This separation is useful
3796* in case you need to replace `applyStyle` with a custom implementation.
3797*
3798* This modifier has `850` as `order` value to maintain backward compatibility
3799* with previous versions of Popper.js. Expect the modifiers ordering method
3800* to change in future major versions of the library.
3801*
3802* @memberof modifiers
3803* @inner
3804*/
3805computeStyle: {3806/** @prop {number} order=850 - Index used to define the order of execution */3807order: 850,3808/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3809enabled: true,3810/** @prop {ModifierFn} */3811fn: computeStyle,3812/**3813* @prop {Boolean} gpuAcceleration=true
3814* If true, it uses the CSS 3D transformation to position the popper.
3815* Otherwise, it will use the `top` and `left` properties
3816*/
3817gpuAcceleration: true,3818/**3819* @prop {string} [x='bottom']
3820* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
3821* Change this if your popper should grow in a direction different from `bottom`
3822*/
3823x: 'bottom',3824/**3825* @prop {string} [x='left']
3826* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
3827* Change this if your popper should grow in a direction different from `right`
3828*/
3829y: 'right'3830},3831
3832/**3833* Applies the computed styles to the popper element.
3834*
3835* All the DOM manipulations are limited to this modifier. This is useful in case
3836* you want to integrate Popper.js inside a framework or view library and you
3837* want to delegate all the DOM manipulations to it.
3838*
3839* Note that if you disable this modifier, you must make sure the popper element
3840* has its position set to `absolute` before Popper.js can do its work!
3841*
3842* Just disable this modifier and define your own to achieve the desired effect.
3843*
3844* @memberof modifiers
3845* @inner
3846*/
3847applyStyle: {3848/** @prop {number} order=900 - Index used to define the order of execution */3849order: 900,3850/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */3851enabled: true,3852/** @prop {ModifierFn} */3853fn: applyStyle,3854/** @prop {Function} */3855onLoad: applyStyleOnLoad,3856/**3857* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
3858* @prop {Boolean} gpuAcceleration=true
3859* If true, it uses the CSS 3D transformation to position the popper.
3860* Otherwise, it will use the `top` and `left` properties
3861*/
3862gpuAcceleration: undefined3863}3864};3865
3866/**3867* The `dataObject` is an object containing all the information used by Popper.js.
3868* This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
3869* @name dataObject
3870* @property {Object} data.instance The Popper.js instance
3871* @property {String} data.placement Placement applied to popper
3872* @property {String} data.originalPlacement Placement originally defined on init
3873* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
3874* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
3875* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
3876* @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
3877* @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
3878* @property {Object} data.boundaries Offsets of the popper boundaries
3879* @property {Object} data.offsets The measurements of popper, reference and arrow elements
3880* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
3881* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
3882* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
3883*/
3884
3885/**3886* Default options provided to Popper.js constructor.<br />
3887* These can be overridden using the `options` argument of Popper.js.<br />
3888* To override an option, simply pass an object with the same
3889* structure of the `options` object, as the 3rd argument. For example:
3890* ```
3891* new Popper(ref, pop, {
3892* modifiers: {
3893* preventOverflow: { enabled: false }
3894* }
3895* })
3896* ```
3897* @type {Object}
3898* @static
3899* @memberof Popper
3900*/
3901var Defaults = {3902/**3903* Popper's placement.
3904* @prop {Popper.placements} placement='bottom'
3905*/
3906placement: 'bottom',3907
3908/**3909* Set this to true if you want popper to position it self in 'fixed' mode
3910* @prop {Boolean} positionFixed=false
3911*/
3912positionFixed: false,3913
3914/**3915* Whether events (resize, scroll) are initially enabled.
3916* @prop {Boolean} eventsEnabled=true
3917*/
3918eventsEnabled: true,3919
3920/**3921* Set to true if you want to automatically remove the popper when
3922* you call the `destroy` method.
3923* @prop {Boolean} removeOnDestroy=false
3924*/
3925removeOnDestroy: false,3926
3927/**3928* Callback called when the popper is created.<br />
3929* By default, it is set to no-op.<br />
3930* Access Popper.js instance with `data.instance`.
3931* @prop {onCreate}
3932*/
3933onCreate: function onCreate() {},3934
3935/**3936* Callback called when the popper is updated. This callback is not called
3937* on the initialization/creation of the popper, but only on subsequent
3938* updates.<br />
3939* By default, it is set to no-op.<br />
3940* Access Popper.js instance with `data.instance`.
3941* @prop {onUpdate}
3942*/
3943onUpdate: function onUpdate() {},3944
3945/**3946* List of modifiers used to modify the offsets before they are applied to the popper.
3947* They provide most of the functionalities of Popper.js.
3948* @prop {modifiers}
3949*/
3950modifiers: modifiers3951};3952
3953/**3954* @callback onCreate
3955* @param {dataObject} data
3956*/
3957
3958/**3959* @callback onUpdate
3960* @param {dataObject} data
3961*/
3962
3963// Utils3964// Methods3965var Popper = function () {3966/**3967* Creates a new Popper.js instance.
3968* @class Popper
3969* @param {Element|referenceObject} reference - The reference element used to position the popper
3970* @param {Element} popper - The HTML / XML element used as the popper
3971* @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
3972* @return {Object} instance - The generated Popper.js instance
3973*/
3974function Popper(reference, popper) {3975var _this = this;3976
3977var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};3978classCallCheck(this, Popper);3979
3980this.scheduleUpdate = function () {3981return requestAnimationFrame(_this.update);3982};3983
3984// make update() debounced, so that it only runs at most once-per-tick3985this.update = debounce(this.update.bind(this));3986
3987// with {} we create a new object with the options inside it3988this.options = _extends({}, Popper.Defaults, options);3989
3990// init state3991this.state = {3992isDestroyed: false,3993isCreated: false,3994scrollParents: []3995};3996
3997// get reference and popper elements (allow jQuery wrappers)3998this.reference = reference && reference.jquery ? reference[0] : reference;3999this.popper = popper && popper.jquery ? popper[0] : popper;4000
4001// Deep merge modifiers options4002this.options.modifiers = {};4003Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {4004_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});4005});4006
4007// Refactoring modifiers' list (Object => Array)4008this.modifiers = Object.keys(this.options.modifiers).map(function (name) {4009return _extends({4010name: name4011}, _this.options.modifiers[name]);4012})4013// sort the modifiers by order4014.sort(function (a, b) {4015return a.order - b.order;4016});4017
4018// modifiers have the ability to execute arbitrary code when Popper.js get inited4019// such code is executed in the same order of its modifier4020// they could add new properties to their options configuration4021// BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!4022this.modifiers.forEach(function (modifierOptions) {4023if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {4024modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);4025}4026});4027
4028// fire the first update to position the popper in the right place4029this.update();4030
4031var eventsEnabled = this.options.eventsEnabled;4032if (eventsEnabled) {4033// setup event listeners, they will take care of update the position in specific situations4034this.enableEventListeners();4035}4036
4037this.state.eventsEnabled = eventsEnabled;4038}4039
4040// We can't use class properties because they don't get listed in the4041// class prototype and break stuff like Sinon stubs4042
4043
4044createClass(Popper, [{4045key: 'update',4046value: function update$$1() {4047return update.call(this);4048}4049}, {4050key: 'destroy',4051value: function destroy$$1() {4052return destroy.call(this);4053}4054}, {4055key: 'enableEventListeners',4056value: function enableEventListeners$$1() {4057return enableEventListeners.call(this);4058}4059}, {4060key: 'disableEventListeners',4061value: function disableEventListeners$$1() {4062return disableEventListeners.call(this);4063}4064
4065/**4066* Schedules an update. It will run on the next UI update available.
4067* @method scheduleUpdate
4068* @memberof Popper
4069*/
4070
4071
4072/**4073* Collection of utilities useful when writing custom modifiers.
4074* Starting from version 1.7, this method is available only if you
4075* include `popper-utils.js` before `popper.js`.
4076*
4077* **DEPRECATION**: This way to access PopperUtils is deprecated
4078* and will be removed in v2! Use the PopperUtils module directly instead.
4079* Due to the high instability of the methods contained in Utils, we can't
4080* guarantee them to follow semver. Use them at your own risk!
4081* @static
4082* @private
4083* @type {Object}
4084* @deprecated since version 1.8
4085* @member Utils
4086* @memberof Popper
4087*/
4088
4089}]);4090return Popper;4091}();4092
4093/**4094* The `referenceObject` is an object that provides an interface compatible with Popper.js
4095* and lets you use it as replacement of a real DOM node.<br />
4096* You can use this method to position a popper relatively to a set of coordinates
4097* in case you don't have a DOM node to use as reference.
4098*
4099* ```
4100* new Popper(referenceObject, popperNode);
4101* ```
4102*
4103* NB: This feature isn't supported in Internet Explorer 10.
4104* @name referenceObject
4105* @property {Function} data.getBoundingClientRect
4106* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
4107* @property {number} data.clientWidth
4108* An ES6 getter that will return the width of the virtual reference element.
4109* @property {number} data.clientHeight
4110* An ES6 getter that will return the height of the virtual reference element.
4111*/
4112
4113
4114Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;4115Popper.placements = placements;4116Popper.Defaults = Defaults;4117
4118var Popper$1 = Popper;4119
4120/**4121* Constants
4122*/
4123
4124var NAME$6 = 'dropdown';4125var VERSION$6 = '4.6.1';4126var DATA_KEY$6 = 'bs.dropdown';4127var EVENT_KEY$6 = "." + DATA_KEY$6;4128var DATA_API_KEY$3 = '.data-api';4129var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6];4130var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key4131
4132var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key4133
4134var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key4135
4136var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key4137
4138var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key4139
4140var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)4141
4142var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1);4143var CLASS_NAME_DISABLED$1 = 'disabled';4144var CLASS_NAME_SHOW$5 = 'show';4145var CLASS_NAME_DROPUP = 'dropup';4146var CLASS_NAME_DROPRIGHT = 'dropright';4147var CLASS_NAME_DROPLEFT = 'dropleft';4148var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';4149var CLASS_NAME_POSITION_STATIC = 'position-static';4150var EVENT_HIDE$3 = "hide" + EVENT_KEY$6;4151var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6;4152var EVENT_SHOW$3 = "show" + EVENT_KEY$6;4153var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6;4154var EVENT_CLICK = "click" + EVENT_KEY$6;4155var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3;4156var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3;4157var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3;4158var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';4159var SELECTOR_FORM_CHILD = '.dropdown form';4160var SELECTOR_MENU = '.dropdown-menu';4161var SELECTOR_NAVBAR_NAV = '.navbar-nav';4162var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';4163var PLACEMENT_TOP = 'top-start';4164var PLACEMENT_TOPEND = 'top-end';4165var PLACEMENT_BOTTOM = 'bottom-start';4166var PLACEMENT_BOTTOMEND = 'bottom-end';4167var PLACEMENT_RIGHT = 'right-start';4168var PLACEMENT_LEFT = 'left-start';4169var Default$5 = {4170offset: 0,4171flip: true,4172boundary: 'scrollParent',4173reference: 'toggle',4174display: 'dynamic',4175popperConfig: null4176};4177var DefaultType$5 = {4178offset: '(number|string|function)',4179flip: 'boolean',4180boundary: '(string|element)',4181reference: '(string|element)',4182display: 'string',4183popperConfig: '(null|object)'4184};4185/**4186* Class definition
4187*/
4188
4189var Dropdown = /*#__PURE__*/function () {4190function Dropdown(element, config) {4191this._element = element;4192this._popper = null;4193this._config = this._getConfig(config);4194this._menu = this._getMenuElement();4195this._inNavbar = this._detectNavbar();4196
4197this._addEventListeners();4198} // Getters4199
4200
4201var _proto = Dropdown.prototype;4202
4203// Public4204_proto.toggle = function toggle() {4205if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) {4206return;4207}4208
4209var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5);4210
4211Dropdown._clearMenus();4212
4213if (isActive) {4214return;4215}4216
4217this.show(true);4218};4219
4220_proto.show = function show(usePopper) {4221if (usePopper === void 0) {4222usePopper = false;4223}4224
4225if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) {4226return;4227}4228
4229var relatedTarget = {4230relatedTarget: this._element4231};4232var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget);4233
4234var parent = Dropdown._getParentFromElement(this._element);4235
4236$__default["default"](parent).trigger(showEvent);4237
4238if (showEvent.isDefaultPrevented()) {4239return;4240} // Totally disable Popper for Dropdowns in Navbar4241
4242
4243if (!this._inNavbar && usePopper) {4244// Check for Popper dependency4245if (typeof Popper$1 === 'undefined') {4246throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');4247}4248
4249var referenceElement = this._element;4250
4251if (this._config.reference === 'parent') {4252referenceElement = parent;4253} else if (Util.isElement(this._config.reference)) {4254referenceElement = this._config.reference; // Check if it's jQuery element4255
4256if (typeof this._config.reference.jquery !== 'undefined') {4257referenceElement = this._config.reference[0];4258}4259} // If boundary is not `scrollParent`, then set position to `static`4260// to allow the menu to "escape" the scroll parent's boundaries4261// https://github.com/twbs/bootstrap/issues/242514262
4263
4264if (this._config.boundary !== 'scrollParent') {4265$__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC);4266}4267
4268this._popper = new Popper$1(referenceElement, this._menu, this._getPopperConfig());4269} // If this is a touch-enabled device we add extra4270// empty mouseover listeners to the body's immediate children;4271// only needed because of broken event delegation on iOS4272// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html4273
4274
4275if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {4276$__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);4277}4278
4279this._element.focus();4280
4281this._element.setAttribute('aria-expanded', true);4282
4283$__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5);4284$__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget));4285};4286
4287_proto.hide = function hide() {4288if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) {4289return;4290}4291
4292var relatedTarget = {4293relatedTarget: this._element4294};4295var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget);4296
4297var parent = Dropdown._getParentFromElement(this._element);4298
4299$__default["default"](parent).trigger(hideEvent);4300
4301if (hideEvent.isDefaultPrevented()) {4302return;4303}4304
4305if (this._popper) {4306this._popper.destroy();4307}4308
4309$__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5);4310$__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget));4311};4312
4313_proto.dispose = function dispose() {4314$__default["default"].removeData(this._element, DATA_KEY$6);4315$__default["default"](this._element).off(EVENT_KEY$6);4316this._element = null;4317this._menu = null;4318
4319if (this._popper !== null) {4320this._popper.destroy();4321
4322this._popper = null;4323}4324};4325
4326_proto.update = function update() {4327this._inNavbar = this._detectNavbar();4328
4329if (this._popper !== null) {4330this._popper.scheduleUpdate();4331}4332} // Private4333;4334
4335_proto._addEventListeners = function _addEventListeners() {4336var _this = this;4337
4338$__default["default"](this._element).on(EVENT_CLICK, function (event) {4339event.preventDefault();4340event.stopPropagation();4341
4342_this.toggle();4343});4344};4345
4346_proto._getConfig = function _getConfig(config) {4347config = _extends$1({}, this.constructor.Default, $__default["default"](this._element).data(), config);4348Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);4349return config;4350};4351
4352_proto._getMenuElement = function _getMenuElement() {4353if (!this._menu) {4354var parent = Dropdown._getParentFromElement(this._element);4355
4356if (parent) {4357this._menu = parent.querySelector(SELECTOR_MENU);4358}4359}4360
4361return this._menu;4362};4363
4364_proto._getPlacement = function _getPlacement() {4365var $parentDropdown = $__default["default"](this._element.parentNode);4366var placement = PLACEMENT_BOTTOM; // Handle dropup4367
4368if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {4369placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;4370} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {4371placement = PLACEMENT_RIGHT;4372} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {4373placement = PLACEMENT_LEFT;4374} else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {4375placement = PLACEMENT_BOTTOMEND;4376}4377
4378return placement;4379};4380
4381_proto._detectNavbar = function _detectNavbar() {4382return $__default["default"](this._element).closest('.navbar').length > 0;4383};4384
4385_proto._getOffset = function _getOffset() {4386var _this2 = this;4387
4388var offset = {};4389
4390if (typeof this._config.offset === 'function') {4391offset.fn = function (data) {4392data.offsets = _extends$1({}, data.offsets, _this2._config.offset(data.offsets, _this2._element));4393return data;4394};4395} else {4396offset.offset = this._config.offset;4397}4398
4399return offset;4400};4401
4402_proto._getPopperConfig = function _getPopperConfig() {4403var popperConfig = {4404placement: this._getPlacement(),4405modifiers: {4406offset: this._getOffset(),4407flip: {4408enabled: this._config.flip4409},4410preventOverflow: {4411boundariesElement: this._config.boundary4412}4413}4414}; // Disable Popper if we have a static display4415
4416if (this._config.display === 'static') {4417popperConfig.modifiers.applyStyle = {4418enabled: false4419};4420}4421
4422return _extends$1({}, popperConfig, this._config.popperConfig);4423} // Static4424;4425
4426Dropdown._jQueryInterface = function _jQueryInterface(config) {4427return this.each(function () {4428var data = $__default["default"](this).data(DATA_KEY$6);4429
4430var _config = typeof config === 'object' ? config : null;4431
4432if (!data) {4433data = new Dropdown(this, _config);4434$__default["default"](this).data(DATA_KEY$6, data);4435}4436
4437if (typeof config === 'string') {4438if (typeof data[config] === 'undefined') {4439throw new TypeError("No method named \"" + config + "\"");4440}4441
4442data[config]();4443}4444});4445};4446
4447Dropdown._clearMenus = function _clearMenus(event) {4448if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {4449return;4450}4451
4452var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));4453
4454for (var i = 0, len = toggles.length; i < len; i++) {4455var parent = Dropdown._getParentFromElement(toggles[i]);4456
4457var context = $__default["default"](toggles[i]).data(DATA_KEY$6);4458var relatedTarget = {4459relatedTarget: toggles[i]4460};4461
4462if (event && event.type === 'click') {4463relatedTarget.clickEvent = event;4464}4465
4466if (!context) {4467continue;4468}4469
4470var dropdownMenu = context._menu;4471
4472if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) {4473continue;4474}4475
4476if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) {4477continue;4478}4479
4480var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget);4481$__default["default"](parent).trigger(hideEvent);4482
4483if (hideEvent.isDefaultPrevented()) {4484continue;4485} // If this is a touch-enabled device we remove the extra4486// empty mouseover listeners we added for iOS support4487
4488
4489if ('ontouchstart' in document.documentElement) {4490$__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);4491}4492
4493toggles[i].setAttribute('aria-expanded', 'false');4494
4495if (context._popper) {4496context._popper.destroy();4497}4498
4499$__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5);4500$__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget));4501}4502};4503
4504Dropdown._getParentFromElement = function _getParentFromElement(element) {4505var parent;4506var selector = Util.getSelectorFromElement(element);4507
4508if (selector) {4509parent = document.querySelector(selector);4510}4511
4512return parent || element.parentNode;4513} // eslint-disable-next-line complexity4514;4515
4516Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {4517// If not input/textarea:4518// - And not a key in REGEXP_KEYDOWN => not a dropdown command4519// If input/textarea:4520// - If space key => not a dropdown command4521// - If key is other than escape4522// - If key is not up or down => not a dropdown command4523// - If trigger inside the menu => not a dropdown command4524if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {4525return;4526}4527
4528if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) {4529return;4530}4531
4532var parent = Dropdown._getParentFromElement(this);4533
4534var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5);4535
4536if (!isActive && event.which === ESCAPE_KEYCODE$1) {4537return;4538}4539
4540event.preventDefault();4541event.stopPropagation();4542
4543if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) {4544if (event.which === ESCAPE_KEYCODE$1) {4545$__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');4546}4547
4548$__default["default"](this).trigger('click');4549return;4550}4551
4552var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {4553return $__default["default"](item).is(':visible');4554});4555
4556if (items.length === 0) {4557return;4558}4559
4560var index = items.indexOf(event.target);4561
4562if (event.which === ARROW_UP_KEYCODE && index > 0) {4563// Up4564index--;4565}4566
4567if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {4568// Down4569index++;4570}4571
4572if (index < 0) {4573index = 0;4574}4575
4576items[index].focus();4577};4578
4579_createClass(Dropdown, null, [{4580key: "VERSION",4581get: function get() {4582return VERSION$6;4583}4584}, {4585key: "Default",4586get: function get() {4587return Default$5;4588}4589}, {4590key: "DefaultType",4591get: function get() {4592return DefaultType$5;4593}4594}]);4595
4596return Dropdown;4597}();4598/**4599* Data API implementation
4600*/
4601
4602
4603$__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {4604event.preventDefault();4605event.stopPropagation();4606
4607Dropdown._jQueryInterface.call($__default["default"](this), 'toggle');4608}).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) {4609e.stopPropagation();4610});4611/**4612* jQuery
4613*/
4614
4615$__default["default"].fn[NAME$6] = Dropdown._jQueryInterface;4616$__default["default"].fn[NAME$6].Constructor = Dropdown;4617
4618$__default["default"].fn[NAME$6].noConflict = function () {4619$__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6;4620return Dropdown._jQueryInterface;4621};4622
4623/**4624* Constants
4625*/
4626
4627var NAME$5 = 'modal';4628var VERSION$5 = '4.6.1';4629var DATA_KEY$5 = 'bs.modal';4630var EVENT_KEY$5 = "." + DATA_KEY$5;4631var DATA_API_KEY$2 = '.data-api';4632var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5];4633var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key4634
4635var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';4636var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';4637var CLASS_NAME_BACKDROP = 'modal-backdrop';4638var CLASS_NAME_OPEN = 'modal-open';4639var CLASS_NAME_FADE$4 = 'fade';4640var CLASS_NAME_SHOW$4 = 'show';4641var CLASS_NAME_STATIC = 'modal-static';4642var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;4643var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;4644var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;4645var EVENT_SHOW$2 = "show" + EVENT_KEY$5;4646var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;4647var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;4648var EVENT_RESIZE = "resize" + EVENT_KEY$5;4649var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5;4650var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;4651var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;4652var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;4653var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2;4654var SELECTOR_DIALOG = '.modal-dialog';4655var SELECTOR_MODAL_BODY = '.modal-body';4656var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]';4657var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]';4658var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';4659var SELECTOR_STICKY_CONTENT = '.sticky-top';4660var Default$4 = {4661backdrop: true,4662keyboard: true,4663focus: true,4664show: true4665};4666var DefaultType$4 = {4667backdrop: '(boolean|string)',4668keyboard: 'boolean',4669focus: 'boolean',4670show: 'boolean'4671};4672/**4673* Class definition
4674*/
4675
4676var Modal = /*#__PURE__*/function () {4677function Modal(element, config) {4678this._config = this._getConfig(config);4679this._element = element;4680this._dialog = element.querySelector(SELECTOR_DIALOG);4681this._backdrop = null;4682this._isShown = false;4683this._isBodyOverflowing = false;4684this._ignoreBackdropClick = false;4685this._isTransitioning = false;4686this._scrollbarWidth = 0;4687} // Getters4688
4689
4690var _proto = Modal.prototype;4691
4692// Public4693_proto.toggle = function toggle(relatedTarget) {4694return this._isShown ? this.hide() : this.show(relatedTarget);4695};4696
4697_proto.show = function show(relatedTarget) {4698var _this = this;4699
4700if (this._isShown || this._isTransitioning) {4701return;4702}4703
4704var showEvent = $__default["default"].Event(EVENT_SHOW$2, {4705relatedTarget: relatedTarget4706});4707$__default["default"](this._element).trigger(showEvent);4708
4709if (showEvent.isDefaultPrevented()) {4710return;4711}4712
4713this._isShown = true;4714
4715if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) {4716this._isTransitioning = true;4717}4718
4719this._checkScrollbar();4720
4721this._setScrollbar();4722
4723this._adjustDialog();4724
4725this._setEscapeEvent();4726
4727this._setResizeEvent();4728
4729$__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) {4730return _this.hide(event);4731});4732$__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {4733$__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {4734if ($__default["default"](event.target).is(_this._element)) {4735_this._ignoreBackdropClick = true;4736}4737});4738});4739
4740this._showBackdrop(function () {4741return _this._showElement(relatedTarget);4742});4743};4744
4745_proto.hide = function hide(event) {4746var _this2 = this;4747
4748if (event) {4749event.preventDefault();4750}4751
4752if (!this._isShown || this._isTransitioning) {4753return;4754}4755
4756var hideEvent = $__default["default"].Event(EVENT_HIDE$2);4757$__default["default"](this._element).trigger(hideEvent);4758
4759if (!this._isShown || hideEvent.isDefaultPrevented()) {4760return;4761}4762
4763this._isShown = false;4764var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4);4765
4766if (transition) {4767this._isTransitioning = true;4768}4769
4770this._setEscapeEvent();4771
4772this._setResizeEvent();4773
4774$__default["default"](document).off(EVENT_FOCUSIN);4775$__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4);4776$__default["default"](this._element).off(EVENT_CLICK_DISMISS$1);4777$__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);4778
4779if (transition) {4780var transitionDuration = Util.getTransitionDurationFromElement(this._element);4781$__default["default"](this._element).one(Util.TRANSITION_END, function (event) {4782return _this2._hideModal(event);4783}).emulateTransitionEnd(transitionDuration);4784} else {4785this._hideModal();4786}4787};4788
4789_proto.dispose = function dispose() {4790[window, this._element, this._dialog].forEach(function (htmlElement) {4791return $__default["default"](htmlElement).off(EVENT_KEY$5);4792});4793/**4794* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
4795* Do not move `document` in `htmlElements` array
4796* It will remove `EVENT_CLICK_DATA_API` event that should remain
4797*/
4798
4799$__default["default"](document).off(EVENT_FOCUSIN);4800$__default["default"].removeData(this._element, DATA_KEY$5);4801this._config = null;4802this._element = null;4803this._dialog = null;4804this._backdrop = null;4805this._isShown = null;4806this._isBodyOverflowing = null;4807this._ignoreBackdropClick = null;4808this._isTransitioning = null;4809this._scrollbarWidth = null;4810};4811
4812_proto.handleUpdate = function handleUpdate() {4813this._adjustDialog();4814} // Private4815;4816
4817_proto._getConfig = function _getConfig(config) {4818config = _extends$1({}, Default$4, config);4819Util.typeCheckConfig(NAME$5, config, DefaultType$4);4820return config;4821};4822
4823_proto._triggerBackdropTransition = function _triggerBackdropTransition() {4824var _this3 = this;4825
4826var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED);4827$__default["default"](this._element).trigger(hideEventPrevented);4828
4829if (hideEventPrevented.isDefaultPrevented()) {4830return;4831}4832
4833var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;4834
4835if (!isModalOverflowing) {4836this._element.style.overflowY = 'hidden';4837}4838
4839this._element.classList.add(CLASS_NAME_STATIC);4840
4841var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);4842$__default["default"](this._element).off(Util.TRANSITION_END);4843$__default["default"](this._element).one(Util.TRANSITION_END, function () {4844_this3._element.classList.remove(CLASS_NAME_STATIC);4845
4846if (!isModalOverflowing) {4847$__default["default"](_this3._element).one(Util.TRANSITION_END, function () {4848_this3._element.style.overflowY = '';4849}).emulateTransitionEnd(_this3._element, modalTransitionDuration);4850}4851}).emulateTransitionEnd(modalTransitionDuration);4852
4853this._element.focus();4854};4855
4856_proto._showElement = function _showElement(relatedTarget) {4857var _this4 = this;4858
4859var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4);4860var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;4861
4862if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {4863// Don't move modal's DOM position4864document.body.appendChild(this._element);4865}4866
4867this._element.style.display = 'block';4868
4869this._element.removeAttribute('aria-hidden');4870
4871this._element.setAttribute('aria-modal', true);4872
4873this._element.setAttribute('role', 'dialog');4874
4875if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {4876modalBody.scrollTop = 0;4877} else {4878this._element.scrollTop = 0;4879}4880
4881if (transition) {4882Util.reflow(this._element);4883}4884
4885$__default["default"](this._element).addClass(CLASS_NAME_SHOW$4);4886
4887if (this._config.focus) {4888this._enforceFocus();4889}4890
4891var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, {4892relatedTarget: relatedTarget4893});4894
4895var transitionComplete = function transitionComplete() {4896if (_this4._config.focus) {4897_this4._element.focus();4898}4899
4900_this4._isTransitioning = false;4901$__default["default"](_this4._element).trigger(shownEvent);4902};4903
4904if (transition) {4905var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);4906$__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);4907} else {4908transitionComplete();4909}4910};4911
4912_proto._enforceFocus = function _enforceFocus() {4913var _this5 = this;4914
4915$__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop4916.on(EVENT_FOCUSIN, function (event) {4917if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) {4918_this5._element.focus();4919}4920});4921};4922
4923_proto._setEscapeEvent = function _setEscapeEvent() {4924var _this6 = this;4925
4926if (this._isShown) {4927$__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {4928if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {4929event.preventDefault();4930
4931_this6.hide();4932} else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {4933_this6._triggerBackdropTransition();4934}4935});4936} else if (!this._isShown) {4937$__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS);4938}4939};4940
4941_proto._setResizeEvent = function _setResizeEvent() {4942var _this7 = this;4943
4944if (this._isShown) {4945$__default["default"](window).on(EVENT_RESIZE, function (event) {4946return _this7.handleUpdate(event);4947});4948} else {4949$__default["default"](window).off(EVENT_RESIZE);4950}4951};4952
4953_proto._hideModal = function _hideModal() {4954var _this8 = this;4955
4956this._element.style.display = 'none';4957
4958this._element.setAttribute('aria-hidden', true);4959
4960this._element.removeAttribute('aria-modal');4961
4962this._element.removeAttribute('role');4963
4964this._isTransitioning = false;4965
4966this._showBackdrop(function () {4967$__default["default"](document.body).removeClass(CLASS_NAME_OPEN);4968
4969_this8._resetAdjustments();4970
4971_this8._resetScrollbar();4972
4973$__default["default"](_this8._element).trigger(EVENT_HIDDEN$2);4974});4975};4976
4977_proto._removeBackdrop = function _removeBackdrop() {4978if (this._backdrop) {4979$__default["default"](this._backdrop).remove();4980this._backdrop = null;4981}4982};4983
4984_proto._showBackdrop = function _showBackdrop(callback) {4985var _this9 = this;4986
4987var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : '';4988
4989if (this._isShown && this._config.backdrop) {4990this._backdrop = document.createElement('div');4991this._backdrop.className = CLASS_NAME_BACKDROP;4992
4993if (animate) {4994this._backdrop.classList.add(animate);4995}4996
4997$__default["default"](this._backdrop).appendTo(document.body);4998$__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) {4999if (_this9._ignoreBackdropClick) {5000_this9._ignoreBackdropClick = false;5001return;5002}5003
5004if (event.target !== event.currentTarget) {5005return;5006}5007
5008if (_this9._config.backdrop === 'static') {5009_this9._triggerBackdropTransition();5010} else {5011_this9.hide();5012}5013});5014
5015if (animate) {5016Util.reflow(this._backdrop);5017}5018
5019$__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4);5020
5021if (!callback) {5022return;5023}5024
5025if (!animate) {5026callback();5027return;5028}5029
5030var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);5031$__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);5032} else if (!this._isShown && this._backdrop) {5033$__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4);5034
5035var callbackRemove = function callbackRemove() {5036_this9._removeBackdrop();5037
5038if (callback) {5039callback();5040}5041};5042
5043if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) {5044var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);5045
5046$__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);5047} else {5048callbackRemove();5049}5050} else if (callback) {5051callback();5052}5053} // ----------------------------------------------------------------------5054// the following methods are used to handle overflowing modals5055// todo (fat): these should probably be refactored out of modal.js5056// ----------------------------------------------------------------------5057;5058
5059_proto._adjustDialog = function _adjustDialog() {5060var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;5061
5062if (!this._isBodyOverflowing && isModalOverflowing) {5063this._element.style.paddingLeft = this._scrollbarWidth + "px";5064}5065
5066if (this._isBodyOverflowing && !isModalOverflowing) {5067this._element.style.paddingRight = this._scrollbarWidth + "px";5068}5069};5070
5071_proto._resetAdjustments = function _resetAdjustments() {5072this._element.style.paddingLeft = '';5073this._element.style.paddingRight = '';5074};5075
5076_proto._checkScrollbar = function _checkScrollbar() {5077var rect = document.body.getBoundingClientRect();5078this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;5079this._scrollbarWidth = this._getScrollbarWidth();5080};5081
5082_proto._setScrollbar = function _setScrollbar() {5083var _this10 = this;5084
5085if (this._isBodyOverflowing) {5086// Note: DOMNode.style.paddingRight returns the actual value or '' if not set5087// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set5088var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));5089var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding5090
5091$__default["default"](fixedContent).each(function (index, element) {5092var actualPadding = element.style.paddingRight;5093var calculatedPadding = $__default["default"](element).css('padding-right');5094$__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");5095}); // Adjust sticky content margin5096
5097$__default["default"](stickyContent).each(function (index, element) {5098var actualMargin = element.style.marginRight;5099var calculatedMargin = $__default["default"](element).css('margin-right');5100$__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");5101}); // Adjust body padding5102
5103var actualPadding = document.body.style.paddingRight;5104var calculatedPadding = $__default["default"](document.body).css('padding-right');5105$__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");5106}5107
5108$__default["default"](document.body).addClass(CLASS_NAME_OPEN);5109};5110
5111_proto._resetScrollbar = function _resetScrollbar() {5112// Restore fixed content padding5113var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));5114$__default["default"](fixedContent).each(function (index, element) {5115var padding = $__default["default"](element).data('padding-right');5116$__default["default"](element).removeData('padding-right');5117element.style.paddingRight = padding ? padding : '';5118}); // Restore sticky content5119
5120var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));5121$__default["default"](elements).each(function (index, element) {5122var margin = $__default["default"](element).data('margin-right');5123
5124if (typeof margin !== 'undefined') {5125$__default["default"](element).css('margin-right', margin).removeData('margin-right');5126}5127}); // Restore body padding5128
5129var padding = $__default["default"](document.body).data('padding-right');5130$__default["default"](document.body).removeData('padding-right');5131document.body.style.paddingRight = padding ? padding : '';5132};5133
5134_proto._getScrollbarWidth = function _getScrollbarWidth() {5135// thx d.walsh5136var scrollDiv = document.createElement('div');5137scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;5138document.body.appendChild(scrollDiv);5139var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;5140document.body.removeChild(scrollDiv);5141return scrollbarWidth;5142} // Static5143;5144
5145Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {5146return this.each(function () {5147var data = $__default["default"](this).data(DATA_KEY$5);5148
5149var _config = _extends$1({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {});5150
5151if (!data) {5152data = new Modal(this, _config);5153$__default["default"](this).data(DATA_KEY$5, data);5154}5155
5156if (typeof config === 'string') {5157if (typeof data[config] === 'undefined') {5158throw new TypeError("No method named \"" + config + "\"");5159}5160
5161data[config](relatedTarget);5162} else if (_config.show) {5163data.show(relatedTarget);5164}5165});5166};5167
5168_createClass(Modal, null, [{5169key: "VERSION",5170get: function get() {5171return VERSION$5;5172}5173}, {5174key: "Default",5175get: function get() {5176return Default$4;5177}5178}]);5179
5180return Modal;5181}();5182/**5183* Data API implementation
5184*/
5185
5186
5187$__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {5188var _this11 = this;5189
5190var target;5191var selector = Util.getSelectorFromElement(this);5192
5193if (selector) {5194target = document.querySelector(selector);5195}5196
5197var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data());5198
5199if (this.tagName === 'A' || this.tagName === 'AREA') {5200event.preventDefault();5201}5202
5203var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) {5204if (showEvent.isDefaultPrevented()) {5205// Only register focus restorer if modal will actually get shown5206return;5207}5208
5209$target.one(EVENT_HIDDEN$2, function () {5210if ($__default["default"](_this11).is(':visible')) {5211_this11.focus();5212}5213});5214});5215
5216Modal._jQueryInterface.call($__default["default"](target), config, this);5217});5218/**5219* jQuery
5220*/
5221
5222$__default["default"].fn[NAME$5] = Modal._jQueryInterface;5223$__default["default"].fn[NAME$5].Constructor = Modal;5224
5225$__default["default"].fn[NAME$5].noConflict = function () {5226$__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5;5227return Modal._jQueryInterface;5228};5229
5230/**5231* --------------------------------------------------------------------------
5232* Bootstrap (v4.6.1): tools/sanitizer.js
5233* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5234* --------------------------------------------------------------------------
5235*/
5236var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];5237var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;5238var DefaultWhitelist = {5239// Global attributes allowed on any supplied element below.5240'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],5241a: ['target', 'href', 'title', 'rel'],5242area: [],5243b: [],5244br: [],5245col: [],5246code: [],5247div: [],5248em: [],5249hr: [],5250h1: [],5251h2: [],5252h3: [],5253h4: [],5254h5: [],5255h6: [],5256i: [],5257img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],5258li: [],5259ol: [],5260p: [],5261pre: [],5262s: [],5263small: [],5264span: [],5265sub: [],5266sup: [],5267strong: [],5268u: [],5269ul: []5270};5271/**5272* A pattern that recognizes a commonly useful subset of URLs that are safe.
5273*
5274* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5275*/
5276
5277var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;5278/**5279* A pattern that matches safe data URLs. Only matches image, video and audio types.
5280*
5281* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
5282*/
5283
5284var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;5285
5286function allowedAttribute(attr, allowedAttributeList) {5287var attrName = attr.nodeName.toLowerCase();5288
5289if (allowedAttributeList.indexOf(attrName) !== -1) {5290if (uriAttrs.indexOf(attrName) !== -1) {5291return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));5292}5293
5294return true;5295}5296
5297var regExp = allowedAttributeList.filter(function (attrRegex) {5298return attrRegex instanceof RegExp;5299}); // Check if a regular expression validates the attribute.5300
5301for (var i = 0, len = regExp.length; i < len; i++) {5302if (regExp[i].test(attrName)) {5303return true;5304}5305}5306
5307return false;5308}5309
5310function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {5311if (unsafeHtml.length === 0) {5312return unsafeHtml;5313}5314
5315if (sanitizeFn && typeof sanitizeFn === 'function') {5316return sanitizeFn(unsafeHtml);5317}5318
5319var domParser = new window.DOMParser();5320var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');5321var whitelistKeys = Object.keys(whiteList);5322var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));5323
5324var _loop = function _loop(i, len) {5325var el = elements[i];5326var elName = el.nodeName.toLowerCase();5327
5328if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {5329el.parentNode.removeChild(el);5330return "continue";5331}5332
5333var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread5334
5335var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);5336attributeList.forEach(function (attr) {5337if (!allowedAttribute(attr, whitelistedAttributes)) {5338el.removeAttribute(attr.nodeName);5339}5340});5341};5342
5343for (var i = 0, len = elements.length; i < len; i++) {5344var _ret = _loop(i);5345
5346if (_ret === "continue") continue;5347}5348
5349return createdDocument.body.innerHTML;5350}5351
5352/**5353* Constants
5354*/
5355
5356var NAME$4 = 'tooltip';5357var VERSION$4 = '4.6.1';5358var DATA_KEY$4 = 'bs.tooltip';5359var EVENT_KEY$4 = "." + DATA_KEY$4;5360var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4];5361var CLASS_PREFIX$1 = 'bs-tooltip';5362var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');5363var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];5364var CLASS_NAME_FADE$3 = 'fade';5365var CLASS_NAME_SHOW$3 = 'show';5366var HOVER_STATE_SHOW = 'show';5367var HOVER_STATE_OUT = 'out';5368var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';5369var SELECTOR_ARROW = '.arrow';5370var TRIGGER_HOVER = 'hover';5371var TRIGGER_FOCUS = 'focus';5372var TRIGGER_CLICK = 'click';5373var TRIGGER_MANUAL = 'manual';5374var AttachmentMap = {5375AUTO: 'auto',5376TOP: 'top',5377RIGHT: 'right',5378BOTTOM: 'bottom',5379LEFT: 'left'5380};5381var Default$3 = {5382animation: true,5383template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',5384trigger: 'hover focus',5385title: '',5386delay: 0,5387html: false,5388selector: false,5389placement: 'top',5390offset: 0,5391container: false,5392fallbackPlacement: 'flip',5393boundary: 'scrollParent',5394customClass: '',5395sanitize: true,5396sanitizeFn: null,5397whiteList: DefaultWhitelist,5398popperConfig: null5399};5400var DefaultType$3 = {5401animation: 'boolean',5402template: 'string',5403title: '(string|element|function)',5404trigger: 'string',5405delay: '(number|object)',5406html: 'boolean',5407selector: '(string|boolean)',5408placement: '(string|function)',5409offset: '(number|string|function)',5410container: '(string|element|boolean)',5411fallbackPlacement: '(string|array)',5412boundary: '(string|element)',5413customClass: '(string|function)',5414sanitize: 'boolean',5415sanitizeFn: '(null|function)',5416whiteList: 'object',5417popperConfig: '(null|object)'5418};5419var Event$1 = {5420HIDE: "hide" + EVENT_KEY$4,5421HIDDEN: "hidden" + EVENT_KEY$4,5422SHOW: "show" + EVENT_KEY$4,5423SHOWN: "shown" + EVENT_KEY$4,5424INSERTED: "inserted" + EVENT_KEY$4,5425CLICK: "click" + EVENT_KEY$4,5426FOCUSIN: "focusin" + EVENT_KEY$4,5427FOCUSOUT: "focusout" + EVENT_KEY$4,5428MOUSEENTER: "mouseenter" + EVENT_KEY$4,5429MOUSELEAVE: "mouseleave" + EVENT_KEY$45430};5431/**5432* Class definition
5433*/
5434
5435var Tooltip = /*#__PURE__*/function () {5436function Tooltip(element, config) {5437if (typeof Popper$1 === 'undefined') {5438throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');5439} // Private5440
5441
5442this._isEnabled = true;5443this._timeout = 0;5444this._hoverState = '';5445this._activeTrigger = {};5446this._popper = null; // Protected5447
5448this.element = element;5449this.config = this._getConfig(config);5450this.tip = null;5451
5452this._setListeners();5453} // Getters5454
5455
5456var _proto = Tooltip.prototype;5457
5458// Public5459_proto.enable = function enable() {5460this._isEnabled = true;5461};5462
5463_proto.disable = function disable() {5464this._isEnabled = false;5465};5466
5467_proto.toggleEnabled = function toggleEnabled() {5468this._isEnabled = !this._isEnabled;5469};5470
5471_proto.toggle = function toggle(event) {5472if (!this._isEnabled) {5473return;5474}5475
5476if (event) {5477var dataKey = this.constructor.DATA_KEY;5478var context = $__default["default"](event.currentTarget).data(dataKey);5479
5480if (!context) {5481context = new this.constructor(event.currentTarget, this._getDelegateConfig());5482$__default["default"](event.currentTarget).data(dataKey, context);5483}5484
5485context._activeTrigger.click = !context._activeTrigger.click;5486
5487if (context._isWithActiveTrigger()) {5488context._enter(null, context);5489} else {5490context._leave(null, context);5491}5492} else {5493if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) {5494this._leave(null, this);5495
5496return;5497}5498
5499this._enter(null, this);5500}5501};5502
5503_proto.dispose = function dispose() {5504clearTimeout(this._timeout);5505$__default["default"].removeData(this.element, this.constructor.DATA_KEY);5506$__default["default"](this.element).off(this.constructor.EVENT_KEY);5507$__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);5508
5509if (this.tip) {5510$__default["default"](this.tip).remove();5511}5512
5513this._isEnabled = null;5514this._timeout = null;5515this._hoverState = null;5516this._activeTrigger = null;5517
5518if (this._popper) {5519this._popper.destroy();5520}5521
5522this._popper = null;5523this.element = null;5524this.config = null;5525this.tip = null;5526};5527
5528_proto.show = function show() {5529var _this = this;5530
5531if ($__default["default"](this.element).css('display') === 'none') {5532throw new Error('Please use show on visible elements');5533}5534
5535var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);5536
5537if (this.isWithContent() && this._isEnabled) {5538$__default["default"](this.element).trigger(showEvent);5539var shadowRoot = Util.findShadowRoot(this.element);5540var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);5541
5542if (showEvent.isDefaultPrevented() || !isInTheDom) {5543return;5544}5545
5546var tip = this.getTipElement();5547var tipId = Util.getUID(this.constructor.NAME);5548tip.setAttribute('id', tipId);5549this.element.setAttribute('aria-describedby', tipId);5550this.setContent();5551
5552if (this.config.animation) {5553$__default["default"](tip).addClass(CLASS_NAME_FADE$3);5554}5555
5556var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;5557
5558var attachment = this._getAttachment(placement);5559
5560this.addAttachmentClass(attachment);5561
5562var container = this._getContainer();5563
5564$__default["default"](tip).data(this.constructor.DATA_KEY, this);5565
5566if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {5567$__default["default"](tip).appendTo(container);5568}5569
5570$__default["default"](this.element).trigger(this.constructor.Event.INSERTED);5571this._popper = new Popper$1(this.element, tip, this._getPopperConfig(attachment));5572$__default["default"](tip).addClass(CLASS_NAME_SHOW$3);5573$__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra5574// empty mouseover listeners to the body's immediate children;5575// only needed because of broken event delegation on iOS5576// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html5577
5578if ('ontouchstart' in document.documentElement) {5579$__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);5580}5581
5582var complete = function complete() {5583if (_this.config.animation) {5584_this._fixTransition();5585}5586
5587var prevHoverState = _this._hoverState;5588_this._hoverState = null;5589$__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);5590
5591if (prevHoverState === HOVER_STATE_OUT) {5592_this._leave(null, _this);5593}5594};5595
5596if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) {5597var transitionDuration = Util.getTransitionDurationFromElement(this.tip);5598$__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);5599} else {5600complete();5601}5602}5603};5604
5605_proto.hide = function hide(callback) {5606var _this2 = this;5607
5608var tip = this.getTipElement();5609var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);5610
5611var complete = function complete() {5612if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {5613tip.parentNode.removeChild(tip);5614}5615
5616_this2._cleanTipClass();5617
5618_this2.element.removeAttribute('aria-describedby');5619
5620$__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);5621
5622if (_this2._popper !== null) {5623_this2._popper.destroy();5624}5625
5626if (callback) {5627callback();5628}5629};5630
5631$__default["default"](this.element).trigger(hideEvent);5632
5633if (hideEvent.isDefaultPrevented()) {5634return;5635}5636
5637$__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra5638// empty mouseover listeners we added for iOS support5639
5640if ('ontouchstart' in document.documentElement) {5641$__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);5642}5643
5644this._activeTrigger[TRIGGER_CLICK] = false;5645this._activeTrigger[TRIGGER_FOCUS] = false;5646this._activeTrigger[TRIGGER_HOVER] = false;5647
5648if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) {5649var transitionDuration = Util.getTransitionDurationFromElement(tip);5650$__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);5651} else {5652complete();5653}5654
5655this._hoverState = '';5656};5657
5658_proto.update = function update() {5659if (this._popper !== null) {5660this._popper.scheduleUpdate();5661}5662} // Protected5663;5664
5665_proto.isWithContent = function isWithContent() {5666return Boolean(this.getTitle());5667};5668
5669_proto.addAttachmentClass = function addAttachmentClass(attachment) {5670$__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);5671};5672
5673_proto.getTipElement = function getTipElement() {5674this.tip = this.tip || $__default["default"](this.config.template)[0];5675return this.tip;5676};5677
5678_proto.setContent = function setContent() {5679var tip = this.getTipElement();5680this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());5681$__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3);5682};5683
5684_proto.setElementContent = function setElementContent($element, content) {5685if (typeof content === 'object' && (content.nodeType || content.jquery)) {5686// Content is a DOM node or a jQuery5687if (this.config.html) {5688if (!$__default["default"](content).parent().is($element)) {5689$element.empty().append(content);5690}5691} else {5692$element.text($__default["default"](content).text());5693}5694
5695return;5696}5697
5698if (this.config.html) {5699if (this.config.sanitize) {5700content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);5701}5702
5703$element.html(content);5704} else {5705$element.text(content);5706}5707};5708
5709_proto.getTitle = function getTitle() {5710var title = this.element.getAttribute('data-original-title');5711
5712if (!title) {5713title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;5714}5715
5716return title;5717} // Private5718;5719
5720_proto._getPopperConfig = function _getPopperConfig(attachment) {5721var _this3 = this;5722
5723var defaultBsConfig = {5724placement: attachment,5725modifiers: {5726offset: this._getOffset(),5727flip: {5728behavior: this.config.fallbackPlacement5729},5730arrow: {5731element: SELECTOR_ARROW5732},5733preventOverflow: {5734boundariesElement: this.config.boundary5735}5736},5737onCreate: function onCreate(data) {5738if (data.originalPlacement !== data.placement) {5739_this3._handlePopperPlacementChange(data);5740}5741},5742onUpdate: function onUpdate(data) {5743return _this3._handlePopperPlacementChange(data);5744}5745};5746return _extends$1({}, defaultBsConfig, this.config.popperConfig);5747};5748
5749_proto._getOffset = function _getOffset() {5750var _this4 = this;5751
5752var offset = {};5753
5754if (typeof this.config.offset === 'function') {5755offset.fn = function (data) {5756data.offsets = _extends$1({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));5757return data;5758};5759} else {5760offset.offset = this.config.offset;5761}5762
5763return offset;5764};5765
5766_proto._getContainer = function _getContainer() {5767if (this.config.container === false) {5768return document.body;5769}5770
5771if (Util.isElement(this.config.container)) {5772return $__default["default"](this.config.container);5773}5774
5775return $__default["default"](document).find(this.config.container);5776};5777
5778_proto._getAttachment = function _getAttachment(placement) {5779return AttachmentMap[placement.toUpperCase()];5780};5781
5782_proto._setListeners = function _setListeners() {5783var _this5 = this;5784
5785var triggers = this.config.trigger.split(' ');5786triggers.forEach(function (trigger) {5787if (trigger === 'click') {5788$__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {5789return _this5.toggle(event);5790});5791} else if (trigger !== TRIGGER_MANUAL) {5792var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;5793var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;5794$__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {5795return _this5._enter(event);5796}).on(eventOut, _this5.config.selector, function (event) {5797return _this5._leave(event);5798});5799}5800});5801
5802this._hideModalHandler = function () {5803if (_this5.element) {5804_this5.hide();5805}5806};5807
5808$__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);5809
5810if (this.config.selector) {5811this.config = _extends$1({}, this.config, {5812trigger: 'manual',5813selector: ''5814});5815} else {5816this._fixTitle();5817}5818};5819
5820_proto._fixTitle = function _fixTitle() {5821var titleType = typeof this.element.getAttribute('data-original-title');5822
5823if (this.element.getAttribute('title') || titleType !== 'string') {5824this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');5825this.element.setAttribute('title', '');5826}5827};5828
5829_proto._enter = function _enter(event, context) {5830var dataKey = this.constructor.DATA_KEY;5831context = context || $__default["default"](event.currentTarget).data(dataKey);5832
5833if (!context) {5834context = new this.constructor(event.currentTarget, this._getDelegateConfig());5835$__default["default"](event.currentTarget).data(dataKey, context);5836}5837
5838if (event) {5839context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;5840}5841
5842if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {5843context._hoverState = HOVER_STATE_SHOW;5844return;5845}5846
5847clearTimeout(context._timeout);5848context._hoverState = HOVER_STATE_SHOW;5849
5850if (!context.config.delay || !context.config.delay.show) {5851context.show();5852return;5853}5854
5855context._timeout = setTimeout(function () {5856if (context._hoverState === HOVER_STATE_SHOW) {5857context.show();5858}5859}, context.config.delay.show);5860};5861
5862_proto._leave = function _leave(event, context) {5863var dataKey = this.constructor.DATA_KEY;5864context = context || $__default["default"](event.currentTarget).data(dataKey);5865
5866if (!context) {5867context = new this.constructor(event.currentTarget, this._getDelegateConfig());5868$__default["default"](event.currentTarget).data(dataKey, context);5869}5870
5871if (event) {5872context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;5873}5874
5875if (context._isWithActiveTrigger()) {5876return;5877}5878
5879clearTimeout(context._timeout);5880context._hoverState = HOVER_STATE_OUT;5881
5882if (!context.config.delay || !context.config.delay.hide) {5883context.hide();5884return;5885}5886
5887context._timeout = setTimeout(function () {5888if (context._hoverState === HOVER_STATE_OUT) {5889context.hide();5890}5891}, context.config.delay.hide);5892};5893
5894_proto._isWithActiveTrigger = function _isWithActiveTrigger() {5895for (var trigger in this._activeTrigger) {5896if (this._activeTrigger[trigger]) {5897return true;5898}5899}5900
5901return false;5902};5903
5904_proto._getConfig = function _getConfig(config) {5905var dataAttributes = $__default["default"](this.element).data();5906Object.keys(dataAttributes).forEach(function (dataAttr) {5907if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {5908delete dataAttributes[dataAttr];5909}5910});5911config = _extends$1({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});5912
5913if (typeof config.delay === 'number') {5914config.delay = {5915show: config.delay,5916hide: config.delay5917};5918}5919
5920if (typeof config.title === 'number') {5921config.title = config.title.toString();5922}5923
5924if (typeof config.content === 'number') {5925config.content = config.content.toString();5926}5927
5928Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);5929
5930if (config.sanitize) {5931config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);5932}5933
5934return config;5935};5936
5937_proto._getDelegateConfig = function _getDelegateConfig() {5938var config = {};5939
5940if (this.config) {5941for (var key in this.config) {5942if (this.constructor.Default[key] !== this.config[key]) {5943config[key] = this.config[key];5944}5945}5946}5947
5948return config;5949};5950
5951_proto._cleanTipClass = function _cleanTipClass() {5952var $tip = $__default["default"](this.getTipElement());5953var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);5954
5955if (tabClass !== null && tabClass.length) {5956$tip.removeClass(tabClass.join(''));5957}5958};5959
5960_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {5961this.tip = popperData.instance.popper;5962
5963this._cleanTipClass();5964
5965this.addAttachmentClass(this._getAttachment(popperData.placement));5966};5967
5968_proto._fixTransition = function _fixTransition() {5969var tip = this.getTipElement();5970var initConfigAnimation = this.config.animation;5971
5972if (tip.getAttribute('x-placement') !== null) {5973return;5974}5975
5976$__default["default"](tip).removeClass(CLASS_NAME_FADE$3);5977this.config.animation = false;5978this.hide();5979this.show();5980this.config.animation = initConfigAnimation;5981} // Static5982;5983
5984Tooltip._jQueryInterface = function _jQueryInterface(config) {5985return this.each(function () {5986var $element = $__default["default"](this);5987var data = $element.data(DATA_KEY$4);5988
5989var _config = typeof config === 'object' && config;5990
5991if (!data && /dispose|hide/.test(config)) {5992return;5993}5994
5995if (!data) {5996data = new Tooltip(this, _config);5997$element.data(DATA_KEY$4, data);5998}5999
6000if (typeof config === 'string') {6001if (typeof data[config] === 'undefined') {6002throw new TypeError("No method named \"" + config + "\"");6003}6004
6005data[config]();6006}6007});6008};6009
6010_createClass(Tooltip, null, [{6011key: "VERSION",6012get: function get() {6013return VERSION$4;6014}6015}, {6016key: "Default",6017get: function get() {6018return Default$3;6019}6020}, {6021key: "NAME",6022get: function get() {6023return NAME$4;6024}6025}, {6026key: "DATA_KEY",6027get: function get() {6028return DATA_KEY$4;6029}6030}, {6031key: "Event",6032get: function get() {6033return Event$1;6034}6035}, {6036key: "EVENT_KEY",6037get: function get() {6038return EVENT_KEY$4;6039}6040}, {6041key: "DefaultType",6042get: function get() {6043return DefaultType$3;6044}6045}]);6046
6047return Tooltip;6048}();6049/**6050* jQuery
6051*/
6052
6053
6054$__default["default"].fn[NAME$4] = Tooltip._jQueryInterface;6055$__default["default"].fn[NAME$4].Constructor = Tooltip;6056
6057$__default["default"].fn[NAME$4].noConflict = function () {6058$__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4;6059return Tooltip._jQueryInterface;6060};6061
6062/**6063* Constants
6064*/
6065
6066var NAME$3 = 'popover';6067var VERSION$3 = '4.6.1';6068var DATA_KEY$3 = 'bs.popover';6069var EVENT_KEY$3 = "." + DATA_KEY$3;6070var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3];6071var CLASS_PREFIX = 'bs-popover';6072var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');6073var CLASS_NAME_FADE$2 = 'fade';6074var CLASS_NAME_SHOW$2 = 'show';6075var SELECTOR_TITLE = '.popover-header';6076var SELECTOR_CONTENT = '.popover-body';6077
6078var Default$2 = _extends$1({}, Tooltip.Default, {6079placement: 'right',6080trigger: 'click',6081content: '',6082template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'6083});6084
6085var DefaultType$2 = _extends$1({}, Tooltip.DefaultType, {6086content: '(string|element|function)'6087});6088
6089var Event = {6090HIDE: "hide" + EVENT_KEY$3,6091HIDDEN: "hidden" + EVENT_KEY$3,6092SHOW: "show" + EVENT_KEY$3,6093SHOWN: "shown" + EVENT_KEY$3,6094INSERTED: "inserted" + EVENT_KEY$3,6095CLICK: "click" + EVENT_KEY$3,6096FOCUSIN: "focusin" + EVENT_KEY$3,6097FOCUSOUT: "focusout" + EVENT_KEY$3,6098MOUSEENTER: "mouseenter" + EVENT_KEY$3,6099MOUSELEAVE: "mouseleave" + EVENT_KEY$36100};6101/**6102* Class definition
6103*/
6104
6105var Popover = /*#__PURE__*/function (_Tooltip) {6106_inheritsLoose(Popover, _Tooltip);6107
6108function Popover() {6109return _Tooltip.apply(this, arguments) || this;6110}6111
6112var _proto = Popover.prototype;6113
6114// Overrides6115_proto.isWithContent = function isWithContent() {6116return this.getTitle() || this._getContent();6117};6118
6119_proto.addAttachmentClass = function addAttachmentClass(attachment) {6120$__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);6121};6122
6123_proto.getTipElement = function getTipElement() {6124this.tip = this.tip || $__default["default"](this.config.template)[0];6125return this.tip;6126};6127
6128_proto.setContent = function setContent() {6129var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events6130
6131this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());6132
6133var content = this._getContent();6134
6135if (typeof content === 'function') {6136content = content.call(this.element);6137}6138
6139this.setElementContent($tip.find(SELECTOR_CONTENT), content);6140$tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2);6141} // Private6142;6143
6144_proto._getContent = function _getContent() {6145return this.element.getAttribute('data-content') || this.config.content;6146};6147
6148_proto._cleanTipClass = function _cleanTipClass() {6149var $tip = $__default["default"](this.getTipElement());6150var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);6151
6152if (tabClass !== null && tabClass.length > 0) {6153$tip.removeClass(tabClass.join(''));6154}6155} // Static6156;6157
6158Popover._jQueryInterface = function _jQueryInterface(config) {6159return this.each(function () {6160var data = $__default["default"](this).data(DATA_KEY$3);6161
6162var _config = typeof config === 'object' ? config : null;6163
6164if (!data && /dispose|hide/.test(config)) {6165return;6166}6167
6168if (!data) {6169data = new Popover(this, _config);6170$__default["default"](this).data(DATA_KEY$3, data);6171}6172
6173if (typeof config === 'string') {6174if (typeof data[config] === 'undefined') {6175throw new TypeError("No method named \"" + config + "\"");6176}6177
6178data[config]();6179}6180});6181};6182
6183_createClass(Popover, null, [{6184key: "VERSION",6185get: // Getters6186function get() {6187return VERSION$3;6188}6189}, {6190key: "Default",6191get: function get() {6192return Default$2;6193}6194}, {6195key: "NAME",6196get: function get() {6197return NAME$3;6198}6199}, {6200key: "DATA_KEY",6201get: function get() {6202return DATA_KEY$3;6203}6204}, {6205key: "Event",6206get: function get() {6207return Event;6208}6209}, {6210key: "EVENT_KEY",6211get: function get() {6212return EVENT_KEY$3;6213}6214}, {6215key: "DefaultType",6216get: function get() {6217return DefaultType$2;6218}6219}]);6220
6221return Popover;6222}(Tooltip);6223/**6224* jQuery
6225*/
6226
6227
6228$__default["default"].fn[NAME$3] = Popover._jQueryInterface;6229$__default["default"].fn[NAME$3].Constructor = Popover;6230
6231$__default["default"].fn[NAME$3].noConflict = function () {6232$__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3;6233return Popover._jQueryInterface;6234};6235
6236/**6237* Constants
6238*/
6239
6240var NAME$2 = 'scrollspy';6241var VERSION$2 = '4.6.1';6242var DATA_KEY$2 = 'bs.scrollspy';6243var EVENT_KEY$2 = "." + DATA_KEY$2;6244var DATA_API_KEY$1 = '.data-api';6245var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2];6246var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';6247var CLASS_NAME_ACTIVE$1 = 'active';6248var EVENT_ACTIVATE = "activate" + EVENT_KEY$2;6249var EVENT_SCROLL = "scroll" + EVENT_KEY$2;6250var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1;6251var METHOD_OFFSET = 'offset';6252var METHOD_POSITION = 'position';6253var SELECTOR_DATA_SPY = '[data-spy="scroll"]';6254var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';6255var SELECTOR_NAV_LINKS = '.nav-link';6256var SELECTOR_NAV_ITEMS = '.nav-item';6257var SELECTOR_LIST_ITEMS = '.list-group-item';6258var SELECTOR_DROPDOWN$1 = '.dropdown';6259var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';6260var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';6261var Default$1 = {6262offset: 10,6263method: 'auto',6264target: ''6265};6266var DefaultType$1 = {6267offset: 'number',6268method: 'string',6269target: '(string|element)'6270};6271/**6272* Class definition
6273*/
6274
6275var ScrollSpy = /*#__PURE__*/function () {6276function ScrollSpy(element, config) {6277var _this = this;6278
6279this._element = element;6280this._scrollElement = element.tagName === 'BODY' ? window : element;6281this._config = this._getConfig(config);6282this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);6283this._offsets = [];6284this._targets = [];6285this._activeTarget = null;6286this._scrollHeight = 0;6287$__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) {6288return _this._process(event);6289});6290this.refresh();6291
6292this._process();6293} // Getters6294
6295
6296var _proto = ScrollSpy.prototype;6297
6298// Public6299_proto.refresh = function refresh() {6300var _this2 = this;6301
6302var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;6303var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;6304var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;6305this._offsets = [];6306this._targets = [];6307this._scrollHeight = this._getScrollHeight();6308var targets = [].slice.call(document.querySelectorAll(this._selector));6309targets.map(function (element) {6310var target;6311var targetSelector = Util.getSelectorFromElement(element);6312
6313if (targetSelector) {6314target = document.querySelector(targetSelector);6315}6316
6317if (target) {6318var targetBCR = target.getBoundingClientRect();6319
6320if (targetBCR.width || targetBCR.height) {6321// TODO (fat): remove sketch reliance on jQuery position/offset6322return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector];6323}6324}6325
6326return null;6327}).filter(function (item) {6328return item;6329}).sort(function (a, b) {6330return a[0] - b[0];6331}).forEach(function (item) {6332_this2._offsets.push(item[0]);6333
6334_this2._targets.push(item[1]);6335});6336};6337
6338_proto.dispose = function dispose() {6339$__default["default"].removeData(this._element, DATA_KEY$2);6340$__default["default"](this._scrollElement).off(EVENT_KEY$2);6341this._element = null;6342this._scrollElement = null;6343this._config = null;6344this._selector = null;6345this._offsets = null;6346this._targets = null;6347this._activeTarget = null;6348this._scrollHeight = null;6349} // Private6350;6351
6352_proto._getConfig = function _getConfig(config) {6353config = _extends$1({}, Default$1, typeof config === 'object' && config ? config : {});6354
6355if (typeof config.target !== 'string' && Util.isElement(config.target)) {6356var id = $__default["default"](config.target).attr('id');6357
6358if (!id) {6359id = Util.getUID(NAME$2);6360$__default["default"](config.target).attr('id', id);6361}6362
6363config.target = "#" + id;6364}6365
6366Util.typeCheckConfig(NAME$2, config, DefaultType$1);6367return config;6368};6369
6370_proto._getScrollTop = function _getScrollTop() {6371return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;6372};6373
6374_proto._getScrollHeight = function _getScrollHeight() {6375return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);6376};6377
6378_proto._getOffsetHeight = function _getOffsetHeight() {6379return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;6380};6381
6382_proto._process = function _process() {6383var scrollTop = this._getScrollTop() + this._config.offset;6384
6385var scrollHeight = this._getScrollHeight();6386
6387var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();6388
6389if (this._scrollHeight !== scrollHeight) {6390this.refresh();6391}6392
6393if (scrollTop >= maxScroll) {6394var target = this._targets[this._targets.length - 1];6395
6396if (this._activeTarget !== target) {6397this._activate(target);6398}6399
6400return;6401}6402
6403if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {6404this._activeTarget = null;6405
6406this._clear();6407
6408return;6409}6410
6411for (var i = this._offsets.length; i--;) {6412var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);6413
6414if (isActiveTarget) {6415this._activate(this._targets[i]);6416}6417}6418};6419
6420_proto._activate = function _activate(target) {6421this._activeTarget = target;6422
6423this._clear();6424
6425var queries = this._selector.split(',').map(function (selector) {6426return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";6427});6428
6429var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(','))));6430
6431if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {6432$link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1);6433$link.addClass(CLASS_NAME_ACTIVE$1);6434} else {6435// Set triggered link as active6436$link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active6437// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor6438
6439$link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item6440
6441$link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1);6442}6443
6444$__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, {6445relatedTarget: target6446});6447};6448
6449_proto._clear = function _clear() {6450[].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {6451return node.classList.contains(CLASS_NAME_ACTIVE$1);6452}).forEach(function (node) {6453return node.classList.remove(CLASS_NAME_ACTIVE$1);6454});6455} // Static6456;6457
6458ScrollSpy._jQueryInterface = function _jQueryInterface(config) {6459return this.each(function () {6460var data = $__default["default"](this).data(DATA_KEY$2);6461
6462var _config = typeof config === 'object' && config;6463
6464if (!data) {6465data = new ScrollSpy(this, _config);6466$__default["default"](this).data(DATA_KEY$2, data);6467}6468
6469if (typeof config === 'string') {6470if (typeof data[config] === 'undefined') {6471throw new TypeError("No method named \"" + config + "\"");6472}6473
6474data[config]();6475}6476});6477};6478
6479_createClass(ScrollSpy, null, [{6480key: "VERSION",6481get: function get() {6482return VERSION$2;6483}6484}, {6485key: "Default",6486get: function get() {6487return Default$1;6488}6489}]);6490
6491return ScrollSpy;6492}();6493/**6494* Data API implementation
6495*/
6496
6497
6498$__default["default"](window).on(EVENT_LOAD_DATA_API, function () {6499var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));6500var scrollSpysLength = scrollSpys.length;6501
6502for (var i = scrollSpysLength; i--;) {6503var $spy = $__default["default"](scrollSpys[i]);6504
6505ScrollSpy._jQueryInterface.call($spy, $spy.data());6506}6507});6508/**6509* jQuery
6510*/
6511
6512$__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface;6513$__default["default"].fn[NAME$2].Constructor = ScrollSpy;6514
6515$__default["default"].fn[NAME$2].noConflict = function () {6516$__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2;6517return ScrollSpy._jQueryInterface;6518};6519
6520/**6521* Constants
6522*/
6523
6524var NAME$1 = 'tab';6525var VERSION$1 = '4.6.1';6526var DATA_KEY$1 = 'bs.tab';6527var EVENT_KEY$1 = "." + DATA_KEY$1;6528var DATA_API_KEY = '.data-api';6529var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1];6530var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';6531var CLASS_NAME_ACTIVE = 'active';6532var CLASS_NAME_DISABLED = 'disabled';6533var CLASS_NAME_FADE$1 = 'fade';6534var CLASS_NAME_SHOW$1 = 'show';6535var EVENT_HIDE$1 = "hide" + EVENT_KEY$1;6536var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1;6537var EVENT_SHOW$1 = "show" + EVENT_KEY$1;6538var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1;6539var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY;6540var SELECTOR_DROPDOWN = '.dropdown';6541var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';6542var SELECTOR_ACTIVE = '.active';6543var SELECTOR_ACTIVE_UL = '> li > .active';6544var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';6545var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';6546var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';6547/**6548* Class definition
6549*/
6550
6551var Tab = /*#__PURE__*/function () {6552function Tab(element) {6553this._element = element;6554} // Getters6555
6556
6557var _proto = Tab.prototype;6558
6559// Public6560_proto.show = function show() {6561var _this = this;6562
6563if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED)) {6564return;6565}6566
6567var target;6568var previous;6569var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];6570var selector = Util.getSelectorFromElement(this._element);6571
6572if (listElement) {6573var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;6574previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector));6575previous = previous[previous.length - 1];6576}6577
6578var hideEvent = $__default["default"].Event(EVENT_HIDE$1, {6579relatedTarget: this._element6580});6581var showEvent = $__default["default"].Event(EVENT_SHOW$1, {6582relatedTarget: previous6583});6584
6585if (previous) {6586$__default["default"](previous).trigger(hideEvent);6587}6588
6589$__default["default"](this._element).trigger(showEvent);6590
6591if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {6592return;6593}6594
6595if (selector) {6596target = document.querySelector(selector);6597}6598
6599this._activate(this._element, listElement);6600
6601var complete = function complete() {6602var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, {6603relatedTarget: _this._element6604});6605var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, {6606relatedTarget: previous6607});6608$__default["default"](previous).trigger(hiddenEvent);6609$__default["default"](_this._element).trigger(shownEvent);6610};6611
6612if (target) {6613this._activate(target, target.parentNode, complete);6614} else {6615complete();6616}6617};6618
6619_proto.dispose = function dispose() {6620$__default["default"].removeData(this._element, DATA_KEY$1);6621this._element = null;6622} // Private6623;6624
6625_proto._activate = function _activate(element, container, callback) {6626var _this2 = this;6627
6628var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE);6629var active = activeElements[0];6630var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1);6631
6632var complete = function complete() {6633return _this2._transitionComplete(element, active, callback);6634};6635
6636if (active && isTransitioning) {6637var transitionDuration = Util.getTransitionDurationFromElement(active);6638$__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);6639} else {6640complete();6641}6642};6643
6644_proto._transitionComplete = function _transitionComplete(element, active, callback) {6645if (active) {6646$__default["default"](active).removeClass(CLASS_NAME_ACTIVE);6647var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];6648
6649if (dropdownChild) {6650$__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE);6651}6652
6653if (active.getAttribute('role') === 'tab') {6654active.setAttribute('aria-selected', false);6655}6656}6657
6658$__default["default"](element).addClass(CLASS_NAME_ACTIVE);6659
6660if (element.getAttribute('role') === 'tab') {6661element.setAttribute('aria-selected', true);6662}6663
6664Util.reflow(element);6665
6666if (element.classList.contains(CLASS_NAME_FADE$1)) {6667element.classList.add(CLASS_NAME_SHOW$1);6668}6669
6670var parent = element.parentNode;6671
6672if (parent && parent.nodeName === 'LI') {6673parent = parent.parentNode;6674}6675
6676if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {6677var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0];6678
6679if (dropdownElement) {6680var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));6681$__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);6682}6683
6684element.setAttribute('aria-expanded', true);6685}6686
6687if (callback) {6688callback();6689}6690} // Static6691;6692
6693Tab._jQueryInterface = function _jQueryInterface(config) {6694return this.each(function () {6695var $this = $__default["default"](this);6696var data = $this.data(DATA_KEY$1);6697
6698if (!data) {6699data = new Tab(this);6700$this.data(DATA_KEY$1, data);6701}6702
6703if (typeof config === 'string') {6704if (typeof data[config] === 'undefined') {6705throw new TypeError("No method named \"" + config + "\"");6706}6707
6708data[config]();6709}6710});6711};6712
6713_createClass(Tab, null, [{6714key: "VERSION",6715get: function get() {6716return VERSION$1;6717}6718}]);6719
6720return Tab;6721}();6722/**6723* Data API implementation
6724*/
6725
6726
6727$__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {6728event.preventDefault();6729
6730Tab._jQueryInterface.call($__default["default"](this), 'show');6731});6732/**6733* jQuery
6734*/
6735
6736$__default["default"].fn[NAME$1] = Tab._jQueryInterface;6737$__default["default"].fn[NAME$1].Constructor = Tab;6738
6739$__default["default"].fn[NAME$1].noConflict = function () {6740$__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1;6741return Tab._jQueryInterface;6742};6743
6744/**6745* Constants
6746*/
6747
6748var NAME = 'toast';6749var VERSION = '4.6.1';6750var DATA_KEY = 'bs.toast';6751var EVENT_KEY = "." + DATA_KEY;6752var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];6753var CLASS_NAME_FADE = 'fade';6754var CLASS_NAME_HIDE = 'hide';6755var CLASS_NAME_SHOW = 'show';6756var CLASS_NAME_SHOWING = 'showing';6757var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;6758var EVENT_HIDE = "hide" + EVENT_KEY;6759var EVENT_HIDDEN = "hidden" + EVENT_KEY;6760var EVENT_SHOW = "show" + EVENT_KEY;6761var EVENT_SHOWN = "shown" + EVENT_KEY;6762var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';6763var Default = {6764animation: true,6765autohide: true,6766delay: 5006767};6768var DefaultType = {6769animation: 'boolean',6770autohide: 'boolean',6771delay: 'number'6772};6773/**6774* Class definition
6775*/
6776
6777var Toast = /*#__PURE__*/function () {6778function Toast(element, config) {6779this._element = element;6780this._config = this._getConfig(config);6781this._timeout = null;6782
6783this._setListeners();6784} // Getters6785
6786
6787var _proto = Toast.prototype;6788
6789// Public6790_proto.show = function show() {6791var _this = this;6792
6793var showEvent = $__default["default"].Event(EVENT_SHOW);6794$__default["default"](this._element).trigger(showEvent);6795
6796if (showEvent.isDefaultPrevented()) {6797return;6798}6799
6800this._clearTimeout();6801
6802if (this._config.animation) {6803this._element.classList.add(CLASS_NAME_FADE);6804}6805
6806var complete = function complete() {6807_this._element.classList.remove(CLASS_NAME_SHOWING);6808
6809_this._element.classList.add(CLASS_NAME_SHOW);6810
6811$__default["default"](_this._element).trigger(EVENT_SHOWN);6812
6813if (_this._config.autohide) {6814_this._timeout = setTimeout(function () {6815_this.hide();6816}, _this._config.delay);6817}6818};6819
6820this._element.classList.remove(CLASS_NAME_HIDE);6821
6822Util.reflow(this._element);6823
6824this._element.classList.add(CLASS_NAME_SHOWING);6825
6826if (this._config.animation) {6827var transitionDuration = Util.getTransitionDurationFromElement(this._element);6828$__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);6829} else {6830complete();6831}6832};6833
6834_proto.hide = function hide() {6835if (!this._element.classList.contains(CLASS_NAME_SHOW)) {6836return;6837}6838
6839var hideEvent = $__default["default"].Event(EVENT_HIDE);6840$__default["default"](this._element).trigger(hideEvent);6841
6842if (hideEvent.isDefaultPrevented()) {6843return;6844}6845
6846this._close();6847};6848
6849_proto.dispose = function dispose() {6850this._clearTimeout();6851
6852if (this._element.classList.contains(CLASS_NAME_SHOW)) {6853this._element.classList.remove(CLASS_NAME_SHOW);6854}6855
6856$__default["default"](this._element).off(EVENT_CLICK_DISMISS);6857$__default["default"].removeData(this._element, DATA_KEY);6858this._element = null;6859this._config = null;6860} // Private6861;6862
6863_proto._getConfig = function _getConfig(config) {6864config = _extends$1({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {});6865Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);6866return config;6867};6868
6869_proto._setListeners = function _setListeners() {6870var _this2 = this;6871
6872$__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {6873return _this2.hide();6874});6875};6876
6877_proto._close = function _close() {6878var _this3 = this;6879
6880var complete = function complete() {6881_this3._element.classList.add(CLASS_NAME_HIDE);6882
6883$__default["default"](_this3._element).trigger(EVENT_HIDDEN);6884};6885
6886this._element.classList.remove(CLASS_NAME_SHOW);6887
6888if (this._config.animation) {6889var transitionDuration = Util.getTransitionDurationFromElement(this._element);6890$__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);6891} else {6892complete();6893}6894};6895
6896_proto._clearTimeout = function _clearTimeout() {6897clearTimeout(this._timeout);6898this._timeout = null;6899} // Static6900;6901
6902Toast._jQueryInterface = function _jQueryInterface(config) {6903return this.each(function () {6904var $element = $__default["default"](this);6905var data = $element.data(DATA_KEY);6906
6907var _config = typeof config === 'object' && config;6908
6909if (!data) {6910data = new Toast(this, _config);6911$element.data(DATA_KEY, data);6912}6913
6914if (typeof config === 'string') {6915if (typeof data[config] === 'undefined') {6916throw new TypeError("No method named \"" + config + "\"");6917}6918
6919data[config](this);6920}6921});6922};6923
6924_createClass(Toast, null, [{6925key: "VERSION",6926get: function get() {6927return VERSION;6928}6929}, {6930key: "DefaultType",6931get: function get() {6932return DefaultType;6933}6934}, {6935key: "Default",6936get: function get() {6937return Default;6938}6939}]);6940
6941return Toast;6942}();6943/**6944* jQuery
6945*/
6946
6947
6948$__default["default"].fn[NAME] = Toast._jQueryInterface;6949$__default["default"].fn[NAME].Constructor = Toast;6950
6951$__default["default"].fn[NAME].noConflict = function () {6952$__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;6953return Toast._jQueryInterface;6954};6955
6956exports.Alert = Alert;6957exports.Button = Button;6958exports.Carousel = Carousel;6959exports.Collapse = Collapse;6960exports.Dropdown = Dropdown;6961exports.Modal = Modal;6962exports.Popover = Popover;6963exports.Scrollspy = ScrollSpy;6964exports.Tab = Tab;6965exports.Toast = Toast;6966exports.Tooltip = Tooltip;6967exports.Util = Util;6968
6969Object.defineProperty(exports, '__esModule', { value: true });6970
6971}));6972//# sourceMappingURL=bootstrap.bundle.js.map
6973