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