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