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