vendor: 10,387 bytes, lines 1-347
1/*! 2 * Bootstrap v5.2.0 (https://getbootstrap.com/) 3 * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5 */ 6(function (global, factory) { 7 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 8 typeof define === 'function' && define.amd ? define(factory) : 9 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory()); 10})(this, (function () { 'use strict'; 11 12 /** 13 * -------------------------------------------------------------------------- 14 * Bootstrap (v5.2.0): util/index.js 15 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 16 * -------------------------------------------------------------------------- 17 */ 18 const MAX_UID = 1000000; 19 const MILLISECONDS_MULTIPLIER = 1000; 20 const TRANSITION_END = 'transitionend'; // Shout-out Angus Croll (https://goo.gl/pxwQGp) 21 22 const toType = object => { 23 if (object === null || object === undefined) { 24 return `${object}`; 25 } 26 27 return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); 28 }; 29 /** 30 * Public Util API 31 */ 32 33 34 const getUID = prefix => { 35 do { 36 prefix += Math.floor(Math.random() * MAX_UID); 37 } while (document.getElementById(prefix)); 38 39 return prefix; 40 }; 41 42 const getSelector = element => { 43 let selector = element.getAttribute('data-bs-target'); 44 45 if (!selector || selector === '#') { 46 let hrefAttribute = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes, 47 // so everything starting with `#` or `.`. If a "real" URL is used as the selector, 48 // `document.querySelector` will rightfully complain it is invalid. 49 // See https://github.com/twbs/bootstrap/issues/32273 50 51 if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) { 52 return null; 53 } // Just in case some CMS puts out a full URL with the anchor appended 54 55 56 if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { 57 hrefAttribute = `#${hrefAttribute.split('#')[1]}`; 58 } 59 60 selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; 61 } 62 63 return selector; 64 }; 65 66 const getSelectorFromElement = element => { 67 const selector = getSelector(element); 68 69 if (selector) { 70 return document.querySelector(selector) ? selector : null; 71 } 72 73 return null; 74 }; 75 76 const getElementFromSelector = element => { 77 const selector = getSelector(element); 78 return selector ? document.querySelector(selector) : null; 79 }; 80 81 const getTransitionDurationFromElement = element => { 82 if (!element) { 83 return 0; 84 } // Get transition-duration of the element 85 86 87 let { 88 transitionDuration, 89 transitionDelay 90 } = window.getComputedStyle(element); 91 const floatTransitionDuration = Number.parseFloat(transitionDuration); 92 const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 93 94 if (!floatTransitionDuration && !floatTransitionDelay) { 95 return 0; 96 } // If multiple durations are defined, take the first 97 98 99 transitionDuration = transitionDuration.split(',')[0]; 100 transitionDelay = transitionDelay.split(',')[0]; 101 return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 102 }; 103 104 const triggerTransitionEnd = element => { 105 element.dispatchEvent(new Event(TRANSITION_END)); 106 }; 107 108 const isElement$1 = object => { 109 if (!object || typeof object !== 'object') { 110 return false; 111 } 112 113 if (typeof object.jquery !== 'undefined') { 114 object = object[0]; 115 } 116 117 return typeof object.nodeType !== 'undefined'; 118 }; 119 120 const getElement = object => { 121 // it's a jQuery object or a node element 122 if (isElement$1(object)) { 123 return object.jquery ? object[0] : object; 124 } 125 126 if (typeof object === 'string' && object.length > 0) { 127 return document.querySelector(object); 128 } 129 130 return null; 131 }; 132 133 const isVisible = element => { 134 if (!isElement$1(element) || element.getClientRects().length === 0) { 135 return false; 136 } 137 138 const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed 139 140 const closedDetails = element.closest('details:not([open])'); 141 142 if (!closedDetails) { 143 return elementIsVisible; 144 } 145 146 if (closedDetails !== element) { 147 const summary = element.closest('summary'); 148 149 if (summary && summary.parentNode !== closedDetails) { 150 return false; 151 } 152 153 if (summary === null) { 154 return false; 155 } 156 } 157 158 return elementIsVisible; 159 }; 160 161 const isDisabled = element => { 162 if (!element || element.nodeType !== Node.ELEMENT_NODE) { 163 return true; 164 } 165 166 if (element.classList.contains('disabled')) { 167 return true; 168 } 169 170 if (typeof element.disabled !== 'undefined') { 171 return element.disabled; 172 } 173 174 return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; 175 }; 176 177 const findShadowRoot = element => { 178 if (!document.documentElement.attachShadow) { 179 return null; 180 } // Can find the shadow root otherwise it'll return the document 181 182 183 if (typeof element.getRootNode === 'function') { 184 const root = element.getRootNode(); 185 return root instanceof ShadowRoot ? root : null; 186 } 187 188 if (element instanceof ShadowRoot) { 189 return element; 190 } // when we don't find a shadow root 191 192 193 if (!element.parentNode) { 194 return null; 195 } 196 197 return findShadowRoot(element.parentNode); 198 }; 199 200 const noop = () => {}; 201 /** 202 * Trick to restart an element's animation 203 * 204 * @param {HTMLElement} element 205 * @return void 206 * 207 * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation 208 */ 209 210 211 const reflow = element => { 212 element.offsetHeight; // eslint-disable-line no-unused-expressions 213 }; 214 215 const getjQuery = () => { 216 if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { 217 return window.jQuery; 218 } 219 220 return null; 221 }; 222 223 const DOMContentLoadedCallbacks = []; 224 225 const onDOMContentLoaded = callback => { 226 if (document.readyState === 'loading') { 227 // add listener on the first call when the document is in loading state 228 if (!DOMContentLoadedCallbacks.length) { 229 document.addEventListener('DOMContentLoaded', () => { 230 for (const callback of DOMContentLoadedCallbacks) { 231 callback(); 232 } 233 }); 234 } 235 236 DOMContentLoadedCallbacks.push(callback); 237 } else { 238 callback(); 239 } 240 }; 241 242 const isRTL = () => document.documentElement.dir === 'rtl'; 243 244 const defineJQueryPlugin = plugin => { 245 onDOMContentLoaded(() => { 246 const $ = getjQuery(); 247 /* istanbul ignore if */ 248 249 if ($) { 250 const name = plugin.NAME; 251 const JQUERY_NO_CONFLICT = $.fn[name]; 252 $.fn[name] = plugin.jQueryInterface; 253 $.fn[name].Constructor = plugin; 254 255 $.fn[name].noConflict = () => { 256 $.fn[name] = JQUERY_NO_CONFLICT; 257 return plugin.jQueryInterface; 258 }; 259 } 260 }); 261 }; 262 263 const execute = callback => { 264 if (typeof callback === 'function') { 265 callback(); 266 } 267 }; 268 269 const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { 270 if (!waitForTransition) { 271 execute(callback); 272 return; 273 } 274 275 const durationPadding = 5; 276 const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; 277 let called = false; 278 279 const handler = ({ 280 target 281 }) => { 282 if (target !== transitionElement) { 283 return; 284 } 285 286 called = true; 287 transitionElement.removeEventListener(TRANSITION_END, handler); 288 execute(callback); 289 }; 290 291 transitionElement.addEventListener(TRANSITION_END, handler); 292 setTimeout(() => { 293 if (!called) { 294 triggerTransitionEnd(transitionElement); 295 } 296 }, emulatedDuration); 297 }; 298 /** 299 * Return the previous/next element of a list. 300 * 301 * @param {array} list The list of elements 302 * @param activeElement The active element 303 * @param shouldGetNext Choose to get next or previous element 304 * @param isCycleAllowed 305 * @return {Element|elem} The proper element 306 */ 307 308 309 const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { 310 const listLength = list.length; 311 let index = list.indexOf(activeElement); // if the element does not exist in the list return an element 312 // depending on the direction and if cycle is allowed 313 314 if (index === -1) { 315 return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]; 316 } 317 318 index += shouldGetNext ? 1 : -1; 319 320 if (isCycleAllowed) { 321 index = (index + listLength) % listLength; 322 } 323 324 return list[Math.max(0, Math.min(index, listLength - 1))]; 325 }; 326 327 /** 328 * -------------------------------------------------------------------------- 329 * Bootstrap (v5.2.0): dom/event-handler.js 330 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 331 * -------------------------------------------------------------------------- 332 */ 333 /** 334 * Constants 335 */ 336 337 const namespaceRegex = /[^.]*(?=\..*)\.|.*/; 338 const stripNameRegex = /\..*/; 339 const stripUidRegex = /::\d+$/; 340 const eventRegistry = {}; // Events storage 341 342 let uidEvent = 1; 343 const customEvents = { 344 mouseenter: 'mouseover', 345 mouseleave: 'mouseout' 346 }; 347 const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'ke
347ypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); 348 /** 349 * Private methods 350 */ 351 352 function makeEventUid(element, uid) { 353 return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; 354 } 355 356 function getElementEvents(element) { 357 const uid = makeEventUid(element); 358 element.uidEvent = uid; 359 eventRegistry[uid] = eventRegistry[uid] || {}; 360 return eventRegistry[uid]; 361 } 362 363 function bootstrapHandler(element, fn) { 364 return function handler(event) { 365 hydrateObj(event, { 366 delegateTarget: element 367 }); 368 369 if (handler.oneOff) { 370 EventHandler.off(element, event.type, fn); 371 } 372 373 return fn.apply(element, [event]);
vendor: 5,195 bytes, lines 374-517
374 }; 375 } 376 377 function bootstrapDelegationHandler(element, selector, fn) { 378 return function handler(event) { 379 const domElements = element.querySelectorAll(selector); 380 381 for (let { 382 target 383 } = event; target && target !== this; target = target.parentNode) { 384 for (const domElement of domElements) { 385 if (domElement !== target) { 386 continue; 387 } 388 389 hydrateObj(event, { 390 delegateTarget: target 391 }); 392 393 if (handler.oneOff) { 394 EventHandler.off(element, event.type, selector, fn); 395 } 396 397 return fn.apply(target, [event]); 398 } 399 } 400 }; 401 } 402 403 function findHandler(events, callable, delegationSelector = null) { 404 return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); 405 } 406 407 function normalizeParameters(originalTypeEvent, handler, delegationFunction) { 408 const isDelegated = typeof handler === 'string'; // todo: tooltip passes `false` instead of selector, so we need to check 409 410 const callable = isDelegated ? delegationFunction : handler || delegationFunction; 411 let typeEvent = getTypeEvent(originalTypeEvent); 412 413 if (!nativeEvents.has(typeEvent)) { 414 typeEvent = originalTypeEvent; 415 } 416 417 return [isDelegated, callable, typeEvent]; 418 } 419 420 function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) { 421 if (typeof originalTypeEvent !== 'string' || !element) { 422 return; 423 } 424 425 let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position 426 // this prevents the handler from being dispatched the same way as mouseover or mouseout does 427 428 if (originalTypeEvent in customEvents) { 429 const wrapFunction = fn => { 430 return function (event) { 431 if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { 432 return fn.call(this, event); 433 } 434 }; 435 }; 436 437 callable = wrapFunction(callable); 438 } 439 440 const events = getElementEvents(element); 441 const handlers = events[typeEvent] || (events[typeEvent] = {}); 442 const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); 443 444 if (previousFunction) { 445 previousFunction.oneOff = previousFunction.oneOff && oneOff; 446 return; 447 } 448 449 const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); 450 const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); 451 fn.delegationSelector = isDelegated ? handler : null; 452 fn.callable = callable; 453 fn.oneOff = oneOff; 454 fn.uidEvent = uid; 455 handlers[uid] = fn; 456 element.addEventListener(typeEvent, fn, isDelegated); 457 } 458 459 function removeHandler(element, events, typeEvent, handler, delegationSelector) { 460 const fn = findHandler(events[typeEvent], handler, delegationSelector); 461 462 if (!fn) { 463 return; 464 } 465 466 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); 467 delete events[typeEvent][fn.uidEvent]; 468 } 469 470 function removeNamespacedHandlers(element, events, typeEvent, namespace) { 471 const storeElementEvent = events[typeEvent] || {}; 472 473 for (const handlerKey of Object.keys(storeElementEvent)) { 474 if (handlerKey.includes(namespace)) { 475 const event = storeElementEvent[handlerKey]; 476 removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); 477 } 478 } 479 } 480 481 function getTypeEvent(event) { 482 // allow to get the native events from namespaced events ('click.bs.button' --> 'click') 483 event = event.replace(stripNameRegex, ''); 484 return customEvents[event] || event; 485 } 486 487 const EventHandler = { 488 on(element, event, handler, delegationFunction) { 489 addHandler(element, event, handler, delegationFunction, false); 490 }, 491 492 one(element, event, handler, delegationFunction) { 493 addHandler(element, event, handler, delegationFunction, true); 494 }, 495 496 off(element, originalTypeEvent, handler, delegationFunction) { 497 if (typeof originalTypeEvent !== 'string' || !element) { 498 return; 499 } 500 501 const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); 502 const inNamespace = typeEvent !== originalTypeEvent; 503 const events = getElementEvents(element); 504 const storeElementEvent = events[typeEvent] || {}; 505 const isNamespace = originalTypeEvent.startsWith('.'); 506 507 if (typeof callable !== 'undefined') { 508 // Simplest case: handler is passed, remove that listener ONLY. 509 if (!Object.keys(storeElementEvent).length) { 510 return; 511 } 512 513 removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null); 514 return; 515 } 516 517 if (isNamespace) {
vendor: 8,181 bytes, lines 518-812
518 for (const elementEvent of Object.keys(events)) { 519 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); 520 } 521 } 522 523 for (const keyHandlers of Object.keys(storeElementEvent)) { 524 const handlerKey = keyHandlers.replace(stripUidRegex, ''); 525 526 if (!inNamespace || originalTypeEvent.includes(handlerKey)) { 527 const event = storeElementEvent[keyHandlers]; 528 removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); 529 } 530 } 531 }, 532 533 trigger(element, event, args) { 534 if (typeof event !== 'string' || !element) { 535 return null; 536 } 537 538 const $ = getjQuery(); 539 const typeEvent = getTypeEvent(event); 540 const inNamespace = event !== typeEvent; 541 let jQueryEvent = null; 542 let bubbles = true; 543 let nativeDispatch = true; 544 let defaultPrevented = false; 545 546 if (inNamespace && $) { 547 jQueryEvent = $.Event(event, args); 548 $(element).trigger(jQueryEvent); 549 bubbles = !jQueryEvent.isPropagationStopped(); 550 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); 551 defaultPrevented = jQueryEvent.isDefaultPrevented(); 552 } 553 554 let evt = new Event(event, { 555 bubbles, 556 cancelable: true 557 }); 558 evt = hydrateObj(evt, args); 559 560 if (defaultPrevented) { 561 evt.preventDefault(); 562 } 563 564 if (nativeDispatch) { 565 element.dispatchEvent(evt); 566 } 567 568 if (evt.defaultPrevented && jQueryEvent) { 569 jQueryEvent.preventDefault(); 570 } 571 572 return evt; 573 } 574 575 }; 576 577 function hydrateObj(obj, meta) { 578 for (const [key, value] of Object.entries(meta || {})) { 579 try { 580 obj[key] = value; 581 } catch (_unused) { 582 Object.defineProperty(obj, key, { 583 configurable: true, 584 585 get() { 586 return value; 587 } 588 589 }); 590 } 591 } 592 593 return obj; 594 } 595 596 /** 597 * -------------------------------------------------------------------------- 598 * Bootstrap (v5.2.0): dom/data.js 599 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 600 * -------------------------------------------------------------------------- 601 */ 602 603 /** 604 * Constants 605 */ 606 const elementMap = new Map(); 607 const Data = { 608 set(element, key, instance) { 609 if (!elementMap.has(element)) { 610 elementMap.set(element, new Map()); 611 } 612 613 const instanceMap = elementMap.get(element); // make it clear we only want one instance per element 614 // can be removed later when multiple key/instances are fine to be used 615 616 if (!instanceMap.has(key) && instanceMap.size !== 0) { 617 // eslint-disable-next-line no-console 618 console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); 619 return; 620 } 621 622 instanceMap.set(key, instance); 623 }, 624 625 get(element, key) { 626 if (elementMap.has(element)) { 627 return elementMap.get(element).get(key) || null; 628 } 629 630 return null; 631 }, 632 633 remove(element, key) { 634 if (!elementMap.has(element)) { 635 return; 636 } 637 638 const instanceMap = elementMap.get(element); 639 instanceMap.delete(key); // free up element references if there are no instances left for an element 640 641 if (instanceMap.size === 0) { 642 elementMap.delete(element); 643 } 644 } 645 646 }; 647 648 /** 649 * -------------------------------------------------------------------------- 650 * Bootstrap (v5.2.0): dom/manipulator.js 651 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 652 * -------------------------------------------------------------------------- 653 */ 654 function normalizeData(value) { 655 if (value === 'true') { 656 return true; 657 } 658 659 if (value === 'false') { 660 return false; 661 } 662 663 if (value === Number(value).toString()) { 664 return Number(value); 665 } 666 667 if (value === '' || value === 'null') { 668 return null; 669 } 670 671 if (typeof value !== 'string') { 672 return value; 673 } 674 675 try { 676 return JSON.parse(decodeURIComponent(value)); 677 } catch (_unused) { 678 return value; 679 } 680 } 681 682 function normalizeDataKey(key) { 683 return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); 684 } 685 686 const Manipulator = { 687 setDataAttribute(element, key, value) { 688 element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); 689 }, 690 691 removeDataAttribute(element, key) { 692 element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); 693 }, 694 695 getDataAttributes(element) { 696 if (!element) { 697 return {}; 698 } 699 700 const attributes = {}; 701 const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); 702 703 for (const key of bsKeys) { 704 let pureKey = key.replace(/^bs/, ''); 705 pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); 706 attributes[pureKey] = normalizeData(element.dataset[key]); 707 } 708 709 return attributes; 710 }, 711 712 getDataAttribute(element, key) { 713 return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); 714 } 715 716 }; 717 718 /** 719 * -------------------------------------------------------------------------- 720 * Bootstrap (v5.2.0): util/config.js 721 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 722 * -------------------------------------------------------------------------- 723 */ 724 /** 725 * Class definition 726 */ 727 728 class Config { 729 // Getters 730 static get Default() { 731 return {}; 732 } 733 734 static get DefaultType() { 735 return {}; 736 } 737 738 static get NAME() { 739 throw new Error('You have to implement the static method "NAME", for each component!'); 740 } 741 742 _getConfig(config) { 743 config = this._mergeConfigObj(config); 744 config = this._configAfterMerge(config); 745 746 this._typeCheckConfig(config); 747 748 return config; 749 } 750 751 _configAfterMerge(config) { 752 return config; 753 } 754 755 _mergeConfigObj(config, element) { 756 const jsonConfig = isElement$1(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse 757 758 return { ...this.constructor.Default, 759 ...(typeof jsonConfig === 'object' ? jsonConfig : {}), 760 ...(isElement$1(element) ? Manipulator.getDataAttributes(element) : {}), 761 ...(typeof config === 'object' ? config : {}) 762 }; 763 } 764 765 _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { 766 for (const property of Object.keys(configTypes)) { 767 const expectedTypes = configTypes[property]; 768 const value = config[property]; 769 const valueType = isElement$1(value) ? 'element' : toType(value); 770 771 if (!new RegExp(expectedTypes).test(valueType)) { 772 throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); 773 } 774 } 775 } 776 777 } 778 779 /** 780 * -------------------------------------------------------------------------- 781 * Bootstrap (v5.2.0): base-component.js 782 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 783 * -------------------------------------------------------------------------- 784 */ 785 /** 786 * Constants 787 */ 788 789 const VERSION = '5.2.0'; 790 /** 791 * Class definition 792 */ 793 794 class BaseComponent extends Config { 795 constructor(element, config) { 796 super(); 797 element = getElement(element); 798 799 if (!element) { 800 return; 801 } 802 803 this._element = element; 804 this._config = this._getConfig(config); 805 Data.set(this._element, this.constructor.DATA_KEY, this); 806 } // Public 807 808 809 dispose() { 810 Data.remove(this._element, this.constructor.DATA_KEY); 811 EventHandler.off(this._element, this.constructor.EVENT_KEY); 812
vendor: 4,874 bytes, lines 813-993
813 for (const propertyName of Object.getOwnPropertyNames(this)) { 814 this[propertyName] = null; 815 } 816 } 817 818 _queueCallback(callback, element, isAnimated = true) { 819 executeAfterTransition(callback, element, isAnimated); 820 } 821 822 _getConfig(config) { 823 config = this._mergeConfigObj(config, this._element); 824 config = this._configAfterMerge(config); 825 826 this._typeCheckConfig(config); 827 828 return config; 829 } // Static 830 831 832 static getInstance(element) { 833 return Data.get(getElement(element), this.DATA_KEY); 834 } 835 836 static getOrCreateInstance(element, config = {}) { 837 return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); 838 } 839 840 static get VERSION() { 841 return VERSION; 842 } 843 844 static get DATA_KEY() { 845 return `bs.${this.NAME}`; 846 } 847 848 static get EVENT_KEY() { 849 return `.${this.DATA_KEY}`; 850 } 851 852 static eventName(name) { 853 return `${name}${this.EVENT_KEY}`; 854 } 855 856 } 857 858 /** 859 * -------------------------------------------------------------------------- 860 * Bootstrap (v5.2.0): util/component-functions.js 861 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 862 * -------------------------------------------------------------------------- 863 */ 864 865 const enableDismissTrigger = (component, method = 'hide') => { 866 const clickEvent = `click.dismiss${component.EVENT_KEY}`; 867 const name = component.NAME; 868 EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { 869 if (['A', 'AREA'].includes(this.tagName)) { 870 event.preventDefault(); 871 } 872 873 if (isDisabled(this)) { 874 return; 875 } 876 877 const target = getElementFromSelector(this) || this.closest(`.${name}`); 878 const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method 879 880 instance[method](); 881 }); 882 }; 883 884 /** 885 * -------------------------------------------------------------------------- 886 * Bootstrap (v5.2.0): alert.js 887 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 888 * -------------------------------------------------------------------------- 889 */ 890 /** 891 * Constants 892 */ 893 894 const NAME$f = 'alert'; 895 const DATA_KEY$a = 'bs.alert'; 896 const EVENT_KEY$b = `.${DATA_KEY$a}`; 897 const EVENT_CLOSE = `close${EVENT_KEY$b}`; 898 const EVENT_CLOSED = `closed${EVENT_KEY$b}`; 899 const CLASS_NAME_FADE$5 = 'fade'; 900 const CLASS_NAME_SHOW$8 = 'show'; 901 /** 902 * Class definition 903 */ 904 905 class Alert extends BaseComponent { 906 // Getters 907 static get NAME() { 908 return NAME$f; 909 } // Public 910 911 912 close() { 913 const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); 914 915 if (closeEvent.defaultPrevented) { 916 return; 917 } 918 919 this._element.classList.remove(CLASS_NAME_SHOW$8); 920 921 const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); 922 923 this._queueCallback(() => this._destroyElement(), this._element, isAnimated); 924 } // Private 925 926 927 _destroyElement() { 928 this._element.remove(); 929 930 EventHandler.trigger(this._element, EVENT_CLOSED); 931 this.dispose(); 932 } // Static 933 934 935 static jQueryInterface(config) { 936 return this.each(function () { 937 const data = Alert.getOrCreateInstance(this); 938 939 if (typeof config !== 'string') { 940 return; 941 } 942 943 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 944 throw new TypeError(`No method named "${config}"`); 945 } 946 947 data[config](this); 948 }); 949 } 950 951 } 952 /** 953 * Data API implementation 954 */ 955 956 957 enableDismissTrigger(Alert, 'close'); 958 /** 959 * jQuery 960 */ 961 962 defineJQueryPlugin(Alert); 963 964 /** 965 * -------------------------------------------------------------------------- 966 * Bootstrap (v5.2.0): button.js 967 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 968 * -------------------------------------------------------------------------- 969 */ 970 /** 971 * Constants 972 */ 973 974 const NAME$e = 'button'; 975 const DATA_KEY$9 = 'bs.button'; 976 const EVENT_KEY$a = `.${DATA_KEY$9}`; 977 const DATA_API_KEY$6 = '.data-api'; 978 const CLASS_NAME_ACTIVE$3 = 'active'; 979 const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; 980 const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; 981 /** 982 * Class definition 983 */ 984 985 class Button extends BaseComponent { 986 // Getters 987 static get NAME() { 988 return NAME$e; 989 } // Public 990 991 992 toggle() { 993 // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle(
993)` method 994 this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); 995 } // Static 996 997 998 static jQueryInterface(config) { 999 return this.each(function () { 1000 const data = Button.getOrCreateInstance(this); 1001 1002 if (config === 'toggle') { 1003 data[config](); 1004 } 1005 }); 1006 } 1007 1008 } 1009 /** 1010 * Data API implementation 1011 */ 1012 1013 1014 EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { 1015 event.preventDefault(); 1016 const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); 1017 const data = Button.getOrCreateInstance(button); 1018 data.toggle(); 1019 }); 1020 /** 1021 * jQuery 1022 */ 1023 1024 defineJQueryPlugin(Button); 1025 1026 /** 1027 * -------------------------------------------------------------------------- 1028 * Bootstrap (v5.2.0): dom/selector-engine.js 1029 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1030 * -------------------------------------------------------------------------- 1031 */ 1032 /** 1033 * Constants 1034 */ 1035 1036 const SelectorEngine = { 1037 find(selector, element = document.documentElement) { 1038 return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); 1039 }, 1040 1041 findOne(selector, element = document.documentElement) { 1042 return Element.prototype.querySelector.call(element, selector); 1043 }, 1044 1045 children(element, selector) { 1046 return [].concat(...element.children).filter(child => child.matches(selector)); 1047 }, 1048 1049 parents(element, selector) { 1050 const parents = []; 1051 let ancestor = element.parentNode.closest(selector); 1052 1053 while (ancestor) { 1054 parents.push(ancestor); 1055 ancestor = ancestor.parentNode.closest(selector); 1056 } 1057 1058 return parents; 1059 }, 1060 1061 prev(element, selector) { 1062 let previous = element.previousElementSibling; 1063 1064 while (previous) { 1065 if (previous.matches(selector)) { 1066 return [previous]; 1067 } 1068 1069 previous = previous.previousElementSibling; 1070 } 1071 1072 return []; 1073 }, 1074 1075 // TODO: this is now unused; remove later along with prev() 1076 next(element, selector) { 1077 let next = element.nextElementSibling; 1078 1079 while (next) { 1080 if (next.matches(selector)) { 1081 return [next]; 1082 } 1083 1084 next = next.nextElementSibling; 1085 } 1086 1087 return []; 1088 }, 1089 1090 focusableChildren(element) { 1091 const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); 1092 return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); 1093 } 1094 1095 }; 1096 1097 /** 1098 * -------------------------------------------------------------------------- 1099 * Bootstrap (v5.2.0): util/swipe.js 1100 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1101 * -------------------------------------------------------------------------- 1102 */ 1103 /** 1104 * Constants 1105 */ 1106 1107 const NAME$d = 'swipe'; 1108 const EVENT_KEY$9 = '.bs.swipe'; 1109 const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; 1110 const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; 1111 const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; 1112 const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; 1113 const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; 1114 const POINTER_TYPE_TOUCH = 'touch'; 1115 const POINTER_TYPE_PEN = 'pen'; 1116 const CLASS_NAME_POINTER_EVENT = 'pointer-event'; 1117 const SWIPE_THRESHOLD = 40; 1118 const Default$c = { 1119 endCallback: null, 1120 leftCallback: null, 1121 rightCallback: null 1122 }; 1123 const DefaultType$c = { 1124 endCallback: '(function|null)', 1125 leftCallback: '(function|null)', 1126 rightCallback: '(function|null)' 1127 }; 1128 /** 1129 * Class definition 1130 */ 1131 1132 class Swipe extends Config { 1133 constructor(element, config) { 1134 super(); 1135 this._element = element; 1136 1137 if (!element || !Swipe.isSupported()) { 1138 return; 1139 } 1140 1141 this._config = this._getConfig(config); 1142 this._deltaX = 0; 1143 this._supportPointerEvents = Boolean(window.PointerEvent); 1144 1145 this._initEvents(); 1146 } // Getters 1147 1148 1149 static get Default() { 1150 return Default$c; 1151 } 1152 1153 static get DefaultType() { 1154 return DefaultType$c; 1155 } 1156 1157 static get NAME() { 1158 return NAME$d; 1159 } // Public 1160 1161 1162 dispose() { 1163 EventHandler.off(this._element, EVENT_KEY$9); 1164 } // Private 1165 1166 1167 _start(event) { 1168 if (!this._supportPointerEvents) { 1169 this._deltaX = event.touches[0].clientX; 1170 return; 1171 } 1172 1173 if (this._eventIsPointerPenTouch(event)) { 1174 this._deltaX = event.clientX; 1175 } 1176 } 1177 1178 _end(event) { 1179 if (this._eventIsPointerPenTouch(event)) { 1180 this._deltaX = event.clientX - this._deltaX; 1181 } 1182 1183 this._handleSwipe(); 1184 1185 execute(this._config.endCallback); 1186 } 1187 1188 _move(event) { 1189 this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; 1190 } 1191 1192 _handleSwipe() { 1193 const absDeltaX = Math.abs(this._deltaX); 1194 1195 if (absDeltaX <= SWIPE_THRESHOLD) { 1196 return; 1197 } 1198 1199 const direction = absDeltaX / this._deltaX; 1200 this._deltaX = 0; 1201 1202 if (!direction) { 1203 return; 1204 } 1205 1206 execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); 1207 } 1208 1209 _initEvents() { 1210 if (this._supportPointerEvents) { 1211 EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); 1212 EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); 1213 1214 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 1215 } else { 1216 EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); 1217 EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); 1218 EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); 1219 } 1220 } 1221 1222 _eventIsPointerPenTouch(event) { 1223 return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); 1224 } // Static 1225 1226 1227 static isSupported() { 1228 return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 1229 } 1230 1231 } 1232 1233 /** 1234 * -------------------------------------------------------------------------- 1235 * Bootstrap (v5.2.0): carousel.js 1236 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1237 * -------------------------------------------------------------------------- 1238 */ 1239 /** 1240 * Constants 1241 */ 1242 1243 const NAME$c = 'carousel'; 1244 const DATA_KEY$8 = 'bs.carousel'; 1245 const EVENT_KEY$8 = `.${DATA_KEY$8}`; 1246 const DATA_API_KEY$5 = '.data-api'; 1247 const ARROW_LEFT_KEY$1 = 'ArrowLeft'; 1248 const ARROW_RIGHT_KEY$1 = 'ArrowRight'; 1249 const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 1250 1251 const ORDER_NEXT = 'next'; 1252 const ORDER_PREV = 'prev'; 1253 const DIRECTION_LEFT = 'left'; 1254 const DIRECTION_RIGHT = 'right'; 1255 const EVENT_SLIDE = `slide${EVENT_KEY$8}`; 1256 const EVENT_SLID = `slid${EVENT_KEY$8}`; 1257 const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; 1258 const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; 1259 const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; 1260 const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; 1261 const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; 1262 const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; 1263 const CLASS_NAME_CAROUSEL = 'carousel'; 1264 const CLASS_NAME_ACTIVE$2 = 'active'; 1265 const CLASS_NAME_SLIDE = 'slide'; 1266 const CLASS_NAME_END = 'carousel-item-end'; 1267 const CLASS_NAME_START = 'carousel-item-start'; 1268 const CLASS_NAME_NEXT = 'carousel-item-next'; 1269 const CLASS_NAME_PREV = 'carousel-item-prev'; 1270 const SELECTOR_ACTIVE = '.active'; 1271 const SELECTOR_ITEM = '.carousel-item'; 1272 const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; 1273 const SELECTOR_ITEM_IMG = '.carousel-item img'; 1274 const SELECTOR_INDICATORS = '.carousel-indicators'; 1275 const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; 1276 const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; 1277 const KEY_TO_DIRECTION = { 1278 [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, 1279 [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT 1280 }; 1281 const Default$b = { 1282 interval: 5000, 1283 keyboard: true, 1284 pause: 'hover', 1285 ride: false, 1286 touch: true, 1287 wrap: true 1288 }; 1289 const DefaultType$b = { 1290 interval: '(number|boolean)',
vendor: 9,311 bytes, lines 1291-1622
1291 // TODO:v6 remove boolean support 1292 keyboard: 'boolean', 1293 pause: '(string|boolean)', 1294 ride: '(boolean|string)', 1295 touch: 'boolean', 1296 wrap: 'boolean' 1297 }; 1298 /** 1299 * Class definition 1300 */ 1301 1302 class Carousel extends BaseComponent { 1303 constructor(element, config) { 1304 super(element, config); 1305 this._interval = null; 1306 this._activeElement = null; 1307 this._isSliding = false; 1308 this.touchTimeout = null; 1309 this._swipeHelper = null; 1310 this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); 1311 1312 this._addEventListeners(); 1313 1314 if (this._config.ride === CLASS_NAME_CAROUSEL) { 1315 this.cycle(); 1316 } 1317 } // Getters 1318 1319 1320 static get Default() { 1321 return Default$b; 1322 } 1323 1324 static get DefaultType() { 1325 return DefaultType$b; 1326 } 1327 1328 static get NAME() { 1329 return NAME$c; 1330 } // Public 1331 1332 1333 next() { 1334 this._slide(ORDER_NEXT); 1335 } 1336 1337 nextWhenVisible() { 1338 // FIXME TODO use `document.visibilityState` 1339 // Don't call next when the page isn't visible 1340 // or the carousel or its parent isn't visible 1341 if (!document.hidden && isVisible(this._element)) { 1342 this.next(); 1343 } 1344 } 1345 1346 prev() { 1347 this._slide(ORDER_PREV); 1348 } 1349 1350 pause() { 1351 if (this._isSliding) { 1352 triggerTransitionEnd(this._element); 1353 } 1354 1355 this._clearInterval(); 1356 } 1357 1358 cycle() { 1359 this._clearInterval(); 1360 1361 this._updateInterval(); 1362 1363 this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); 1364 } 1365 1366 _maybeEnableCycle() { 1367 if (!this._config.ride) { 1368 return; 1369 } 1370 1371 if (this._isSliding) { 1372 EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); 1373 return; 1374 } 1375 1376 this.cycle(); 1377 } 1378 1379 to(index) { 1380 const items = this._getItems(); 1381 1382 if (index > items.length - 1 || index < 0) { 1383 return; 1384 } 1385 1386 if (this._isSliding) { 1387 EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); 1388 return; 1389 } 1390 1391 const activeIndex = this._getItemIndex(this._getActive()); 1392 1393 if (activeIndex === index) { 1394 return; 1395 } 1396 1397 const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; 1398 1399 this._slide(order, items[index]); 1400 } 1401 1402 dispose() { 1403 if (this._swipeHelper) { 1404 this._swipeHelper.dispose(); 1405 } 1406 1407 super.dispose(); 1408 } // Private 1409 1410 1411 _configAfterMerge(config) { 1412 config.defaultInterval = config.interval; 1413 return config; 1414 } 1415 1416 _addEventListeners() { 1417 if (this._config.keyboard) { 1418 EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); 1419 } 1420 1421 if (this._config.pause === 'hover') { 1422 EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); 1423 EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); 1424 } 1425 1426 if (this._config.touch && Swipe.isSupported()) { 1427 this._addTouchEventListeners(); 1428 } 1429 } 1430 1431 _addTouchEventListeners() { 1432 for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { 1433 EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); 1434 } 1435 1436 const endCallBack = () => { 1437 if (this._config.pause !== 'hover') { 1438 return; 1439 } // If it's a touch-enabled device, mouseenter/leave are fired as 1440 // part of the mouse compatibility events on first tap - the carousel 1441 // would stop cycling until user tapped out of it; 1442 // here, we listen for touchend, explicitly pause the carousel 1443 // (as if it's the second time we tap on it, mouseenter compat event 1444 // is NOT fired) and after a timeout (to allow for mouse compatibility 1445 // events to fire) we explicitly restart cycling 1446 1447 1448 this.pause(); 1449 1450 if (this.touchTimeout) { 1451 clearTimeout(this.touchTimeout); 1452 } 1453 1454 this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); 1455 }; 1456 1457 const swipeConfig = { 1458 leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), 1459 rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), 1460 endCallback: endCallBack 1461 }; 1462 this._swipeHelper = new Swipe(this._element, swipeConfig); 1463 } 1464 1465 _keydown(event) { 1466 if (/input|textarea/i.test(event.target.tagName)) { 1467 return; 1468 } 1469 1470 const direction = KEY_TO_DIRECTION[event.key]; 1471 1472 if (direction) { 1473 event.preventDefault(); 1474 1475 this._slide(this._directionToOrder(direction)); 1476 } 1477 } 1478 1479 _getItemIndex(element) { 1480 return this._getItems().indexOf(element); 1481 } 1482 1483 _setActiveIndicatorElement(index) { 1484 if (!this._indicatorsElement) { 1485 return; 1486 } 1487 1488 const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); 1489 activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); 1490 activeIndicator.removeAttribute('aria-current'); 1491 const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); 1492 1493 if (newActiveIndicator) { 1494 newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); 1495 newActiveIndicator.setAttribute('aria-current', 'true'); 1496 } 1497 } 1498 1499 _updateInterval() { 1500 const element = this._activeElement || this._getActive(); 1501 1502 if (!element) { 1503 return; 1504 } 1505 1506 const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); 1507 this._config.interval = elementInterval || this._config.defaultInterval; 1508 } 1509 1510 _slide(order, element = null) { 1511 if (this._isSliding) { 1512 return; 1513 } 1514 1515 const activeElement = this._getActive(); 1516 1517 const isNext = order === ORDER_NEXT; 1518 const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); 1519 1520 if (nextElement === activeElement) { 1521 return; 1522 } 1523 1524 const nextElementIndex = this._getItemIndex(nextElement); 1525 1526 const triggerEvent = eventName => { 1527 return EventHandler.trigger(this._element, eventName, { 1528 relatedTarget: nextElement, 1529 direction: this._orderToDirection(order), 1530 from: this._getItemIndex(activeElement), 1531 to: nextElementIndex 1532 }); 1533 }; 1534 1535 const slideEvent = triggerEvent(EVENT_SLIDE); 1536 1537 if (slideEvent.defaultPrevented) { 1538 return; 1539 } 1540 1541 if (!activeElement || !nextElement) { 1542 // Some weirdness is happening, so we bail 1543 // todo: change tests that use empty divs to avoid this check 1544 return; 1545 } 1546 1547 const isCycling = Boolean(this._interval); 1548 this.pause(); 1549 this._isSliding = true; 1550 1551 this._setActiveIndicatorElement(nextElementIndex); 1552 1553 this._activeElement = nextElement; 1554 const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; 1555 const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; 1556 nextElement.classList.add(orderClassName); 1557 reflow(nextElement); 1558 activeElement.classList.add(directionalClassName); 1559 nextElement.classList.add(directionalClassName); 1560 1561 const completeCallBack = () => { 1562 nextElement.classList.remove(directionalClassName, orderClassName); 1563 nextElement.classList.add(CLASS_NAME_ACTIVE$2); 1564 activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); 1565 this._isSliding = false; 1566 triggerEvent(EVENT_SLID); 1567 }; 1568 1569 this._queueCallback(completeCallBack, activeElement, this._isAnimated()); 1570 1571 if (isCycling) { 1572 this.cycle(); 1573 } 1574 } 1575 1576 _isAnimated() { 1577 return this._element.classList.contains(CLASS_NAME_SLIDE); 1578 } 1579 1580 _getActive() { 1581 return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); 1582 } 1583 1584 _getItems() { 1585 return SelectorEngine.find(SELECTOR_ITEM, this._element); 1586 } 1587 1588 _clearInterval() { 1589 if (this._interval) { 1590 clearInterval(this._interval); 1591 this._interval = null; 1592 } 1593 } 1594 1595 _directionToOrder(direction) { 1596 if (isRTL()) { 1597 return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; 1598 } 1599 1600 return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; 1601 } 1602 1603 _orderToDirection(order) { 1604 if (isRTL()) { 1605 return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; 1606 } 1607 1608 return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; 1609 } // Static 1610 1611 1612 static jQueryInterface(config) { 1613 return this.each(function () { 1614 const data = Carousel.getOrCreateInstance(this, config); 1615 1616 if (typeof config === 'number') { 1617 data.to(config); 1618 return; 1619 } 1620 1621 if (typeof config === 'string') { 1622 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
vendor: 1,092 bytes, lines 1623-1671
1623 throw new TypeError(`No method named "${config}"`); 1624 } 1625 1626 data[config](); 1627 } 1628 }); 1629 } 1630 1631 } 1632 /** 1633 * Data API implementation 1634 */ 1635 1636 1637 EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { 1638 const target = getElementFromSelector(this); 1639 1640 if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { 1641 return; 1642 } 1643 1644 event.preventDefault(); 1645 const carousel = Carousel.getOrCreateInstance(target); 1646 const slideIndex = this.getAttribute('data-bs-slide-to'); 1647 1648 if (slideIndex) { 1649 carousel.to(slideIndex); 1650 1651 carousel._maybeEnableCycle(); 1652 1653 return; 1654 } 1655 1656 if (Manipulator.getDataAttribute(this, 'slide') === 'next') { 1657 carousel.next(); 1658 1659 carousel._maybeEnableCycle(); 1660 1661 return; 1662 } 1663 1664 carousel.prev(); 1665 1666 carousel._maybeEnableCycle(); 1667 }); 1668 EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { 1669 const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); 1670 1671 for (const carousel of carousels) {
vendor: 10,747 bytes, lines 1672-2043
1672 Carousel.getOrCreateInstance(carousel); 1673 } 1674 }); 1675 /** 1676 * jQuery 1677 */ 1678 1679 defineJQueryPlugin(Carousel); 1680 1681 /** 1682 * -------------------------------------------------------------------------- 1683 * Bootstrap (v5.2.0): collapse.js 1684 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1685 * -------------------------------------------------------------------------- 1686 */ 1687 /** 1688 * Constants 1689 */ 1690 1691 const NAME$b = 'collapse'; 1692 const DATA_KEY$7 = 'bs.collapse'; 1693 const EVENT_KEY$7 = `.${DATA_KEY$7}`; 1694 const DATA_API_KEY$4 = '.data-api'; 1695 const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; 1696 const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; 1697 const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; 1698 const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; 1699 const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; 1700 const CLASS_NAME_SHOW$7 = 'show'; 1701 const CLASS_NAME_COLLAPSE = 'collapse'; 1702 const CLASS_NAME_COLLAPSING = 'collapsing'; 1703 const CLASS_NAME_COLLAPSED = 'collapsed'; 1704 const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; 1705 const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; 1706 const WIDTH = 'width'; 1707 const HEIGHT = 'height'; 1708 const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; 1709 const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; 1710 const Default$a = { 1711 parent: null, 1712 toggle: true 1713 }; 1714 const DefaultType$a = { 1715 parent: '(null|element)', 1716 toggle: 'boolean' 1717 }; 1718 /** 1719 * Class definition 1720 */ 1721 1722 class Collapse extends BaseComponent { 1723 constructor(element, config) { 1724 super(element, config); 1725 this._isTransitioning = false; 1726 this._triggerArray = []; 1727 const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); 1728 1729 for (const elem of toggleList) { 1730 const selector = getSelectorFromElement(elem); 1731 const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); 1732 1733 if (selector !== null && filterElement.length) { 1734 this._triggerArray.push(elem); 1735 } 1736 } 1737 1738 this._initializeChildren(); 1739 1740 if (!this._config.parent) { 1741 this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); 1742 } 1743 1744 if (this._config.toggle) { 1745 this.toggle(); 1746 } 1747 } // Getters 1748 1749 1750 static get Default() { 1751 return Default$a; 1752 } 1753 1754 static get DefaultType() { 1755 return DefaultType$a; 1756 } 1757 1758 static get NAME() { 1759 return NAME$b; 1760 } // Public 1761 1762 1763 toggle() { 1764 if (this._isShown()) { 1765 this.hide(); 1766 } else { 1767 this.show(); 1768 } 1769 } 1770 1771 show() { 1772 if (this._isTransitioning || this._isShown()) { 1773 return; 1774 } 1775 1776 let activeChildren = []; // find active children 1777 1778 if (this._config.parent) { 1779 activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { 1780 toggle: false 1781 })); 1782 } 1783 1784 if (activeChildren.length && activeChildren[0]._isTransitioning) { 1785 return; 1786 } 1787 1788 const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); 1789 1790 if (startEvent.defaultPrevented) { 1791 return; 1792 } 1793 1794 for (const activeInstance of activeChildren) { 1795 activeInstance.hide(); 1796 } 1797 1798 const dimension = this._getDimension(); 1799 1800 this._element.classList.remove(CLASS_NAME_COLLAPSE); 1801 1802 this._element.classList.add(CLASS_NAME_COLLAPSING); 1803 1804 this._element.style[dimension] = 0; 1805 1806 this._addAriaAndCollapsedClass(this._triggerArray, true); 1807 1808 this._isTransitioning = true; 1809 1810 const complete = () => { 1811 this._isTransitioning = false; 1812 1813 this._element.classList.remove(CLASS_NAME_COLLAPSING); 1814 1815 this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); 1816 1817 this._element.style[dimension] = ''; 1818 EventHandler.trigger(this._element, EVENT_SHOWN$6); 1819 }; 1820 1821 const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1822 const scrollSize = `scroll${capitalizedDimension}`; 1823 1824 this._queueCallback(complete, this._element, true); 1825 1826 this._element.style[dimension] = `${this._element[scrollSize]}px`; 1827 } 1828 1829 hide() { 1830 if (this._isTransitioning || !this._isShown()) { 1831 return; 1832 } 1833 1834 const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); 1835 1836 if (startEvent.defaultPrevented) { 1837 return; 1838 } 1839 1840 const dimension = this._getDimension(); 1841 1842 this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; 1843 reflow(this._element); 1844 1845 this._element.classList.add(CLASS_NAME_COLLAPSING); 1846 1847 this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); 1848 1849 for (const trigger of this._triggerArray) { 1850 const element = getElementFromSelector(trigger); 1851 1852 if (element && !this._isShown(element)) { 1853 this._addAriaAndCollapsedClass([trigger], false); 1854 } 1855 } 1856 1857 this._isTransitioning = true; 1858 1859 const complete = () => { 1860 this._isTransitioning = false; 1861 1862 this._element.classList.remove(CLASS_NAME_COLLAPSING); 1863 1864 this._element.classList.add(CLASS_NAME_COLLAPSE); 1865 1866 EventHandler.trigger(this._element, EVENT_HIDDEN$6); 1867 }; 1868 1869 this._element.style[dimension] = ''; 1870 1871 this._queueCallback(complete, this._element, true); 1872 } 1873 1874 _isShown(element = this._element) { 1875 return element.classList.contains(CLASS_NAME_SHOW$7); 1876 } // Private 1877 1878 1879 _configAfterMerge(config) { 1880 config.toggle = Boolean(config.toggle); // Coerce string values 1881 1882 config.parent = getElement(config.parent); 1883 return config; 1884 } 1885 1886 _getDimension() { 1887 return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; 1888 } 1889 1890 _initializeChildren() { 1891 if (!this._config.parent) { 1892 return; 1893 } 1894 1895 const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); 1896 1897 for (const element of children) { 1898 const selected = getElementFromSelector(element); 1899 1900 if (selected) { 1901 this._addAriaAndCollapsedClass([element], this._isShown(selected)); 1902 } 1903 } 1904 } 1905 1906 _getFirstLevelChildren(selector) { 1907 const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); // remove children if greater depth 1908 1909 return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); 1910 } 1911 1912 _addAriaAndCollapsedClass(triggerArray, isOpen) { 1913 if (!triggerArray.length) { 1914 return; 1915 } 1916 1917 for (const element of triggerArray) { 1918 element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); 1919 element.setAttribute('aria-expanded', isOpen); 1920 } 1921 } // Static 1922 1923 1924 static jQueryInterface(config) { 1925 const _config = {}; 1926 1927 if (typeof config === 'string' && /show|hide/.test(config)) { 1928 _config.toggle = false; 1929 } 1930 1931 return this.each(function () { 1932 const data = Collapse.getOrCreateInstance(this, _config); 1933 1934 if (typeof config === 'string') { 1935 if (typeof data[config] === 'undefined') { 1936 throw new TypeError(`No method named "${config}"`); 1937 } 1938 1939 data[config](); 1940 } 1941 }); 1942 } 1943 1944 } 1945 /** 1946 * Data API implementation 1947 */ 1948 1949 1950 EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { 1951 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1952 if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { 1953 event.preventDefault(); 1954 } 1955 1956 const selector = getSelectorFromElement(this); 1957 const selectorElements = SelectorEngine.find(selector); 1958 1959 for (const element of selectorElements) { 1960 Collapse.getOrCreateInstance(element, { 1961 toggle: false 1962 }).toggle(); 1963 } 1964 }); 1965 /** 1966 * jQuery 1967 */ 1968 1969 defineJQueryPlugin(Collapse); 1970 1971 var top = 'top'; 1972 var bottom = 'bottom'; 1973 var right = 'right'; 1974 var left = 'left'; 1975 var auto = 'auto'; 1976 var basePlacements = [top, bottom, right, left]; 1977 var start = 'start'; 1978 var end = 'end'; 1979 var clippingParents = 'clippingParents'; 1980 var viewport = 'viewport'; 1981 var popper = 'popper'; 1982 var reference = 'reference'; 1983 var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 1984 return acc.concat([placement + "-" + start, placement + "-" + end]); 1985 }, []); 1986 var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 1987 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 1988 }, []); // modifiers that need to read the DOM 1989 1990 var beforeRead = 'beforeRead'; 1991 var read = 'read'; 1992 var afterRead = 'afterRead'; // pure-logic modifiers 1993 1994 var beforeMain = 'beforeMain'; 1995 var main = 'main'; 1996 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 1997 1998 var beforeWrite = 'beforeWrite'; 1999 var write = 'write'; 2000 var afterWrite = 'afterWrite'; 2001 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 2002 2003 function getNodeName(element) { 2004 return element ? (element.nodeName || '').toLowerCase() : null; 2005 } 2006 2007 function getWindow(node) { 2008 if (node == null) { 2009 return window; 2010 } 2011 2012 if (node.toString() !== '[object Window]') { 2013 var ownerDocument = node.ownerDocument; 2014 return ownerDocument ? ownerDocument.defaultView || window : window; 2015 } 2016 2017 return node; 2018 } 2019 2020 function isElement(node) { 2021 var OwnElement = getWindow(node).Element; 2022 return node instanceof OwnElement || node instanceof Element; 2023 } 2024 2025 function isHTMLElement(node) { 2026 var OwnElement = getWindow(node).HTMLElement; 2027 return node instanceof OwnElement || node instanceof HTMLElement; 2028 } 2029 2030 function isShadowRoot(node) { 2031 // IE 11 has no ShadowRoot 2032 if (typeof ShadowRoot === 'undefined') { 2033 return false; 2034 } 2035 2036 var OwnElement = getWindow(node).ShadowRoot; 2037 return node instanceof OwnElement || node instanceof ShadowRoot; 2038 } 2039 2040 // and applies them to the HTMLElements such as popper and arrow 2041 2042 function applyStyles(_ref) { 2043 var state = _ref.state;
vendor: 13,658 bytes, lines 2044-2463
2044 Object.keys(state.elements).forEach(function (name) { 2045 var style = state.styles[name] || {}; 2046 var attributes = state.attributes[name] || {}; 2047 var element = state.elements[name]; // arrow is optional + virtual elements 2048 2049 if (!isHTMLElement(element) || !getNodeName(element)) { 2050 return; 2051 } // Flow doesn't support to extend this property, but it's the most 2052 // effective way to apply styles to an HTMLElement 2053 // $FlowFixMe[cannot-write] 2054 2055 2056 Object.assign(element.style, style); 2057 Object.keys(attributes).forEach(function (name) { 2058 var value = attributes[name]; 2059 2060 if (value === false) { 2061 element.removeAttribute(name); 2062 } else { 2063 element.setAttribute(name, value === true ? '' : value); 2064 } 2065 }); 2066 }); 2067 } 2068 2069 function effect$2(_ref2) { 2070 var state = _ref2.state; 2071 var initialStyles = { 2072 popper: { 2073 position: state.options.strategy, 2074 left: '0', 2075 top: '0', 2076 margin: '0' 2077 }, 2078 arrow: { 2079 position: 'absolute' 2080 }, 2081 reference: {} 2082 }; 2083 Object.assign(state.elements.popper.style, initialStyles.popper); 2084 state.styles = initialStyles; 2085 2086 if (state.elements.arrow) { 2087 Object.assign(state.elements.arrow.style, initialStyles.arrow); 2088 } 2089 2090 return function () { 2091 Object.keys(state.elements).forEach(function (name) { 2092 var element = state.elements[name]; 2093 var attributes = state.attributes[name] || {}; 2094 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 2095 2096 var style = styleProperties.reduce(function (style, property) { 2097 style[property] = ''; 2098 return style; 2099 }, {}); // arrow is optional + virtual elements 2100 2101 if (!isHTMLElement(element) || !getNodeName(element)) { 2102 return; 2103 } 2104 2105 Object.assign(element.style, style); 2106 Object.keys(attributes).forEach(function (attribute) { 2107 element.removeAttribute(attribute); 2108 }); 2109 }); 2110 }; 2111 } // eslint-disable-next-line import/no-unused-modules 2112 2113 2114 const applyStyles$1 = { 2115 name: 'applyStyles', 2116 enabled: true, 2117 phase: 'write', 2118 fn: applyStyles, 2119 effect: effect$2, 2120 requires: ['computeStyles'] 2121 }; 2122 2123 function getBasePlacement(placement) { 2124 return placement.split('-')[0]; 2125 } 2126 2127 var max = Math.max; 2128 var min = Math.min; 2129 var round = Math.round; 2130 2131 function getBoundingClientRect(element, includeScale) { 2132 if (includeScale === void 0) { 2133 includeScale = false; 2134 } 2135 2136 var rect = element.getBoundingClientRect(); 2137 var scaleX = 1; 2138 var scaleY = 1; 2139 2140 if (isHTMLElement(element) && includeScale) { 2141 var offsetHeight = element.offsetHeight; 2142 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale 2143 // Fallback to 1 in case both values are `0` 2144 2145 if (offsetWidth > 0) { 2146 scaleX = round(rect.width) / offsetWidth || 1; 2147 } 2148 2149 if (offsetHeight > 0) { 2150 scaleY = round(rect.height) / offsetHeight || 1; 2151 } 2152 } 2153 2154 return { 2155 width: rect.width / scaleX, 2156 height: rect.height / scaleY, 2157 top: rect.top / scaleY, 2158 right: rect.right / scaleX, 2159 bottom: rect.bottom / scaleY, 2160 left: rect.left / scaleX, 2161 x: rect.left / scaleX, 2162 y: rect.top / scaleY 2163 }; 2164 } 2165 2166 // means it doesn't take into account transforms. 2167 2168 function getLayoutRect(element) { 2169 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 2170 // Fixes https://github.com/popperjs/popper-core/issues/1223 2171 2172 var width = element.offsetWidth; 2173 var height = element.offsetHeight; 2174 2175 if (Math.abs(clientRect.width - width) <= 1) { 2176 width = clientRect.width; 2177 } 2178 2179 if (Math.abs(clientRect.height - height) <= 1) { 2180 height = clientRect.height; 2181 } 2182 2183 return { 2184 x: element.offsetLeft, 2185 y: element.offsetTop, 2186 width: width, 2187 height: height 2188 }; 2189 } 2190 2191 function contains(parent, child) { 2192 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 2193 2194 if (parent.contains(child)) { 2195 return true; 2196 } // then fallback to custom implementation with Shadow DOM support 2197 else if (rootNode && isShadowRoot(rootNode)) { 2198 var next = child; 2199 2200 do { 2201 if (next && parent.isSameNode(next)) { 2202 return true; 2203 } // $FlowFixMe[prop-missing]: need a better way to handle this... 2204 2205 2206 next = next.parentNode || next.host; 2207 } while (next); 2208 } // Give up, the result is false 2209 2210 2211 return false; 2212 } 2213 2214 function getComputedStyle$1(element) { 2215 return getWindow(element).getComputedStyle(element); 2216 } 2217 2218 function isTableElement(element) { 2219 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 2220 } 2221 2222 function getDocumentElement(element) { 2223 // $FlowFixMe[incompatible-return]: assume body is always available 2224 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 2225 element.document) || window.document).documentElement; 2226 } 2227 2228 function getParentNode(element) { 2229 if (getNodeName(element) === 'html') { 2230 return element; 2231 } 2232 2233 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 2234 // $FlowFixMe[incompatible-return] 2235 // $FlowFixMe[prop-missing] 2236 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 2237 element.parentNode || ( // DOM Element detected 2238 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 2239 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 2240 getDocumentElement(element) // fallback 2241 2242 ); 2243 } 2244 2245 function getTrueOffsetParent(element) { 2246 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 2247 getComputedStyle$1(element).position === 'fixed') { 2248 return null; 2249 } 2250 2251 return element.offsetParent; 2252 } // `.offsetParent` reports `null` for fixed elements, while absolute elements 2253 // return the containing block 2254 2255 2256 function getContainingBlock(element) { 2257 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; 2258 var isIE = navigator.userAgent.indexOf('Trident') !== -1; 2259 2260 if (isIE && isHTMLElement(element)) { 2261 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 2262 var elementCss = getComputedStyle$1(element); 2263 2264 if (elementCss.position === 'fixed') { 2265 return null; 2266 } 2267 } 2268 2269 var currentNode = getParentNode(element); 2270 2271 if (isShadowRoot(currentNode)) { 2272 currentNode = currentNode.host; 2273 } 2274 2275 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 2276 var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that 2277 // create a containing block. 2278 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 2279 2280 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 2281 return currentNode; 2282 } else { 2283 currentNode = currentNode.parentNode; 2284 } 2285 } 2286 2287 return null; 2288 } // Gets the closest ancestor positioned element. Handles some edge cases, 2289 // such as table ancestors and cross browser bugs. 2290 2291 2292 function getOffsetParent(element) { 2293 var window = getWindow(element); 2294 var offsetParent = getTrueOffsetParent(element); 2295 2296 while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') { 2297 offsetParent = getTrueOffsetParent(offsetParent); 2298 } 2299 2300 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) { 2301 return window; 2302 } 2303 2304 return offsetParent || getContainingBlock(element) || window; 2305 } 2306 2307 function getMainAxisFromPlacement(placement) { 2308 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 2309 } 2310 2311 function within(min$1, value, max$1) { 2312 return max(min$1, min(value, max$1)); 2313 } 2314 function withinMaxClamp(min, value, max) { 2315 var v = within(min, value, max); 2316 return v > max ? max : v; 2317 } 2318 2319 function getFreshSideObject() { 2320 return { 2321 top: 0, 2322 right: 0, 2323 bottom: 0, 2324 left: 0 2325 }; 2326 } 2327 2328 function mergePaddingObject(paddingObject) { 2329 return Object.assign({}, getFreshSideObject(), paddingObject); 2330 } 2331 2332 function expandToHashMap(value, keys) { 2333 return keys.reduce(function (hashMap, key) { 2334 hashMap[key] = value; 2335 return hashMap; 2336 }, {}); 2337 } 2338 2339 var toPaddingObject = function toPaddingObject(padding, state) { 2340 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 2341 placement: state.placement 2342 })) : padding; 2343 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2344 }; 2345 2346 function arrow(_ref) { 2347 var _state$modifiersData$; 2348 2349 var state = _ref.state, 2350 name = _ref.name, 2351 options = _ref.options; 2352 var arrowElement = state.elements.arrow; 2353 var popperOffsets = state.modifiersData.popperOffsets; 2354 var basePlacement = getBasePlacement(state.placement); 2355 var axis = getMainAxisFromPlacement(basePlacement); 2356 var isVertical = [left, right].indexOf(basePlacement) >= 0; 2357 var len = isVertical ? 'height' : 'width'; 2358 2359 if (!arrowElement || !popperOffsets) { 2360 return; 2361 } 2362 2363 var paddingObject = toPaddingObject(options.padding, state); 2364 var arrowRect = getLayoutRect(arrowElement); 2365 var minProp = axis === 'y' ? top : left; 2366 var maxProp = axis === 'y' ? bottom : right; 2367 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 2368 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 2369 var arrowOffsetParent = getOffsetParent(arrowElement); 2370 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 2371 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 2372 // outside of the popper bounds 2373 2374 var min = paddingObject[minProp]; 2375 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 2376 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 2377 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 2378 2379 var axisProp = axis; 2380 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 2381 } 2382 2383 function effect$1(_ref2) { 2384 var state = _ref2.state, 2385 options = _ref2.options; 2386 var _options$element = options.element, 2387 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 2388 2389 if (arrowElement == null) { 2390 return; 2391 } // CSS selector 2392 2393 2394 if (typeof arrowElement === 'string') { 2395 arrowElement = state.elements.popper.querySelector(arrowElement); 2396 2397 if (!arrowElement) { 2398 return; 2399 } 2400 } 2401 2402 if (!contains(state.elements.popper, arrowElement)) { 2403 2404 return; 2405 } 2406 2407 state.elements.arrow = arrowElement; 2408 } // eslint-disable-next-line import/no-unused-modules 2409 2410 2411 const arrow$1 = { 2412 name: 'arrow', 2413 enabled: true, 2414 phase: 'main', 2415 fn: arrow, 2416 effect: effect$1, 2417 requires: ['popperOffsets'], 2418 requiresIfExists: ['preventOverflow'] 2419 }; 2420 2421 function getVariation(placement) { 2422 return placement.split('-')[1]; 2423 } 2424 2425 var unsetSides = { 2426 top: 'auto', 2427 right: 'auto', 2428 bottom: 'auto', 2429 left: 'auto' 2430 }; // Round the offsets to the nearest suitable subpixel based on the DPR. 2431 // Zooming can change the DPR, but it seems to report a value that will 2432 // cleanly divide the values into the appropriate subpixels. 2433 2434 function roundOffsetsByDPR(_ref) { 2435 var x = _ref.x, 2436 y = _ref.y; 2437 var win = window; 2438 var dpr = win.devicePixelRatio || 1; 2439 return { 2440 x: round(x * dpr) / dpr || 0, 2441 y: round(y * dpr) / dpr || 0 2442 }; 2443 } 2444 2445 function mapToStyles(_ref2) { 2446 var _Object$assign2; 2447 2448 var popper = _ref2.popper, 2449 popperRect = _ref2.popperRect, 2450 placement = _ref2.placement, 2451 variation = _ref2.variation, 2452 offsets = _ref2.offsets, 2453 position = _ref2.position, 2454 gpuAcceleration = _ref2.gpuAcceleration, 2455 adaptive = _ref2.adaptive, 2456 roundOffsets = _ref2.roundOffsets, 2457 isFixed = _ref2.isFixed; 2458 var _offsets$x = offsets.x, 2459 x = _offsets$x === void 0 ? 0 : _offsets$x, 2460 _offsets$y = offsets.y, 2461 y = _offsets$y === void 0 ? 0 : _offsets$y; 2462 2463 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
vendor: 4,169 bytes, lines 2464-2576
2464 x: x, 2465 y: y 2466 }) : { 2467 x: x, 2468 y: y 2469 }; 2470 2471 x = _ref3.x; 2472 y = _ref3.y; 2473 var hasX = offsets.hasOwnProperty('x'); 2474 var hasY = offsets.hasOwnProperty('y'); 2475 var sideX = left; 2476 var sideY = top; 2477 var win = window; 2478 2479 if (adaptive) { 2480 var offsetParent = getOffsetParent(popper); 2481 var heightProp = 'clientHeight'; 2482 var widthProp = 'clientWidth'; 2483 2484 if (offsetParent === getWindow(popper)) { 2485 offsetParent = getDocumentElement(popper); 2486 2487 if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') { 2488 heightProp = 'scrollHeight'; 2489 widthProp = 'scrollWidth'; 2490 } 2491 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 2492 2493 2494 offsetParent = offsetParent; 2495 2496 if (placement === top || (placement === left || placement === right) && variation === end) { 2497 sideY = bottom; 2498 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 2499 offsetParent[heightProp]; 2500 y -= offsetY - popperRect.height; 2501 y *= gpuAcceleration ? 1 : -1; 2502 } 2503 2504 if (placement === left || (placement === top || placement === bottom) && variation === end) { 2505 sideX = right; 2506 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 2507 offsetParent[widthProp]; 2508 x -= offsetX - popperRect.width; 2509 x *= gpuAcceleration ? 1 : -1; 2510 } 2511 } 2512 2513 var commonStyles = Object.assign({ 2514 position: position 2515 }, adaptive && unsetSides); 2516 2517 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 2518 x: x, 2519 y: y 2520 }) : { 2521 x: x, 2522 y: y 2523 }; 2524 2525 x = _ref4.x; 2526 y = _ref4.y; 2527 2528 if (gpuAcceleration) { 2529 var _Object$assign; 2530 2531 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 2532 } 2533 2534 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 2535 } 2536 2537 function computeStyles(_ref5) { 2538 var state = _ref5.state, 2539 options = _ref5.options; 2540 var _options$gpuAccelerat = options.gpuAcceleration, 2541 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 2542 _options$adaptive = options.adaptive, 2543 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 2544 _options$roundOffsets = options.roundOffsets, 2545 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 2546 2547 var commonStyles = { 2548 placement: getBasePlacement(state.placement), 2549 variation: getVariation(state.placement), 2550 popper: state.elements.popper, 2551 popperRect: state.rects.popper, 2552 gpuAcceleration: gpuAcceleration, 2553 isFixed: state.options.strategy === 'fixed' 2554 }; 2555 2556 if (state.modifiersData.popperOffsets != null) { 2557 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 2558 offsets: state.modifiersData.popperOffsets, 2559 position: state.options.strategy, 2560 adaptive: adaptive, 2561 roundOffsets: roundOffsets 2562 }))); 2563 } 2564 2565 if (state.modifiersData.arrow != null) { 2566 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 2567 offsets: state.modifiersData.arrow, 2568 position: 'absolute', 2569 adaptive: false, 2570 roundOffsets: roundOffsets 2571 }))); 2572 } 2573 2574 state.attributes.popper = Object.assign({}, state.attributes.popper, { 2575 'data-popper-placement': state.placement 2576 });
vendor: 3,541 bytes, lines 2577-2693
2577 } // eslint-disable-next-line import/no-unused-modules 2578 2579 2580 const computeStyles$1 = { 2581 name: 'computeStyles', 2582 enabled: true, 2583 phase: 'beforeWrite', 2584 fn: computeStyles, 2585 data: {} 2586 }; 2587 2588 var passive = { 2589 passive: true 2590 }; 2591 2592 function effect(_ref) { 2593 var state = _ref.state, 2594 instance = _ref.instance, 2595 options = _ref.options; 2596 var _options$scroll = options.scroll, 2597 scroll = _options$scroll === void 0 ? true : _options$scroll, 2598 _options$resize = options.resize, 2599 resize = _options$resize === void 0 ? true : _options$resize; 2600 var window = getWindow(state.elements.popper); 2601 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 2602 2603 if (scroll) { 2604 scrollParents.forEach(function (scrollParent) { 2605 scrollParent.addEventListener('scroll', instance.update, passive); 2606 }); 2607 } 2608 2609 if (resize) { 2610 window.addEventListener('resize', instance.update, passive); 2611 } 2612 2613 return function () { 2614 if (scroll) { 2615 scrollParents.forEach(function (scrollParent) { 2616 scrollParent.removeEventListener('scroll', instance.update, passive); 2617 }); 2618 } 2619 2620 if (resize) { 2621 window.removeEventListener('resize', instance.update, passive); 2622 } 2623 }; 2624 } // eslint-disable-next-line import/no-unused-modules 2625 2626 2627 const eventListeners = { 2628 name: 'eventListeners', 2629 enabled: true, 2630 phase: 'write', 2631 fn: function fn() {}, 2632 effect: effect, 2633 data: {} 2634 }; 2635 2636 var hash$1 = { 2637 left: 'right', 2638 right: 'left', 2639 bottom: 'top', 2640 top: 'bottom' 2641 }; 2642 function getOppositePlacement(placement) { 2643 return placement.replace(/left|right|bottom|top/g, function (matched) { 2644 return hash$1[matched]; 2645 }); 2646 } 2647 2648 var hash = { 2649 start: 'end', 2650 end: 'start' 2651 }; 2652 function getOppositeVariationPlacement(placement) { 2653 return placement.replace(/start|end/g, function (matched) { 2654 return hash[matched]; 2655 }); 2656 } 2657 2658 function getWindowScroll(node) { 2659 var win = getWindow(node); 2660 var scrollLeft = win.pageXOffset; 2661 var scrollTop = win.pageYOffset; 2662 return { 2663 scrollLeft: scrollLeft, 2664 scrollTop: scrollTop 2665 }; 2666 } 2667 2668 function getWindowScrollBarX(element) { 2669 // If <html> has a CSS width greater than the viewport, then this will be 2670 // incorrect for RTL. 2671 // Popper 1 is broken in this case and never had a bug report so let's assume 2672 // it's not an issue. I don't think anyone ever specifies width on <html> 2673 // anyway. 2674 // Browsers where the left scrollbar doesn't cause an issue report `0` for 2675 // this (e.g. Edge 2019, IE11, Safari) 2676 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 2677 } 2678 2679 function getViewportRect(element) { 2680 var win = getWindow(element); 2681 var html = getDocumentElement(element); 2682 var visualViewport = win.visualViewport; 2683 var width = html.clientWidth; 2684 var height = html.clientHeight; 2685 var x = 0; 2686 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper 2687 // can be obscured underneath it. 2688 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even 2689 // if it isn't open, so if this isn't available, the popper will be detected 2690 // to overflow the bottom of the screen too early. 2691 2692 if (visualViewport) { 2693 width = visualViewport.width;
vendor: 5,404 bytes, lines 2694-2829
2694 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) 2695 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding 2696 // errors due to floating point numbers, so we need to check precision. 2697 // Safari returns a number <= 0, usually < -1 when pinch-zoomed 2698 // Feature detection fails in mobile emulation mode in Chrome. 2699 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 2700 // 0.001 2701 // Fallback here: "Not Safari" userAgent 2702 2703 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { 2704 x = visualViewport.offsetLeft; 2705 y = visualViewport.offsetTop; 2706 } 2707 } 2708 2709 return { 2710 width: width, 2711 height: height, 2712 x: x + getWindowScrollBarX(element), 2713 y: y 2714 }; 2715 } 2716 2717 // of the `<html>` and `<body>` rect bounds if horizontally scrollable 2718 2719 function getDocumentRect(element) { 2720 var _element$ownerDocumen; 2721 2722 var html = getDocumentElement(element); 2723 var winScroll = getWindowScroll(element); 2724 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 2725 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 2726 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 2727 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 2728 var y = -winScroll.scrollTop; 2729 2730 if (getComputedStyle$1(body || html).direction === 'rtl') { 2731 x += max(html.clientWidth, body ? body.clientWidth : 0) - width; 2732 } 2733 2734 return { 2735 width: width, 2736 height: height, 2737 x: x, 2738 y: y 2739 }; 2740 } 2741 2742 function isScrollParent(element) { 2743 // Firefox wants us to check `-x` and `-y` variations as well 2744 var _getComputedStyle = getComputedStyle$1(element), 2745 overflow = _getComputedStyle.overflow, 2746 overflowX = _getComputedStyle.overflowX, 2747 overflowY = _getComputedStyle.overflowY; 2748 2749 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 2750 } 2751 2752 function getScrollParent(node) { 2753 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 2754 // $FlowFixMe[incompatible-return]: assume body is always available 2755 return node.ownerDocument.body; 2756 } 2757 2758 if (isHTMLElement(node) && isScrollParent(node)) { 2759 return node; 2760 } 2761 2762 return getScrollParent(getParentNode(node)); 2763 } 2764 2765 /* 2766 given a DOM element, return the list of all scroll parents, up the list of ancesors 2767 until we get to the top window object. This list is what we attach scroll listeners 2768 to, because if any of these parent elements scroll, we'll need to re-calculate the 2769 reference element's position. 2770 */ 2771 2772 function listScrollParents(element, list) { 2773 var _element$ownerDocumen; 2774 2775 if (list === void 0) { 2776 list = []; 2777 } 2778 2779 var scrollParent = getScrollParent(element); 2780 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 2781 var win = getWindow(scrollParent); 2782 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 2783 var updatedList = list.concat(target); 2784 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 2785 updatedList.concat(listScrollParents(getParentNode(target))); 2786 } 2787 2788 function rectToClientRect(rect) { 2789 return Object.assign({}, rect, { 2790 left: rect.x, 2791 top: rect.y, 2792 right: rect.x + rect.width, 2793 bottom: rect.y + rect.height 2794 }); 2795 } 2796 2797 function getInnerBoundingClientRect(element) { 2798 var rect = getBoundingClientRect(element); 2799 rect.top = rect.top + element.clientTop; 2800 rect.left = rect.left + element.clientLeft; 2801 rect.bottom = rect.top + element.clientHeight; 2802 rect.right = rect.left + element.clientWidth; 2803 rect.width = element.clientWidth; 2804 rect.height = element.clientHeight; 2805 rect.x = rect.left; 2806 rect.y = rect.top; 2807 return rect; 2808 } 2809 2810 function getClientRectFromMixedType(element, clippingParent) { 2811 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 2812 } // A "clipping parent" is an overflowable container with the characteristic of 2813 // clipping (or hiding) overflowing elements with a position different from 2814 // `initial` 2815 2816 2817 function getClippingParents(element) { 2818 var clippingParents = listScrollParents(getParentNode(element)); 2819 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0; 2820 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 2821 2822 if (!isElement(clipperElement)) { 2823 return []; 2824 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 2825 2826 2827 return clippingParents.filter(function (clippingParent) { 2828 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 2829 });
vendor: 4,343 bytes, lines 2830-2942
2830 } // Gets the maximum area that the element is visible in due to any number of 2831 // clipping parents 2832 2833 2834 function getClippingRect(element, boundary, rootBoundary) { 2835 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 2836 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 2837 var firstClippingParent = clippingParents[0]; 2838 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 2839 var rect = getClientRectFromMixedType(element, clippingParent); 2840 accRect.top = max(rect.top, accRect.top); 2841 accRect.right = min(rect.right, accRect.right); 2842 accRect.bottom = min(rect.bottom, accRect.bottom); 2843 accRect.left = max(rect.left, accRect.left); 2844 return accRect; 2845 }, getClientRectFromMixedType(element, firstClippingParent)); 2846 clippingRect.width = clippingRect.right - clippingRect.left; 2847 clippingRect.height = clippingRect.bottom - clippingRect.top; 2848 clippingRect.x = clippingRect.left; 2849 clippingRect.y = clippingRect.top; 2850 return clippingRect; 2851 } 2852 2853 function computeOffsets(_ref) { 2854 var reference = _ref.reference, 2855 element = _ref.element, 2856 placement = _ref.placement; 2857 var basePlacement = placement ? getBasePlacement(placement) : null; 2858 var variation = placement ? getVariation(placement) : null; 2859 var commonX = reference.x + reference.width / 2 - element.width / 2; 2860 var commonY = reference.y + reference.height / 2 - element.height / 2; 2861 var offsets; 2862 2863 switch (basePlacement) { 2864 case top: 2865 offsets = { 2866 x: commonX, 2867 y: reference.y - element.height 2868 }; 2869 break; 2870 2871 case bottom: 2872 offsets = { 2873 x: commonX, 2874 y: reference.y + reference.height 2875 }; 2876 break; 2877 2878 case right: 2879 offsets = { 2880 x: reference.x + reference.width, 2881 y: commonY 2882 }; 2883 break; 2884 2885 case left: 2886 offsets = { 2887 x: reference.x - element.width, 2888 y: commonY 2889 }; 2890 break; 2891 2892 default: 2893 offsets = { 2894 x: reference.x, 2895 y: reference.y 2896 }; 2897 } 2898 2899 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 2900 2901 if (mainAxis != null) { 2902 var len = mainAxis === 'y' ? 'height' : 'width'; 2903 2904 switch (variation) { 2905 case start: 2906 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 2907 break; 2908 2909 case end: 2910 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 2911 break; 2912 } 2913 } 2914 2915 return offsets; 2916 } 2917 2918 function detectOverflow(state, options) { 2919 if (options === void 0) { 2920 options = {}; 2921 } 2922 2923 var _options = options, 2924 _options$placement = _options.placement, 2925 placement = _options$placement === void 0 ? state.placement : _options$placement, 2926 _options$boundary = _options.boundary, 2927 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 2928 _options$rootBoundary = _options.rootBoundary, 2929 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 2930 _options$elementConte = _options.elementContext, 2931 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 2932 _options$altBoundary = _options.altBoundary, 2933 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 2934 _options$padding = _options.padding, 2935 padding = _options$padding === void 0 ? 0 : _options$padding; 2936 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2937 var altContext = elementContext === popper ? reference : popper; 2938 var popperRect = state.rects.popper; 2939 var element = state.elements[altBoundary ? altContext : elementContext]; 2940 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); 2941 var referenceClientRect = getBoundingClientRect(state.elements.reference); 2942 var popperOffsets = computeOffsets({
vendor: 12,960 bytes, lines 2943-3312
2943 reference: referenceClientRect, 2944 element: popperRect, 2945 strategy: 'absolute', 2946 placement: placement 2947 }); 2948 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 2949 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 2950 // 0 or negative = within the clipping rect 2951 2952 var overflowOffsets = { 2953 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 2954 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 2955 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 2956 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 2957 }; 2958 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 2959 2960 if (elementContext === popper && offsetData) { 2961 var offset = offsetData[placement]; 2962 Object.keys(overflowOffsets).forEach(function (key) { 2963 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 2964 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 2965 overflowOffsets[key] += offset[axis] * multiply; 2966 }); 2967 } 2968 2969 return overflowOffsets; 2970 } 2971 2972 function computeAutoPlacement(state, options) { 2973 if (options === void 0) { 2974 options = {}; 2975 } 2976 2977 var _options = options, 2978 placement = _options.placement, 2979 boundary = _options.boundary, 2980 rootBoundary = _options.rootBoundary, 2981 padding = _options.padding, 2982 flipVariations = _options.flipVariations, 2983 _options$allowedAutoP = _options.allowedAutoPlacements, 2984 allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; 2985 var variation = getVariation(placement); 2986 var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 2987 return getVariation(placement) === variation; 2988 }) : basePlacements; 2989 var allowedPlacements = placements$1.filter(function (placement) { 2990 return allowedAutoPlacements.indexOf(placement) >= 0; 2991 }); 2992 2993 if (allowedPlacements.length === 0) { 2994 allowedPlacements = placements$1; 2995 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 2996 2997 2998 var overflows = allowedPlacements.reduce(function (acc, placement) { 2999 acc[placement] = detectOverflow(state, { 3000 placement: placement, 3001 boundary: boundary, 3002 rootBoundary: rootBoundary, 3003 padding: padding 3004 })[getBasePlacement(placement)]; 3005 return acc; 3006 }, {}); 3007 return Object.keys(overflows).sort(function (a, b) { 3008 return overflows[a] - overflows[b]; 3009 }); 3010 } 3011 3012 function getExpandedFallbackPlacements(placement) { 3013 if (getBasePlacement(placement) === auto) { 3014 return []; 3015 } 3016 3017 var oppositePlacement = getOppositePlacement(placement); 3018 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 3019 } 3020 3021 function flip(_ref) { 3022 var state = _ref.state, 3023 options = _ref.options, 3024 name = _ref.name; 3025 3026 if (state.modifiersData[name]._skip) { 3027 return; 3028 } 3029 3030 var _options$mainAxis = options.mainAxis, 3031 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 3032 _options$altAxis = options.altAxis, 3033 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 3034 specifiedFallbackPlacements = options.fallbackPlacements, 3035 padding = options.padding, 3036 boundary = options.boundary, 3037 rootBoundary = options.rootBoundary, 3038 altBoundary = options.altBoundary, 3039 _options$flipVariatio = options.flipVariations, 3040 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 3041 allowedAutoPlacements = options.allowedAutoPlacements; 3042 var preferredPlacement = state.options.placement; 3043 var basePlacement = getBasePlacement(preferredPlacement); 3044 var isBasePlacement = basePlacement === preferredPlacement; 3045 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 3046 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 3047 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 3048 placement: placement, 3049 boundary: boundary, 3050 rootBoundary: rootBoundary, 3051 padding: padding, 3052 flipVariations: flipVariations, 3053 allowedAutoPlacements: allowedAutoPlacements 3054 }) : placement); 3055 }, []); 3056 var referenceRect = state.rects.reference; 3057 var popperRect = state.rects.popper; 3058 var checksMap = new Map(); 3059 var makeFallbackChecks = true; 3060 var firstFittingPlacement = placements[0]; 3061 3062 for (var i = 0; i < placements.length; i++) { 3063 var placement = placements[i]; 3064 3065 var _basePlacement = getBasePlacement(placement); 3066 3067 var isStartVariation = getVariation(placement) === start; 3068 var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; 3069 var len = isVertical ? 'width' : 'height'; 3070 var overflow = detectOverflow(state, { 3071 placement: placement, 3072 boundary: boundary, 3073 rootBoundary: rootBoundary, 3074 altBoundary: altBoundary, 3075 padding: padding 3076 }); 3077 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; 3078 3079 if (referenceRect[len] > popperRect[len]) { 3080 mainVariationSide = getOppositePlacement(mainVariationSide); 3081 } 3082 3083 var altVariationSide = getOppositePlacement(mainVariationSide); 3084 var checks = []; 3085 3086 if (checkMainAxis) { 3087 checks.push(overflow[_basePlacement] <= 0); 3088 } 3089 3090 if (checkAltAxis) { 3091 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 3092 } 3093 3094 if (checks.every(function (check) { 3095 return check; 3096 })) { 3097 firstFittingPlacement = placement; 3098 makeFallbackChecks = false; 3099 break; 3100 } 3101 3102 checksMap.set(placement, checks); 3103 } 3104 3105 if (makeFallbackChecks) { 3106 // `2` may be desired in some cases – research later 3107 var numberOfChecks = flipVariations ? 3 : 1; 3108 3109 var _loop = function _loop(_i) { 3110 var fittingPlacement = placements.find(function (placement) { 3111 var checks = checksMap.get(placement); 3112 3113 if (checks) { 3114 return checks.slice(0, _i).every(function (check) { 3115 return check; 3116 }); 3117 } 3118 }); 3119 3120 if (fittingPlacement) { 3121 firstFittingPlacement = fittingPlacement; 3122 return "break"; 3123 } 3124 }; 3125 3126 for (var _i = numberOfChecks; _i > 0; _i--) { 3127 var _ret = _loop(_i); 3128 3129 if (_ret === "break") break; 3130 } 3131 } 3132 3133 if (state.placement !== firstFittingPlacement) { 3134 state.modifiersData[name]._skip = true; 3135 state.placement = firstFittingPlacement; 3136 state.reset = true; 3137 } 3138 } // eslint-disable-next-line import/no-unused-modules 3139 3140 3141 const flip$1 = { 3142 name: 'flip', 3143 enabled: true, 3144 phase: 'main', 3145 fn: flip, 3146 requiresIfExists: ['offset'], 3147 data: { 3148 _skip: false 3149 } 3150 }; 3151 3152 function getSideOffsets(overflow, rect, preventedOffsets) { 3153 if (preventedOffsets === void 0) { 3154 preventedOffsets = { 3155 x: 0, 3156 y: 0 3157 }; 3158 } 3159 3160 return { 3161 top: overflow.top - rect.height - preventedOffsets.y, 3162 right: overflow.right - rect.width + preventedOffsets.x, 3163 bottom: overflow.bottom - rect.height + preventedOffsets.y, 3164 left: overflow.left - rect.width - preventedOffsets.x 3165 }; 3166 } 3167 3168 function isAnySideFullyClipped(overflow) { 3169 return [top, right, bottom, left].some(function (side) { 3170 return overflow[side] >= 0; 3171 }); 3172 } 3173 3174 function hide(_ref) { 3175 var state = _ref.state, 3176 name = _ref.name; 3177 var referenceRect = state.rects.reference; 3178 var popperRect = state.rects.popper; 3179 var preventedOffsets = state.modifiersData.preventOverflow; 3180 var referenceOverflow = detectOverflow(state, { 3181 elementContext: 'reference' 3182 }); 3183 var popperAltOverflow = detectOverflow(state, { 3184 altBoundary: true 3185 }); 3186 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 3187 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 3188 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 3189 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 3190 state.modifiersData[name] = { 3191 referenceClippingOffsets: referenceClippingOffsets, 3192 popperEscapeOffsets: popperEscapeOffsets, 3193 isReferenceHidden: isReferenceHidden, 3194 hasPopperEscaped: hasPopperEscaped 3195 }; 3196 state.attributes.popper = Object.assign({}, state.attributes.popper, { 3197 'data-popper-reference-hidden': isReferenceHidden, 3198 'data-popper-escaped': hasPopperEscaped 3199 }); 3200 } // eslint-disable-next-line import/no-unused-modules 3201 3202 3203 const hide$1 = { 3204 name: 'hide', 3205 enabled: true, 3206 phase: 'main', 3207 requiresIfExists: ['preventOverflow'], 3208 fn: hide 3209 }; 3210 3211 function distanceAndSkiddingToXY(placement, rects, offset) { 3212 var basePlacement = getBasePlacement(placement); 3213 var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; 3214 3215 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 3216 placement: placement 3217 })) : offset, 3218 skidding = _ref[0], 3219 distance = _ref[1]; 3220 3221 skidding = skidding || 0; 3222 distance = (distance || 0) * invertDistance; 3223 return [left, right].indexOf(basePlacement) >= 0 ? { 3224 x: distance, 3225 y: skidding 3226 } : { 3227 x: skidding, 3228 y: distance 3229 }; 3230 } 3231 3232 function offset(_ref2) { 3233 var state = _ref2.state, 3234 options = _ref2.options, 3235 name = _ref2.name; 3236 var _options$offset = options.offset, 3237 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 3238 var data = placements.reduce(function (acc, placement) { 3239 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 3240 return acc; 3241 }, {}); 3242 var _data$state$placement = data[state.placement], 3243 x = _data$state$placement.x, 3244 y = _data$state$placement.y; 3245 3246 if (state.modifiersData.popperOffsets != null) { 3247 state.modifiersData.popperOffsets.x += x; 3248 state.modifiersData.popperOffsets.y += y; 3249 } 3250 3251 state.modifiersData[name] = data; 3252 } // eslint-disable-next-line import/no-unused-modules 3253 3254 3255 const offset$1 = { 3256 name: 'offset', 3257 enabled: true, 3258 phase: 'main', 3259 requires: ['popperOffsets'], 3260 fn: offset 3261 }; 3262 3263 function popperOffsets(_ref) { 3264 var state = _ref.state, 3265 name = _ref.name; 3266 // Offsets are the actual position the popper needs to have to be 3267 // properly positioned near its reference element 3268 // This is the most basic placement, and will be adjusted by 3269 // the modifiers in the next step 3270 state.modifiersData[name] = computeOffsets({ 3271 reference: state.rects.reference, 3272 element: state.rects.popper, 3273 strategy: 'absolute', 3274 placement: state.placement 3275 }); 3276 } // eslint-disable-next-line import/no-unused-modules 3277 3278 3279 const popperOffsets$1 = { 3280 name: 'popperOffsets', 3281 enabled: true, 3282 phase: 'read', 3283 fn: popperOffsets, 3284 data: {} 3285 }; 3286 3287 function getAltAxis(axis) { 3288 return axis === 'x' ? 'y' : 'x'; 3289 } 3290 3291 function preventOverflow(_ref) { 3292 var state = _ref.state, 3293 options = _ref.options, 3294 name = _ref.name; 3295 var _options$mainAxis = options.mainAxis, 3296 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 3297 _options$altAxis = options.altAxis, 3298 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 3299 boundary = options.boundary, 3300 rootBoundary = options.rootBoundary, 3301 altBoundary = options.altBoundary, 3302 padding = options.padding, 3303 _options$tether = options.tether, 3304 tether = _options$tether === void 0 ? true : _options$tether, 3305 _options$tetherOffset = options.tetherOffset, 3306 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 3307 var overflow = detectOverflow(state, { 3308 boundary: boundary, 3309 rootBoundary: rootBoundary, 3310 padding: padding, 3311 altBoundary: altBoundary 3312 });
vendor: 26,192 bytes, lines 3313-4046
3313 var basePlacement = getBasePlacement(state.placement); 3314 var variation = getVariation(state.placement); 3315 var isBasePlacement = !variation; 3316 var mainAxis = getMainAxisFromPlacement(basePlacement); 3317 var altAxis = getAltAxis(mainAxis); 3318 var popperOffsets = state.modifiersData.popperOffsets; 3319 var referenceRect = state.rects.reference; 3320 var popperRect = state.rects.popper; 3321 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 3322 placement: state.placement 3323 })) : tetherOffset; 3324 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 3325 mainAxis: tetherOffsetValue, 3326 altAxis: tetherOffsetValue 3327 } : Object.assign({ 3328 mainAxis: 0, 3329 altAxis: 0 3330 }, tetherOffsetValue); 3331 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 3332 var data = { 3333 x: 0, 3334 y: 0 3335 }; 3336 3337 if (!popperOffsets) { 3338 return; 3339 } 3340 3341 if (checkMainAxis) { 3342 var _offsetModifierState$; 3343 3344 var mainSide = mainAxis === 'y' ? top : left; 3345 var altSide = mainAxis === 'y' ? bottom : right; 3346 var len = mainAxis === 'y' ? 'height' : 'width'; 3347 var offset = popperOffsets[mainAxis]; 3348 var min$1 = offset + overflow[mainSide]; 3349 var max$1 = offset - overflow[altSide]; 3350 var additive = tether ? -popperRect[len] / 2 : 0; 3351 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 3352 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 3353 // outside the reference bounds 3354 3355 var arrowElement = state.elements.arrow; 3356 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 3357 width: 0, 3358 height: 0 3359 }; 3360 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 3361 var arrowPaddingMin = arrowPaddingObject[mainSide]; 3362 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 3363 // to include its full size in the calculation. If the reference is small 3364 // and near the edge of a boundary, the popper can overflow even if the 3365 // reference is not overflowing as well (e.g. virtual elements with no 3366 // width or height) 3367 3368 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 3369 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 3370 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 3371 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 3372 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 3373 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 3374 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 3375 var tetherMax = offset + maxOffset - offsetModifierValue; 3376 var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); 3377 popperOffsets[mainAxis] = preventedOffset; 3378 data[mainAxis] = preventedOffset - offset; 3379 } 3380 3381 if (checkAltAxis) { 3382 var _offsetModifierState$2; 3383 3384 var _mainSide = mainAxis === 'x' ? top : left; 3385 3386 var _altSide = mainAxis === 'x' ? bottom : right; 3387 3388 var _offset = popperOffsets[altAxis]; 3389 3390 var _len = altAxis === 'y' ? 'height' : 'width'; 3391 3392 var _min = _offset + overflow[_mainSide]; 3393 3394 var _max = _offset - overflow[_altSide]; 3395 3396 var isOriginSide = [top, left].indexOf(basePlacement) !== -1; 3397 3398 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 3399 3400 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 3401 3402 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 3403 3404 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 3405 3406 popperOffsets[altAxis] = _preventedOffset; 3407 data[altAxis] = _preventedOffset - _offset; 3408 } 3409 3410 state.modifiersData[name] = data; 3411 } // eslint-disable-next-line import/no-unused-modules 3412 3413 3414 const preventOverflow$1 = { 3415 name: 'preventOverflow', 3416 enabled: true, 3417 phase: 'main', 3418 fn: preventOverflow, 3419 requiresIfExists: ['offset'] 3420 }; 3421 3422 function getHTMLElementScroll(element) { 3423 return { 3424 scrollLeft: element.scrollLeft, 3425 scrollTop: element.scrollTop 3426 }; 3427 } 3428 3429 function getNodeScroll(node) { 3430 if (node === getWindow(node) || !isHTMLElement(node)) { 3431 return getWindowScroll(node); 3432 } else { 3433 return getHTMLElementScroll(node); 3434 } 3435 } 3436 3437 function isElementScaled(element) { 3438 var rect = element.getBoundingClientRect(); 3439 var scaleX = round(rect.width) / element.offsetWidth || 1; 3440 var scaleY = round(rect.height) / element.offsetHeight || 1; 3441 return scaleX !== 1 || scaleY !== 1; 3442 } // Returns the composite rect of an element relative to its offsetParent. 3443 // Composite means it takes into account transforms as well as layout. 3444 3445 3446 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 3447 if (isFixed === void 0) { 3448 isFixed = false; 3449 } 3450 3451 var isOffsetParentAnElement = isHTMLElement(offsetParent); 3452 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); 3453 var documentElement = getDocumentElement(offsetParent); 3454 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); 3455 var scroll = { 3456 scrollLeft: 0, 3457 scrollTop: 0 3458 }; 3459 var offsets = { 3460 x: 0, 3461 y: 0 3462 }; 3463 3464 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 3465 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 3466 isScrollParent(documentElement)) { 3467 scroll = getNodeScroll(offsetParent); 3468 } 3469 3470 if (isHTMLElement(offsetParent)) { 3471 offsets = getBoundingClientRect(offsetParent, true); 3472 offsets.x += offsetParent.clientLeft; 3473 offsets.y += offsetParent.clientTop; 3474 } else if (documentElement) { 3475 offsets.x = getWindowScrollBarX(documentElement); 3476 } 3477 } 3478 3479 return { 3480 x: rect.left + scroll.scrollLeft - offsets.x, 3481 y: rect.top + scroll.scrollTop - offsets.y, 3482 width: rect.width, 3483 height: rect.height 3484 }; 3485 } 3486 3487 function order(modifiers) { 3488 var map = new Map(); 3489 var visited = new Set(); 3490 var result = []; 3491 modifiers.forEach(function (modifier) { 3492 map.set(modifier.name, modifier); 3493 }); // On visiting object, check for its dependencies and visit them recursively 3494 3495 function sort(modifier) { 3496 visited.add(modifier.name); 3497 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); 3498 requires.forEach(function (dep) { 3499 if (!visited.has(dep)) { 3500 var depModifier = map.get(dep); 3501 3502 if (depModifier) { 3503 sort(depModifier); 3504 } 3505 } 3506 }); 3507 result.push(modifier); 3508 } 3509 3510 modifiers.forEach(function (modifier) { 3511 if (!visited.has(modifier.name)) { 3512 // check for visited object 3513 sort(modifier); 3514 } 3515 }); 3516 return result; 3517 } 3518 3519 function orderModifiers(modifiers) { 3520 // order based on dependencies 3521 var orderedModifiers = order(modifiers); // order based on phase 3522 3523 return modifierPhases.reduce(function (acc, phase) { 3524 return acc.concat(orderedModifiers.filter(function (modifier) { 3525 return modifier.phase === phase; 3526 })); 3527 }, []); 3528 } 3529 3530 function debounce(fn) { 3531 var pending; 3532 return function () { 3533 if (!pending) { 3534 pending = new Promise(function (resolve) { 3535 Promise.resolve().then(function () { 3536 pending = undefined; 3537 resolve(fn()); 3538 }); 3539 }); 3540 } 3541 3542 return pending; 3543 }; 3544 } 3545 3546 function mergeByName(modifiers) { 3547 var merged = modifiers.reduce(function (merged, current) { 3548 var existing = merged[current.name]; 3549 merged[current.name] = existing ? Object.assign({}, existing, current, { 3550 options: Object.assign({}, existing.options, current.options), 3551 data: Object.assign({}, existing.data, current.data) 3552 }) : current; 3553 return merged; 3554 }, {}); // IE11 does not support Object.values 3555 3556 return Object.keys(merged).map(function (key) { 3557 return merged[key]; 3558 }); 3559 } 3560 3561 var DEFAULT_OPTIONS = { 3562 placement: 'bottom', 3563 modifiers: [], 3564 strategy: 'absolute' 3565 }; 3566 3567 function areValidElements() { 3568 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 3569 args[_key] = arguments[_key]; 3570 } 3571 3572 return !args.some(function (element) { 3573 return !(element && typeof element.getBoundingClientRect === 'function'); 3574 }); 3575 } 3576 3577 function popperGenerator(generatorOptions) { 3578 if (generatorOptions === void 0) { 3579 generatorOptions = {}; 3580 } 3581 3582 var _generatorOptions = generatorOptions, 3583 _generatorOptions$def = _generatorOptions.defaultModifiers, 3584 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 3585 _generatorOptions$def2 = _generatorOptions.defaultOptions, 3586 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 3587 return function createPopper(reference, popper, options) { 3588 if (options === void 0) { 3589 options = defaultOptions; 3590 } 3591 3592 var state = { 3593 placement: 'bottom', 3594 orderedModifiers: [], 3595 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 3596 modifiersData: {}, 3597 elements: { 3598 reference: reference, 3599 popper: popper 3600 }, 3601 attributes: {}, 3602 styles: {} 3603 }; 3604 var effectCleanupFns = []; 3605 var isDestroyed = false; 3606 var instance = { 3607 state: state, 3608 setOptions: function setOptions(setOptionsAction) { 3609 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 3610 cleanupModifierEffects(); 3611 state.options = Object.assign({}, defaultOptions, state.options, options); 3612 state.scrollParents = { 3613 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 3614 popper: listScrollParents(popper) 3615 }; // Orders the modifiers based on their dependencies and `phase` 3616 // properties 3617 3618 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 3619 3620 state.orderedModifiers = orderedModifiers.filter(function (m) { 3621 return m.enabled; 3622 }); // Validate the provided modifiers so that the consumer will get warned 3623 3624 runModifierEffects(); 3625 return instance.update(); 3626 }, 3627 // Sync update – it will always be executed, even if not necessary. This 3628 // is useful for low frequency updates where sync behavior simplifies the 3629 // logic. 3630 // For high frequency updates (e.g. `resize` and `scroll` events), always 3631 // prefer the async Popper#update method 3632 forceUpdate: function forceUpdate() { 3633 if (isDestroyed) { 3634 return; 3635 } 3636 3637 var _state$elements = state.elements, 3638 reference = _state$elements.reference, 3639 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 3640 // anymore 3641 3642 if (!areValidElements(reference, popper)) { 3643 3644 return; 3645 } // Store the reference and popper rects to be read by modifiers 3646 3647 3648 state.rects = { 3649 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 3650 popper: getLayoutRect(popper) 3651 }; // Modifiers have the ability to reset the current update cycle. The 3652 // most common use case for this is the `flip` modifier changing the 3653 // placement, which then needs to re-run all the modifiers, because the 3654 // logic was previously ran for the previous placement and is therefore 3655 // stale/incorrect 3656 3657 state.reset = false; 3658 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 3659 // is filled with the initial data specified by the modifier. This means 3660 // it doesn't persist and is fresh on each update. 3661 // To ensure persistent data, use `${name}#persistent` 3662 3663 state.orderedModifiers.forEach(function (modifier) { 3664 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 3665 }); 3666 3667 for (var index = 0; index < state.orderedModifiers.length; index++) { 3668 3669 if (state.reset === true) { 3670 state.reset = false; 3671 index = -1; 3672 continue; 3673 } 3674 3675 var _state$orderedModifie = state.orderedModifiers[index], 3676 fn = _state$orderedModifie.fn, 3677 _state$orderedModifie2 = _state$orderedModifie.options, 3678 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 3679 name = _state$orderedModifie.name; 3680 3681 if (typeof fn === 'function') { 3682 state = fn({ 3683 state: state, 3684 options: _options, 3685 name: name, 3686 instance: instance 3687 }) || state; 3688 } 3689 } 3690 }, 3691 // Async and optimistically optimized update – it will not be executed if 3692 // not necessary (debounced to run at most once-per-tick) 3693 update: debounce(function () { 3694 return new Promise(function (resolve) { 3695 instance.forceUpdate(); 3696 resolve(state); 3697 }); 3698 }), 3699 destroy: function destroy() { 3700 cleanupModifierEffects(); 3701 isDestroyed = true; 3702 } 3703 }; 3704 3705 if (!areValidElements(reference, popper)) { 3706 3707 return instance; 3708 } 3709 3710 instance.setOptions(options).then(function (state) { 3711 if (!isDestroyed && options.onFirstUpdate) { 3712 options.onFirstUpdate(state); 3713 } 3714 }); // Modifiers have the ability to execute arbitrary code before the first 3715 // update cycle runs. They will be executed in the same order as the update 3716 // cycle. This is useful when a modifier adds some persistent data that 3717 // other modifiers need to use, but the modifier is run after the dependent 3718 // one. 3719 3720 function runModifierEffects() { 3721 state.orderedModifiers.forEach(function (_ref3) { 3722 var name = _ref3.name, 3723 _ref3$options = _ref3.options, 3724 options = _ref3$options === void 0 ? {} : _ref3$options, 3725 effect = _ref3.effect; 3726 3727 if (typeof effect === 'function') { 3728 var cleanupFn = effect({ 3729 state: state, 3730 name: name, 3731 instance: instance, 3732 options: options 3733 }); 3734 3735 var noopFn = function noopFn() {}; 3736 3737 effectCleanupFns.push(cleanupFn || noopFn); 3738 } 3739 }); 3740 } 3741 3742 function cleanupModifierEffects() { 3743 effectCleanupFns.forEach(function (fn) { 3744 return fn(); 3745 }); 3746 effectCleanupFns = []; 3747 } 3748 3749 return instance; 3750 }; 3751 } 3752 var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules 3753 3754 var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; 3755 var createPopper$1 = /*#__PURE__*/popperGenerator({ 3756 defaultModifiers: defaultModifiers$1 3757 }); // eslint-disable-next-line import/no-unused-modules 3758 3759 var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; 3760 var createPopper = /*#__PURE__*/popperGenerator({ 3761 defaultModifiers: defaultModifiers 3762 }); // eslint-disable-next-line import/no-unused-modules 3763 3764 const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ 3765 __proto__: null, 3766 popperGenerator, 3767 detectOverflow, 3768 createPopperBase: createPopper$2, 3769 createPopper, 3770 createPopperLite: createPopper$1, 3771 top, 3772 bottom, 3773 right, 3774 left, 3775 auto, 3776 basePlacements, 3777 start, 3778 end, 3779 clippingParents, 3780 viewport, 3781 popper, 3782 reference, 3783 variationPlacements, 3784 placements, 3785 beforeRead, 3786 read, 3787 afterRead, 3788 beforeMain, 3789 main, 3790 afterMain, 3791 beforeWrite, 3792 write, 3793 afterWrite, 3794 modifierPhases, 3795 applyStyles: applyStyles$1, 3796 arrow: arrow$1, 3797 computeStyles: computeStyles$1, 3798 eventListeners, 3799 flip: flip$1, 3800 hide: hide$1, 3801 offset: offset$1, 3802 popperOffsets: popperOffsets$1, 3803 preventOverflow: preventOverflow$1 3804 }, Symbol.toStringTag, { value: 'Module' })); 3805 3806 /** 3807 * -------------------------------------------------------------------------- 3808 * Bootstrap (v5.2.0): dropdown.js 3809 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3810 * -------------------------------------------------------------------------- 3811 */ 3812 /** 3813 * Constants 3814 */ 3815 3816 const NAME$a = 'dropdown'; 3817 const DATA_KEY$6 = 'bs.dropdown'; 3818 const EVENT_KEY$6 = `.${DATA_KEY$6}`; 3819 const DATA_API_KEY$3 = '.data-api'; 3820 const ESCAPE_KEY$2 = 'Escape'; 3821 const TAB_KEY$1 = 'Tab'; 3822 const ARROW_UP_KEY$1 = 'ArrowUp'; 3823 const ARROW_DOWN_KEY$1 = 'ArrowDown'; 3824 const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button 3825 3826 const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; 3827 const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; 3828 const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; 3829 const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; 3830 const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; 3831 const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; 3832 const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; 3833 const CLASS_NAME_SHOW$6 = 'show'; 3834 const CLASS_NAME_DROPUP = 'dropup'; 3835 const CLASS_NAME_DROPEND = 'dropend'; 3836 const CLASS_NAME_DROPSTART = 'dropstart'; 3837 const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; 3838 const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; 3839 const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; 3840 const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; 3841 const SELECTOR_MENU = '.dropdown-menu'; 3842 const SELECTOR_NAVBAR = '.navbar'; 3843 const SELECTOR_NAVBAR_NAV = '.navbar-nav'; 3844 const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 3845 const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; 3846 const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; 3847 const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; 3848 const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; 3849 const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; 3850 const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; 3851 const PLACEMENT_TOPCENTER = 'top'; 3852 const PLACEMENT_BOTTOMCENTER = 'bottom'; 3853 const Default$9 = { 3854 autoClose: true, 3855 boundary: 'clippingParents', 3856 display: 'dynamic', 3857 offset: [0, 2], 3858 popperConfig: null, 3859 reference: 'toggle' 3860 }; 3861 const DefaultType$9 = { 3862 autoClose: '(boolean|string)', 3863 boundary: '(string|element)', 3864 display: 'string', 3865 offset: '(array|string|function)', 3866 popperConfig: '(null|object|function)', 3867 reference: '(string|element|object)' 3868 }; 3869 /** 3870 * Class definition 3871 */ 3872 3873 class Dropdown extends BaseComponent { 3874 constructor(element, config) { 3875 super(element, config); 3876 this._popper = null; 3877 this._parent = this._element.parentNode; // dropdown wrapper 3878 3879 this._menu = SelectorEngine.findOne(SELECTOR_MENU, this._parent); 3880 this._inNavbar = this._detectNavbar(); 3881 } // Getters 3882 3883 3884 static get Default() { 3885 return Default$9; 3886 } 3887 3888 static get DefaultType() { 3889 return DefaultType$9; 3890 } 3891 3892 static get NAME() { 3893 return NAME$a; 3894 } // Public 3895 3896 3897 toggle() { 3898 return this._isShown() ? this.hide() : this.show(); 3899 } 3900 3901 show() { 3902 if (isDisabled(this._element) || this._isShown()) { 3903 return; 3904 } 3905 3906 const relatedTarget = { 3907 relatedTarget: this._element 3908 }; 3909 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); 3910 3911 if (showEvent.defaultPrevented) { 3912 return; 3913 } 3914 3915 this._createPopper(); // If this is a touch-enabled device we add extra 3916 // empty mouseover listeners to the body's immediate children; 3917 // only needed because of broken event delegation on iOS 3918 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3919 3920 3921 if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { 3922 for (const element of [].concat(...document.body.children)) { 3923 EventHandler.on(element, 'mouseover', noop); 3924 } 3925 } 3926 3927 this._element.focus(); 3928 3929 this._element.setAttribute('aria-expanded', true); 3930 3931 this._menu.classList.add(CLASS_NAME_SHOW$6); 3932 3933 this._element.classList.add(CLASS_NAME_SHOW$6); 3934 3935 EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); 3936 } 3937 3938 hide() { 3939 if (isDisabled(this._element) || !this._isShown()) { 3940 return; 3941 } 3942 3943 const relatedTarget = { 3944 relatedTarget: this._element 3945 }; 3946 3947 this._completeHide(relatedTarget); 3948 } 3949 3950 dispose() { 3951 if (this._popper) { 3952 this._popper.destroy(); 3953 } 3954 3955 super.dispose(); 3956 } 3957 3958 update() { 3959 this._inNavbar = this._detectNavbar(); 3960 3961 if (this._popper) { 3962 this._popper.update(); 3963 } 3964 } // Private 3965 3966 3967 _completeHide(relatedTarget) { 3968 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); 3969 3970 if (hideEvent.defaultPrevented) { 3971 return; 3972 } // If this is a touch-enabled device we remove the extra 3973 // empty mouseover listeners we added for iOS support 3974 3975 3976 if ('ontouchstart' in document.documentElement) { 3977 for (const element of [].concat(...document.body.children)) { 3978 EventHandler.off(element, 'mouseover', noop); 3979 } 3980 } 3981 3982 if (this._popper) { 3983 this._popper.destroy(); 3984 } 3985 3986 this._menu.classList.remove(CLASS_NAME_SHOW$6); 3987 3988 this._element.classList.remove(CLASS_NAME_SHOW$6); 3989 3990 this._element.setAttribute('aria-expanded', 'false'); 3991 3992 Manipulator.removeDataAttribute(this._menu, 'popper'); 3993 EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); 3994 } 3995 3996 _getConfig(config) { 3997 config = super._getConfig(config); 3998 3999 if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { 4000 // Popper virtual elements require a getBoundingClientRect method 4001 throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); 4002 } 4003 4004 return config; 4005 } 4006 4007 _createPopper() { 4008 if (typeof Popper === 'undefined') { 4009 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 4010 } 4011 4012 let referenceElement = this._element; 4013 4014 if (this._config.reference === 'parent') { 4015 referenceElement = this._parent; 4016 } else if (isElement$1(this._config.reference)) { 4017 referenceElement = getElement(this._config.reference); 4018 } else if (typeof this._config.reference === 'object') { 4019 referenceElement = this._config.reference; 4020 } 4021 4022 const popperConfig = this._getPopperConfig(); 4023 4024 this._popper = createPopper(referenceElement, this._menu, popperConfig); 4025 } 4026 4027 _isShown() { 4028 return this._menu.classList.contains(CLASS_NAME_SHOW$6); 4029 } 4030 4031 _getPlacement() { 4032 const parentDropdown = this._parent; 4033 4034 if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { 4035 return PLACEMENT_RIGHT; 4036 } 4037 4038 if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { 4039 return PLACEMENT_LEFT; 4040 } 4041 4042 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { 4043 return PLACEMENT_TOPCENTER; 4044 } 4045 4046 if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENT
vendor: 4,275 bytes, lines 4046-4182
4046ER)) { 4047 return PLACEMENT_BOTTOMCENTER; 4048 } // We need to trim the value because custom properties can also include spaces 4049 4050 4051 const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; 4052 4053 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { 4054 return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; 4055 } 4056 4057 return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; 4058 } 4059 4060 _detectNavbar() { 4061 return this._element.closest(SELECTOR_NAVBAR) !== null; 4062 } 4063 4064 _getOffset() { 4065 const { 4066 offset 4067 } = this._config; 4068 4069 if (typeof offset === 'string') { 4070 return offset.split(',').map(value => Number.parseInt(value, 10)); 4071 } 4072 4073 if (typeof offset === 'function') { 4074 return popperData => offset(popperData, this._element); 4075 } 4076 4077 return offset; 4078 } 4079 4080 _getPopperConfig() { 4081 const defaultBsPopperConfig = { 4082 placement: this._getPlacement(), 4083 modifiers: [{ 4084 name: 'preventOverflow', 4085 options: { 4086 boundary: this._config.boundary 4087 } 4088 }, { 4089 name: 'offset', 4090 options: { 4091 offset: this._getOffset() 4092 } 4093 }] 4094 }; // Disable Popper if we have a static display or Dropdown is in Navbar 4095 4096 if (this._inNavbar || this._config.display === 'static') { 4097 Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove 4098 4099 defaultBsPopperConfig.modifiers = [{ 4100 name: 'applyStyles', 4101 enabled: false 4102 }]; 4103 } 4104 4105 return { ...defaultBsPopperConfig, 4106 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) 4107 }; 4108 } 4109 4110 _selectMenuItem({ 4111 key, 4112 target 4113 }) { 4114 const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); 4115 4116 if (!items.length) { 4117 return; 4118 } // if target isn't included in items (e.g. when expanding the dropdown) 4119 // allow cycling to get the last item in case key equals ARROW_UP_KEY 4120 4121 4122 getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); 4123 } // Static 4124 4125 4126 static jQueryInterface(config) { 4127 return this.each(function () { 4128 const data = Dropdown.getOrCreateInstance(this, config); 4129 4130 if (typeof config !== 'string') { 4131 return; 4132 } 4133 4134 if (typeof data[config] === 'undefined') { 4135 throw new TypeError(`No method named "${config}"`); 4136 } 4137 4138 data[config](); 4139 }); 4140 } 4141 4142 static clearMenus(event) { 4143 if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { 4144 return; 4145 } 4146 4147 const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); 4148 4149 for (const toggle of openToggles) { 4150 const context = Dropdown.getInstance(toggle); 4151 4152 if (!context || context._config.autoClose === false) { 4153 continue; 4154 } 4155 4156 const composedPath = event.composedPath(); 4157 const isMenuTarget = composedPath.includes(context._menu); 4158 4159 if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { 4160 continue; 4161 } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu 4162 4163 4164 if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { 4165 continue; 4166 } 4167 4168 const relatedTarget = { 4169 relatedTarget: context._element 4170 }; 4171 4172 if (event.type === 'click') { 4173 relatedTarget.clickEvent = event; 4174 } 4175 4176 context._completeHide(relatedTarget); 4177 } 4178 } 4179 4180 static dataApiKeydownHandler(event) { 4181 // If not an UP | DOWN | ESCAPE key => not a dropdown command 4182 // If input/textarea && if key is other than ESCAPE => not a dropdown command
vendor: 9,751 bytes, lines 4183-4526
4183 const isInput = /input|textarea/i.test(event.target.tagName); 4184 const isEscapeEvent = event.key === ESCAPE_KEY$2; 4185 const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); 4186 4187 if (!isUpOrDownEvent && !isEscapeEvent) { 4188 return; 4189 } 4190 4191 if (isInput && !isEscapeEvent) { 4192 return; 4193 } 4194 4195 event.preventDefault(); 4196 const getToggleButton = SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); 4197 const instance = Dropdown.getOrCreateInstance(getToggleButton); 4198 4199 if (isUpOrDownEvent) { 4200 event.stopPropagation(); 4201 instance.show(); 4202 4203 instance._selectMenuItem(event); 4204 4205 return; 4206 } 4207 4208 if (instance._isShown()) { 4209 // else is escape and we check if it is shown 4210 event.stopPropagation(); 4211 instance.hide(); 4212 getToggleButton.focus(); 4213 } 4214 } 4215 4216 } 4217 /** 4218 * Data API implementation 4219 */ 4220 4221 4222 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); 4223 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); 4224 EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); 4225 EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); 4226 EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 4227 event.preventDefault(); 4228 Dropdown.getOrCreateInstance(this).toggle(); 4229 }); 4230 /** 4231 * jQuery 4232 */ 4233 4234 defineJQueryPlugin(Dropdown); 4235 4236 /** 4237 * -------------------------------------------------------------------------- 4238 * Bootstrap (v5.2.0): util/scrollBar.js 4239 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4240 * -------------------------------------------------------------------------- 4241 */ 4242 /** 4243 * Constants 4244 */ 4245 4246 const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 4247 const SELECTOR_STICKY_CONTENT = '.sticky-top'; 4248 const PROPERTY_PADDING = 'padding-right'; 4249 const PROPERTY_MARGIN = 'margin-right'; 4250 /** 4251 * Class definition 4252 */ 4253 4254 class ScrollBarHelper { 4255 constructor() { 4256 this._element = document.body; 4257 } // Public 4258 4259 4260 getWidth() { 4261 // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes 4262 const documentWidth = document.documentElement.clientWidth; 4263 return Math.abs(window.innerWidth - documentWidth); 4264 } 4265 4266 hide() { 4267 const width = this.getWidth(); 4268 4269 this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width 4270 4271 4272 this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth 4273 4274 4275 this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); 4276 4277 this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); 4278 } 4279 4280 reset() { 4281 this._resetElementAttributes(this._element, 'overflow'); 4282 4283 this._resetElementAttributes(this._element, PROPERTY_PADDING); 4284 4285 this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); 4286 4287 this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); 4288 } 4289 4290 isOverflowing() { 4291 return this.getWidth() > 0; 4292 } // Private 4293 4294 4295 _disableOverFlow() { 4296 this._saveInitialAttribute(this._element, 'overflow'); 4297 4298 this._element.style.overflow = 'hidden'; 4299 } 4300 4301 _setElementAttributes(selector, styleProperty, callback) { 4302 const scrollbarWidth = this.getWidth(); 4303 4304 const manipulationCallBack = element => { 4305 if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { 4306 return; 4307 } 4308 4309 this._saveInitialAttribute(element, styleProperty); 4310 4311 const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); 4312 element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); 4313 }; 4314 4315 this._applyManipulationCallback(selector, manipulationCallBack); 4316 } 4317 4318 _saveInitialAttribute(element, styleProperty) { 4319 const actualValue = element.style.getPropertyValue(styleProperty); 4320 4321 if (actualValue) { 4322 Manipulator.setDataAttribute(element, styleProperty, actualValue); 4323 } 4324 } 4325 4326 _resetElementAttributes(selector, styleProperty) { 4327 const manipulationCallBack = element => { 4328 const value = Manipulator.getDataAttribute(element, styleProperty); // We only want to remove the property if the value is `null`; the value can also be zero 4329 4330 if (value === null) { 4331 element.style.removeProperty(styleProperty); 4332 return; 4333 } 4334 4335 Manipulator.removeDataAttribute(element, styleProperty); 4336 element.style.setProperty(styleProperty, value); 4337 }; 4338 4339 this._applyManipulationCallback(selector, manipulationCallBack); 4340 } 4341 4342 _applyManipulationCallback(selector, callBack) { 4343 if (isElement$1(selector)) { 4344 callBack(selector); 4345 return; 4346 } 4347 4348 for (const sel of SelectorEngine.find(selector, this._element)) { 4349 callBack(sel); 4350 } 4351 } 4352 4353 } 4354 4355 /** 4356 * -------------------------------------------------------------------------- 4357 * Bootstrap (v5.2.0): util/backdrop.js 4358 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4359 * -------------------------------------------------------------------------- 4360 */ 4361 /** 4362 * Constants 4363 */ 4364 4365 const NAME$9 = 'backdrop'; 4366 const CLASS_NAME_FADE$4 = 'fade'; 4367 const CLASS_NAME_SHOW$5 = 'show'; 4368 const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; 4369 const Default$8 = { 4370 className: 'modal-backdrop', 4371 clickCallback: null, 4372 isAnimated: false, 4373 isVisible: true, 4374 // if false, we use the backdrop helper without adding any element to the dom 4375 rootElement: 'body' // give the choice to place backdrop under different elements 4376 4377 }; 4378 const DefaultType$8 = { 4379 className: 'string', 4380 clickCallback: '(function|null)', 4381 isAnimated: 'boolean', 4382 isVisible: 'boolean', 4383 rootElement: '(element|string)' 4384 }; 4385 /** 4386 * Class definition 4387 */ 4388 4389 class Backdrop extends Config { 4390 constructor(config) { 4391 super(); 4392 this._config = this._getConfig(config); 4393 this._isAppended = false; 4394 this._element = null; 4395 } // Getters 4396 4397 4398 static get Default() { 4399 return Default$8; 4400 } 4401 4402 static get DefaultType() { 4403 return DefaultType$8; 4404 } 4405 4406 static get NAME() { 4407 return NAME$9; 4408 } // Public 4409 4410 4411 show(callback) { 4412 if (!this._config.isVisible) { 4413 execute(callback); 4414 return; 4415 } 4416 4417 this._append(); 4418 4419 const element = this._getElement(); 4420 4421 if (this._config.isAnimated) { 4422 reflow(element); 4423 } 4424 4425 element.classList.add(CLASS_NAME_SHOW$5); 4426 4427 this._emulateAnimation(() => { 4428 execute(callback); 4429 }); 4430 } 4431 4432 hide(callback) { 4433 if (!this._config.isVisible) { 4434 execute(callback); 4435 return; 4436 } 4437 4438 this._getElement().classList.remove(CLASS_NAME_SHOW$5); 4439 4440 this._emulateAnimation(() => { 4441 this.dispose(); 4442 execute(callback); 4443 }); 4444 } 4445 4446 dispose() { 4447 if (!this._isAppended) { 4448 return; 4449 } 4450 4451 EventHandler.off(this._element, EVENT_MOUSEDOWN); 4452 4453 this._element.remove(); 4454 4455 this._isAppended = false; 4456 } // Private 4457 4458 4459 _getElement() { 4460 if (!this._element) { 4461 const backdrop = document.createElement('div'); 4462 backdrop.className = this._config.className; 4463 4464 if (this._config.isAnimated) { 4465 backdrop.classList.add(CLASS_NAME_FADE$4); 4466 } 4467 4468 this._element = backdrop; 4469 } 4470 4471 return this._element; 4472 } 4473 4474 _configAfterMerge(config) { 4475 // use getElement() with the default "body" to get a fresh Element on each instantiation 4476 config.rootElement = getElement(config.rootElement); 4477 return config; 4478 } 4479 4480 _append() { 4481 if (this._isAppended) { 4482 return; 4483 } 4484 4485 const element = this._getElement(); 4486 4487 this._config.rootElement.append(element); 4488 4489 EventHandler.on(element, EVENT_MOUSEDOWN, () => { 4490 execute(this._config.clickCallback); 4491 }); 4492 this._isAppended = true; 4493 } 4494 4495 _emulateAnimation(callback) { 4496 executeAfterTransition(callback, this._getElement(), this._config.isAnimated); 4497 } 4498 4499 } 4500 4501 /** 4502 * -------------------------------------------------------------------------- 4503 * Bootstrap (v5.2.0): util/focustrap.js 4504 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4505 * -------------------------------------------------------------------------- 4506 */ 4507 /** 4508 * Constants 4509 */ 4510 4511 const NAME$8 = 'focustrap'; 4512 const DATA_KEY$5 = 'bs.focustrap'; 4513 const EVENT_KEY$5 = `.${DATA_KEY$5}`; 4514 const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; 4515 const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; 4516 const TAB_KEY = 'Tab'; 4517 const TAB_NAV_FORWARD = 'forward'; 4518 const TAB_NAV_BACKWARD = 'backward'; 4519 const Default$7 = { 4520 autofocus: true, 4521 trapElement: null // The element to trap focus inside of 4522 4523 }; 4524 const DefaultType$7 = { 4525 autofocus: 'boolean', 4526 trapElement: 'element'
vendor: 10,773 bytes, lines 4527-4933
4527 }; 4528 /** 4529 * Class definition 4530 */ 4531 4532 class FocusTrap extends Config { 4533 constructor(config) { 4534 super(); 4535 this._config = this._getConfig(config); 4536 this._isActive = false; 4537 this._lastTabNavDirection = null; 4538 } // Getters 4539 4540 4541 static get Default() { 4542 return Default$7; 4543 } 4544 4545 static get DefaultType() { 4546 return DefaultType$7; 4547 } 4548 4549 static get NAME() { 4550 return NAME$8; 4551 } // Public 4552 4553 4554 activate() { 4555 if (this._isActive) { 4556 return; 4557 } 4558 4559 if (this._config.autofocus) { 4560 this._config.trapElement.focus(); 4561 } 4562 4563 EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop 4564 4565 EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); 4566 EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); 4567 this._isActive = true; 4568 } 4569 4570 deactivate() { 4571 if (!this._isActive) { 4572 return; 4573 } 4574 4575 this._isActive = false; 4576 EventHandler.off(document, EVENT_KEY$5); 4577 } // Private 4578 4579 4580 _handleFocusin(event) { 4581 const { 4582 trapElement 4583 } = this._config; 4584 4585 if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { 4586 return; 4587 } 4588 4589 const elements = SelectorEngine.focusableChildren(trapElement); 4590 4591 if (elements.length === 0) { 4592 trapElement.focus(); 4593 } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { 4594 elements[elements.length - 1].focus(); 4595 } else { 4596 elements[0].focus(); 4597 } 4598 } 4599 4600 _handleKeydown(event) { 4601 if (event.key !== TAB_KEY) { 4602 return; 4603 } 4604 4605 this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; 4606 } 4607 4608 } 4609 4610 /** 4611 * -------------------------------------------------------------------------- 4612 * Bootstrap (v5.2.0): modal.js 4613 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4614 * -------------------------------------------------------------------------- 4615 */ 4616 /** 4617 * Constants 4618 */ 4619 4620 const NAME$7 = 'modal'; 4621 const DATA_KEY$4 = 'bs.modal'; 4622 const EVENT_KEY$4 = `.${DATA_KEY$4}`; 4623 const DATA_API_KEY$2 = '.data-api'; 4624 const ESCAPE_KEY$1 = 'Escape'; 4625 const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; 4626 const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; 4627 const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; 4628 const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; 4629 const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; 4630 const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; 4631 const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; 4632 const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; 4633 const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; 4634 const CLASS_NAME_OPEN = 'modal-open'; 4635 const CLASS_NAME_FADE$3 = 'fade'; 4636 const CLASS_NAME_SHOW$4 = 'show'; 4637 const CLASS_NAME_STATIC = 'modal-static'; 4638 const OPEN_SELECTOR$1 = '.modal.show'; 4639 const SELECTOR_DIALOG = '.modal-dialog'; 4640 const SELECTOR_MODAL_BODY = '.modal-body'; 4641 const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; 4642 const Default$6 = { 4643 backdrop: true, 4644 focus: true, 4645 keyboard: true 4646 }; 4647 const DefaultType$6 = { 4648 backdrop: '(boolean|string)', 4649 focus: 'boolean', 4650 keyboard: 'boolean' 4651 }; 4652 /** 4653 * Class definition 4654 */ 4655 4656 class Modal extends BaseComponent { 4657 constructor(element, config) { 4658 super(element, config); 4659 this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); 4660 this._backdrop = this._initializeBackDrop(); 4661 this._focustrap = this._initializeFocusTrap(); 4662 this._isShown = false; 4663 this._isTransitioning = false; 4664 this._scrollBar = new ScrollBarHelper(); 4665 4666 this._addEventListeners(); 4667 } // Getters 4668 4669 4670 static get Default() { 4671 return Default$6; 4672 } 4673 4674 static get DefaultType() { 4675 return DefaultType$6; 4676 } 4677 4678 static get NAME() { 4679 return NAME$7; 4680 } // Public 4681 4682 4683 toggle(relatedTarget) { 4684 return this._isShown ? this.hide() : this.show(relatedTarget); 4685 } 4686 4687 show(relatedTarget) { 4688 if (this._isShown || this._isTransitioning) { 4689 return; 4690 } 4691 4692 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { 4693 relatedTarget 4694 }); 4695 4696 if (showEvent.defaultPrevented) { 4697 return; 4698 } 4699 4700 this._isShown = true; 4701 this._isTransitioning = true; 4702 4703 this._scrollBar.hide(); 4704 4705 document.body.classList.add(CLASS_NAME_OPEN); 4706 4707 this._adjustDialog(); 4708 4709 this._backdrop.show(() => this._showElement(relatedTarget)); 4710 } 4711 4712 hide() { 4713 if (!this._isShown || this._isTransitioning) { 4714 return; 4715 } 4716 4717 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); 4718 4719 if (hideEvent.defaultPrevented) { 4720 return; 4721 } 4722 4723 this._isShown = false; 4724 this._isTransitioning = true; 4725 4726 this._focustrap.deactivate(); 4727 4728 this._element.classList.remove(CLASS_NAME_SHOW$4); 4729 4730 this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); 4731 } 4732 4733 dispose() { 4734 for (const htmlElement of [window, this._dialog]) { 4735 EventHandler.off(htmlElement, EVENT_KEY$4); 4736 } 4737 4738 this._backdrop.dispose(); 4739 4740 this._focustrap.deactivate(); 4741 4742 super.dispose(); 4743 } 4744 4745 handleUpdate() { 4746 this._adjustDialog(); 4747 } // Private 4748 4749 4750 _initializeBackDrop() { 4751 return new Backdrop({ 4752 isVisible: Boolean(this._config.backdrop), 4753 // 'static' option will be translated to true, and booleans will keep their value, 4754 isAnimated: this._isAnimated() 4755 }); 4756 } 4757 4758 _initializeFocusTrap() { 4759 return new FocusTrap({ 4760 trapElement: this._element 4761 }); 4762 } 4763 4764 _showElement(relatedTarget) { 4765 // try to append dynamic modal 4766 if (!document.body.contains(this._element)) { 4767 document.body.append(this._element); 4768 } 4769 4770 this._element.style.display = 'block'; 4771 4772 this._element.removeAttribute('aria-hidden'); 4773 4774 this._element.setAttribute('aria-modal', true); 4775 4776 this._element.setAttribute('role', 'dialog'); 4777 4778 this._element.scrollTop = 0; 4779 const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); 4780 4781 if (modalBody) { 4782 modalBody.scrollTop = 0; 4783 } 4784 4785 reflow(this._element); 4786 4787 this._element.classList.add(CLASS_NAME_SHOW$4); 4788 4789 const transitionComplete = () => { 4790 if (this._config.focus) { 4791 this._focustrap.activate(); 4792 } 4793 4794 this._isTransitioning = false; 4795 EventHandler.trigger(this._element, EVENT_SHOWN$4, { 4796 relatedTarget 4797 }); 4798 }; 4799 4800 this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); 4801 } 4802 4803 _addEventListeners() { 4804 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { 4805 if (event.key !== ESCAPE_KEY$1) { 4806 return; 4807 } 4808 4809 if (this._config.keyboard) { 4810 event.preventDefault(); 4811 this.hide(); 4812 return; 4813 } 4814 4815 this._triggerBackdropTransition(); 4816 }); 4817 EventHandler.on(window, EVENT_RESIZE$1, () => { 4818 if (this._isShown && !this._isTransitioning) { 4819 this._adjustDialog(); 4820 } 4821 }); 4822 EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { 4823 if (event.target !== event.currentTarget) { 4824 // click is inside modal-dialog 4825 return; 4826 } 4827 4828 if (this._config.backdrop === 'static') { 4829 this._triggerBackdropTransition(); 4830 4831 return; 4832 } 4833 4834 if (this._config.backdrop) { 4835 this.hide(); 4836 } 4837 }); 4838 } 4839 4840 _hideModal() { 4841 this._element.style.display = 'none'; 4842 4843 this._element.setAttribute('aria-hidden', true); 4844 4845 this._element.removeAttribute('aria-modal'); 4846 4847 this._element.removeAttribute('role'); 4848 4849 this._isTransitioning = false; 4850 4851 this._backdrop.hide(() => { 4852 document.body.classList.remove(CLASS_NAME_OPEN); 4853 4854 this._resetAdjustments(); 4855 4856 this._scrollBar.reset(); 4857 4858 EventHandler.trigger(this._element, EVENT_HIDDEN$4); 4859 }); 4860 } 4861 4862 _isAnimated() { 4863 return this._element.classList.contains(CLASS_NAME_FADE$3); 4864 } 4865 4866 _triggerBackdropTransition() { 4867 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); 4868 4869 if (hideEvent.defaultPrevented) { 4870 return; 4871 } 4872 4873 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4874 const initialOverflowY = this._element.style.overflowY; // return if the following background transition hasn't yet completed 4875 4876 if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { 4877 return; 4878 } 4879 4880 if (!isModalOverflowing) { 4881 this._element.style.overflowY = 'hidden'; 4882 } 4883 4884 this._element.classList.add(CLASS_NAME_STATIC); 4885 4886 this._queueCallback(() => { 4887 this._element.classList.remove(CLASS_NAME_STATIC); 4888 4889 this._queueCallback(() => { 4890 this._element.style.overflowY = initialOverflowY; 4891 }, this._dialog); 4892 }, this._dialog); 4893 4894 this._element.focus(); 4895 } 4896 /** 4897 * The following methods are used to handle overflowing modals 4898 */ 4899 4900 4901 _adjustDialog() { 4902 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4903 4904 const scrollbarWidth = this._scrollBar.getWidth(); 4905 4906 const isBodyOverflowing = scrollbarWidth > 0; 4907 4908 if (isBodyOverflowing && !isModalOverflowing) { 4909 const property = isRTL() ? 'paddingLeft' : 'paddingRight'; 4910 this._element.style[property] = `${scrollbarWidth}px`; 4911 } 4912 4913 if (!isBodyOverflowing && isModalOverflowing) { 4914 const property = isRTL() ? 'paddingRight' : 'paddingLeft'; 4915 this._element.style[property] = `${scrollbarWidth}px`; 4916 } 4917 } 4918 4919 _resetAdjustments() { 4920 this._element.style.paddingLeft = ''; 4921 this._element.style.paddingRight = ''; 4922 } // Static 4923 4924 4925 static jQueryInterface(config, relatedTarget) { 4926 return this.each(function () { 4927 const data = Modal.getOrCreateInstance(this, config); 4928 4929 if (typeof config !== 'string') { 4930 return; 4931 } 4932 4933 if (typeof data[config] === 'undefined') {
vendor: 6,831 bytes, lines 4934-5197
4934 throw new TypeError(`No method named "${config}"`); 4935 } 4936 4937 data[config](relatedTarget); 4938 }); 4939 } 4940 4941 } 4942 /** 4943 * Data API implementation 4944 */ 4945 4946 4947 EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 4948 const target = getElementFromSelector(this); 4949 4950 if (['A', 'AREA'].includes(this.tagName)) { 4951 event.preventDefault(); 4952 } 4953 4954 EventHandler.one(target, EVENT_SHOW$4, showEvent => { 4955 if (showEvent.defaultPrevented) { 4956 // only register focus restorer if modal will actually get shown 4957 return; 4958 } 4959 4960 EventHandler.one(target, EVENT_HIDDEN$4, () => { 4961 if (isVisible(this)) { 4962 this.focus(); 4963 } 4964 }); 4965 }); // avoid conflict when clicking modal toggler while another one is open 4966 4967 const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); 4968 4969 if (alreadyOpen) { 4970 Modal.getInstance(alreadyOpen).hide(); 4971 } 4972 4973 const data = Modal.getOrCreateInstance(target); 4974 data.toggle(this); 4975 }); 4976 enableDismissTrigger(Modal); 4977 /** 4978 * jQuery 4979 */ 4980 4981 defineJQueryPlugin(Modal); 4982 4983 /** 4984 * -------------------------------------------------------------------------- 4985 * Bootstrap (v5.2.0): offcanvas.js 4986 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4987 * -------------------------------------------------------------------------- 4988 */ 4989 /** 4990 * Constants 4991 */ 4992 4993 const NAME$6 = 'offcanvas'; 4994 const DATA_KEY$3 = 'bs.offcanvas'; 4995 const EVENT_KEY$3 = `.${DATA_KEY$3}`; 4996 const DATA_API_KEY$1 = '.data-api'; 4997 const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; 4998 const ESCAPE_KEY = 'Escape'; 4999 const CLASS_NAME_SHOW$3 = 'show'; 5000 const CLASS_NAME_SHOWING$1 = 'showing'; 5001 const CLASS_NAME_HIDING = 'hiding'; 5002 const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; 5003 const OPEN_SELECTOR = '.offcanvas.show'; 5004 const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; 5005 const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; 5006 const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; 5007 const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; 5008 const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; 5009 const EVENT_RESIZE = `resize${EVENT_KEY$3}`; 5010 const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; 5011 const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; 5012 const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; 5013 const Default$5 = { 5014 backdrop: true, 5015 keyboard: true, 5016 scroll: false 5017 }; 5018 const DefaultType$5 = { 5019 backdrop: '(boolean|string)', 5020 keyboard: 'boolean', 5021 scroll: 'boolean' 5022 }; 5023 /** 5024 * Class definition 5025 */ 5026 5027 class Offcanvas extends BaseComponent { 5028 constructor(element, config) { 5029 super(element, config); 5030 this._isShown = false; 5031 this._backdrop = this._initializeBackDrop(); 5032 this._focustrap = this._initializeFocusTrap(); 5033 5034 this._addEventListeners(); 5035 } // Getters 5036 5037 5038 static get Default() { 5039 return Default$5; 5040 } 5041 5042 static get DefaultType() { 5043 return DefaultType$5; 5044 } 5045 5046 static get NAME() { 5047 return NAME$6; 5048 } // Public 5049 5050 5051 toggle(relatedTarget) { 5052 return this._isShown ? this.hide() : this.show(relatedTarget); 5053 } 5054 5055 show(relatedTarget) { 5056 if (this._isShown) { 5057 return; 5058 } 5059 5060 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { 5061 relatedTarget 5062 }); 5063 5064 if (showEvent.defaultPrevented) { 5065 return; 5066 } 5067 5068 this._isShown = true; 5069 5070 this._backdrop.show(); 5071 5072 if (!this._config.scroll) { 5073 new ScrollBarHelper().hide(); 5074 } 5075 5076 this._element.setAttribute('aria-modal', true); 5077 5078 this._element.setAttribute('role', 'dialog'); 5079 5080 this._element.classList.add(CLASS_NAME_SHOWING$1); 5081 5082 const completeCallBack = () => { 5083 if (!this._config.scroll || this._config.backdrop) { 5084 this._focustrap.activate(); 5085 } 5086 5087 this._element.classList.add(CLASS_NAME_SHOW$3); 5088 5089 this._element.classList.remove(CLASS_NAME_SHOWING$1); 5090 5091 EventHandler.trigger(this._element, EVENT_SHOWN$3, { 5092 relatedTarget 5093 }); 5094 }; 5095 5096 this._queueCallback(completeCallBack, this._element, true); 5097 } 5098 5099 hide() { 5100 if (!this._isShown) { 5101 return; 5102 } 5103 5104 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); 5105 5106 if (hideEvent.defaultPrevented) { 5107 return; 5108 } 5109 5110 this._focustrap.deactivate(); 5111 5112 this._element.blur(); 5113 5114 this._isShown = false; 5115 5116 this._element.classList.add(CLASS_NAME_HIDING); 5117 5118 this._backdrop.hide(); 5119 5120 const completeCallback = () => { 5121 this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); 5122 5123 this._element.removeAttribute('aria-modal'); 5124 5125 this._element.removeAttribute('role'); 5126 5127 if (!this._config.scroll) { 5128 new ScrollBarHelper().reset(); 5129 } 5130 5131 EventHandler.trigger(this._element, EVENT_HIDDEN$3); 5132 }; 5133 5134 this._queueCallback(completeCallback, this._element, true); 5135 } 5136 5137 dispose() { 5138 this._backdrop.dispose(); 5139 5140 this._focustrap.deactivate(); 5141 5142 super.dispose(); 5143 } // Private 5144 5145 5146 _initializeBackDrop() { 5147 const clickCallback = () => { 5148 if (this._config.backdrop === 'static') { 5149 EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 5150 return; 5151 } 5152 5153 this.hide(); 5154 }; // 'static' option will be translated to true, and booleans will keep their value 5155 5156 5157 const isVisible = Boolean(this._config.backdrop); 5158 return new Backdrop({ 5159 className: CLASS_NAME_BACKDROP, 5160 isVisible, 5161 isAnimated: true, 5162 rootElement: this._element.parentNode, 5163 clickCallback: isVisible ? clickCallback : null 5164 }); 5165 } 5166 5167 _initializeFocusTrap() { 5168 return new FocusTrap({ 5169 trapElement: this._element 5170 }); 5171 } 5172 5173 _addEventListeners() { 5174 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { 5175 if (event.key !== ESCAPE_KEY) { 5176 return; 5177 } 5178 5179 if (!this._config.keyboard) { 5180 EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 5181 return; 5182 } 5183 5184 this.hide(); 5185 }); 5186 } // Static 5187 5188 5189 static jQueryInterface(config) { 5190 return this.each(function () { 5191 const data = Offcanvas.getOrCreateInstance(this, config); 5192 5193 if (typeof config !== 'string') { 5194 return; 5195 } 5196 5197 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
vendor: 4,946 bytes, lines 5198-5353
5198 throw new TypeError(`No method named "${config}"`); 5199 } 5200 5201 data[config](this); 5202 }); 5203 } 5204 5205 } 5206 /** 5207 * Data API implementation 5208 */ 5209 5210 5211 EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 5212 const target = getElementFromSelector(this); 5213 5214 if (['A', 'AREA'].includes(this.tagName)) { 5215 event.preventDefault(); 5216 } 5217 5218 if (isDisabled(this)) { 5219 return; 5220 } 5221 5222 EventHandler.one(target, EVENT_HIDDEN$3, () => { 5223 // focus on trigger when it is closed 5224 if (isVisible(this)) { 5225 this.focus(); 5226 } 5227 }); // avoid conflict when clicking a toggler of an offcanvas, while another is open 5228 5229 const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); 5230 5231 if (alreadyOpen && alreadyOpen !== target) { 5232 Offcanvas.getInstance(alreadyOpen).hide(); 5233 } 5234 5235 const data = Offcanvas.getOrCreateInstance(target); 5236 data.toggle(this); 5237 }); 5238 EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { 5239 for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { 5240 Offcanvas.getOrCreateInstance(selector).show(); 5241 } 5242 }); 5243 EventHandler.on(window, EVENT_RESIZE, () => { 5244 for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { 5245 if (getComputedStyle(element).position !== 'fixed') { 5246 Offcanvas.getOrCreateInstance(element).hide(); 5247 } 5248 } 5249 }); 5250 enableDismissTrigger(Offcanvas); 5251 /** 5252 * jQuery 5253 */ 5254 5255 defineJQueryPlugin(Offcanvas); 5256 5257 /** 5258 * -------------------------------------------------------------------------- 5259 * Bootstrap (v5.2.0): util/sanitizer.js 5260 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5261 * -------------------------------------------------------------------------- 5262 */ 5263 const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); 5264 const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5265 /** 5266 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5267 * 5268 * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 5269 */ 5270 5271 const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 5272 /** 5273 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5274 * 5275 * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 5276 */ 5277 5278 const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 5279 5280 const allowedAttribute = (attribute, allowedAttributeList) => { 5281 const attributeName = attribute.nodeName.toLowerCase(); 5282 5283 if (allowedAttributeList.includes(attributeName)) { 5284 if (uriAttributes.has(attributeName)) { 5285 return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue)); 5286 } 5287 5288 return true; 5289 } // Check if a regular expression validates the attribute. 5290 5291 5292 return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); 5293 }; 5294 5295 const DefaultAllowlist = { 5296 // Global attributes allowed on any supplied element below. 5297 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5298 a: ['target', 'href', 'title', 'rel'], 5299 area: [], 5300 b: [], 5301 br: [], 5302 col: [], 5303 code: [], 5304 div: [], 5305 em: [], 5306 hr: [], 5307 h1: [], 5308 h2: [], 5309 h3: [], 5310 h4: [], 5311 h5: [], 5312 h6: [], 5313 i: [], 5314 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 5315 li: [], 5316 ol: [], 5317 p: [], 5318 pre: [], 5319 s: [], 5320 small: [], 5321 span: [], 5322 sub: [], 5323 sup: [], 5324 strong: [], 5325 u: [], 5326 ul: [] 5327 }; 5328 function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { 5329 if (!unsafeHtml.length) { 5330 return unsafeHtml; 5331 } 5332 5333 if (sanitizeFunction && typeof sanitizeFunction === 'function') { 5334 return sanitizeFunction(unsafeHtml); 5335 } 5336 5337 const domParser = new window.DOMParser(); 5338 const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5339 const elements = [].concat(...createdDocument.body.querySelectorAll('*')); 5340 5341 for (const element of elements) { 5342 const elementName = element.nodeName.toLowerCase(); 5343 5344 if (!Object.keys(allowList).includes(elementName)) { 5345 element.remove(); 5346 continue; 5347 } 5348 5349 const attributeList = [].concat(...element.attributes); 5350 const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); 5351 5352 for (const attribute of attributeList) { 5353 if (!allowedAttribute(attribute, allowedAttributes)) {
vendor: 9,524 bytes, lines 5354-5726
5354 element.removeAttribute(attribute.nodeName); 5355 } 5356 } 5357 } 5358 5359 return createdDocument.body.innerHTML; 5360 } 5361 5362 /** 5363 * -------------------------------------------------------------------------- 5364 * Bootstrap (v5.2.0): util/template-factory.js 5365 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5366 * -------------------------------------------------------------------------- 5367 */ 5368 /** 5369 * Constants 5370 */ 5371 5372 const NAME$5 = 'TemplateFactory'; 5373 const Default$4 = { 5374 allowList: DefaultAllowlist, 5375 content: {}, 5376 // { selector : text , selector2 : text2 , } 5377 extraClass: '', 5378 html: false, 5379 sanitize: true, 5380 sanitizeFn: null, 5381 template: '<div></div>' 5382 }; 5383 const DefaultType$4 = { 5384 allowList: 'object', 5385 content: 'object', 5386 extraClass: '(string|function)', 5387 html: 'boolean', 5388 sanitize: 'boolean', 5389 sanitizeFn: '(null|function)', 5390 template: 'string' 5391 }; 5392 const DefaultContentType = { 5393 entry: '(string|element|function|null)', 5394 selector: '(string|element)' 5395 }; 5396 /** 5397 * Class definition 5398 */ 5399 5400 class TemplateFactory extends Config { 5401 constructor(config) { 5402 super(); 5403 this._config = this._getConfig(config); 5404 } // Getters 5405 5406 5407 static get Default() { 5408 return Default$4; 5409 } 5410 5411 static get DefaultType() { 5412 return DefaultType$4; 5413 } 5414 5415 static get NAME() { 5416 return NAME$5; 5417 } // Public 5418 5419 5420 getContent() { 5421 return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); 5422 } 5423 5424 hasContent() { 5425 return this.getContent().length > 0; 5426 } 5427 5428 changeContent(content) { 5429 this._checkContent(content); 5430 5431 this._config.content = { ...this._config.content, 5432 ...content 5433 }; 5434 return this; 5435 } 5436 5437 toHtml() { 5438 const templateWrapper = document.createElement('div'); 5439 templateWrapper.innerHTML = this._maybeSanitize(this._config.template); 5440 5441 for (const [selector, text] of Object.entries(this._config.content)) { 5442 this._setContent(templateWrapper, text, selector); 5443 } 5444 5445 const template = templateWrapper.children[0]; 5446 5447 const extraClass = this._resolvePossibleFunction(this._config.extraClass); 5448 5449 if (extraClass) { 5450 template.classList.add(...extraClass.split(' ')); 5451 } 5452 5453 return template; 5454 } // Private 5455 5456 5457 _typeCheckConfig(config) { 5458 super._typeCheckConfig(config); 5459 5460 this._checkContent(config.content); 5461 } 5462 5463 _checkContent(arg) { 5464 for (const [selector, content] of Object.entries(arg)) { 5465 super._typeCheckConfig({ 5466 selector, 5467 entry: content 5468 }, DefaultContentType); 5469 } 5470 } 5471 5472 _setContent(template, content, selector) { 5473 const templateElement = SelectorEngine.findOne(selector, template); 5474 5475 if (!templateElement) { 5476 return; 5477 } 5478 5479 content = this._resolvePossibleFunction(content); 5480 5481 if (!content) { 5482 templateElement.remove(); 5483 return; 5484 } 5485 5486 if (isElement$1(content)) { 5487 this._putElementInTemplate(getElement(content), templateElement); 5488 5489 return; 5490 } 5491 5492 if (this._config.html) { 5493 templateElement.innerHTML = this._maybeSanitize(content); 5494 return; 5495 } 5496 5497 templateElement.textContent = content; 5498 } 5499 5500 _maybeSanitize(arg) { 5501 return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; 5502 } 5503 5504 _resolvePossibleFunction(arg) { 5505 return typeof arg === 'function' ? arg(this) : arg; 5506 } 5507 5508 _putElementInTemplate(element, templateElement) { 5509 if (this._config.html) { 5510 templateElement.innerHTML = ''; 5511 templateElement.append(element); 5512 return; 5513 } 5514 5515 templateElement.textContent = element.textContent; 5516 } 5517 5518 } 5519 5520 /** 5521 * -------------------------------------------------------------------------- 5522 * Bootstrap (v5.2.0): tooltip.js 5523 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5524 * -------------------------------------------------------------------------- 5525 */ 5526 /** 5527 * Constants 5528 */ 5529 5530 const NAME$4 = 'tooltip'; 5531 const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); 5532 const CLASS_NAME_FADE$2 = 'fade'; 5533 const CLASS_NAME_MODAL = 'modal'; 5534 const CLASS_NAME_SHOW$2 = 'show'; 5535 const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 5536 const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; 5537 const EVENT_MODAL_HIDE = 'hide.bs.modal'; 5538 const TRIGGER_HOVER = 'hover'; 5539 const TRIGGER_FOCUS = 'focus'; 5540 const TRIGGER_CLICK = 'click'; 5541 const TRIGGER_MANUAL = 'manual'; 5542 const EVENT_HIDE$2 = 'hide'; 5543 const EVENT_HIDDEN$2 = 'hidden'; 5544 const EVENT_SHOW$2 = 'show'; 5545 const EVENT_SHOWN$2 = 'shown'; 5546 const EVENT_INSERTED = 'inserted'; 5547 const EVENT_CLICK$1 = 'click'; 5548 const EVENT_FOCUSIN$1 = 'focusin'; 5549 const EVENT_FOCUSOUT$1 = 'focusout'; 5550 const EVENT_MOUSEENTER = 'mouseenter'; 5551 const EVENT_MOUSELEAVE = 'mouseleave'; 5552 const AttachmentMap = { 5553 AUTO: 'auto', 5554 TOP: 'top', 5555 RIGHT: isRTL() ? 'left' : 'right', 5556 BOTTOM: 'bottom', 5557 LEFT: isRTL() ? 'right' : 'left' 5558 }; 5559 const Default$3 = { 5560 allowList: DefaultAllowlist, 5561 animation: true, 5562 boundary: 'clippingParents', 5563 container: false, 5564 customClass: '', 5565 delay: 0, 5566 fallbackPlacements: ['top', 'right', 'bottom', 'left'], 5567 html: false, 5568 offset: [0, 0], 5569 placement: 'top', 5570 popperConfig: null, 5571 sanitize: true, 5572 sanitizeFn: null, 5573 selector: false, 5574 template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', 5575 title: '', 5576 trigger: 'hover focus' 5577 }; 5578 const DefaultType$3 = { 5579 allowList: 'object', 5580 animation: 'boolean', 5581 boundary: '(string|element)', 5582 container: '(string|element|boolean)', 5583 customClass: '(string|function)', 5584 delay: '(number|object)', 5585 fallbackPlacements: 'array', 5586 html: 'boolean', 5587 offset: '(array|string|function)', 5588 placement: '(string|function)', 5589 popperConfig: '(null|object|function)', 5590 sanitize: 'boolean', 5591 sanitizeFn: '(null|function)', 5592 selector: '(string|boolean)', 5593 template: 'string', 5594 title: '(string|element|function)', 5595 trigger: 'string' 5596 }; 5597 /** 5598 * Class definition 5599 */ 5600 5601 class Tooltip extends BaseComponent { 5602 constructor(element, config) { 5603 if (typeof Popper === 'undefined') { 5604 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 5605 } 5606 5607 super(element, config); // Private 5608 5609 this._isEnabled = true; 5610 this._timeout = 0; 5611 this._isHovered = false; 5612 this._activeTrigger = {}; 5613 this._popper = null; 5614 this._templateFactory = null; 5615 this._newContent = null; // Protected 5616 5617 this.tip = null; 5618 5619 this._setListeners(); 5620 } // Getters 5621 5622 5623 static get Default() { 5624 return Default$3; 5625 } 5626 5627 static get DefaultType() { 5628 return DefaultType$3; 5629 } 5630 5631 static get NAME() { 5632 return NAME$4; 5633 } // Public 5634 5635 5636 enable() { 5637 this._isEnabled = true; 5638 } 5639 5640 disable() { 5641 this._isEnabled = false; 5642 } 5643 5644 toggleEnabled() { 5645 this._isEnabled = !this._isEnabled; 5646 } 5647 5648 toggle(event) { 5649 if (!this._isEnabled) { 5650 return; 5651 } 5652 5653 if (event) { 5654 const context = this._initializeOnDelegatedTarget(event); 5655 5656 context._activeTrigger.click = !context._activeTrigger.click; 5657 5658 if (context._isWithActiveTrigger()) { 5659 context._enter(); 5660 } else { 5661 context._leave(); 5662 } 5663 5664 return; 5665 } 5666 5667 if (this._isShown()) { 5668 this._leave(); 5669 5670 return; 5671 } 5672 5673 this._enter(); 5674 } 5675 5676 dispose() { 5677 clearTimeout(this._timeout); 5678 EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); 5679 5680 if (this.tip) { 5681 this.tip.remove(); 5682 } 5683 5684 this._disposePopper(); 5685 5686 super.dispose(); 5687 } 5688 5689 show() { 5690 if (this._element.style.display === 'none') { 5691 throw new Error('Please use show on visible elements'); 5692 } 5693 5694 if (!(this._isWithContent() && this._isEnabled)) { 5695 return; 5696 } 5697 5698 const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); 5699 const shadowRoot = findShadowRoot(this._element); 5700 5701 const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); 5702 5703 if (showEvent.defaultPrevented || !isInTheDom) { 5704 return; 5705 } // todo v6 remove this OR make it optional 5706 5707 5708 if (this.tip) { 5709 this.tip.remove(); 5710 this.tip = null; 5711 } 5712 5713 const tip = this._getTipElement(); 5714 5715 this._element.setAttribute('aria-describedby', tip.getAttribute('id')); 5716 5717 const { 5718 container 5719 } = this._config; 5720 5721 if (!this._element.ownerDocument.documentElement.contains(this.tip)) { 5722 container.append(tip); 5723 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); 5724 } 5725 5726 if (this._popper) {
vendor: 3,112 bytes, lines 5727-5832
5727 this._popper.update(); 5728 } else { 5729 this._popper = this._createPopper(tip); 5730 } 5731 5732 tip.classList.add(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we add extra 5733 // empty mouseover listeners to the body's immediate children; 5734 // only needed because of broken event delegation on iOS 5735 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5736 5737 if ('ontouchstart' in document.documentElement) { 5738 for (const element of [].concat(...document.body.children)) { 5739 EventHandler.on(element, 'mouseover', noop); 5740 } 5741 } 5742 5743 const complete = () => { 5744 const previousHoverState = this._isHovered; 5745 this._isHovered = false; 5746 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); 5747 5748 if (previousHoverState) { 5749 this._leave(); 5750 } 5751 }; 5752 5753 this._queueCallback(complete, this.tip, this._isAnimated()); 5754 } 5755 5756 hide() { 5757 if (!this._isShown()) { 5758 return; 5759 } 5760 5761 const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); 5762 5763 if (hideEvent.defaultPrevented) { 5764 return; 5765 } 5766 5767 const tip = this._getTipElement(); 5768 5769 tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra 5770 // empty mouseover listeners we added for iOS support 5771 5772 if ('ontouchstart' in document.documentElement) { 5773 for (const element of [].concat(...document.body.children)) { 5774 EventHandler.off(element, 'mouseover', noop); 5775 } 5776 } 5777 5778 this._activeTrigger[TRIGGER_CLICK] = false; 5779 this._activeTrigger[TRIGGER_FOCUS] = false; 5780 this._activeTrigger[TRIGGER_HOVER] = false; 5781 this._isHovered = false; 5782 5783 const complete = () => { 5784 if (this._isWithActiveTrigger()) { 5785 return; 5786 } 5787 5788 if (!this._isHovered) { 5789 tip.remove(); 5790 } 5791 5792 this._element.removeAttribute('aria-describedby'); 5793 5794 EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); 5795 5796 this._disposePopper(); 5797 }; 5798 5799 this._queueCallback(complete, this.tip, this._isAnimated()); 5800 } 5801 5802 update() { 5803 if (this._popper) { 5804 this._popper.update(); 5805 } 5806 } // Protected 5807 5808 5809 _isWithContent() { 5810 return Boolean(this._getTitle()); 5811 } 5812 5813 _getTipElement() { 5814 if (!this.tip) { 5815 this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); 5816 } 5817 5818 return this.tip; 5819 } 5820 5821 _createTipElement(content) { 5822 const tip = this._getTemplateFactory(content).toHtml(); // todo: remove this check on v6 5823 5824 5825 if (!tip) { 5826 return null; 5827 } 5828 5829 tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); // todo: on v6 the following can be achieved with CSS only 5830 5831 tip.classList.add(`bs-${this.constructor.NAME}-auto`); 5832 const tipId = getUID(this.constructor.NAME).toString();
vendor: 6,606 bytes, lines 5833-6053
5833 tip.setAttribute('id', tipId); 5834 5835 if (this._isAnimated()) { 5836 tip.classList.add(CLASS_NAME_FADE$2); 5837 } 5838 5839 return tip; 5840 } 5841 5842 setContent(content) { 5843 this._newContent = content; 5844 5845 if (this._isShown()) { 5846 this._disposePopper(); 5847 5848 this.show(); 5849 } 5850 } 5851 5852 _getTemplateFactory(content) { 5853 if (this._templateFactory) { 5854 this._templateFactory.changeContent(content); 5855 } else { 5856 this._templateFactory = new TemplateFactory({ ...this._config, 5857 // the `content` var has to be after `this._config` 5858 // to override config.content in case of popover 5859 content, 5860 extraClass: this._resolvePossibleFunction(this._config.customClass) 5861 }); 5862 } 5863 5864 return this._templateFactory; 5865 } 5866 5867 _getContentForTemplate() { 5868 return { 5869 [SELECTOR_TOOLTIP_INNER]: this._getTitle() 5870 }; 5871 } 5872 5873 _getTitle() { 5874 return this._resolvePossibleFunction(this._config.title) || this._config.originalTitle; 5875 } // Private 5876 5877 5878 _initializeOnDelegatedTarget(event) { 5879 return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); 5880 } 5881 5882 _isAnimated() { 5883 return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); 5884 } 5885 5886 _isShown() { 5887 return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); 5888 } 5889 5890 _createPopper(tip) { 5891 const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement; 5892 const attachment = AttachmentMap[placement.toUpperCase()]; 5893 return createPopper(this._element, tip, this._getPopperConfig(attachment)); 5894 } 5895 5896 _getOffset() { 5897 const { 5898 offset 5899 } = this._config; 5900 5901 if (typeof offset === 'string') { 5902 return offset.split(',').map(value => Number.parseInt(value, 10)); 5903 } 5904 5905 if (typeof offset === 'function') { 5906 return popperData => offset(popperData, this._element); 5907 } 5908 5909 return offset; 5910 } 5911 5912 _resolvePossibleFunction(arg) { 5913 return typeof arg === 'function' ? arg.call(this._element) : arg; 5914 } 5915 5916 _getPopperConfig(attachment) { 5917 const defaultBsPopperConfig = { 5918 placement: attachment, 5919 modifiers: [{ 5920 name: 'flip', 5921 options: { 5922 fallbackPlacements: this._config.fallbackPlacements 5923 } 5924 }, { 5925 name: 'offset', 5926 options: { 5927 offset: this._getOffset() 5928 } 5929 }, { 5930 name: 'preventOverflow', 5931 options: { 5932 boundary: this._config.boundary 5933 } 5934 }, { 5935 name: 'arrow', 5936 options: { 5937 element: `.${this.constructor.NAME}-arrow` 5938 } 5939 }, { 5940 name: 'preSetPlacement', 5941 enabled: true, 5942 phase: 'beforeMain', 5943 fn: data => { 5944 // Pre-set Popper's placement attribute in order to read the arrow sizes properly. 5945 // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement 5946 this._getTipElement().setAttribute('data-popper-placement', data.state.placement); 5947 } 5948 }] 5949 }; 5950 return { ...defaultBsPopperConfig, 5951 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) 5952 }; 5953 } 5954 5955 _setListeners() { 5956 const triggers = this._config.trigger.split(' '); 5957 5958 for (const trigger of triggers) { 5959 if (trigger === 'click') { 5960 EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => this.toggle(event)); 5961 } else if (trigger !== TRIGGER_MANUAL) { 5962 const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); 5963 const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); 5964 EventHandler.on(this._element, eventIn, this._config.selector, event => { 5965 const context = this._initializeOnDelegatedTarget(event); 5966 5967 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 5968 5969 context._enter(); 5970 }); 5971 EventHandler.on(this._element, eventOut, this._config.selector, event => { 5972 const context = this._initializeOnDelegatedTarget(event); 5973 5974 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); 5975 5976 context._leave(); 5977 }); 5978 } 5979 } 5980 5981 this._hideModalHandler = () => { 5982 if (this._element) { 5983 this.hide(); 5984 } 5985 }; 5986 5987 EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); 5988 5989 if (this._config.selector) { 5990 this._config = { ...this._config, 5991 trigger: 'manual', 5992 selector: '' 5993 }; 5994 } else { 5995 this._fixTitle(); 5996 } 5997 } 5998 5999 _fixTitle() { 6000 const title = this._config.originalTitle; 6001 6002 if (!title) { 6003 return; 6004 } 6005 6006 if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { 6007 this._element.setAttribute('aria-label', title); 6008 } 6009 6010 this._element.removeAttribute('title'); 6011 } 6012 6013 _enter() { 6014 if (this._isShown() || this._isHovered) { 6015 this._isHovered = true; 6016 return; 6017 } 6018 6019 this._isHovered = true; 6020 6021 this._setTimeout(() => { 6022 if (this._isHovered) { 6023 this.show(); 6024 } 6025 }, this._config.delay.show); 6026 } 6027 6028 _leave() { 6029 if (this._isWithActiveTrigger()) { 6030 return; 6031 } 6032 6033 this._isHovered = false; 6034 6035 this._setTimeout(() => { 6036 if (!this._isHovered) { 6037 this.hide(); 6038 } 6039 }, this._config.delay.hide); 6040 } 6041 6042 _setTimeout(handler, timeout) { 6043 clearTimeout(this._timeout); 6044 this._timeout = setTimeout(handler, timeout); 6045 } 6046 6047 _isWithActiveTrigger() { 6048 return Object.values(this._activeTrigger).includes(true); 6049 } 6050 6051 _getConfig(config) { 6052 const dataAttributes = Manipulator.getDataAttributes(this._element); 6053
vendor: 4,832 bytes, lines 6054-6241
6054 for (const dataAttribute of Object.keys(dataAttributes)) { 6055 if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { 6056 delete dataAttributes[dataAttribute]; 6057 } 6058 } 6059 6060 config = { ...dataAttributes, 6061 ...(typeof config === 'object' && config ? config : {}) 6062 }; 6063 config = this._mergeConfigObj(config); 6064 config = this._configAfterMerge(config); 6065 6066 this._typeCheckConfig(config); 6067 6068 return config; 6069 } 6070 6071 _configAfterMerge(config) { 6072 config.container = config.container === false ? document.body : getElement(config.container); 6073 6074 if (typeof config.delay === 'number') { 6075 config.delay = { 6076 show: config.delay, 6077 hide: config.delay 6078 }; 6079 } 6080 6081 config.originalTitle = this._element.getAttribute('title') || ''; 6082 6083 if (typeof config.title === 'number') { 6084 config.title = config.title.toString(); 6085 } 6086 6087 if (typeof config.content === 'number') { 6088 config.content = config.content.toString(); 6089 } 6090 6091 return config; 6092 } 6093 6094 _getDelegateConfig() { 6095 const config = {}; 6096 6097 for (const key in this._config) { 6098 if (this.constructor.Default[key] !== this._config[key]) { 6099 config[key] = this._config[key]; 6100 } 6101 } // In the future can be replaced with: 6102 // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) 6103 // `Object.fromEntries(keysWithDifferentValues)` 6104 6105 6106 return config; 6107 } 6108 6109 _disposePopper() { 6110 if (this._popper) { 6111 this._popper.destroy(); 6112 6113 this._popper = null; 6114 } 6115 } // Static 6116 6117 6118 static jQueryInterface(config) { 6119 return this.each(function () { 6120 const data = Tooltip.getOrCreateInstance(this, config); 6121 6122 if (typeof config !== 'string') { 6123 return; 6124 } 6125 6126 if (typeof data[config] === 'undefined') { 6127 throw new TypeError(`No method named "${config}"`); 6128 } 6129 6130 data[config](); 6131 }); 6132 } 6133 6134 } 6135 /** 6136 * jQuery 6137 */ 6138 6139 6140 defineJQueryPlugin(Tooltip); 6141 6142 /** 6143 * -------------------------------------------------------------------------- 6144 * Bootstrap (v5.2.0): popover.js 6145 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6146 * -------------------------------------------------------------------------- 6147 */ 6148 /** 6149 * Constants 6150 */ 6151 6152 const NAME$3 = 'popover'; 6153 const SELECTOR_TITLE = '.popover-header'; 6154 const SELECTOR_CONTENT = '.popover-body'; 6155 const Default$2 = { ...Tooltip.Default, 6156 content: '', 6157 offset: [0, 8], 6158 placement: 'right', 6159 template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>', 6160 trigger: 'click' 6161 }; 6162 const DefaultType$2 = { ...Tooltip.DefaultType, 6163 content: '(null|string|element|function)' 6164 }; 6165 /** 6166 * Class definition 6167 */ 6168 6169 class Popover extends Tooltip { 6170 // Getters 6171 static get Default() { 6172 return Default$2; 6173 } 6174 6175 static get DefaultType() { 6176 return DefaultType$2; 6177 } 6178 6179 static get NAME() { 6180 return NAME$3; 6181 } // Overrides 6182 6183 6184 _isWithContent() { 6185 return this._getTitle() || this._getContent(); 6186 } // Private 6187 6188 6189 _getContentForTemplate() { 6190 return { 6191 [SELECTOR_TITLE]: this._getTitle(), 6192 [SELECTOR_CONTENT]: this._getContent() 6193 }; 6194 } 6195 6196 _getContent() { 6197 return this._resolvePossibleFunction(this._config.content); 6198 } // Static 6199 6200 6201 static jQueryInterface(config) { 6202 return this.each(function () { 6203 const data = Popover.getOrCreateInstance(this, config); 6204 6205 if (typeof config !== 'string') { 6206 return; 6207 } 6208 6209 if (typeof data[config] === 'undefined') { 6210 throw new TypeError(`No method named "${config}"`); 6211 } 6212 6213 data[config](); 6214 }); 6215 } 6216 6217 } 6218 /** 6219 * jQuery 6220 */ 6221 6222 6223 defineJQueryPlugin(Popover); 6224 6225 /** 6226 * -------------------------------------------------------------------------- 6227 * Bootstrap (v5.2.0): scrollspy.js 6228 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6229 * -------------------------------------------------------------------------- 6230 */ 6231 /** 6232 * Constants 6233 */ 6234 6235 const NAME$2 = 'scrollspy'; 6236 const DATA_KEY$2 = 'bs.scrollspy'; 6237 const EVENT_KEY$2 = `.${DATA_KEY$2}`; 6238 const DATA_API_KEY = '.data-api'; 6239 const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; 6240 const EVENT_CLICK = `click${EVENT_KEY$2}`; 6241 const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;
vendor: 4,299 bytes, lines 6242-6381
6242 const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 6243 const CLASS_NAME_ACTIVE$1 = 'active'; 6244 const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; 6245 const SELECTOR_TARGET_LINKS = '[href]'; 6246 const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 6247 const SELECTOR_NAV_LINKS = '.nav-link'; 6248 const SELECTOR_NAV_ITEMS = '.nav-item'; 6249 const SELECTOR_LIST_ITEMS = '.list-group-item'; 6250 const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; 6251 const SELECTOR_DROPDOWN = '.dropdown'; 6252 const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 6253 const Default$1 = { 6254 offset: null, 6255 // TODO: v6 @deprecated, keep it for backwards compatibility reasons 6256 rootMargin: '0px 0px -25%', 6257 smoothScroll: false, 6258 target: null 6259 }; 6260 const DefaultType$1 = { 6261 offset: '(number|null)', 6262 // TODO v6 @deprecated, keep it for backwards compatibility reasons 6263 rootMargin: 'string', 6264 smoothScroll: 'boolean', 6265 target: 'element' 6266 }; 6267 /** 6268 * Class definition 6269 */ 6270 6271 class ScrollSpy extends BaseComponent { 6272 constructor(element, config) { 6273 super(element, config); // this._element is the observablesContainer and config.target the menu links wrapper 6274 6275 this._targetLinks = new Map(); 6276 this._observableSections = new Map(); 6277 this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; 6278 this._activeTarget = null; 6279 this._observer = null; 6280 this._previousScrollData = { 6281 visibleEntryTop: 0, 6282 parentScrollTop: 0 6283 }; 6284 this.refresh(); // initialize 6285 } // Getters 6286 6287 6288 static get Default() { 6289 return Default$1; 6290 } 6291 6292 static get DefaultType() { 6293 return DefaultType$1; 6294 } 6295 6296 static get NAME() { 6297 return NAME$2; 6298 } // Public 6299 6300 6301 refresh() { 6302 this._initializeTargetsAndObservables(); 6303 6304 this._maybeEnableSmoothScroll(); 6305 6306 if (this._observer) { 6307 this._observer.disconnect(); 6308 } else { 6309 this._observer = this._getNewObserver(); 6310 } 6311 6312 for (const section of this._observableSections.values()) { 6313 this._observer.observe(section); 6314 } 6315 } 6316 6317 dispose() { 6318 this._observer.disconnect(); 6319 6320 super.dispose(); 6321 } // Private 6322 6323 6324 _configAfterMerge(config) { 6325 // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case 6326 config.target = getElement(config.target) || document.body; 6327 return config; 6328 } 6329 6330 _maybeEnableSmoothScroll() { 6331 if (!this._config.smoothScroll) { 6332 return; 6333 } // unregister any previous listeners 6334 6335 6336 EventHandler.off(this._config.target, EVENT_CLICK); 6337 EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { 6338 const observableSection = this._observableSections.get(event.target.hash); 6339 6340 if (observableSection) { 6341 event.preventDefault(); 6342 const root = this._rootElement || window; 6343 const height = observableSection.offsetTop - this._element.offsetTop; 6344 6345 if (root.scrollTo) { 6346 root.scrollTo({ 6347 top: height, 6348 behavior: 'smooth' 6349 }); 6350 return; 6351 } // Chrome 60 doesn't support `scrollTo` 6352 6353 6354 root.scrollTop = height; 6355 } 6356 }); 6357 } 6358 6359 _getNewObserver() { 6360 const options = { 6361 root: this._rootElement, 6362 threshold: [0.1, 0.5, 1], 6363 rootMargin: this._getRootMargin() 6364 }; 6365 return new IntersectionObserver(entries => this._observerCallback(entries), options); 6366 } // The logic of selection 6367 6368 6369 _observerCallback(entries) { 6370 const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); 6371 6372 const activate = entry => { 6373 this._previousScrollData.visibleEntryTop = entry.target.offsetTop; 6374 6375 this._process(targetElement(entry)); 6376 }; 6377 6378 const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; 6379 const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; 6380 this._previousScrollData.parentScrollTop = parentScrollTop; 6381
vendor: 5,122 bytes, lines 6382-6541
6382 for (const entry of entries) { 6383 if (!entry.isIntersecting) { 6384 this._activeTarget = null; 6385 6386 this._clearActiveClass(targetElement(entry)); 6387 6388 continue; 6389 } 6390 6391 const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; // if we are scrolling down, pick the bigger offsetTop 6392 6393 if (userScrollsDown && entryIsLowerThanPrevious) { 6394 activate(entry); // if parent isn't scrolled, let's keep the first visible item, breaking the iteration 6395 6396 if (!parentScrollTop) { 6397 return; 6398 } 6399 6400 continue; 6401 } // if we are scrolling up, pick the smallest offsetTop 6402 6403 6404 if (!userScrollsDown && !entryIsLowerThanPrevious) { 6405 activate(entry); 6406 } 6407 } 6408 } // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only 6409 6410 6411 _getRootMargin() { 6412 return this._config.offset ? `${this._config.offset}px 0px -30%` : this._config.rootMargin; 6413 } 6414 6415 _initializeTargetsAndObservables() { 6416 this._targetLinks = new Map(); 6417 this._observableSections = new Map(); 6418 const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); 6419 6420 for (const anchor of targetLinks) { 6421 // ensure that the anchor has an id and is not disabled 6422 if (!anchor.hash || isDisabled(anchor)) { 6423 continue; 6424 } 6425 6426 const observableSection = SelectorEngine.findOne(anchor.hash, this._element); // ensure that the observableSection exists & is visible 6427 6428 if (isVisible(observableSection)) { 6429 this._targetLinks.set(anchor.hash, anchor); 6430 6431 this._observableSections.set(anchor.hash, observableSection); 6432 } 6433 } 6434 } 6435 6436 _process(target) { 6437 if (this._activeTarget === target) { 6438 return; 6439 } 6440 6441 this._clearActiveClass(this._config.target); 6442 6443 this._activeTarget = target; 6444 target.classList.add(CLASS_NAME_ACTIVE$1); 6445 6446 this._activateParents(target); 6447 6448 EventHandler.trigger(this._element, EVENT_ACTIVATE, { 6449 relatedTarget: target 6450 }); 6451 } 6452 6453 _activateParents(target) { 6454 // Activate dropdown parents 6455 if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { 6456 SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); 6457 return; 6458 } 6459 6460 for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { 6461 // Set triggered links parents as active 6462 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6463 for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) { 6464 item.classList.add(CLASS_NAME_ACTIVE$1); 6465 } 6466 } 6467 } 6468 6469 _clearActiveClass(parent) { 6470 parent.classList.remove(CLASS_NAME_ACTIVE$1); 6471 const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent); 6472 6473 for (const node of activeNodes) { 6474 node.classList.remove(CLASS_NAME_ACTIVE$1); 6475 } 6476 } // Static 6477 6478 6479 static jQueryInterface(config) { 6480 return this.each(function () { 6481 const data = ScrollSpy.getOrCreateInstance(this, config); 6482 6483 if (typeof config !== 'string') { 6484 return; 6485 } 6486 6487 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 6488 throw new TypeError(`No method named "${config}"`); 6489 } 6490 6491 data[config](); 6492 }); 6493 } 6494 6495 } 6496 /** 6497 * Data API implementation 6498 */ 6499 6500 6501 EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => { 6502 for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) { 6503 ScrollSpy.getOrCreateInstance(spy); 6504 } 6505 }); 6506 /** 6507 * jQuery 6508 */ 6509 6510 defineJQueryPlugin(ScrollSpy); 6511 6512 /** 6513 * -------------------------------------------------------------------------- 6514 * Bootstrap (v5.2.0): tab.js 6515 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6516 * -------------------------------------------------------------------------- 6517 */ 6518 /** 6519 * Constants 6520 */ 6521 6522 const NAME$1 = 'tab'; 6523 const DATA_KEY$1 = 'bs.tab'; 6524 const EVENT_KEY$1 = `.${DATA_KEY$1}`; 6525 const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`; 6526 const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`; 6527 const EVENT_SHOW$1 = `show${EVENT_KEY$1}`; 6528 const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`; 6529 const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`; 6530 const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`; 6531 const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`; 6532 const ARROW_LEFT_KEY = 'ArrowLeft'; 6533 const ARROW_RIGHT_KEY = 'ArrowRight'; 6534 const ARROW_UP_KEY = 'ArrowUp'; 6535 const ARROW_DOWN_KEY = 'ArrowDown'; 6536 const CLASS_NAME_ACTIVE = 'active'; 6537 const CLASS_NAME_FADE$1 = 'fade'; 6538 const CLASS_NAME_SHOW$1 = 'show'; 6539 const CLASS_DROPDOWN = 'dropdown'; 6540 const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 6541 const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
vendor: 5,999 bytes, lines 6542-6734
6542 const SELECTOR_DROPDOWN_ITEM = '.dropdown-item'; 6543 const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)'; 6544 const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'; 6545 const SELECTOR_OUTER = '.nav-item, .list-group-item'; 6546 const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`; 6547 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab` 6548 6549 const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`; 6550 const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`; 6551 /** 6552 * Class definition 6553 */ 6554 6555 class Tab extends BaseComponent { 6556 constructor(element) { 6557 super(element); 6558 this._parent = this._element.closest(SELECTOR_TAB_PANEL); 6559 6560 if (!this._parent) { 6561 return; // todo: should Throw exception on v6 6562 // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`) 6563 } // Set up initial aria attributes 6564 6565 6566 this._setInitialAttributes(this._parent, this._getChildren()); 6567 6568 EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); 6569 } // Getters 6570 6571 6572 static get NAME() { 6573 return NAME$1; 6574 } // Public 6575 6576 6577 show() { 6578 // Shows this elem and deactivate the active sibling if exists 6579 const innerElem = this._element; 6580 6581 if (this._elemIsActive(innerElem)) { 6582 return; 6583 } // Search for active tab on same parent to deactivate it 6584 6585 6586 const active = this._getActiveElem(); 6587 6588 const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, { 6589 relatedTarget: innerElem 6590 }) : null; 6591 const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, { 6592 relatedTarget: active 6593 }); 6594 6595 if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) { 6596 return; 6597 } 6598 6599 this._deactivate(active, innerElem); 6600 6601 this._activate(innerElem, active); 6602 } // Private 6603 6604 6605 _activate(element, relatedElem) { 6606 if (!element) { 6607 return; 6608 } 6609 6610 element.classList.add(CLASS_NAME_ACTIVE); 6611 6612 this._activate(getElementFromSelector(element)); // Search and activate/show the proper section 6613 6614 6615 const complete = () => { 6616 if (element.getAttribute('role') !== 'tab') { 6617 element.classList.add(CLASS_NAME_SHOW$1); 6618 return; 6619 } 6620 6621 element.focus(); 6622 element.removeAttribute('tabindex'); 6623 element.setAttribute('aria-selected', true); 6624 6625 this._toggleDropDown(element, true); 6626 6627 EventHandler.trigger(element, EVENT_SHOWN$1, { 6628 relatedTarget: relatedElem 6629 }); 6630 }; 6631 6632 this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); 6633 } 6634 6635 _deactivate(element, relatedElem) { 6636 if (!element) { 6637 return; 6638 } 6639 6640 element.classList.remove(CLASS_NAME_ACTIVE); 6641 element.blur(); 6642 6643 this._deactivate(getElementFromSelector(element)); // Search and deactivate the shown section too 6644 6645 6646 const complete = () => { 6647 if (element.getAttribute('role') !== 'tab') { 6648 element.classList.remove(CLASS_NAME_SHOW$1); 6649 return; 6650 } 6651 6652 element.setAttribute('aria-selected', false); 6653 element.setAttribute('tabindex', '-1'); 6654 6655 this._toggleDropDown(element, false); 6656 6657 EventHandler.trigger(element, EVENT_HIDDEN$1, { 6658 relatedTarget: relatedElem 6659 }); 6660 }; 6661 6662 this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); 6663 } 6664 6665 _keydown(event) { 6666 if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) { 6667 return; 6668 } 6669 6670 event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page 6671 6672 event.preventDefault(); 6673 const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key); 6674 const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true); 6675 6676 if (nextActiveElement) { 6677 Tab.getOrCreateInstance(nextActiveElement).show(); 6678 } 6679 } 6680 6681 _getChildren() { 6682 // collection of inner elements 6683 return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent); 6684 } 6685 6686 _getActiveElem() { 6687 return this._getChildren().find(child => this._elemIsActive(child)) || null; 6688 } 6689 6690 _setInitialAttributes(parent, children) { 6691 this._setAttributeIfNotExists(parent, 'role', 'tablist'); 6692 6693 for (const child of children) { 6694 this._setInitialAttributesOnChild(child); 6695 } 6696 } 6697 6698 _setInitialAttributesOnChild(child) { 6699 child = this._getInnerElement(child); 6700 6701 const isActive = this._elemIsActive(child); 6702 6703 const outerElem = this._getOuterElement(child); 6704 6705 child.setAttribute('aria-selected', isActive); 6706 6707 if (outerElem !== child) { 6708 this._setAttributeIfNotExists(outerElem, 'role', 'presentation'); 6709 } 6710 6711 if (!isActive) { 6712 child.setAttribute('tabindex', '-1'); 6713 } 6714 6715 this._setAttributeIfNotExists(child, 'role', 'tab'); // set attributes to the related panel too 6716 6717 6718 this._setInitialAttributesOnTargetPanel(child); 6719 } 6720 6721 _setInitialAttributesOnTargetPanel(child) { 6722 const target = getElementFromSelector(child); 6723 6724 if (!target) { 6725 return; 6726 } 6727 6728 this._setAttributeIfNotExists(target, 'role', 'tabpanel'); 6729 6730 if (child.id) { 6731 this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`); 6732 } 6733 } 6734
vendor: 7,396 bytes, lines 6735-7020
6735 _toggleDropDown(element, open) { 6736 const outerElem = this._getOuterElement(element); 6737 6738 if (!outerElem.classList.contains(CLASS_DROPDOWN)) { 6739 return; 6740 } 6741 6742 const toggle = (selector, className) => { 6743 const element = SelectorEngine.findOne(selector, outerElem); 6744 6745 if (element) { 6746 element.classList.toggle(className, open); 6747 } 6748 }; 6749 6750 toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE); 6751 toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1); 6752 toggle(SELECTOR_DROPDOWN_ITEM, CLASS_NAME_ACTIVE); 6753 outerElem.setAttribute('aria-expanded', open); 6754 } 6755 6756 _setAttributeIfNotExists(element, attribute, value) { 6757 if (!element.hasAttribute(attribute)) { 6758 element.setAttribute(attribute, value); 6759 } 6760 } 6761 6762 _elemIsActive(elem) { 6763 return elem.classList.contains(CLASS_NAME_ACTIVE); 6764 } // Try to get the inner element (usually the .nav-link) 6765 6766 6767 _getInnerElement(elem) { 6768 return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem); 6769 } // Try to get the outer element (usually the .nav-item) 6770 6771 6772 _getOuterElement(elem) { 6773 return elem.closest(SELECTOR_OUTER) || elem; 6774 } // Static 6775 6776 6777 static jQueryInterface(config) { 6778 return this.each(function () { 6779 const data = Tab.getOrCreateInstance(this); 6780 6781 if (typeof config !== 'string') { 6782 return; 6783 } 6784 6785 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 6786 throw new TypeError(`No method named "${config}"`); 6787 } 6788 6789 data[config](); 6790 }); 6791 } 6792 6793 } 6794 /** 6795 * Data API implementation 6796 */ 6797 6798 6799 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 6800 if (['A', 'AREA'].includes(this.tagName)) { 6801 event.preventDefault(); 6802 } 6803 6804 if (isDisabled(this)) { 6805 return; 6806 } 6807 6808 Tab.getOrCreateInstance(this).show(); 6809 }); 6810 /** 6811 * Initialize on focus 6812 */ 6813 6814 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 6815 for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) { 6816 Tab.getOrCreateInstance(element); 6817 } 6818 }); 6819 /** 6820 * jQuery 6821 */ 6822 6823 defineJQueryPlugin(Tab); 6824 6825 /** 6826 * -------------------------------------------------------------------------- 6827 * Bootstrap (v5.2.0): toast.js 6828 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6829 * -------------------------------------------------------------------------- 6830 */ 6831 /** 6832 * Constants 6833 */ 6834 6835 const NAME = 'toast'; 6836 const DATA_KEY = 'bs.toast'; 6837 const EVENT_KEY = `.${DATA_KEY}`; 6838 const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; 6839 const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; 6840 const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; 6841 const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; 6842 const EVENT_HIDE = `hide${EVENT_KEY}`; 6843 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 6844 const EVENT_SHOW = `show${EVENT_KEY}`; 6845 const EVENT_SHOWN = `shown${EVENT_KEY}`; 6846 const CLASS_NAME_FADE = 'fade'; 6847 const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility 6848 6849 const CLASS_NAME_SHOW = 'show'; 6850 const CLASS_NAME_SHOWING = 'showing'; 6851 const DefaultType = { 6852 animation: 'boolean', 6853 autohide: 'boolean', 6854 delay: 'number' 6855 }; 6856 const Default = { 6857 animation: true, 6858 autohide: true, 6859 delay: 5000 6860 }; 6861 /** 6862 * Class definition 6863 */ 6864 6865 class Toast extends BaseComponent { 6866 constructor(element, config) { 6867 super(element, config); 6868 this._timeout = null; 6869 this._hasMouseInteraction = false; 6870 this._hasKeyboardInteraction = false; 6871 6872 this._setListeners(); 6873 } // Getters 6874 6875 6876 static get Default() { 6877 return Default; 6878 } 6879 6880 static get DefaultType() { 6881 return DefaultType; 6882 } 6883 6884 static get NAME() { 6885 return NAME; 6886 } // Public 6887 6888 6889 show() { 6890 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); 6891 6892 if (showEvent.defaultPrevented) { 6893 return; 6894 } 6895 6896 this._clearTimeout(); 6897 6898 if (this._config.animation) { 6899 this._element.classList.add(CLASS_NAME_FADE); 6900 } 6901 6902 const complete = () => { 6903 this._element.classList.remove(CLASS_NAME_SHOWING); 6904 6905 EventHandler.trigger(this._element, EVENT_SHOWN); 6906 6907 this._maybeScheduleHide(); 6908 }; 6909 6910 this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated 6911 6912 6913 reflow(this._element); 6914 6915 this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING); 6916 6917 this._queueCallback(complete, this._element, this._config.animation); 6918 } 6919 6920 hide() { 6921 if (!this.isShown()) { 6922 return; 6923 } 6924 6925 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); 6926 6927 if (hideEvent.defaultPrevented) { 6928 return; 6929 } 6930 6931 const complete = () => { 6932 this._element.classList.add(CLASS_NAME_HIDE); // @deprecated 6933 6934 6935 this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW); 6936 6937 EventHandler.trigger(this._element, EVENT_HIDDEN); 6938 }; 6939 6940 this._element.classList.add(CLASS_NAME_SHOWING); 6941 6942 this._queueCallback(complete, this._element, this._config.animation); 6943 } 6944 6945 dispose() { 6946 this._clearTimeout(); 6947 6948 if (this.isShown()) { 6949 this._element.classList.remove(CLASS_NAME_SHOW); 6950 } 6951 6952 super.dispose(); 6953 } 6954 6955 isShown() { 6956 return this._element.classList.contains(CLASS_NAME_SHOW); 6957 } // Private 6958 6959 6960 _maybeScheduleHide() { 6961 if (!this._config.autohide) { 6962 return; 6963 } 6964 6965 if (this._hasMouseInteraction || this._hasKeyboardInteraction) { 6966 return; 6967 } 6968 6969 this._timeout = setTimeout(() => { 6970 this.hide(); 6971 }, this._config.delay); 6972 } 6973 6974 _onInteraction(event, isInteracting) { 6975 switch (event.type) { 6976 case 'mouseover': 6977 case 'mouseout': 6978 this._hasMouseInteraction = isInteracting; 6979 break; 6980 6981 case 'focusin': 6982 case 'focusout': 6983 this._hasKeyboardInteraction = isInteracting; 6984 break; 6985 } 6986 6987 if (isInteracting) { 6988 this._clearTimeout(); 6989 6990 return; 6991 } 6992 6993 const nextElement = event.relatedTarget; 6994 6995 if (this._element === nextElement || this._element.contains(nextElement)) { 6996 return; 6997 } 6998 6999 this._maybeScheduleHide(); 7000 } 7001 7002 _setListeners() { 7003 EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); 7004 EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); 7005 EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); 7006 EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); 7007 } 7008 7009 _clearTimeout() { 7010 clearTimeout(this._timeout); 7011 this._timeout = null; 7012 } // Static 7013 7014 7015 static jQueryInterface(config) { 7016 return this.each(function () { 7017 const data = Toast.getOrCreateInstance(this, config); 7018 7019 if (typeof config === 'string') { 7020 if (typeof data[config] === 'undefined') {
7021 throw new TypeError(`No method named "${config}"`); 7022 } 7023 7024 data[config](this); 7025 } 7026 }); 7027 } 7028 7029 } 7030 /** 7031 * Data API implementation 7032 */ 7033 7034 7035 enableDismissTrigger(Toast); 7036 /** 7037 * jQuery 7038 */ 7039 7040 defineJQueryPlugin(Toast); 7041 7042 /** 7043 * -------------------------------------------------------------------------- 7044 * Bootstrap (v5.2.0): index.umd.js 7045 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 7046 * -------------------------------------------------------------------------- 7047 */ 7048 const index_umd = { 7049 Alert, 7050 Button, 7051 Carousel, 7052 Collapse, 7053 Dropdown, 7054 Modal, 7055 Offcanvas, 7056 Popover, 7057 ScrollSpy, 7058 Tab, 7059 Toast, 7060 Tooltip 7061 }; 7062 7063 return index_umd; 7064 7065})); 7066//# sourceMappingURL=bootstrap.bundle.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.