1/*! 2 * Bootstrap v4.3.1 (https://getbootstrap.com/) 3 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 */ 6(function (global, factory) { 7 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('popper.js')) : 8 typeof define === 'function' && define.amd ? define(['popper.js'], factory) : 9 (global = global || self, global.bootstrap = factory(global.Popper)); 10}(this, function (Popper) { 'use strict'; 11 12 Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 13 14 function _defineProperties(target, props) { 15 for (var i = 0; i < props.length; i++) { 16 var descriptor = props[i]; 17 descriptor.enumerable = descriptor.enumerable || false; 18 descriptor.configurable = true; 19 if ("value" in descriptor) descriptor.writable = true; 20 Object.defineProperty(target, descriptor.key, descriptor); 21 } 22 } 23 24 function _createClass(Constructor, protoProps, staticProps) { 25 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 26 if (staticProps) _defineProperties(Constructor, staticProps); 27 return Constructor; 28 } 29 30 function _defineProperty(obj, key, value) { 31 if (key in obj) { 32 Object.defineProperty(obj, key, { 33 value: value, 34 enumerable: true, 35 configurable: true, 36 writable: true 37 }); 38 } else { 39 obj[key] = value; 40 } 41 42 return obj; 43 } 44 45 function _objectSpread(target) { 46 for (var i = 1; i < arguments.length; i++) { 47 var source = arguments[i] != null ? arguments[i] : {}; 48 var ownKeys = Object.keys(source); 49 50 if (typeof Object.getOwnPropertySymbols === 'function') { 51 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 52 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 53 })); 54 } 55 56 ownKeys.forEach(function (key) { 57 _defineProperty(target, key, source[key]); 58 }); 59 } 60 61 return target; 62 } 63 64 function _inheritsLoose(subClass, superClass) { 65 subClass.prototype = Object.create(superClass.prototype); 66 subClass.prototype.constructor = subClass; 67 subClass.__proto__ = superClass; 68 } 69 70 /** 71 * -------------------------------------------------------------------------- 72 * Bootstrap (v4.3.1): util/index.js 73 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 74 * -------------------------------------------------------------------------- 75 */ 76 var MAX_UID = 1000000; 77 var MILLISECONDS_MULTIPLIER = 1000; 78 var TRANSITION_END = 'transitionend'; 79 var _window = window, 80 jQuery = _window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 81 82 var toType = function toType(obj) { 83 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 84 }; 85 /** 86 * -------------------------------------------------------------------------- 87 * Public Util Api 88 * -------------------------------------------------------------------------- 89 */ 90 91 92 var getUID = function getUID(prefix) { 93 do { 94 // eslint-disable-next-line no-bitwise 95 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 96 } while (document.getElementById(prefix)); 97 98 return prefix; 99 }; 100 101 var getSelectorFromElement = function getSelectorFromElement(element) { 102 var selector = element.getAttribute('data-target'); 103 104 if (!selector || selector === '#') { 105 var hrefAttr = element.getAttribute('href'); 106 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 107 } 108 109 try { 110 return document.querySelector(selector) ? selector : null; 111 } catch (error) { 112 return null; 113 } 114 }; 115 116 var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) { 117 if (!element) { 118 return 0; 119 } // Get transition-duration of the element 120 121 122 var _window$getComputedSt = window.getComputedStyle(element), 123 transitionDuration = _window$getComputedSt.transitionDuration, 124 transitionDelay = _window$getComputedSt.transitionDelay; 125 126 var floatTransitionDuration = parseFloat(transitionDuration); 127 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 128 129 if (!floatTransitionDuration && !floatTransitionDelay) { 130 return 0; 131 } // If multiple durations are defined, take the first 132 133 134 transitionDuration = transitionDuration.split(',')[0]; 135 transitionDelay = transitionDelay.split(',')[0]; 136 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 137 }; 138 139 var triggerTransitionEnd = function triggerTransitionEnd(element) { 140 var evt = document.createEvent('HTMLEvents'); 141 evt.initEvent(TRANSITION_END, true, true); 142 element.dispatchEvent(evt); 143 }; 144 145 var isElement = function isElement(obj) { 146 return (obj[0] || obj).nodeType; 147 }; 148 149 var emulateTransitionEnd = function emulateTransitionEnd(element, duration) { 150 var called = false;
151 var durationPadding = 5; 152 var emulatedDuration = duration + durationPadding; 153 154 function listener() { 155 called = true; 156 element.removeEventListener(TRANSITION_END, listener); 157 } 158 159 element.addEventListener(TRANSITION_END, listener); 160 setTimeout(function () { 161 if (!called) { 162 triggerTransitionEnd(element); 163 } 164 }, emulatedDuration); 165 }; 166 167 var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) { 168 Object.keys(configTypes).forEach(function (property) { 169 var expectedTypes = configTypes[property]; 170 var value = config[property]; 171 var valueType = value && isElement(value) ? 'element' : toType(value); 172 173 if (!new RegExp(expectedTypes).test(valueType)) { 174 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 175 } 176 }); 177 }; 178 179 var makeArray = function makeArray(nodeList) { 180 if (!nodeList) { 181 return []; 182 } 183 184 return [].slice.call(nodeList); 185 }; 186 187 var isVisible = function isVisible(element) { 188 if (!element) { 189 return false; 190 } 191 192 if (element.style && element.parentNode && element.parentNode.style) { 193 return element.style.display !== 'none' && element.parentNode.style.display !== 'none' && element.style.visibility !== 'hidden'; 194 } 195 196 return false; 197 }; 198 199 var findShadowRoot = function findShadowRoot(element) { 200 if (!document.documentElement.attachShadow) { 201 return null; 202 } // Can find the shadow root otherwise it'll return the document 203 204 205 if (typeof element.getRootNode === 'function') { 206 var root = element.getRootNode(); 207 return root instanceof ShadowRoot ? root : null; 208 } 209 210 if (element instanceof ShadowRoot) { 211 return element; 212 } // when we don't find a shadow root 213 214 215 if (!element.parentNode) { 216 return null; 217 } 218 219 return findShadowRoot(element.parentNode); 220 }; // eslint-disable-next-line no-empty-function 221 222 223 var noop = function noop() { 224 return function () {}; 225 }; 226 227 var reflow = function reflow(element) { 228 return element.offsetHeight; 229 }; 230 231 /** 232 * -------------------------------------------------------------------------- 233 * Bootstrap (v4.3.1): dom/data.js 234 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 235 * -------------------------------------------------------------------------- 236 */ 237 238 /** 239 * ------------------------------------------------------------------------ 240 * Constants 241 * ------------------------------------------------------------------------ 242 */ 243 var mapData = function () { 244 var storeData = {}; 245 var id = 1; 246 return { 247 set: function set(element, key, data) { 248 if (typeof element.key === 'undefined') { 249 element.key = { 250 key: key, 251 id: id 252 }; 253 id++; 254 } 255 256 storeData[element.key.id] = data; 257 }, 258 get: function get(element, key) { 259 if (!element || typeof element.key === 'undefined') { 260 return null; 261 } 262 263 var keyProperties = element.key; 264 265 if (keyProperties.key === key) { 266 return storeData[keyProperties.id]; 267 } 268 269 return null; 270 }, 271 delete: function _delete(element, key) { 272 if (typeof element.key === 'undefined') { 273 return; 274 } 275 276 var keyProperties = element.key; 277 278 if (keyProperties.key === key) { 279 delete storeData[keyProperties.id]; 280 delete element.key; 281 } 282 } 283 }; 284 }(); 285 286 var Data = { 287 setData: function setData(instance, key, data) { 288 mapData.set(instance, key, data); 289 }, 290 getData: function getData(instance, key) { 291 return mapData.get(instance, key); 292 }, 293 removeData: function removeData(instance, key) { 294 mapData.delete(instance, key); 295 } 296 }; 297 298 /* istanbul ignore file */ 299 var _Element$prototype = Element.prototype, 300 matches = _Element$prototype.matches, 301 closest = _Element$prototype.closest; 302 var find = Element.prototype.querySelectorAll; 303 var findOne = Element.prototype.querySelector; 304 305 var createCustomEvent = function createCustomEvent(eventName, params) { 306 var cEvent = new CustomEvent(eventName, params); 307 return cEvent; 308 }; 309 310 if (typeof window.CustomEvent !== 'function') { 311 createCustomEvent = function createCustomEvent(eventName, params) { 312 params = params || { 313 bubbles: false, 314 cancelable: false, 315 detail: null 316 }; 317 var evt = document.createEvent('CustomEvent'); 318 evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail); 319 return evt; 320 }; 321 } 322 323 var workingDefaultPrevented = function () { 324 var e = document.createEvent('CustomEvent'); 325 e.initEvent('Bootstrap', true, true); 326 e.preventDefault(); 327 return e.defaultPrevented; 328 }(); 329 330 if (!workingDefaultPrevented) { 331 var origPreventDefault = Event.prototype.preventDefault; 332 333 Event.prototype.preventDefault = function () { 334 if (!this.cancelable) { 335 return; 336 } 337 338 origPreventDefault.call(this); 339 Object.defineProperty(this, 'defaultPrevented', { 340 get: function get() { 341 return true; 342 }, 343 configurable: true 344 }); 345 }; 346 } // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached 347 348
349 var defaultPreventedPreservedOnDispatch = function () { 350 var e = createCustomEvent('Bootstrap', { 351 cancelable: true 352 }); 353 var element = document.createElement('div'); 354 element.addEventListener('Bootstrap', function () { 355 return null; 356 }); 357 e.preventDefault(); 358 element.dispatchEvent(e); 359 return e.defaultPrevented; 360 }(); 361 362 if (!matches) { 363 matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 364 } 365 366 if (!closest) { 367 closest = function closest(selector) { 368 var element = this; 369 370 do { 371 if (matches.call(element, selector)) { 372 return element; 373 } 374 375 element = element.parentElement || element.parentNode; 376 } while (element !== null && element.nodeType === 1); 377 378 return null; 379 }; 380 } 381 382 var scopeSelectorRegex = /:scope\b/; 383 384 var supportScopeQuery = function () { 385 var element = document.createElement('div'); 386 387 try { 388 element.querySelectorAll(':scope *'); 389 } catch (error) { 390 return false; 391 } 392 393 return true; 394 }(); 395 396 if (!supportScopeQuery) { 397 find = function find(selector) { 398 if (!scopeSelectorRegex.test(selector)) { 399 return this.querySelectorAll(selector); 400 } 401 402 var hasId = Boolean(this.id); 403 404 if (!hasId) { 405 this.id = getUID('scope'); 406 } 407 408 var nodeList = null; 409 410 try { 411 selector = selector.replace(scopeSelectorRegex, "#" + this.id); 412 nodeList = this.querySelectorAll(selector); 413 } finally { 414 if (!hasId) { 415 this.removeAttribute('id'); 416 } 417 } 418 419 return nodeList; 420 }; 421 422 findOne = function findOne(selector) { 423 if (!scopeSelectorRegex.test(selector)) { 424 return this.querySelector(selector); 425 } 426 427 var matches = find.call(this, selector); 428 429 if (typeof matches[0] !== 'undefined') { 430 return matches[0]; 431 } 432 433 return null; 434 }; 435 } 436 437 /** 438 * -------------------------------------------------------------------------- 439 * Bootstrap (v4.3.1): dom/event-handler.js 440 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 441 * -------------------------------------------------------------------------- 442 */ 443 /** 444 * ------------------------------------------------------------------------ 445 * Constants 446 * ------------------------------------------------------------------------ 447 */ 448 449 var namespaceRegex = /[^.]*(?=\..*)\.|.*/; 450 var stripNameRegex = /\..*/; 451 var keyEventRegex = /^key/; 452 var stripUidRegex = /::\d+$/; 453 var eventRegistry = {}; // Events storage 454 455 var uidEvent = 1; 456 var customEvents = { 457 mouseenter: 'mouseover', 458 mouseleave: 'mouseout' 459 }; 460 var nativeEvents = ['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']; 461 /** 462 * ------------------------------------------------------------------------ 463 * Private methods 464 * ------------------------------------------------------------------------ 465 */ 466 467 function getUidEvent(element, uid) { 468 return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++; 469 } 470 471 function getEvent(element) { 472 var uid = getUidEvent(element); 473 element.uidEvent = uid; 474 eventRegistry[uid] = eventRegistry[uid] || {}; 475 return eventRegistry[uid]; 476 } 477 478 function fixEvent(event, element) { 479 // Add which for key events 480 if (event.which === null && keyEventRegex.test(event.type)) { 481 event.which = event.charCode === null ? event.keyCode : event.charCode; 482 } 483 484 event.delegateTarget = element; 485 } 486 487 function bootstrapHandler(element, fn) { 488 return function handler(event) { 489 fixEvent(event, element); 490 491 if (handler.oneOff) { 492 EventHandler.off(element, event.type, fn); 493 } 494 495 return fn.apply(element, [event]); 496 }; 497 } 498 499 function bootstrapDelegationHandler(element, selector, fn) { 500 return function handler(event) { 501 var domElements = element.querySelectorAll(selector); 502 503 for (var target = event.target; target && target !== this; target = target.parentNode) { 504 for (var i = domElements.length; i--;) { 505 if (domElements[i] === target) { 506 fixEvent(event, target); 507 508 if (handler.oneOff) { 509 EventHandler.off(element, event.type, fn); 510 } 511 512 return fn.apply(target, [event]); 513 } 514 } 515 } // To please ESLint 516 517 518 return null; 519 }; 520 } 521 522 function findHandler(events, handler, delegationSelector) { 523 if (delegationSelector === void 0) { 524 delegationSelector = null; 525 } 526 527 for (var _i = 0, _Object$keys = Object.keys(events); _i < _Object$keys.length; _i++) { 528 var uid = _Object$keys[_i]; 529 var event = events[uid]; 530 531 if (event.originalHandler === handler && event.delegationSelector === delegationSelector) { 532 return events[uid]; 533 } 534 } 535 536 return null; 537 } 538 539 function normalizeParams(originalTypeEvent, handler, delegationFn) { 540 var delegation = typeof handler === 'string'; 541 var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click') 542 543 var typeEvent = originalTypeEvent.replace(stripNameRegex, ''); 544 var custom = customEvents[typeEvent]; 545 546 if (custom) { 547 typeEvent = custom; 548 } 549 550 var isNative = nativeEvents.indexOf(typeEvent) > -1; 551 552 if (!isNative) { 553 typeEvent = originalTypeEvent; 554 } 555 556 return [delegation, originalHandler, typeEvent]; 557 } 558 559 function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) { 560 if (typeof originalTypeEvent !== 'string' || !element) { 561 return; 562 } 563 564 if (!handler) { 565 handler = delegationFn; 566 delegationFn = null; 567 } 568 569 var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn), 570 delegation = _normalizeParams[0], 571 originalHandler = _normalizeParams[1], 572 typeEvent = _normalizeParams[2]; 573 574 var events = getEvent(element); 575 var handlers = events[typeEvent] || (events[typeEvent] = {}); 576 var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null); 577 578 if (previousFn) { 579 previousFn.oneOff = previousFn.oneOff && oneOff; 580 return; 581 } 582 583 var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, '')); 584 var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler); 585 fn.delegationSelector = delegation ? handler : null; 586 fn.originalHandler = originalHandler; 587 fn.oneOff = oneOff; 588 fn.uidEvent = uid; 589 handlers[uid] = fn; 590 element.addEventListener(typeEvent, fn, delegation); 591 } 592 593 function removeHandler(element, events, typeEvent, handler, delegationSelector) { 594 var fn = findHandler(events[typeEvent], handler, delegationSelector); 595 596 if (fn === null) { 597 return; 598 } 599 600 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); 601 delete events[typeEvent][fn.uidEvent]; 602 } 603 604 function removeNamespacedHandlers(element, events, typeEvent, namespace) { 605 var storeElementEvent = events[typeEvent] || {};
606 Object.keys(storeElementEvent).forEach(function (handlerKey) { 607 if (handlerKey.indexOf(namespace) > -1) { 608 var event = storeElementEvent[handlerKey]; 609 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); 610 } 611 }); 612 } 613 614 var EventHandler = { 615 on: function on(element, event, handler, delegationFn) { 616 addHandler(element, event, handler, delegationFn, false); 617 }, 618 one: function one(element, event, handler, delegationFn) { 619 addHandler(element, event, handler, delegationFn, true); 620 }, 621 off: function off(element, originalTypeEvent, handler, delegationFn) { 622 if (typeof originalTypeEvent !== 'string' || !element) { 623 return; 624 } 625 626 var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn), 627 delegation = _normalizeParams2[0], 628 originalHandler = _normalizeParams2[1], 629 typeEvent = _normalizeParams2[2]; 630 631 var inNamespace = typeEvent !== originalTypeEvent; 632 var events = getEvent(element); 633 var isNamespace = originalTypeEvent.charAt(0) === '.'; 634 635 if (typeof originalHandler !== 'undefined') { 636 // Simplest case: handler is passed, remove that listener ONLY. 637 if (!events || !events[typeEvent]) { 638 return; 639 } 640 641 removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null); 642 return; 643 } 644 645 if (isNamespace) { 646 Object.keys(events).forEach(function (elementEvent) { 647 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.substr(1)); 648 }); 649 } 650 651 var storeElementEvent = events[typeEvent] || {}; 652 Object.keys(storeElementEvent).forEach(function (keyHandlers) { 653 var handlerKey = keyHandlers.replace(stripUidRegex, ''); 654 655 if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) { 656 var event = storeElementEvent[keyHandlers]; 657 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); 658 } 659 }); 660 }, 661 trigger: function trigger(element, event, args) { 662 if (typeof event !== 'string' || !element) { 663 return null; 664 } 665 666 var typeEvent = event.replace(stripNameRegex, ''); 667 var inNamespace = event !== typeEvent; 668 var isNative = nativeEvents.indexOf(typeEvent) > -1; 669 var jQueryEvent; 670 var bubbles = true; 671 var nativeDispatch = true; 672 var defaultPrevented = false; 673 var evt = null; 674 675 if (inNamespace && typeof jQuery !== 'undefined') { 676 jQueryEvent = jQuery.Event(event, args); 677 jQuery(element).trigger(jQueryEvent); 678 bubbles = !jQueryEvent.isPropagationStopped(); 679 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); 680 defaultPrevented = jQueryEvent.isDefaultPrevented(); 681 } 682 683 if (isNative) { 684 evt = document.createEvent('HTMLEvents'); 685 evt.initEvent(typeEvent, bubbles, true); 686 } else { 687 evt = createCustomEvent(event, { 688 bubbles: bubbles, 689 cancelable: true 690 }); 691 } // merge custom informations in our event 692 693 694 if (typeof args !== 'undefined') { 695 Object.keys(args).forEach(function (key) { 696 Object.defineProperty(evt, key, { 697 get: function get() { 698 return args[key]; 699 } 700 }); 701 }); 702 } 703 704 if (defaultPrevented) { 705 evt.preventDefault(); 706 707 if (!defaultPreventedPreservedOnDispatch) { 708 Object.defineProperty(evt, 'defaultPrevented', { 709 get: function get() { 710 return true; 711 } 712 }); 713 } 714 } 715 716 if (nativeDispatch) { 717 element.dispatchEvent(evt); 718 } 719 720 if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') { 721 jQueryEvent.preventDefault(); 722 } 723 724 return evt; 725 } 726 }; 727 728 /** 729 * -------------------------------------------------------------------------- 730 * Bootstrap (v4.3.1): dom/selector-engine.js 731 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 732 * -------------------------------------------------------------------------- 733 */ 734 /** 735 * ------------------------------------------------------------------------ 736 * Constants 737 * ------------------------------------------------------------------------ 738 */ 739 740 var NODE_TEXT = 3; 741 var SelectorEngine = { 742 matches: function matches$1(element, selector) { 743 return matches.call(element, selector); 744 }, 745 find: function find$1(selector, element) { 746 if (element === void 0) { 747 element = document.documentElement; 748 } 749 750 if (typeof selector !== 'string') { 751 return null; 752 } 753 754 return find.call(element, selector); 755 }, 756 findOne: function findOne$1(selector, element) { 757 if (element === void 0) { 758 element = document.documentElement; 759 } 760 761 if (typeof selector !== 'string') { 762 return null; 763 } 764 765 return findOne.call(element, selector); 766 }, 767 children: function children(element, selector) { 768 var _this = this; 769 770 if (typeof selector !== 'string') { 771 return null; 772 } 773 774 var children = makeArray(element.children); 775 return children.filter(function (child) { 776 return _this.matches(child, selector); 777 }); 778 }, 779 parents: function parents(element, selector) { 780 if (typeof selector !== 'string') { 781 return null; 782 } 783 784 var parents = []; 785 var ancestor = element.parentNode; 786 787 while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { 788 if (this.matches(ancestor, selector)) { 789 parents.push(ancestor); 790 } 791 792 ancestor = ancestor.parentNode; 793 } 794 795 return parents; 796 }, 797 closest: function closest$1(element, selector) { 798 if (typeof selector !== 'string') { 799 return null; 800 } 801 802 return closest.call(element, selector); 803 }, 804 prev: function prev(element, selector) { 805 if (typeof selector !== 'string') { 806 return null; 807 } 808 809 var siblings = []; 810 var previous = element.previousSibling; 811 812 while (previous && previous.nodeType === Node.ELEMENT_NODE && previous.nodeType !== NODE_TEXT) { 813 if (this.matches(previous, selector)) { 814 siblings.push(previous); 815 } 816 817 previous = previous.previousSibling; 818 } 819 820 return siblings; 821 } 822 }; 823 824 /** 825 * ------------------------------------------------------------------------ 826 * Constants 827 * ------------------------------------------------------------------------ 828 */ 829 830 var NAME = 'alert'; 831 var VERSION = '4.3.1'; 832 var DATA_KEY = 'bs.alert'; 833 var EVENT_KEY = "." + DATA_KEY; 834 var DATA_API_KEY = '.data-api'; 835 var Selector = { 836 DISMISS: '[data-dismiss="alert"]' 837 }; 838 var Event$1 = { 839 CLOSE: "close" + EVENT_KEY, 840 CLOSED: "closed" + EVENT_KEY, 841 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 842 }; 843 var ClassName = { 844 ALERT: 'alert', 845 FADE: 'fade', 846 SHOW: 'show' 847 /** 848 * ------------------------------------------------------------------------ 849 * Class Definition 850 * ------------------------------------------------------------------------ 851 */ 852 853 }; 854 855 var Alert = 856 /*#__PURE__*/ 857 function () { 858 function Alert(element) { 859 this._element = element; 860 861 if (this._element) { 862 Data.setData(element, DATA_KEY, this); 863 } 864 } // Getters 865 866 867 var _proto = Alert.prototype; 868 869 // Public 870 _proto.close = function close(element) { 871 var rootElement = this._element; 872 873 if (element) { 874 rootElement = this._getRootElement(element); 875 } 876 877 var customEvent = this._triggerCloseEvent(rootElement); 878 879 if (customEvent === null || customEvent.defaultPrevented) { 880 return; 881 } 882 883 this._removeElement(rootElement); 884 }; 885 886 _proto.dispose = function dispose() { 887 Data.removeData(this._element, DATA_KEY); 888 this._element = null; 889 } // Private 890 ; 891 892 _proto._getRootElement = function _getRootElement(element) { 893 var selector = getSelectorFromElement(element); 894 var parent = false;
895 896 if (selector) { 897 parent = SelectorEngine.findOne(selector); 898 } 899 900 if (!parent) { 901 parent = SelectorEngine.closest(element, "." + ClassName.ALERT); 902 } 903 904 return parent; 905 }; 906 907 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 908 return EventHandler.trigger(element, Event$1.CLOSE); 909 }; 910 911 _proto._removeElement = function _removeElement(element) { 912 var _this = this; 913 914 element.classList.remove(ClassName.SHOW); 915 916 if (!element.classList.contains(ClassName.FADE)) { 917 this._destroyElement(element); 918 919 return; 920 } 921 922 var transitionDuration = getTransitionDurationFromElement(element); 923 EventHandler.one(element, TRANSITION_END, function (event) { 924 return _this._destroyElement(element, event); 925 }); 926 emulateTransitionEnd(element, transitionDuration); 927 }; 928 929 _proto._destroyElement = function _destroyElement(element) { 930 if (element.parentNode) { 931 element.parentNode.removeChild(element); 932 } 933 934 EventHandler.trigger(element, Event$1.CLOSED); 935 } // Static 936 ; 937 938 Alert._jQueryInterface = function _jQueryInterface(config) { 939 return this.each(function () { 940 var data = Data.getData(this, DATA_KEY); 941 942 if (!data) { 943 data = new Alert(this); 944 } 945 946 if (config === 'close') { 947 data[config](this); 948 } 949 }); 950 }; 951 952 Alert._handleDismiss = function _handleDismiss(alertInstance) { 953 return function (event) { 954 if (event) { 955 event.preventDefault(); 956 } 957 958 alertInstance.close(this); 959 }; 960 }; 961 962 Alert._getInstance = function _getInstance(element) { 963 return Data.getData(element, DATA_KEY); 964 }; 965 966 _createClass(Alert, null, [{ 967 key: "VERSION", 968 get: function get() { 969 return VERSION; 970 } 971 }]); 972 973 return Alert; 974 }(); 975 /** 976 * ------------------------------------------------------------------------ 977 * Data Api implementation 978 * ------------------------------------------------------------------------ 979 */ 980 981 982 EventHandler.on(document, Event$1.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 983 /** 984 * ------------------------------------------------------------------------ 985 * jQuery 986 * ------------------------------------------------------------------------ 987 * add .alert to jQuery only if jQuery is present 988 */ 989 990 if (typeof jQuery !== 'undefined') { 991 var JQUERY_NO_CONFLICT = jQuery.fn[NAME]; 992 jQuery.fn[NAME] = Alert._jQueryInterface; 993 jQuery.fn[NAME].Constructor = Alert; 994 995 jQuery.fn[NAME].noConflict = function () { 996 jQuery.fn[NAME] = JQUERY_NO_CONFLICT; 997 return Alert._jQueryInterface; 998 }; 999 } 1000 1001 /** 1002 * ------------------------------------------------------------------------ 1003 * Constants 1004 * ------------------------------------------------------------------------ 1005 */ 1006 1007 var NAME$1 = 'button'; 1008 var VERSION$1 = '4.3.1'; 1009 var DATA_KEY$1 = 'bs.button'; 1010 var EVENT_KEY$1 = "." + DATA_KEY$1; 1011 var DATA_API_KEY$1 = '.data-api'; 1012 var ClassName$1 = { 1013 ACTIVE: 'active', 1014 BUTTON: 'btn', 1015 FOCUS: 'focus' 1016 }; 1017 var Selector$1 = { 1018 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 1019 DATA_TOGGLE: '[data-toggle="buttons"]', 1020 INPUT: 'input:not([type="hidden"])', 1021 ACTIVE: '.active', 1022 BUTTON: '.btn' 1023 }; 1024 var Event$2 = { 1025 CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, 1026 FOCUS_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1, 1027 BLUR_DATA_API: "blur" + EVENT_KEY$1 + DATA_API_KEY$1 1028 /** 1029 * ------------------------------------------------------------------------ 1030 * Class Definition 1031 * ------------------------------------------------------------------------ 1032 */ 1033 1034 }; 1035 1036 var Button = 1037 /*#__PURE__*/ 1038 function () { 1039 function Button(element) { 1040 this._element = element; 1041 Data.setData(element, DATA_KEY$1, this); 1042 } // Getters 1043 1044 1045 var _proto = Button.prototype; 1046 1047 // Public 1048 _proto.toggle = function toggle() { 1049 var triggerChangeEvent = true; 1050 var addAriaPressed = true; 1051 var rootElement = SelectorEngine.closest(this._element, Selector$1.DATA_TOGGLE); 1052 1053 if (rootElement) { 1054 var input = SelectorEngine.findOne(Selector$1.INPUT, this._element); 1055 1056 if (input) { 1057 if (input.type === 'radio') { 1058 if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { 1059 triggerChangeEvent = false;
1060 } else { 1061 var activeElement = SelectorEngine.findOne(Selector$1.ACTIVE, rootElement); 1062 1063 if (activeElement) { 1064 activeElement.classList.remove(ClassName$1.ACTIVE); 1065 } 1066 } 1067 } 1068 1069 if (triggerChangeEvent) { 1070 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { 1071 return; 1072 } 1073 1074 input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); 1075 EventHandler.trigger(input, 'change'); 1076 } 1077 1078 input.focus(); 1079 addAriaPressed = false; 1080 } 1081 } 1082 1083 if (addAriaPressed) { 1084 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); 1085 } 1086 1087 if (triggerChangeEvent) { 1088 this._element.classList.toggle(ClassName$1.ACTIVE); 1089 } 1090 }; 1091 1092 _proto.dispose = function dispose() { 1093 Data.removeData(this._element, DATA_KEY$1); 1094 this._element = null; 1095 } // Static 1096 ; 1097 1098 Button._jQueryInterface = function _jQueryInterface(config) { 1099 return this.each(function () { 1100 var data = Data.getData(this, DATA_KEY$1); 1101 1102 if (!data) { 1103 data = new Button(this); 1104 } 1105 1106 if (config === 'toggle') { 1107 data[config](); 1108 } 1109 }); 1110 }; 1111 1112 Button._getInstance = function _getInstance(element) { 1113 return Data.getData(element, DATA_KEY$1); 1114 }; 1115 1116 _createClass(Button, null, [{ 1117 key: "VERSION", 1118 get: function get() { 1119 return VERSION$1; 1120 } 1121 }]); 1122 1123 return Button; 1124 }(); 1125 /** 1126 * ------------------------------------------------------------------------ 1127 * Data Api implementation 1128 * ------------------------------------------------------------------------ 1129 */ 1130 1131 1132 EventHandler.on(document, Event$2.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 1133 event.preventDefault(); 1134 var button = event.target; 1135 1136 if (!button.classList.contains(ClassName$1.BUTTON)) { 1137 button = SelectorEngine.closest(button, Selector$1.BUTTON); 1138 } 1139 1140 var data = Data.getData(button, DATA_KEY$1); 1141 1142 if (!data) { 1143 data = new Button(button); 1144 Data.setData(button, DATA_KEY$1, data); 1145 } 1146 1147 data.toggle(); 1148 }); 1149 EventHandler.on(document, Event$2.FOCUS_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 1150 var button = SelectorEngine.closest(event.target, Selector$1.BUTTON); 1151 1152 if (button) { 1153 button.classList.add(ClassName$1.FOCUS); 1154 } 1155 }); 1156 EventHandler.on(document, Event$2.BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 1157 var button = SelectorEngine.closest(event.target, Selector$1.BUTTON); 1158 1159 if (button) { 1160 button.classList.remove(ClassName$1.FOCUS); 1161 } 1162 }); 1163 /** 1164 * ------------------------------------------------------------------------ 1165 * jQuery 1166 * ------------------------------------------------------------------------ 1167 * add .button to jQuery only if jQuery is present 1168 */ 1169 1170 if (typeof jQuery !== 'undefined') { 1171 var JQUERY_NO_CONFLICT$1 = jQuery.fn[NAME$1]; 1172 jQuery.fn[NAME$1] = Button._jQueryInterface; 1173 jQuery.fn[NAME$1].Constructor = Button; 1174 1175 jQuery.fn[NAME$1].noConflict = function () { 1176 jQuery.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 1177 return Button._jQueryInterface; 1178 }; 1179 } 1180 1181 /** 1182 * -------------------------------------------------------------------------- 1183 * Bootstrap (v4.3.1): dom/manipulator.js 1184 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1185 * -------------------------------------------------------------------------- 1186 */ 1187 function normalizeData(val) { 1188 if (val === 'true') { 1189 return true; 1190 } 1191 1192 if (val === 'false') { 1193 return false; 1194 } 1195 1196 if (val === Number(val).toString()) { 1197 return Number(val); 1198 } 1199 1200 if (val === '' || val === 'null') { 1201 return null; 1202 } 1203 1204 return val; 1205 } 1206 1207 function normalizeDataKey(key) { 1208 return key.replace(/[A-Z]/g, function (chr) { 1209 return chr.toLowerCase(); 1210 }); 1211 } 1212 1213 var Manipulator = { 1214 setDataAttribute: function setDataAttribute(element, key, value) { 1215 element.setAttribute("data-" + normalizeDataKey(key), value); 1216 }, 1217 removeDataAttribute: function removeDataAttribute(element, key) { 1218 element.removeAttribute("data-" + normalizeDataKey(key)); 1219 }, 1220 getDataAttributes: function getDataAttributes(element) { 1221 if (!element) { 1222 return {}; 1223 } 1224 1225 var attributes = _objectSpread({}, element.dataset); 1226
1227 Object.keys(attributes).forEach(function (key) { 1228 attributes[key] = normalizeData(attributes[key]); 1229 }); 1230 return attributes; 1231 }, 1232 getDataAttribute: function getDataAttribute(element, key) { 1233 return normalizeData(element.getAttribute("data-" + normalizeDataKey(key))); 1234 }, 1235 offset: function offset(element) { 1236 var rect = element.getBoundingClientRect(); 1237 return { 1238 top: rect.top + document.body.scrollTop, 1239 left: rect.left + document.body.scrollLeft 1240 }; 1241 }, 1242 position: function position(element) { 1243 return { 1244 top: element.offsetTop, 1245 left: element.offsetLeft 1246 }; 1247 }, 1248 toggleClass: function toggleClass(element, className) { 1249 if (!element) { 1250 return; 1251 } 1252 1253 if (element.classList.contains(className)) { 1254 element.classList.remove(className); 1255 } else { 1256 element.classList.add(className); 1257 } 1258 } 1259 }; 1260 1261 /** 1262 * ------------------------------------------------------------------------ 1263 * Constants 1264 * ------------------------------------------------------------------------ 1265 */ 1266 1267 var NAME$2 = 'carousel'; 1268 var VERSION$2 = '4.3.1'; 1269 var DATA_KEY$2 = 'bs.carousel'; 1270 var EVENT_KEY$2 = "." + DATA_KEY$2; 1271 var DATA_API_KEY$2 = '.data-api'; 1272 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 1273 1274 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 1275 1276 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 1277 1278 var SWIPE_THRESHOLD = 40; 1279 var Default = { 1280 interval: 5000, 1281 keyboard: true, 1282 slide: false, 1283 pause: 'hover', 1284 wrap: true, 1285 touch: true 1286 }; 1287 var DefaultType = { 1288 interval: '(number|boolean)', 1289 keyboard: 'boolean', 1290 slide: '(boolean|string)', 1291 pause: '(string|boolean)', 1292 wrap: 'boolean', 1293 touch: 'boolean' 1294 }; 1295 var Direction = { 1296 NEXT: 'next', 1297 PREV: 'prev', 1298 LEFT: 'left', 1299 RIGHT: 'right' 1300 }; 1301 var Event$3 = { 1302 SLIDE: "slide" + EVENT_KEY$2, 1303 SLID: "slid" + EVENT_KEY$2, 1304 KEYDOWN: "keydown" + EVENT_KEY$2, 1305 MOUSEENTER: "mouseenter" + EVENT_KEY$2, 1306 MOUSELEAVE: "mouseleave" + EVENT_KEY$2, 1307 TOUCHSTART: "touchstart" + EVENT_KEY$2, 1308 TOUCHMOVE: "touchmove" + EVENT_KEY$2, 1309 TOUCHEND: "touchend" + EVENT_KEY$2, 1310 POINTERDOWN: "pointerdown" + EVENT_KEY$2, 1311 POINTERUP: "pointerup" + EVENT_KEY$2, 1312 DRAG_START: "dragstart" + EVENT_KEY$2, 1313 LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, 1314 CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 1315 }; 1316 var ClassName$2 = { 1317 CAROUSEL: 'carousel', 1318 ACTIVE: 'active', 1319 SLIDE: 'slide', 1320 RIGHT: 'carousel-item-right', 1321 LEFT: 'carousel-item-left', 1322 NEXT: 'carousel-item-next', 1323 PREV: 'carousel-item-prev', 1324 ITEM: 'carousel-item', 1325 POINTER_EVENT: 'pointer-event' 1326 }; 1327 var Selector$2 = { 1328 ACTIVE: '.active', 1329 ACTIVE_ITEM: '.active.carousel-item', 1330 ITEM: '.carousel-item', 1331 ITEM_IMG: '.carousel-item img', 1332 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 1333 INDICATORS: '.carousel-indicators', 1334 DATA_SLIDE: '[data-slide], [data-slide-to]', 1335 DATA_RIDE: '[data-ride="carousel"]' 1336 }; 1337 var PointerType = { 1338 TOUCH: 'touch', 1339 PEN: 'pen' 1340 /** 1341 * ------------------------------------------------------------------------ 1342 * Class Definition 1343 * ------------------------------------------------------------------------ 1344 */ 1345 1346 }; 1347 1348 var Carousel = 1349 /*#__PURE__*/ 1350 function () { 1351 function Carousel(element, config) { 1352 this._items = null; 1353 this._interval = null; 1354 this._activeElement = null; 1355 this._isPaused = false; 1356 this._isSliding = false; 1357 this.touchTimeout = null; 1358 this.touchStartX = 0; 1359 this.touchDeltaX = 0; 1360 this._config = this._getConfig(config); 1361 this._element = element; 1362 this._indicatorsElement = SelectorEngine.findOne(Selector$2.INDICATORS, this._element); 1363 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 1364 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 1365 1366 this._addEventListeners(); 1367 1368 Data.setData(element, DATA_KEY$2, this); 1369 } // Getters 1370 1371 1372 var _proto = Carousel.prototype; 1373 1374 // Public 1375 _proto.next = function next() { 1376 if (!this._isSliding) { 1377 this._slide(Direction.NEXT); 1378 } 1379 }; 1380 1381 _proto.nextWhenVisible = function nextWhenVisible() { 1382 // Don't call next when the page isn't visible 1383 // or the carousel or its parent isn't visible 1384 if (!document.hidden && isVisible(this._element)) { 1385 this.next(); 1386 } 1387 }; 1388 1389 _proto.prev = function prev() { 1390 if (!this._isSliding) { 1391 this._slide(Direction.PREV); 1392 } 1393 }; 1394 1395 _proto.pause = function pause(event) { 1396 if (!event) { 1397 this._isPaused = true; 1398 } 1399 1400 if (SelectorEngine.findOne(Selector$2.NEXT_PREV, this._element)) { 1401 triggerTransitionEnd(this._element); 1402 this.cycle(true); 1403 } 1404 1405 clearInterval(this._interval); 1406 this._interval = null; 1407 }; 1408 1409 _proto.cycle = function cycle(event) { 1410 if (!event) { 1411 this._isPaused = false;
1412 } 1413 1414 if (this._interval) { 1415 clearInterval(this._interval); 1416 this._interval = null; 1417 } 1418 1419 if (this._config && this._config.interval && !this._isPaused) { 1420 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 1421 } 1422 }; 1423 1424 _proto.to = function to(index) { 1425 var _this = this; 1426 1427 this._activeElement = SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element); 1428 1429 var activeIndex = this._getItemIndex(this._activeElement); 1430 1431 if (index > this._items.length - 1 || index < 0) { 1432 return; 1433 } 1434 1435 if (this._isSliding) { 1436 EventHandler.one(this._element, Event$3.SLID, function () { 1437 return _this.to(index); 1438 }); 1439 return; 1440 } 1441 1442 if (activeIndex === index) { 1443 this.pause(); 1444 this.cycle(); 1445 return; 1446 } 1447 1448 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 1449 1450 this._slide(direction, this._items[index]); 1451 }; 1452 1453 _proto.dispose = function dispose() { 1454 EventHandler.off(this._element, EVENT_KEY$2); 1455 Data.removeData(this._element, DATA_KEY$2); 1456 this._items = null; 1457 this._config = null; 1458 this._element = null; 1459 this._interval = null; 1460 this._isPaused = null; 1461 this._isSliding = null; 1462 this._activeElement = null; 1463 this._indicatorsElement = null; 1464 } // Private 1465 ; 1466 1467 _proto._getConfig = function _getConfig(config) { 1468 config = _objectSpread({}, Default, config); 1469 typeCheckConfig(NAME$2, config, DefaultType); 1470 return config; 1471 }; 1472 1473 _proto._handleSwipe = function _handleSwipe() { 1474 var absDeltax = Math.abs(this.touchDeltaX); 1475 1476 if (absDeltax <= SWIPE_THRESHOLD) { 1477 return; 1478 } 1479 1480 var direction = absDeltax / this.touchDeltaX; 1481 this.touchDeltaX = 0; // swipe left 1482 1483 if (direction > 0) { 1484 this.prev(); 1485 } // swipe right 1486 1487 1488 if (direction < 0) { 1489 this.next(); 1490 } 1491 }; 1492 1493 _proto._addEventListeners = function _addEventListeners() { 1494 var _this2 = this; 1495 1496 if (this._config.keyboard) { 1497 EventHandler.on(this._element, Event$3.KEYDOWN, function (event) { 1498 return _this2._keydown(event); 1499 }); 1500 } 1501 1502 if (this._config.pause === 'hover') { 1503 EventHandler.on(this._element, Event$3.MOUSEENTER, function (event) { 1504 return _this2.pause(event); 1505 }); 1506 EventHandler.on(this._element, Event$3.MOUSELEAVE, function (event) { 1507 return _this2.cycle(event); 1508 }); 1509 } 1510 1511 if (this._config.touch) { 1512 this._addTouchEventListeners(); 1513 } 1514 }; 1515 1516 _proto._addTouchEventListeners = function _addTouchEventListeners() { 1517 var _this3 = this; 1518 1519 if (!this._touchSupported) { 1520 return; 1521 } 1522 1523 var start = function start(event) { 1524 if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) { 1525 _this3.touchStartX = event.clientX; 1526 } else if (!_this3._pointerEvent) { 1527 _this3.touchStartX = event.touches[0].clientX; 1528 } 1529 }; 1530 1531 var move = function move(event) { 1532 // ensure swiping with one touch and not pinching 1533 if (event.touches && event.touches.length > 1) { 1534 _this3.touchDeltaX = 0; 1535 } else { 1536 _this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX; 1537 } 1538 }; 1539 1540 var end = function end(event) { 1541 if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) { 1542 _this3.touchDeltaX = event.clientX - _this3.touchStartX; 1543 } 1544 1545 _this3._handleSwipe(); 1546 1547 if (_this3._config.pause === 'hover') { 1548 // If it's a touch-enabled device, mouseenter/leave are fired as 1549 // part of the mouse compatibility events on first tap - the carousel 1550 // would stop cycling until user tapped out of it; 1551 // here, we listen for touchend, explicitly pause the carousel 1552 // (as if it's the second time we tap on it, mouseenter compat event 1553 // is NOT fired) and after a timeout (to allow for mouse compatibility 1554 // events to fire) we explicitly restart cycling 1555 _this3.pause(); 1556 1557 if (_this3.touchTimeout) { 1558 clearTimeout(_this3.touchTimeout); 1559 } 1560 1561 _this3.touchTimeout = setTimeout(function (event) { 1562 return _this3.cycle(event); 1563 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 1564 } 1565 }; 1566 1567 makeArray(SelectorEngine.find(Selector$2.ITEM_IMG, this._element)).forEac
1567h(function (itemImg) { 1568 EventHandler.on(itemImg, Event$3.DRAG_START, function (e) { 1569 return e.preventDefault(); 1570 }); 1571 }); 1572 1573 if (this._pointerEvent) { 1574 EventHandler.on(this._element, Event$3.POINTERDOWN, function (event) { 1575 return start(event); 1576 }); 1577 EventHandler.on(this._element, Event$3.POINTERUP, function (event) { 1578 return end(event); 1579 }); 1580 1581 this._element.classList.add(ClassName$2.POINTER_EVENT); 1582 } else { 1583 EventHandler.on(this._element, Event$3.TOUCHSTART, function (event) { 1584 return start(event); 1585 }); 1586 EventHandler.on(this._element, Event$3.TOUCHMOVE, function (event) { 1587 return move(event); 1588 }); 1589 EventHandler.on(this._element, Event$3.TOUCHEND, function (event) { 1590 return end(event); 1591 }); 1592 } 1593 }; 1594 1595 _proto._keydown = function _keydown(event) { 1596 if (/input|textarea/i.test(event.target.tagName)) { 1597 return; 1598 } 1599 1600 switch (event.which) { 1601 case ARROW_LEFT_KEYCODE: 1602 event.preventDefault(); 1603 this.prev(); 1604 break; 1605 1606 case ARROW_RIGHT_KEYCODE: 1607 event.preventDefault(); 1608 this.next(); 1609 break; 1610 1611 default: 1612 } 1613 }; 1614 1615 _proto._getItemIndex = function _getItemIndex(element) { 1616 this._items = element && element.parentNode ? makeArray(SelectorEngine.find(Selector$2.ITEM, element.parentNode)) : []; 1617 return this._items.indexOf(element); 1618 }; 1619 1620 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 1621 var isNextDirection = direction === Direction.NEXT; 1622 var isPrevDirection = direction === Direction.PREV; 1623 1624 var activeIndex = this._getItemIndex(activeElement); 1625 1626 var lastItemIndex = this._items.length - 1; 1627 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1628 1629 if (isGoingToWrap && !this._config.wrap) { 1630 return activeElement; 1631 } 1632 1633 var delta = direction === Direction.PREV ? -1 : 1; 1634 var itemIndex = (activeIndex + delta) % this._items.length; 1635 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1636 }; 1637 1638 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1639 var targetIndex = this._getItemIndex(relatedTarget); 1640 1641 var fromIndex = this._getItemIndex(SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element)); 1642 1643 return EventHandler.trigger(this._element, Event$3.SLIDE, { 1644 relatedTarget: relatedTarget, 1645 direction: eventDirectionName, 1646 from: fromIndex, 1647 to: targetIndex 1648 }); 1649 }; 1650 1651 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 1652 if (this._indicatorsElement) { 1653 var indicators = SelectorEngine.find(Selector$2.ACTIVE, this._indicatorsElement); 1654 1655 for (var i = 0; i < indicators.length; i++) { 1656 indicators[i].classList.remove(ClassName$2.ACTIVE); 1657 } 1658 1659 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1660 1661 if (nextIndicator) { 1662 nextIndicator.classList.add(ClassName$2.ACTIVE); 1663 } 1664 } 1665 }; 1666 1667 _proto._slide = function _slide(direction, element) { 1668 var _this4 = this; 1669 1670 var activeElement = SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element); 1671 1672 var activeElementIndex = this._getItemIndex(activeElement); 1673 1674 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1675 1676 var nextElementIndex = this._getItemIndex(nextElement); 1677 1678 var isCycling = Boolean(this._interval); 1679 var directionalClassName; 1680 var orderClassName; 1681 var eventDirectionName; 1682 1683 if (direction === Direction.NEXT) { 1684 directionalClassName = ClassName$2.LEFT; 1685 orderClassName = ClassName$2.NEXT; 1686 eventDirectionName = Direction.LEFT; 1687 } else { 1688 directionalClassName = ClassName$2.RIGHT; 1689 orderClassName = ClassName$2.PREV; 1690 eventDirectionName = Direction.RIGHT; 1691 } 1692 1693 if (nextElement && nextElement.classList.contains(ClassName$2.ACTIVE)) { 1694 this._isSliding = false;
1695 return; 1696 } 1697 1698 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1699 1700 if (slideEvent.defaultPrevented) { 1701 return; 1702 } 1703 1704 if (!activeElement || !nextElement) { 1705 // Some weirdness is happening, so we bail 1706 return; 1707 } 1708 1709 this._isSliding = true; 1710 1711 if (isCycling) { 1712 this.pause(); 1713 } 1714 1715 this._setActiveIndicatorElement(nextElement); 1716 1717 if (this._element.classList.contains(ClassName$2.SLIDE)) { 1718 nextElement.classList.add(orderClassName); 1719 reflow(nextElement); 1720 activeElement.classList.add(directionalClassName); 1721 nextElement.classList.add(directionalClassName); 1722 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1723 1724 if (nextElementInterval) { 1725 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1726 this._config.interval = nextElementInterval; 1727 } else { 1728 this._config.interval = this._config.defaultInterval || this._config.interval; 1729 } 1730 1731 var transitionDuration = getTransitionDurationFromElement(activeElement); 1732 EventHandler.one(activeElement, TRANSITION_END, function () { 1733 nextElement.classList.remove(directionalClassName); 1734 nextElement.classList.remove(orderClassName); 1735 nextElement.classList.add(ClassName$2.ACTIVE); 1736 activeElement.classList.remove(ClassName$2.ACTIVE); 1737 activeElement.classList.remove(orderClassName); 1738 activeElement.classList.remove(directionalClassName); 1739 _this4._isSliding = false; 1740 setTimeout(function () { 1741 EventHandler.trigger(_this4._element, Event$3.SLID, { 1742 relatedTarget: nextElement, 1743 direction: eventDirectionName, 1744 from: activeElementIndex, 1745 to: nextElementIndex 1746 }); 1747 }, 0); 1748 }); 1749 emulateTransitionEnd(activeElement, transitionDuration); 1750 } else { 1751 activeElement.classList.remove(ClassName$2.ACTIVE); 1752 nextElement.classList.add(ClassName$2.ACTIVE); 1753 this._isSliding = false; 1754 EventHandler.trigger(this._element, Event$3.SLID, { 1755 relatedTarget: nextElement, 1756 direction: eventDirectionName, 1757 from: activeElementIndex, 1758 to: nextElementIndex 1759 }); 1760 } 1761 1762 if (isCycling) { 1763 this.cycle(); 1764 } 1765 } // Static 1766 ; 1767 1768 Carousel._carouselInterface = function _carouselInterface(element, config) { 1769 var data = Data.getData(element, DATA_KEY$2); 1770 1771 var _config = _objectSpread({}, Default, Manipulator.getDataAttributes(element)); 1772 1773 if (typeof config === 'object') { 1774 _config = _objectSpread({}, _config, config); 1775 } 1776 1777 var action = typeof config === 'string' ? config : _config.slide; 1778 1779 if (!data) { 1780 data = new Carousel(element, _config); 1781 } 1782 1783 if (typeof config === 'number') { 1784 data.to(config); 1785 } else if (typeof action === 'string') { 1786 if (typeof data[action] === 'undefined') { 1787 throw new TypeError("No method named \"" + action + "\""); 1788 } 1789 1790 data[action](); 1791 } else if (_config.interval && _config.ride) { 1792 data.pause(); 1793 data.cycle(); 1794 } 1795 }; 1796 1797 Carousel._jQueryInterface = function _jQueryInterface(config) { 1798 return this.each(function () { 1799 Carousel._carouselInterface(this, config); 1800 }); 1801 }; 1802 1803 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1804 var selector = getSelectorFromElement(this); 1805 1806 if (!selector) { 1807 return; 1808 } 1809 1810 var target = SelectorEngine.findOne(selector); 1811 1812 if (!target || !target.classList.contains(ClassName$2.CAROUSEL)) { 1813 return; 1814 } 1815 1816 var config = _objectSpread({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this)); 1817 1818 var slideIndex = this.getAttribute('data-slide-to'); 1819 1820 if (slideIndex) { 1821 config.interval = false; 1822 } 1823 1824 Carousel._carouselInterface(target, config); 1825 1826 if (slideIndex) { 1827 Data.getData(target, DATA_KEY$2).to(slideIndex); 1828 } 1829 1830 event.preventDefault(); 1831 }; 1832 1833 Carousel._getInstance = function _getInstance(element) { 1834 return Data.getData(element, DATA_KEY$2); 1835 }; 1836 1837 _createClass(Carousel, null, [{ 1838 key: "VERSION", 1839 get: function get() { 1840 return VERSION$2; 1841 } 1842 }, {
1843 key: "Default", 1844 get: function get() { 1845 return Default; 1846 } 1847 }]); 1848 1849 return Carousel; 1850 }(); 1851 /** 1852 * ------------------------------------------------------------------------ 1853 * Data Api implementation 1854 * ------------------------------------------------------------------------ 1855 */ 1856 1857 1858 EventHandler.on(document, Event$3.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); 1859 EventHandler.on(window, Event$3.LOAD_DATA_API, function () { 1860 var carousels = makeArray(SelectorEngine.find(Selector$2.DATA_RIDE)); 1861 1862 for (var i = 0, len = carousels.length; i < len; i++) { 1863 Carousel._carouselInterface(carousels[i], Data.getData(carousels[i], DATA_KEY$2)); 1864 } 1865 }); 1866 /** 1867 * ------------------------------------------------------------------------ 1868 * jQuery 1869 * ------------------------------------------------------------------------ 1870 * add .carousel to jQuery only if jQuery is present 1871 */ 1872 1873 if (typeof jQuery !== 'undefined') { 1874 var JQUERY_NO_CONFLICT$2 = jQuery.fn[NAME$2]; 1875 jQuery.fn[NAME$2] = Carousel._jQueryInterface; 1876 jQuery.fn[NAME$2].Constructor = Carousel; 1877 1878 jQuery.fn[NAME$2].noConflict = function () { 1879 jQuery.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1880 return Carousel._jQueryInterface; 1881 }; 1882 } 1883 1884 /** 1885 * ------------------------------------------------------------------------ 1886 * Constants 1887 * ------------------------------------------------------------------------ 1888 */ 1889 1890 var NAME$3 = 'collapse'; 1891 var VERSION$3 = '4.3.1'; 1892 var DATA_KEY$3 = 'bs.collapse'; 1893 var EVENT_KEY$3 = "." + DATA_KEY$3; 1894 var DATA_API_KEY$3 = '.data-api'; 1895 var Default$1 = { 1896 toggle: true, 1897 parent: '' 1898 }; 1899 var DefaultType$1 = { 1900 toggle: 'boolean', 1901 parent: '(string|element)' 1902 }; 1903 var Event$4 = { 1904 SHOW: "show" + EVENT_KEY$3, 1905 SHOWN: "shown" + EVENT_KEY$3, 1906 HIDE: "hide" + EVENT_KEY$3, 1907 HIDDEN: "hidden" + EVENT_KEY$3, 1908 CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 1909 }; 1910 var ClassName$3 = { 1911 SHOW: 'show', 1912 COLLAPSE: 'collapse', 1913 COLLAPSING: 'collapsing', 1914 COLLAPSED: 'collapsed' 1915 }; 1916 var Dimension = { 1917 WIDTH: 'width', 1918 HEIGHT: 'height' 1919 }; 1920 var Selector$3 = { 1921 ACTIVES: '.show, .collapsing', 1922 DATA_TOGGLE: '[data-toggle="collapse"]' 1923 /** 1924 * ------------------------------------------------------------------------ 1925 * Class Definition 1926 * ------------------------------------------------------------------------ 1927 */ 1928 1929 }; 1930 1931 var Collapse = 1932 /*#__PURE__*/ 1933 function () { 1934 function Collapse(element, config) { 1935 this._isTransitioning = false; 1936 this._element = element; 1937 this._config = this._getConfig(config); 1938 this._triggerArray = makeArray(SelectorEngine.find("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1939 var toggleList = makeArray(SelectorEngine.find(Selector$3.DATA_TOGGLE)); 1940 1941 for (var i = 0, len = toggleList.length; i < len; i++) { 1942 var elem = toggleList[i]; 1943 var selector = getSelectorFromElement(elem); 1944 var filterElement = makeArray(SelectorEngine.find(selector)).filter(function (foundElem) { 1945 return foundElem === element; 1946 }); 1947 1948 if (selector !== null && filterElement.length) { 1949 this._selector = selector; 1950 1951 this._triggerArray.push(elem); 1952 } 1953 } 1954 1955 this._parent = this._config.parent ? this._getParent() : null; 1956 1957 if (!this._config.parent) { 1958 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1959 } 1960 1961 if (this._config.toggle) { 1962 this.toggle(); 1963 } 1964 1965 Data.setData(element, DATA_KEY$3, this); 1966 } // Getters 1967 1968 1969 var _proto = Collapse.prototype; 1970 1971 // Public 1972 _proto.toggle = function toggle() { 1973 if (this._element.classList.contains(ClassName$3.SHOW)) { 1974 this.hide(); 1975 } else { 1976 this.show(); 1977 } 1978 }; 1979 1980 _proto.show = function show() { 1981 var _this = this; 1982 1983 if (this._isTransitioning || this._element.classList.contains(ClassName$3.SHOW)) { 1984 return; 1985 } 1986 1987 var actives; 1988 var activesData; 1989 1990 if (this._parent) { 1991 actives = makeArray(SelectorEngine.find(Selector$3.ACTIVES, this._parent)).filter(function (elem) { 1992 if (typeof _this._config.parent === 'string') { 1993 return elem.getAttribute('data-parent') === _this._config.parent; 1994 } 1995 1996 return elem.classList.contains(ClassName$3.COLLAPSE); 1997 }); 1998 1999 if (actives.length === 0) { 2000 actives = null; 2001 } 2002 } 2003 2004 var container = SelectorEngine.findOne(this._selector); 2005 2006 if (actives) { 2007 var tempActiveData = actives.filter(function (elem) { 2008 return container !== elem; 2009 }); 2010 activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY$3) : null; 2011 2012 if (activesData && activesData._isTransitioning) { 2013 return; 2014 } 2015 } 2016 2017 var startEvent = EventHandler.trigger(this._element, Event$4.SHOW); 2018 2019 if (startEvent.defaultPrevented) { 2020 return; 2021 } 2022 2023 if (actives) {
2024 actives.forEach(function (elemActive) { 2025 if (container !== elemActive) { 2026 Collapse._collapseInterface(elemActive, 'hide'); 2027 } 2028 2029 if (!activesData) { 2030 Data.setData(elemActive, DATA_KEY$3, null); 2031 } 2032 }); 2033 } 2034 2035 var dimension = this._getDimension(); 2036 2037 this._element.classList.remove(ClassName$3.COLLAPSE); 2038 2039 this._element.classList.add(ClassName$3.COLLAPSING); 2040 2041 this._element.style[dimension] = 0; 2042 2043 if (this._triggerArray.length) { 2044 this._triggerArray.forEach(function (element) { 2045 element.classList.remove(ClassName$3.COLLAPSED); 2046 element.setAttribute('aria-expanded', true); 2047 }); 2048 } 2049 2050 this.setTransitioning(true); 2051 2052 var complete = function complete() { 2053 _this._element.classList.remove(ClassName$3.COLLAPSING); 2054 2055 _this._element.classList.add(ClassName$3.COLLAPSE); 2056 2057 _this._element.classList.add(ClassName$3.SHOW); 2058 2059 _this._element.style[dimension] = ''; 2060 2061 _this.setTransitioning(false); 2062 2063 EventHandler.trigger(_this._element, Event$4.SHOWN); 2064 }; 2065 2066 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 2067 var scrollSize = "scroll" + capitalizedDimension; 2068 var transitionDuration = getTransitionDurationFromElement(this._element); 2069 EventHandler.one(this._element, TRANSITION_END, complete); 2070 emulateTransitionEnd(this._element, transitionDuration); 2071 this._element.style[dimension] = this._element[scrollSize] + "px"; 2072 }; 2073 2074 _proto.hide = function hide() { 2075 var _this2 = this; 2076 2077 if (this._isTransitioning || !this._element.classList.contains(ClassName$3.SHOW)) { 2078 return; 2079 } 2080 2081 var startEvent = EventHandler.trigger(this._element, Event$4.HIDE); 2082 2083 if (startEvent.defaultPrevented) { 2084 return; 2085 } 2086 2087 var dimension = this._getDimension(); 2088 2089 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 2090 reflow(this._element); 2091 2092 this._element.classList.add(ClassName$3.COLLAPSING); 2093 2094 this._element.classList.remove(ClassName$3.COLLAPSE); 2095 2096 this._element.classList.remove(ClassName$3.SHOW); 2097 2098 var triggerArrayLength = this._triggerArray.length; 2099 2100 if (triggerArrayLength > 0) { 2101 for (var i = 0; i < triggerArrayLength; i++) { 2102 var trigger = this._triggerArray[i]; 2103 var selector = getSelectorFromElement(trigger); 2104 2105 if (selector !== null) { 2106 var elem = SelectorEngine.findOne(selector); 2107 2108 if (!elem.classList.contains(ClassName$3.SHOW)) { 2109 trigger.classList.add(ClassName$3.COLLAPSED); 2110 trigger.setAttribute('aria-expanded', false); 2111 } 2112 } 2113 } 2114 } 2115 2116 this.setTransitioning(true); 2117 2118 var complete = function complete() { 2119 _this2.setTransitioning(false); 2120 2121 _this2._element.classList.remove(ClassName$3.COLLAPSING); 2122 2123 _this2._element.classList.add(ClassName$3.COLLAPSE); 2124 2125 EventHandler.trigger(_this2._element, Event$4.HIDDEN); 2126 }; 2127 2128 this._element.style[dimension] = ''; 2129 var transitionDuration = getTransitionDurationFromElement(this._element); 2130 EventHandler.one(this._element, TRANSITION_END, complete); 2131 emulateTransitionEnd(this._element, transitionDuration); 2132 }; 2133 2134 _proto.setTransitioning = function setTransitioning(isTransitioning) { 2135 this._isTransitioning = isTransitioning; 2136 }; 2137 2138 _proto.dispose = function dispose() { 2139 Data.removeData(this._element, DATA_KEY$3); 2140 this._config = null; 2141 this._parent = null; 2142 this._element = null; 2143 this._triggerArray = null; 2144 this._isTransitioning = null; 2145 } // Private 2146 ; 2147 2148 _proto._getConfig = function _getConfig(config) { 2149 config = _objectSpread({}, Default$1, config); 2150 config.toggle = Boolean(config.toggle); // Coerce string values 2151 2152 typeCheckConfig(NAME$3, config, DefaultType$1); 2153 return config; 2154 }; 2155 2156 _proto._getDimension = function _getDimension() { 2157 var hasWidth = this._element.classList.contains(Dimension.WIDTH); 2158 2159 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 2160 }; 2161 2162 _proto._getParent = function _getParent() { 2163 var _this3 = this; 2164 2165 var parent = this._config.parent; 2166 2167 if (isElement(parent)) { 2168 // it's a jQuery object 2169 if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') { 2170 parent = parent[0]; 2171 } 2172 } else { 2173 parent = SelectorEngine.findOne(parent); 2174 } 2175 2176 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + parent + "\"]";
2177 makeArray(SelectorEngine.find(selector, parent)).forEach(function (element) { 2178 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 2179 }); 2180 return parent; 2181 }; 2182 2183 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 2184 if (element) { 2185 var isOpen = element.classList.contains(ClassName$3.SHOW); 2186 2187 if (triggerArray.length) { 2188 triggerArray.forEach(function (elem) { 2189 if (isOpen) { 2190 elem.classList.remove(ClassName$3.COLLAPSED); 2191 } else { 2192 elem.classList.add(ClassName$3.COLLAPSED); 2193 } 2194 2195 elem.setAttribute('aria-expanded', isOpen); 2196 }); 2197 } 2198 } 2199 } // Static 2200 ; 2201 2202 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 2203 var selector = getSelectorFromElement(element); 2204 return selector ? SelectorEngine.findOne(selector) : null; 2205 }; 2206 2207 Collapse._collapseInterface = function _collapseInterface(element, config) { 2208 var data = Data.getData(element, DATA_KEY$3); 2209 2210 var _config = _objectSpread({}, Default$1, Manipulator.getDataAttributes(element), typeof config === 'object' && config ? config : {}); 2211 2212 if (!data && _config.toggle && /show|hide/.test(config)) { 2213 _config.toggle = false; 2214 } 2215 2216 if (!data) { 2217 data = new Collapse(element, _config); 2218 } 2219 2220 if (typeof config === 'string') { 2221 if (typeof data[config] === 'undefined') { 2222 throw new TypeError("No method named \"" + config + "\""); 2223 } 2224 2225 data[config](); 2226 } 2227 }; 2228 2229 Collapse._jQueryInterface = function _jQueryInterface(config) { 2230 return this.each(function () { 2231 Collapse._collapseInterface(this, config); 2232 }); 2233 }; 2234 2235 Collapse._getInstance = function _getInstance(element) { 2236 return Data.getData(element, DATA_KEY$3); 2237 }; 2238 2239 _createClass(Collapse, null, [{ 2240 key: "VERSION", 2241 get: function get() { 2242 return VERSION$3; 2243 } 2244 }, { 2245 key: "Default", 2246 get: function get() { 2247 return Default$1; 2248 } 2249 }]); 2250 2251 return Collapse; 2252 }(); 2253 /** 2254 * ------------------------------------------------------------------------ 2255 * Data Api implementation 2256 * ------------------------------------------------------------------------ 2257 */ 2258 2259 2260 EventHandler.on(document, Event$4.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { 2261 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 2262 if (event.target.tagName === 'A') { 2263 event.preventDefault(); 2264 } 2265 2266 var triggerData = Manipulator.getDataAttributes(this); 2267 var selector = getSelectorFromElement(this); 2268 var selectorElements = makeArray(SelectorEngine.find(selector)); 2269 selectorElements.forEach(function (element) { 2270 var data = Data.getData(element, DATA_KEY$3); 2271 var config; 2272 2273 if (data) { 2274 // update parent attribute 2275 if (data._parent === null && typeof triggerData.parent === 'string') { 2276 data._config.parent = triggerData.parent; 2277 data._parent = data._getParent(); 2278 } 2279 2280 config = 'toggle'; 2281 } else { 2282 config = triggerData; 2283 } 2284 2285 Collapse._collapseInterface(element, config); 2286 }); 2287 }); 2288 /** 2289 * ------------------------------------------------------------------------ 2290 * jQuery 2291 * ------------------------------------------------------------------------ 2292 * add .collapse to jQuery only if jQuery is present 2293 */ 2294 2295 if (typeof jQuery !== 'undefined') { 2296 var JQUERY_NO_CONFLICT$3 = jQuery.fn[NAME$3]; 2297 jQuery.fn[NAME$3] = Collapse._jQueryInterface; 2298 jQuery.fn[NAME$3].Constructor = Collapse; 2299 2300 jQuery.fn[NAME$3].noConflict = function () { 2301 jQuery.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 2302 return Collapse._jQueryInterface; 2303 }; 2304 } 2305 2306 /** 2307 * ------------------------------------------------------------------------ 2308 * Constants 2309 * ------------------------------------------------------------------------ 2310 */ 2311 2312 var NAME$4 = 'dropdown'; 2313 var VERSION$4 = '4.3.1'; 2314 var DATA_KEY$4 = 'bs.dropdown'; 2315 var EVENT_KEY$4 = "." + DATA_KEY$4; 2316 var DATA_API_KEY$4 = '.data-api'; 2317 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 2318 2319 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 2320 2321 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 2322 2323 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 2324 2325 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 2326 2327 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 2328 2329 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 2330 var Event$5 = { 2331 HIDE: "hide" + EVENT_KEY$4, 2332 HIDDEN: "hidden" + EVENT_KEY$4, 2333 SHOW: "show" + EVENT_KEY$4, 2334 SHOWN: "shown" + EVENT_KEY$4, 2335 CLICK: "click" + EVENT_KEY$4, 2336 CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, 2337 KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, 2338 KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 2339 }; 2340 var ClassName$4 = { 2341 DISABLED: 'disabled', 2342 SHOW: 'show', 2343 DROPUP: 'dropup', 2344 DROPRIGHT: 'dropright', 2345 DROPLEFT: 'dropleft', 2346 MENURIGHT: 'dropdown-menu-right', 2347 POSITION_STATIC: 'position-static' 2348 }; 2349 var Selector$4 = { 2350 DATA_TOGGLE: '[data-toggle="dropdown"]', 2351 FORM_CHILD: '.dropdown form', 2352 MENU: '.dropdown-menu', 2353 NAVBAR_NAV: '.navbar-nav', 2354 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 2355 }; 2356 var AttachmentMap = { 2357 TOP: 'top-start', 2358 TOPEND: 'top-end', 2359 BOTTOM: 'bottom-start', 2360 BOTTOMEND: 'bottom-end', 2361 RIGHT: 'right-start', 2362 RIGHTEND: 'right-end', 2363 LEFT: 'left-start', 2364 LEFTEND: 'left-end' 2365 }; 2366 var Default$2 = { 2367 offset: 0, 2368 flip: true, 2369 boundary: 'scrollParent', 2370 reference: 'toggle', 2371 display: 'dynamic' 2372 }; 2373 var DefaultType$2 = { 2374 offset: '(number|string|function)', 2375 flip: 'boolean', 2376 boundary: '(string|element)', 2377 reference: '(string|element)', 2378 display: 'string' 2379 /** 2380 * ------------------------------------------------------------------------ 2381 * Class Definition 2382 * ------------------------------------------------------------------------ 2383 */ 2384 2385 }; 2386 2387 var Dropdown = 2388 /*#__PURE__*/ 2389 function () { 2390 function Dropdown(element, config) { 2391 this._element = element; 2392 this._popper = null; 2393 this._config = this._getConfig(config); 2394 this._menu = this._getMenuElement(); 2395 this._inNavbar = this._detectNavbar(); 2396 2397 this._addEventListeners(); 2398 2399 Data.setData(element, DATA_KEY$4, this); 2400 } // Getters 2401 2402 2403 var _proto = Dropdown.prototype; 2404 2405 // Public
2406 _proto.toggle = function toggle() { 2407 if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED)) { 2408 return; 2409 } 2410 2411 var parent = Dropdown._getParentFromElement(this._element); 2412 2413 var isActive = this._menu.classList.contains(ClassName$4.SHOW); 2414 2415 Dropdown._clearMenus(); 2416 2417 if (isActive) { 2418 return; 2419 } 2420 2421 var relatedTarget = { 2422 relatedTarget: this._element 2423 }; 2424 var showEvent = EventHandler.trigger(parent, Event$5.SHOW, relatedTarget); 2425 2426 if (showEvent.defaultPrevented) { 2427 return; 2428 } // Disable totally Popper.js for Dropdown in Navbar 2429 2430 2431 if (!this._inNavbar) { 2432 /** 2433 * Check for Popper dependency 2434 * Popper - https://popper.js.org 2435 */ 2436 if (typeof Popper === 'undefined') { 2437 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)'); 2438 } 2439 2440 var referenceElement = this._element; 2441 2442 if (this._config.reference === 'parent') { 2443 referenceElement = parent; 2444 } else if (isElement(this._config.reference)) { 2445 referenceElement = this._config.reference; // Check if it's jQuery element 2446 2447 if (typeof this._config.reference.jquery !== 'undefined') { 2448 referenceElement = this._config.reference[0]; 2449 } 2450 } // If boundary is not `scrollParent`, then set position to `static` 2451 // to allow the menu to "escape" the scroll parent's boundaries 2452 // https://github.com/twbs/bootstrap/issues/24251 2453 2454 2455 if (this._config.boundary !== 'scrollParent') { 2456 parent.classList.add(ClassName$4.POSITION_STATIC); 2457 } 2458 2459 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 2460 } // If this is a touch-enabled device we add extra 2461 // empty mouseover listeners to the body's immediate children; 2462 // only needed because of broken event delegation on iOS 2463 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 2464 2465 2466 if ('ontouchstart' in document.documentElement && !makeArray(SelectorEngine.closest(parent, Selector$4.NAVBAR_NAV)).length) { 2467 makeArray(document.body.children).forEach(function (elem) { 2468 return EventHandler.on(elem, 'mouseover', null, noop()); 2469 }); 2470 } 2471 2472 this._element.focus(); 2473 2474 this._element.setAttribute('aria-expanded', true); 2475 2476 Manipulator.toggleClass(this._menu, ClassName$4.SHOW); 2477 Manipulator.toggleClass(parent, ClassName$4.SHOW); 2478 EventHandler.trigger(parent, Event$5.SHOWN, relatedTarget); 2479 }; 2480 2481 _proto.show = function show() { 2482 if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED) || this._menu.classList.contains(ClassName$4.SHOW)) { 2483 return; 2484 } 2485 2486 var parent = Dropdown._getParentFromElement(this._element); 2487 2488 var relatedTarget = { 2489 relatedTarget: this._element 2490 }; 2491 var showEvent = EventHandler.trigger(parent, Event$5.SHOW, relatedTarget); 2492 2493 if (showEvent.defaultPrevented) { 2494 return; 2495 } 2496 2497 Manipulator.toggleClass(this._menu, ClassName$4.SHOW); 2498 Manipulator.toggleClass(parent, ClassName$4.SHOW); 2499 EventHandler.trigger(parent, Event$5.SHOWN, relatedTarget); 2500 }; 2501 2502 _proto.hide = function hide() { 2503 if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED) || !this._menu.classList.contains(ClassName$4.SHOW)) { 2504 return; 2505 } 2506 2507 var parent = Dropdown._getParentFromElement(this._element); 2508 2509 var relatedTarget = { 2510 relatedTarget: this._element 2511 }; 2512 var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget); 2513 2514 if (hideEvent.defaultPrevented) { 2515 return; 2516 } 2517 2518 Manipulator.toggleClass(this._menu, ClassName$4.SHOW); 2519 Manipulator.toggleClass(parent, ClassName$4.SHOW); 2520 EventHandler.trigger(parent, Event$5.HIDDEN, relatedTarget); 2521 }; 2522 2523 _proto.dispose = function dispose() { 2524 Data.removeData(this._element, DATA_KEY$4); 2525 EventHandler.off(this._element, EVENT_KEY$4); 2526 this._element = null; 2527 this._menu = null; 2528 2529 if (this._popper !== null) { 2530 this._popper.destroy(); 2531 2532 this._popper = null; 2533 } 2534 }; 2535
2536 _proto.update = function update() { 2537 this._inNavbar = this._detectNavbar(); 2538 2539 if (this._popper !== null) { 2540 this._popper.scheduleUpdate(); 2541 } 2542 } // Private 2543 ; 2544 2545 _proto._addEventListeners = function _addEventListeners() { 2546 var _this = this; 2547 2548 EventHandler.on(this._element, Event$5.CLICK, function (event) { 2549 event.preventDefault(); 2550 event.stopPropagation(); 2551 2552 _this.toggle(); 2553 }); 2554 }; 2555 2556 _proto._getConfig = function _getConfig(config) { 2557 config = _objectSpread({}, this.constructor.Default, Manipulator.getDataAttributes(this._element), config); 2558 typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 2559 return config; 2560 }; 2561 2562 _proto._getMenuElement = function _getMenuElement() { 2563 if (!this._menu) { 2564 var parent = Dropdown._getParentFromElement(this._element); 2565 2566 if (parent) { 2567 this._menu = SelectorEngine.findOne(Selector$4.MENU, parent); 2568 } 2569 } 2570 2571 return this._menu; 2572 }; 2573 2574 _proto._getPlacement = function _getPlacement() { 2575 var parentDropdown = this._element.parentNode; 2576 var placement = AttachmentMap.BOTTOM; // Handle dropup 2577 2578 if (parentDropdown.classList.contains(ClassName$4.DROPUP)) { 2579 placement = AttachmentMap.TOP; 2580 2581 if (this._menu.classList.contains(ClassName$4.MENURIGHT)) { 2582 placement = AttachmentMap.TOPEND; 2583 } 2584 } else if (parentDropdown.classList.contains(ClassName$4.DROPRIGHT)) { 2585 placement = AttachmentMap.RIGHT; 2586 } else if (parentDropdown.classList.contains(ClassName$4.DROPLEFT)) { 2587 placement = AttachmentMap.LEFT; 2588 } else if (this._menu.classList.contains(ClassName$4.MENURIGHT)) { 2589 placement = AttachmentMap.BOTTOMEND; 2590 } 2591 2592 return placement; 2593 }; 2594 2595 _proto._detectNavbar = function _detectNavbar() { 2596 return Boolean(SelectorEngine.closest(this._element, '.navbar')); 2597 }; 2598 2599 _proto._getOffset = function _getOffset() { 2600 var _this2 = this; 2601 2602 var offset = {}; 2603 2604 if (typeof this._config.offset === 'function') { 2605 offset.fn = function (data) { 2606 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 2607 return data; 2608 }; 2609 } else { 2610 offset.offset = this._config.offset; 2611 } 2612 2613 return offset; 2614 }; 2615 2616 _proto._getPopperConfig = function _getPopperConfig() { 2617 var popperConfig = { 2618 placement: this._getPlacement(), 2619 modifiers: { 2620 offset: this._getOffset(), 2621 flip: { 2622 enabled: this._config.flip 2623 }, 2624 preventOverflow: { 2625 boundariesElement: this._config.boundary 2626 } 2627 } // Disable Popper.js if we have a static display 2628 2629 }; 2630 2631 if (this._config.display === 'static') { 2632 popperConfig.modifiers.applyStyle = { 2633 enabled: false 2634 }; 2635 } 2636 2637 return popperConfig; 2638 } // Static 2639 ; 2640 2641 Dropdown._dropdownInterface = function _dropdownInterface(element, config) { 2642 var data = Data.getData(element, DATA_KEY$4); 2643 2644 var _config = typeof config === 'object' ? config : null; 2645 2646 if (!data) { 2647 data = new Dropdown(element, _config); 2648 } 2649 2650 if (typeof config === 'string') { 2651 if (typeof data[config] === 'undefined') { 2652 throw new TypeError("No method named \"" + config + "\""); 2653 } 2654 2655 data[config](); 2656 } 2657 }; 2658 2659 Dropdown._jQueryInterface = function _jQueryInterface(config) { 2660 return this.each(function () { 2661 Dropdown._dropdownInterface(this, config); 2662 }); 2663 }; 2664 2665 Dropdown._clearMenus = function _clearMenus(event) { 2666 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 2667 return; 2668 } 2669 2670 var toggles = makeArray(SelectorEngine.find(Selector$4.DATA_TOGGLE)); 2671 2672 for (var i = 0, len = toggles.length; i < len; i++) { 2673 var parent = Dropdown._getParentFromElement(toggles[i]); 2674 2675 var context = Data.getData(toggles[i], DATA_KEY$4); 2676 var relatedTarget = { 2677 relatedTarget: toggles[i] 2678 }; 2679 2680 if (event && event.type === 'click') { 2681 relatedTarget.clickEvent = event; 2682 } 2683 2684 if (!context) { 2685 continue; 2686 } 2687 2688 var dropdownMenu = context._menu; 2689 2690 if (!parent.classList.contains(ClassName$4.SHOW)) { 2691 continue; 2692 } 2693 2694 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && parent.contains(event.target)) { 2695 continue; 2696 } 2697 2698 var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget); 2699 2700 if (hideEvent.defaultPrevented) { 2701 continue; 2702 } // If this is a touch-enabled device we remove the extra 2703 // empty mouseover listeners we added for iOS support 2704 2705 2706 if ('ontouchstart' in document.documentElement) {
2707 makeArray(document.body.children).forEach(function (elem) { 2708 return EventHandler.off(elem, 'mouseover', null, noop()); 2709 }); 2710 } 2711 2712 toggles[i].setAttribute('aria-expanded', 'false'); 2713 dropdownMenu.classList.remove(ClassName$4.SHOW); 2714 parent.classList.remove(ClassName$4.SHOW); 2715 EventHandler.trigger(parent, Event$5.HIDDEN, relatedTarget); 2716 } 2717 }; 2718 2719 Dropdown._getParentFromElement = function _getParentFromElement(element) { 2720 var parent; 2721 var selector = getSelectorFromElement(element); 2722 2723 if (selector) { 2724 parent = SelectorEngine.findOne(selector); 2725 } 2726 2727 return parent || element.parentNode; 2728 }; 2729 2730 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 2731 // If not input/textarea: 2732 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 2733 // If input/textarea: 2734 // - If space key => not a dropdown command 2735 // - If key is other than escape 2736 // - If key is not up or down => not a dropdown command 2737 // - If trigger inside the menu => not a dropdown command 2738 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || SelectorEngine.closest(event.target, Selector$4.MENU)) : !REGEXP_KEYDOWN.test(event.which)) { 2739 return; 2740 } 2741 2742 event.preventDefault(); 2743 event.stopPropagation(); 2744 2745 if (this.disabled || this.classList.contains(ClassName$4.DISABLED)) { 2746 return; 2747 } 2748 2749 var parent = Dropdown._getParentFromElement(this); 2750 2751 var isActive = parent.classList.contains(ClassName$4.SHOW); 2752 2753 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 2754 if (event.which === ESCAPE_KEYCODE) { 2755 EventHandler.trigger(SelectorEngine.findOne(Selector$4.DATA_TOGGLE, parent), 'focus'); 2756 } 2757 2758 Dropdown._clearMenus(); 2759 2760 return; 2761 } 2762 2763 var items = makeArray(SelectorEngine.find(Selector$4.VISIBLE_ITEMS, parent)); 2764 2765 if (!items.length) { 2766 return; 2767 } 2768 2769 var index = items.indexOf(event.target); 2770 2771 if (event.which === ARROW_UP_KEYCODE && index > 0) { 2772 // Up 2773 index--; 2774 } 2775 2776 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 2777 // Down 2778 index++; 2779 } 2780 2781 if (index < 0) { 2782 index = 0; 2783 } 2784 2785 items[index].focus(); 2786 }; 2787 2788 Dropdown._getInstance = function _getInstance(element) { 2789 return Data.getData(element, DATA_KEY$4); 2790 }; 2791 2792 _createClass(Dropdown, null, [{ 2793 key: "VERSION", 2794 get: function get() { 2795 return VERSION$4; 2796 } 2797 }, { 2798 key: "Default", 2799 get: function get() { 2800 return Default$2; 2801 } 2802 }, { 2803 key: "DefaultType", 2804 get: function get() { 2805 return DefaultType$2; 2806 } 2807 }]); 2808 2809 return Dropdown; 2810 }(); 2811 /** 2812 * ------------------------------------------------------------------------ 2813 * Data Api implementation 2814 * ------------------------------------------------------------------------ 2815 */ 2816 2817 2818 EventHandler.on(document, Event$5.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler); 2819 EventHandler.on(document, Event$5.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler); 2820 EventHandler.on(document, Event$5.CLICK_DATA_API, Dropdown._clearMenus); 2821 EventHandler.on(document, Event$5.KEYUP_DATA_API, Dropdown._clearMenus); 2822 EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { 2823 event.preventDefault(); 2824 event.stopPropagation(); 2825 2826 Dropdown._dropdownInterface(this, 'toggle'); 2827 }); 2828 EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { 2829 return e.stopPropagation(); 2830 }); 2831 /** 2832 * ------------------------------------------------------------------------ 2833 * jQuery 2834 * ------------------------------------------------------------------------ 2835 * add .dropdown to jQuery only if jQuery is present 2836 */ 2837 2838 if (typeof jQuery !== 'undefined') { 2839 var JQUERY_NO_CONFLICT$4 = jQuery.fn[NAME$4]; 2840 jQuery.fn[NAME$4] = Dropdown._jQueryInterface; 2841 jQuery.fn[NAME$4].Constructor = Dropdown; 2842 2843 jQuery.fn[NAME$4].noConflict = function () { 2844 jQuery.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 2845 return Dropdown._jQueryInterface; 2846 }; 2847 } 2848 2849 /** 2850 * ------------------------------------------------------------------------ 2851 * Constants 2852 * ------------------------------------------------------------------------ 2853 */ 2854 2855 var NAME$5 = 'modal'; 2856 var VERSION$5 = '4.3.1'; 2857 var DATA_KEY$5 = 'bs.modal'; 2858 var EVENT_KEY$5 = "." + DATA_KEY$5; 2859 var DATA_API_KEY$5 = '.data-api'; 2860 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 2861 2862 var Default$3 = { 2863 backdrop: true, 2864 keyboard: true, 2865 focus: true, 2866 show: true 2867 }; 2868 var DefaultType$3 = { 2869 backdrop: '(boolean|string)', 2870 keyboard: 'boolean', 2871 focus: 'boolean', 2872 show: 'boolean' 2873 }; 2874 var Event$6 = { 2875 HIDE: "hide" + EVENT_KEY$5, 2876 HIDDEN: "hidden" + EVENT_KEY$5, 2877 SHOW: "show" + EVENT_KEY$5, 2878 SHOWN: "shown" + EVENT_KEY$5, 2879 FOCUSIN: "focusin" + EVENT_KEY$5, 2880 RESIZE: "resize" + EVENT_KEY$5, 2881 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, 2882 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, 2883 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, 2884 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, 2885 CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 2886 }; 2887 var ClassName$5 = {
2888 SCROLLABLE: 'modal-dialog-scrollable', 2889 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 2890 BACKDROP: 'modal-backdrop', 2891 OPEN: 'modal-open', 2892 FADE: 'fade', 2893 SHOW: 'show' 2894 }; 2895 var Selector$5 = { 2896 DIALOG: '.modal-dialog', 2897 MODAL_BODY: '.modal-body', 2898 DATA_TOGGLE: '[data-toggle="modal"]', 2899 DATA_DISMISS: '[data-dismiss="modal"]', 2900 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 2901 STICKY_CONTENT: '.sticky-top' 2902 /** 2903 * ------------------------------------------------------------------------ 2904 * Class Definition 2905 * ------------------------------------------------------------------------ 2906 */ 2907 2908 }; 2909 2910 var Modal = 2911 /*#__PURE__*/ 2912 function () { 2913 function Modal(element, config) { 2914 this._config = this._getConfig(config); 2915 this._element = element; 2916 this._dialog = SelectorEngine.findOne(Selector$5.DIALOG, element); 2917 this._backdrop = null; 2918 this._isShown = false; 2919 this._isBodyOverflowing = false; 2920 this._ignoreBackdropClick = false; 2921 this._isTransitioning = false; 2922 this._scrollbarWidth = 0; 2923 Data.setData(element, DATA_KEY$5, this); 2924 } // Getters 2925 2926 2927 var _proto = Modal.prototype; 2928 2929 // Public 2930 _proto.toggle = function toggle(relatedTarget) { 2931 return this._isShown ? this.hide() : this.show(relatedTarget); 2932 }; 2933 2934 _proto.show = function show(relatedTarget) { 2935 var _this = this; 2936 2937 if (this._isShown || this._isTransitioning) { 2938 return; 2939 } 2940 2941 if (this._element.classList.contains(ClassName$5.FADE)) { 2942 this._isTransitioning = true; 2943 } 2944 2945 var showEvent = EventHandler.trigger(this._element, Event$6.SHOW, { 2946 relatedTarget: relatedTarget 2947 }); 2948 2949 if (this._isShown || showEvent.defaultPrevented) { 2950 return; 2951 } 2952 2953 this._isShown = true; 2954 2955 this._checkScrollbar(); 2956 2957 this._setScrollbar(); 2958 2959 this._adjustDialog(); 2960 2961 this._setEscapeEvent(); 2962 2963 this._setResizeEvent(); 2964 2965 EventHandler.on(this._element, Event$6.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { 2966 return _this.hide(event); 2967 }); 2968 EventHandler.on(this._dialog, Event$6.MOUSEDOWN_DISMISS, function () { 2969 EventHandler.one(_this._element, Event$6.MOUSEUP_DISMISS, function (event) { 2970 if (event.target === _this._element) { 2971 _this._ignoreBackdropClick = true; 2972 } 2973 }); 2974 }); 2975 2976 this._showBackdrop(function () { 2977 return _this._showElement(relatedTarget); 2978 }); 2979 }; 2980 2981 _proto.hide = function hide(event) { 2982 var _this2 = this; 2983 2984 if (event) { 2985 event.preventDefault(); 2986 } 2987 2988 if (!this._isShown || this._isTransitioning) { 2989 return; 2990 } 2991 2992 var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE); 2993 2994 if (!this._isShown || hideEvent.defaultPrevented) { 2995 return; 2996 } 2997 2998 this._isShown = false; 2999 3000 var transition = this._element.classList.contains(ClassName$5.FADE); 3001 3002 if (transition) { 3003 this._isTransitioning = true; 3004 } 3005 3006 this._setEscapeEvent(); 3007 3008 this._setResizeEvent(); 3009 3010 EventHandler.off(document, Event$6.FOCUSIN); 3011 3012 this._element.classList.remove(ClassName$5.SHOW); 3013 3014 EventHandler.off(this._element, Event$6.CLICK_DISMISS); 3015 EventHandler.off(this._dialog, Event$6.MOUSEDOWN_DISMISS); 3016 3017 if (transition) { 3018 var transitionDuration = getTransitionDurationFromElement(this._element); 3019 EventHandler.one(this._element, TRANSITION_END, function (event) { 3020 return _this2._hideModal(event); 3021 }); 3022 emulateTransitionEnd(this._element, transitionDuration); 3023 } else { 3024 this._hideModal(); 3025 } 3026 }; 3027 3028 _proto.dispose = function dispose() { 3029 [window, this._element, this._dialog].forEach(function (htmlElement) { 3030 return EventHandler.off(htmlElement, EVENT_KEY$5); 3031 }); 3032 /** 3033 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 3034 * Do not move `document` in `htmlElements` array 3035 * It will remove `Event.CLICK_DATA_API` event that should remain 3036 */ 3037 3038 EventHandler.off(document, Event$6.FOCUSIN); 3039 Data.removeData(this._element, DATA_KEY$5); 3040 this._config = null; 3041 this._element = null; 3042 this._dialog = null; 3043 this._backdrop = null; 3044 this._isShown = null; 3045 this._isBodyOverflowing = null; 3046 this._ignoreBackdropClick = null; 3047 this._isTransitioning = null; 3048 this._scrollbarWidth = null; 3049 }; 3050 3051 _proto.handleUpdate = function handleUpdate() { 3052 this._adjustDialog(); 3053 } // Private 3054 ; 3055 3056 _proto._getConfig = function _getConfig(config) { 3057 config = _objectSpread({}, Default$3, config); 3058 typeCheckConfig(NAME$5, config, DefaultType$3); 3059 return config; 3060 }; 3061 3062 _proto._showElement = function _showElement(relatedTarget) { 3063 var _this3 = this; 3064 3065 var transition = this._element.classList.contains(ClassName$5.FADE); 3066 3067 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 3068 // Don't move modal's DOM position 3069 document.body.appendChild(this._element); 3070 } 3071 3072 this._element.style.display = 'block'; 3073 3074 this._element.removeAttribute('aria-hidden'); 3075 3076 this._element.setAttribute('aria-modal', true); 3077 3078 if (this._dialog.classList.contains(ClassName$5.SCROLLABLE)) { 3079 SelectorEngine.findOne(Selector$5.MODAL_BODY, this._dialog).scrollTop = 0; 3080 } else { 3081 this._element.scrollTop = 0; 3082 } 3083 3084 if (transition) { 3085 reflow(this._element); 3086 } 3087 3088 this._element.classList.add(ClassName$5.SHOW); 3089 3090 if (this._config.focus) { 3091 this._enforceFocus(); 3092 } 3093 3094 var transitionComplete = function transitionComplete() { 3095 if (_this3._config.focus) { 3096 _this3._element.focus(); 3097 } 3098 3099 _this3._isTransitioning = false;
3100 EventHandler.trigger(_this3._element, Event$6.SHOWN, { 3101 relatedTarget: relatedTarget 3102 }); 3103 }; 3104 3105 if (transition) { 3106 var transitionDuration = getTransitionDurationFromElement(this._dialog); 3107 EventHandler.one(this._dialog, TRANSITION_END, transitionComplete); 3108 emulateTransitionEnd(this._dialog, transitionDuration); 3109 } else { 3110 transitionComplete(); 3111 } 3112 }; 3113 3114 _proto._enforceFocus = function _enforceFocus() { 3115 var _this4 = this; 3116 3117 EventHandler.off(document, Event$6.FOCUSIN); // guard against infinite focus loop 3118 3119 EventHandler.on(document, Event$6.FOCUSIN, function (event) { 3120 if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) { 3121 _this4._element.focus(); 3122 } 3123 }); 3124 }; 3125 3126 _proto._setEscapeEvent = function _setEscapeEvent() { 3127 var _this5 = this; 3128 3129 if (this._isShown && this._config.keyboard) { 3130 EventHandler.on(this._element, Event$6.KEYDOWN_DISMISS, function (event) { 3131 if (event.which === ESCAPE_KEYCODE$1) { 3132 event.preventDefault(); 3133 3134 _this5.hide(); 3135 } 3136 }); 3137 } else if (!this._isShown) { 3138 EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS); 3139 } 3140 }; 3141 3142 _proto._setResizeEvent = function _setResizeEvent() { 3143 var _this6 = this; 3144 3145 if (this._isShown) { 3146 EventHandler.on(window, Event$6.RESIZE, function (event) { 3147 return _this6.handleUpdate(event); 3148 }); 3149 } else { 3150 EventHandler.off(window, Event$6.RESIZE); 3151 } 3152 }; 3153 3154 _proto._hideModal = function _hideModal() { 3155 var _this7 = this; 3156 3157 this._element.style.display = 'none'; 3158 3159 this._element.setAttribute('aria-hidden', true); 3160 3161 this._element.removeAttribute('aria-modal'); 3162 3163 this._isTransitioning = false; 3164 3165 this._showBackdrop(function () { 3166 document.body.classList.remove(ClassName$5.OPEN); 3167 3168 _this7._resetAdjustments(); 3169 3170 _this7._resetScrollbar(); 3171 3172 EventHandler.trigger(_this7._element, Event$6.HIDDEN); 3173 }); 3174 }; 3175 3176 _proto._removeBackdrop = function _removeBackdrop() { 3177 if (this._backdrop) { 3178 this._backdrop.parentNode.removeChild(this._backdrop); 3179 3180 this._backdrop = null; 3181 } 3182 }; 3183 3184 _proto._showBackdrop = function _showBackdrop(callback) { 3185 var _this8 = this; 3186 3187 var animate = this._element.classList.contains(ClassName$5.FADE) ? ClassName$5.FADE : ''; 3188 3189 if (this._isShown && this._config.backdrop) { 3190 this._backdrop = document.createElement('div'); 3191 this._backdrop.className = ClassName$5.BACKDROP; 3192 3193 if (animate) { 3194 this._backdrop.classList.add(animate); 3195 } 3196 3197 document.body.appendChild(this._backdrop); 3198 EventHandler.on(this._element, Event$6.CLICK_DISMISS, function (event) { 3199 if (_this8._ignoreBackdropClick) { 3200 _this8._ignoreBackdropClick = false; 3201 return; 3202 } 3203 3204 if (event.target !== event.currentTarget) { 3205 return; 3206 } 3207 3208 if (_this8._config.backdrop === 'static') { 3209 _this8._element.focus(); 3210 } else { 3211 _this8.hide(); 3212 } 3213 }); 3214 3215 if (animate) { 3216 reflow(this._backdrop); 3217 } 3218 3219 this._backdrop.classList.add(ClassName$5.SHOW); 3220 3221 if (!callback) { 3222 return; 3223 } 3224 3225 if (!animate) { 3226 callback(); 3227 return; 3228 } 3229 3230 var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop); 3231 EventHandler.one(this._backdrop, TRANSITION_END, callback); 3232 emulateTransitionEnd(this._backdrop, backdropTransitionDuration); 3233 } else if (!this._isShown && this._backdrop) { 3234 this._backdrop.classList.remove(ClassName$5.SHOW); 3235 3236 var callbackRemove = function callbackRemove() { 3237 _this8._removeBackdrop(); 3238 3239 if (callback) { 3240 callback(); 3241 } 3242 }; 3243 3244 if (this._element.classList.contains(ClassName$5.FADE)) { 3245 var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop); 3246 3247 EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove); 3248 emulateTransitionEnd(this._backdrop, _backdropTransitionDuration); 3249 } else { 3250 callbackRemove(); 3251 } 3252 } else if (callback) { 3253 callback(); 3254 } 3255 } // ---------------------------------------------------------------------- 3256 // the following methods are used to handle overflowing modals 3257 // ---------------------------------------------------------------------- 3258 ; 3259
3260 _proto._adjustDialog = function _adjustDialog() { 3261 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 3262 3263 if (!this._isBodyOverflowing && isModalOverflowing) { 3264 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 3265 } 3266 3267 if (this._isBodyOverflowing && !isModalOverflowing) { 3268 this._element.style.paddingRight = this._scrollbarWidth + "px"; 3269 } 3270 }; 3271 3272 _proto._resetAdjustments = function _resetAdjustments() { 3273 this._element.style.paddingLeft = ''; 3274 this._element.style.paddingRight = ''; 3275 }; 3276 3277 _proto._checkScrollbar = function _checkScrollbar() { 3278 var rect = document.body.getBoundingClientRect(); 3279 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 3280 this._scrollbarWidth = this._getScrollbarWidth(); 3281 }; 3282 3283 _proto._setScrollbar = function _setScrollbar() { 3284 var _this9 = this; 3285 3286 if (this._isBodyOverflowing) { 3287 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 3288 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 3289 // Adjust fixed content padding 3290 makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) { 3291 var actualPadding = element.style.paddingRight; 3292 var calculatedPadding = window.getComputedStyle(element)['padding-right']; 3293 Manipulator.setDataAttribute(element, 'padding-right', actualPadding); 3294 element.style.paddingRight = parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"; 3295 }); // Adjust sticky content margin 3296 3297 makeArray(SelectorEngine.find(Selector$5.STICKY_CONTENT)).forEach(function (element) { 3298 var actualMargin = element.style.marginRight; 3299 var calculatedMargin = window.getComputedStyle(element)['margin-right']; 3300 Manipulator.setDataAttribute(element, 'margin-right', actualMargin); 3301 element.style.marginRight = parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"; 3302 }); // Adjust body padding 3303 3304 var actualPadding = document.body.style.paddingRight; 3305 var calculatedPadding = window.getComputedStyle(document.body)['padding-right']; 3306 Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding); 3307 document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px"; 3308 } 3309 3310 document.body.classList.add(ClassName$5.OPEN); 3311 }; 3312 3313 _proto._resetScrollbar = function _resetScrollbar() { 3314 // Restore fixed content padding 3315 makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) { 3316 var padding = Manipulator.getDataAttribute(element, 'padding-right'); 3317 3318 if (typeof padding !== 'undefined') { 3319 Manipulator.removeDataAttribute(element, 'padding-right'); 3320 element.style.paddingRight = padding; 3321 } 3322 }); // Restore sticky content and navbar-toggler margin 3323 3324 makeArray(SelectorEngine.find("" + Selector$5.STICKY_CONTENT)).forEach(function (element) { 3325 var margin = Manipulator.getDataAttribute(element, 'margin-right'); 3326 3327 if (typeof margin !== 'undefined') { 3328 Manipulator.removeDataAttribute(element, 'margin-right'); 3329 element.style.marginRight = margin; 3330 } 3331 }); // Restore body padding 3332 3333 var padding = Manipulator.getDataAttribute(document.body, 'padding-right'); 3334 3335 if (typeof padding === 'undefined') { 3336 document.body.style.paddingRight = ''; 3337 } else { 3338 Manipulator.removeDataAttribute(document.body, 'padding-right'); 3339 document.body.style.paddingRight = padding; 3340 } 3341 }; 3342 3343 _proto._getScrollbarWidth = function _getScrollbarWidth() { 3344 // thx d.walsh 3345 var scrollDiv = document.createElement('div'); 3346 scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; 3347 document.body.appendChild(scrollDiv); 3348 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 3349 document.body.removeChild(scrollDiv); 3350 return scrollbarWidth; 3351 } // Static 3352 ; 3353 3354 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 3355 return this.each(function () { 3356 var data = Data.getData(this, DATA_KEY$5); 3357 3358 var _config = _objectSpread({}, Default$3, Manipulator.getDataAttributes(this), typeof config === 'object' && config ? config : {}); 3359 3360 if (!data) { 3361 data = new Modal(this, _config); 3362 } 3363 3364 if (typeof config === 'string') { 3365 if (typeof data[config] === 'undefined') {
3366 throw new TypeError("No method named \"" + config + "\""); 3367 } 3368 3369 data[config](relatedTarget); 3370 } else if (_config.show) { 3371 data.show(relatedTarget); 3372 } 3373 }); 3374 }; 3375 3376 Modal._getInstance = function _getInstance(element) { 3377 return Data.getData(element, DATA_KEY$5); 3378 }; 3379 3380 _createClass(Modal, null, [{ 3381 key: "VERSION", 3382 get: function get() { 3383 return VERSION$5; 3384 } 3385 }, { 3386 key: "Default", 3387 get: function get() { 3388 return Default$3; 3389 } 3390 }]); 3391 3392 return Modal; 3393 }(); 3394 /** 3395 * ------------------------------------------------------------------------ 3396 * Data Api implementation 3397 * ------------------------------------------------------------------------ 3398 */ 3399 3400 3401 EventHandler.on(document, Event$6.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { 3402 var _this10 = this; 3403 3404 var target; 3405 var selector = getSelectorFromElement(this); 3406 3407 if (selector) { 3408 target = SelectorEngine.findOne(selector); 3409 } 3410 3411 var config = Data.getData(target, DATA_KEY$5) ? 'toggle' : _objectSpread({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this)); 3412 3413 if (this.tagName === 'A' || this.tagName === 'AREA') { 3414 event.preventDefault(); 3415 } 3416 3417 EventHandler.one(target, Event$6.SHOW, function (showEvent) { 3418 if (showEvent.defaultPrevented) { 3419 // only register focus restorer if modal will actually get shown 3420 return; 3421 } 3422 3423 EventHandler.one(target, Event$6.HIDDEN, function () { 3424 if (isVisible(_this10)) { 3425 _this10.focus(); 3426 } 3427 }); 3428 }); 3429 var data = Data.getData(target, DATA_KEY$5); 3430 3431 if (!data) { 3432 data = new Modal(target, config); 3433 } 3434 3435 data.show(this); 3436 }); 3437 /** 3438 * ------------------------------------------------------------------------ 3439 * jQuery 3440 * ------------------------------------------------------------------------ 3441 */ 3442 3443 if (typeof jQuery !== 'undefined') { 3444 var JQUERY_NO_CONFLICT$5 = jQuery.fn[NAME$5]; 3445 jQuery.fn[NAME$5] = Modal._jQueryInterface; 3446 jQuery.fn[NAME$5].Constructor = Modal; 3447 3448 jQuery.fn[NAME$5].noConflict = function () { 3449 jQuery.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 3450 return Modal._jQueryInterface; 3451 }; 3452 } 3453 3454 /** 3455 * -------------------------------------------------------------------------- 3456 * Bootstrap (v4.3.1): util/sanitizer.js 3457 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3458 * -------------------------------------------------------------------------- 3459 */ 3460 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 3461 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 3462 /** 3463 * A pattern that recognizes a commonly useful subset of URLs that are safe. 3464 * 3465 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3466 */ 3467 3468 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 3469 /** 3470 * A pattern that matches safe data URLs. Only matches image, video and audio types. 3471 * 3472 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3473 */ 3474 3475 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 3476 3477 var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) { 3478 var attrName = attr.nodeName.toLowerCase(); 3479 3480 if (allowedAttributeList.indexOf(attrName) !== -1) { 3481 if (uriAttrs.indexOf(attrName) !== -1) { 3482 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 3483 } 3484 3485 return true; 3486 } 3487 3488 var regExp = allowedAttributeList.filter(function (attrRegex) { 3489 return attrRegex instanceof RegExp; 3490 }); // Check if a regular expression validates the attribute. 3491 3492 for (var i = 0, l = regExp.length; i < l; i++) { 3493 if (attrName.match(regExp[i])) { 3494 return true; 3495 } 3496 } 3497 3498 return false;
vendor: 5,259 bytes, lines 3499-3703
3499 }; 3500 3501 var DefaultWhitelist = { 3502 // Global attributes allowed on any supplied element below. 3503 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 3504 a: ['target', 'href', 'title', 'rel'], 3505 area: [], 3506 b: [], 3507 br: [], 3508 col: [], 3509 code: [], 3510 div: [], 3511 em: [], 3512 hr: [], 3513 h1: [], 3514 h2: [], 3515 h3: [], 3516 h4: [], 3517 h5: [], 3518 h6: [], 3519 i: [], 3520 img: ['src', 'alt', 'title', 'width', 'height'], 3521 li: [], 3522 ol: [], 3523 p: [], 3524 pre: [], 3525 s: [], 3526 small: [], 3527 span: [], 3528 sub: [], 3529 sup: [], 3530 strong: [], 3531 u: [], 3532 ul: [] 3533 }; 3534 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 3535 if (!unsafeHtml.length) { 3536 return unsafeHtml; 3537 } 3538 3539 if (sanitizeFn && typeof sanitizeFn === 'function') { 3540 return sanitizeFn(unsafeHtml); 3541 } 3542 3543 var domParser = new window.DOMParser(); 3544 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 3545 var whitelistKeys = Object.keys(whiteList); 3546 var elements = makeArray(createdDocument.body.querySelectorAll('*')); 3547 3548 var _loop = function _loop(i, len) { 3549 var el = elements[i]; 3550 var elName = el.nodeName.toLowerCase(); 3551 3552 if (whitelistKeys.indexOf(elName) === -1) { 3553 el.parentNode.removeChild(el); 3554 return "continue"; 3555 } 3556 3557 var attributeList = makeArray(el.attributes); 3558 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 3559 attributeList.forEach(function (attr) { 3560 if (!allowedAttribute(attr, whitelistedAttributes)) { 3561 el.removeAttribute(attr.nodeName); 3562 } 3563 }); 3564 }; 3565 3566 for (var i = 0, len = elements.length; i < len; i++) { 3567 var _ret = _loop(i, len); 3568 3569 if (_ret === "continue") continue; 3570 } 3571 3572 return createdDocument.body.innerHTML; 3573 } 3574 3575 /** 3576 * ------------------------------------------------------------------------ 3577 * Constants 3578 * ------------------------------------------------------------------------ 3579 */ 3580 3581 var NAME$6 = 'tooltip'; 3582 var VERSION$6 = '4.3.1'; 3583 var DATA_KEY$6 = 'bs.tooltip'; 3584 var EVENT_KEY$6 = "." + DATA_KEY$6; 3585 var CLASS_PREFIX = 'bs-tooltip'; 3586 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 3587 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 3588 var DefaultType$4 = { 3589 animation: 'boolean', 3590 template: 'string', 3591 title: '(string|element|function)', 3592 trigger: 'string', 3593 delay: '(number|object)', 3594 html: 'boolean', 3595 selector: '(string|boolean)', 3596 placement: '(string|function)', 3597 offset: '(number|string|function)', 3598 container: '(string|element|boolean)', 3599 fallbackPlacement: '(string|array)', 3600 boundary: '(string|element)', 3601 sanitize: 'boolean', 3602 sanitizeFn: '(null|function)', 3603 whiteList: 'object' 3604 }; 3605 var AttachmentMap$1 = { 3606 AUTO: 'auto', 3607 TOP: 'top', 3608 RIGHT: 'right', 3609 BOTTOM: 'bottom', 3610 LEFT: 'left' 3611 }; 3612 var Default$4 = { 3613 animation: true, 3614 template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>', 3615 trigger: 'hover focus', 3616 title: '', 3617 delay: 0, 3618 html: false, 3619 selector: false, 3620 placement: 'top', 3621 offset: 0, 3622 container: false, 3623 fallbackPlacement: 'flip', 3624 boundary: 'scrollParent', 3625 sanitize: true, 3626 sanitizeFn: null, 3627 whiteList: DefaultWhitelist 3628 }; 3629 var HoverState = { 3630 SHOW: 'show', 3631 OUT: 'out' 3632 }; 3633 var Event$7 = { 3634 HIDE: "hide" + EVENT_KEY$6, 3635 HIDDEN: "hidden" + EVENT_KEY$6, 3636 SHOW: "show" + EVENT_KEY$6, 3637 SHOWN: "shown" + EVENT_KEY$6, 3638 INSERTED: "inserted" + EVENT_KEY$6, 3639 CLICK: "click" + EVENT_KEY$6, 3640 FOCUSIN: "focusin" + EVENT_KEY$6, 3641 FOCUSOUT: "focusout" + EVENT_KEY$6, 3642 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 3643 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 3644 }; 3645 var ClassName$6 = { 3646 FADE: 'fade', 3647 SHOW: 'show' 3648 }; 3649 var Selector$6 = { 3650 TOOLTIP_INNER: '.tooltip-inner', 3651 TOOLTIP_ARROW: '.tooltip-arrow' 3652 }; 3653 var Trigger = { 3654 HOVER: 'hover', 3655 FOCUS: 'focus', 3656 CLICK: 'click', 3657 MANUAL: 'manual' 3658 /** 3659 * ------------------------------------------------------------------------ 3660 * Class Definition 3661 * ------------------------------------------------------------------------ 3662 */ 3663 3664 }; 3665 3666 var Tooltip = 3667 /*#__PURE__*/ 3668 function () { 3669 function Tooltip(element, config) { 3670 /** 3671 * Check for Popper dependency 3672 * Popper - https://popper.js.org 3673 */ 3674 if (typeof Popper === 'undefined') { 3675 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)'); 3676 } // private 3677 3678 3679 this._isEnabled = true; 3680 this._timeout = 0; 3681 this._hoverState = ''; 3682 this._activeTrigger = {}; 3683 this._popper = null; // Protected 3684 3685 this.element = element; 3686 this.config = this._getConfig(config); 3687 this.tip = null; 3688 3689 this._setListeners(); 3690 3691 Data.setData(element, this.constructor.DATA_KEY, this); 3692 } // Getters 3693 3694 3695 var _proto = Tooltip.prototype; 3696 3697 // Public 3698 _proto.enable = function enable() { 3699 this._isEnabled = true; 3700 }; 3701 3702 _proto.disable = function disable() { 3703 this._isEnabled = false;
3704 }; 3705 3706 _proto.toggleEnabled = function toggleEnabled() { 3707 this._isEnabled = !this._isEnabled; 3708 }; 3709 3710 _proto.toggle = function toggle(event) { 3711 if (!this._isEnabled) { 3712 return; 3713 } 3714 3715 if (event) { 3716 var dataKey = this.constructor.DATA_KEY; 3717 var context = Data.getData(event.delegateTarget, dataKey); 3718 3719 if (!context) { 3720 context = new this.constructor(event.delegateTarget, this._getDelegateConfig()); 3721 Data.setData(event.delegateTarget, dataKey, context); 3722 } 3723 3724 context._activeTrigger.click = !context._activeTrigger.click; 3725 3726 if (context._isWithActiveTrigger()) { 3727 context._enter(null, context); 3728 } else { 3729 context._leave(null, context); 3730 } 3731 } else { 3732 if (this.getTipElement().classList.contains(ClassName$6.SHOW)) { 3733 this._leave(null, this); 3734 3735 return; 3736 } 3737 3738 this._enter(null, this); 3739 } 3740 }; 3741 3742 _proto.dispose = function dispose() { 3743 clearTimeout(this._timeout); 3744 Data.removeData(this.element, this.constructor.DATA_KEY); 3745 EventHandler.off(this.element, this.constructor.EVENT_KEY); 3746 EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal'); 3747 3748 if (this.tip) { 3749 this.tip.parentNode.removeChild(this.tip); 3750 } 3751 3752 this._isEnabled = null; 3753 this._timeout = null; 3754 this._hoverState = null; 3755 this._activeTrigger = null; 3756 3757 if (this._popper !== null) { 3758 this._popper.destroy(); 3759 } 3760 3761 this._popper = null; 3762 this.element = null; 3763 this.config = null; 3764 this.tip = null; 3765 }; 3766 3767 _proto.show = function show() { 3768 var _this = this; 3769 3770 if (this.element.style.display === 'none') { 3771 throw new Error('Please use show on visible elements'); 3772 } 3773 3774 if (this.isWithContent() && this._isEnabled) { 3775 var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW); 3776 var shadowRoot = findShadowRoot(this.element); 3777 var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element); 3778 3779 if (showEvent.defaultPrevented || !isInTheDom) { 3780 return; 3781 } 3782 3783 var tip = this.getTipElement(); 3784 var tipId = getUID(this.constructor.NAME);
3785 tip.setAttribute('id', tipId); 3786 this.element.setAttribute('aria-describedby', tipId); 3787 this.setContent(); 3788 3789 if (this.config.animation) { 3790 tip.classList.add(ClassName$6.FADE); 3791 } 3792 3793 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 3794 3795 var attachment = this._getAttachment(placement); 3796 3797 this.addAttachmentClass(attachment); 3798 3799 var container = this._getContainer(); 3800 3801 Data.setData(tip, this.constructor.DATA_KEY, this); 3802 3803 if (!this.element.ownerDocument.documentElement.contains(this.tip)) { 3804 container.appendChild(tip); 3805 } 3806 3807 EventHandler.trigger(this.element, this.constructor.Event.INSERTED); 3808 this._popper = new Popper(this.element, tip, { 3809 placement: attachment, 3810 modifiers: { 3811 offset: this._getOffset(), 3812 flip: { 3813 behavior: this.config.fallbackPlacement 3814 }, 3815 arrow: { 3816 element: Selector$6.TOOLTIP_ARROW 3817 }, 3818 preventOverflow: { 3819 boundariesElement: this.config.boundary 3820 } 3821 }, 3822 onCreate: function onCreate(data) { 3823 if (data.originalPlacement !== data.placement) { 3824 _this._handlePopperPlacementChange(data); 3825 } 3826 }, 3827 onUpdate: function onUpdate(data) { 3828 return _this._handlePopperPlacementChange(data); 3829 } 3830 }); 3831 tip.classList.add(ClassName$6.SHOW); // If this is a touch-enabled device we add extra 3832 // empty mouseover listeners to the body's immediate children; 3833 // only needed because of broken event delegation on iOS 3834 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3835 3836 if ('ontouchstart' in document.documentElement) { 3837 makeArray(document.body.children).forEach(function (element) { 3838 EventHandler.on(element, 'mouseover', noop()); 3839 }); 3840 } 3841 3842 var complete = function complete() { 3843 if (_this.config.animation) { 3844 _this._fixTransition(); 3845 } 3846 3847 var prevHoverState = _this._hoverState; 3848 _this._hoverState = null; 3849 EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN); 3850 3851 if (prevHoverState === HoverState.OUT) { 3852 _this._leave(null, _this); 3853 } 3854 }; 3855 3856 if (this.tip.classList.contains(ClassName$6.FADE)) { 3857 var transitionDuration = getTransitionDurationFromElement(this.tip); 3858 EventHandler.one(this.tip, TRANSITION_END, complete); 3859 emulateTransitionEnd(this.tip, transitionDuration); 3860 } else { 3861 complete(); 3862 } 3863 } 3864 }; 3865 3866 _proto.hide = function hide(callback) { 3867 var _this2 = this; 3868 3869 var tip = this.getTipElement(); 3870 3871 var complete = function complete() { 3872 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 3873 tip.parentNode.removeChild(tip); 3874 } 3875 3876 _this2._cleanTipClass(); 3877 3878 _this2.element.removeAttribute('aria-describedby'); 3879 3880 EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN); 3881 3882 if (_this2._popper !== null) { 3883 _this2._popper.destroy(); 3884 } 3885 3886 if (callback) { 3887 callback(); 3888 } 3889 }; 3890 3891 var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE); 3892 3893 if (hideEvent.defaultPrevented) { 3894 return; 3895 } 3896 3897 tip.classList.remove(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra 3898 // empty mouseover listeners we added for iOS support 3899 3900 if ('ontouchstart' in document.documentElement) { 3901 makeArray(document.body.children).forEach(function (element) { 3902 return EventHandler.off(element, 'mouseover', noop); 3903 }); 3904 } 3905 3906 this._activeTrigger[Trigger.CLICK] = false; 3907 this._activeTrigger[Trigger.FOCUS] = false; 3908 this._activeTrigger[Trigger.HOVER] = false;
3909 3910 if (this.tip.classList.contains(ClassName$6.FADE)) { 3911 var transitionDuration = getTransitionDurationFromElement(tip); 3912 EventHandler.one(tip, TRANSITION_END, complete); 3913 emulateTransitionEnd(tip, transitionDuration); 3914 } else { 3915 complete(); 3916 } 3917 3918 this._hoverState = ''; 3919 }; 3920 3921 _proto.update = function update() { 3922 if (this._popper !== null) { 3923 this._popper.scheduleUpdate(); 3924 } 3925 } // Protected 3926 ; 3927 3928 _proto.isWithContent = function isWithContent() { 3929 return Boolean(this.getTitle()); 3930 }; 3931 3932 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3933 this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); 3934 }; 3935 3936 _proto.getTipElement = function getTipElement() { 3937 if (this.tip) { 3938 return this.tip; 3939 } 3940 3941 var element = document.createElement('div'); 3942 element.innerHTML = this.config.template; 3943 this.tip = element.children[0]; 3944 return this.tip; 3945 }; 3946 3947 _proto.setContent = function setContent() { 3948 var tip = this.getTipElement(); 3949 this.setElementContent(SelectorEngine.findOne(Selector$6.TOOLTIP_INNER, tip), this.getTitle()); 3950 tip.classList.remove(ClassName$6.FADE); 3951 tip.classList.remove(ClassName$6.SHOW); 3952 }; 3953 3954 _proto.setElementContent = function setElementContent(element, content) { 3955 if (element === null) { 3956 return; 3957 } 3958 3959 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 3960 if (content.jquery) { 3961 content = content[0]; 3962 } // content is a DOM node or a jQuery 3963 3964 3965 if (this.config.html) { 3966 if (content.parentNode !== element) { 3967 element.innerHTML = ''; 3968 element.appendChild(content); 3969 } 3970 } else { 3971 element.innerText = content.textContent; 3972 } 3973 3974 return; 3975 } 3976 3977 if (this.config.html) { 3978 if (this.config.sanitize) { 3979 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 3980 } 3981 3982 element.innerHTML = content; 3983 } else { 3984 element.innerText = content; 3985 } 3986 }; 3987 3988 _proto.getTitle = function getTitle() { 3989 var title = this.element.getAttribute('data-original-title'); 3990 3991 if (!title) { 3992 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 3993 } 3994 3995 return title; 3996 } // Private 3997 ; 3998 3999 _proto._getOffset = function _getOffset() { 4000 var _this3 = this; 4001 4002 var offset = {}; 4003 4004 if (typeof this.config.offset === 'function') { 4005 offset.fn = function (data) { 4006 data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); 4007 return data; 4008 }; 4009 } else { 4010 offset.offset = this.config.offset; 4011 } 4012 4013 return offset; 4014 }; 4015 4016 _proto._getContainer = function _getContainer() { 4017 if (this.config.container === false) { 4018 return document.body; 4019 } 4020 4021 if (isElement(this.config.container)) { 4022 return this.config.container; 4023 } 4024 4025 return SelectorEngine.findOne(this.config.container); 4026 }; 4027 4028 _proto._getAttachment = function _getAttachment(placement) { 4029 return AttachmentMap$1[placement.toUpperCase()]; 4030 }; 4031 4032 _proto._setListeners = function _setListeners() { 4033 var _this4 = this; 4034 4035 var triggers = this.config.trigger.split(' '); 4036 triggers.forEach(function (trigger) { 4037 if (trigger === 'click') { 4038 EventHandler.on(_this4.element, _this4.constructor.Event.CLICK, _this4.config.selector, function (event) { 4039 return _this4.toggle(event); 4040 }); 4041 } else if (trigger !== Trigger.MANUAL) { 4042 var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; 4043 var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; 4044 EventHandler.on(_this4.element, eventIn, _this4.config.selector, function (event) { 4045 return _this4._enter(event); 4046 }); 4047 EventHandler.on(_this4.element, eventOut, _this4.config.selector, function (event) { 4048 return _this4._leave(event); 4049 }); 4050 } 4051 }); 4052 EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', function () { 4053 if (_this4.element) { 4054 _this4.hide(); 4055 } 4056 }); 4057 4058 if (this.config.selector) { 4059 this.config = _objectSpread({}, this.config, { 4060 trigger: 'manual', 4061 selector: '' 4062 }); 4063 } else { 4064 this._fixTitle(); 4065 } 4066 }; 4067 4068 _proto._fixTitle = function _fixTitle() { 4069 var titleType = typeof this.element.getAttribute('data-original-title'); 4070 4071 if (this.element.getAttribute('title') || titleType !== 'string') { 4072 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 4073 this.element.setAttribute('title', ''); 4074 } 4075 }; 4076 4077 _proto._enter = function _enter(event, context) { 4078 var dataKey = this.constructor.DATA_KEY; 4079 context = context || Data.getData(event.delegateTarget, dataKey); 4080 4081 if (!context) { 4082 context = new this.constructor(event.delegateTarget, this._getDelegateConfig()); 4083 Data.setData(event.delegateTarget, dataKey, context); 4084 } 4085 4086 if (event) { 4087 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 4088 } 4089 4090 if (context.getTipElement().classList.contains(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { 4091 context._hoverState = HoverState.SHOW; 4092 return; 4093 } 4094 4095 clearTimeout(context._timeout); 4096 context._hoverState = HoverState.SHOW; 4097 4098 if (!context.config.delay || !context.config.delay.show) { 4099 context.show(); 4100 return; 4101 } 4102 4103 context._timeout = setTimeout(function () { 4104 if (context._hoverState === HoverState.SHOW) { 4105 context.show(); 4106 } 4107 }, context.config.delay.show); 4108 }; 4109 4110 _proto._leave = function _leave(event, context) { 4111 var dataKey = this.constructor.DATA_KEY; 4112 context = context || Data.getData(event.delegateTarget, dataKey); 4113 4114 if (!context) { 4115 context = new this.constructor(event.delegateTarget, this._getDelegateConfig()); 4116 Data.setData(event.delegateTarget, dataKey, context); 4117 } 4118 4119 if (event) { 4120 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
vendor: 2,496 bytes, lines 4121-4211
4121 } 4122 4123 if (context._isWithActiveTrigger()) { 4124 return; 4125 } 4126 4127 clearTimeout(context._timeout); 4128 context._hoverState = HoverState.OUT; 4129 4130 if (!context.config.delay || !context.config.delay.hide) { 4131 context.hide(); 4132 return; 4133 } 4134 4135 context._timeout = setTimeout(function () { 4136 if (context._hoverState === HoverState.OUT) { 4137 context.hide(); 4138 } 4139 }, context.config.delay.hide); 4140 }; 4141 4142 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 4143 for (var trigger in this._activeTrigger) { 4144 if (this._activeTrigger[trigger]) { 4145 return true; 4146 } 4147 } 4148 4149 return false; 4150 }; 4151 4152 _proto._getConfig = function _getConfig(config) { 4153 var dataAttributes = Manipulator.getDataAttributes(this.element); 4154 Object.keys(dataAttributes).forEach(function (dataAttr) { 4155 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 4156 delete dataAttributes[dataAttr]; 4157 } 4158 }); 4159 4160 if (config && typeof config.container === 'object' && config.container.jquery) { 4161 config.container = config.container[0]; 4162 } 4163 4164 config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 4165 4166 if (typeof config.delay === 'number') { 4167 config.delay = { 4168 show: config.delay, 4169 hide: config.delay 4170 }; 4171 } 4172 4173 if (typeof config.title === 'number') { 4174 config.title = config.title.toString(); 4175 } 4176 4177 if (typeof config.content === 'number') { 4178 config.content = config.content.toString(); 4179 } 4180 4181 typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 4182 4183 if (config.sanitize) { 4184 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 4185 } 4186 4187 return config; 4188 }; 4189 4190 _proto._getDelegateConfig = function _getDelegateConfig() { 4191 var config = {}; 4192 4193 if (this.config) { 4194 for (var key in this.config) { 4195 if (this.constructor.Default[key] !== this.config[key]) { 4196 config[key] = this.config[key]; 4197 } 4198 } 4199 } 4200 4201 return config; 4202 }; 4203 4204 _proto._cleanTipClass = function _cleanTipClass() { 4205 var tip = this.getTipElement(); 4206 var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX); 4207 4208 if (tabClass !== null && tabClass.length) { 4209 tabClass.map(function (token) { 4210 return token.trim(); 4211 }
4211).forEach(function (tClass) { 4212 return tip.classList.remove(tClass); 4213 }); 4214 } 4215 }; 4216 4217 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 4218 var popperInstance = popperData.instance; 4219 this.tip = popperInstance.popper; 4220 4221 this._cleanTipClass(); 4222 4223 this.addAttachmentClass(this._getAttachment(popperData.placement)); 4224 }; 4225 4226 _proto._fixTransition = function _fixTransition() { 4227 var tip = this.getTipElement(); 4228 var initConfigAnimation = this.config.animation; 4229 4230 if (tip.getAttribute('x-placement') !== null) { 4231 return; 4232 } 4233 4234 tip.classList.remove(ClassName$6.FADE); 4235 this.config.animation = false; 4236 this.hide(); 4237 this.show(); 4238 this.config.animation = initConfigAnimation; 4239 } // Static 4240 ; 4241 4242 Tooltip._jQueryInterface = function _jQueryInterface(config) { 4243 return this.each(function () { 4244 var data = Data.getData(this, DATA_KEY$6); 4245 4246 var _config = typeof config === 'object' && config; 4247 4248 if (!data && /dispose|hide/.test(config)) { 4249 return; 4250 } 4251 4252 if (!data) { 4253 data = new Tooltip(this, _config); 4254 } 4255 4256 if (typeof config === 'string') { 4257 if (typeof data[config] === 'undefined') { 4258 throw new TypeError("No method named \"" + config + "\""); 4259 } 4260 4261 data[config](); 4262 } 4263 }); 4264 }; 4265 4266 Tooltip._getInstance = function _getInstance(element) { 4267 return Data.getData(element, DATA_KEY$6); 4268 }; 4269 4270 _createClass(Tooltip, null, [{ 4271 key: "VERSION", 4272 get: function get() { 4273 return VERSION$6; 4274 } 4275 }, { 4276 key: "Default", 4277 get: function get() { 4278 return Default$4; 4279 } 4280 }, { 4281 key: "NAME", 4282 get: function get() { 4283 return NAME$6; 4284 } 4285 }, { 4286 key: "DATA_KEY", 4287 get: function get() { 4288 return DATA_KEY$6; 4289 } 4290 }, { 4291 key: "Event", 4292 get: function get() { 4293 return Event$7; 4294 } 4295 }, { 4296 key: "EVENT_KEY", 4297 get: function get() { 4298 return EVENT_KEY$6; 4299 } 4300 }, { 4301 key: "DefaultType", 4302 get: function get() { 4303 return DefaultType$4; 4304 } 4305 }]); 4306 4307 return Tooltip; 4308 }(); 4309 /** 4310 * ------------------------------------------------------------------------ 4311 * jQuery 4312 * ------------------------------------------------------------------------ 4313 * add .tooltip to jQuery only if jQuery is present 4314 */ 4315 4316 4317 if (typeof jQuery !== 'undefined') { 4318 var JQUERY_NO_CONFLICT$6 = jQuery.fn[NAME$6]; 4319 jQuery.fn[NAME$6] = Tooltip._jQueryInterface; 4320 jQuery.fn[NAME$6].Constructor = Tooltip; 4321 4322 jQuery.fn[NAME$6].noConflict = function () { 4323 jQuery.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 4324 return Tooltip._jQueryInterface; 4325 }; 4326 } 4327 4328 /** 4329 * ------------------------------------------------------------------------ 4330 * Constants 4331 * ------------------------------------------------------------------------ 4332 */ 4333 4334 var NAME$7 = 'popover'; 4335 var VERSION$7 = '4.3.1'; 4336 var DATA_KEY$7 = 'bs.popover'; 4337 var EVENT_KEY$7 = "." + DATA_KEY$7; 4338 var CLASS_PREFIX$1 = 'bs-popover'; 4339 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 4340 4341 var Default$5 = _objectSpread({}, Tooltip.Default, { 4342 placement: 'right', 4343 trigger: 'click', 4344 content: '', 4345 template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 4346 }); 4347 4348 var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { 4349 content: '(string|element|function)' 4350 }); 4351 4352 var ClassName$7 = { 4353 FADE: 'fade', 4354 SHOW: 'show' 4355 }; 4356 var Selector$7 = { 4357 TITLE: '.popover-header', 4358 CONTENT: '.popover-body' 4359 }; 4360 var Event$8 = { 4361 HIDE: "hide" + EVENT_KEY$7, 4362 HIDDEN: "hidden" + EVENT_KEY$7, 4363 SHOW: "show" + EVENT_KEY$7, 4364 SHOWN: "shown" + EVENT_KEY$7, 4365 INSERTED: "inserted" + EVENT_KEY$7, 4366 CLICK: "click" + EVENT_KEY$7, 4367 FOCUSIN: "focusin" + EVENT_KEY$7, 4368 FOCUSOUT: "focusout" + EVENT_KEY$7, 4369 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 4370 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 4371 /** 4372 * ------------------------------------------------------------------------ 4373 * Class Definition 4374 * ------------------------------------------------------------------------ 4375 */ 4376 4377 }; 4378 4379 var Popover = 4380 /*#__PURE__*/ 4381 function (_Tooltip) { 4382 _inheritsLoose(Popover, _Tooltip); 4383 4384 function Popover() { 4385 return _Tooltip.apply(this, arguments) || this; 4386 } 4387 4388 var _proto = Popover.prototype; 4389 4390 // Overrides 4391 _proto.isWithContent = function isWithContent() { 4392 return this.getTitle() || this._getContent(); 4393 }; 4394 4395 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 4396 this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment); 4397 }; 4398 4399 _proto.setContent = function setContent() { 4400 var tip = this.getTipElement(); // we use append for html objects to maintain js events 4401 4402 this.setElementContent(SelectorEngine.findOne(Selector$7.TITLE, tip), this.getTitle()); 4403 4404 var content = this._getContent(); 4405 4406 if (typeof content === 'function') { 4407 content = content.call(this.element); 4408 } 4409 4410 this.setElementContent(SelectorEngine.findOne(Selector$7.CONTENT, tip), content); 4411 tip.classList.remove(ClassName$7.FADE); 4412 tip.classList.remove(ClassName$7.SHOW); 4413 } // Private 4414 ; 4415 4416 _proto._getContent = function _getContent() { 4417 return this.element.getAttribute('data-content') || this.config.content; 4418 }; 4419 4420 _proto._cleanTipClass = function _cleanTipClass() { 4421 var tip = this.getTipElement(); 4422 var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1); 4423 4424 if (tabClass !== null && tabClass.length > 0) { 4425 tabClass.map(function (token) { 4426 return token.trim(); 4427 }
4427).forEach(function (tClass) { 4428 return tip.classList.remove(tClass); 4429 }); 4430 } 4431 } // Static 4432 ; 4433 4434 Popover._jQueryInterface = function _jQueryInterface(config) { 4435 return this.each(function () { 4436 var data = Data.getData(this, DATA_KEY$7); 4437 4438 var _config = typeof config === 'object' ? config : null; 4439 4440 if (!data && /dispose|hide/.test(config)) { 4441 return; 4442 } 4443 4444 if (!data) { 4445 data = new Popover(this, _config); 4446 Data.setData(this, DATA_KEY$7, data); 4447 } 4448 4449 if (typeof config === 'string') { 4450 if (typeof data[config] === 'undefined') { 4451 throw new TypeError("No method named \"" + config + "\""); 4452 } 4453 4454 data[config](); 4455 } 4456 }); 4457 }; 4458 4459 Popover._getInstance = function _getInstance(element) { 4460 return Data.getData(element, DATA_KEY$7); 4461 }; 4462 4463 _createClass(Popover, null, [{ 4464 key: "VERSION", 4465 // Getters 4466 get: function get() { 4467 return VERSION$7; 4468 } 4469 }, { 4470 key: "Default", 4471 get: function get() { 4472 return Default$5; 4473 } 4474 }, { 4475 key: "NAME", 4476 get: function get() { 4477 return NAME$7; 4478 } 4479 }, { 4480 key: "DATA_KEY", 4481 get: function get() { 4482 return DATA_KEY$7; 4483 } 4484 }, { 4485 key: "Event", 4486 get: function get() { 4487 return Event$8; 4488 } 4489 }, { 4490 key: "EVENT_KEY", 4491 get: function get() { 4492 return EVENT_KEY$7; 4493 } 4494 }, { 4495 key: "DefaultType", 4496 get: function get() { 4497 return DefaultType$5; 4498 } 4499 }]); 4500 4501 return Popover; 4502 }(Tooltip); 4503 /** 4504 * ------------------------------------------------------------------------ 4505 * jQuery 4506 * ------------------------------------------------------------------------ 4507 */ 4508 4509 4510 if (typeof jQuery !== 'undefined') { 4511 var JQUERY_NO_CONFLICT$7 = jQuery.fn[NAME$7]; 4512 jQuery.fn[NAME$7] = Popover._jQueryInterface; 4513 jQuery.fn[NAME$7].Constructor = Popover; 4514 4515 jQuery.fn[NAME$7].noConflict = function () { 4516 jQuery.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 4517 return Popover._jQueryInterface; 4518 }; 4519 } 4520 4521 /** 4522 * ------------------------------------------------------------------------ 4523 * Constants 4524 * ------------------------------------------------------------------------ 4525 */ 4526 4527 var NAME$8 = 'scrollspy'; 4528 var VERSION$8 = '4.3.1'; 4529 var DATA_KEY$8 = 'bs.scrollspy'; 4530 var EVENT_KEY$8 = "." + DATA_KEY$8; 4531 var DATA_API_KEY$6 = '.data-api'; 4532 var Default$6 = { 4533 offset: 10, 4534 method: 'auto', 4535 target: '' 4536 }; 4537 var DefaultType$6 = { 4538 offset: 'number', 4539 method: 'string', 4540 target: '(string|element)' 4541 }; 4542 var Event$9 = { 4543 ACTIVATE: "activate" + EVENT_KEY$8, 4544 SCROLL: "scroll" + EVENT_KEY$8, 4545 LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 4546 }; 4547 var ClassName$8 = { 4548 DROPDOWN_ITEM: 'dropdown-item', 4549 ACTIVE: 'active' 4550 }; 4551 var Selector$8 = { 4552 DATA_SPY: '[data-spy="scroll"]', 4553 NAV_LIST_GROUP: '.nav, .list-group', 4554 NAV_LINKS: '.nav-link', 4555 NAV_ITEMS: '.nav-item', 4556 LIST_ITEMS: '.list-group-item', 4557 DROPDOWN: '.dropdown', 4558 DROPDOWN_TOGGLE: '.dropdown-toggle' 4559 }; 4560 var OffsetMethod = { 4561 OFFSET: 'offset', 4562 POSITION: 'position' 4563 /** 4564 * ------------------------------------------------------------------------ 4565 * Class Definition 4566 * ------------------------------------------------------------------------ 4567 */ 4568 4569 }; 4570 4571 var ScrollSpy = 4572 /*#__PURE__*/ 4573 function () { 4574 function ScrollSpy(element, config) { 4575 var _this = this; 4576 4577 this._element = element; 4578 this._scrollElement = element.tagName === 'BODY' ? window : element; 4579 this._config = this._getConfig(config); 4580 this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " ." + ClassName$8.DROPDOWN_ITEM); 4581 this._offsets = []; 4582 this._targets = []; 4583 this._activeTarget = null; 4584 this._scrollHeight = 0; 4585 EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) { 4586 return _this._process(event); 4587 }); 4588 this.refresh(); 4589 4590 this._process(); 4591 4592 Data.setData(element, DATA_KEY$8, this); 4593 } // Getters 4594 4595 4596 var _proto = ScrollSpy.prototype; 4597 4598 // Public 4599 _proto.refresh = function refresh() { 4600 var _this2 = this; 4601 4602 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 4603 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 4604 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 4605 this._offsets = []; 4606 this._targets = []; 4607 this._scrollHeight = this._getScrollHeight(); 4608 var targets = makeArray(SelectorEngine.find(this._selector)); 4609 targets.map(function (element) { 4610 var target; 4611 var targetSelector = getSelectorFromElement(element); 4612
4613 if (targetSelector) { 4614 target = SelectorEngine.findOne(targetSelector); 4615 } 4616 4617 if (target) { 4618 var targetBCR = target.getBoundingClientRect(); 4619 4620 if (targetBCR.width || targetBCR.height) { 4621 return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector]; 4622 } 4623 } 4624 4625 return null; 4626 }).filter(function (item) { 4627 return item; 4628 }).sort(function (a, b) { 4629 return a[0] - b[0]; 4630 }).forEach(function (item) { 4631 _this2._offsets.push(item[0]); 4632 4633 _this2._targets.push(item[1]); 4634 }); 4635 }; 4636 4637 _proto.dispose = function dispose() { 4638 Data.removeData(this._element, DATA_KEY$8); 4639 EventHandler.off(this._scrollElement, EVENT_KEY$8); 4640 this._element = null; 4641 this._scrollElement = null; 4642 this._config = null; 4643 this._selector = null; 4644 this._offsets = null; 4645 this._targets = null; 4646 this._activeTarget = null; 4647 this._scrollHeight = null; 4648 } // Private 4649 ; 4650 4651 _proto._getConfig = function _getConfig(config) { 4652 config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); 4653 4654 if (typeof config.target !== 'string') { 4655 var id = config.target.id; 4656 4657 if (!id) { 4658 id = getUID(NAME$8); 4659 config.target.id = id; 4660 } 4661 4662 config.target = "#" + id; 4663 } 4664 4665 typeCheckConfig(NAME$8, config, DefaultType$6); 4666 return config; 4667 }; 4668 4669 _proto._getScrollTop = function _getScrollTop() { 4670 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 4671 }; 4672 4673 _proto._getScrollHeight = function _getScrollHeight() { 4674 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 4675 }; 4676 4677 _proto._getOffsetHeight = function _getOffsetHeight() { 4678 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 4679 }; 4680 4681 _proto._process = function _process() { 4682 var scrollTop = this._getScrollTop() + this._config.offset; 4683 4684 var scrollHeight = this._getScrollHeight(); 4685 4686 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 4687 4688 if (this._scrollHeight !== scrollHeight) { 4689 this.refresh(); 4690 } 4691 4692 if (scrollTop >= maxScroll) { 4693 var target = this._targets[this._targets.length - 1]; 4694 4695 if (this._activeTarget !== target) { 4696 this._activate(target); 4697 } 4698 4699 return; 4700 } 4701 4702 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 4703 this._activeTarget = null; 4704 4705 this._clear(); 4706 4707 return; 4708 } 4709 4710 var offsetLength = this._offsets.length; 4711 4712 for (var i = offsetLength; i--;) { 4713 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 4714 4715 if (isActiveTarget) { 4716 this._activate(this._targets[i]); 4717 } 4718 } 4719 }; 4720 4721 _proto._activate = function _activate(target) { 4722 this._activeTarget = target; 4723 4724 this._clear(); 4725 4726 var queries = this._selector.split(',').map(function (selector) { 4727 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 4728 }); 4729 4730 var link = SelectorEngine.findOne(queries.join(',')); 4731 4732 if (link.classList.contains(ClassName$8.DROPDOWN_ITEM)) { 4733 SelectorEngine.findOne(Selector$8.DROPDOWN_TOGGLE, SelectorEngine.closest(link, Selector$8.DROPDOWN)).classList.add(ClassName$8.ACTIVE); 4734 link.classList.add(ClassName$8.ACTIVE); 4735 } else { 4736 // Set triggered link as active 4737 link.classList.add(ClassName$8.ACTIVE); 4738 SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) { 4739 // Set triggered links parents as active
4740 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 4741 SelectorEngine.prev(listGroup, Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).forEach(function (item) { 4742 return item.classList.add(ClassName$8.ACTIVE); 4743 }); // Handle special case when .nav-link is inside .nav-item 4744 4745 SelectorEngine.prev(listGroup, Selector$8.NAV_ITEMS).forEach(function (navItem) { 4746 SelectorEngine.children(navItem, Selector$8.NAV_LINKS).forEach(function (item) { 4747 return item.classList.add(ClassName$8.ACTIVE); 4748 }); 4749 }); 4750 }); 4751 } 4752 4753 EventHandler.trigger(this._scrollElement, Event$9.ACTIVATE, { 4754 relatedTarget: target 4755 }); 4756 }; 4757 4758 _proto._clear = function _clear() { 4759 makeArray(SelectorEngine.find(this._selector)).filter(function (node) { 4760 return node.classList.contains(ClassName$8.ACTIVE); 4761 }).forEach(function (node) { 4762 return node.classList.remove(ClassName$8.ACTIVE); 4763 }); 4764 } // Static 4765 ; 4766 4767 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 4768 return this.each(function () { 4769 var data = Data.getData(this, DATA_KEY$8); 4770 4771 var _config = typeof config === 'object' && config; 4772 4773 if (!data) { 4774 data = new ScrollSpy(this, _config); 4775 } 4776 4777 if (typeof config === 'string') { 4778 if (typeof data[config] === 'undefined') { 4779 throw new TypeError("No method named \"" + config + "\""); 4780 } 4781 4782 data[config](); 4783 } 4784 }); 4785 }; 4786 4787 ScrollSpy._getInstance = function _getInstance(element) { 4788 return Data.getData(element, DATA_KEY$8); 4789 }; 4790 4791 _createClass(ScrollSpy, null, [{ 4792 key: "VERSION", 4793 get: function get() { 4794 return VERSION$8; 4795 } 4796 }, { 4797 key: "Default", 4798 get: function get() { 4799 return Default$6; 4800 } 4801 }]); 4802 4803 return ScrollSpy; 4804 }(); 4805 /** 4806 * ------------------------------------------------------------------------ 4807 * Data Api implementation 4808 * ------------------------------------------------------------------------ 4809 */ 4810 4811 4812 EventHandler.on(window, Event$9.LOAD_DATA_API, function () { 4813 makeArray(SelectorEngine.find(Selector$8.DATA_SPY)).forEach(function (spy) { 4814 return new ScrollSpy(spy, Manipulator.getDataAttributes(spy)); 4815 }); 4816 }); 4817 /** 4818 * ------------------------------------------------------------------------ 4819 * jQuery 4820 * ------------------------------------------------------------------------ 4821 */ 4822 4823 if (typeof jQuery !== 'undefined') { 4824 var JQUERY_NO_CONFLICT$8 = jQuery.fn[NAME$8]; 4825 jQuery.fn[NAME$8] = ScrollSpy._jQueryInterface; 4826 jQuery.fn[NAME$8].Constructor = ScrollSpy; 4827 4828 jQuery.fn[NAME$8].noConflict = function () { 4829 jQuery.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 4830 return ScrollSpy._jQueryInterface; 4831 }; 4832 } 4833 4834 /** 4835 * ------------------------------------------------------------------------ 4836 * Constants 4837 * ------------------------------------------------------------------------ 4838 */ 4839 4840 var NAME$9 = 'tab'; 4841 var VERSION$9 = '4.3.1'; 4842 var DATA_KEY$9 = 'bs.tab'; 4843 var EVENT_KEY$9 = "." + DATA_KEY$9; 4844 var DATA_API_KEY$7 = '.data-api'; 4845 var Event$a = { 4846 HIDE: "hide" + EVENT_KEY$9, 4847 HIDDEN: "hidden" + EVENT_KEY$9, 4848 SHOW: "show" + EVENT_KEY$9, 4849 SHOWN: "shown" + EVENT_KEY$9, 4850 CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 4851 }; 4852 var ClassName$9 = { 4853 DROPDOWN_MENU: 'dropdown-menu', 4854 ACTIVE: 'active', 4855 DISABLED: 'disabled', 4856 FADE: 'fade', 4857 SHOW: 'show' 4858 }; 4859 var Selector$9 = { 4860 DROPDOWN: '.dropdown', 4861 NAV_LIST_GROUP: '.nav, .list-group', 4862 ACTIVE: '.active', 4863 ACTIVE_UL: ':scope > li > .active', 4864 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 4865 DROPDOWN_TOGGLE: '.dropdown-toggle', 4866 DROPDOWN_ACTIVE_CHILD: ':scope > .dropdown-menu .active' 4867 /** 4868 * ------------------------------------------------------------------------ 4869 * Class Definition 4870 * ------------------------------------------------------------------------ 4871 */ 4872 4873 }; 4874 4875 var Tab = 4876 /*#__PURE__*/ 4877 function () { 4878 function Tab(element) { 4879 this._element = element; 4880 Data.setData(this._element, DATA_KEY$9, this); 4881 } // Getters 4882 4883 4884 var _proto = Tab.prototype; 4885 4886 // Public 4887 _proto.show = function show() { 4888 var _this = this; 4889 4890 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(ClassName$9.ACTIVE) || this._element.classList.contains(ClassName$9.DISABLED)) { 4891 return; 4892 } 4893 4894 var target; 4895 var previous; 4896 var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP); 4897 var selector = getSelectorFromElement(this._element); 4898 4899 if (listElement) { 4900 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; 4901 previous = makeArray(SelectorEngine.find(itemSelector, listElement)); 4902 previous = previous[previous.length - 1]; 4903 } 4904 4905 var hideEvent = null; 4906 4907 if (previous) { 4908 hideEvent = EventHandler.trigger(previous, Event$a.HIDE, { 4909 relatedTarget: this._element 4910 }); 4911 } 4912 4913 var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, { 4914 relatedTarget: previous 4915 }); 4916 4917 if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) { 4918 return; 4919 } 4920 4921 if (selector) { 4922 target = SelectorEngine.findOne(selector); 4923 } 4924 4925 this._activate(this._element, listElement); 4926 4927 var complete = function complete() { 4928 EventHandler.trigger(previous, Event$a.HIDDEN, { 4929 relatedTarget: _this._element 4930 }); 4931 EventHandler.trigger(_this._element, Event$a.SHOWN, { 4932 relatedTarget: previous 4933 }); 4934 }; 4935 4936 if (target) { 4937 this._activate(target, target.parentNode, complete); 4938 } else { 4939 complete(); 4940 } 4941 }; 4942 4943 _proto.dispose = function dispose() { 4944 Data.removeData(this._element, DATA_KEY$9); 4945 this._element = null; 4946 } // Private 4947 ; 4948 4949 _proto._activate = function _activate(element, container, callback) { 4950 var _this2 = this; 4951 4952 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(Selector$9.ACTIVE_UL, container) : SelectorEngine.children(container, Selector$9.ACTIVE); 4953 var active = activeElements[0]; 4954 var isTransitioning = callback && active && active.classList.contains(ClassName$9.FADE); 4955 4956 var complete = function complete() { 4957 return _this2._transitionComplete(element, active, callback); 4958 }; 4959 4960 if (active && isTransitioning) { 4961 var transitionDuration = getTransitionDurationFromElement(active); 4962 active.classList.remove(ClassName$9.SHOW); 4963 EventHandler.one(active, TRANSITION_END, complete); 4964 emulateTransitionEnd(active, transitionDuration); 4965 } else { 4966 complete(); 4967 } 4968 }; 4969 4970 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 4971 if (active) { 4972 active.classList.remove(ClassName$9.ACTIVE);
4973 var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode); 4974 4975 if (dropdownChild) { 4976 dropdownChild.classList.remove(ClassName$9.ACTIVE); 4977 } 4978 4979 if (active.getAttribute('role') === 'tab') { 4980 active.setAttribute('aria-selected', false); 4981 } 4982 } 4983 4984 element.classList.add(ClassName$9.ACTIVE); 4985 4986 if (element.getAttribute('role') === 'tab') { 4987 element.setAttribute('aria-selected', true); 4988 } 4989 4990 reflow(element); 4991 4992 if (element.classList.contains(ClassName$9.FADE)) { 4993 element.classList.add(ClassName$9.SHOW); 4994 } 4995 4996 if (element.parentNode && element.parentNode.classList.contains(ClassName$9.DROPDOWN_MENU)) { 4997 var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN); 4998 4999 if (dropdownElement) { 5000 makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) { 5001 return dropdown.classList.add(ClassName$9.ACTIVE); 5002 }); 5003 } 5004 5005 element.setAttribute('aria-expanded', true); 5006 } 5007 5008 if (callback) { 5009 callback(); 5010 } 5011 } // Static 5012 ; 5013 5014 Tab._jQueryInterface = function _jQueryInterface(config) { 5015 return this.each(function () { 5016 var data = Data.getData(this, DATA_KEY$9) || new Tab(this); 5017 5018 if (typeof config === 'string') { 5019 if (typeof data[config] === 'undefined') { 5020 throw new TypeError("No method named \"" + config + "\""); 5021 } 5022 5023 data[config](); 5024 } 5025 }); 5026 }; 5027 5028 Tab._getInstance = function _getInstance(element) { 5029 return Data.getData(element, DATA_KEY$9); 5030 }; 5031 5032 _createClass(Tab, null, [{ 5033 key: "VERSION", 5034 get: function get() { 5035 return VERSION$9; 5036 } 5037 }]); 5038 5039 return Tab; 5040 }(); 5041 /** 5042 * ------------------------------------------------------------------------ 5043 * Data Api implementation 5044 * ------------------------------------------------------------------------ 5045 */ 5046 5047 5048 EventHandler.on(document, Event$a.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { 5049 event.preventDefault(); 5050 var data = Data.getData(this, DATA_KEY$9) || new Tab(this); 5051 data.show(); 5052 }); 5053 /** 5054 * ------------------------------------------------------------------------ 5055 * jQuery 5056 * ------------------------------------------------------------------------ 5057 * add .tab to jQuery only if jQuery is present 5058 */ 5059 5060 if (typeof jQuery !== 'undefined') { 5061 var JQUERY_NO_CONFLICT$9 = jQuery.fn[NAME$9]; 5062 jQuery.fn[NAME$9] = Tab._jQueryInterface; 5063 jQuery.fn[NAME$9].Constructor = Tab; 5064 5065 jQuery.fn[NAME$9].noConflict = function () { 5066 jQuery.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 5067 return Tab._jQueryInterface; 5068 }; 5069 } 5070 5071 /** 5072 * ------------------------------------------------------------------------ 5073 * Constants 5074 * ------------------------------------------------------------------------ 5075 */ 5076 5077 var NAME$a = 'toast'; 5078 var VERSION$a = '4.3.1'; 5079 var DATA_KEY$a = 'bs.toast'; 5080 var EVENT_KEY$a = "." + DATA_KEY$a; 5081 var Event$b = { 5082 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, 5083 HIDE: "hide" + EVENT_KEY$a, 5084 HIDDEN: "hidden" + EVENT_KEY$a, 5085 SHOW: "show" + EVENT_KEY$a, 5086 SHOWN: "shown" + EVENT_KEY$a 5087 }; 5088 var ClassName$a = { 5089 FADE: 'fade', 5090 HIDE: 'hide', 5091 SHOW: 'show', 5092 SHOWING: 'showing' 5093 }; 5094 var DefaultType$7 = { 5095 animation: 'boolean', 5096 autohide: 'boolean', 5097 delay: 'number' 5098 }; 5099 var Default$7 = { 5100 animation: true, 5101 autohide: true, 5102 delay: 500 5103 }; 5104 var Selector$a = { 5105 DATA_DISMISS: '[data-dismiss="toast"]' 5106 /** 5107 * ------------------------------------------------------------------------ 5108 * Class Definition 5109 * ------------------------------------------------------------------------ 5110 */ 5111 5112 }; 5113 5114 var Toast = 5115 /*#__PURE__*/ 5116 function () { 5117 function Toast(element, config) { 5118 this._element = element; 5119 this._config = this._getConfig(config); 5120 this._timeout = null; 5121 5122 this._setListeners(); 5123 5124 Data.setData(element, DATA_KEY$a, this); 5125 } // Getters 5126 5127 5128 var _proto = Toast.prototype; 5129 5130 // Public 5131 _proto.show = function show() { 5132 var _this = this; 5133 5134 EventHandler.trigger(this._element, Event$b.SHOW); 5135 5136 if (this._config.animation) { 5137 this._element.classList.add(ClassName$a.FADE); 5138 } 5139 5140 var complete = function complete() { 5141 _this._element.classList.remove(ClassName$a.SHOWING); 5142 5143 _this._element.classList.add(ClassName$a.SHOW); 5144 5145 EventHandler.trigger(_this._element, Event$b.SHOWN); 5146 5147 if (_this._config.autohide) { 5148 _this._timeout = setTimeout(function () { 5149 _this.hide(); 5150 }, _this._config.delay); 5151 } 5152 }; 5153 5154 this._element.classList.remove(ClassName$a.HIDE); 5155 5156 this._element.classList.add(ClassName$a.SHOWING); 5157 5158 if (this._config.animation) { 5159 var transitionDuration = getTransitionDurationFromElement(this._element); 5160 EventHandler.one(this._element, TRANSITION_END, complete); 5161 emulateTransitionEnd(this._element, transitionDuration); 5162 } else { 5163 complete(); 5164 } 5165 }; 5166 5167 _proto.hide = function hide() { 5168 var _this2 = this; 5169 5170 if (!this._element.classList.contains(ClassName$a.SHOW)) { 5171 return; 5172 } 5173 5174 EventHandler.trigger(this._element, Event$b.HIDE); 5175 5176 var complete = function complete() { 5177 _this2._element.classList.add(ClassName$a.HIDE); 5178 5179 EventHandler.trigger(_this2._element, Event$b.HIDDEN); 5180 }; 5181 5182 this._element.classList.remove(ClassName$a.SHOW); 5183 5184 if (this._config.animation) { 5185 var transitionDuration = getTransitionDurationFromElement(this._element); 5186 EventHandler.one(this._element, TRANSITION_END, complete); 5187 emulateTransitionEnd(this._element, transitionDuration); 5188 } else { 5189 complete(); 5190 } 5191 }; 5192 5193 _proto.dispose = function dispose() { 5194 clearTimeout(this._timeout); 5195 this._timeout = null; 5196 5197 if (this._element.classList.contains(ClassName$a.SHOW)) { 5198 this._element.classList.remove(ClassName$a.SHOW); 5199 } 5200 5201 EventHandler.off(this._element, Event$b.CLICK_DISMISS); 5202 Data.removeData(this._element, DATA_KEY$a); 5203 this._element = null; 5204 this._config = null; 5205 } // Private 5206 ; 5207 5208 _proto._getConfig = function _getConfig(config) { 5209 config = _objectSpread({}, Default$7, Manipulator.getDataAttributes(this._element), typeof config === 'object' && config ? config : {}); 5210 typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 5211 return config; 5212 }; 5213 5214 _proto._setListeners = function _setListeners() { 5215 var _this3 = this; 5216 5217 EventHandler.on(this._element, Event$b.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { 5218 return _this3.hide(); 5219 }); 5220 } // Static 5221 ; 5222 5223 Toast._jQueryInterface = function _jQueryInterface(config) { 5224 return this.each(function () { 5225 var data = Data.getData(this, DATA_KEY$a); 5226 5227 var _config = typeof config === 'object' && config; 5228 5229 if (!data) { 5230 data = new Toast(this, _config); 5231 } 5232 5233 if (typeof config === 'string') { 5234 if (typeof data[config] === 'undefined') {
5235 throw new TypeError("No method named \"" + config + "\""); 5236 } 5237 5238 data[config](this); 5239 } 5240 }); 5241 }; 5242 5243 Toast._getInstance = function _getInstance(element) { 5244 return Data.getData(element, DATA_KEY$a); 5245 }; 5246 5247 _createClass(Toast, null, [{ 5248 key: "VERSION", 5249 get: function get() { 5250 return VERSION$a; 5251 } 5252 }, { 5253 key: "DefaultType", 5254 get: function get() { 5255 return DefaultType$7; 5256 } 5257 }, { 5258 key: "Default", 5259 get: function get() { 5260 return Default$7; 5261 } 5262 }]); 5263 5264 return Toast; 5265 }(); 5266 /** 5267 * ------------------------------------------------------------------------ 5268 * jQuery 5269 * ------------------------------------------------------------------------ 5270 * add .toast to jQuery only if jQuery is present 5271 */ 5272 5273 5274 if (typeof jQuery !== 'undefined') { 5275 var JQUERY_NO_CONFLICT$a = jQuery.fn[NAME$a]; 5276 jQuery.fn[NAME$a] = Toast._jQueryInterface; 5277 jQuery.fn[NAME$a].Constructor = Toast; 5278 5279 jQuery.fn[NAME$a].noConflict = function () { 5280 jQuery.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 5281 return Toast._jQueryInterface; 5282 }; 5283 } 5284 5285 /** 5286 * -------------------------------------------------------------------------- 5287 * Bootstrap (v4.3.1): index.umd.js 5288 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5289 * -------------------------------------------------------------------------- 5290 */ 5291 var index_umd = { 5292 Alert: Alert, 5293 Button: Button, 5294 Carousel: Carousel, 5295 Collapse: Collapse, 5296 Dropdown: Dropdown, 5297 Modal: Modal, 5298 Popover: Popover, 5299 ScrollSpy: ScrollSpy, 5300 Tab: Tab, 5301 Toast: Toast, 5302 Tooltip: Tooltip 5303 }; 5304 5305 return index_umd; 5306 5307})); 5308//# sourceMappingURL=bootstrap.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.