administrate-bootstrap-theme 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -32
  3. data/app/assets/javascripts/administrate-bootstrap-theme/{bootstrap/bootstrap.bundle.js → bootstrap.bundle.js} +910 -857
  4. data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +2 -14
  5. data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -0
  6. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_card.scss +7 -6
  7. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_carousel.scss +2 -2
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_dropdown.scss +4 -4
  9. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_functions.scss +94 -3
  10. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +11 -0
  11. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_helpers.scss +2 -0
  12. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_images.scss +1 -1
  13. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_mixins.scss +1 -0
  14. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_modal.scss +5 -15
  15. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_navbar.scss +30 -1
  16. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_offcanvas.scss +8 -2
  17. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +51 -0
  18. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_popover.scss +10 -10
  19. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_reboot.scss +12 -8
  20. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +39 -2
  21. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tables.scss +1 -1
  22. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_toasts.scss +3 -3
  23. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tooltip.scss +4 -4
  24. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_transitions.scss +6 -0
  25. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_utilities.scss +44 -8
  26. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables.scss +189 -24
  27. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-grid.scss +1 -1
  28. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-reboot.scss +1 -1
  29. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap.scss +2 -1
  31. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_floating-labels.scss +3 -1
  32. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-check.scss +1 -1
  33. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-control.scss +1 -1
  34. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-range.scss +1 -1
  35. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-select.scss +3 -0
  36. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_stacks.scss +15 -0
  37. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +8 -0
  38. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_backdrop.scss +14 -0
  39. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_buttons.scss +1 -1
  40. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_grid.scss +33 -8
  41. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_utilities.scss +27 -6
  42. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/vendor/_rfs.scss +55 -13
  43. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_autumn.scss +8 -0
  44. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_default.scss +8 -0
  45. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_forest.scss +9 -0
  46. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_industrial.scss +8 -0
  47. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_water.scss +8 -0
  48. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +21 -1
  49. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss +1 -1
  50. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +2 -0
  51. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +26 -3
  52. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +1 -1
  53. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_lato.scss +5 -0
  54. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_montserrat.scss +5 -0
  55. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_open_sans.scss +5 -0
  56. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_roboto.scss +5 -0
  57. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_source_sans_pro.scss +5 -0
  58. data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +10 -61
  59. data/lib/administrate-bootstrap-theme/version.rb +2 -1
  60. data/lib/generators/administrate_bootstrap_theme/install/USAGE +10 -0
  61. data/lib/generators/administrate_bootstrap_theme/install/install_generator.rb +33 -0
  62. data/package.json +2 -3
  63. metadata +38 -10
  64. data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +0 -2673
  65. data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +0 -22
  66. data/app/assets/stylesheets/administrate-bootstrap-theme/flatpickr/flatpickr.scss +0 -791
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v5.0.1 (https://getbootstrap.com/)
2
+ * Bootstrap v5.1.0 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -11,82 +11,10 @@
11
11
 
12
12
  /**
13
13
  * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.1): dom/selector-engine.js
14
+ * Bootstrap (v5.1.0): util/index.js
15
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
16
  * --------------------------------------------------------------------------
17
17
  */
18
-
19
- /**
20
- * ------------------------------------------------------------------------
21
- * Constants
22
- * ------------------------------------------------------------------------
23
- */
24
- const NODE_TEXT = 3;
25
- const SelectorEngine = {
26
- find(selector, element = document.documentElement) {
27
- return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
28
- },
29
-
30
- findOne(selector, element = document.documentElement) {
31
- return Element.prototype.querySelector.call(element, selector);
32
- },
33
-
34
- children(element, selector) {
35
- return [].concat(...element.children).filter(child => child.matches(selector));
36
- },
37
-
38
- parents(element, selector) {
39
- const parents = [];
40
- let ancestor = element.parentNode;
41
-
42
- while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
43
- if (ancestor.matches(selector)) {
44
- parents.push(ancestor);
45
- }
46
-
47
- ancestor = ancestor.parentNode;
48
- }
49
-
50
- return parents;
51
- },
52
-
53
- prev(element, selector) {
54
- let previous = element.previousElementSibling;
55
-
56
- while (previous) {
57
- if (previous.matches(selector)) {
58
- return [previous];
59
- }
60
-
61
- previous = previous.previousElementSibling;
62
- }
63
-
64
- return [];
65
- },
66
-
67
- next(element, selector) {
68
- let next = element.nextElementSibling;
69
-
70
- while (next) {
71
- if (next.matches(selector)) {
72
- return [next];
73
- }
74
-
75
- next = next.nextElementSibling;
76
- }
77
-
78
- return [];
79
- }
80
-
81
- };
82
-
83
- /**
84
- * --------------------------------------------------------------------------
85
- * Bootstrap (v5.0.1): util/index.js
86
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
87
- * --------------------------------------------------------------------------
88
- */
89
-
90
18
  const MAX_UID = 1000000;
91
19
  const MILLISECONDS_MULTIPLIER = 1000;
92
20
  const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
@@ -198,30 +126,12 @@
198
126
  }
199
127
 
200
128
  if (typeof obj === 'string' && obj.length > 0) {
201
- return SelectorEngine.findOne(obj);
129
+ return document.querySelector(obj);
202
130
  }
203
131
 
204
132
  return null;
205
133
  };
206
134
 
207
- const emulateTransitionEnd = (element, duration) => {
208
- let called = false;
209
- const durationPadding = 5;
210
- const emulatedDuration = duration + durationPadding;
211
-
212
- function listener() {
213
- called = true;
214
- element.removeEventListener(TRANSITION_END, listener);
215
- }
216
-
217
- element.addEventListener(TRANSITION_END, listener);
218
- setTimeout(() => {
219
- if (!called) {
220
- triggerTransitionEnd(element);
221
- }
222
- }, emulatedDuration);
223
- };
224
-
225
135
  const typeCheckConfig = (componentName, config, configTypes) => {
226
136
  Object.keys(configTypes).forEach(property => {
227
137
  const expectedTypes = configTypes[property];
@@ -235,17 +145,11 @@
235
145
  };
236
146
 
237
147
  const isVisible = element => {
238
- if (!element) {
148
+ if (!isElement$1(element) || element.getClientRects().length === 0) {
239
149
  return false;
240
150
  }
241
151
 
242
- if (element.style && element.parentNode && element.parentNode.style) {
243
- const elementStyle = getComputedStyle(element);
244
- const parentNodeStyle = getComputedStyle(element.parentNode);
245
- return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
246
- }
247
-
248
- return false;
152
+ return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
249
153
  };
250
154
 
251
155
  const isDisabled = element => {
@@ -288,8 +192,20 @@
288
192
  };
289
193
 
290
194
  const noop = () => {};
195
+ /**
196
+ * Trick to restart an element's animation
197
+ *
198
+ * @param {HTMLElement} element
199
+ * @return void
200
+ *
201
+ * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
202
+ */
291
203
 
292
- const reflow = element => element.offsetHeight;
204
+
205
+ const reflow = element => {
206
+ // eslint-disable-next-line no-unused-expressions
207
+ element.offsetHeight;
208
+ };
293
209
 
294
210
  const getjQuery = () => {
295
211
  const {
@@ -303,9 +219,18 @@
303
219
  return null;
304
220
  };
305
221
 
222
+ const DOMContentLoadedCallbacks = [];
223
+
306
224
  const onDOMContentLoaded = callback => {
307
225
  if (document.readyState === 'loading') {
308
- document.addEventListener('DOMContentLoaded', callback);
226
+ // add listener on the first call when the document is in loading state
227
+ if (!DOMContentLoadedCallbacks.length) {
228
+ document.addEventListener('DOMContentLoaded', () => {
229
+ DOMContentLoadedCallbacks.forEach(callback => callback());
230
+ });
231
+ }
232
+
233
+ DOMContentLoadedCallbacks.push(callback);
309
234
  } else {
310
235
  callback();
311
236
  }
@@ -338,63 +263,66 @@
338
263
  }
339
264
  };
340
265
 
341
- /**
342
- * --------------------------------------------------------------------------
343
- * Bootstrap (v5.0.1): dom/data.js
344
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
345
- * --------------------------------------------------------------------------
346
- */
347
-
348
- /**
349
- * ------------------------------------------------------------------------
350
- * Constants
351
- * ------------------------------------------------------------------------
352
- */
353
- const elementMap = new Map();
354
- var Data = {
355
- set(element, key, instance) {
356
- if (!elementMap.has(element)) {
357
- elementMap.set(element, new Map());
358
- }
266
+ const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
267
+ if (!waitForTransition) {
268
+ execute(callback);
269
+ return;
270
+ }
359
271
 
360
- const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
361
- // can be removed later when multiple key/instances are fine to be used
272
+ const durationPadding = 5;
273
+ const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
274
+ let called = false;
362
275
 
363
- if (!instanceMap.has(key) && instanceMap.size !== 0) {
364
- // eslint-disable-next-line no-console
365
- console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
276
+ const handler = ({
277
+ target
278
+ }) => {
279
+ if (target !== transitionElement) {
366
280
  return;
367
281
  }
368
282
 
369
- instanceMap.set(key, instance);
370
- },
283
+ called = true;
284
+ transitionElement.removeEventListener(TRANSITION_END, handler);
285
+ execute(callback);
286
+ };
371
287
 
372
- get(element, key) {
373
- if (elementMap.has(element)) {
374
- return elementMap.get(element).get(key) || null;
288
+ transitionElement.addEventListener(TRANSITION_END, handler);
289
+ setTimeout(() => {
290
+ if (!called) {
291
+ triggerTransitionEnd(transitionElement);
375
292
  }
293
+ }, emulatedDuration);
294
+ };
295
+ /**
296
+ * Return the previous/next element of a list.
297
+ *
298
+ * @param {array} list The list of elements
299
+ * @param activeElement The active element
300
+ * @param shouldGetNext Choose to get next or previous element
301
+ * @param isCycleAllowed
302
+ * @return {Element|elem} The proper element
303
+ */
376
304
 
377
- return null;
378
- },
379
305
 
380
- remove(element, key) {
381
- if (!elementMap.has(element)) {
382
- return;
383
- }
306
+ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
307
+ let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed
384
308
 
385
- const instanceMap = elementMap.get(element);
386
- instanceMap.delete(key); // free up element references if there are no instances left for an element
309
+ if (index === -1) {
310
+ return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];
311
+ }
387
312
 
388
- if (instanceMap.size === 0) {
389
- elementMap.delete(element);
390
- }
313
+ const listLength = list.length;
314
+ index += shouldGetNext ? 1 : -1;
315
+
316
+ if (isCycleAllowed) {
317
+ index = (index + listLength) % listLength;
391
318
  }
392
319
 
320
+ return list[Math.max(0, Math.min(index, listLength - 1))];
393
321
  };
394
322
 
395
323
  /**
396
324
  * --------------------------------------------------------------------------
397
- * Bootstrap (v5.0.1): dom/event-handler.js
325
+ * Bootstrap (v5.1.0): dom/event-handler.js
398
326
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
399
327
  * --------------------------------------------------------------------------
400
328
  */
@@ -683,17 +611,71 @@
683
611
 
684
612
  /**
685
613
  * --------------------------------------------------------------------------
686
- * Bootstrap (v5.0.1): base-component.js
614
+ * Bootstrap (v5.1.0): dom/data.js
687
615
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
688
616
  * --------------------------------------------------------------------------
689
617
  */
618
+
690
619
  /**
691
620
  * ------------------------------------------------------------------------
692
621
  * Constants
693
622
  * ------------------------------------------------------------------------
694
623
  */
624
+ const elementMap = new Map();
625
+ var Data = {
626
+ set(element, key, instance) {
627
+ if (!elementMap.has(element)) {
628
+ elementMap.set(element, new Map());
629
+ }
695
630
 
696
- const VERSION = '5.0.1';
631
+ const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
632
+ // can be removed later when multiple key/instances are fine to be used
633
+
634
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
635
+ // eslint-disable-next-line no-console
636
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
637
+ return;
638
+ }
639
+
640
+ instanceMap.set(key, instance);
641
+ },
642
+
643
+ get(element, key) {
644
+ if (elementMap.has(element)) {
645
+ return elementMap.get(element).get(key) || null;
646
+ }
647
+
648
+ return null;
649
+ },
650
+
651
+ remove(element, key) {
652
+ if (!elementMap.has(element)) {
653
+ return;
654
+ }
655
+
656
+ const instanceMap = elementMap.get(element);
657
+ instanceMap.delete(key); // free up element references if there are no instances left for an element
658
+
659
+ if (instanceMap.size === 0) {
660
+ elementMap.delete(element);
661
+ }
662
+ }
663
+
664
+ };
665
+
666
+ /**
667
+ * --------------------------------------------------------------------------
668
+ * Bootstrap (v5.1.0): base-component.js
669
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
670
+ * --------------------------------------------------------------------------
671
+ */
672
+ /**
673
+ * ------------------------------------------------------------------------
674
+ * Constants
675
+ * ------------------------------------------------------------------------
676
+ */
677
+
678
+ const VERSION = '5.1.0';
697
679
 
698
680
  class BaseComponent {
699
681
  constructor(element) {
@@ -716,20 +698,17 @@
716
698
  }
717
699
 
718
700
  _queueCallback(callback, element, isAnimated = true) {
719
- if (!isAnimated) {
720
- execute(callback);
721
- return;
722
- }
723
-
724
- const transitionDuration = getTransitionDurationFromElement(element);
725
- EventHandler.one(element, 'transitionend', () => execute(callback));
726
- emulateTransitionEnd(element, transitionDuration);
701
+ executeAfterTransition(callback, element, isAnimated);
727
702
  }
728
703
  /** Static */
729
704
 
730
705
 
731
706
  static getInstance(element) {
732
- return Data.get(element, this.DATA_KEY);
707
+ return Data.get(getElement(element), this.DATA_KEY);
708
+ }
709
+
710
+ static getOrCreateInstance(element, config = {}) {
711
+ return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
733
712
  }
734
713
 
735
714
  static get VERSION() {
@@ -752,7 +731,33 @@
752
731
 
753
732
  /**
754
733
  * --------------------------------------------------------------------------
755
- * Bootstrap (v5.0.1): alert.js
734
+ * Bootstrap (v5.1.0): util/component-functions.js
735
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
736
+ * --------------------------------------------------------------------------
737
+ */
738
+
739
+ const enableDismissTrigger = (component, method = 'hide') => {
740
+ const clickEvent = `click.dismiss${component.EVENT_KEY}`;
741
+ const name = component.NAME;
742
+ EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
743
+ if (['A', 'AREA'].includes(this.tagName)) {
744
+ event.preventDefault();
745
+ }
746
+
747
+ if (isDisabled(this)) {
748
+ return;
749
+ }
750
+
751
+ const target = getElementFromSelector(this) || this.closest(`.${name}`);
752
+ const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
753
+
754
+ instance[method]();
755
+ });
756
+ };
757
+
758
+ /**
759
+ * --------------------------------------------------------------------------
760
+ * Bootstrap (v5.1.0): alert.js
756
761
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
757
762
  * --------------------------------------------------------------------------
758
763
  */
@@ -762,17 +767,13 @@
762
767
  * ------------------------------------------------------------------------
763
768
  */
764
769
 
765
- const NAME$c = 'alert';
766
- const DATA_KEY$b = 'bs.alert';
767
- const EVENT_KEY$b = `.${DATA_KEY$b}`;
768
- const DATA_API_KEY$8 = '.data-api';
769
- const SELECTOR_DISMISS = '[data-bs-dismiss="alert"]';
770
- const EVENT_CLOSE = `close${EVENT_KEY$b}`;
771
- const EVENT_CLOSED = `closed${EVENT_KEY$b}`;
772
- const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`;
773
- const CLASS_NAME_ALERT = 'alert';
774
- const CLASS_NAME_FADE$6 = 'fade';
775
- const CLASS_NAME_SHOW$9 = 'show';
770
+ const NAME$d = 'alert';
771
+ const DATA_KEY$c = 'bs.alert';
772
+ const EVENT_KEY$c = `.${DATA_KEY$c}`;
773
+ const EVENT_CLOSE = `close${EVENT_KEY$c}`;
774
+ const EVENT_CLOSED = `closed${EVENT_KEY$c}`;
775
+ const CLASS_NAME_FADE$5 = 'fade';
776
+ const CLASS_NAME_SHOW$8 = 'show';
776
777
  /**
777
778
  * ------------------------------------------------------------------------
778
779
  * Class Definition
@@ -782,69 +783,47 @@
782
783
  class Alert extends BaseComponent {
783
784
  // Getters
784
785
  static get NAME() {
785
- return NAME$c;
786
+ return NAME$d;
786
787
  } // Public
787
788
 
788
789
 
789
- close(element) {
790
- const rootElement = element ? this._getRootElement(element) : this._element;
791
-
792
- const customEvent = this._triggerCloseEvent(rootElement);
790
+ close() {
791
+ const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
793
792
 
794
- if (customEvent === null || customEvent.defaultPrevented) {
793
+ if (closeEvent.defaultPrevented) {
795
794
  return;
796
795
  }
797
796
 
798
- this._removeElement(rootElement);
799
- } // Private
800
-
797
+ this._element.classList.remove(CLASS_NAME_SHOW$8);
801
798
 
802
- _getRootElement(element) {
803
- return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`);
804
- }
799
+ const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
805
800
 
806
- _triggerCloseEvent(element) {
807
- return EventHandler.trigger(element, EVENT_CLOSE);
808
- }
809
-
810
- _removeElement(element) {
811
- element.classList.remove(CLASS_NAME_SHOW$9);
812
- const isAnimated = element.classList.contains(CLASS_NAME_FADE$6);
801
+ this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
802
+ } // Private
813
803
 
814
- this._queueCallback(() => this._destroyElement(element), element, isAnimated);
815
- }
816
804
 
817
- _destroyElement(element) {
818
- if (element.parentNode) {
819
- element.parentNode.removeChild(element);
820
- }
805
+ _destroyElement() {
806
+ this._element.remove();
821
807
 
822
- EventHandler.trigger(element, EVENT_CLOSED);
808
+ EventHandler.trigger(this._element, EVENT_CLOSED);
809
+ this.dispose();
823
810
  } // Static
824
811
 
825
812
 
826
813
  static jQueryInterface(config) {
827
814
  return this.each(function () {
828
- let data = Data.get(this, DATA_KEY$b);
815
+ const data = Alert.getOrCreateInstance(this);
829
816
 
830
- if (!data) {
831
- data = new Alert(this);
832
- }
833
-
834
- if (config === 'close') {
835
- data[config](this);
817
+ if (typeof config !== 'string') {
818
+ return;
836
819
  }
837
- });
838
- }
839
820
 
840
- static handleDismiss(alertInstance) {
841
- return function (event) {
842
- if (event) {
843
- event.preventDefault();
821
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
822
+ throw new TypeError(`No method named "${config}"`);
844
823
  }
845
824
 
846
- alertInstance.close(this);
847
- };
825
+ data[config](this);
826
+ });
848
827
  }
849
828
 
850
829
  }
@@ -855,7 +834,7 @@
855
834
  */
856
835
 
857
836
 
858
- EventHandler.on(document, EVENT_CLICK_DATA_API$7, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
837
+ enableDismissTrigger(Alert, 'close');
859
838
  /**
860
839
  * ------------------------------------------------------------------------
861
840
  * jQuery
@@ -867,7 +846,7 @@
867
846
 
868
847
  /**
869
848
  * --------------------------------------------------------------------------
870
- * Bootstrap (v5.0.1): button.js
849
+ * Bootstrap (v5.1.0): button.js
871
850
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
872
851
  * --------------------------------------------------------------------------
873
852
  */
@@ -877,13 +856,13 @@
877
856
  * ------------------------------------------------------------------------
878
857
  */
879
858
 
880
- const NAME$b = 'button';
881
- const DATA_KEY$a = 'bs.button';
882
- const EVENT_KEY$a = `.${DATA_KEY$a}`;
859
+ const NAME$c = 'button';
860
+ const DATA_KEY$b = 'bs.button';
861
+ const EVENT_KEY$b = `.${DATA_KEY$b}`;
883
862
  const DATA_API_KEY$7 = '.data-api';
884
863
  const CLASS_NAME_ACTIVE$3 = 'active';
885
864
  const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
886
- const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$7}`;
865
+ const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
887
866
  /**
888
867
  * ------------------------------------------------------------------------
889
868
  * Class Definition
@@ -893,7 +872,7 @@
893
872
  class Button extends BaseComponent {
894
873
  // Getters
895
874
  static get NAME() {
896
- return NAME$b;
875
+ return NAME$c;
897
876
  } // Public
898
877
 
899
878
 
@@ -905,11 +884,7 @@
905
884
 
906
885
  static jQueryInterface(config) {
907
886
  return this.each(function () {
908
- let data = Data.get(this, DATA_KEY$a);
909
-
910
- if (!data) {
911
- data = new Button(this);
912
- }
887
+ const data = Button.getOrCreateInstance(this);
913
888
 
914
889
  if (config === 'toggle') {
915
890
  data[config]();
@@ -928,12 +903,7 @@
928
903
  EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {
929
904
  event.preventDefault();
930
905
  const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);
931
- let data = Data.get(button, DATA_KEY$a);
932
-
933
- if (!data) {
934
- data = new Button(button);
935
- }
936
-
906
+ const data = Button.getOrCreateInstance(button);
937
907
  data.toggle();
938
908
  });
939
909
  /**
@@ -947,7 +917,7 @@
947
917
 
948
918
  /**
949
919
  * --------------------------------------------------------------------------
950
- * Bootstrap (v5.0.1): dom/manipulator.js
920
+ * Bootstrap (v5.1.0): dom/manipulator.js
951
921
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
952
922
  * --------------------------------------------------------------------------
953
923
  */
@@ -1005,8 +975,8 @@
1005
975
  offset(element) {
1006
976
  const rect = element.getBoundingClientRect();
1007
977
  return {
1008
- top: rect.top + document.body.scrollTop,
1009
- left: rect.left + document.body.scrollLeft
978
+ top: rect.top + window.pageYOffset,
979
+ left: rect.left + window.pageXOffset
1010
980
  };
1011
981
  },
1012
982
 
@@ -1021,7 +991,77 @@
1021
991
 
1022
992
  /**
1023
993
  * --------------------------------------------------------------------------
1024
- * Bootstrap (v5.0.1): carousel.js
994
+ * Bootstrap (v5.1.0): dom/selector-engine.js
995
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
996
+ * --------------------------------------------------------------------------
997
+ */
998
+ const NODE_TEXT = 3;
999
+ const SelectorEngine = {
1000
+ find(selector, element = document.documentElement) {
1001
+ return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
1002
+ },
1003
+
1004
+ findOne(selector, element = document.documentElement) {
1005
+ return Element.prototype.querySelector.call(element, selector);
1006
+ },
1007
+
1008
+ children(element, selector) {
1009
+ return [].concat(...element.children).filter(child => child.matches(selector));
1010
+ },
1011
+
1012
+ parents(element, selector) {
1013
+ const parents = [];
1014
+ let ancestor = element.parentNode;
1015
+
1016
+ while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
1017
+ if (ancestor.matches(selector)) {
1018
+ parents.push(ancestor);
1019
+ }
1020
+
1021
+ ancestor = ancestor.parentNode;
1022
+ }
1023
+
1024
+ return parents;
1025
+ },
1026
+
1027
+ prev(element, selector) {
1028
+ let previous = element.previousElementSibling;
1029
+
1030
+ while (previous) {
1031
+ if (previous.matches(selector)) {
1032
+ return [previous];
1033
+ }
1034
+
1035
+ previous = previous.previousElementSibling;
1036
+ }
1037
+
1038
+ return [];
1039
+ },
1040
+
1041
+ next(element, selector) {
1042
+ let next = element.nextElementSibling;
1043
+
1044
+ while (next) {
1045
+ if (next.matches(selector)) {
1046
+ return [next];
1047
+ }
1048
+
1049
+ next = next.nextElementSibling;
1050
+ }
1051
+
1052
+ return [];
1053
+ },
1054
+
1055
+ focusableChildren(element) {
1056
+ const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
1057
+ return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
1058
+ }
1059
+
1060
+ };
1061
+
1062
+ /**
1063
+ * --------------------------------------------------------------------------
1064
+ * Bootstrap (v5.1.0): carousel.js
1025
1065
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1026
1066
  * --------------------------------------------------------------------------
1027
1067
  */
@@ -1031,16 +1071,16 @@
1031
1071
  * ------------------------------------------------------------------------
1032
1072
  */
1033
1073
 
1034
- const NAME$a = 'carousel';
1035
- const DATA_KEY$9 = 'bs.carousel';
1036
- const EVENT_KEY$9 = `.${DATA_KEY$9}`;
1074
+ const NAME$b = 'carousel';
1075
+ const DATA_KEY$a = 'bs.carousel';
1076
+ const EVENT_KEY$a = `.${DATA_KEY$a}`;
1037
1077
  const DATA_API_KEY$6 = '.data-api';
1038
1078
  const ARROW_LEFT_KEY = 'ArrowLeft';
1039
1079
  const ARROW_RIGHT_KEY = 'ArrowRight';
1040
1080
  const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
1041
1081
 
1042
1082
  const SWIPE_THRESHOLD = 40;
1043
- const Default$9 = {
1083
+ const Default$a = {
1044
1084
  interval: 5000,
1045
1085
  keyboard: true,
1046
1086
  slide: false,
@@ -1048,7 +1088,7 @@
1048
1088
  wrap: true,
1049
1089
  touch: true
1050
1090
  };
1051
- const DefaultType$9 = {
1091
+ const DefaultType$a = {
1052
1092
  interval: '(number|boolean)',
1053
1093
  keyboard: 'boolean',
1054
1094
  slide: '(boolean|string)',
@@ -1060,19 +1100,23 @@
1060
1100
  const ORDER_PREV = 'prev';
1061
1101
  const DIRECTION_LEFT = 'left';
1062
1102
  const DIRECTION_RIGHT = 'right';
1063
- const EVENT_SLIDE = `slide${EVENT_KEY$9}`;
1064
- const EVENT_SLID = `slid${EVENT_KEY$9}`;
1065
- const EVENT_KEYDOWN = `keydown${EVENT_KEY$9}`;
1066
- const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$9}`;
1067
- const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$9}`;
1068
- const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;
1069
- const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;
1070
- const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;
1071
- const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;
1072
- const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;
1073
- const EVENT_DRAG_START = `dragstart${EVENT_KEY$9}`;
1074
- const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$9}${DATA_API_KEY$6}`;
1075
- const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$9}${DATA_API_KEY$6}`;
1103
+ const KEY_TO_DIRECTION = {
1104
+ [ARROW_LEFT_KEY]: DIRECTION_RIGHT,
1105
+ [ARROW_RIGHT_KEY]: DIRECTION_LEFT
1106
+ };
1107
+ const EVENT_SLIDE = `slide${EVENT_KEY$a}`;
1108
+ const EVENT_SLID = `slid${EVENT_KEY$a}`;
1109
+ const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;
1110
+ const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;
1111
+ const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;
1112
+ const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;
1113
+ const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;
1114
+ const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;
1115
+ const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;
1116
+ const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;
1117
+ const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;
1118
+ const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;
1119
+ const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
1076
1120
  const CLASS_NAME_CAROUSEL = 'carousel';
1077
1121
  const CLASS_NAME_ACTIVE$2 = 'active';
1078
1122
  const CLASS_NAME_SLIDE = 'slide';
@@ -1119,18 +1163,16 @@
1119
1163
 
1120
1164
 
1121
1165
  static get Default() {
1122
- return Default$9;
1166
+ return Default$a;
1123
1167
  }
1124
1168
 
1125
1169
  static get NAME() {
1126
- return NAME$a;
1170
+ return NAME$b;
1127
1171
  } // Public
1128
1172
 
1129
1173
 
1130
1174
  next() {
1131
- if (!this._isSliding) {
1132
- this._slide(ORDER_NEXT);
1133
- }
1175
+ this._slide(ORDER_NEXT);
1134
1176
  }
1135
1177
 
1136
1178
  nextWhenVisible() {
@@ -1142,9 +1184,7 @@
1142
1184
  }
1143
1185
 
1144
1186
  prev() {
1145
- if (!this._isSliding) {
1146
- this._slide(ORDER_PREV);
1147
- }
1187
+ this._slide(ORDER_PREV);
1148
1188
  }
1149
1189
 
1150
1190
  pause(event) {
@@ -1205,10 +1245,11 @@
1205
1245
 
1206
1246
 
1207
1247
  _getConfig(config) {
1208
- config = { ...Default$9,
1209
- ...config
1248
+ config = { ...Default$a,
1249
+ ...Manipulator.getDataAttributes(this._element),
1250
+ ...(typeof config === 'object' ? config : {})
1210
1251
  };
1211
- typeCheckConfig(NAME$a, config, DefaultType$9);
1252
+ typeCheckConfig(NAME$b, config, DefaultType$a);
1212
1253
  return config;
1213
1254
  }
1214
1255
 
@@ -1304,14 +1345,12 @@
1304
1345
  return;
1305
1346
  }
1306
1347
 
1307
- if (event.key === ARROW_LEFT_KEY) {
1308
- event.preventDefault();
1348
+ const direction = KEY_TO_DIRECTION[event.key];
1309
1349
 
1310
- this._slide(DIRECTION_RIGHT);
1311
- } else if (event.key === ARROW_RIGHT_KEY) {
1350
+ if (direction) {
1312
1351
  event.preventDefault();
1313
1352
 
1314
- this._slide(DIRECTION_LEFT);
1353
+ this._slide(direction);
1315
1354
  }
1316
1355
  }
1317
1356
 
@@ -1322,20 +1361,7 @@
1322
1361
 
1323
1362
  _getItemByOrder(order, activeElement) {
1324
1363
  const isNext = order === ORDER_NEXT;
1325
- const isPrev = order === ORDER_PREV;
1326
-
1327
- const activeIndex = this._getItemIndex(activeElement);
1328
-
1329
- const lastItemIndex = this._items.length - 1;
1330
- const isGoingToWrap = isPrev && activeIndex === 0 || isNext && activeIndex === lastItemIndex;
1331
-
1332
- if (isGoingToWrap && !this._config.wrap) {
1333
- return activeElement;
1334
- }
1335
-
1336
- const delta = isPrev ? -1 : 1;
1337
- const itemIndex = (activeIndex + delta) % this._items.length;
1338
- return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
1364
+ return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);
1339
1365
  }
1340
1366
 
1341
1367
  _triggerSlideEvent(relatedTarget, eventDirectionName) {
@@ -1408,6 +1434,10 @@
1408
1434
  return;
1409
1435
  }
1410
1436
 
1437
+ if (this._isSliding) {
1438
+ return;
1439
+ }
1440
+
1411
1441
  const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
1412
1442
 
1413
1443
  if (slideEvent.defaultPrevented) {
@@ -1491,10 +1521,10 @@
1491
1521
 
1492
1522
 
1493
1523
  static carouselInterface(element, config) {
1494
- let data = Data.get(element, DATA_KEY$9);
1495
- let _config = { ...Default$9,
1496
- ...Manipulator.getDataAttributes(element)
1497
- };
1524
+ const data = Carousel.getOrCreateInstance(element, config);
1525
+ let {
1526
+ _config
1527
+ } = data;
1498
1528
 
1499
1529
  if (typeof config === 'object') {
1500
1530
  _config = { ..._config,
@@ -1504,10 +1534,6 @@
1504
1534
 
1505
1535
  const action = typeof config === 'string' ? config : _config.slide;
1506
1536
 
1507
- if (!data) {
1508
- data = new Carousel(element, _config);
1509
- }
1510
-
1511
1537
  if (typeof config === 'number') {
1512
1538
  data.to(config);
1513
1539
  } else if (typeof action === 'string') {
@@ -1547,7 +1573,7 @@
1547
1573
  Carousel.carouselInterface(target, config);
1548
1574
 
1549
1575
  if (slideIndex) {
1550
- Data.get(target, DATA_KEY$9).to(slideIndex);
1576
+ Carousel.getInstance(target).to(slideIndex);
1551
1577
  }
1552
1578
 
1553
1579
  event.preventDefault();
@@ -1566,7 +1592,7 @@
1566
1592
  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
1567
1593
 
1568
1594
  for (let i = 0, len = carousels.length; i < len; i++) {
1569
- Carousel.carouselInterface(carousels[i], Data.get(carousels[i], DATA_KEY$9));
1595
+ Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));
1570
1596
  }
1571
1597
  });
1572
1598
  /**
@@ -1580,7 +1606,7 @@
1580
1606
 
1581
1607
  /**
1582
1608
  * --------------------------------------------------------------------------
1583
- * Bootstrap (v5.0.1): collapse.js
1609
+ * Bootstrap (v5.1.0): collapse.js
1584
1610
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1585
1611
  * --------------------------------------------------------------------------
1586
1612
  */
@@ -1590,27 +1616,28 @@
1590
1616
  * ------------------------------------------------------------------------
1591
1617
  */
1592
1618
 
1593
- const NAME$9 = 'collapse';
1594
- const DATA_KEY$8 = 'bs.collapse';
1595
- const EVENT_KEY$8 = `.${DATA_KEY$8}`;
1619
+ const NAME$a = 'collapse';
1620
+ const DATA_KEY$9 = 'bs.collapse';
1621
+ const EVENT_KEY$9 = `.${DATA_KEY$9}`;
1596
1622
  const DATA_API_KEY$5 = '.data-api';
1597
- const Default$8 = {
1623
+ const Default$9 = {
1598
1624
  toggle: true,
1599
- parent: ''
1625
+ parent: null
1600
1626
  };
1601
- const DefaultType$8 = {
1627
+ const DefaultType$9 = {
1602
1628
  toggle: 'boolean',
1603
- parent: '(string|element)'
1629
+ parent: '(null|element)'
1604
1630
  };
1605
- const EVENT_SHOW$5 = `show${EVENT_KEY$8}`;
1606
- const EVENT_SHOWN$5 = `shown${EVENT_KEY$8}`;
1607
- const EVENT_HIDE$5 = `hide${EVENT_KEY$8}`;
1608
- const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$8}`;
1609
- const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
1610
- const CLASS_NAME_SHOW$8 = 'show';
1631
+ const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;
1632
+ const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;
1633
+ const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;
1634
+ const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;
1635
+ const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;
1636
+ const CLASS_NAME_SHOW$7 = 'show';
1611
1637
  const CLASS_NAME_COLLAPSE = 'collapse';
1612
1638
  const CLASS_NAME_COLLAPSING = 'collapsing';
1613
1639
  const CLASS_NAME_COLLAPSED = 'collapsed';
1640
+ const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
1614
1641
  const WIDTH = 'width';
1615
1642
  const HEIGHT = 'height';
1616
1643
  const SELECTOR_ACTIVES = '.show, .collapsing';
@@ -1626,7 +1653,7 @@
1626
1653
  super(element);
1627
1654
  this._isTransitioning = false;
1628
1655
  this._config = this._getConfig(config);
1629
- this._triggerArray = SelectorEngine.find(`${SELECTOR_DATA_TOGGLE$4}[href="#${this._element.id}"],` + `${SELECTOR_DATA_TOGGLE$4}[data-bs-target="#${this._element.id}"]`);
1656
+ this._triggerArray = [];
1630
1657
  const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
1631
1658
 
1632
1659
  for (let i = 0, len = toggleList.length; i < len; i++) {
@@ -1641,10 +1668,10 @@
1641
1668
  }
1642
1669
  }
1643
1670
 
1644
- this._parent = this._config.parent ? this._getParent() : null;
1671
+ this._initializeChildren();
1645
1672
 
1646
1673
  if (!this._config.parent) {
1647
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1674
+ this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
1648
1675
  }
1649
1676
 
1650
1677
  if (this._config.toggle) {
@@ -1654,16 +1681,16 @@
1654
1681
 
1655
1682
 
1656
1683
  static get Default() {
1657
- return Default$8;
1684
+ return Default$9;
1658
1685
  }
1659
1686
 
1660
1687
  static get NAME() {
1661
- return NAME$9;
1688
+ return NAME$a;
1662
1689
  } // Public
1663
1690
 
1664
1691
 
1665
1692
  toggle() {
1666
- if (this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1693
+ if (this._isShown()) {
1667
1694
  this.hide();
1668
1695
  } else {
1669
1696
  this.show();
@@ -1671,32 +1698,23 @@
1671
1698
  }
1672
1699
 
1673
1700
  show() {
1674
- if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1701
+ if (this._isTransitioning || this._isShown()) {
1675
1702
  return;
1676
1703
  }
1677
1704
 
1678
- let actives;
1705
+ let actives = [];
1679
1706
  let activesData;
1680
1707
 
1681
- if (this._parent) {
1682
- actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(elem => {
1683
- if (typeof this._config.parent === 'string') {
1684
- return elem.getAttribute('data-bs-parent') === this._config.parent;
1685
- }
1686
-
1687
- return elem.classList.contains(CLASS_NAME_COLLAPSE);
1688
- });
1689
-
1690
- if (actives.length === 0) {
1691
- actives = null;
1692
- }
1708
+ if (this._config.parent) {
1709
+ const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
1710
+ actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
1693
1711
  }
1694
1712
 
1695
1713
  const container = SelectorEngine.findOne(this._selector);
1696
1714
 
1697
- if (actives) {
1715
+ if (actives.length) {
1698
1716
  const tempActiveData = actives.find(elem => container !== elem);
1699
- activesData = tempActiveData ? Data.get(tempActiveData, DATA_KEY$8) : null;
1717
+ activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
1700
1718
 
1701
1719
  if (activesData && activesData._isTransitioning) {
1702
1720
  return;
@@ -1709,17 +1727,17 @@
1709
1727
  return;
1710
1728
  }
1711
1729
 
1712
- if (actives) {
1713
- actives.forEach(elemActive => {
1714
- if (container !== elemActive) {
1715
- Collapse.collapseInterface(elemActive, 'hide');
1716
- }
1730
+ actives.forEach(elemActive => {
1731
+ if (container !== elemActive) {
1732
+ Collapse.getOrCreateInstance(elemActive, {
1733
+ toggle: false
1734
+ }).hide();
1735
+ }
1717
1736
 
1718
- if (!activesData) {
1719
- Data.set(elemActive, DATA_KEY$8, null);
1720
- }
1721
- });
1722
- }
1737
+ if (!activesData) {
1738
+ Data.set(elemActive, DATA_KEY$9, null);
1739
+ }
1740
+ });
1723
1741
 
1724
1742
  const dimension = this._getDimension();
1725
1743
 
@@ -1729,22 +1747,18 @@
1729
1747
 
1730
1748
  this._element.style[dimension] = 0;
1731
1749
 
1732
- if (this._triggerArray.length) {
1733
- this._triggerArray.forEach(element => {
1734
- element.classList.remove(CLASS_NAME_COLLAPSED);
1735
- element.setAttribute('aria-expanded', true);
1736
- });
1737
- }
1750
+ this._addAriaAndCollapsedClass(this._triggerArray, true);
1738
1751
 
1739
- this.setTransitioning(true);
1752
+ this._isTransitioning = true;
1740
1753
 
1741
1754
  const complete = () => {
1755
+ this._isTransitioning = false;
1756
+
1742
1757
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
1743
1758
 
1744
- this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
1759
+ this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
1745
1760
 
1746
1761
  this._element.style[dimension] = '';
1747
- this.setTransitioning(false);
1748
1762
  EventHandler.trigger(this._element, EVENT_SHOWN$5);
1749
1763
  };
1750
1764
 
@@ -1757,7 +1771,7 @@
1757
1771
  }
1758
1772
 
1759
1773
  hide() {
1760
- if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1774
+ if (this._isTransitioning || !this._isShown()) {
1761
1775
  return;
1762
1776
  }
1763
1777
 
@@ -1774,26 +1788,23 @@
1774
1788
 
1775
1789
  this._element.classList.add(CLASS_NAME_COLLAPSING);
1776
1790
 
1777
- this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
1791
+ this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
1778
1792
 
1779
1793
  const triggerArrayLength = this._triggerArray.length;
1780
1794
 
1781
- if (triggerArrayLength > 0) {
1782
- for (let i = 0; i < triggerArrayLength; i++) {
1783
- const trigger = this._triggerArray[i];
1784
- const elem = getElementFromSelector(trigger);
1795
+ for (let i = 0; i < triggerArrayLength; i++) {
1796
+ const trigger = this._triggerArray[i];
1797
+ const elem = getElementFromSelector(trigger);
1785
1798
 
1786
- if (elem && !elem.classList.contains(CLASS_NAME_SHOW$8)) {
1787
- trigger.classList.add(CLASS_NAME_COLLAPSED);
1788
- trigger.setAttribute('aria-expanded', false);
1789
- }
1799
+ if (elem && !this._isShown(elem)) {
1800
+ this._addAriaAndCollapsedClass([trigger], false);
1790
1801
  }
1791
1802
  }
1792
1803
 
1793
- this.setTransitioning(true);
1804
+ this._isTransitioning = true;
1794
1805
 
1795
1806
  const complete = () => {
1796
- this.setTransitioning(false);
1807
+ this._isTransitioning = false;
1797
1808
 
1798
1809
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
1799
1810
 
@@ -1807,45 +1818,47 @@
1807
1818
  this._queueCallback(complete, this._element, true);
1808
1819
  }
1809
1820
 
1810
- setTransitioning(isTransitioning) {
1811
- this._isTransitioning = isTransitioning;
1821
+ _isShown(element = this._element) {
1822
+ return element.classList.contains(CLASS_NAME_SHOW$7);
1812
1823
  } // Private
1813
1824
 
1814
1825
 
1815
1826
  _getConfig(config) {
1816
- config = { ...Default$8,
1827
+ config = { ...Default$9,
1828
+ ...Manipulator.getDataAttributes(this._element),
1817
1829
  ...config
1818
1830
  };
1819
1831
  config.toggle = Boolean(config.toggle); // Coerce string values
1820
1832
 
1821
- typeCheckConfig(NAME$9, config, DefaultType$8);
1833
+ config.parent = getElement(config.parent);
1834
+ typeCheckConfig(NAME$a, config, DefaultType$9);
1822
1835
  return config;
1823
1836
  }
1824
1837
 
1825
1838
  _getDimension() {
1826
- return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
1839
+ return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
1827
1840
  }
1828
1841
 
1829
- _getParent() {
1830
- let {
1831
- parent
1832
- } = this._config;
1833
- parent = getElement(parent);
1834
- const selector = `${SELECTOR_DATA_TOGGLE$4}[data-bs-parent="${parent}"]`;
1835
- SelectorEngine.find(selector, parent).forEach(element => {
1842
+ _initializeChildren() {
1843
+ if (!this._config.parent) {
1844
+ return;
1845
+ }
1846
+
1847
+ const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent);
1848
+ SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
1836
1849
  const selected = getElementFromSelector(element);
1837
1850
 
1838
- this._addAriaAndCollapsedClass(selected, [element]);
1851
+ if (selected) {
1852
+ this._addAriaAndCollapsedClass([element], this._isShown(selected));
1853
+ }
1839
1854
  });
1840
- return parent;
1841
1855
  }
1842
1856
 
1843
- _addAriaAndCollapsedClass(element, triggerArray) {
1844
- if (!element || !triggerArray.length) {
1857
+ _addAriaAndCollapsedClass(triggerArray, isOpen) {
1858
+ if (!triggerArray.length) {
1845
1859
  return;
1846
1860
  }
1847
1861
 
1848
- const isOpen = element.classList.contains(CLASS_NAME_SHOW$8);
1849
1862
  triggerArray.forEach(elem => {
1850
1863
  if (isOpen) {
1851
1864
  elem.classList.remove(CLASS_NAME_COLLAPSED);
@@ -1858,33 +1871,23 @@
1858
1871
  } // Static
1859
1872
 
1860
1873
 
1861
- static collapseInterface(element, config) {
1862
- let data = Data.get(element, DATA_KEY$8);
1863
- const _config = { ...Default$8,
1864
- ...Manipulator.getDataAttributes(element),
1865
- ...(typeof config === 'object' && config ? config : {})
1866
- };
1867
-
1868
- if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
1869
- _config.toggle = false;
1870
- }
1871
-
1872
- if (!data) {
1873
- data = new Collapse(element, _config);
1874
- }
1874
+ static jQueryInterface(config) {
1875
+ return this.each(function () {
1876
+ const _config = {};
1875
1877
 
1876
- if (typeof config === 'string') {
1877
- if (typeof data[config] === 'undefined') {
1878
- throw new TypeError(`No method named "${config}"`);
1878
+ if (typeof config === 'string' && /show|hide/.test(config)) {
1879
+ _config.toggle = false;
1879
1880
  }
1880
1881
 
1881
- data[config]();
1882
- }
1883
- }
1882
+ const data = Collapse.getOrCreateInstance(this, _config);
1884
1883
 
1885
- static jQueryInterface(config) {
1886
- return this.each(function () {
1887
- Collapse.collapseInterface(this, config);
1884
+ if (typeof config === 'string') {
1885
+ if (typeof data[config] === 'undefined') {
1886
+ throw new TypeError(`No method named "${config}"`);
1887
+ }
1888
+
1889
+ data[config]();
1890
+ }
1888
1891
  });
1889
1892
  }
1890
1893
 
@@ -1902,26 +1905,12 @@
1902
1905
  event.preventDefault();
1903
1906
  }
1904
1907
 
1905
- const triggerData = Manipulator.getDataAttributes(this);
1906
1908
  const selector = getSelectorFromElement(this);
1907
1909
  const selectorElements = SelectorEngine.find(selector);
1908
1910
  selectorElements.forEach(element => {
1909
- const data = Data.get(element, DATA_KEY$8);
1910
- let config;
1911
-
1912
- if (data) {
1913
- // update parent attribute
1914
- if (data._parent === null && typeof triggerData.parent === 'string') {
1915
- data._config.parent = triggerData.parent;
1916
- data._parent = data._getParent();
1917
- }
1918
-
1919
- config = 'toggle';
1920
- } else {
1921
- config = triggerData;
1922
- }
1923
-
1924
- Collapse.collapseInterface(element, config);
1911
+ Collapse.getOrCreateInstance(element, {
1912
+ toggle: false
1913
+ }).toggle();
1925
1914
  });
1926
1915
  });
1927
1916
  /**
@@ -2089,17 +2078,31 @@
2089
2078
  return placement.split('-')[0];
2090
2079
  }
2091
2080
 
2092
- function getBoundingClientRect(element) {
2081
+ var round$1 = Math.round;
2082
+ function getBoundingClientRect(element, includeScale) {
2083
+ if (includeScale === void 0) {
2084
+ includeScale = false;
2085
+ }
2086
+
2093
2087
  var rect = element.getBoundingClientRect();
2088
+ var scaleX = 1;
2089
+ var scaleY = 1;
2090
+
2091
+ if (isHTMLElement(element) && includeScale) {
2092
+ // Fallback to 1 in case both values are `0`
2093
+ scaleX = rect.width / element.offsetWidth || 1;
2094
+ scaleY = rect.height / element.offsetHeight || 1;
2095
+ }
2096
+
2094
2097
  return {
2095
- width: rect.width,
2096
- height: rect.height,
2097
- top: rect.top,
2098
- right: rect.right,
2099
- bottom: rect.bottom,
2100
- left: rect.left,
2101
- x: rect.left,
2102
- y: rect.top
2098
+ width: round$1(rect.width / scaleX),
2099
+ height: round$1(rect.height / scaleY),
2100
+ top: round$1(rect.top / scaleY),
2101
+ right: round$1(rect.right / scaleX),
2102
+ bottom: round$1(rect.bottom / scaleY),
2103
+ left: round$1(rect.left / scaleX),
2104
+ x: round$1(rect.left / scaleX),
2105
+ y: round$1(rect.top / scaleY)
2103
2106
  };
2104
2107
  }
2105
2108
 
@@ -3083,7 +3086,7 @@
3083
3086
  });
3084
3087
  }
3085
3088
 
3086
- function hide$1(_ref) {
3089
+ function hide(_ref) {
3087
3090
  var state = _ref.state,
3088
3091
  name = _ref.name;
3089
3092
  var referenceRect = state.rects.reference;
@@ -3112,12 +3115,12 @@
3112
3115
  } // eslint-disable-next-line import/no-unused-modules
3113
3116
 
3114
3117
 
3115
- var hide$2 = {
3118
+ var hide$1 = {
3116
3119
  name: 'hide',
3117
3120
  enabled: true,
3118
3121
  phase: 'main',
3119
3122
  requiresIfExists: ['preventOverflow'],
3120
- fn: hide$1
3123
+ fn: hide
3121
3124
  };
3122
3125
 
3123
3126
  function distanceAndSkiddingToXY(placement, rects, offset) {
@@ -3327,16 +3330,24 @@
3327
3330
  }
3328
3331
  }
3329
3332
 
3333
+ function isElementScaled(element) {
3334
+ var rect = element.getBoundingClientRect();
3335
+ var scaleX = rect.width / element.offsetWidth || 1;
3336
+ var scaleY = rect.height / element.offsetHeight || 1;
3337
+ return scaleX !== 1 || scaleY !== 1;
3338
+ } // Returns the composite rect of an element relative to its offsetParent.
3330
3339
  // Composite means it takes into account transforms as well as layout.
3331
3340
 
3341
+
3332
3342
  function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
3333
3343
  if (isFixed === void 0) {
3334
3344
  isFixed = false;
3335
3345
  }
3336
3346
 
3337
- var documentElement = getDocumentElement(offsetParent);
3338
- var rect = getBoundingClientRect(elementOrVirtualElement);
3339
3347
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
3348
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
3349
+ var documentElement = getDocumentElement(offsetParent);
3350
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
3340
3351
  var scroll = {
3341
3352
  scrollLeft: 0,
3342
3353
  scrollTop: 0
@@ -3353,7 +3364,7 @@
3353
3364
  }
3354
3365
 
3355
3366
  if (isHTMLElement(offsetParent)) {
3356
- offsets = getBoundingClientRect(offsetParent);
3367
+ offsets = getBoundingClientRect(offsetParent, true);
3357
3368
  offsets.x += offsetParent.clientLeft;
3358
3369
  offsets.y += offsetParent.clientTop;
3359
3370
  } else if (documentElement) {
@@ -3640,7 +3651,7 @@
3640
3651
  defaultModifiers: defaultModifiers$1
3641
3652
  }); // eslint-disable-next-line import/no-unused-modules
3642
3653
 
3643
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$2];
3654
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
3644
3655
  var createPopper = /*#__PURE__*/popperGenerator({
3645
3656
  defaultModifiers: defaultModifiers
3646
3657
  }); // eslint-disable-next-line import/no-unused-modules
@@ -3681,7 +3692,7 @@
3681
3692
  computeStyles: computeStyles$1,
3682
3693
  eventListeners: eventListeners,
3683
3694
  flip: flip$1,
3684
- hide: hide$2,
3695
+ hide: hide$1,
3685
3696
  offset: offset$1,
3686
3697
  popperOffsets: popperOffsets$1,
3687
3698
  preventOverflow: preventOverflow$1
@@ -3689,7 +3700,7 @@
3689
3700
 
3690
3701
  /**
3691
3702
  * --------------------------------------------------------------------------
3692
- * Bootstrap (v5.0.1): dropdown.js
3703
+ * Bootstrap (v5.1.0): dropdown.js
3693
3704
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3694
3705
  * --------------------------------------------------------------------------
3695
3706
  */
@@ -3699,27 +3710,26 @@
3699
3710
  * ------------------------------------------------------------------------
3700
3711
  */
3701
3712
 
3702
- const NAME$8 = 'dropdown';
3703
- const DATA_KEY$7 = 'bs.dropdown';
3704
- const EVENT_KEY$7 = `.${DATA_KEY$7}`;
3713
+ const NAME$9 = 'dropdown';
3714
+ const DATA_KEY$8 = 'bs.dropdown';
3715
+ const EVENT_KEY$8 = `.${DATA_KEY$8}`;
3705
3716
  const DATA_API_KEY$4 = '.data-api';
3706
3717
  const ESCAPE_KEY$2 = 'Escape';
3707
3718
  const SPACE_KEY = 'Space';
3708
- const TAB_KEY = 'Tab';
3719
+ const TAB_KEY$1 = 'Tab';
3709
3720
  const ARROW_UP_KEY = 'ArrowUp';
3710
3721
  const ARROW_DOWN_KEY = 'ArrowDown';
3711
3722
  const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
3712
3723
 
3713
3724
  const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
3714
- const EVENT_HIDE$4 = `hide${EVENT_KEY$7}`;
3715
- const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$7}`;
3716
- const EVENT_SHOW$4 = `show${EVENT_KEY$7}`;
3717
- const EVENT_SHOWN$4 = `shown${EVENT_KEY$7}`;
3718
- const EVENT_CLICK = `click${EVENT_KEY$7}`;
3719
- const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
3720
- const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$7}${DATA_API_KEY$4}`;
3721
- const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$7}${DATA_API_KEY$4}`;
3722
- const CLASS_NAME_SHOW$7 = 'show';
3725
+ const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;
3726
+ const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
3727
+ const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
3728
+ const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
3729
+ const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;
3730
+ const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;
3731
+ const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;
3732
+ const CLASS_NAME_SHOW$6 = 'show';
3723
3733
  const CLASS_NAME_DROPUP = 'dropup';
3724
3734
  const CLASS_NAME_DROPEND = 'dropend';
3725
3735
  const CLASS_NAME_DROPSTART = 'dropstart';
@@ -3734,7 +3744,7 @@
3734
3744
  const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
3735
3745
  const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
3736
3746
  const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
3737
- const Default$7 = {
3747
+ const Default$8 = {
3738
3748
  offset: [0, 2],
3739
3749
  boundary: 'clippingParents',
3740
3750
  reference: 'toggle',
@@ -3742,7 +3752,7 @@
3742
3752
  popperConfig: null,
3743
3753
  autoClose: true
3744
3754
  };
3745
- const DefaultType$7 = {
3755
+ const DefaultType$8 = {
3746
3756
  offset: '(array|string|function)',
3747
3757
  boundary: '(string|element)',
3748
3758
  reference: '(string|element|object)',
@@ -3763,45 +3773,31 @@
3763
3773
  this._config = this._getConfig(config);
3764
3774
  this._menu = this._getMenuElement();
3765
3775
  this._inNavbar = this._detectNavbar();
3766
-
3767
- this._addEventListeners();
3768
3776
  } // Getters
3769
3777
 
3770
3778
 
3771
3779
  static get Default() {
3772
- return Default$7;
3780
+ return Default$8;
3773
3781
  }
3774
3782
 
3775
3783
  static get DefaultType() {
3776
- return DefaultType$7;
3784
+ return DefaultType$8;
3777
3785
  }
3778
3786
 
3779
3787
  static get NAME() {
3780
- return NAME$8;
3788
+ return NAME$9;
3781
3789
  } // Public
3782
3790
 
3783
3791
 
3784
3792
  toggle() {
3785
- if (isDisabled(this._element)) {
3786
- return;
3787
- }
3788
-
3789
- const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7);
3790
-
3791
- if (isActive) {
3792
- this.hide();
3793
- return;
3794
- }
3795
-
3796
- this.show();
3793
+ return this._isShown() ? this.hide() : this.show();
3797
3794
  }
3798
3795
 
3799
3796
  show() {
3800
- if (isDisabled(this._element) || this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
3797
+ if (isDisabled(this._element) || this._isShown(this._menu)) {
3801
3798
  return;
3802
3799
  }
3803
3800
 
3804
- const parent = Dropdown.getParentFromElement(this._element);
3805
3801
  const relatedTarget = {
3806
3802
  relatedTarget: this._element
3807
3803
  };
@@ -3809,34 +3805,14 @@
3809
3805
 
3810
3806
  if (showEvent.defaultPrevented) {
3811
3807
  return;
3812
- } // Totally disable Popper for Dropdowns in Navbar
3808
+ }
3813
3809
 
3810
+ const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
3814
3811
 
3815
3812
  if (this._inNavbar) {
3816
3813
  Manipulator.setDataAttribute(this._menu, 'popper', 'none');
3817
3814
  } else {
3818
- if (typeof Popper === 'undefined') {
3819
- throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
3820
- }
3821
-
3822
- let referenceElement = this._element;
3823
-
3824
- if (this._config.reference === 'parent') {
3825
- referenceElement = parent;
3826
- } else if (isElement$1(this._config.reference)) {
3827
- referenceElement = getElement(this._config.reference);
3828
- } else if (typeof this._config.reference === 'object') {
3829
- referenceElement = this._config.reference;
3830
- }
3831
-
3832
- const popperConfig = this._getPopperConfig();
3833
-
3834
- const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
3835
- this._popper = createPopper(referenceElement, this._menu, popperConfig);
3836
-
3837
- if (isDisplayStatic) {
3838
- Manipulator.setDataAttribute(this._menu, 'popper', 'static');
3839
- }
3815
+ this._createPopper(parent);
3840
3816
  } // If this is a touch-enabled device we add extra
3841
3817
  // empty mouseover listeners to the body's immediate children;
3842
3818
  // only needed because of broken event delegation on iOS
@@ -3851,15 +3827,15 @@
3851
3827
 
3852
3828
  this._element.setAttribute('aria-expanded', true);
3853
3829
 
3854
- this._menu.classList.toggle(CLASS_NAME_SHOW$7);
3830
+ this._menu.classList.add(CLASS_NAME_SHOW$6);
3855
3831
 
3856
- this._element.classList.toggle(CLASS_NAME_SHOW$7);
3832
+ this._element.classList.add(CLASS_NAME_SHOW$6);
3857
3833
 
3858
3834
  EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
3859
3835
  }
3860
3836
 
3861
3837
  hide() {
3862
- if (isDisabled(this._element) || !this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
3838
+ if (isDisabled(this._element) || !this._isShown(this._menu)) {
3863
3839
  return;
3864
3840
  }
3865
3841
 
@@ -3887,13 +3863,6 @@
3887
3863
  } // Private
3888
3864
 
3889
3865
 
3890
- _addEventListeners() {
3891
- EventHandler.on(this._element, EVENT_CLICK, event => {
3892
- event.preventDefault();
3893
- this.toggle();
3894
- });
3895
- }
3896
-
3897
3866
  _completeHide(relatedTarget) {
3898
3867
  const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
3899
3868
 
@@ -3911,9 +3880,9 @@
3911
3880
  this._popper.destroy();
3912
3881
  }
3913
3882
 
3914
- this._menu.classList.remove(CLASS_NAME_SHOW$7);
3883
+ this._menu.classList.remove(CLASS_NAME_SHOW$6);
3915
3884
 
3916
- this._element.classList.remove(CLASS_NAME_SHOW$7);
3885
+ this._element.classList.remove(CLASS_NAME_SHOW$6);
3917
3886
 
3918
3887
  this._element.setAttribute('aria-expanded', 'false');
3919
3888
 
@@ -3926,16 +3895,45 @@
3926
3895
  ...Manipulator.getDataAttributes(this._element),
3927
3896
  ...config
3928
3897
  };
3929
- typeCheckConfig(NAME$8, config, this.constructor.DefaultType);
3898
+ typeCheckConfig(NAME$9, config, this.constructor.DefaultType);
3930
3899
 
3931
3900
  if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
3932
3901
  // Popper virtual elements require a getBoundingClientRect method
3933
- throw new TypeError(`${NAME$8.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
3902
+ throw new TypeError(`${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
3934
3903
  }
3935
3904
 
3936
3905
  return config;
3937
3906
  }
3938
3907
 
3908
+ _createPopper(parent) {
3909
+ if (typeof Popper === 'undefined') {
3910
+ throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
3911
+ }
3912
+
3913
+ let referenceElement = this._element;
3914
+
3915
+ if (this._config.reference === 'parent') {
3916
+ referenceElement = parent;
3917
+ } else if (isElement$1(this._config.reference)) {
3918
+ referenceElement = getElement(this._config.reference);
3919
+ } else if (typeof this._config.reference === 'object') {
3920
+ referenceElement = this._config.reference;
3921
+ }
3922
+
3923
+ const popperConfig = this._getPopperConfig();
3924
+
3925
+ const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
3926
+ this._popper = createPopper(referenceElement, this._menu, popperConfig);
3927
+
3928
+ if (isDisplayStatic) {
3929
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static');
3930
+ }
3931
+ }
3932
+
3933
+ _isShown(element = this._element) {
3934
+ return element.classList.contains(CLASS_NAME_SHOW$6);
3935
+ }
3936
+
3939
3937
  _getMenuElement() {
3940
3938
  return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
3941
3939
  }
@@ -4009,69 +4007,53 @@
4009
4007
  };
4010
4008
  }
4011
4009
 
4012
- _selectMenuItem(event) {
4010
+ _selectMenuItem({
4011
+ key,
4012
+ target
4013
+ }) {
4013
4014
  const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
4014
4015
 
4015
4016
  if (!items.length) {
4016
4017
  return;
4017
- }
4018
-
4019
- let index = items.indexOf(event.target); // Up
4018
+ } // if target isn't included in items (e.g. when expanding the dropdown)
4019
+ // allow cycling to get the last item in case key equals ARROW_UP_KEY
4020
4020
 
4021
- if (event.key === ARROW_UP_KEY && index > 0) {
4022
- index--;
4023
- } // Down
4024
4021
 
4025
-
4026
- if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
4027
- index++;
4028
- } // index is -1 if the first keydown is an ArrowUp
4029
-
4030
-
4031
- index = index === -1 ? 0 : index;
4032
- items[index].focus();
4022
+ getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
4033
4023
  } // Static
4034
4024
 
4035
4025
 
4036
- static dropdownInterface(element, config) {
4037
- let data = Data.get(element, DATA_KEY$7);
4038
-
4039
- const _config = typeof config === 'object' ? config : null;
4026
+ static jQueryInterface(config) {
4027
+ return this.each(function () {
4028
+ const data = Dropdown.getOrCreateInstance(this, config);
4040
4029
 
4041
- if (!data) {
4042
- data = new Dropdown(element, _config);
4043
- }
4030
+ if (typeof config !== 'string') {
4031
+ return;
4032
+ }
4044
4033
 
4045
- if (typeof config === 'string') {
4046
4034
  if (typeof data[config] === 'undefined') {
4047
4035
  throw new TypeError(`No method named "${config}"`);
4048
- }
4049
-
4050
- data[config]();
4051
- }
4052
- }
4036
+ }
4053
4037
 
4054
- static jQueryInterface(config) {
4055
- return this.each(function () {
4056
- Dropdown.dropdownInterface(this, config);
4038
+ data[config]();
4057
4039
  });
4058
4040
  }
4059
4041
 
4060
4042
  static clearMenus(event) {
4061
- if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
4043
+ if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
4062
4044
  return;
4063
4045
  }
4064
4046
 
4065
4047
  const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);
4066
4048
 
4067
4049
  for (let i = 0, len = toggles.length; i < len; i++) {
4068
- const context = Data.get(toggles[i], DATA_KEY$7);
4050
+ const context = Dropdown.getInstance(toggles[i]);
4069
4051
 
4070
4052
  if (!context || context._config.autoClose === false) {
4071
4053
  continue;
4072
4054
  }
4073
4055
 
4074
- if (!context._element.classList.contains(CLASS_NAME_SHOW$7)) {
4056
+ if (!context._isShown()) {
4075
4057
  continue;
4076
4058
  }
4077
4059
 
@@ -4088,7 +4070,7 @@
4088
4070
  } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
4089
4071
 
4090
4072
 
4091
- if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
4073
+ if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
4092
4074
  continue;
4093
4075
  }
4094
4076
 
@@ -4117,7 +4099,7 @@
4117
4099
  return;
4118
4100
  }
4119
4101
 
4120
- const isActive = this.classList.contains(CLASS_NAME_SHOW$7);
4102
+ const isActive = this.classList.contains(CLASS_NAME_SHOW$6);
4121
4103
 
4122
4104
  if (!isActive && event.key === ESCAPE_KEY$2) {
4123
4105
  return;
@@ -4130,25 +4112,27 @@
4130
4112
  return;
4131
4113
  }
4132
4114
 
4133
- const getToggleButton = () => this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
4115
+ const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
4116
+ const instance = Dropdown.getOrCreateInstance(getToggleButton);
4134
4117
 
4135
4118
  if (event.key === ESCAPE_KEY$2) {
4136
- getToggleButton().focus();
4137
- Dropdown.clearMenus();
4119
+ instance.hide();
4138
4120
  return;
4139
4121
  }
4140
4122
 
4141
- if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
4142
- getToggleButton().click();
4123
+ if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
4124
+ if (!isActive) {
4125
+ instance.show();
4126
+ }
4127
+
4128
+ instance._selectMenuItem(event);
4129
+
4143
4130
  return;
4144
4131
  }
4145
4132
 
4146
4133
  if (!isActive || event.key === SPACE_KEY) {
4147
4134
  Dropdown.clearMenus();
4148
- return;
4149
4135
  }
4150
-
4151
- Dropdown.getInstance(getToggleButton())._selectMenuItem(event);
4152
4136
  }
4153
4137
 
4154
4138
  }
@@ -4165,7 +4149,7 @@
4165
4149
  EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
4166
4150
  EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {
4167
4151
  event.preventDefault();
4168
- Dropdown.dropdownInterface(this);
4152
+ Dropdown.getOrCreateInstance(this).toggle();
4169
4153
  });
4170
4154
  /**
4171
4155
  * ------------------------------------------------------------------------
@@ -4178,103 +4162,134 @@
4178
4162
 
4179
4163
  /**
4180
4164
  * --------------------------------------------------------------------------
4181
- * Bootstrap (v5.0.1): util/scrollBar.js
4165
+ * Bootstrap (v5.1.0): util/scrollBar.js
4182
4166
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4183
4167
  * --------------------------------------------------------------------------
4184
4168
  */
4185
4169
  const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
4186
4170
  const SELECTOR_STICKY_CONTENT = '.sticky-top';
4187
4171
 
4188
- const getWidth = () => {
4189
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
4190
- const documentWidth = document.documentElement.clientWidth;
4191
- return Math.abs(window.innerWidth - documentWidth);
4192
- };
4172
+ class ScrollBarHelper {
4173
+ constructor() {
4174
+ this._element = document.body;
4175
+ }
4193
4176
 
4194
- const hide = (width = getWidth()) => {
4195
- _disableOverFlow(); // give padding to element to balances the hidden scrollbar width
4177
+ getWidth() {
4178
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
4179
+ const documentWidth = document.documentElement.clientWidth;
4180
+ return Math.abs(window.innerWidth - documentWidth);
4181
+ }
4196
4182
 
4183
+ hide() {
4184
+ const width = this.getWidth();
4197
4185
 
4198
- _setElementAttributes('body', 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements, to keep shown fullwidth
4186
+ this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width
4199
4187
 
4200
4188
 
4201
- _setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
4189
+ this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
4202
4190
 
4203
- _setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
4204
- };
4205
4191
 
4206
- const _disableOverFlow = () => {
4207
- const actualValue = document.body.style.overflow;
4192
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
4208
4193
 
4209
- if (actualValue) {
4210
- Manipulator.setDataAttribute(document.body, 'overflow', actualValue);
4194
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
4211
4195
  }
4212
4196
 
4213
- document.body.style.overflow = 'hidden';
4214
- };
4197
+ _disableOverFlow() {
4198
+ this._saveInitialAttribute(this._element, 'overflow');
4215
4199
 
4216
- const _setElementAttributes = (selector, styleProp, callback) => {
4217
- const scrollbarWidth = getWidth();
4218
- SelectorEngine.find(selector).forEach(element => {
4219
- if (element !== document.body && window.innerWidth > element.clientWidth + scrollbarWidth) {
4220
- return;
4221
- }
4200
+ this._element.style.overflow = 'hidden';
4201
+ }
4222
4202
 
4223
- const actualValue = element.style[styleProp];
4224
- const calculatedValue = window.getComputedStyle(element)[styleProp];
4225
- Manipulator.setDataAttribute(element, styleProp, actualValue);
4226
- element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
4227
- });
4228
- };
4203
+ _setElementAttributes(selector, styleProp, callback) {
4204
+ const scrollbarWidth = this.getWidth();
4205
+
4206
+ const manipulationCallBack = element => {
4207
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
4208
+ return;
4209
+ }
4229
4210
 
4230
- const reset = () => {
4231
- _resetElementAttributes('body', 'overflow');
4211
+ this._saveInitialAttribute(element, styleProp);
4232
4212
 
4233
- _resetElementAttributes('body', 'paddingRight');
4213
+ const calculatedValue = window.getComputedStyle(element)[styleProp];
4214
+ element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
4215
+ };
4234
4216
 
4235
- _resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
4217
+ this._applyManipulationCallback(selector, manipulationCallBack);
4218
+ }
4236
4219
 
4237
- _resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
4238
- };
4220
+ reset() {
4221
+ this._resetElementAttributes(this._element, 'overflow');
4222
+
4223
+ this._resetElementAttributes(this._element, 'paddingRight');
4224
+
4225
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
4226
+
4227
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
4228
+ }
4239
4229
 
4240
- const _resetElementAttributes = (selector, styleProp) => {
4241
- SelectorEngine.find(selector).forEach(element => {
4242
- const value = Manipulator.getDataAttribute(element, styleProp);
4230
+ _saveInitialAttribute(element, styleProp) {
4231
+ const actualValue = element.style[styleProp];
4232
+
4233
+ if (actualValue) {
4234
+ Manipulator.setDataAttribute(element, styleProp, actualValue);
4235
+ }
4236
+ }
4237
+
4238
+ _resetElementAttributes(selector, styleProp) {
4239
+ const manipulationCallBack = element => {
4240
+ const value = Manipulator.getDataAttribute(element, styleProp);
4241
+
4242
+ if (typeof value === 'undefined') {
4243
+ element.style.removeProperty(styleProp);
4244
+ } else {
4245
+ Manipulator.removeDataAttribute(element, styleProp);
4246
+ element.style[styleProp] = value;
4247
+ }
4248
+ };
4249
+
4250
+ this._applyManipulationCallback(selector, manipulationCallBack);
4251
+ }
4243
4252
 
4244
- if (typeof value === 'undefined') {
4245
- element.style.removeProperty(styleProp);
4253
+ _applyManipulationCallback(selector, callBack) {
4254
+ if (isElement$1(selector)) {
4255
+ callBack(selector);
4246
4256
  } else {
4247
- Manipulator.removeDataAttribute(element, styleProp);
4248
- element.style[styleProp] = value;
4257
+ SelectorEngine.find(selector, this._element).forEach(callBack);
4249
4258
  }
4250
- });
4251
- };
4259
+ }
4260
+
4261
+ isOverflowing() {
4262
+ return this.getWidth() > 0;
4263
+ }
4264
+
4265
+ }
4252
4266
 
4253
4267
  /**
4254
4268
  * --------------------------------------------------------------------------
4255
- * Bootstrap (v5.0.1): util/backdrop.js
4269
+ * Bootstrap (v5.1.0): util/backdrop.js
4256
4270
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4257
4271
  * --------------------------------------------------------------------------
4258
4272
  */
4259
- const Default$6 = {
4273
+ const Default$7 = {
4274
+ className: 'modal-backdrop',
4260
4275
  isVisible: true,
4261
4276
  // if false, we use the backdrop helper without adding any element to the dom
4262
4277
  isAnimated: false,
4263
- rootElement: document.body,
4278
+ rootElement: 'body',
4264
4279
  // give the choice to place backdrop under different elements
4265
4280
  clickCallback: null
4266
4281
  };
4267
- const DefaultType$6 = {
4282
+ const DefaultType$7 = {
4283
+ className: 'string',
4268
4284
  isVisible: 'boolean',
4269
4285
  isAnimated: 'boolean',
4270
- rootElement: 'element',
4286
+ rootElement: '(element|string)',
4271
4287
  clickCallback: '(function|null)'
4272
4288
  };
4273
- const NAME$7 = 'backdrop';
4274
- const CLASS_NAME_BACKDROP = 'modal-backdrop';
4275
- const CLASS_NAME_FADE$5 = 'fade';
4276
- const CLASS_NAME_SHOW$6 = 'show';
4277
- const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`;
4289
+ const NAME$8 = 'backdrop';
4290
+ const CLASS_NAME_FADE$4 = 'fade';
4291
+ const CLASS_NAME_SHOW$5 = 'show';
4292
+ const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;
4278
4293
 
4279
4294
  class Backdrop {
4280
4295
  constructor(config) {
@@ -4295,7 +4310,7 @@
4295
4310
  reflow(this._getElement());
4296
4311
  }
4297
4312
 
4298
- this._getElement().classList.add(CLASS_NAME_SHOW$6);
4313
+ this._getElement().classList.add(CLASS_NAME_SHOW$5);
4299
4314
 
4300
4315
  this._emulateAnimation(() => {
4301
4316
  execute(callback);
@@ -4308,7 +4323,7 @@
4308
4323
  return;
4309
4324
  }
4310
4325
 
4311
- this._getElement().classList.remove(CLASS_NAME_SHOW$6);
4326
+ this._getElement().classList.remove(CLASS_NAME_SHOW$5);
4312
4327
 
4313
4328
  this._emulateAnimation(() => {
4314
4329
  this.dispose();
@@ -4320,10 +4335,10 @@
4320
4335
  _getElement() {
4321
4336
  if (!this._element) {
4322
4337
  const backdrop = document.createElement('div');
4323
- backdrop.className = CLASS_NAME_BACKDROP;
4338
+ backdrop.className = this._config.className;
4324
4339
 
4325
4340
  if (this._config.isAnimated) {
4326
- backdrop.classList.add(CLASS_NAME_FADE$5);
4341
+ backdrop.classList.add(CLASS_NAME_FADE$4);
4327
4342
  }
4328
4343
 
4329
4344
  this._element = backdrop;
@@ -4333,11 +4348,12 @@
4333
4348
  }
4334
4349
 
4335
4350
  _getConfig(config) {
4336
- config = { ...Default$6,
4351
+ config = { ...Default$7,
4337
4352
  ...(typeof config === 'object' ? config : {})
4338
- };
4339
- config.rootElement = config.rootElement || document.body;
4340
- typeCheckConfig(NAME$7, config, DefaultType$6);
4353
+ }; // use getElement() with the default "body" to get a fresh Element on each instantiation
4354
+
4355
+ config.rootElement = getElement(config.rootElement);
4356
+ typeCheckConfig(NAME$8, config, DefaultType$7);
4341
4357
  return config;
4342
4358
  }
4343
4359
 
@@ -4346,7 +4362,7 @@
4346
4362
  return;
4347
4363
  }
4348
4364
 
4349
- this._config.rootElement.appendChild(this._getElement());
4365
+ this._config.rootElement.append(this._getElement());
4350
4366
 
4351
4367
  EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
4352
4368
  execute(this._config.clickCallback);
@@ -4361,27 +4377,123 @@
4361
4377
 
4362
4378
  EventHandler.off(this._element, EVENT_MOUSEDOWN);
4363
4379
 
4364
- this._getElement().parentNode.removeChild(this._element);
4380
+ this._element.remove();
4365
4381
 
4366
4382
  this._isAppended = false;
4367
4383
  }
4368
4384
 
4369
4385
  _emulateAnimation(callback) {
4370
- if (!this._config.isAnimated) {
4371
- execute(callback);
4386
+ executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
4387
+ }
4388
+
4389
+ }
4390
+
4391
+ /**
4392
+ * --------------------------------------------------------------------------
4393
+ * Bootstrap (v5.1.0): util/focustrap.js
4394
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4395
+ * --------------------------------------------------------------------------
4396
+ */
4397
+ const Default$6 = {
4398
+ trapElement: null,
4399
+ // The element to trap focus inside of
4400
+ autofocus: true
4401
+ };
4402
+ const DefaultType$6 = {
4403
+ trapElement: 'element',
4404
+ autofocus: 'boolean'
4405
+ };
4406
+ const NAME$7 = 'focustrap';
4407
+ const DATA_KEY$7 = 'bs.focustrap';
4408
+ const EVENT_KEY$7 = `.${DATA_KEY$7}`;
4409
+ const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;
4410
+ const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;
4411
+ const TAB_KEY = 'Tab';
4412
+ const TAB_NAV_FORWARD = 'forward';
4413
+ const TAB_NAV_BACKWARD = 'backward';
4414
+
4415
+ class FocusTrap {
4416
+ constructor(config) {
4417
+ this._config = this._getConfig(config);
4418
+ this._isActive = false;
4419
+ this._lastTabNavDirection = null;
4420
+ }
4421
+
4422
+ activate() {
4423
+ const {
4424
+ trapElement,
4425
+ autofocus
4426
+ } = this._config;
4427
+
4428
+ if (this._isActive) {
4429
+ return;
4430
+ }
4431
+
4432
+ if (autofocus) {
4433
+ trapElement.focus();
4434
+ }
4435
+
4436
+ EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop
4437
+
4438
+ EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
4439
+ EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
4440
+ this._isActive = true;
4441
+ }
4442
+
4443
+ deactivate() {
4444
+ if (!this._isActive) {
4445
+ return;
4446
+ }
4447
+
4448
+ this._isActive = false;
4449
+ EventHandler.off(document, EVENT_KEY$7);
4450
+ } // Private
4451
+
4452
+
4453
+ _handleFocusin(event) {
4454
+ const {
4455
+ target
4456
+ } = event;
4457
+ const {
4458
+ trapElement
4459
+ } = this._config;
4460
+
4461
+ if (target === document || target === trapElement || trapElement.contains(target)) {
4462
+ return;
4463
+ }
4464
+
4465
+ const elements = SelectorEngine.focusableChildren(trapElement);
4466
+
4467
+ if (elements.length === 0) {
4468
+ trapElement.focus();
4469
+ } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
4470
+ elements[elements.length - 1].focus();
4471
+ } else {
4472
+ elements[0].focus();
4473
+ }
4474
+ }
4475
+
4476
+ _handleKeydown(event) {
4477
+ if (event.key !== TAB_KEY) {
4372
4478
  return;
4373
4479
  }
4374
4480
 
4375
- const backdropTransitionDuration = getTransitionDurationFromElement(this._getElement());
4376
- EventHandler.one(this._getElement(), 'transitionend', () => execute(callback));
4377
- emulateTransitionEnd(this._getElement(), backdropTransitionDuration);
4481
+ this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
4482
+ }
4483
+
4484
+ _getConfig(config) {
4485
+ config = { ...Default$6,
4486
+ ...(typeof config === 'object' ? config : {})
4487
+ };
4488
+ typeCheckConfig(NAME$7, config, DefaultType$6);
4489
+ return config;
4378
4490
  }
4379
4491
 
4380
4492
  }
4381
4493
 
4382
4494
  /**
4383
4495
  * --------------------------------------------------------------------------
4384
- * Bootstrap (v5.0.1): modal.js
4496
+ * Bootstrap (v5.1.0): modal.js
4385
4497
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4386
4498
  * --------------------------------------------------------------------------
4387
4499
  */
@@ -4411,21 +4523,19 @@
4411
4523
  const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
4412
4524
  const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
4413
4525
  const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
4414
- const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
4415
4526
  const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
4416
- const EVENT_CLICK_DISMISS$2 = `click.dismiss${EVENT_KEY$6}`;
4527
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;
4417
4528
  const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
4418
4529
  const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
4419
4530
  const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
4420
4531
  const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
4421
4532
  const CLASS_NAME_OPEN = 'modal-open';
4422
- const CLASS_NAME_FADE$4 = 'fade';
4423
- const CLASS_NAME_SHOW$5 = 'show';
4533
+ const CLASS_NAME_FADE$3 = 'fade';
4534
+ const CLASS_NAME_SHOW$4 = 'show';
4424
4535
  const CLASS_NAME_STATIC = 'modal-static';
4425
4536
  const SELECTOR_DIALOG = '.modal-dialog';
4426
4537
  const SELECTOR_MODAL_BODY = '.modal-body';
4427
4538
  const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
4428
- const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]';
4429
4539
  /**
4430
4540
  * ------------------------------------------------------------------------
4431
4541
  * Class Definition
@@ -4438,9 +4548,11 @@
4438
4548
  this._config = this._getConfig(config);
4439
4549
  this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
4440
4550
  this._backdrop = this._initializeBackDrop();
4551
+ this._focustrap = this._initializeFocusTrap();
4441
4552
  this._isShown = false;
4442
4553
  this._ignoreBackdropClick = false;
4443
4554
  this._isTransitioning = false;
4555
+ this._scrollBar = new ScrollBarHelper();
4444
4556
  } // Getters
4445
4557
 
4446
4558
 
@@ -4462,20 +4574,22 @@
4462
4574
  return;
4463
4575
  }
4464
4576
 
4465
- if (this._isAnimated()) {
4466
- this._isTransitioning = true;
4467
- }
4468
-
4469
4577
  const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
4470
4578
  relatedTarget
4471
4579
  });
4472
4580
 
4473
- if (this._isShown || showEvent.defaultPrevented) {
4581
+ if (showEvent.defaultPrevented) {
4474
4582
  return;
4475
4583
  }
4476
4584
 
4477
4585
  this._isShown = true;
4478
- hide();
4586
+
4587
+ if (this._isAnimated()) {
4588
+ this._isTransitioning = true;
4589
+ }
4590
+
4591
+ this._scrollBar.hide();
4592
+
4479
4593
  document.body.classList.add(CLASS_NAME_OPEN);
4480
4594
 
4481
4595
  this._adjustDialog();
@@ -4484,7 +4598,6 @@
4484
4598
 
4485
4599
  this._setResizeEvent();
4486
4600
 
4487
- EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
4488
4601
  EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
4489
4602
  EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
4490
4603
  if (event.target === this._element) {
@@ -4496,11 +4609,7 @@
4496
4609
  this._showBackdrop(() => this._showElement(relatedTarget));
4497
4610
  }
4498
4611
 
4499
- hide(event) {
4500
- if (event) {
4501
- event.preventDefault();
4502
- }
4503
-
4612
+ hide() {
4504
4613
  if (!this._isShown || this._isTransitioning) {
4505
4614
  return;
4506
4615
  }
@@ -4523,11 +4632,11 @@
4523
4632
 
4524
4633
  this._setResizeEvent();
4525
4634
 
4526
- EventHandler.off(document, EVENT_FOCUSIN$2);
4635
+ this._focustrap.deactivate();
4527
4636
 
4528
- this._element.classList.remove(CLASS_NAME_SHOW$5);
4637
+ this._element.classList.remove(CLASS_NAME_SHOW$4);
4529
4638
 
4530
- EventHandler.off(this._element, EVENT_CLICK_DISMISS$2);
4639
+ EventHandler.off(this._element, EVENT_CLICK_DISMISS);
4531
4640
  EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
4532
4641
 
4533
4642
  this._queueCallback(() => this._hideModal(), this._element, isAnimated);
@@ -4538,14 +4647,9 @@
4538
4647
 
4539
4648
  this._backdrop.dispose();
4540
4649
 
4541
- super.dispose();
4542
- /**
4543
- * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
4544
- * Do not move `document` in `htmlElements` array
4545
- * It will remove `EVENT_CLICK_DATA_API` event that should remain
4546
- */
4650
+ this._focustrap.deactivate();
4547
4651
 
4548
- EventHandler.off(document, EVENT_FOCUSIN$2);
4652
+ super.dispose();
4549
4653
  }
4550
4654
 
4551
4655
  handleUpdate() {
@@ -4561,10 +4665,16 @@
4561
4665
  });
4562
4666
  }
4563
4667
 
4668
+ _initializeFocusTrap() {
4669
+ return new FocusTrap({
4670
+ trapElement: this._element
4671
+ });
4672
+ }
4673
+
4564
4674
  _getConfig(config) {
4565
4675
  config = { ...Default$5,
4566
4676
  ...Manipulator.getDataAttributes(this._element),
4567
- ...config
4677
+ ...(typeof config === 'object' ? config : {})
4568
4678
  };
4569
4679
  typeCheckConfig(NAME$6, config, DefaultType$5);
4570
4680
  return config;
@@ -4577,7 +4687,7 @@
4577
4687
 
4578
4688
  if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
4579
4689
  // Don't move modal's DOM position
4580
- document.body.appendChild(this._element);
4690
+ document.body.append(this._element);
4581
4691
  }
4582
4692
 
4583
4693
  this._element.style.display = 'block';
@@ -4598,15 +4708,11 @@
4598
4708
  reflow(this._element);
4599
4709
  }
4600
4710
 
4601
- this._element.classList.add(CLASS_NAME_SHOW$5);
4602
-
4603
- if (this._config.focus) {
4604
- this._enforceFocus();
4605
- }
4711
+ this._element.classList.add(CLASS_NAME_SHOW$4);
4606
4712
 
4607
4713
  const transitionComplete = () => {
4608
4714
  if (this._config.focus) {
4609
- this._element.focus();
4715
+ this._focustrap.activate();
4610
4716
  }
4611
4717
 
4612
4718
  this._isTransitioning = false;
@@ -4618,16 +4724,6 @@
4618
4724
  this._queueCallback(transitionComplete, this._dialog, isAnimated);
4619
4725
  }
4620
4726
 
4621
- _enforceFocus() {
4622
- EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
4623
-
4624
- EventHandler.on(document, EVENT_FOCUSIN$2, event => {
4625
- if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
4626
- this._element.focus();
4627
- }
4628
- });
4629
- }
4630
-
4631
4727
  _setEscapeEvent() {
4632
4728
  if (this._isShown) {
4633
4729
  EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
@@ -4667,13 +4763,14 @@
4667
4763
 
4668
4764
  this._resetAdjustments();
4669
4765
 
4670
- reset();
4766
+ this._scrollBar.reset();
4767
+
4671
4768
  EventHandler.trigger(this._element, EVENT_HIDDEN$3);
4672
4769
  });
4673
4770
  }
4674
4771
 
4675
4772
  _showBackdrop(callback) {
4676
- EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, event => {
4773
+ EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
4677
4774
  if (this._ignoreBackdropClick) {
4678
4775
  this._ignoreBackdropClick = false;
4679
4776
  return;
@@ -4694,7 +4791,7 @@
4694
4791
  }
4695
4792
 
4696
4793
  _isAnimated() {
4697
- return this._element.classList.contains(CLASS_NAME_FADE$4);
4794
+ return this._element.classList.contains(CLASS_NAME_FADE$3);
4698
4795
  }
4699
4796
 
4700
4797
  _triggerBackdropTransition() {
@@ -4704,27 +4801,32 @@
4704
4801
  return;
4705
4802
  }
4706
4803
 
4707
- const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4804
+ const {
4805
+ classList,
4806
+ scrollHeight,
4807
+ style
4808
+ } = this._element;
4809
+ const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed
4810
+
4811
+ if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {
4812
+ return;
4813
+ }
4708
4814
 
4709
4815
  if (!isModalOverflowing) {
4710
- this._element.style.overflowY = 'hidden';
4816
+ style.overflowY = 'hidden';
4711
4817
  }
4712
4818
 
4713
- this._element.classList.add(CLASS_NAME_STATIC);
4819
+ classList.add(CLASS_NAME_STATIC);
4714
4820
 
4715
- const modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
4716
- EventHandler.off(this._element, 'transitionend');
4717
- EventHandler.one(this._element, 'transitionend', () => {
4718
- this._element.classList.remove(CLASS_NAME_STATIC);
4821
+ this._queueCallback(() => {
4822
+ classList.remove(CLASS_NAME_STATIC);
4719
4823
 
4720
4824
  if (!isModalOverflowing) {
4721
- EventHandler.one(this._element, 'transitionend', () => {
4722
- this._element.style.overflowY = '';
4723
- });
4724
- emulateTransitionEnd(this._element, modalTransitionDuration);
4825
+ this._queueCallback(() => {
4826
+ style.overflowY = '';
4827
+ }, this._dialog);
4725
4828
  }
4726
- });
4727
- emulateTransitionEnd(this._element, modalTransitionDuration);
4829
+ }, this._dialog);
4728
4830
 
4729
4831
  this._element.focus();
4730
4832
  } // ----------------------------------------------------------------------
@@ -4734,7 +4836,9 @@
4734
4836
 
4735
4837
  _adjustDialog() {
4736
4838
  const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4737
- const scrollbarWidth = getWidth();
4839
+
4840
+ const scrollbarWidth = this._scrollBar.getWidth();
4841
+
4738
4842
  const isBodyOverflowing = scrollbarWidth > 0;
4739
4843
 
4740
4844
  if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
@@ -4754,7 +4858,7 @@
4754
4858
 
4755
4859
  static jQueryInterface(config, relatedTarget) {
4756
4860
  return this.each(function () {
4757
- const data = Modal.getInstance(this) || new Modal(this, typeof config === 'object' ? config : {});
4861
+ const data = Modal.getOrCreateInstance(this, config);
4758
4862
 
4759
4863
  if (typeof config !== 'string') {
4760
4864
  return;
@@ -4795,9 +4899,10 @@
4795
4899
  }
4796
4900
  });
4797
4901
  });
4798
- const data = Modal.getInstance(target) || new Modal(target);
4902
+ const data = Modal.getOrCreateInstance(target);
4799
4903
  data.toggle(this);
4800
4904
  });
4905
+ enableDismissTrigger(Modal);
4801
4906
  /**
4802
4907
  * ------------------------------------------------------------------------
4803
4908
  * jQuery
@@ -4809,7 +4914,7 @@
4809
4914
 
4810
4915
  /**
4811
4916
  * --------------------------------------------------------------------------
4812
- * Bootstrap (v5.0.1): offcanvas.js
4917
+ * Bootstrap (v5.1.0): offcanvas.js
4813
4918
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4814
4919
  * --------------------------------------------------------------------------
4815
4920
  */
@@ -4835,17 +4940,15 @@
4835
4940
  keyboard: 'boolean',
4836
4941
  scroll: 'boolean'
4837
4942
  };
4838
- const CLASS_NAME_SHOW$4 = 'show';
4943
+ const CLASS_NAME_SHOW$3 = 'show';
4944
+ const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
4839
4945
  const OPEN_SELECTOR = '.offcanvas.show';
4840
4946
  const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
4841
4947
  const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
4842
4948
  const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
4843
4949
  const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
4844
- const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`;
4845
4950
  const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
4846
- const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
4847
4951
  const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
4848
- const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]';
4849
4952
  const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
4850
4953
  /**
4851
4954
  * ------------------------------------------------------------------------
@@ -4859,6 +4962,7 @@
4859
4962
  this._config = this._getConfig(config);
4860
4963
  this._isShown = false;
4861
4964
  this._backdrop = this._initializeBackDrop();
4965
+ this._focustrap = this._initializeFocusTrap();
4862
4966
 
4863
4967
  this._addEventListeners();
4864
4968
  } // Getters
@@ -4896,9 +5000,7 @@
4896
5000
  this._backdrop.show();
4897
5001
 
4898
5002
  if (!this._config.scroll) {
4899
- hide();
4900
-
4901
- this._enforceFocusOnElement(this._element);
5003
+ new ScrollBarHelper().hide();
4902
5004
  }
4903
5005
 
4904
5006
  this._element.removeAttribute('aria-hidden');
@@ -4907,9 +5009,13 @@
4907
5009
 
4908
5010
  this._element.setAttribute('role', 'dialog');
4909
5011
 
4910
- this._element.classList.add(CLASS_NAME_SHOW$4);
5012
+ this._element.classList.add(CLASS_NAME_SHOW$3);
4911
5013
 
4912
5014
  const completeCallBack = () => {
5015
+ if (!this._config.scroll) {
5016
+ this._focustrap.activate();
5017
+ }
5018
+
4913
5019
  EventHandler.trigger(this._element, EVENT_SHOWN$2, {
4914
5020
  relatedTarget
4915
5021
  });
@@ -4929,13 +5035,13 @@
4929
5035
  return;
4930
5036
  }
4931
5037
 
4932
- EventHandler.off(document, EVENT_FOCUSIN$1);
5038
+ this._focustrap.deactivate();
4933
5039
 
4934
5040
  this._element.blur();
4935
5041
 
4936
5042
  this._isShown = false;
4937
5043
 
4938
- this._element.classList.remove(CLASS_NAME_SHOW$4);
5044
+ this._element.classList.remove(CLASS_NAME_SHOW$3);
4939
5045
 
4940
5046
  this._backdrop.hide();
4941
5047
 
@@ -4949,7 +5055,7 @@
4949
5055
  this._element.style.visibility = 'hidden';
4950
5056
 
4951
5057
  if (!this._config.scroll) {
4952
- reset();
5058
+ new ScrollBarHelper().reset();
4953
5059
  }
4954
5060
 
4955
5061
  EventHandler.trigger(this._element, EVENT_HIDDEN$2);
@@ -4961,8 +5067,9 @@
4961
5067
  dispose() {
4962
5068
  this._backdrop.dispose();
4963
5069
 
5070
+ this._focustrap.deactivate();
5071
+
4964
5072
  super.dispose();
4965
- EventHandler.off(document, EVENT_FOCUSIN$1);
4966
5073
  } // Private
4967
5074
 
4968
5075
 
@@ -4977,6 +5084,7 @@
4977
5084
 
4978
5085
  _initializeBackDrop() {
4979
5086
  return new Backdrop({
5087
+ className: CLASS_NAME_BACKDROP,
4980
5088
  isVisible: this._config.backdrop,
4981
5089
  isAnimated: true,
4982
5090
  rootElement: this._element.parentNode,
@@ -4984,19 +5092,13 @@
4984
5092
  });
4985
5093
  }
4986
5094
 
4987
- _enforceFocusOnElement(element) {
4988
- EventHandler.off(document, EVENT_FOCUSIN$1); // guard against infinite focus loop
4989
-
4990
- EventHandler.on(document, EVENT_FOCUSIN$1, event => {
4991
- if (document !== event.target && element !== event.target && !element.contains(event.target)) {
4992
- element.focus();
4993
- }
5095
+ _initializeFocusTrap() {
5096
+ return new FocusTrap({
5097
+ trapElement: this._element
4994
5098
  });
4995
- element.focus();
4996
5099
  }
4997
5100
 
4998
5101
  _addEventListeners() {
4999
- EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
5000
5102
  EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
5001
5103
  if (this._config.keyboard && event.key === ESCAPE_KEY) {
5002
5104
  this.hide();
@@ -5007,7 +5109,7 @@
5007
5109
 
5008
5110
  static jQueryInterface(config) {
5009
5111
  return this.each(function () {
5010
- const data = Data.get(this, DATA_KEY$5) || new Offcanvas(this, typeof config === 'object' ? config : {});
5112
+ const data = Offcanvas.getOrCreateInstance(this, config);
5011
5113
 
5012
5114
  if (typeof config !== 'string') {
5013
5115
  return;
@@ -5053,12 +5155,11 @@
5053
5155
  Offcanvas.getInstance(allReadyOpen).hide();
5054
5156
  }
5055
5157
 
5056
- const data = Data.get(target, DATA_KEY$5) || new Offcanvas(target);
5158
+ const data = Offcanvas.getOrCreateInstance(target);
5057
5159
  data.toggle(this);
5058
5160
  });
5059
- EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {
5060
- SelectorEngine.find(OPEN_SELECTOR).forEach(el => (Data.get(el, DATA_KEY$5) || new Offcanvas(el)).show());
5061
- });
5161
+ EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
5162
+ enableDismissTrigger(Offcanvas);
5062
5163
  /**
5063
5164
  * ------------------------------------------------------------------------
5064
5165
  * jQuery
@@ -5069,7 +5170,7 @@
5069
5170
 
5070
5171
  /**
5071
5172
  * --------------------------------------------------------------------------
5072
- * Bootstrap (v5.0.1): util/sanitizer.js
5173
+ * Bootstrap (v5.1.0): util/sanitizer.js
5073
5174
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5074
5175
  * --------------------------------------------------------------------------
5075
5176
  */
@@ -5164,7 +5265,7 @@
5164
5265
  const elName = el.nodeName.toLowerCase();
5165
5266
 
5166
5267
  if (!allowlistKeys.includes(elName)) {
5167
- el.parentNode.removeChild(el);
5268
+ el.remove();
5168
5269
  continue;
5169
5270
  }
5170
5271
 
@@ -5182,7 +5283,7 @@
5182
5283
 
5183
5284
  /**
5184
5285
  * --------------------------------------------------------------------------
5185
- * Bootstrap (v5.0.1): tooltip.js
5286
+ * Bootstrap (v5.1.0): tooltip.js
5186
5287
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5187
5288
  * --------------------------------------------------------------------------
5188
5289
  */
@@ -5196,7 +5297,6 @@
5196
5297
  const DATA_KEY$4 = 'bs.tooltip';
5197
5298
  const EVENT_KEY$4 = `.${DATA_KEY$4}`;
5198
5299
  const CLASS_PREFIX$1 = 'bs-tooltip';
5199
- const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
5200
5300
  const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
5201
5301
  const DefaultType$3 = {
5202
5302
  animation: 'boolean',
@@ -5255,12 +5355,14 @@
5255
5355
  MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
5256
5356
  MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
5257
5357
  };
5258
- const CLASS_NAME_FADE$3 = 'fade';
5358
+ const CLASS_NAME_FADE$2 = 'fade';
5259
5359
  const CLASS_NAME_MODAL = 'modal';
5260
- const CLASS_NAME_SHOW$3 = 'show';
5360
+ const CLASS_NAME_SHOW$2 = 'show';
5261
5361
  const HOVER_STATE_SHOW = 'show';
5262
5362
  const HOVER_STATE_OUT = 'out';
5263
5363
  const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
5364
+ const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
5365
+ const EVENT_MODAL_HIDE = 'hide.bs.modal';
5264
5366
  const TRIGGER_HOVER = 'hover';
5265
5367
  const TRIGGER_FOCUS = 'focus';
5266
5368
  const TRIGGER_CLICK = 'click';
@@ -5337,7 +5439,7 @@
5337
5439
  context._leave(null, context);
5338
5440
  }
5339
5441
  } else {
5340
- if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
5442
+ if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {
5341
5443
  this._leave(null, this);
5342
5444
 
5343
5445
  return;
@@ -5349,10 +5451,10 @@
5349
5451
 
5350
5452
  dispose() {
5351
5453
  clearTimeout(this._timeout);
5352
- EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
5454
+ EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
5353
5455
 
5354
- if (this.tip && this.tip.parentNode) {
5355
- this.tip.parentNode.removeChild(this.tip);
5456
+ if (this.tip) {
5457
+ this.tip.remove();
5356
5458
  }
5357
5459
 
5358
5460
  if (this._popper) {
@@ -5385,10 +5487,8 @@
5385
5487
 
5386
5488
  this._element.setAttribute('aria-describedby', tipId);
5387
5489
 
5388
- this.setContent();
5389
-
5390
5490
  if (this._config.animation) {
5391
- tip.classList.add(CLASS_NAME_FADE$3);
5491
+ tip.classList.add(CLASS_NAME_FADE$2);
5392
5492
  }
5393
5493
 
5394
5494
  const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
@@ -5403,7 +5503,7 @@
5403
5503
  Data.set(tip, this.constructor.DATA_KEY, this);
5404
5504
 
5405
5505
  if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
5406
- container.appendChild(tip);
5506
+ container.append(tip);
5407
5507
  EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
5408
5508
  }
5409
5509
 
@@ -5413,8 +5513,9 @@
5413
5513
  this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
5414
5514
  }
5415
5515
 
5416
- tip.classList.add(CLASS_NAME_SHOW$3);
5417
- const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
5516
+ tip.classList.add(CLASS_NAME_SHOW$2);
5517
+
5518
+ const customClass = this._resolvePossibleFunction(this._config.customClass);
5418
5519
 
5419
5520
  if (customClass) {
5420
5521
  tip.classList.add(...customClass.split(' '));
@@ -5440,7 +5541,7 @@
5440
5541
  }
5441
5542
  };
5442
5543
 
5443
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
5544
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
5444
5545
 
5445
5546
  this._queueCallback(complete, this.tip, isAnimated);
5446
5547
  }
@@ -5457,8 +5558,8 @@
5457
5558
  return;
5458
5559
  }
5459
5560
 
5460
- if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
5461
- tip.parentNode.removeChild(tip);
5561
+ if (this._hoverState !== HOVER_STATE_SHOW) {
5562
+ tip.remove();
5462
5563
  }
5463
5564
 
5464
5565
  this._cleanTipClass();
@@ -5480,7 +5581,7 @@
5480
5581
  return;
5481
5582
  }
5482
5583
 
5483
- tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
5584
+ tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra
5484
5585
  // empty mouseover listeners we added for iOS support
5485
5586
 
5486
5587
  if ('ontouchstart' in document.documentElement) {
@@ -5490,7 +5591,7 @@
5490
5591
  this._activeTrigger[TRIGGER_CLICK] = false;
5491
5592
  this._activeTrigger[TRIGGER_FOCUS] = false;
5492
5593
  this._activeTrigger[TRIGGER_HOVER] = false;
5493
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
5594
+ const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
5494
5595
 
5495
5596
  this._queueCallback(complete, this.tip, isAnimated);
5496
5597
 
@@ -5515,14 +5616,27 @@
5515
5616
 
5516
5617
  const element = document.createElement('div');
5517
5618
  element.innerHTML = this._config.template;
5518
- this.tip = element.children[0];
5619
+ const tip = element.children[0];
5620
+ this.setContent(tip);
5621
+ tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
5622
+ this.tip = tip;
5519
5623
  return this.tip;
5520
5624
  }
5521
5625
 
5522
- setContent() {
5523
- const tip = this.getTipElement();
5524
- this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
5525
- tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
5626
+ setContent(tip) {
5627
+ this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
5628
+ }
5629
+
5630
+ _sanitizeAndSetContent(template, content, selector) {
5631
+ const templateElement = SelectorEngine.findOne(selector, template);
5632
+
5633
+ if (!content && templateElement) {
5634
+ templateElement.remove();
5635
+ return;
5636
+ } // we use append for html objects to maintain js events
5637
+
5638
+
5639
+ this.setElementContent(templateElement, content);
5526
5640
  }
5527
5641
 
5528
5642
  setElementContent(element, content) {
@@ -5536,7 +5650,7 @@
5536
5650
  if (this._config.html) {
5537
5651
  if (content.parentNode !== element) {
5538
5652
  element.innerHTML = '';
5539
- element.appendChild(content);
5653
+ element.append(content);
5540
5654
  }
5541
5655
  } else {
5542
5656
  element.textContent = content.textContent;
@@ -5557,13 +5671,9 @@
5557
5671
  }
5558
5672
 
5559
5673
  getTitle() {
5560
- let title = this._element.getAttribute('data-bs-original-title');
5561
-
5562
- if (!title) {
5563
- title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
5564
- }
5674
+ const title = this._element.getAttribute('data-bs-original-title') || this._config.title;
5565
5675
 
5566
- return title;
5676
+ return this._resolvePossibleFunction(title);
5567
5677
  }
5568
5678
 
5569
5679
  updateAttachment(attachment) {
@@ -5580,15 +5690,7 @@
5580
5690
 
5581
5691
 
5582
5692
  _initializeOnDelegatedTarget(event, context) {
5583
- const dataKey = this.constructor.DATA_KEY;
5584
- context = context || Data.get(event.delegateTarget, dataKey);
5585
-
5586
- if (!context) {
5587
- context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
5588
- Data.set(event.delegateTarget, dataKey, context);
5589
- }
5590
-
5591
- return context;
5693
+ return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
5592
5694
  }
5593
5695
 
5594
5696
  _getOffset() {
@@ -5607,6 +5709,10 @@
5607
5709
  return offset;
5608
5710
  }
5609
5711
 
5712
+ _resolvePossibleFunction(content) {
5713
+ return typeof content === 'function' ? content.call(this._element) : content;
5714
+ }
5715
+
5610
5716
  _getPopperConfig(attachment) {
5611
5717
  const defaultBsPopperConfig = {
5612
5718
  placement: attachment,
@@ -5648,7 +5754,7 @@
5648
5754
  }
5649
5755
 
5650
5756
  _addAttachmentClass(attachment) {
5651
- this.getTipElement().classList.add(`${CLASS_PREFIX$1}-${this.updateAttachment(attachment)}`);
5757
+ this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
5652
5758
  }
5653
5759
 
5654
5760
  _getAttachment(placement) {
@@ -5675,7 +5781,7 @@
5675
5781
  }
5676
5782
  };
5677
5783
 
5678
- EventHandler.on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
5784
+ EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
5679
5785
 
5680
5786
  if (this._config.selector) {
5681
5787
  this._config = { ...this._config,
@@ -5710,7 +5816,7 @@
5710
5816
  context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
5711
5817
  }
5712
5818
 
5713
- if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
5819
+ if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {
5714
5820
  context._hoverState = HOVER_STATE_SHOW;
5715
5821
  return;
5716
5822
  }
@@ -5806,26 +5912,32 @@
5806
5912
  _getDelegateConfig() {
5807
5913
  const config = {};
5808
5914
 
5809
- if (this._config) {
5810
- for (const key in this._config) {
5811
- if (this.constructor.Default[key] !== this._config[key]) {
5812
- config[key] = this._config[key];
5813
- }
5915
+ for (const key in this._config) {
5916
+ if (this.constructor.Default[key] !== this._config[key]) {
5917
+ config[key] = this._config[key];
5814
5918
  }
5815
- }
5919
+ } // In the future can be replaced with:
5920
+ // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
5921
+ // `Object.fromEntries(keysWithDifferentValues)`
5922
+
5816
5923
 
5817
5924
  return config;
5818
5925
  }
5819
5926
 
5820
5927
  _cleanTipClass() {
5821
5928
  const tip = this.getTipElement();
5822
- const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
5929
+ const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
5930
+ const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
5823
5931
 
5824
5932
  if (tabClass !== null && tabClass.length > 0) {
5825
5933
  tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
5826
5934
  }
5827
5935
  }
5828
5936
 
5937
+ _getBasicClassPrefix() {
5938
+ return CLASS_PREFIX$1;
5939
+ }
5940
+
5829
5941
  _handlePopperPlacementChange(popperData) {
5830
5942
  const {
5831
5943
  state
@@ -5845,17 +5957,7 @@
5845
5957
 
5846
5958
  static jQueryInterface(config) {
5847
5959
  return this.each(function () {
5848
- let data = Data.get(this, DATA_KEY$4);
5849
-
5850
- const _config = typeof config === 'object' && config;
5851
-
5852
- if (!data && /dispose|hide/.test(config)) {
5853
- return;
5854
- }
5855
-
5856
- if (!data) {
5857
- data = new Tooltip(this, _config);
5858
- }
5960
+ const data = Tooltip.getOrCreateInstance(this, config);
5859
5961
 
5860
5962
  if (typeof config === 'string') {
5861
5963
  if (typeof data[config] === 'undefined') {
@@ -5880,7 +5982,7 @@
5880
5982
 
5881
5983
  /**
5882
5984
  * --------------------------------------------------------------------------
5883
- * Bootstrap (v5.0.1): popover.js
5985
+ * Bootstrap (v5.1.0): popover.js
5884
5986
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5885
5987
  * --------------------------------------------------------------------------
5886
5988
  */
@@ -5894,7 +5996,6 @@
5894
5996
  const DATA_KEY$3 = 'bs.popover';
5895
5997
  const EVENT_KEY$3 = `.${DATA_KEY$3}`;
5896
5998
  const CLASS_PREFIX = 'bs-popover';
5897
- const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
5898
5999
  const Default$2 = { ...Tooltip.Default,
5899
6000
  placement: 'right',
5900
6001
  offset: [0, 8],
@@ -5917,8 +6018,6 @@
5917
6018
  MOUSEENTER: `mouseenter${EVENT_KEY$3}`,
5918
6019
  MOUSELEAVE: `mouseleave${EVENT_KEY$3}`
5919
6020
  };
5920
- const CLASS_NAME_FADE$2 = 'fade';
5921
- const CLASS_NAME_SHOW$2 = 'show';
5922
6021
  const SELECTOR_TITLE = '.popover-header';
5923
6022
  const SELECTOR_CONTENT = '.popover-body';
5924
6023
  /**
@@ -5950,54 +6049,25 @@
5950
6049
  return this.getTitle() || this._getContent();
5951
6050
  }
5952
6051
 
5953
- setContent() {
5954
- const tip = this.getTipElement(); // we use append for html objects to maintain js events
5955
-
5956
- this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
5957
-
5958
- let content = this._getContent();
6052
+ setContent(tip) {
6053
+ this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
5959
6054
 
5960
- if (typeof content === 'function') {
5961
- content = content.call(this._element);
5962
- }
5963
-
5964
- this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
5965
- tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
6055
+ this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
5966
6056
  } // Private
5967
6057
 
5968
6058
 
5969
- _addAttachmentClass(attachment) {
5970
- this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
5971
- }
5972
-
5973
6059
  _getContent() {
5974
- return this._element.getAttribute('data-bs-content') || this._config.content;
6060
+ return this._resolvePossibleFunction(this._config.content);
5975
6061
  }
5976
6062
 
5977
- _cleanTipClass() {
5978
- const tip = this.getTipElement();
5979
- const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
5980
-
5981
- if (tabClass !== null && tabClass.length > 0) {
5982
- tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
5983
- }
6063
+ _getBasicClassPrefix() {
6064
+ return CLASS_PREFIX;
5984
6065
  } // Static
5985
6066
 
5986
6067
 
5987
6068
  static jQueryInterface(config) {
5988
6069
  return this.each(function () {
5989
- let data = Data.get(this, DATA_KEY$3);
5990
-
5991
- const _config = typeof config === 'object' ? config : null;
5992
-
5993
- if (!data && /dispose|hide/.test(config)) {
5994
- return;
5995
- }
5996
-
5997
- if (!data) {
5998
- data = new Popover(this, _config);
5999
- Data.set(this, DATA_KEY$3, data);
6000
- }
6070
+ const data = Popover.getOrCreateInstance(this, config);
6001
6071
 
6002
6072
  if (typeof config === 'string') {
6003
6073
  if (typeof data[config] === 'undefined') {
@@ -6022,7 +6092,7 @@
6022
6092
 
6023
6093
  /**
6024
6094
  * --------------------------------------------------------------------------
6025
- * Bootstrap (v5.0.1): scrollspy.js
6095
+ * Bootstrap (v5.1.0): scrollspy.js
6026
6096
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6027
6097
  * --------------------------------------------------------------------------
6028
6098
  */
@@ -6056,6 +6126,7 @@
6056
6126
  const SELECTOR_NAV_LINKS = '.nav-link';
6057
6127
  const SELECTOR_NAV_ITEMS = '.nav-item';
6058
6128
  const SELECTOR_LIST_ITEMS = '.list-group-item';
6129
+ const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;
6059
6130
  const SELECTOR_DROPDOWN$1 = '.dropdown';
6060
6131
  const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
6061
6132
  const METHOD_OFFSET = 'offset';
@@ -6071,7 +6142,6 @@
6071
6142
  super(element);
6072
6143
  this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;
6073
6144
  this._config = this._getConfig(config);
6074
- this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
6075
6145
  this._offsets = [];
6076
6146
  this._targets = [];
6077
6147
  this._activeTarget = null;
@@ -6099,7 +6169,7 @@
6099
6169
  this._offsets = [];
6100
6170
  this._targets = [];
6101
6171
  this._scrollHeight = this._getScrollHeight();
6102
- const targets = SelectorEngine.find(this._selector);
6172
+ const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);
6103
6173
  targets.map(element => {
6104
6174
  const targetSelector = getSelectorFromElement(element);
6105
6175
  const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
@@ -6131,20 +6201,7 @@
6131
6201
  ...Manipulator.getDataAttributes(this._element),
6132
6202
  ...(typeof config === 'object' && config ? config : {})
6133
6203
  };
6134
-
6135
- if (typeof config.target !== 'string' && isElement$1(config.target)) {
6136
- let {
6137
- id
6138
- } = config.target;
6139
-
6140
- if (!id) {
6141
- id = getUID(NAME$2);
6142
- config.target.id = id;
6143
- }
6144
-
6145
- config.target = `#${id}`;
6146
- }
6147
-
6204
+ config.target = getElement(config.target) || document.documentElement;
6148
6205
  typeCheckConfig(NAME$2, config, DefaultType$1);
6149
6206
  return config;
6150
6207
  }
@@ -6204,16 +6261,13 @@
6204
6261
 
6205
6262
  this._clear();
6206
6263
 
6207
- const queries = this._selector.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
6208
-
6209
- const link = SelectorEngine.findOne(queries.join(','));
6264
+ const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
6265
+ const link = SelectorEngine.findOne(queries.join(','), this._config.target);
6266
+ link.classList.add(CLASS_NAME_ACTIVE$1);
6210
6267
 
6211
6268
  if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
6212
6269
  SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);
6213
- link.classList.add(CLASS_NAME_ACTIVE$1);
6214
6270
  } else {
6215
- // Set triggered link as active
6216
- link.classList.add(CLASS_NAME_ACTIVE$1);
6217
6271
  SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {
6218
6272
  // Set triggered links parents as active
6219
6273
  // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
@@ -6231,13 +6285,13 @@
6231
6285
  }
6232
6286
 
6233
6287
  _clear() {
6234
- SelectorEngine.find(this._selector).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
6288
+ SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
6235
6289
  } // Static
6236
6290
 
6237
6291
 
6238
6292
  static jQueryInterface(config) {
6239
6293
  return this.each(function () {
6240
- const data = ScrollSpy.getInstance(this) || new ScrollSpy(this, typeof config === 'object' ? config : {});
6294
+ const data = ScrollSpy.getOrCreateInstance(this, config);
6241
6295
 
6242
6296
  if (typeof config !== 'string') {
6243
6297
  return;
@@ -6273,7 +6327,7 @@
6273
6327
 
6274
6328
  /**
6275
6329
  * --------------------------------------------------------------------------
6276
- * Bootstrap (v5.0.1): tab.js
6330
+ * Bootstrap (v5.1.0): tab.js
6277
6331
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6278
6332
  * --------------------------------------------------------------------------
6279
6333
  */
@@ -6428,7 +6482,7 @@
6428
6482
 
6429
6483
  static jQueryInterface(config) {
6430
6484
  return this.each(function () {
6431
- const data = Data.get(this, DATA_KEY$1) || new Tab(this);
6485
+ const data = Tab.getOrCreateInstance(this);
6432
6486
 
6433
6487
  if (typeof config === 'string') {
6434
6488
  if (typeof data[config] === 'undefined') {
@@ -6457,7 +6511,7 @@
6457
6511
  return;
6458
6512
  }
6459
6513
 
6460
- const data = Data.get(this, DATA_KEY$1) || new Tab(this);
6514
+ const data = Tab.getOrCreateInstance(this);
6461
6515
  data.show();
6462
6516
  });
6463
6517
  /**
@@ -6471,7 +6525,7 @@
6471
6525
 
6472
6526
  /**
6473
6527
  * --------------------------------------------------------------------------
6474
- * Bootstrap (v5.0.1): toast.js
6528
+ * Bootstrap (v5.1.0): toast.js
6475
6529
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6476
6530
  * --------------------------------------------------------------------------
6477
6531
  */
@@ -6484,7 +6538,6 @@
6484
6538
  const NAME = 'toast';
6485
6539
  const DATA_KEY = 'bs.toast';
6486
6540
  const EVENT_KEY = `.${DATA_KEY}`;
6487
- const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
6488
6541
  const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
6489
6542
  const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
6490
6543
  const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
@@ -6494,7 +6547,8 @@
6494
6547
  const EVENT_SHOW = `show${EVENT_KEY}`;
6495
6548
  const EVENT_SHOWN = `shown${EVENT_KEY}`;
6496
6549
  const CLASS_NAME_FADE = 'fade';
6497
- const CLASS_NAME_HIDE = 'hide';
6550
+ const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
6551
+
6498
6552
  const CLASS_NAME_SHOW = 'show';
6499
6553
  const CLASS_NAME_SHOWING = 'showing';
6500
6554
  const DefaultType = {
@@ -6507,7 +6561,6 @@
6507
6561
  autohide: true,
6508
6562
  delay: 5000
6509
6563
  };
6510
- const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
6511
6564
  /**
6512
6565
  * ------------------------------------------------------------------------
6513
6566
  * Class Definition
@@ -6555,17 +6608,18 @@
6555
6608
  const complete = () => {
6556
6609
  this._element.classList.remove(CLASS_NAME_SHOWING);
6557
6610
 
6558
- this._element.classList.add(CLASS_NAME_SHOW);
6559
-
6560
6611
  EventHandler.trigger(this._element, EVENT_SHOWN);
6561
6612
 
6562
6613
  this._maybeScheduleHide();
6563
6614
  };
6564
6615
 
6565
- this._element.classList.remove(CLASS_NAME_HIDE);
6616
+ this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
6617
+
6566
6618
 
6567
6619
  reflow(this._element);
6568
6620
 
6621
+ this._element.classList.add(CLASS_NAME_SHOW);
6622
+
6569
6623
  this._element.classList.add(CLASS_NAME_SHOWING);
6570
6624
 
6571
6625
  this._queueCallback(complete, this._element, this._config.animation);
@@ -6583,12 +6637,17 @@
6583
6637
  }
6584
6638
 
6585
6639
  const complete = () => {
6586
- this._element.classList.add(CLASS_NAME_HIDE);
6640
+ this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
6641
+
6642
+
6643
+ this._element.classList.remove(CLASS_NAME_SHOWING);
6644
+
6645
+ this._element.classList.remove(CLASS_NAME_SHOW);
6587
6646
 
6588
6647
  EventHandler.trigger(this._element, EVENT_HIDDEN);
6589
6648
  };
6590
6649
 
6591
- this._element.classList.remove(CLASS_NAME_SHOW);
6650
+ this._element.classList.add(CLASS_NAME_SHOWING);
6592
6651
 
6593
6652
  this._queueCallback(complete, this._element, this._config.animation);
6594
6653
  }
@@ -6656,7 +6715,6 @@
6656
6715
  }
6657
6716
 
6658
6717
  _setListeners() {
6659
- EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
6660
6718
  EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
6661
6719
  EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
6662
6720
  EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
@@ -6671,13 +6729,7 @@
6671
6729
 
6672
6730
  static jQueryInterface(config) {
6673
6731
  return this.each(function () {
6674
- let data = Data.get(this, DATA_KEY);
6675
-
6676
- const _config = typeof config === 'object' && config;
6677
-
6678
- if (!data) {
6679
- data = new Toast(this, _config);
6680
- }
6732
+ const data = Toast.getOrCreateInstance(this, config);
6681
6733
 
6682
6734
  if (typeof config === 'string') {
6683
6735
  if (typeof data[config] === 'undefined') {
@@ -6690,6 +6742,8 @@
6690
6742
  }
6691
6743
 
6692
6744
  }
6745
+
6746
+ enableDismissTrigger(Toast);
6693
6747
  /**
6694
6748
  * ------------------------------------------------------------------------
6695
6749
  * jQuery
@@ -6697,12 +6751,11 @@
6697
6751
  * add .Toast to jQuery only if jQuery is present
6698
6752
  */
6699
6753
 
6700
-
6701
6754
  defineJQueryPlugin(Toast);
6702
6755
 
6703
6756
  /**
6704
6757
  * --------------------------------------------------------------------------
6705
- * Bootstrap (v5.0.1): index.umd.js
6758
+ * Bootstrap (v5.1.0): index.umd.js
6706
6759
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6707
6760
  * --------------------------------------------------------------------------
6708
6761
  */