PageSourceSearch

https://market.eprice.com.tw/js/bootstrap.js

js eprice.com.tw collected 2026-10-02 05:09:25 UTC 150,397 bytes, 5,043 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.