publishing_platform_publishing_components 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +2 -0
  4. data/Rakefile +41 -0
  5. data/app/assets/builds/gemkeep +0 -0
  6. data/app/assets/config/publishing_platform_publishing_components_manifest.js +2 -0
  7. data/app/assets/images/publishing_platform_publishing_components/gemkeep +0 -0
  8. data/app/assets/stylesheets/publishing_platform_publishing_components/_all_components.scss +3 -0
  9. data/app/assets/stylesheets/publishing_platform_publishing_components/components/_attachment.scss +117 -0
  10. data/app/assets/stylesheets/publishing_platform_publishing_components/components/_summary-list.scss +169 -0
  11. data/app/controllers/publishing_platform_publishing_components/application_controller.rb +4 -0
  12. data/app/helpers/publishing_platform_publishing_components/application_helper.rb +4 -0
  13. data/app/models/publishing_platform_publishing_components/component_doc.rb +90 -0
  14. data/app/models/publishing_platform_publishing_components/component_docs.rb +57 -0
  15. data/app/models/publishing_platform_publishing_components/component_example.rb +104 -0
  16. data/app/models/publishing_platform_publishing_components/shared_accessibility_criteria.rb +37 -0
  17. data/app/views/publishing_platform_publishing_components/component_doc/_component_output.html.erb +15 -0
  18. data/app/views/publishing_platform_publishing_components/components/_attachment.html.erb +91 -0
  19. data/app/views/publishing_platform_publishing_components/components/_error_summary.html.erb +38 -0
  20. data/app/views/publishing_platform_publishing_components/components/_summary_list.html.erb +135 -0
  21. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_document.html.erb +3 -0
  22. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_external.html.erb +3 -0
  23. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_generic.html.erb +4 -0
  24. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_html.html.erb +3 -0
  25. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_pdf.html.erb +3 -0
  26. data/app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb +5 -0
  27. data/app/views/publishing_platform_publishing_components/components/docs/attachment.yml +104 -0
  28. data/app/views/publishing_platform_publishing_components/components/docs/error_summary.yml +51 -0
  29. data/app/views/publishing_platform_publishing_components/components/docs/summary_list.yml +137 -0
  30. data/config/initializers/assets.rb +24 -0
  31. data/config/routes.rb +2 -0
  32. data/lib/publishing_platform_publishing_components/config.rb +25 -0
  33. data/lib/publishing_platform_publishing_components/engine.rb +5 -0
  34. data/lib/publishing_platform_publishing_components/presenters/attachment_helper.rb +176 -0
  35. data/lib/publishing_platform_publishing_components/presenters/component_wrapper_helper.rb +290 -0
  36. data/lib/publishing_platform_publishing_components/presenters/shared_helper.rb +24 -0
  37. data/lib/publishing_platform_publishing_components/version.rb +3 -0
  38. data/lib/publishing_platform_publishing_components.rb +10 -0
  39. data/lib/tasks/publishing_platform_publishing_components_tasks.rake +4 -0
  40. data/node_modules/bootstrap/LICENSE +21 -0
  41. data/node_modules/bootstrap/README.md +246 -0
  42. data/node_modules/bootstrap/dist/css/bootstrap-grid.css +4085 -0
  43. data/node_modules/bootstrap/dist/css/bootstrap-grid.css.map +1 -0
  44. data/node_modules/bootstrap/dist/css/bootstrap-grid.min.css +6 -0
  45. data/node_modules/bootstrap/dist/css/bootstrap-grid.min.css.map +1 -0
  46. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.css +4084 -0
  47. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.css.map +1 -0
  48. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.min.css +6 -0
  49. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map +1 -0
  50. data/node_modules/bootstrap/dist/css/bootstrap-reboot.css +601 -0
  51. data/node_modules/bootstrap/dist/css/bootstrap-reboot.css.map +1 -0
  52. data/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css +6 -0
  53. data/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css.map +1 -0
  54. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.css +598 -0
  55. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.css.map +1 -0
  56. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.min.css +6 -0
  57. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map +1 -0
  58. data/node_modules/bootstrap/dist/css/bootstrap-utilities.css +5406 -0
  59. data/node_modules/bootstrap/dist/css/bootstrap-utilities.css.map +1 -0
  60. data/node_modules/bootstrap/dist/css/bootstrap-utilities.min.css +6 -0
  61. data/node_modules/bootstrap/dist/css/bootstrap-utilities.min.css.map +1 -0
  62. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.css +5397 -0
  63. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.css.map +1 -0
  64. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.min.css +6 -0
  65. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map +1 -0
  66. data/node_modules/bootstrap/dist/css/bootstrap.css +12048 -0
  67. data/node_modules/bootstrap/dist/css/bootstrap.css.map +1 -0
  68. data/node_modules/bootstrap/dist/css/bootstrap.min.css +6 -0
  69. data/node_modules/bootstrap/dist/css/bootstrap.min.css.map +1 -0
  70. data/node_modules/bootstrap/dist/css/bootstrap.rtl.css +12021 -0
  71. data/node_modules/bootstrap/dist/css/bootstrap.rtl.css.map +1 -0
  72. data/node_modules/bootstrap/dist/css/bootstrap.rtl.min.css +6 -0
  73. data/node_modules/bootstrap/dist/css/bootstrap.rtl.min.css.map +1 -0
  74. data/node_modules/bootstrap/dist/js/bootstrap.bundle.js +6312 -0
  75. data/node_modules/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
  76. data/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js +7 -0
  77. data/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
  78. data/node_modules/bootstrap/dist/js/bootstrap.esm.js +4447 -0
  79. data/node_modules/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
  80. data/node_modules/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
  81. data/node_modules/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
  82. data/node_modules/bootstrap/dist/js/bootstrap.js +4494 -0
  83. data/node_modules/bootstrap/dist/js/bootstrap.js.map +1 -0
  84. data/node_modules/bootstrap/dist/js/bootstrap.min.js +7 -0
  85. data/node_modules/bootstrap/dist/js/bootstrap.min.js.map +1 -0
  86. data/node_modules/bootstrap/js/dist/alert.js +90 -0
  87. data/node_modules/bootstrap/js/dist/alert.js.map +1 -0
  88. data/node_modules/bootstrap/js/dist/base-component.js +86 -0
  89. data/node_modules/bootstrap/js/dist/base-component.js.map +1 -0
  90. data/node_modules/bootstrap/js/dist/button.js +79 -0
  91. data/node_modules/bootstrap/js/dist/button.js.map +1 -0
  92. data/node_modules/bootstrap/js/dist/carousel.js +388 -0
  93. data/node_modules/bootstrap/js/dist/carousel.js.map +1 -0
  94. data/node_modules/bootstrap/js/dist/collapse.js +249 -0
  95. data/node_modules/bootstrap/js/dist/collapse.js.map +1 -0
  96. data/node_modules/bootstrap/js/dist/dom/data.js +63 -0
  97. data/node_modules/bootstrap/js/dist/dom/data.js.map +1 -0
  98. data/node_modules/bootstrap/js/dist/dom/event-handler.js +237 -0
  99. data/node_modules/bootstrap/js/dist/dom/event-handler.js.map +1 -0
  100. data/node_modules/bootstrap/js/dist/dom/manipulator.js +72 -0
  101. data/node_modules/bootstrap/js/dist/dom/manipulator.js.map +1 -0
  102. data/node_modules/bootstrap/js/dist/dom/selector-engine.js +104 -0
  103. data/node_modules/bootstrap/js/dist/dom/selector-engine.js.map +1 -0
  104. data/node_modules/bootstrap/js/dist/dropdown.js +402 -0
  105. data/node_modules/bootstrap/js/dist/dropdown.js.map +1 -0
  106. data/node_modules/bootstrap/js/dist/modal.js +320 -0
  107. data/node_modules/bootstrap/js/dist/modal.js.map +1 -0
  108. data/node_modules/bootstrap/js/dist/offcanvas.js +246 -0
  109. data/node_modules/bootstrap/js/dist/offcanvas.js.map +1 -0
  110. data/node_modules/bootstrap/js/dist/popover.js +96 -0
  111. data/node_modules/bootstrap/js/dist/popover.js.map +1 -0
  112. data/node_modules/bootstrap/js/dist/scrollspy.js +275 -0
  113. data/node_modules/bootstrap/js/dist/scrollspy.js.map +1 -0
  114. data/node_modules/bootstrap/js/dist/tab.js +285 -0
  115. data/node_modules/bootstrap/js/dist/tab.js.map +1 -0
  116. data/node_modules/bootstrap/js/dist/toast.js +198 -0
  117. data/node_modules/bootstrap/js/dist/toast.js.map +1 -0
  118. data/node_modules/bootstrap/js/dist/tooltip.js +546 -0
  119. data/node_modules/bootstrap/js/dist/tooltip.js.map +1 -0
  120. data/node_modules/bootstrap/js/dist/util/backdrop.js +139 -0
  121. data/node_modules/bootstrap/js/dist/util/backdrop.js.map +1 -0
  122. data/node_modules/bootstrap/js/dist/util/component-functions.js +42 -0
  123. data/node_modules/bootstrap/js/dist/util/component-functions.js.map +1 -0
  124. data/node_modules/bootstrap/js/dist/util/config.js +68 -0
  125. data/node_modules/bootstrap/js/dist/util/config.js.map +1 -0
  126. data/node_modules/bootstrap/js/dist/util/focustrap.js +113 -0
  127. data/node_modules/bootstrap/js/dist/util/focustrap.js.map +1 -0
  128. data/node_modules/bootstrap/js/dist/util/index.js +281 -0
  129. data/node_modules/bootstrap/js/dist/util/index.js.map +1 -0
  130. data/node_modules/bootstrap/js/dist/util/sanitizer.js +113 -0
  131. data/node_modules/bootstrap/js/dist/util/sanitizer.js.map +1 -0
  132. data/node_modules/bootstrap/js/dist/util/scrollbar.js +113 -0
  133. data/node_modules/bootstrap/js/dist/util/scrollbar.js.map +1 -0
  134. data/node_modules/bootstrap/js/dist/util/swipe.js +135 -0
  135. data/node_modules/bootstrap/js/dist/util/swipe.js.map +1 -0
  136. data/node_modules/bootstrap/js/dist/util/template-factory.js +151 -0
  137. data/node_modules/bootstrap/js/dist/util/template-factory.js.map +1 -0
  138. data/node_modules/bootstrap/js/index.esm.js +19 -0
  139. data/node_modules/bootstrap/js/index.umd.js +34 -0
  140. data/node_modules/bootstrap/js/src/alert.js +87 -0
  141. data/node_modules/bootstrap/js/src/base-component.js +86 -0
  142. data/node_modules/bootstrap/js/src/button.js +72 -0
  143. data/node_modules/bootstrap/js/src/carousel.js +474 -0
  144. data/node_modules/bootstrap/js/src/collapse.js +297 -0
  145. data/node_modules/bootstrap/js/src/dom/data.js +55 -0
  146. data/node_modules/bootstrap/js/src/dom/event-handler.js +317 -0
  147. data/node_modules/bootstrap/js/src/dom/manipulator.js +71 -0
  148. data/node_modules/bootstrap/js/src/dom/selector-engine.js +126 -0
  149. data/node_modules/bootstrap/js/src/dropdown.js +455 -0
  150. data/node_modules/bootstrap/js/src/modal.js +378 -0
  151. data/node_modules/bootstrap/js/src/offcanvas.js +282 -0
  152. data/node_modules/bootstrap/js/src/popover.js +97 -0
  153. data/node_modules/bootstrap/js/src/scrollspy.js +296 -0
  154. data/node_modules/bootstrap/js/src/tab.js +315 -0
  155. data/node_modules/bootstrap/js/src/toast.js +224 -0
  156. data/node_modules/bootstrap/js/src/tooltip.js +633 -0
  157. data/node_modules/bootstrap/js/src/util/backdrop.js +151 -0
  158. data/node_modules/bootstrap/js/src/util/component-functions.js +35 -0
  159. data/node_modules/bootstrap/js/src/util/config.js +65 -0
  160. data/node_modules/bootstrap/js/src/util/focustrap.js +115 -0
  161. data/node_modules/bootstrap/js/src/util/index.js +306 -0
  162. data/node_modules/bootstrap/js/src/util/sanitizer.js +116 -0
  163. data/node_modules/bootstrap/js/src/util/scrollbar.js +114 -0
  164. data/node_modules/bootstrap/js/src/util/swipe.js +146 -0
  165. data/node_modules/bootstrap/js/src/util/template-factory.js +160 -0
  166. data/node_modules/bootstrap/package.json +210 -0
  167. data/node_modules/bootstrap/scss/_accordion.scss +153 -0
  168. data/node_modules/bootstrap/scss/_alert.scss +68 -0
  169. data/node_modules/bootstrap/scss/_badge.scss +38 -0
  170. data/node_modules/bootstrap/scss/_breadcrumb.scss +40 -0
  171. data/node_modules/bootstrap/scss/_button-group.scss +147 -0
  172. data/node_modules/bootstrap/scss/_buttons.scss +216 -0
  173. data/node_modules/bootstrap/scss/_card.scss +238 -0
  174. data/node_modules/bootstrap/scss/_carousel.scss +226 -0
  175. data/node_modules/bootstrap/scss/_close.scss +66 -0
  176. data/node_modules/bootstrap/scss/_containers.scss +41 -0
  177. data/node_modules/bootstrap/scss/_dropdown.scss +250 -0
  178. data/node_modules/bootstrap/scss/_forms.scss +9 -0
  179. data/node_modules/bootstrap/scss/_functions.scss +302 -0
  180. data/node_modules/bootstrap/scss/_grid.scss +39 -0
  181. data/node_modules/bootstrap/scss/_helpers.scss +12 -0
  182. data/node_modules/bootstrap/scss/_images.scss +42 -0
  183. data/node_modules/bootstrap/scss/_list-group.scss +199 -0
  184. data/node_modules/bootstrap/scss/_maps.scss +174 -0
  185. data/node_modules/bootstrap/scss/_mixins.scss +42 -0
  186. data/node_modules/bootstrap/scss/_modal.scss +240 -0
  187. data/node_modules/bootstrap/scss/_nav.scss +197 -0
  188. data/node_modules/bootstrap/scss/_navbar.scss +289 -0
  189. data/node_modules/bootstrap/scss/_offcanvas.scss +147 -0
  190. data/node_modules/bootstrap/scss/_pagination.scss +109 -0
  191. data/node_modules/bootstrap/scss/_placeholders.scss +51 -0
  192. data/node_modules/bootstrap/scss/_popover.scss +196 -0
  193. data/node_modules/bootstrap/scss/_progress.scss +68 -0
  194. data/node_modules/bootstrap/scss/_reboot.scss +617 -0
  195. data/node_modules/bootstrap/scss/_root.scss +187 -0
  196. data/node_modules/bootstrap/scss/_spinners.scss +86 -0
  197. data/node_modules/bootstrap/scss/_tables.scss +171 -0
  198. data/node_modules/bootstrap/scss/_toasts.scss +73 -0
  199. data/node_modules/bootstrap/scss/_tooltip.scss +119 -0
  200. data/node_modules/bootstrap/scss/_transitions.scss +27 -0
  201. data/node_modules/bootstrap/scss/_type.scss +106 -0
  202. data/node_modules/bootstrap/scss/_utilities.scss +806 -0
  203. data/node_modules/bootstrap/scss/_variables-dark.scss +102 -0
  204. data/node_modules/bootstrap/scss/_variables.scss +1753 -0
  205. data/node_modules/bootstrap/scss/bootstrap-grid.scss +62 -0
  206. data/node_modules/bootstrap/scss/bootstrap-reboot.scss +10 -0
  207. data/node_modules/bootstrap/scss/bootstrap-utilities.scss +19 -0
  208. data/node_modules/bootstrap/scss/bootstrap.scss +52 -0
  209. data/node_modules/bootstrap/scss/forms/_floating-labels.scss +97 -0
  210. data/node_modules/bootstrap/scss/forms/_form-check.scss +189 -0
  211. data/node_modules/bootstrap/scss/forms/_form-control.scss +214 -0
  212. data/node_modules/bootstrap/scss/forms/_form-range.scss +91 -0
  213. data/node_modules/bootstrap/scss/forms/_form-select.scss +80 -0
  214. data/node_modules/bootstrap/scss/forms/_form-text.scss +11 -0
  215. data/node_modules/bootstrap/scss/forms/_input-group.scss +132 -0
  216. data/node_modules/bootstrap/scss/forms/_labels.scss +36 -0
  217. data/node_modules/bootstrap/scss/forms/_validation.scss +12 -0
  218. data/node_modules/bootstrap/scss/helpers/_clearfix.scss +3 -0
  219. data/node_modules/bootstrap/scss/helpers/_color-bg.scss +7 -0
  220. data/node_modules/bootstrap/scss/helpers/_colored-links.scss +30 -0
  221. data/node_modules/bootstrap/scss/helpers/_focus-ring.scss +5 -0
  222. data/node_modules/bootstrap/scss/helpers/_icon-link.scss +25 -0
  223. data/node_modules/bootstrap/scss/helpers/_position.scss +36 -0
  224. data/node_modules/bootstrap/scss/helpers/_ratio.scss +26 -0
  225. data/node_modules/bootstrap/scss/helpers/_stacks.scss +15 -0
  226. data/node_modules/bootstrap/scss/helpers/_stretched-link.scss +15 -0
  227. data/node_modules/bootstrap/scss/helpers/_text-truncation.scss +7 -0
  228. data/node_modules/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
  229. data/node_modules/bootstrap/scss/helpers/_vr.scss +8 -0
  230. data/node_modules/bootstrap/scss/mixins/_alert.scss +18 -0
  231. data/node_modules/bootstrap/scss/mixins/_backdrop.scss +14 -0
  232. data/node_modules/bootstrap/scss/mixins/_banner.scss +7 -0
  233. data/node_modules/bootstrap/scss/mixins/_border-radius.scss +78 -0
  234. data/node_modules/bootstrap/scss/mixins/_box-shadow.scss +24 -0
  235. data/node_modules/bootstrap/scss/mixins/_breakpoints.scss +127 -0
  236. data/node_modules/bootstrap/scss/mixins/_buttons.scss +70 -0
  237. data/node_modules/bootstrap/scss/mixins/_caret.scss +69 -0
  238. data/node_modules/bootstrap/scss/mixins/_clearfix.scss +9 -0
  239. data/node_modules/bootstrap/scss/mixins/_color-mode.scss +21 -0
  240. data/node_modules/bootstrap/scss/mixins/_color-scheme.scss +7 -0
  241. data/node_modules/bootstrap/scss/mixins/_container.scss +11 -0
  242. data/node_modules/bootstrap/scss/mixins/_deprecate.scss +10 -0
  243. data/node_modules/bootstrap/scss/mixins/_forms.scss +163 -0
  244. data/node_modules/bootstrap/scss/mixins/_gradients.scss +47 -0
  245. data/node_modules/bootstrap/scss/mixins/_grid.scss +151 -0
  246. data/node_modules/bootstrap/scss/mixins/_image.scss +16 -0
  247. data/node_modules/bootstrap/scss/mixins/_list-group.scss +26 -0
  248. data/node_modules/bootstrap/scss/mixins/_lists.scss +7 -0
  249. data/node_modules/bootstrap/scss/mixins/_pagination.scss +10 -0
  250. data/node_modules/bootstrap/scss/mixins/_reset-text.scss +17 -0
  251. data/node_modules/bootstrap/scss/mixins/_resize.scss +6 -0
  252. data/node_modules/bootstrap/scss/mixins/_table-variants.scss +24 -0
  253. data/node_modules/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  254. data/node_modules/bootstrap/scss/mixins/_transition.scss +26 -0
  255. data/node_modules/bootstrap/scss/mixins/_utilities.scss +97 -0
  256. data/node_modules/bootstrap/scss/mixins/_visually-hidden.scss +38 -0
  257. data/node_modules/bootstrap/scss/utilities/_api.scss +47 -0
  258. data/node_modules/bootstrap/scss/vendor/_rfs.scss +348 -0
  259. metadata +448 -0
@@ -0,0 +1,4447 @@
1
+ /*!
2
+ * Bootstrap v5.3.8 (https://getbootstrap.com/)
3
+ * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
6
+ import * as Popper from '@popperjs/core';
7
+
8
+ /**
9
+ * --------------------------------------------------------------------------
10
+ * Bootstrap dom/data.js
11
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
12
+ * --------------------------------------------------------------------------
13
+ */
14
+
15
+ /**
16
+ * Constants
17
+ */
18
+
19
+ const elementMap = new Map();
20
+ const Data = {
21
+ set(element, key, instance) {
22
+ if (!elementMap.has(element)) {
23
+ elementMap.set(element, new Map());
24
+ }
25
+ const instanceMap = elementMap.get(element);
26
+
27
+ // make it clear we only want one instance per element
28
+ // can be removed later when multiple key/instances are fine to be used
29
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
30
+ // eslint-disable-next-line no-console
31
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
32
+ return;
33
+ }
34
+ instanceMap.set(key, instance);
35
+ },
36
+ get(element, key) {
37
+ if (elementMap.has(element)) {
38
+ return elementMap.get(element).get(key) || null;
39
+ }
40
+ return null;
41
+ },
42
+ remove(element, key) {
43
+ if (!elementMap.has(element)) {
44
+ return;
45
+ }
46
+ const instanceMap = elementMap.get(element);
47
+ instanceMap.delete(key);
48
+
49
+ // free up element references if there are no instances left for an element
50
+ if (instanceMap.size === 0) {
51
+ elementMap.delete(element);
52
+ }
53
+ }
54
+ };
55
+
56
+ /**
57
+ * --------------------------------------------------------------------------
58
+ * Bootstrap util/index.js
59
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
60
+ * --------------------------------------------------------------------------
61
+ */
62
+
63
+ const MAX_UID = 1000000;
64
+ const MILLISECONDS_MULTIPLIER = 1000;
65
+ const TRANSITION_END = 'transitionend';
66
+
67
+ /**
68
+ * Properly escape IDs selectors to handle weird IDs
69
+ * @param {string} selector
70
+ * @returns {string}
71
+ */
72
+ const parseSelector = selector => {
73
+ if (selector && window.CSS && window.CSS.escape) {
74
+ // document.querySelector needs escaping to handle IDs (html5+) containing for instance /
75
+ selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`);
76
+ }
77
+ return selector;
78
+ };
79
+
80
+ // Shout-out Angus Croll (https://goo.gl/pxwQGp)
81
+ const toType = object => {
82
+ if (object === null || object === undefined) {
83
+ return `${object}`;
84
+ }
85
+ return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
86
+ };
87
+
88
+ /**
89
+ * Public Util API
90
+ */
91
+
92
+ const getUID = prefix => {
93
+ do {
94
+ prefix += Math.floor(Math.random() * MAX_UID);
95
+ } while (document.getElementById(prefix));
96
+ return prefix;
97
+ };
98
+ const getTransitionDurationFromElement = element => {
99
+ if (!element) {
100
+ return 0;
101
+ }
102
+
103
+ // Get transition-duration of the element
104
+ let {
105
+ transitionDuration,
106
+ transitionDelay
107
+ } = window.getComputedStyle(element);
108
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
109
+ const floatTransitionDelay = Number.parseFloat(transitionDelay);
110
+
111
+ // Return 0 if element or transition duration is not found
112
+ if (!floatTransitionDuration && !floatTransitionDelay) {
113
+ return 0;
114
+ }
115
+
116
+ // If multiple durations are defined, take the first
117
+ transitionDuration = transitionDuration.split(',')[0];
118
+ transitionDelay = transitionDelay.split(',')[0];
119
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
120
+ };
121
+ const triggerTransitionEnd = element => {
122
+ element.dispatchEvent(new Event(TRANSITION_END));
123
+ };
124
+ const isElement = object => {
125
+ if (!object || typeof object !== 'object') {
126
+ return false;
127
+ }
128
+ if (typeof object.jquery !== 'undefined') {
129
+ object = object[0];
130
+ }
131
+ return typeof object.nodeType !== 'undefined';
132
+ };
133
+ const getElement = object => {
134
+ // it's a jQuery object or a node element
135
+ if (isElement(object)) {
136
+ return object.jquery ? object[0] : object;
137
+ }
138
+ if (typeof object === 'string' && object.length > 0) {
139
+ return document.querySelector(parseSelector(object));
140
+ }
141
+ return null;
142
+ };
143
+ const isVisible = element => {
144
+ if (!isElement(element) || element.getClientRects().length === 0) {
145
+ return false;
146
+ }
147
+ const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
148
+ // Handle `details` element as its content may falsie appear visible when it is closed
149
+ const closedDetails = element.closest('details:not([open])');
150
+ if (!closedDetails) {
151
+ return elementIsVisible;
152
+ }
153
+ if (closedDetails !== element) {
154
+ const summary = element.closest('summary');
155
+ if (summary && summary.parentNode !== closedDetails) {
156
+ return false;
157
+ }
158
+ if (summary === null) {
159
+ return false;
160
+ }
161
+ }
162
+ return elementIsVisible;
163
+ };
164
+ const isDisabled = element => {
165
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) {
166
+ return true;
167
+ }
168
+ if (element.classList.contains('disabled')) {
169
+ return true;
170
+ }
171
+ if (typeof element.disabled !== 'undefined') {
172
+ return element.disabled;
173
+ }
174
+ return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
175
+ };
176
+ const findShadowRoot = element => {
177
+ if (!document.documentElement.attachShadow) {
178
+ return null;
179
+ }
180
+
181
+ // Can find the shadow root otherwise it'll return the document
182
+ if (typeof element.getRootNode === 'function') {
183
+ const root = element.getRootNode();
184
+ return root instanceof ShadowRoot ? root : null;
185
+ }
186
+ if (element instanceof ShadowRoot) {
187
+ return element;
188
+ }
189
+
190
+ // when we don't find a shadow root
191
+ if (!element.parentNode) {
192
+ return null;
193
+ }
194
+ return findShadowRoot(element.parentNode);
195
+ };
196
+ const noop = () => {};
197
+
198
+ /**
199
+ * Trick to restart an element's animation
200
+ *
201
+ * @param {HTMLElement} element
202
+ * @return void
203
+ *
204
+ * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
205
+ */
206
+ const reflow = element => {
207
+ element.offsetHeight; // eslint-disable-line no-unused-expressions
208
+ };
209
+ const getjQuery = () => {
210
+ if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
211
+ return window.jQuery;
212
+ }
213
+ return null;
214
+ };
215
+ const DOMContentLoadedCallbacks = [];
216
+ const onDOMContentLoaded = callback => {
217
+ if (document.readyState === 'loading') {
218
+ // add listener on the first call when the document is in loading state
219
+ if (!DOMContentLoadedCallbacks.length) {
220
+ document.addEventListener('DOMContentLoaded', () => {
221
+ for (const callback of DOMContentLoadedCallbacks) {
222
+ callback();
223
+ }
224
+ });
225
+ }
226
+ DOMContentLoadedCallbacks.push(callback);
227
+ } else {
228
+ callback();
229
+ }
230
+ };
231
+ const isRTL = () => document.documentElement.dir === 'rtl';
232
+ const defineJQueryPlugin = plugin => {
233
+ onDOMContentLoaded(() => {
234
+ const $ = getjQuery();
235
+ /* istanbul ignore if */
236
+ if ($) {
237
+ const name = plugin.NAME;
238
+ const JQUERY_NO_CONFLICT = $.fn[name];
239
+ $.fn[name] = plugin.jQueryInterface;
240
+ $.fn[name].Constructor = plugin;
241
+ $.fn[name].noConflict = () => {
242
+ $.fn[name] = JQUERY_NO_CONFLICT;
243
+ return plugin.jQueryInterface;
244
+ };
245
+ }
246
+ });
247
+ };
248
+ const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
249
+ return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue;
250
+ };
251
+ const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
252
+ if (!waitForTransition) {
253
+ execute(callback);
254
+ return;
255
+ }
256
+ const durationPadding = 5;
257
+ const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
258
+ let called = false;
259
+ const handler = ({
260
+ target
261
+ }) => {
262
+ if (target !== transitionElement) {
263
+ return;
264
+ }
265
+ called = true;
266
+ transitionElement.removeEventListener(TRANSITION_END, handler);
267
+ execute(callback);
268
+ };
269
+ transitionElement.addEventListener(TRANSITION_END, handler);
270
+ setTimeout(() => {
271
+ if (!called) {
272
+ triggerTransitionEnd(transitionElement);
273
+ }
274
+ }, emulatedDuration);
275
+ };
276
+
277
+ /**
278
+ * Return the previous/next element of a list.
279
+ *
280
+ * @param {array} list The list of elements
281
+ * @param activeElement The active element
282
+ * @param shouldGetNext Choose to get next or previous element
283
+ * @param isCycleAllowed
284
+ * @return {Element|elem} The proper element
285
+ */
286
+ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
287
+ const listLength = list.length;
288
+ let index = list.indexOf(activeElement);
289
+
290
+ // if the element does not exist in the list return an element
291
+ // depending on the direction and if cycle is allowed
292
+ if (index === -1) {
293
+ return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];
294
+ }
295
+ index += shouldGetNext ? 1 : -1;
296
+ if (isCycleAllowed) {
297
+ index = (index + listLength) % listLength;
298
+ }
299
+ return list[Math.max(0, Math.min(index, listLength - 1))];
300
+ };
301
+
302
+ /**
303
+ * --------------------------------------------------------------------------
304
+ * Bootstrap dom/event-handler.js
305
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
306
+ * --------------------------------------------------------------------------
307
+ */
308
+
309
+
310
+ /**
311
+ * Constants
312
+ */
313
+
314
+ const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
315
+ const stripNameRegex = /\..*/;
316
+ const stripUidRegex = /::\d+$/;
317
+ const eventRegistry = {}; // Events storage
318
+ let uidEvent = 1;
319
+ const customEvents = {
320
+ mouseenter: 'mouseover',
321
+ mouseleave: 'mouseout'
322
+ };
323
+ const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);
324
+
325
+ /**
326
+ * Private methods
327
+ */
328
+
329
+ function makeEventUid(element, uid) {
330
+ return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
331
+ }
332
+ function getElementEvents(element) {
333
+ const uid = makeEventUid(element);
334
+ element.uidEvent = uid;
335
+ eventRegistry[uid] = eventRegistry[uid] || {};
336
+ return eventRegistry[uid];
337
+ }
338
+ function bootstrapHandler(element, fn) {
339
+ return function handler(event) {
340
+ hydrateObj(event, {
341
+ delegateTarget: element
342
+ });
343
+ if (handler.oneOff) {
344
+ EventHandler.off(element, event.type, fn);
345
+ }
346
+ return fn.apply(element, [event]);
347
+ };
348
+ }
349
+ function bootstrapDelegationHandler(element, selector, fn) {
350
+ return function handler(event) {
351
+ const domElements = element.querySelectorAll(selector);
352
+ for (let {
353
+ target
354
+ } = event; target && target !== this; target = target.parentNode) {
355
+ for (const domElement of domElements) {
356
+ if (domElement !== target) {
357
+ continue;
358
+ }
359
+ hydrateObj(event, {
360
+ delegateTarget: target
361
+ });
362
+ if (handler.oneOff) {
363
+ EventHandler.off(element, event.type, selector, fn);
364
+ }
365
+ return fn.apply(target, [event]);
366
+ }
367
+ }
368
+ };
369
+ }
370
+ function findHandler(events, callable, delegationSelector = null) {
371
+ return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
372
+ }
373
+ function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
374
+ const isDelegated = typeof handler === 'string';
375
+ // TODO: tooltip passes `false` instead of selector, so we need to check
376
+ const callable = isDelegated ? delegationFunction : handler || delegationFunction;
377
+ let typeEvent = getTypeEvent(originalTypeEvent);
378
+ if (!nativeEvents.has(typeEvent)) {
379
+ typeEvent = originalTypeEvent;
380
+ }
381
+ return [isDelegated, callable, typeEvent];
382
+ }
383
+ function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
384
+ if (typeof originalTypeEvent !== 'string' || !element) {
385
+ return;
386
+ }
387
+ let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
388
+
389
+ // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
390
+ // this prevents the handler from being dispatched the same way as mouseover or mouseout does
391
+ if (originalTypeEvent in customEvents) {
392
+ const wrapFunction = fn => {
393
+ return function (event) {
394
+ if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
395
+ return fn.call(this, event);
396
+ }
397
+ };
398
+ };
399
+ callable = wrapFunction(callable);
400
+ }
401
+ const events = getElementEvents(element);
402
+ const handlers = events[typeEvent] || (events[typeEvent] = {});
403
+ const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
404
+ if (previousFunction) {
405
+ previousFunction.oneOff = previousFunction.oneOff && oneOff;
406
+ return;
407
+ }
408
+ const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
409
+ const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
410
+ fn.delegationSelector = isDelegated ? handler : null;
411
+ fn.callable = callable;
412
+ fn.oneOff = oneOff;
413
+ fn.uidEvent = uid;
414
+ handlers[uid] = fn;
415
+ element.addEventListener(typeEvent, fn, isDelegated);
416
+ }
417
+ function removeHandler(element, events, typeEvent, handler, delegationSelector) {
418
+ const fn = findHandler(events[typeEvent], handler, delegationSelector);
419
+ if (!fn) {
420
+ return;
421
+ }
422
+ element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
423
+ delete events[typeEvent][fn.uidEvent];
424
+ }
425
+ function removeNamespacedHandlers(element, events, typeEvent, namespace) {
426
+ const storeElementEvent = events[typeEvent] || {};
427
+ for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
428
+ if (handlerKey.includes(namespace)) {
429
+ removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
430
+ }
431
+ }
432
+ }
433
+ function getTypeEvent(event) {
434
+ // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
435
+ event = event.replace(stripNameRegex, '');
436
+ return customEvents[event] || event;
437
+ }
438
+ const EventHandler = {
439
+ on(element, event, handler, delegationFunction) {
440
+ addHandler(element, event, handler, delegationFunction, false);
441
+ },
442
+ one(element, event, handler, delegationFunction) {
443
+ addHandler(element, event, handler, delegationFunction, true);
444
+ },
445
+ off(element, originalTypeEvent, handler, delegationFunction) {
446
+ if (typeof originalTypeEvent !== 'string' || !element) {
447
+ return;
448
+ }
449
+ const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
450
+ const inNamespace = typeEvent !== originalTypeEvent;
451
+ const events = getElementEvents(element);
452
+ const storeElementEvent = events[typeEvent] || {};
453
+ const isNamespace = originalTypeEvent.startsWith('.');
454
+ if (typeof callable !== 'undefined') {
455
+ // Simplest case: handler is passed, remove that listener ONLY.
456
+ if (!Object.keys(storeElementEvent).length) {
457
+ return;
458
+ }
459
+ removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
460
+ return;
461
+ }
462
+ if (isNamespace) {
463
+ for (const elementEvent of Object.keys(events)) {
464
+ removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
465
+ }
466
+ }
467
+ for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {
468
+ const handlerKey = keyHandlers.replace(stripUidRegex, '');
469
+ if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
470
+ removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
471
+ }
472
+ }
473
+ },
474
+ trigger(element, event, args) {
475
+ if (typeof event !== 'string' || !element) {
476
+ return null;
477
+ }
478
+ const $ = getjQuery();
479
+ const typeEvent = getTypeEvent(event);
480
+ const inNamespace = event !== typeEvent;
481
+ let jQueryEvent = null;
482
+ let bubbles = true;
483
+ let nativeDispatch = true;
484
+ let defaultPrevented = false;
485
+ if (inNamespace && $) {
486
+ jQueryEvent = $.Event(event, args);
487
+ $(element).trigger(jQueryEvent);
488
+ bubbles = !jQueryEvent.isPropagationStopped();
489
+ nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
490
+ defaultPrevented = jQueryEvent.isDefaultPrevented();
491
+ }
492
+ const evt = hydrateObj(new Event(event, {
493
+ bubbles,
494
+ cancelable: true
495
+ }), args);
496
+ if (defaultPrevented) {
497
+ evt.preventDefault();
498
+ }
499
+ if (nativeDispatch) {
500
+ element.dispatchEvent(evt);
501
+ }
502
+ if (evt.defaultPrevented && jQueryEvent) {
503
+ jQueryEvent.preventDefault();
504
+ }
505
+ return evt;
506
+ }
507
+ };
508
+ function hydrateObj(obj, meta = {}) {
509
+ for (const [key, value] of Object.entries(meta)) {
510
+ try {
511
+ obj[key] = value;
512
+ } catch (_unused) {
513
+ Object.defineProperty(obj, key, {
514
+ configurable: true,
515
+ get() {
516
+ return value;
517
+ }
518
+ });
519
+ }
520
+ }
521
+ return obj;
522
+ }
523
+
524
+ /**
525
+ * --------------------------------------------------------------------------
526
+ * Bootstrap dom/manipulator.js
527
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
528
+ * --------------------------------------------------------------------------
529
+ */
530
+
531
+ function normalizeData(value) {
532
+ if (value === 'true') {
533
+ return true;
534
+ }
535
+ if (value === 'false') {
536
+ return false;
537
+ }
538
+ if (value === Number(value).toString()) {
539
+ return Number(value);
540
+ }
541
+ if (value === '' || value === 'null') {
542
+ return null;
543
+ }
544
+ if (typeof value !== 'string') {
545
+ return value;
546
+ }
547
+ try {
548
+ return JSON.parse(decodeURIComponent(value));
549
+ } catch (_unused) {
550
+ return value;
551
+ }
552
+ }
553
+ function normalizeDataKey(key) {
554
+ return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
555
+ }
556
+ const Manipulator = {
557
+ setDataAttribute(element, key, value) {
558
+ element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
559
+ },
560
+ removeDataAttribute(element, key) {
561
+ element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
562
+ },
563
+ getDataAttributes(element) {
564
+ if (!element) {
565
+ return {};
566
+ }
567
+ const attributes = {};
568
+ const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
569
+ for (const key of bsKeys) {
570
+ let pureKey = key.replace(/^bs/, '');
571
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1);
572
+ attributes[pureKey] = normalizeData(element.dataset[key]);
573
+ }
574
+ return attributes;
575
+ },
576
+ getDataAttribute(element, key) {
577
+ return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
578
+ }
579
+ };
580
+
581
+ /**
582
+ * --------------------------------------------------------------------------
583
+ * Bootstrap util/config.js
584
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
585
+ * --------------------------------------------------------------------------
586
+ */
587
+
588
+
589
+ /**
590
+ * Class definition
591
+ */
592
+
593
+ class Config {
594
+ // Getters
595
+ static get Default() {
596
+ return {};
597
+ }
598
+ static get DefaultType() {
599
+ return {};
600
+ }
601
+ static get NAME() {
602
+ throw new Error('You have to implement the static method "NAME", for each component!');
603
+ }
604
+ _getConfig(config) {
605
+ config = this._mergeConfigObj(config);
606
+ config = this._configAfterMerge(config);
607
+ this._typeCheckConfig(config);
608
+ return config;
609
+ }
610
+ _configAfterMerge(config) {
611
+ return config;
612
+ }
613
+ _mergeConfigObj(config, element) {
614
+ const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse
615
+
616
+ return {
617
+ ...this.constructor.Default,
618
+ ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
619
+ ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),
620
+ ...(typeof config === 'object' ? config : {})
621
+ };
622
+ }
623
+ _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
624
+ for (const [property, expectedTypes] of Object.entries(configTypes)) {
625
+ const value = config[property];
626
+ const valueType = isElement(value) ? 'element' : toType(value);
627
+ if (!new RegExp(expectedTypes).test(valueType)) {
628
+ throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
629
+ }
630
+ }
631
+ }
632
+ }
633
+
634
+ /**
635
+ * --------------------------------------------------------------------------
636
+ * Bootstrap base-component.js
637
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
638
+ * --------------------------------------------------------------------------
639
+ */
640
+
641
+
642
+ /**
643
+ * Constants
644
+ */
645
+
646
+ const VERSION = '5.3.8';
647
+
648
+ /**
649
+ * Class definition
650
+ */
651
+
652
+ class BaseComponent extends Config {
653
+ constructor(element, config) {
654
+ super();
655
+ element = getElement(element);
656
+ if (!element) {
657
+ return;
658
+ }
659
+ this._element = element;
660
+ this._config = this._getConfig(config);
661
+ Data.set(this._element, this.constructor.DATA_KEY, this);
662
+ }
663
+
664
+ // Public
665
+ dispose() {
666
+ Data.remove(this._element, this.constructor.DATA_KEY);
667
+ EventHandler.off(this._element, this.constructor.EVENT_KEY);
668
+ for (const propertyName of Object.getOwnPropertyNames(this)) {
669
+ this[propertyName] = null;
670
+ }
671
+ }
672
+
673
+ // Private
674
+ _queueCallback(callback, element, isAnimated = true) {
675
+ executeAfterTransition(callback, element, isAnimated);
676
+ }
677
+ _getConfig(config) {
678
+ config = this._mergeConfigObj(config, this._element);
679
+ config = this._configAfterMerge(config);
680
+ this._typeCheckConfig(config);
681
+ return config;
682
+ }
683
+
684
+ // Static
685
+ static getInstance(element) {
686
+ return Data.get(getElement(element), this.DATA_KEY);
687
+ }
688
+ static getOrCreateInstance(element, config = {}) {
689
+ return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
690
+ }
691
+ static get VERSION() {
692
+ return VERSION;
693
+ }
694
+ static get DATA_KEY() {
695
+ return `bs.${this.NAME}`;
696
+ }
697
+ static get EVENT_KEY() {
698
+ return `.${this.DATA_KEY}`;
699
+ }
700
+ static eventName(name) {
701
+ return `${name}${this.EVENT_KEY}`;
702
+ }
703
+ }
704
+
705
+ /**
706
+ * --------------------------------------------------------------------------
707
+ * Bootstrap dom/selector-engine.js
708
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
709
+ * --------------------------------------------------------------------------
710
+ */
711
+
712
+ const getSelector = element => {
713
+ let selector = element.getAttribute('data-bs-target');
714
+ if (!selector || selector === '#') {
715
+ let hrefAttribute = element.getAttribute('href');
716
+
717
+ // The only valid content that could double as a selector are IDs or classes,
718
+ // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
719
+ // `document.querySelector` will rightfully complain it is invalid.
720
+ // See https://github.com/twbs/bootstrap/issues/32273
721
+ if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
722
+ return null;
723
+ }
724
+
725
+ // Just in case some CMS puts out a full URL with the anchor appended
726
+ if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
727
+ hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
728
+ }
729
+ selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
730
+ }
731
+ return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;
732
+ };
733
+ const SelectorEngine = {
734
+ find(selector, element = document.documentElement) {
735
+ return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
736
+ },
737
+ findOne(selector, element = document.documentElement) {
738
+ return Element.prototype.querySelector.call(element, selector);
739
+ },
740
+ children(element, selector) {
741
+ return [].concat(...element.children).filter(child => child.matches(selector));
742
+ },
743
+ parents(element, selector) {
744
+ const parents = [];
745
+ let ancestor = element.parentNode.closest(selector);
746
+ while (ancestor) {
747
+ parents.push(ancestor);
748
+ ancestor = ancestor.parentNode.closest(selector);
749
+ }
750
+ return parents;
751
+ },
752
+ prev(element, selector) {
753
+ let previous = element.previousElementSibling;
754
+ while (previous) {
755
+ if (previous.matches(selector)) {
756
+ return [previous];
757
+ }
758
+ previous = previous.previousElementSibling;
759
+ }
760
+ return [];
761
+ },
762
+ // TODO: this is now unused; remove later along with prev()
763
+ next(element, selector) {
764
+ let next = element.nextElementSibling;
765
+ while (next) {
766
+ if (next.matches(selector)) {
767
+ return [next];
768
+ }
769
+ next = next.nextElementSibling;
770
+ }
771
+ return [];
772
+ },
773
+ focusableChildren(element) {
774
+ const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
775
+ return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
776
+ },
777
+ getSelectorFromElement(element) {
778
+ const selector = getSelector(element);
779
+ if (selector) {
780
+ return SelectorEngine.findOne(selector) ? selector : null;
781
+ }
782
+ return null;
783
+ },
784
+ getElementFromSelector(element) {
785
+ const selector = getSelector(element);
786
+ return selector ? SelectorEngine.findOne(selector) : null;
787
+ },
788
+ getMultipleElementsFromSelector(element) {
789
+ const selector = getSelector(element);
790
+ return selector ? SelectorEngine.find(selector) : [];
791
+ }
792
+ };
793
+
794
+ /**
795
+ * --------------------------------------------------------------------------
796
+ * Bootstrap util/component-functions.js
797
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
798
+ * --------------------------------------------------------------------------
799
+ */
800
+
801
+ const enableDismissTrigger = (component, method = 'hide') => {
802
+ const clickEvent = `click.dismiss${component.EVENT_KEY}`;
803
+ const name = component.NAME;
804
+ EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
805
+ if (['A', 'AREA'].includes(this.tagName)) {
806
+ event.preventDefault();
807
+ }
808
+ if (isDisabled(this)) {
809
+ return;
810
+ }
811
+ const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);
812
+ const instance = component.getOrCreateInstance(target);
813
+
814
+ // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
815
+ instance[method]();
816
+ });
817
+ };
818
+
819
+ /**
820
+ * --------------------------------------------------------------------------
821
+ * Bootstrap alert.js
822
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
823
+ * --------------------------------------------------------------------------
824
+ */
825
+
826
+
827
+ /**
828
+ * Constants
829
+ */
830
+
831
+ const NAME$f = 'alert';
832
+ const DATA_KEY$a = 'bs.alert';
833
+ const EVENT_KEY$b = `.${DATA_KEY$a}`;
834
+ const EVENT_CLOSE = `close${EVENT_KEY$b}`;
835
+ const EVENT_CLOSED = `closed${EVENT_KEY$b}`;
836
+ const CLASS_NAME_FADE$5 = 'fade';
837
+ const CLASS_NAME_SHOW$8 = 'show';
838
+
839
+ /**
840
+ * Class definition
841
+ */
842
+
843
+ class Alert extends BaseComponent {
844
+ // Getters
845
+ static get NAME() {
846
+ return NAME$f;
847
+ }
848
+
849
+ // Public
850
+ close() {
851
+ const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
852
+ if (closeEvent.defaultPrevented) {
853
+ return;
854
+ }
855
+ this._element.classList.remove(CLASS_NAME_SHOW$8);
856
+ const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
857
+ this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
858
+ }
859
+
860
+ // Private
861
+ _destroyElement() {
862
+ this._element.remove();
863
+ EventHandler.trigger(this._element, EVENT_CLOSED);
864
+ this.dispose();
865
+ }
866
+
867
+ // Static
868
+ static jQueryInterface(config) {
869
+ return this.each(function () {
870
+ const data = Alert.getOrCreateInstance(this);
871
+ if (typeof config !== 'string') {
872
+ return;
873
+ }
874
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
875
+ throw new TypeError(`No method named "${config}"`);
876
+ }
877
+ data[config](this);
878
+ });
879
+ }
880
+ }
881
+
882
+ /**
883
+ * Data API implementation
884
+ */
885
+
886
+ enableDismissTrigger(Alert, 'close');
887
+
888
+ /**
889
+ * jQuery
890
+ */
891
+
892
+ defineJQueryPlugin(Alert);
893
+
894
+ /**
895
+ * --------------------------------------------------------------------------
896
+ * Bootstrap button.js
897
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
898
+ * --------------------------------------------------------------------------
899
+ */
900
+
901
+
902
+ /**
903
+ * Constants
904
+ */
905
+
906
+ const NAME$e = 'button';
907
+ const DATA_KEY$9 = 'bs.button';
908
+ const EVENT_KEY$a = `.${DATA_KEY$9}`;
909
+ const DATA_API_KEY$6 = '.data-api';
910
+ const CLASS_NAME_ACTIVE$3 = 'active';
911
+ const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
912
+ const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
913
+
914
+ /**
915
+ * Class definition
916
+ */
917
+
918
+ class Button extends BaseComponent {
919
+ // Getters
920
+ static get NAME() {
921
+ return NAME$e;
922
+ }
923
+
924
+ // Public
925
+ toggle() {
926
+ // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
927
+ this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));
928
+ }
929
+
930
+ // Static
931
+ static jQueryInterface(config) {
932
+ return this.each(function () {
933
+ const data = Button.getOrCreateInstance(this);
934
+ if (config === 'toggle') {
935
+ data[config]();
936
+ }
937
+ });
938
+ }
939
+ }
940
+
941
+ /**
942
+ * Data API implementation
943
+ */
944
+
945
+ EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {
946
+ event.preventDefault();
947
+ const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);
948
+ const data = Button.getOrCreateInstance(button);
949
+ data.toggle();
950
+ });
951
+
952
+ /**
953
+ * jQuery
954
+ */
955
+
956
+ defineJQueryPlugin(Button);
957
+
958
+ /**
959
+ * --------------------------------------------------------------------------
960
+ * Bootstrap util/swipe.js
961
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
962
+ * --------------------------------------------------------------------------
963
+ */
964
+
965
+
966
+ /**
967
+ * Constants
968
+ */
969
+
970
+ const NAME$d = 'swipe';
971
+ const EVENT_KEY$9 = '.bs.swipe';
972
+ const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;
973
+ const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;
974
+ const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;
975
+ const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;
976
+ const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;
977
+ const POINTER_TYPE_TOUCH = 'touch';
978
+ const POINTER_TYPE_PEN = 'pen';
979
+ const CLASS_NAME_POINTER_EVENT = 'pointer-event';
980
+ const SWIPE_THRESHOLD = 40;
981
+ const Default$c = {
982
+ endCallback: null,
983
+ leftCallback: null,
984
+ rightCallback: null
985
+ };
986
+ const DefaultType$c = {
987
+ endCallback: '(function|null)',
988
+ leftCallback: '(function|null)',
989
+ rightCallback: '(function|null)'
990
+ };
991
+
992
+ /**
993
+ * Class definition
994
+ */
995
+
996
+ class Swipe extends Config {
997
+ constructor(element, config) {
998
+ super();
999
+ this._element = element;
1000
+ if (!element || !Swipe.isSupported()) {
1001
+ return;
1002
+ }
1003
+ this._config = this._getConfig(config);
1004
+ this._deltaX = 0;
1005
+ this._supportPointerEvents = Boolean(window.PointerEvent);
1006
+ this._initEvents();
1007
+ }
1008
+
1009
+ // Getters
1010
+ static get Default() {
1011
+ return Default$c;
1012
+ }
1013
+ static get DefaultType() {
1014
+ return DefaultType$c;
1015
+ }
1016
+ static get NAME() {
1017
+ return NAME$d;
1018
+ }
1019
+
1020
+ // Public
1021
+ dispose() {
1022
+ EventHandler.off(this._element, EVENT_KEY$9);
1023
+ }
1024
+
1025
+ // Private
1026
+ _start(event) {
1027
+ if (!this._supportPointerEvents) {
1028
+ this._deltaX = event.touches[0].clientX;
1029
+ return;
1030
+ }
1031
+ if (this._eventIsPointerPenTouch(event)) {
1032
+ this._deltaX = event.clientX;
1033
+ }
1034
+ }
1035
+ _end(event) {
1036
+ if (this._eventIsPointerPenTouch(event)) {
1037
+ this._deltaX = event.clientX - this._deltaX;
1038
+ }
1039
+ this._handleSwipe();
1040
+ execute(this._config.endCallback);
1041
+ }
1042
+ _move(event) {
1043
+ this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;
1044
+ }
1045
+ _handleSwipe() {
1046
+ const absDeltaX = Math.abs(this._deltaX);
1047
+ if (absDeltaX <= SWIPE_THRESHOLD) {
1048
+ return;
1049
+ }
1050
+ const direction = absDeltaX / this._deltaX;
1051
+ this._deltaX = 0;
1052
+ if (!direction) {
1053
+ return;
1054
+ }
1055
+ execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);
1056
+ }
1057
+ _initEvents() {
1058
+ if (this._supportPointerEvents) {
1059
+ EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));
1060
+ EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));
1061
+ this._element.classList.add(CLASS_NAME_POINTER_EVENT);
1062
+ } else {
1063
+ EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));
1064
+ EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));
1065
+ EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));
1066
+ }
1067
+ }
1068
+ _eventIsPointerPenTouch(event) {
1069
+ return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
1070
+ }
1071
+
1072
+ // Static
1073
+ static isSupported() {
1074
+ return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
1075
+ }
1076
+ }
1077
+
1078
+ /**
1079
+ * --------------------------------------------------------------------------
1080
+ * Bootstrap carousel.js
1081
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1082
+ * --------------------------------------------------------------------------
1083
+ */
1084
+
1085
+
1086
+ /**
1087
+ * Constants
1088
+ */
1089
+
1090
+ const NAME$c = 'carousel';
1091
+ const DATA_KEY$8 = 'bs.carousel';
1092
+ const EVENT_KEY$8 = `.${DATA_KEY$8}`;
1093
+ const DATA_API_KEY$5 = '.data-api';
1094
+ const ARROW_LEFT_KEY$1 = 'ArrowLeft';
1095
+ const ARROW_RIGHT_KEY$1 = 'ArrowRight';
1096
+ const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
1097
+
1098
+ const ORDER_NEXT = 'next';
1099
+ const ORDER_PREV = 'prev';
1100
+ const DIRECTION_LEFT = 'left';
1101
+ const DIRECTION_RIGHT = 'right';
1102
+ const EVENT_SLIDE = `slide${EVENT_KEY$8}`;
1103
+ const EVENT_SLID = `slid${EVENT_KEY$8}`;
1104
+ const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;
1105
+ const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;
1106
+ const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;
1107
+ const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;
1108
+ const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;
1109
+ const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
1110
+ const CLASS_NAME_CAROUSEL = 'carousel';
1111
+ const CLASS_NAME_ACTIVE$2 = 'active';
1112
+ const CLASS_NAME_SLIDE = 'slide';
1113
+ const CLASS_NAME_END = 'carousel-item-end';
1114
+ const CLASS_NAME_START = 'carousel-item-start';
1115
+ const CLASS_NAME_NEXT = 'carousel-item-next';
1116
+ const CLASS_NAME_PREV = 'carousel-item-prev';
1117
+ const SELECTOR_ACTIVE = '.active';
1118
+ const SELECTOR_ITEM = '.carousel-item';
1119
+ const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;
1120
+ const SELECTOR_ITEM_IMG = '.carousel-item img';
1121
+ const SELECTOR_INDICATORS = '.carousel-indicators';
1122
+ const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
1123
+ const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
1124
+ const KEY_TO_DIRECTION = {
1125
+ [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,
1126
+ [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT
1127
+ };
1128
+ const Default$b = {
1129
+ interval: 5000,
1130
+ keyboard: true,
1131
+ pause: 'hover',
1132
+ ride: false,
1133
+ touch: true,
1134
+ wrap: true
1135
+ };
1136
+ const DefaultType$b = {
1137
+ interval: '(number|boolean)',
1138
+ // TODO:v6 remove boolean support
1139
+ keyboard: 'boolean',
1140
+ pause: '(string|boolean)',
1141
+ ride: '(boolean|string)',
1142
+ touch: 'boolean',
1143
+ wrap: 'boolean'
1144
+ };
1145
+
1146
+ /**
1147
+ * Class definition
1148
+ */
1149
+
1150
+ class Carousel extends BaseComponent {
1151
+ constructor(element, config) {
1152
+ super(element, config);
1153
+ this._interval = null;
1154
+ this._activeElement = null;
1155
+ this._isSliding = false;
1156
+ this.touchTimeout = null;
1157
+ this._swipeHelper = null;
1158
+ this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
1159
+ this._addEventListeners();
1160
+ if (this._config.ride === CLASS_NAME_CAROUSEL) {
1161
+ this.cycle();
1162
+ }
1163
+ }
1164
+
1165
+ // Getters
1166
+ static get Default() {
1167
+ return Default$b;
1168
+ }
1169
+ static get DefaultType() {
1170
+ return DefaultType$b;
1171
+ }
1172
+ static get NAME() {
1173
+ return NAME$c;
1174
+ }
1175
+
1176
+ // Public
1177
+ next() {
1178
+ this._slide(ORDER_NEXT);
1179
+ }
1180
+ nextWhenVisible() {
1181
+ // FIXME TODO use `document.visibilityState`
1182
+ // Don't call next when the page isn't visible
1183
+ // or the carousel or its parent isn't visible
1184
+ if (!document.hidden && isVisible(this._element)) {
1185
+ this.next();
1186
+ }
1187
+ }
1188
+ prev() {
1189
+ this._slide(ORDER_PREV);
1190
+ }
1191
+ pause() {
1192
+ if (this._isSliding) {
1193
+ triggerTransitionEnd(this._element);
1194
+ }
1195
+ this._clearInterval();
1196
+ }
1197
+ cycle() {
1198
+ this._clearInterval();
1199
+ this._updateInterval();
1200
+ this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);
1201
+ }
1202
+ _maybeEnableCycle() {
1203
+ if (!this._config.ride) {
1204
+ return;
1205
+ }
1206
+ if (this._isSliding) {
1207
+ EventHandler.one(this._element, EVENT_SLID, () => this.cycle());
1208
+ return;
1209
+ }
1210
+ this.cycle();
1211
+ }
1212
+ to(index) {
1213
+ const items = this._getItems();
1214
+ if (index > items.length - 1 || index < 0) {
1215
+ return;
1216
+ }
1217
+ if (this._isSliding) {
1218
+ EventHandler.one(this._element, EVENT_SLID, () => this.to(index));
1219
+ return;
1220
+ }
1221
+ const activeIndex = this._getItemIndex(this._getActive());
1222
+ if (activeIndex === index) {
1223
+ return;
1224
+ }
1225
+ const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
1226
+ this._slide(order, items[index]);
1227
+ }
1228
+ dispose() {
1229
+ if (this._swipeHelper) {
1230
+ this._swipeHelper.dispose();
1231
+ }
1232
+ super.dispose();
1233
+ }
1234
+
1235
+ // Private
1236
+ _configAfterMerge(config) {
1237
+ config.defaultInterval = config.interval;
1238
+ return config;
1239
+ }
1240
+ _addEventListeners() {
1241
+ if (this._config.keyboard) {
1242
+ EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));
1243
+ }
1244
+ if (this._config.pause === 'hover') {
1245
+ EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());
1246
+ EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());
1247
+ }
1248
+ if (this._config.touch && Swipe.isSupported()) {
1249
+ this._addTouchEventListeners();
1250
+ }
1251
+ }
1252
+ _addTouchEventListeners() {
1253
+ for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {
1254
+ EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());
1255
+ }
1256
+ const endCallBack = () => {
1257
+ if (this._config.pause !== 'hover') {
1258
+ return;
1259
+ }
1260
+
1261
+ // If it's a touch-enabled device, mouseenter/leave are fired as
1262
+ // part of the mouse compatibility events on first tap - the carousel
1263
+ // would stop cycling until user tapped out of it;
1264
+ // here, we listen for touchend, explicitly pause the carousel
1265
+ // (as if it's the second time we tap on it, mouseenter compat event
1266
+ // is NOT fired) and after a timeout (to allow for mouse compatibility
1267
+ // events to fire) we explicitly restart cycling
1268
+
1269
+ this.pause();
1270
+ if (this.touchTimeout) {
1271
+ clearTimeout(this.touchTimeout);
1272
+ }
1273
+ this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);
1274
+ };
1275
+ const swipeConfig = {
1276
+ leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),
1277
+ rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),
1278
+ endCallback: endCallBack
1279
+ };
1280
+ this._swipeHelper = new Swipe(this._element, swipeConfig);
1281
+ }
1282
+ _keydown(event) {
1283
+ if (/input|textarea/i.test(event.target.tagName)) {
1284
+ return;
1285
+ }
1286
+ const direction = KEY_TO_DIRECTION[event.key];
1287
+ if (direction) {
1288
+ event.preventDefault();
1289
+ this._slide(this._directionToOrder(direction));
1290
+ }
1291
+ }
1292
+ _getItemIndex(element) {
1293
+ return this._getItems().indexOf(element);
1294
+ }
1295
+ _setActiveIndicatorElement(index) {
1296
+ if (!this._indicatorsElement) {
1297
+ return;
1298
+ }
1299
+ const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
1300
+ activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);
1301
+ activeIndicator.removeAttribute('aria-current');
1302
+ const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement);
1303
+ if (newActiveIndicator) {
1304
+ newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);
1305
+ newActiveIndicator.setAttribute('aria-current', 'true');
1306
+ }
1307
+ }
1308
+ _updateInterval() {
1309
+ const element = this._activeElement || this._getActive();
1310
+ if (!element) {
1311
+ return;
1312
+ }
1313
+ const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
1314
+ this._config.interval = elementInterval || this._config.defaultInterval;
1315
+ }
1316
+ _slide(order, element = null) {
1317
+ if (this._isSliding) {
1318
+ return;
1319
+ }
1320
+ const activeElement = this._getActive();
1321
+ const isNext = order === ORDER_NEXT;
1322
+ const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);
1323
+ if (nextElement === activeElement) {
1324
+ return;
1325
+ }
1326
+ const nextElementIndex = this._getItemIndex(nextElement);
1327
+ const triggerEvent = eventName => {
1328
+ return EventHandler.trigger(this._element, eventName, {
1329
+ relatedTarget: nextElement,
1330
+ direction: this._orderToDirection(order),
1331
+ from: this._getItemIndex(activeElement),
1332
+ to: nextElementIndex
1333
+ });
1334
+ };
1335
+ const slideEvent = triggerEvent(EVENT_SLIDE);
1336
+ if (slideEvent.defaultPrevented) {
1337
+ return;
1338
+ }
1339
+ if (!activeElement || !nextElement) {
1340
+ // Some weirdness is happening, so we bail
1341
+ // TODO: change tests that use empty divs to avoid this check
1342
+ return;
1343
+ }
1344
+ const isCycling = Boolean(this._interval);
1345
+ this.pause();
1346
+ this._isSliding = true;
1347
+ this._setActiveIndicatorElement(nextElementIndex);
1348
+ this._activeElement = nextElement;
1349
+ const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
1350
+ const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
1351
+ nextElement.classList.add(orderClassName);
1352
+ reflow(nextElement);
1353
+ activeElement.classList.add(directionalClassName);
1354
+ nextElement.classList.add(directionalClassName);
1355
+ const completeCallBack = () => {
1356
+ nextElement.classList.remove(directionalClassName, orderClassName);
1357
+ nextElement.classList.add(CLASS_NAME_ACTIVE$2);
1358
+ activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);
1359
+ this._isSliding = false;
1360
+ triggerEvent(EVENT_SLID);
1361
+ };
1362
+ this._queueCallback(completeCallBack, activeElement, this._isAnimated());
1363
+ if (isCycling) {
1364
+ this.cycle();
1365
+ }
1366
+ }
1367
+ _isAnimated() {
1368
+ return this._element.classList.contains(CLASS_NAME_SLIDE);
1369
+ }
1370
+ _getActive() {
1371
+ return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
1372
+ }
1373
+ _getItems() {
1374
+ return SelectorEngine.find(SELECTOR_ITEM, this._element);
1375
+ }
1376
+ _clearInterval() {
1377
+ if (this._interval) {
1378
+ clearInterval(this._interval);
1379
+ this._interval = null;
1380
+ }
1381
+ }
1382
+ _directionToOrder(direction) {
1383
+ if (isRTL()) {
1384
+ return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;
1385
+ }
1386
+ return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
1387
+ }
1388
+ _orderToDirection(order) {
1389
+ if (isRTL()) {
1390
+ return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
1391
+ }
1392
+ return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;
1393
+ }
1394
+
1395
+ // Static
1396
+ static jQueryInterface(config) {
1397
+ return this.each(function () {
1398
+ const data = Carousel.getOrCreateInstance(this, config);
1399
+ if (typeof config === 'number') {
1400
+ data.to(config);
1401
+ return;
1402
+ }
1403
+ if (typeof config === 'string') {
1404
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
1405
+ throw new TypeError(`No method named "${config}"`);
1406
+ }
1407
+ data[config]();
1408
+ }
1409
+ });
1410
+ }
1411
+ }
1412
+
1413
+ /**
1414
+ * Data API implementation
1415
+ */
1416
+
1417
+ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {
1418
+ const target = SelectorEngine.getElementFromSelector(this);
1419
+ if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
1420
+ return;
1421
+ }
1422
+ event.preventDefault();
1423
+ const carousel = Carousel.getOrCreateInstance(target);
1424
+ const slideIndex = this.getAttribute('data-bs-slide-to');
1425
+ if (slideIndex) {
1426
+ carousel.to(slideIndex);
1427
+ carousel._maybeEnableCycle();
1428
+ return;
1429
+ }
1430
+ if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
1431
+ carousel.next();
1432
+ carousel._maybeEnableCycle();
1433
+ return;
1434
+ }
1435
+ carousel.prev();
1436
+ carousel._maybeEnableCycle();
1437
+ });
1438
+ EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {
1439
+ const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
1440
+ for (const carousel of carousels) {
1441
+ Carousel.getOrCreateInstance(carousel);
1442
+ }
1443
+ });
1444
+
1445
+ /**
1446
+ * jQuery
1447
+ */
1448
+
1449
+ defineJQueryPlugin(Carousel);
1450
+
1451
+ /**
1452
+ * --------------------------------------------------------------------------
1453
+ * Bootstrap collapse.js
1454
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1455
+ * --------------------------------------------------------------------------
1456
+ */
1457
+
1458
+
1459
+ /**
1460
+ * Constants
1461
+ */
1462
+
1463
+ const NAME$b = 'collapse';
1464
+ const DATA_KEY$7 = 'bs.collapse';
1465
+ const EVENT_KEY$7 = `.${DATA_KEY$7}`;
1466
+ const DATA_API_KEY$4 = '.data-api';
1467
+ const EVENT_SHOW$6 = `show${EVENT_KEY$7}`;
1468
+ const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;
1469
+ const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;
1470
+ const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;
1471
+ const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
1472
+ const CLASS_NAME_SHOW$7 = 'show';
1473
+ const CLASS_NAME_COLLAPSE = 'collapse';
1474
+ const CLASS_NAME_COLLAPSING = 'collapsing';
1475
+ const CLASS_NAME_COLLAPSED = 'collapsed';
1476
+ const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
1477
+ const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
1478
+ const WIDTH = 'width';
1479
+ const HEIGHT = 'height';
1480
+ const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
1481
+ const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
1482
+ const Default$a = {
1483
+ parent: null,
1484
+ toggle: true
1485
+ };
1486
+ const DefaultType$a = {
1487
+ parent: '(null|element)',
1488
+ toggle: 'boolean'
1489
+ };
1490
+
1491
+ /**
1492
+ * Class definition
1493
+ */
1494
+
1495
+ class Collapse extends BaseComponent {
1496
+ constructor(element, config) {
1497
+ super(element, config);
1498
+ this._isTransitioning = false;
1499
+ this._triggerArray = [];
1500
+ const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
1501
+ for (const elem of toggleList) {
1502
+ const selector = SelectorEngine.getSelectorFromElement(elem);
1503
+ const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
1504
+ if (selector !== null && filterElement.length) {
1505
+ this._triggerArray.push(elem);
1506
+ }
1507
+ }
1508
+ this._initializeChildren();
1509
+ if (!this._config.parent) {
1510
+ this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
1511
+ }
1512
+ if (this._config.toggle) {
1513
+ this.toggle();
1514
+ }
1515
+ }
1516
+
1517
+ // Getters
1518
+ static get Default() {
1519
+ return Default$a;
1520
+ }
1521
+ static get DefaultType() {
1522
+ return DefaultType$a;
1523
+ }
1524
+ static get NAME() {
1525
+ return NAME$b;
1526
+ }
1527
+
1528
+ // Public
1529
+ toggle() {
1530
+ if (this._isShown()) {
1531
+ this.hide();
1532
+ } else {
1533
+ this.show();
1534
+ }
1535
+ }
1536
+ show() {
1537
+ if (this._isTransitioning || this._isShown()) {
1538
+ return;
1539
+ }
1540
+ let activeChildren = [];
1541
+
1542
+ // find active children
1543
+ if (this._config.parent) {
1544
+ activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {
1545
+ toggle: false
1546
+ }));
1547
+ }
1548
+ if (activeChildren.length && activeChildren[0]._isTransitioning) {
1549
+ return;
1550
+ }
1551
+ const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);
1552
+ if (startEvent.defaultPrevented) {
1553
+ return;
1554
+ }
1555
+ for (const activeInstance of activeChildren) {
1556
+ activeInstance.hide();
1557
+ }
1558
+ const dimension = this._getDimension();
1559
+ this._element.classList.remove(CLASS_NAME_COLLAPSE);
1560
+ this._element.classList.add(CLASS_NAME_COLLAPSING);
1561
+ this._element.style[dimension] = 0;
1562
+ this._addAriaAndCollapsedClass(this._triggerArray, true);
1563
+ this._isTransitioning = true;
1564
+ const complete = () => {
1565
+ this._isTransitioning = false;
1566
+ this._element.classList.remove(CLASS_NAME_COLLAPSING);
1567
+ this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
1568
+ this._element.style[dimension] = '';
1569
+ EventHandler.trigger(this._element, EVENT_SHOWN$6);
1570
+ };
1571
+ const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1572
+ const scrollSize = `scroll${capitalizedDimension}`;
1573
+ this._queueCallback(complete, this._element, true);
1574
+ this._element.style[dimension] = `${this._element[scrollSize]}px`;
1575
+ }
1576
+ hide() {
1577
+ if (this._isTransitioning || !this._isShown()) {
1578
+ return;
1579
+ }
1580
+ const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);
1581
+ if (startEvent.defaultPrevented) {
1582
+ return;
1583
+ }
1584
+ const dimension = this._getDimension();
1585
+ this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;
1586
+ reflow(this._element);
1587
+ this._element.classList.add(CLASS_NAME_COLLAPSING);
1588
+ this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
1589
+ for (const trigger of this._triggerArray) {
1590
+ const element = SelectorEngine.getElementFromSelector(trigger);
1591
+ if (element && !this._isShown(element)) {
1592
+ this._addAriaAndCollapsedClass([trigger], false);
1593
+ }
1594
+ }
1595
+ this._isTransitioning = true;
1596
+ const complete = () => {
1597
+ this._isTransitioning = false;
1598
+ this._element.classList.remove(CLASS_NAME_COLLAPSING);
1599
+ this._element.classList.add(CLASS_NAME_COLLAPSE);
1600
+ EventHandler.trigger(this._element, EVENT_HIDDEN$6);
1601
+ };
1602
+ this._element.style[dimension] = '';
1603
+ this._queueCallback(complete, this._element, true);
1604
+ }
1605
+
1606
+ // Private
1607
+ _isShown(element = this._element) {
1608
+ return element.classList.contains(CLASS_NAME_SHOW$7);
1609
+ }
1610
+ _configAfterMerge(config) {
1611
+ config.toggle = Boolean(config.toggle); // Coerce string values
1612
+ config.parent = getElement(config.parent);
1613
+ return config;
1614
+ }
1615
+ _getDimension() {
1616
+ return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
1617
+ }
1618
+ _initializeChildren() {
1619
+ if (!this._config.parent) {
1620
+ return;
1621
+ }
1622
+ const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);
1623
+ for (const element of children) {
1624
+ const selected = SelectorEngine.getElementFromSelector(element);
1625
+ if (selected) {
1626
+ this._addAriaAndCollapsedClass([element], this._isShown(selected));
1627
+ }
1628
+ }
1629
+ }
1630
+ _getFirstLevelChildren(selector) {
1631
+ const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
1632
+ // remove children if greater depth
1633
+ return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));
1634
+ }
1635
+ _addAriaAndCollapsedClass(triggerArray, isOpen) {
1636
+ if (!triggerArray.length) {
1637
+ return;
1638
+ }
1639
+ for (const element of triggerArray) {
1640
+ element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);
1641
+ element.setAttribute('aria-expanded', isOpen);
1642
+ }
1643
+ }
1644
+
1645
+ // Static
1646
+ static jQueryInterface(config) {
1647
+ const _config = {};
1648
+ if (typeof config === 'string' && /show|hide/.test(config)) {
1649
+ _config.toggle = false;
1650
+ }
1651
+ return this.each(function () {
1652
+ const data = Collapse.getOrCreateInstance(this, _config);
1653
+ if (typeof config === 'string') {
1654
+ if (typeof data[config] === 'undefined') {
1655
+ throw new TypeError(`No method named "${config}"`);
1656
+ }
1657
+ data[config]();
1658
+ }
1659
+ });
1660
+ }
1661
+ }
1662
+
1663
+ /**
1664
+ * Data API implementation
1665
+ */
1666
+
1667
+ EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {
1668
+ // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
1669
+ if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
1670
+ event.preventDefault();
1671
+ }
1672
+ for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {
1673
+ Collapse.getOrCreateInstance(element, {
1674
+ toggle: false
1675
+ }).toggle();
1676
+ }
1677
+ });
1678
+
1679
+ /**
1680
+ * jQuery
1681
+ */
1682
+
1683
+ defineJQueryPlugin(Collapse);
1684
+
1685
+ /**
1686
+ * --------------------------------------------------------------------------
1687
+ * Bootstrap dropdown.js
1688
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1689
+ * --------------------------------------------------------------------------
1690
+ */
1691
+
1692
+
1693
+ /**
1694
+ * Constants
1695
+ */
1696
+
1697
+ const NAME$a = 'dropdown';
1698
+ const DATA_KEY$6 = 'bs.dropdown';
1699
+ const EVENT_KEY$6 = `.${DATA_KEY$6}`;
1700
+ const DATA_API_KEY$3 = '.data-api';
1701
+ const ESCAPE_KEY$2 = 'Escape';
1702
+ const TAB_KEY$1 = 'Tab';
1703
+ const ARROW_UP_KEY$1 = 'ArrowUp';
1704
+ const ARROW_DOWN_KEY$1 = 'ArrowDown';
1705
+ const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
1706
+
1707
+ const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;
1708
+ const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;
1709
+ const EVENT_SHOW$5 = `show${EVENT_KEY$6}`;
1710
+ const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;
1711
+ const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
1712
+ const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;
1713
+ const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;
1714
+ const CLASS_NAME_SHOW$6 = 'show';
1715
+ const CLASS_NAME_DROPUP = 'dropup';
1716
+ const CLASS_NAME_DROPEND = 'dropend';
1717
+ const CLASS_NAME_DROPSTART = 'dropstart';
1718
+ const CLASS_NAME_DROPUP_CENTER = 'dropup-center';
1719
+ const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';
1720
+ const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';
1721
+ const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;
1722
+ const SELECTOR_MENU = '.dropdown-menu';
1723
+ const SELECTOR_NAVBAR = '.navbar';
1724
+ const SELECTOR_NAVBAR_NAV = '.navbar-nav';
1725
+ const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
1726
+ const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';
1727
+ const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';
1728
+ const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';
1729
+ const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
1730
+ const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
1731
+ const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
1732
+ const PLACEMENT_TOPCENTER = 'top';
1733
+ const PLACEMENT_BOTTOMCENTER = 'bottom';
1734
+ const Default$9 = {
1735
+ autoClose: true,
1736
+ boundary: 'clippingParents',
1737
+ display: 'dynamic',
1738
+ offset: [0, 2],
1739
+ popperConfig: null,
1740
+ reference: 'toggle'
1741
+ };
1742
+ const DefaultType$9 = {
1743
+ autoClose: '(boolean|string)',
1744
+ boundary: '(string|element)',
1745
+ display: 'string',
1746
+ offset: '(array|string|function)',
1747
+ popperConfig: '(null|object|function)',
1748
+ reference: '(string|element|object)'
1749
+ };
1750
+
1751
+ /**
1752
+ * Class definition
1753
+ */
1754
+
1755
+ class Dropdown extends BaseComponent {
1756
+ constructor(element, config) {
1757
+ super(element, config);
1758
+ this._popper = null;
1759
+ this._parent = this._element.parentNode; // dropdown wrapper
1760
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
1761
+ this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
1762
+ this._inNavbar = this._detectNavbar();
1763
+ }
1764
+
1765
+ // Getters
1766
+ static get Default() {
1767
+ return Default$9;
1768
+ }
1769
+ static get DefaultType() {
1770
+ return DefaultType$9;
1771
+ }
1772
+ static get NAME() {
1773
+ return NAME$a;
1774
+ }
1775
+
1776
+ // Public
1777
+ toggle() {
1778
+ return this._isShown() ? this.hide() : this.show();
1779
+ }
1780
+ show() {
1781
+ if (isDisabled(this._element) || this._isShown()) {
1782
+ return;
1783
+ }
1784
+ const relatedTarget = {
1785
+ relatedTarget: this._element
1786
+ };
1787
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);
1788
+ if (showEvent.defaultPrevented) {
1789
+ return;
1790
+ }
1791
+ this._createPopper();
1792
+
1793
+ // If this is a touch-enabled device we add extra
1794
+ // empty mouseover listeners to the body's immediate children;
1795
+ // only needed because of broken event delegation on iOS
1796
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
1797
+ if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {
1798
+ for (const element of [].concat(...document.body.children)) {
1799
+ EventHandler.on(element, 'mouseover', noop);
1800
+ }
1801
+ }
1802
+ this._element.focus();
1803
+ this._element.setAttribute('aria-expanded', true);
1804
+ this._menu.classList.add(CLASS_NAME_SHOW$6);
1805
+ this._element.classList.add(CLASS_NAME_SHOW$6);
1806
+ EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
1807
+ }
1808
+ hide() {
1809
+ if (isDisabled(this._element) || !this._isShown()) {
1810
+ return;
1811
+ }
1812
+ const relatedTarget = {
1813
+ relatedTarget: this._element
1814
+ };
1815
+ this._completeHide(relatedTarget);
1816
+ }
1817
+ dispose() {
1818
+ if (this._popper) {
1819
+ this._popper.destroy();
1820
+ }
1821
+ super.dispose();
1822
+ }
1823
+ update() {
1824
+ this._inNavbar = this._detectNavbar();
1825
+ if (this._popper) {
1826
+ this._popper.update();
1827
+ }
1828
+ }
1829
+
1830
+ // Private
1831
+ _completeHide(relatedTarget) {
1832
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
1833
+ if (hideEvent.defaultPrevented) {
1834
+ return;
1835
+ }
1836
+
1837
+ // If this is a touch-enabled device we remove the extra
1838
+ // empty mouseover listeners we added for iOS support
1839
+ if ('ontouchstart' in document.documentElement) {
1840
+ for (const element of [].concat(...document.body.children)) {
1841
+ EventHandler.off(element, 'mouseover', noop);
1842
+ }
1843
+ }
1844
+ if (this._popper) {
1845
+ this._popper.destroy();
1846
+ }
1847
+ this._menu.classList.remove(CLASS_NAME_SHOW$6);
1848
+ this._element.classList.remove(CLASS_NAME_SHOW$6);
1849
+ this._element.setAttribute('aria-expanded', 'false');
1850
+ Manipulator.removeDataAttribute(this._menu, 'popper');
1851
+ EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);
1852
+ }
1853
+ _getConfig(config) {
1854
+ config = super._getConfig(config);
1855
+ if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
1856
+ // Popper virtual elements require a getBoundingClientRect method
1857
+ throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
1858
+ }
1859
+ return config;
1860
+ }
1861
+ _createPopper() {
1862
+ if (typeof Popper === 'undefined') {
1863
+ throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org/docs/v2/)');
1864
+ }
1865
+ let referenceElement = this._element;
1866
+ if (this._config.reference === 'parent') {
1867
+ referenceElement = this._parent;
1868
+ } else if (isElement(this._config.reference)) {
1869
+ referenceElement = getElement(this._config.reference);
1870
+ } else if (typeof this._config.reference === 'object') {
1871
+ referenceElement = this._config.reference;
1872
+ }
1873
+ const popperConfig = this._getPopperConfig();
1874
+ this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig);
1875
+ }
1876
+ _isShown() {
1877
+ return this._menu.classList.contains(CLASS_NAME_SHOW$6);
1878
+ }
1879
+ _getPlacement() {
1880
+ const parentDropdown = this._parent;
1881
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
1882
+ return PLACEMENT_RIGHT;
1883
+ }
1884
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
1885
+ return PLACEMENT_LEFT;
1886
+ }
1887
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {
1888
+ return PLACEMENT_TOPCENTER;
1889
+ }
1890
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {
1891
+ return PLACEMENT_BOTTOMCENTER;
1892
+ }
1893
+
1894
+ // We need to trim the value because custom properties can also include spaces
1895
+ const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
1896
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
1897
+ return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
1898
+ }
1899
+ return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
1900
+ }
1901
+ _detectNavbar() {
1902
+ return this._element.closest(SELECTOR_NAVBAR) !== null;
1903
+ }
1904
+ _getOffset() {
1905
+ const {
1906
+ offset
1907
+ } = this._config;
1908
+ if (typeof offset === 'string') {
1909
+ return offset.split(',').map(value => Number.parseInt(value, 10));
1910
+ }
1911
+ if (typeof offset === 'function') {
1912
+ return popperData => offset(popperData, this._element);
1913
+ }
1914
+ return offset;
1915
+ }
1916
+ _getPopperConfig() {
1917
+ const defaultBsPopperConfig = {
1918
+ placement: this._getPlacement(),
1919
+ modifiers: [{
1920
+ name: 'preventOverflow',
1921
+ options: {
1922
+ boundary: this._config.boundary
1923
+ }
1924
+ }, {
1925
+ name: 'offset',
1926
+ options: {
1927
+ offset: this._getOffset()
1928
+ }
1929
+ }]
1930
+ };
1931
+
1932
+ // Disable Popper if we have a static display or Dropdown is in Navbar
1933
+ if (this._inNavbar || this._config.display === 'static') {
1934
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
1935
+ defaultBsPopperConfig.modifiers = [{
1936
+ name: 'applyStyles',
1937
+ enabled: false
1938
+ }];
1939
+ }
1940
+ return {
1941
+ ...defaultBsPopperConfig,
1942
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
1943
+ };
1944
+ }
1945
+ _selectMenuItem({
1946
+ key,
1947
+ target
1948
+ }) {
1949
+ const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));
1950
+ if (!items.length) {
1951
+ return;
1952
+ }
1953
+
1954
+ // if target isn't included in items (e.g. when expanding the dropdown)
1955
+ // allow cycling to get the last item in case key equals ARROW_UP_KEY
1956
+ getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();
1957
+ }
1958
+
1959
+ // Static
1960
+ static jQueryInterface(config) {
1961
+ return this.each(function () {
1962
+ const data = Dropdown.getOrCreateInstance(this, config);
1963
+ if (typeof config !== 'string') {
1964
+ return;
1965
+ }
1966
+ if (typeof data[config] === 'undefined') {
1967
+ throw new TypeError(`No method named "${config}"`);
1968
+ }
1969
+ data[config]();
1970
+ });
1971
+ }
1972
+ static clearMenus(event) {
1973
+ if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {
1974
+ return;
1975
+ }
1976
+ const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);
1977
+ for (const toggle of openToggles) {
1978
+ const context = Dropdown.getInstance(toggle);
1979
+ if (!context || context._config.autoClose === false) {
1980
+ continue;
1981
+ }
1982
+ const composedPath = event.composedPath();
1983
+ const isMenuTarget = composedPath.includes(context._menu);
1984
+ if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
1985
+ continue;
1986
+ }
1987
+
1988
+ // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
1989
+ if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
1990
+ continue;
1991
+ }
1992
+ const relatedTarget = {
1993
+ relatedTarget: context._element
1994
+ };
1995
+ if (event.type === 'click') {
1996
+ relatedTarget.clickEvent = event;
1997
+ }
1998
+ context._completeHide(relatedTarget);
1999
+ }
2000
+ }
2001
+ static dataApiKeydownHandler(event) {
2002
+ // If not an UP | DOWN | ESCAPE key => not a dropdown command
2003
+ // If input/textarea && if key is other than ESCAPE => not a dropdown command
2004
+
2005
+ const isInput = /input|textarea/i.test(event.target.tagName);
2006
+ const isEscapeEvent = event.key === ESCAPE_KEY$2;
2007
+ const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);
2008
+ if (!isUpOrDownEvent && !isEscapeEvent) {
2009
+ return;
2010
+ }
2011
+ if (isInput && !isEscapeEvent) {
2012
+ return;
2013
+ }
2014
+ event.preventDefault();
2015
+
2016
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
2017
+ const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
2018
+ const instance = Dropdown.getOrCreateInstance(getToggleButton);
2019
+ if (isUpOrDownEvent) {
2020
+ event.stopPropagation();
2021
+ instance.show();
2022
+ instance._selectMenuItem(event);
2023
+ return;
2024
+ }
2025
+ if (instance._isShown()) {
2026
+ // else is escape and we check if it is shown
2027
+ event.stopPropagation();
2028
+ instance.hide();
2029
+ getToggleButton.focus();
2030
+ }
2031
+ }
2032
+ }
2033
+
2034
+ /**
2035
+ * Data API implementation
2036
+ */
2037
+
2038
+ EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);
2039
+ EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
2040
+ EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);
2041
+ EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
2042
+ EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {
2043
+ event.preventDefault();
2044
+ Dropdown.getOrCreateInstance(this).toggle();
2045
+ });
2046
+
2047
+ /**
2048
+ * jQuery
2049
+ */
2050
+
2051
+ defineJQueryPlugin(Dropdown);
2052
+
2053
+ /**
2054
+ * --------------------------------------------------------------------------
2055
+ * Bootstrap util/backdrop.js
2056
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2057
+ * --------------------------------------------------------------------------
2058
+ */
2059
+
2060
+
2061
+ /**
2062
+ * Constants
2063
+ */
2064
+
2065
+ const NAME$9 = 'backdrop';
2066
+ const CLASS_NAME_FADE$4 = 'fade';
2067
+ const CLASS_NAME_SHOW$5 = 'show';
2068
+ const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;
2069
+ const Default$8 = {
2070
+ className: 'modal-backdrop',
2071
+ clickCallback: null,
2072
+ isAnimated: false,
2073
+ isVisible: true,
2074
+ // if false, we use the backdrop helper without adding any element to the dom
2075
+ rootElement: 'body' // give the choice to place backdrop under different elements
2076
+ };
2077
+ const DefaultType$8 = {
2078
+ className: 'string',
2079
+ clickCallback: '(function|null)',
2080
+ isAnimated: 'boolean',
2081
+ isVisible: 'boolean',
2082
+ rootElement: '(element|string)'
2083
+ };
2084
+
2085
+ /**
2086
+ * Class definition
2087
+ */
2088
+
2089
+ class Backdrop extends Config {
2090
+ constructor(config) {
2091
+ super();
2092
+ this._config = this._getConfig(config);
2093
+ this._isAppended = false;
2094
+ this._element = null;
2095
+ }
2096
+
2097
+ // Getters
2098
+ static get Default() {
2099
+ return Default$8;
2100
+ }
2101
+ static get DefaultType() {
2102
+ return DefaultType$8;
2103
+ }
2104
+ static get NAME() {
2105
+ return NAME$9;
2106
+ }
2107
+
2108
+ // Public
2109
+ show(callback) {
2110
+ if (!this._config.isVisible) {
2111
+ execute(callback);
2112
+ return;
2113
+ }
2114
+ this._append();
2115
+ const element = this._getElement();
2116
+ if (this._config.isAnimated) {
2117
+ reflow(element);
2118
+ }
2119
+ element.classList.add(CLASS_NAME_SHOW$5);
2120
+ this._emulateAnimation(() => {
2121
+ execute(callback);
2122
+ });
2123
+ }
2124
+ hide(callback) {
2125
+ if (!this._config.isVisible) {
2126
+ execute(callback);
2127
+ return;
2128
+ }
2129
+ this._getElement().classList.remove(CLASS_NAME_SHOW$5);
2130
+ this._emulateAnimation(() => {
2131
+ this.dispose();
2132
+ execute(callback);
2133
+ });
2134
+ }
2135
+ dispose() {
2136
+ if (!this._isAppended) {
2137
+ return;
2138
+ }
2139
+ EventHandler.off(this._element, EVENT_MOUSEDOWN);
2140
+ this._element.remove();
2141
+ this._isAppended = false;
2142
+ }
2143
+
2144
+ // Private
2145
+ _getElement() {
2146
+ if (!this._element) {
2147
+ const backdrop = document.createElement('div');
2148
+ backdrop.className = this._config.className;
2149
+ if (this._config.isAnimated) {
2150
+ backdrop.classList.add(CLASS_NAME_FADE$4);
2151
+ }
2152
+ this._element = backdrop;
2153
+ }
2154
+ return this._element;
2155
+ }
2156
+ _configAfterMerge(config) {
2157
+ // use getElement() with the default "body" to get a fresh Element on each instantiation
2158
+ config.rootElement = getElement(config.rootElement);
2159
+ return config;
2160
+ }
2161
+ _append() {
2162
+ if (this._isAppended) {
2163
+ return;
2164
+ }
2165
+ const element = this._getElement();
2166
+ this._config.rootElement.append(element);
2167
+ EventHandler.on(element, EVENT_MOUSEDOWN, () => {
2168
+ execute(this._config.clickCallback);
2169
+ });
2170
+ this._isAppended = true;
2171
+ }
2172
+ _emulateAnimation(callback) {
2173
+ executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
2174
+ }
2175
+ }
2176
+
2177
+ /**
2178
+ * --------------------------------------------------------------------------
2179
+ * Bootstrap util/focustrap.js
2180
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2181
+ * --------------------------------------------------------------------------
2182
+ */
2183
+
2184
+
2185
+ /**
2186
+ * Constants
2187
+ */
2188
+
2189
+ const NAME$8 = 'focustrap';
2190
+ const DATA_KEY$5 = 'bs.focustrap';
2191
+ const EVENT_KEY$5 = `.${DATA_KEY$5}`;
2192
+ const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;
2193
+ const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;
2194
+ const TAB_KEY = 'Tab';
2195
+ const TAB_NAV_FORWARD = 'forward';
2196
+ const TAB_NAV_BACKWARD = 'backward';
2197
+ const Default$7 = {
2198
+ autofocus: true,
2199
+ trapElement: null // The element to trap focus inside of
2200
+ };
2201
+ const DefaultType$7 = {
2202
+ autofocus: 'boolean',
2203
+ trapElement: 'element'
2204
+ };
2205
+
2206
+ /**
2207
+ * Class definition
2208
+ */
2209
+
2210
+ class FocusTrap extends Config {
2211
+ constructor(config) {
2212
+ super();
2213
+ this._config = this._getConfig(config);
2214
+ this._isActive = false;
2215
+ this._lastTabNavDirection = null;
2216
+ }
2217
+
2218
+ // Getters
2219
+ static get Default() {
2220
+ return Default$7;
2221
+ }
2222
+ static get DefaultType() {
2223
+ return DefaultType$7;
2224
+ }
2225
+ static get NAME() {
2226
+ return NAME$8;
2227
+ }
2228
+
2229
+ // Public
2230
+ activate() {
2231
+ if (this._isActive) {
2232
+ return;
2233
+ }
2234
+ if (this._config.autofocus) {
2235
+ this._config.trapElement.focus();
2236
+ }
2237
+ EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop
2238
+ EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));
2239
+ EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
2240
+ this._isActive = true;
2241
+ }
2242
+ deactivate() {
2243
+ if (!this._isActive) {
2244
+ return;
2245
+ }
2246
+ this._isActive = false;
2247
+ EventHandler.off(document, EVENT_KEY$5);
2248
+ }
2249
+
2250
+ // Private
2251
+ _handleFocusin(event) {
2252
+ const {
2253
+ trapElement
2254
+ } = this._config;
2255
+ if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {
2256
+ return;
2257
+ }
2258
+ const elements = SelectorEngine.focusableChildren(trapElement);
2259
+ if (elements.length === 0) {
2260
+ trapElement.focus();
2261
+ } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
2262
+ elements[elements.length - 1].focus();
2263
+ } else {
2264
+ elements[0].focus();
2265
+ }
2266
+ }
2267
+ _handleKeydown(event) {
2268
+ if (event.key !== TAB_KEY) {
2269
+ return;
2270
+ }
2271
+ this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
2272
+ }
2273
+ }
2274
+
2275
+ /**
2276
+ * --------------------------------------------------------------------------
2277
+ * Bootstrap util/scrollBar.js
2278
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2279
+ * --------------------------------------------------------------------------
2280
+ */
2281
+
2282
+
2283
+ /**
2284
+ * Constants
2285
+ */
2286
+
2287
+ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2288
+ const SELECTOR_STICKY_CONTENT = '.sticky-top';
2289
+ const PROPERTY_PADDING = 'padding-right';
2290
+ const PROPERTY_MARGIN = 'margin-right';
2291
+
2292
+ /**
2293
+ * Class definition
2294
+ */
2295
+
2296
+ class ScrollBarHelper {
2297
+ constructor() {
2298
+ this._element = document.body;
2299
+ }
2300
+
2301
+ // Public
2302
+ getWidth() {
2303
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
2304
+ const documentWidth = document.documentElement.clientWidth;
2305
+ return Math.abs(window.innerWidth - documentWidth);
2306
+ }
2307
+ hide() {
2308
+ const width = this.getWidth();
2309
+ this._disableOverFlow();
2310
+ // give padding to element to balance the hidden scrollbar width
2311
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2312
+ // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
2313
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2314
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
2315
+ }
2316
+ reset() {
2317
+ this._resetElementAttributes(this._element, 'overflow');
2318
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
2319
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
2320
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
2321
+ }
2322
+ isOverflowing() {
2323
+ return this.getWidth() > 0;
2324
+ }
2325
+
2326
+ // Private
2327
+ _disableOverFlow() {
2328
+ this._saveInitialAttribute(this._element, 'overflow');
2329
+ this._element.style.overflow = 'hidden';
2330
+ }
2331
+ _setElementAttributes(selector, styleProperty, callback) {
2332
+ const scrollbarWidth = this.getWidth();
2333
+ const manipulationCallBack = element => {
2334
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
2335
+ return;
2336
+ }
2337
+ this._saveInitialAttribute(element, styleProperty);
2338
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
2339
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
2340
+ };
2341
+ this._applyManipulationCallback(selector, manipulationCallBack);
2342
+ }
2343
+ _saveInitialAttribute(element, styleProperty) {
2344
+ const actualValue = element.style.getPropertyValue(styleProperty);
2345
+ if (actualValue) {
2346
+ Manipulator.setDataAttribute(element, styleProperty, actualValue);
2347
+ }
2348
+ }
2349
+ _resetElementAttributes(selector, styleProperty) {
2350
+ const manipulationCallBack = element => {
2351
+ const value = Manipulator.getDataAttribute(element, styleProperty);
2352
+ // We only want to remove the property if the value is `null`; the value can also be zero
2353
+ if (value === null) {
2354
+ element.style.removeProperty(styleProperty);
2355
+ return;
2356
+ }
2357
+ Manipulator.removeDataAttribute(element, styleProperty);
2358
+ element.style.setProperty(styleProperty, value);
2359
+ };
2360
+ this._applyManipulationCallback(selector, manipulationCallBack);
2361
+ }
2362
+ _applyManipulationCallback(selector, callBack) {
2363
+ if (isElement(selector)) {
2364
+ callBack(selector);
2365
+ return;
2366
+ }
2367
+ for (const sel of SelectorEngine.find(selector, this._element)) {
2368
+ callBack(sel);
2369
+ }
2370
+ }
2371
+ }
2372
+
2373
+ /**
2374
+ * --------------------------------------------------------------------------
2375
+ * Bootstrap modal.js
2376
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2377
+ * --------------------------------------------------------------------------
2378
+ */
2379
+
2380
+
2381
+ /**
2382
+ * Constants
2383
+ */
2384
+
2385
+ const NAME$7 = 'modal';
2386
+ const DATA_KEY$4 = 'bs.modal';
2387
+ const EVENT_KEY$4 = `.${DATA_KEY$4}`;
2388
+ const DATA_API_KEY$2 = '.data-api';
2389
+ const ESCAPE_KEY$1 = 'Escape';
2390
+ const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;
2391
+ const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;
2392
+ const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;
2393
+ const EVENT_SHOW$4 = `show${EVENT_KEY$4}`;
2394
+ const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;
2395
+ const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;
2396
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;
2397
+ const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;
2398
+ const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;
2399
+ const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;
2400
+ const CLASS_NAME_OPEN = 'modal-open';
2401
+ const CLASS_NAME_FADE$3 = 'fade';
2402
+ const CLASS_NAME_SHOW$4 = 'show';
2403
+ const CLASS_NAME_STATIC = 'modal-static';
2404
+ const OPEN_SELECTOR$1 = '.modal.show';
2405
+ const SELECTOR_DIALOG = '.modal-dialog';
2406
+ const SELECTOR_MODAL_BODY = '.modal-body';
2407
+ const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
2408
+ const Default$6 = {
2409
+ backdrop: true,
2410
+ focus: true,
2411
+ keyboard: true
2412
+ };
2413
+ const DefaultType$6 = {
2414
+ backdrop: '(boolean|string)',
2415
+ focus: 'boolean',
2416
+ keyboard: 'boolean'
2417
+ };
2418
+
2419
+ /**
2420
+ * Class definition
2421
+ */
2422
+
2423
+ class Modal extends BaseComponent {
2424
+ constructor(element, config) {
2425
+ super(element, config);
2426
+ this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
2427
+ this._backdrop = this._initializeBackDrop();
2428
+ this._focustrap = this._initializeFocusTrap();
2429
+ this._isShown = false;
2430
+ this._isTransitioning = false;
2431
+ this._scrollBar = new ScrollBarHelper();
2432
+ this._addEventListeners();
2433
+ }
2434
+
2435
+ // Getters
2436
+ static get Default() {
2437
+ return Default$6;
2438
+ }
2439
+ static get DefaultType() {
2440
+ return DefaultType$6;
2441
+ }
2442
+ static get NAME() {
2443
+ return NAME$7;
2444
+ }
2445
+
2446
+ // Public
2447
+ toggle(relatedTarget) {
2448
+ return this._isShown ? this.hide() : this.show(relatedTarget);
2449
+ }
2450
+ show(relatedTarget) {
2451
+ if (this._isShown || this._isTransitioning) {
2452
+ return;
2453
+ }
2454
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {
2455
+ relatedTarget
2456
+ });
2457
+ if (showEvent.defaultPrevented) {
2458
+ return;
2459
+ }
2460
+ this._isShown = true;
2461
+ this._isTransitioning = true;
2462
+ this._scrollBar.hide();
2463
+ document.body.classList.add(CLASS_NAME_OPEN);
2464
+ this._adjustDialog();
2465
+ this._backdrop.show(() => this._showElement(relatedTarget));
2466
+ }
2467
+ hide() {
2468
+ if (!this._isShown || this._isTransitioning) {
2469
+ return;
2470
+ }
2471
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
2472
+ if (hideEvent.defaultPrevented) {
2473
+ return;
2474
+ }
2475
+ this._isShown = false;
2476
+ this._isTransitioning = true;
2477
+ this._focustrap.deactivate();
2478
+ this._element.classList.remove(CLASS_NAME_SHOW$4);
2479
+ this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
2480
+ }
2481
+ dispose() {
2482
+ EventHandler.off(window, EVENT_KEY$4);
2483
+ EventHandler.off(this._dialog, EVENT_KEY$4);
2484
+ this._backdrop.dispose();
2485
+ this._focustrap.deactivate();
2486
+ super.dispose();
2487
+ }
2488
+ handleUpdate() {
2489
+ this._adjustDialog();
2490
+ }
2491
+
2492
+ // Private
2493
+ _initializeBackDrop() {
2494
+ return new Backdrop({
2495
+ isVisible: Boolean(this._config.backdrop),
2496
+ // 'static' option will be translated to true, and booleans will keep their value,
2497
+ isAnimated: this._isAnimated()
2498
+ });
2499
+ }
2500
+ _initializeFocusTrap() {
2501
+ return new FocusTrap({
2502
+ trapElement: this._element
2503
+ });
2504
+ }
2505
+ _showElement(relatedTarget) {
2506
+ // try to append dynamic modal
2507
+ if (!document.body.contains(this._element)) {
2508
+ document.body.append(this._element);
2509
+ }
2510
+ this._element.style.display = 'block';
2511
+ this._element.removeAttribute('aria-hidden');
2512
+ this._element.setAttribute('aria-modal', true);
2513
+ this._element.setAttribute('role', 'dialog');
2514
+ this._element.scrollTop = 0;
2515
+ const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
2516
+ if (modalBody) {
2517
+ modalBody.scrollTop = 0;
2518
+ }
2519
+ reflow(this._element);
2520
+ this._element.classList.add(CLASS_NAME_SHOW$4);
2521
+ const transitionComplete = () => {
2522
+ if (this._config.focus) {
2523
+ this._focustrap.activate();
2524
+ }
2525
+ this._isTransitioning = false;
2526
+ EventHandler.trigger(this._element, EVENT_SHOWN$4, {
2527
+ relatedTarget
2528
+ });
2529
+ };
2530
+ this._queueCallback(transitionComplete, this._dialog, this._isAnimated());
2531
+ }
2532
+ _addEventListeners() {
2533
+ EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
2534
+ if (event.key !== ESCAPE_KEY$1) {
2535
+ return;
2536
+ }
2537
+ if (this._config.keyboard) {
2538
+ this.hide();
2539
+ return;
2540
+ }
2541
+ this._triggerBackdropTransition();
2542
+ });
2543
+ EventHandler.on(window, EVENT_RESIZE$1, () => {
2544
+ if (this._isShown && !this._isTransitioning) {
2545
+ this._adjustDialog();
2546
+ }
2547
+ });
2548
+ EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
2549
+ // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks
2550
+ EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {
2551
+ if (this._element !== event.target || this._element !== event2.target) {
2552
+ return;
2553
+ }
2554
+ if (this._config.backdrop === 'static') {
2555
+ this._triggerBackdropTransition();
2556
+ return;
2557
+ }
2558
+ if (this._config.backdrop) {
2559
+ this.hide();
2560
+ }
2561
+ });
2562
+ });
2563
+ }
2564
+ _hideModal() {
2565
+ this._element.style.display = 'none';
2566
+ this._element.setAttribute('aria-hidden', true);
2567
+ this._element.removeAttribute('aria-modal');
2568
+ this._element.removeAttribute('role');
2569
+ this._isTransitioning = false;
2570
+ this._backdrop.hide(() => {
2571
+ document.body.classList.remove(CLASS_NAME_OPEN);
2572
+ this._resetAdjustments();
2573
+ this._scrollBar.reset();
2574
+ EventHandler.trigger(this._element, EVENT_HIDDEN$4);
2575
+ });
2576
+ }
2577
+ _isAnimated() {
2578
+ return this._element.classList.contains(CLASS_NAME_FADE$3);
2579
+ }
2580
+ _triggerBackdropTransition() {
2581
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);
2582
+ if (hideEvent.defaultPrevented) {
2583
+ return;
2584
+ }
2585
+ const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
2586
+ const initialOverflowY = this._element.style.overflowY;
2587
+ // return if the following background transition hasn't yet completed
2588
+ if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {
2589
+ return;
2590
+ }
2591
+ if (!isModalOverflowing) {
2592
+ this._element.style.overflowY = 'hidden';
2593
+ }
2594
+ this._element.classList.add(CLASS_NAME_STATIC);
2595
+ this._queueCallback(() => {
2596
+ this._element.classList.remove(CLASS_NAME_STATIC);
2597
+ this._queueCallback(() => {
2598
+ this._element.style.overflowY = initialOverflowY;
2599
+ }, this._dialog);
2600
+ }, this._dialog);
2601
+ this._element.focus();
2602
+ }
2603
+
2604
+ /**
2605
+ * The following methods are used to handle overflowing modals
2606
+ */
2607
+
2608
+ _adjustDialog() {
2609
+ const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
2610
+ const scrollbarWidth = this._scrollBar.getWidth();
2611
+ const isBodyOverflowing = scrollbarWidth > 0;
2612
+ if (isBodyOverflowing && !isModalOverflowing) {
2613
+ const property = isRTL() ? 'paddingLeft' : 'paddingRight';
2614
+ this._element.style[property] = `${scrollbarWidth}px`;
2615
+ }
2616
+ if (!isBodyOverflowing && isModalOverflowing) {
2617
+ const property = isRTL() ? 'paddingRight' : 'paddingLeft';
2618
+ this._element.style[property] = `${scrollbarWidth}px`;
2619
+ }
2620
+ }
2621
+ _resetAdjustments() {
2622
+ this._element.style.paddingLeft = '';
2623
+ this._element.style.paddingRight = '';
2624
+ }
2625
+
2626
+ // Static
2627
+ static jQueryInterface(config, relatedTarget) {
2628
+ return this.each(function () {
2629
+ const data = Modal.getOrCreateInstance(this, config);
2630
+ if (typeof config !== 'string') {
2631
+ return;
2632
+ }
2633
+ if (typeof data[config] === 'undefined') {
2634
+ throw new TypeError(`No method named "${config}"`);
2635
+ }
2636
+ data[config](relatedTarget);
2637
+ });
2638
+ }
2639
+ }
2640
+
2641
+ /**
2642
+ * Data API implementation
2643
+ */
2644
+
2645
+ EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {
2646
+ const target = SelectorEngine.getElementFromSelector(this);
2647
+ if (['A', 'AREA'].includes(this.tagName)) {
2648
+ event.preventDefault();
2649
+ }
2650
+ EventHandler.one(target, EVENT_SHOW$4, showEvent => {
2651
+ if (showEvent.defaultPrevented) {
2652
+ // only register focus restorer if modal will actually get shown
2653
+ return;
2654
+ }
2655
+ EventHandler.one(target, EVENT_HIDDEN$4, () => {
2656
+ if (isVisible(this)) {
2657
+ this.focus();
2658
+ }
2659
+ });
2660
+ });
2661
+
2662
+ // avoid conflict when clicking modal toggler while another one is open
2663
+ const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
2664
+ if (alreadyOpen) {
2665
+ Modal.getInstance(alreadyOpen).hide();
2666
+ }
2667
+ const data = Modal.getOrCreateInstance(target);
2668
+ data.toggle(this);
2669
+ });
2670
+ enableDismissTrigger(Modal);
2671
+
2672
+ /**
2673
+ * jQuery
2674
+ */
2675
+
2676
+ defineJQueryPlugin(Modal);
2677
+
2678
+ /**
2679
+ * --------------------------------------------------------------------------
2680
+ * Bootstrap offcanvas.js
2681
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2682
+ * --------------------------------------------------------------------------
2683
+ */
2684
+
2685
+
2686
+ /**
2687
+ * Constants
2688
+ */
2689
+
2690
+ const NAME$6 = 'offcanvas';
2691
+ const DATA_KEY$3 = 'bs.offcanvas';
2692
+ const EVENT_KEY$3 = `.${DATA_KEY$3}`;
2693
+ const DATA_API_KEY$1 = '.data-api';
2694
+ const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;
2695
+ const ESCAPE_KEY = 'Escape';
2696
+ const CLASS_NAME_SHOW$3 = 'show';
2697
+ const CLASS_NAME_SHOWING$1 = 'showing';
2698
+ const CLASS_NAME_HIDING = 'hiding';
2699
+ const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
2700
+ const OPEN_SELECTOR = '.offcanvas.show';
2701
+ const EVENT_SHOW$3 = `show${EVENT_KEY$3}`;
2702
+ const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;
2703
+ const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;
2704
+ const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;
2705
+ const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;
2706
+ const EVENT_RESIZE = `resize${EVENT_KEY$3}`;
2707
+ const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;
2708
+ const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;
2709
+ const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
2710
+ const Default$5 = {
2711
+ backdrop: true,
2712
+ keyboard: true,
2713
+ scroll: false
2714
+ };
2715
+ const DefaultType$5 = {
2716
+ backdrop: '(boolean|string)',
2717
+ keyboard: 'boolean',
2718
+ scroll: 'boolean'
2719
+ };
2720
+
2721
+ /**
2722
+ * Class definition
2723
+ */
2724
+
2725
+ class Offcanvas extends BaseComponent {
2726
+ constructor(element, config) {
2727
+ super(element, config);
2728
+ this._isShown = false;
2729
+ this._backdrop = this._initializeBackDrop();
2730
+ this._focustrap = this._initializeFocusTrap();
2731
+ this._addEventListeners();
2732
+ }
2733
+
2734
+ // Getters
2735
+ static get Default() {
2736
+ return Default$5;
2737
+ }
2738
+ static get DefaultType() {
2739
+ return DefaultType$5;
2740
+ }
2741
+ static get NAME() {
2742
+ return NAME$6;
2743
+ }
2744
+
2745
+ // Public
2746
+ toggle(relatedTarget) {
2747
+ return this._isShown ? this.hide() : this.show(relatedTarget);
2748
+ }
2749
+ show(relatedTarget) {
2750
+ if (this._isShown) {
2751
+ return;
2752
+ }
2753
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
2754
+ relatedTarget
2755
+ });
2756
+ if (showEvent.defaultPrevented) {
2757
+ return;
2758
+ }
2759
+ this._isShown = true;
2760
+ this._backdrop.show();
2761
+ if (!this._config.scroll) {
2762
+ new ScrollBarHelper().hide();
2763
+ }
2764
+ this._element.setAttribute('aria-modal', true);
2765
+ this._element.setAttribute('role', 'dialog');
2766
+ this._element.classList.add(CLASS_NAME_SHOWING$1);
2767
+ const completeCallBack = () => {
2768
+ if (!this._config.scroll || this._config.backdrop) {
2769
+ this._focustrap.activate();
2770
+ }
2771
+ this._element.classList.add(CLASS_NAME_SHOW$3);
2772
+ this._element.classList.remove(CLASS_NAME_SHOWING$1);
2773
+ EventHandler.trigger(this._element, EVENT_SHOWN$3, {
2774
+ relatedTarget
2775
+ });
2776
+ };
2777
+ this._queueCallback(completeCallBack, this._element, true);
2778
+ }
2779
+ hide() {
2780
+ if (!this._isShown) {
2781
+ return;
2782
+ }
2783
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);
2784
+ if (hideEvent.defaultPrevented) {
2785
+ return;
2786
+ }
2787
+ this._focustrap.deactivate();
2788
+ this._element.blur();
2789
+ this._isShown = false;
2790
+ this._element.classList.add(CLASS_NAME_HIDING);
2791
+ this._backdrop.hide();
2792
+ const completeCallback = () => {
2793
+ this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);
2794
+ this._element.removeAttribute('aria-modal');
2795
+ this._element.removeAttribute('role');
2796
+ if (!this._config.scroll) {
2797
+ new ScrollBarHelper().reset();
2798
+ }
2799
+ EventHandler.trigger(this._element, EVENT_HIDDEN$3);
2800
+ };
2801
+ this._queueCallback(completeCallback, this._element, true);
2802
+ }
2803
+ dispose() {
2804
+ this._backdrop.dispose();
2805
+ this._focustrap.deactivate();
2806
+ super.dispose();
2807
+ }
2808
+
2809
+ // Private
2810
+ _initializeBackDrop() {
2811
+ const clickCallback = () => {
2812
+ if (this._config.backdrop === 'static') {
2813
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
2814
+ return;
2815
+ }
2816
+ this.hide();
2817
+ };
2818
+
2819
+ // 'static' option will be translated to true, and booleans will keep their value
2820
+ const isVisible = Boolean(this._config.backdrop);
2821
+ return new Backdrop({
2822
+ className: CLASS_NAME_BACKDROP,
2823
+ isVisible,
2824
+ isAnimated: true,
2825
+ rootElement: this._element.parentNode,
2826
+ clickCallback: isVisible ? clickCallback : null
2827
+ });
2828
+ }
2829
+ _initializeFocusTrap() {
2830
+ return new FocusTrap({
2831
+ trapElement: this._element
2832
+ });
2833
+ }
2834
+ _addEventListeners() {
2835
+ EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
2836
+ if (event.key !== ESCAPE_KEY) {
2837
+ return;
2838
+ }
2839
+ if (this._config.keyboard) {
2840
+ this.hide();
2841
+ return;
2842
+ }
2843
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
2844
+ });
2845
+ }
2846
+
2847
+ // Static
2848
+ static jQueryInterface(config) {
2849
+ return this.each(function () {
2850
+ const data = Offcanvas.getOrCreateInstance(this, config);
2851
+ if (typeof config !== 'string') {
2852
+ return;
2853
+ }
2854
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
2855
+ throw new TypeError(`No method named "${config}"`);
2856
+ }
2857
+ data[config](this);
2858
+ });
2859
+ }
2860
+ }
2861
+
2862
+ /**
2863
+ * Data API implementation
2864
+ */
2865
+
2866
+ EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {
2867
+ const target = SelectorEngine.getElementFromSelector(this);
2868
+ if (['A', 'AREA'].includes(this.tagName)) {
2869
+ event.preventDefault();
2870
+ }
2871
+ if (isDisabled(this)) {
2872
+ return;
2873
+ }
2874
+ EventHandler.one(target, EVENT_HIDDEN$3, () => {
2875
+ // focus on trigger when it is closed
2876
+ if (isVisible(this)) {
2877
+ this.focus();
2878
+ }
2879
+ });
2880
+
2881
+ // avoid conflict when clicking a toggler of an offcanvas, while another is open
2882
+ const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
2883
+ if (alreadyOpen && alreadyOpen !== target) {
2884
+ Offcanvas.getInstance(alreadyOpen).hide();
2885
+ }
2886
+ const data = Offcanvas.getOrCreateInstance(target);
2887
+ data.toggle(this);
2888
+ });
2889
+ EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
2890
+ for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {
2891
+ Offcanvas.getOrCreateInstance(selector).show();
2892
+ }
2893
+ });
2894
+ EventHandler.on(window, EVENT_RESIZE, () => {
2895
+ for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {
2896
+ if (getComputedStyle(element).position !== 'fixed') {
2897
+ Offcanvas.getOrCreateInstance(element).hide();
2898
+ }
2899
+ }
2900
+ });
2901
+ enableDismissTrigger(Offcanvas);
2902
+
2903
+ /**
2904
+ * jQuery
2905
+ */
2906
+
2907
+ defineJQueryPlugin(Offcanvas);
2908
+
2909
+ /**
2910
+ * --------------------------------------------------------------------------
2911
+ * Bootstrap util/sanitizer.js
2912
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2913
+ * --------------------------------------------------------------------------
2914
+ */
2915
+
2916
+ // js-docs-start allow-list
2917
+ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
2918
+ const DefaultAllowlist = {
2919
+ // Global attributes allowed on any supplied element below.
2920
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
2921
+ a: ['target', 'href', 'title', 'rel'],
2922
+ area: [],
2923
+ b: [],
2924
+ br: [],
2925
+ col: [],
2926
+ code: [],
2927
+ dd: [],
2928
+ div: [],
2929
+ dl: [],
2930
+ dt: [],
2931
+ em: [],
2932
+ hr: [],
2933
+ h1: [],
2934
+ h2: [],
2935
+ h3: [],
2936
+ h4: [],
2937
+ h5: [],
2938
+ h6: [],
2939
+ i: [],
2940
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
2941
+ li: [],
2942
+ ol: [],
2943
+ p: [],
2944
+ pre: [],
2945
+ s: [],
2946
+ small: [],
2947
+ span: [],
2948
+ sub: [],
2949
+ sup: [],
2950
+ strong: [],
2951
+ u: [],
2952
+ ul: []
2953
+ };
2954
+ // js-docs-end allow-list
2955
+
2956
+ const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
2957
+
2958
+ /**
2959
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
2960
+ * contexts.
2961
+ *
2962
+ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
2963
+ */
2964
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
2965
+ const allowedAttribute = (attribute, allowedAttributeList) => {
2966
+ const attributeName = attribute.nodeName.toLowerCase();
2967
+ if (allowedAttributeList.includes(attributeName)) {
2968
+ if (uriAttributes.has(attributeName)) {
2969
+ return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
2970
+ }
2971
+ return true;
2972
+ }
2973
+
2974
+ // Check if a regular expression validates the attribute.
2975
+ return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
2976
+ };
2977
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
2978
+ if (!unsafeHtml.length) {
2979
+ return unsafeHtml;
2980
+ }
2981
+ if (sanitizeFunction && typeof sanitizeFunction === 'function') {
2982
+ return sanitizeFunction(unsafeHtml);
2983
+ }
2984
+ const domParser = new window.DOMParser();
2985
+ const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
2986
+ const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
2987
+ for (const element of elements) {
2988
+ const elementName = element.nodeName.toLowerCase();
2989
+ if (!Object.keys(allowList).includes(elementName)) {
2990
+ element.remove();
2991
+ continue;
2992
+ }
2993
+ const attributeList = [].concat(...element.attributes);
2994
+ const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
2995
+ for (const attribute of attributeList) {
2996
+ if (!allowedAttribute(attribute, allowedAttributes)) {
2997
+ element.removeAttribute(attribute.nodeName);
2998
+ }
2999
+ }
3000
+ }
3001
+ return createdDocument.body.innerHTML;
3002
+ }
3003
+
3004
+ /**
3005
+ * --------------------------------------------------------------------------
3006
+ * Bootstrap util/template-factory.js
3007
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3008
+ * --------------------------------------------------------------------------
3009
+ */
3010
+
3011
+
3012
+ /**
3013
+ * Constants
3014
+ */
3015
+
3016
+ const NAME$5 = 'TemplateFactory';
3017
+ const Default$4 = {
3018
+ allowList: DefaultAllowlist,
3019
+ content: {},
3020
+ // { selector : text , selector2 : text2 , }
3021
+ extraClass: '',
3022
+ html: false,
3023
+ sanitize: true,
3024
+ sanitizeFn: null,
3025
+ template: '<div></div>'
3026
+ };
3027
+ const DefaultType$4 = {
3028
+ allowList: 'object',
3029
+ content: 'object',
3030
+ extraClass: '(string|function)',
3031
+ html: 'boolean',
3032
+ sanitize: 'boolean',
3033
+ sanitizeFn: '(null|function)',
3034
+ template: 'string'
3035
+ };
3036
+ const DefaultContentType = {
3037
+ entry: '(string|element|function|null)',
3038
+ selector: '(string|element)'
3039
+ };
3040
+
3041
+ /**
3042
+ * Class definition
3043
+ */
3044
+
3045
+ class TemplateFactory extends Config {
3046
+ constructor(config) {
3047
+ super();
3048
+ this._config = this._getConfig(config);
3049
+ }
3050
+
3051
+ // Getters
3052
+ static get Default() {
3053
+ return Default$4;
3054
+ }
3055
+ static get DefaultType() {
3056
+ return DefaultType$4;
3057
+ }
3058
+ static get NAME() {
3059
+ return NAME$5;
3060
+ }
3061
+
3062
+ // Public
3063
+ getContent() {
3064
+ return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);
3065
+ }
3066
+ hasContent() {
3067
+ return this.getContent().length > 0;
3068
+ }
3069
+ changeContent(content) {
3070
+ this._checkContent(content);
3071
+ this._config.content = {
3072
+ ...this._config.content,
3073
+ ...content
3074
+ };
3075
+ return this;
3076
+ }
3077
+ toHtml() {
3078
+ const templateWrapper = document.createElement('div');
3079
+ templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
3080
+ for (const [selector, text] of Object.entries(this._config.content)) {
3081
+ this._setContent(templateWrapper, text, selector);
3082
+ }
3083
+ const template = templateWrapper.children[0];
3084
+ const extraClass = this._resolvePossibleFunction(this._config.extraClass);
3085
+ if (extraClass) {
3086
+ template.classList.add(...extraClass.split(' '));
3087
+ }
3088
+ return template;
3089
+ }
3090
+
3091
+ // Private
3092
+ _typeCheckConfig(config) {
3093
+ super._typeCheckConfig(config);
3094
+ this._checkContent(config.content);
3095
+ }
3096
+ _checkContent(arg) {
3097
+ for (const [selector, content] of Object.entries(arg)) {
3098
+ super._typeCheckConfig({
3099
+ selector,
3100
+ entry: content
3101
+ }, DefaultContentType);
3102
+ }
3103
+ }
3104
+ _setContent(template, content, selector) {
3105
+ const templateElement = SelectorEngine.findOne(selector, template);
3106
+ if (!templateElement) {
3107
+ return;
3108
+ }
3109
+ content = this._resolvePossibleFunction(content);
3110
+ if (!content) {
3111
+ templateElement.remove();
3112
+ return;
3113
+ }
3114
+ if (isElement(content)) {
3115
+ this._putElementInTemplate(getElement(content), templateElement);
3116
+ return;
3117
+ }
3118
+ if (this._config.html) {
3119
+ templateElement.innerHTML = this._maybeSanitize(content);
3120
+ return;
3121
+ }
3122
+ templateElement.textContent = content;
3123
+ }
3124
+ _maybeSanitize(arg) {
3125
+ return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
3126
+ }
3127
+ _resolvePossibleFunction(arg) {
3128
+ return execute(arg, [undefined, this]);
3129
+ }
3130
+ _putElementInTemplate(element, templateElement) {
3131
+ if (this._config.html) {
3132
+ templateElement.innerHTML = '';
3133
+ templateElement.append(element);
3134
+ return;
3135
+ }
3136
+ templateElement.textContent = element.textContent;
3137
+ }
3138
+ }
3139
+
3140
+ /**
3141
+ * --------------------------------------------------------------------------
3142
+ * Bootstrap tooltip.js
3143
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3144
+ * --------------------------------------------------------------------------
3145
+ */
3146
+
3147
+
3148
+ /**
3149
+ * Constants
3150
+ */
3151
+
3152
+ const NAME$4 = 'tooltip';
3153
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
3154
+ const CLASS_NAME_FADE$2 = 'fade';
3155
+ const CLASS_NAME_MODAL = 'modal';
3156
+ const CLASS_NAME_SHOW$2 = 'show';
3157
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
3158
+ const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
3159
+ const EVENT_MODAL_HIDE = 'hide.bs.modal';
3160
+ const TRIGGER_HOVER = 'hover';
3161
+ const TRIGGER_FOCUS = 'focus';
3162
+ const TRIGGER_CLICK = 'click';
3163
+ const TRIGGER_MANUAL = 'manual';
3164
+ const EVENT_HIDE$2 = 'hide';
3165
+ const EVENT_HIDDEN$2 = 'hidden';
3166
+ const EVENT_SHOW$2 = 'show';
3167
+ const EVENT_SHOWN$2 = 'shown';
3168
+ const EVENT_INSERTED = 'inserted';
3169
+ const EVENT_CLICK$1 = 'click';
3170
+ const EVENT_FOCUSIN$1 = 'focusin';
3171
+ const EVENT_FOCUSOUT$1 = 'focusout';
3172
+ const EVENT_MOUSEENTER = 'mouseenter';
3173
+ const EVENT_MOUSELEAVE = 'mouseleave';
3174
+ const AttachmentMap = {
3175
+ AUTO: 'auto',
3176
+ TOP: 'top',
3177
+ RIGHT: isRTL() ? 'left' : 'right',
3178
+ BOTTOM: 'bottom',
3179
+ LEFT: isRTL() ? 'right' : 'left'
3180
+ };
3181
+ const Default$3 = {
3182
+ allowList: DefaultAllowlist,
3183
+ animation: true,
3184
+ boundary: 'clippingParents',
3185
+ container: false,
3186
+ customClass: '',
3187
+ delay: 0,
3188
+ fallbackPlacements: ['top', 'right', 'bottom', 'left'],
3189
+ html: false,
3190
+ offset: [0, 6],
3191
+ placement: 'top',
3192
+ popperConfig: null,
3193
+ sanitize: true,
3194
+ sanitizeFn: null,
3195
+ selector: false,
3196
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
3197
+ title: '',
3198
+ trigger: 'hover focus'
3199
+ };
3200
+ const DefaultType$3 = {
3201
+ allowList: 'object',
3202
+ animation: 'boolean',
3203
+ boundary: '(string|element)',
3204
+ container: '(string|element|boolean)',
3205
+ customClass: '(string|function)',
3206
+ delay: '(number|object)',
3207
+ fallbackPlacements: 'array',
3208
+ html: 'boolean',
3209
+ offset: '(array|string|function)',
3210
+ placement: '(string|function)',
3211
+ popperConfig: '(null|object|function)',
3212
+ sanitize: 'boolean',
3213
+ sanitizeFn: '(null|function)',
3214
+ selector: '(string|boolean)',
3215
+ template: 'string',
3216
+ title: '(string|element|function)',
3217
+ trigger: 'string'
3218
+ };
3219
+
3220
+ /**
3221
+ * Class definition
3222
+ */
3223
+
3224
+ class Tooltip extends BaseComponent {
3225
+ constructor(element, config) {
3226
+ if (typeof Popper === 'undefined') {
3227
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org/docs/v2/)');
3228
+ }
3229
+ super(element, config);
3230
+
3231
+ // Private
3232
+ this._isEnabled = true;
3233
+ this._timeout = 0;
3234
+ this._isHovered = null;
3235
+ this._activeTrigger = {};
3236
+ this._popper = null;
3237
+ this._templateFactory = null;
3238
+ this._newContent = null;
3239
+
3240
+ // Protected
3241
+ this.tip = null;
3242
+ this._setListeners();
3243
+ if (!this._config.selector) {
3244
+ this._fixTitle();
3245
+ }
3246
+ }
3247
+
3248
+ // Getters
3249
+ static get Default() {
3250
+ return Default$3;
3251
+ }
3252
+ static get DefaultType() {
3253
+ return DefaultType$3;
3254
+ }
3255
+ static get NAME() {
3256
+ return NAME$4;
3257
+ }
3258
+
3259
+ // Public
3260
+ enable() {
3261
+ this._isEnabled = true;
3262
+ }
3263
+ disable() {
3264
+ this._isEnabled = false;
3265
+ }
3266
+ toggleEnabled() {
3267
+ this._isEnabled = !this._isEnabled;
3268
+ }
3269
+ toggle() {
3270
+ if (!this._isEnabled) {
3271
+ return;
3272
+ }
3273
+ if (this._isShown()) {
3274
+ this._leave();
3275
+ return;
3276
+ }
3277
+ this._enter();
3278
+ }
3279
+ dispose() {
3280
+ clearTimeout(this._timeout);
3281
+ EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
3282
+ if (this._element.getAttribute('data-bs-original-title')) {
3283
+ this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
3284
+ }
3285
+ this._disposePopper();
3286
+ super.dispose();
3287
+ }
3288
+ show() {
3289
+ if (this._element.style.display === 'none') {
3290
+ throw new Error('Please use show on visible elements');
3291
+ }
3292
+ if (!(this._isWithContent() && this._isEnabled)) {
3293
+ return;
3294
+ }
3295
+ const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));
3296
+ const shadowRoot = findShadowRoot(this._element);
3297
+ const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);
3298
+ if (showEvent.defaultPrevented || !isInTheDom) {
3299
+ return;
3300
+ }
3301
+
3302
+ // TODO: v6 remove this or make it optional
3303
+ this._disposePopper();
3304
+ const tip = this._getTipElement();
3305
+ this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
3306
+ const {
3307
+ container
3308
+ } = this._config;
3309
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
3310
+ container.append(tip);
3311
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));
3312
+ }
3313
+ this._popper = this._createPopper(tip);
3314
+ tip.classList.add(CLASS_NAME_SHOW$2);
3315
+
3316
+ // If this is a touch-enabled device we add extra
3317
+ // empty mouseover listeners to the body's immediate children;
3318
+ // only needed because of broken event delegation on iOS
3319
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
3320
+ if ('ontouchstart' in document.documentElement) {
3321
+ for (const element of [].concat(...document.body.children)) {
3322
+ EventHandler.on(element, 'mouseover', noop);
3323
+ }
3324
+ }
3325
+ const complete = () => {
3326
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));
3327
+ if (this._isHovered === false) {
3328
+ this._leave();
3329
+ }
3330
+ this._isHovered = false;
3331
+ };
3332
+ this._queueCallback(complete, this.tip, this._isAnimated());
3333
+ }
3334
+ hide() {
3335
+ if (!this._isShown()) {
3336
+ return;
3337
+ }
3338
+ const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));
3339
+ if (hideEvent.defaultPrevented) {
3340
+ return;
3341
+ }
3342
+ const tip = this._getTipElement();
3343
+ tip.classList.remove(CLASS_NAME_SHOW$2);
3344
+
3345
+ // If this is a touch-enabled device we remove the extra
3346
+ // empty mouseover listeners we added for iOS support
3347
+ if ('ontouchstart' in document.documentElement) {
3348
+ for (const element of [].concat(...document.body.children)) {
3349
+ EventHandler.off(element, 'mouseover', noop);
3350
+ }
3351
+ }
3352
+ this._activeTrigger[TRIGGER_CLICK] = false;
3353
+ this._activeTrigger[TRIGGER_FOCUS] = false;
3354
+ this._activeTrigger[TRIGGER_HOVER] = false;
3355
+ this._isHovered = null; // it is a trick to support manual triggering
3356
+
3357
+ const complete = () => {
3358
+ if (this._isWithActiveTrigger()) {
3359
+ return;
3360
+ }
3361
+ if (!this._isHovered) {
3362
+ this._disposePopper();
3363
+ }
3364
+ this._element.removeAttribute('aria-describedby');
3365
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));
3366
+ };
3367
+ this._queueCallback(complete, this.tip, this._isAnimated());
3368
+ }
3369
+ update() {
3370
+ if (this._popper) {
3371
+ this._popper.update();
3372
+ }
3373
+ }
3374
+
3375
+ // Protected
3376
+ _isWithContent() {
3377
+ return Boolean(this._getTitle());
3378
+ }
3379
+ _getTipElement() {
3380
+ if (!this.tip) {
3381
+ this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());
3382
+ }
3383
+ return this.tip;
3384
+ }
3385
+ _createTipElement(content) {
3386
+ const tip = this._getTemplateFactory(content).toHtml();
3387
+
3388
+ // TODO: remove this check in v6
3389
+ if (!tip) {
3390
+ return null;
3391
+ }
3392
+ tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
3393
+ // TODO: v6 the following can be achieved with CSS only
3394
+ tip.classList.add(`bs-${this.constructor.NAME}-auto`);
3395
+ const tipId = getUID(this.constructor.NAME).toString();
3396
+ tip.setAttribute('id', tipId);
3397
+ if (this._isAnimated()) {
3398
+ tip.classList.add(CLASS_NAME_FADE$2);
3399
+ }
3400
+ return tip;
3401
+ }
3402
+ setContent(content) {
3403
+ this._newContent = content;
3404
+ if (this._isShown()) {
3405
+ this._disposePopper();
3406
+ this.show();
3407
+ }
3408
+ }
3409
+ _getTemplateFactory(content) {
3410
+ if (this._templateFactory) {
3411
+ this._templateFactory.changeContent(content);
3412
+ } else {
3413
+ this._templateFactory = new TemplateFactory({
3414
+ ...this._config,
3415
+ // the `content` var has to be after `this._config`
3416
+ // to override config.content in case of popover
3417
+ content,
3418
+ extraClass: this._resolvePossibleFunction(this._config.customClass)
3419
+ });
3420
+ }
3421
+ return this._templateFactory;
3422
+ }
3423
+ _getContentForTemplate() {
3424
+ return {
3425
+ [SELECTOR_TOOLTIP_INNER]: this._getTitle()
3426
+ };
3427
+ }
3428
+ _getTitle() {
3429
+ return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');
3430
+ }
3431
+
3432
+ // Private
3433
+ _initializeOnDelegatedTarget(event) {
3434
+ return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
3435
+ }
3436
+ _isAnimated() {
3437
+ return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);
3438
+ }
3439
+ _isShown() {
3440
+ return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);
3441
+ }
3442
+ _createPopper(tip) {
3443
+ const placement = execute(this._config.placement, [this, tip, this._element]);
3444
+ const attachment = AttachmentMap[placement.toUpperCase()];
3445
+ return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
3446
+ }
3447
+ _getOffset() {
3448
+ const {
3449
+ offset
3450
+ } = this._config;
3451
+ if (typeof offset === 'string') {
3452
+ return offset.split(',').map(value => Number.parseInt(value, 10));
3453
+ }
3454
+ if (typeof offset === 'function') {
3455
+ return popperData => offset(popperData, this._element);
3456
+ }
3457
+ return offset;
3458
+ }
3459
+ _resolvePossibleFunction(arg) {
3460
+ return execute(arg, [this._element, this._element]);
3461
+ }
3462
+ _getPopperConfig(attachment) {
3463
+ const defaultBsPopperConfig = {
3464
+ placement: attachment,
3465
+ modifiers: [{
3466
+ name: 'flip',
3467
+ options: {
3468
+ fallbackPlacements: this._config.fallbackPlacements
3469
+ }
3470
+ }, {
3471
+ name: 'offset',
3472
+ options: {
3473
+ offset: this._getOffset()
3474
+ }
3475
+ }, {
3476
+ name: 'preventOverflow',
3477
+ options: {
3478
+ boundary: this._config.boundary
3479
+ }
3480
+ }, {
3481
+ name: 'arrow',
3482
+ options: {
3483
+ element: `.${this.constructor.NAME}-arrow`
3484
+ }
3485
+ }, {
3486
+ name: 'preSetPlacement',
3487
+ enabled: true,
3488
+ phase: 'beforeMain',
3489
+ fn: data => {
3490
+ // Pre-set Popper's placement attribute in order to read the arrow sizes properly.
3491
+ // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
3492
+ this._getTipElement().setAttribute('data-popper-placement', data.state.placement);
3493
+ }
3494
+ }]
3495
+ };
3496
+ return {
3497
+ ...defaultBsPopperConfig,
3498
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
3499
+ };
3500
+ }
3501
+ _setListeners() {
3502
+ const triggers = this._config.trigger.split(' ');
3503
+ for (const trigger of triggers) {
3504
+ if (trigger === 'click') {
3505
+ EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {
3506
+ const context = this._initializeOnDelegatedTarget(event);
3507
+ context._activeTrigger[TRIGGER_CLICK] = !(context._isShown() && context._activeTrigger[TRIGGER_CLICK]);
3508
+ context.toggle();
3509
+ });
3510
+ } else if (trigger !== TRIGGER_MANUAL) {
3511
+ const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);
3512
+ const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);
3513
+ EventHandler.on(this._element, eventIn, this._config.selector, event => {
3514
+ const context = this._initializeOnDelegatedTarget(event);
3515
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
3516
+ context._enter();
3517
+ });
3518
+ EventHandler.on(this._element, eventOut, this._config.selector, event => {
3519
+ const context = this._initializeOnDelegatedTarget(event);
3520
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
3521
+ context._leave();
3522
+ });
3523
+ }
3524
+ }
3525
+ this._hideModalHandler = () => {
3526
+ if (this._element) {
3527
+ this.hide();
3528
+ }
3529
+ };
3530
+ EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
3531
+ }
3532
+ _fixTitle() {
3533
+ const title = this._element.getAttribute('title');
3534
+ if (!title) {
3535
+ return;
3536
+ }
3537
+ if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
3538
+ this._element.setAttribute('aria-label', title);
3539
+ }
3540
+ this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility
3541
+ this._element.removeAttribute('title');
3542
+ }
3543
+ _enter() {
3544
+ if (this._isShown() || this._isHovered) {
3545
+ this._isHovered = true;
3546
+ return;
3547
+ }
3548
+ this._isHovered = true;
3549
+ this._setTimeout(() => {
3550
+ if (this._isHovered) {
3551
+ this.show();
3552
+ }
3553
+ }, this._config.delay.show);
3554
+ }
3555
+ _leave() {
3556
+ if (this._isWithActiveTrigger()) {
3557
+ return;
3558
+ }
3559
+ this._isHovered = false;
3560
+ this._setTimeout(() => {
3561
+ if (!this._isHovered) {
3562
+ this.hide();
3563
+ }
3564
+ }, this._config.delay.hide);
3565
+ }
3566
+ _setTimeout(handler, timeout) {
3567
+ clearTimeout(this._timeout);
3568
+ this._timeout = setTimeout(handler, timeout);
3569
+ }
3570
+ _isWithActiveTrigger() {
3571
+ return Object.values(this._activeTrigger).includes(true);
3572
+ }
3573
+ _getConfig(config) {
3574
+ const dataAttributes = Manipulator.getDataAttributes(this._element);
3575
+ for (const dataAttribute of Object.keys(dataAttributes)) {
3576
+ if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
3577
+ delete dataAttributes[dataAttribute];
3578
+ }
3579
+ }
3580
+ config = {
3581
+ ...dataAttributes,
3582
+ ...(typeof config === 'object' && config ? config : {})
3583
+ };
3584
+ config = this._mergeConfigObj(config);
3585
+ config = this._configAfterMerge(config);
3586
+ this._typeCheckConfig(config);
3587
+ return config;
3588
+ }
3589
+ _configAfterMerge(config) {
3590
+ config.container = config.container === false ? document.body : getElement(config.container);
3591
+ if (typeof config.delay === 'number') {
3592
+ config.delay = {
3593
+ show: config.delay,
3594
+ hide: config.delay
3595
+ };
3596
+ }
3597
+ if (typeof config.title === 'number') {
3598
+ config.title = config.title.toString();
3599
+ }
3600
+ if (typeof config.content === 'number') {
3601
+ config.content = config.content.toString();
3602
+ }
3603
+ return config;
3604
+ }
3605
+ _getDelegateConfig() {
3606
+ const config = {};
3607
+ for (const [key, value] of Object.entries(this._config)) {
3608
+ if (this.constructor.Default[key] !== value) {
3609
+ config[key] = value;
3610
+ }
3611
+ }
3612
+ config.selector = false;
3613
+ config.trigger = 'manual';
3614
+
3615
+ // In the future can be replaced with:
3616
+ // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
3617
+ // `Object.fromEntries(keysWithDifferentValues)`
3618
+ return config;
3619
+ }
3620
+ _disposePopper() {
3621
+ if (this._popper) {
3622
+ this._popper.destroy();
3623
+ this._popper = null;
3624
+ }
3625
+ if (this.tip) {
3626
+ this.tip.remove();
3627
+ this.tip = null;
3628
+ }
3629
+ }
3630
+
3631
+ // Static
3632
+ static jQueryInterface(config) {
3633
+ return this.each(function () {
3634
+ const data = Tooltip.getOrCreateInstance(this, config);
3635
+ if (typeof config !== 'string') {
3636
+ return;
3637
+ }
3638
+ if (typeof data[config] === 'undefined') {
3639
+ throw new TypeError(`No method named "${config}"`);
3640
+ }
3641
+ data[config]();
3642
+ });
3643
+ }
3644
+ }
3645
+
3646
+ /**
3647
+ * jQuery
3648
+ */
3649
+
3650
+ defineJQueryPlugin(Tooltip);
3651
+
3652
+ /**
3653
+ * --------------------------------------------------------------------------
3654
+ * Bootstrap popover.js
3655
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3656
+ * --------------------------------------------------------------------------
3657
+ */
3658
+
3659
+
3660
+ /**
3661
+ * Constants
3662
+ */
3663
+
3664
+ const NAME$3 = 'popover';
3665
+ const SELECTOR_TITLE = '.popover-header';
3666
+ const SELECTOR_CONTENT = '.popover-body';
3667
+ const Default$2 = {
3668
+ ...Tooltip.Default,
3669
+ content: '',
3670
+ offset: [0, 8],
3671
+ placement: 'right',
3672
+ template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>',
3673
+ trigger: 'click'
3674
+ };
3675
+ const DefaultType$2 = {
3676
+ ...Tooltip.DefaultType,
3677
+ content: '(null|string|element|function)'
3678
+ };
3679
+
3680
+ /**
3681
+ * Class definition
3682
+ */
3683
+
3684
+ class Popover extends Tooltip {
3685
+ // Getters
3686
+ static get Default() {
3687
+ return Default$2;
3688
+ }
3689
+ static get DefaultType() {
3690
+ return DefaultType$2;
3691
+ }
3692
+ static get NAME() {
3693
+ return NAME$3;
3694
+ }
3695
+
3696
+ // Overrides
3697
+ _isWithContent() {
3698
+ return this._getTitle() || this._getContent();
3699
+ }
3700
+
3701
+ // Private
3702
+ _getContentForTemplate() {
3703
+ return {
3704
+ [SELECTOR_TITLE]: this._getTitle(),
3705
+ [SELECTOR_CONTENT]: this._getContent()
3706
+ };
3707
+ }
3708
+ _getContent() {
3709
+ return this._resolvePossibleFunction(this._config.content);
3710
+ }
3711
+
3712
+ // Static
3713
+ static jQueryInterface(config) {
3714
+ return this.each(function () {
3715
+ const data = Popover.getOrCreateInstance(this, config);
3716
+ if (typeof config !== 'string') {
3717
+ return;
3718
+ }
3719
+ if (typeof data[config] === 'undefined') {
3720
+ throw new TypeError(`No method named "${config}"`);
3721
+ }
3722
+ data[config]();
3723
+ });
3724
+ }
3725
+ }
3726
+
3727
+ /**
3728
+ * jQuery
3729
+ */
3730
+
3731
+ defineJQueryPlugin(Popover);
3732
+
3733
+ /**
3734
+ * --------------------------------------------------------------------------
3735
+ * Bootstrap scrollspy.js
3736
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3737
+ * --------------------------------------------------------------------------
3738
+ */
3739
+
3740
+
3741
+ /**
3742
+ * Constants
3743
+ */
3744
+
3745
+ const NAME$2 = 'scrollspy';
3746
+ const DATA_KEY$2 = 'bs.scrollspy';
3747
+ const EVENT_KEY$2 = `.${DATA_KEY$2}`;
3748
+ const DATA_API_KEY = '.data-api';
3749
+ const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;
3750
+ const EVENT_CLICK = `click${EVENT_KEY$2}`;
3751
+ const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;
3752
+ const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
3753
+ const CLASS_NAME_ACTIVE$1 = 'active';
3754
+ const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
3755
+ const SELECTOR_TARGET_LINKS = '[href]';
3756
+ const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
3757
+ const SELECTOR_NAV_LINKS = '.nav-link';
3758
+ const SELECTOR_NAV_ITEMS = '.nav-item';
3759
+ const SELECTOR_LIST_ITEMS = '.list-group-item';
3760
+ const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;
3761
+ const SELECTOR_DROPDOWN = '.dropdown';
3762
+ const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
3763
+ const Default$1 = {
3764
+ offset: null,
3765
+ // TODO: v6 @deprecated, keep it for backwards compatibility reasons
3766
+ rootMargin: '0px 0px -25%',
3767
+ smoothScroll: false,
3768
+ target: null,
3769
+ threshold: [0.1, 0.5, 1]
3770
+ };
3771
+ const DefaultType$1 = {
3772
+ offset: '(number|null)',
3773
+ // TODO v6 @deprecated, keep it for backwards compatibility reasons
3774
+ rootMargin: 'string',
3775
+ smoothScroll: 'boolean',
3776
+ target: 'element',
3777
+ threshold: 'array'
3778
+ };
3779
+
3780
+ /**
3781
+ * Class definition
3782
+ */
3783
+
3784
+ class ScrollSpy extends BaseComponent {
3785
+ constructor(element, config) {
3786
+ super(element, config);
3787
+
3788
+ // this._element is the observablesContainer and config.target the menu links wrapper
3789
+ this._targetLinks = new Map();
3790
+ this._observableSections = new Map();
3791
+ this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;
3792
+ this._activeTarget = null;
3793
+ this._observer = null;
3794
+ this._previousScrollData = {
3795
+ visibleEntryTop: 0,
3796
+ parentScrollTop: 0
3797
+ };
3798
+ this.refresh(); // initialize
3799
+ }
3800
+
3801
+ // Getters
3802
+ static get Default() {
3803
+ return Default$1;
3804
+ }
3805
+ static get DefaultType() {
3806
+ return DefaultType$1;
3807
+ }
3808
+ static get NAME() {
3809
+ return NAME$2;
3810
+ }
3811
+
3812
+ // Public
3813
+ refresh() {
3814
+ this._initializeTargetsAndObservables();
3815
+ this._maybeEnableSmoothScroll();
3816
+ if (this._observer) {
3817
+ this._observer.disconnect();
3818
+ } else {
3819
+ this._observer = this._getNewObserver();
3820
+ }
3821
+ for (const section of this._observableSections.values()) {
3822
+ this._observer.observe(section);
3823
+ }
3824
+ }
3825
+ dispose() {
3826
+ this._observer.disconnect();
3827
+ super.dispose();
3828
+ }
3829
+
3830
+ // Private
3831
+ _configAfterMerge(config) {
3832
+ // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
3833
+ config.target = getElement(config.target) || document.body;
3834
+
3835
+ // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
3836
+ config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
3837
+ if (typeof config.threshold === 'string') {
3838
+ config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));
3839
+ }
3840
+ return config;
3841
+ }
3842
+ _maybeEnableSmoothScroll() {
3843
+ if (!this._config.smoothScroll) {
3844
+ return;
3845
+ }
3846
+
3847
+ // unregister any previous listeners
3848
+ EventHandler.off(this._config.target, EVENT_CLICK);
3849
+ EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {
3850
+ const observableSection = this._observableSections.get(event.target.hash);
3851
+ if (observableSection) {
3852
+ event.preventDefault();
3853
+ const root = this._rootElement || window;
3854
+ const height = observableSection.offsetTop - this._element.offsetTop;
3855
+ if (root.scrollTo) {
3856
+ root.scrollTo({
3857
+ top: height,
3858
+ behavior: 'smooth'
3859
+ });
3860
+ return;
3861
+ }
3862
+
3863
+ // Chrome 60 doesn't support `scrollTo`
3864
+ root.scrollTop = height;
3865
+ }
3866
+ });
3867
+ }
3868
+ _getNewObserver() {
3869
+ const options = {
3870
+ root: this._rootElement,
3871
+ threshold: this._config.threshold,
3872
+ rootMargin: this._config.rootMargin
3873
+ };
3874
+ return new IntersectionObserver(entries => this._observerCallback(entries), options);
3875
+ }
3876
+
3877
+ // The logic of selection
3878
+ _observerCallback(entries) {
3879
+ const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);
3880
+ const activate = entry => {
3881
+ this._previousScrollData.visibleEntryTop = entry.target.offsetTop;
3882
+ this._process(targetElement(entry));
3883
+ };
3884
+ const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;
3885
+ const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;
3886
+ this._previousScrollData.parentScrollTop = parentScrollTop;
3887
+ for (const entry of entries) {
3888
+ if (!entry.isIntersecting) {
3889
+ this._activeTarget = null;
3890
+ this._clearActiveClass(targetElement(entry));
3891
+ continue;
3892
+ }
3893
+ const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;
3894
+ // if we are scrolling down, pick the bigger offsetTop
3895
+ if (userScrollsDown && entryIsLowerThanPrevious) {
3896
+ activate(entry);
3897
+ // if parent isn't scrolled, let's keep the first visible item, breaking the iteration
3898
+ if (!parentScrollTop) {
3899
+ return;
3900
+ }
3901
+ continue;
3902
+ }
3903
+
3904
+ // if we are scrolling up, pick the smallest offsetTop
3905
+ if (!userScrollsDown && !entryIsLowerThanPrevious) {
3906
+ activate(entry);
3907
+ }
3908
+ }
3909
+ }
3910
+ _initializeTargetsAndObservables() {
3911
+ this._targetLinks = new Map();
3912
+ this._observableSections = new Map();
3913
+ const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);
3914
+ for (const anchor of targetLinks) {
3915
+ // ensure that the anchor has an id and is not disabled
3916
+ if (!anchor.hash || isDisabled(anchor)) {
3917
+ continue;
3918
+ }
3919
+ const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
3920
+
3921
+ // ensure that the observableSection exists & is visible
3922
+ if (isVisible(observableSection)) {
3923
+ this._targetLinks.set(decodeURI(anchor.hash), anchor);
3924
+ this._observableSections.set(anchor.hash, observableSection);
3925
+ }
3926
+ }
3927
+ }
3928
+ _process(target) {
3929
+ if (this._activeTarget === target) {
3930
+ return;
3931
+ }
3932
+ this._clearActiveClass(this._config.target);
3933
+ this._activeTarget = target;
3934
+ target.classList.add(CLASS_NAME_ACTIVE$1);
3935
+ this._activateParents(target);
3936
+ EventHandler.trigger(this._element, EVENT_ACTIVATE, {
3937
+ relatedTarget: target
3938
+ });
3939
+ }
3940
+ _activateParents(target) {
3941
+ // Activate dropdown parents
3942
+ if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
3943
+ SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);
3944
+ return;
3945
+ }
3946
+ for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {
3947
+ // Set triggered links parents as active
3948
+ // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
3949
+ for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {
3950
+ item.classList.add(CLASS_NAME_ACTIVE$1);
3951
+ }
3952
+ }
3953
+ }
3954
+ _clearActiveClass(parent) {
3955
+ parent.classList.remove(CLASS_NAME_ACTIVE$1);
3956
+ const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent);
3957
+ for (const node of activeNodes) {
3958
+ node.classList.remove(CLASS_NAME_ACTIVE$1);
3959
+ }
3960
+ }
3961
+
3962
+ // Static
3963
+ static jQueryInterface(config) {
3964
+ return this.each(function () {
3965
+ const data = ScrollSpy.getOrCreateInstance(this, config);
3966
+ if (typeof config !== 'string') {
3967
+ return;
3968
+ }
3969
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
3970
+ throw new TypeError(`No method named "${config}"`);
3971
+ }
3972
+ data[config]();
3973
+ });
3974
+ }
3975
+ }
3976
+
3977
+ /**
3978
+ * Data API implementation
3979
+ */
3980
+
3981
+ EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {
3982
+ for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {
3983
+ ScrollSpy.getOrCreateInstance(spy);
3984
+ }
3985
+ });
3986
+
3987
+ /**
3988
+ * jQuery
3989
+ */
3990
+
3991
+ defineJQueryPlugin(ScrollSpy);
3992
+
3993
+ /**
3994
+ * --------------------------------------------------------------------------
3995
+ * Bootstrap tab.js
3996
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3997
+ * --------------------------------------------------------------------------
3998
+ */
3999
+
4000
+
4001
+ /**
4002
+ * Constants
4003
+ */
4004
+
4005
+ const NAME$1 = 'tab';
4006
+ const DATA_KEY$1 = 'bs.tab';
4007
+ const EVENT_KEY$1 = `.${DATA_KEY$1}`;
4008
+ const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;
4009
+ const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;
4010
+ const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;
4011
+ const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;
4012
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`;
4013
+ const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`;
4014
+ const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`;
4015
+ const ARROW_LEFT_KEY = 'ArrowLeft';
4016
+ const ARROW_RIGHT_KEY = 'ArrowRight';
4017
+ const ARROW_UP_KEY = 'ArrowUp';
4018
+ const ARROW_DOWN_KEY = 'ArrowDown';
4019
+ const HOME_KEY = 'Home';
4020
+ const END_KEY = 'End';
4021
+ const CLASS_NAME_ACTIVE = 'active';
4022
+ const CLASS_NAME_FADE$1 = 'fade';
4023
+ const CLASS_NAME_SHOW$1 = 'show';
4024
+ const CLASS_DROPDOWN = 'dropdown';
4025
+ const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
4026
+ const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
4027
+ const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`;
4028
+ const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
4029
+ const SELECTOR_OUTER = '.nav-item, .list-group-item';
4030
+ const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
4031
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
4032
+ const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
4033
+ const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
4034
+
4035
+ /**
4036
+ * Class definition
4037
+ */
4038
+
4039
+ class Tab extends BaseComponent {
4040
+ constructor(element) {
4041
+ super(element);
4042
+ this._parent = this._element.closest(SELECTOR_TAB_PANEL);
4043
+ if (!this._parent) {
4044
+ return;
4045
+ // TODO: should throw exception in v6
4046
+ // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
4047
+ }
4048
+
4049
+ // Set up initial aria attributes
4050
+ this._setInitialAttributes(this._parent, this._getChildren());
4051
+ EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
4052
+ }
4053
+
4054
+ // Getters
4055
+ static get NAME() {
4056
+ return NAME$1;
4057
+ }
4058
+
4059
+ // Public
4060
+ show() {
4061
+ // Shows this elem and deactivate the active sibling if exists
4062
+ const innerElem = this._element;
4063
+ if (this._elemIsActive(innerElem)) {
4064
+ return;
4065
+ }
4066
+
4067
+ // Search for active tab on same parent to deactivate it
4068
+ const active = this._getActiveElem();
4069
+ const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, {
4070
+ relatedTarget: innerElem
4071
+ }) : null;
4072
+ const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, {
4073
+ relatedTarget: active
4074
+ });
4075
+ if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) {
4076
+ return;
4077
+ }
4078
+ this._deactivate(active, innerElem);
4079
+ this._activate(innerElem, active);
4080
+ }
4081
+
4082
+ // Private
4083
+ _activate(element, relatedElem) {
4084
+ if (!element) {
4085
+ return;
4086
+ }
4087
+ element.classList.add(CLASS_NAME_ACTIVE);
4088
+ this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section
4089
+
4090
+ const complete = () => {
4091
+ if (element.getAttribute('role') !== 'tab') {
4092
+ element.classList.add(CLASS_NAME_SHOW$1);
4093
+ return;
4094
+ }
4095
+ element.removeAttribute('tabindex');
4096
+ element.setAttribute('aria-selected', true);
4097
+ this._toggleDropDown(element, true);
4098
+ EventHandler.trigger(element, EVENT_SHOWN$1, {
4099
+ relatedTarget: relatedElem
4100
+ });
4101
+ };
4102
+ this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
4103
+ }
4104
+ _deactivate(element, relatedElem) {
4105
+ if (!element) {
4106
+ return;
4107
+ }
4108
+ element.classList.remove(CLASS_NAME_ACTIVE);
4109
+ element.blur();
4110
+ this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too
4111
+
4112
+ const complete = () => {
4113
+ if (element.getAttribute('role') !== 'tab') {
4114
+ element.classList.remove(CLASS_NAME_SHOW$1);
4115
+ return;
4116
+ }
4117
+ element.setAttribute('aria-selected', false);
4118
+ element.setAttribute('tabindex', '-1');
4119
+ this._toggleDropDown(element, false);
4120
+ EventHandler.trigger(element, EVENT_HIDDEN$1, {
4121
+ relatedTarget: relatedElem
4122
+ });
4123
+ };
4124
+ this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
4125
+ }
4126
+ _keydown(event) {
4127
+ if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {
4128
+ return;
4129
+ }
4130
+ event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
4131
+ event.preventDefault();
4132
+ const children = this._getChildren().filter(element => !isDisabled(element));
4133
+ let nextActiveElement;
4134
+ if ([HOME_KEY, END_KEY].includes(event.key)) {
4135
+ nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];
4136
+ } else {
4137
+ const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
4138
+ nextActiveElement = getNextActiveElement(children, event.target, isNext, true);
4139
+ }
4140
+ if (nextActiveElement) {
4141
+ nextActiveElement.focus({
4142
+ preventScroll: true
4143
+ });
4144
+ Tab.getOrCreateInstance(nextActiveElement).show();
4145
+ }
4146
+ }
4147
+ _getChildren() {
4148
+ // collection of inner elements
4149
+ return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent);
4150
+ }
4151
+ _getActiveElem() {
4152
+ return this._getChildren().find(child => this._elemIsActive(child)) || null;
4153
+ }
4154
+ _setInitialAttributes(parent, children) {
4155
+ this._setAttributeIfNotExists(parent, 'role', 'tablist');
4156
+ for (const child of children) {
4157
+ this._setInitialAttributesOnChild(child);
4158
+ }
4159
+ }
4160
+ _setInitialAttributesOnChild(child) {
4161
+ child = this._getInnerElement(child);
4162
+ const isActive = this._elemIsActive(child);
4163
+ const outerElem = this._getOuterElement(child);
4164
+ child.setAttribute('aria-selected', isActive);
4165
+ if (outerElem !== child) {
4166
+ this._setAttributeIfNotExists(outerElem, 'role', 'presentation');
4167
+ }
4168
+ if (!isActive) {
4169
+ child.setAttribute('tabindex', '-1');
4170
+ }
4171
+ this._setAttributeIfNotExists(child, 'role', 'tab');
4172
+
4173
+ // set attributes to the related panel too
4174
+ this._setInitialAttributesOnTargetPanel(child);
4175
+ }
4176
+ _setInitialAttributesOnTargetPanel(child) {
4177
+ const target = SelectorEngine.getElementFromSelector(child);
4178
+ if (!target) {
4179
+ return;
4180
+ }
4181
+ this._setAttributeIfNotExists(target, 'role', 'tabpanel');
4182
+ if (child.id) {
4183
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
4184
+ }
4185
+ }
4186
+ _toggleDropDown(element, open) {
4187
+ const outerElem = this._getOuterElement(element);
4188
+ if (!outerElem.classList.contains(CLASS_DROPDOWN)) {
4189
+ return;
4190
+ }
4191
+ const toggle = (selector, className) => {
4192
+ const element = SelectorEngine.findOne(selector, outerElem);
4193
+ if (element) {
4194
+ element.classList.toggle(className, open);
4195
+ }
4196
+ };
4197
+ toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE);
4198
+ toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1);
4199
+ outerElem.setAttribute('aria-expanded', open);
4200
+ }
4201
+ _setAttributeIfNotExists(element, attribute, value) {
4202
+ if (!element.hasAttribute(attribute)) {
4203
+ element.setAttribute(attribute, value);
4204
+ }
4205
+ }
4206
+ _elemIsActive(elem) {
4207
+ return elem.classList.contains(CLASS_NAME_ACTIVE);
4208
+ }
4209
+
4210
+ // Try to get the inner element (usually the .nav-link)
4211
+ _getInnerElement(elem) {
4212
+ return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem);
4213
+ }
4214
+
4215
+ // Try to get the outer element (usually the .nav-item)
4216
+ _getOuterElement(elem) {
4217
+ return elem.closest(SELECTOR_OUTER) || elem;
4218
+ }
4219
+
4220
+ // Static
4221
+ static jQueryInterface(config) {
4222
+ return this.each(function () {
4223
+ const data = Tab.getOrCreateInstance(this);
4224
+ if (typeof config !== 'string') {
4225
+ return;
4226
+ }
4227
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
4228
+ throw new TypeError(`No method named "${config}"`);
4229
+ }
4230
+ data[config]();
4231
+ });
4232
+ }
4233
+ }
4234
+
4235
+ /**
4236
+ * Data API implementation
4237
+ */
4238
+
4239
+ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
4240
+ if (['A', 'AREA'].includes(this.tagName)) {
4241
+ event.preventDefault();
4242
+ }
4243
+ if (isDisabled(this)) {
4244
+ return;
4245
+ }
4246
+ Tab.getOrCreateInstance(this).show();
4247
+ });
4248
+
4249
+ /**
4250
+ * Initialize on focus
4251
+ */
4252
+ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
4253
+ for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {
4254
+ Tab.getOrCreateInstance(element);
4255
+ }
4256
+ });
4257
+ /**
4258
+ * jQuery
4259
+ */
4260
+
4261
+ defineJQueryPlugin(Tab);
4262
+
4263
+ /**
4264
+ * --------------------------------------------------------------------------
4265
+ * Bootstrap toast.js
4266
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4267
+ * --------------------------------------------------------------------------
4268
+ */
4269
+
4270
+
4271
+ /**
4272
+ * Constants
4273
+ */
4274
+
4275
+ const NAME = 'toast';
4276
+ const DATA_KEY = 'bs.toast';
4277
+ const EVENT_KEY = `.${DATA_KEY}`;
4278
+ const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
4279
+ const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
4280
+ const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
4281
+ const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
4282
+ const EVENT_HIDE = `hide${EVENT_KEY}`;
4283
+ const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
4284
+ const EVENT_SHOW = `show${EVENT_KEY}`;
4285
+ const EVENT_SHOWN = `shown${EVENT_KEY}`;
4286
+ const CLASS_NAME_FADE = 'fade';
4287
+ const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
4288
+ const CLASS_NAME_SHOW = 'show';
4289
+ const CLASS_NAME_SHOWING = 'showing';
4290
+ const DefaultType = {
4291
+ animation: 'boolean',
4292
+ autohide: 'boolean',
4293
+ delay: 'number'
4294
+ };
4295
+ const Default = {
4296
+ animation: true,
4297
+ autohide: true,
4298
+ delay: 5000
4299
+ };
4300
+
4301
+ /**
4302
+ * Class definition
4303
+ */
4304
+
4305
+ class Toast extends BaseComponent {
4306
+ constructor(element, config) {
4307
+ super(element, config);
4308
+ this._timeout = null;
4309
+ this._hasMouseInteraction = false;
4310
+ this._hasKeyboardInteraction = false;
4311
+ this._setListeners();
4312
+ }
4313
+
4314
+ // Getters
4315
+ static get Default() {
4316
+ return Default;
4317
+ }
4318
+ static get DefaultType() {
4319
+ return DefaultType;
4320
+ }
4321
+ static get NAME() {
4322
+ return NAME;
4323
+ }
4324
+
4325
+ // Public
4326
+ show() {
4327
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);
4328
+ if (showEvent.defaultPrevented) {
4329
+ return;
4330
+ }
4331
+ this._clearTimeout();
4332
+ if (this._config.animation) {
4333
+ this._element.classList.add(CLASS_NAME_FADE);
4334
+ }
4335
+ const complete = () => {
4336
+ this._element.classList.remove(CLASS_NAME_SHOWING);
4337
+ EventHandler.trigger(this._element, EVENT_SHOWN);
4338
+ this._maybeScheduleHide();
4339
+ };
4340
+ this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
4341
+ reflow(this._element);
4342
+ this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);
4343
+ this._queueCallback(complete, this._element, this._config.animation);
4344
+ }
4345
+ hide() {
4346
+ if (!this.isShown()) {
4347
+ return;
4348
+ }
4349
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
4350
+ if (hideEvent.defaultPrevented) {
4351
+ return;
4352
+ }
4353
+ const complete = () => {
4354
+ this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
4355
+ this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);
4356
+ EventHandler.trigger(this._element, EVENT_HIDDEN);
4357
+ };
4358
+ this._element.classList.add(CLASS_NAME_SHOWING);
4359
+ this._queueCallback(complete, this._element, this._config.animation);
4360
+ }
4361
+ dispose() {
4362
+ this._clearTimeout();
4363
+ if (this.isShown()) {
4364
+ this._element.classList.remove(CLASS_NAME_SHOW);
4365
+ }
4366
+ super.dispose();
4367
+ }
4368
+ isShown() {
4369
+ return this._element.classList.contains(CLASS_NAME_SHOW);
4370
+ }
4371
+
4372
+ // Private
4373
+ _maybeScheduleHide() {
4374
+ if (!this._config.autohide) {
4375
+ return;
4376
+ }
4377
+ if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
4378
+ return;
4379
+ }
4380
+ this._timeout = setTimeout(() => {
4381
+ this.hide();
4382
+ }, this._config.delay);
4383
+ }
4384
+ _onInteraction(event, isInteracting) {
4385
+ switch (event.type) {
4386
+ case 'mouseover':
4387
+ case 'mouseout':
4388
+ {
4389
+ this._hasMouseInteraction = isInteracting;
4390
+ break;
4391
+ }
4392
+ case 'focusin':
4393
+ case 'focusout':
4394
+ {
4395
+ this._hasKeyboardInteraction = isInteracting;
4396
+ break;
4397
+ }
4398
+ }
4399
+ if (isInteracting) {
4400
+ this._clearTimeout();
4401
+ return;
4402
+ }
4403
+ const nextElement = event.relatedTarget;
4404
+ if (this._element === nextElement || this._element.contains(nextElement)) {
4405
+ return;
4406
+ }
4407
+ this._maybeScheduleHide();
4408
+ }
4409
+ _setListeners() {
4410
+ EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
4411
+ EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
4412
+ EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
4413
+ EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
4414
+ }
4415
+ _clearTimeout() {
4416
+ clearTimeout(this._timeout);
4417
+ this._timeout = null;
4418
+ }
4419
+
4420
+ // Static
4421
+ static jQueryInterface(config) {
4422
+ return this.each(function () {
4423
+ const data = Toast.getOrCreateInstance(this, config);
4424
+ if (typeof config === 'string') {
4425
+ if (typeof data[config] === 'undefined') {
4426
+ throw new TypeError(`No method named "${config}"`);
4427
+ }
4428
+ data[config](this);
4429
+ }
4430
+ });
4431
+ }
4432
+ }
4433
+
4434
+ /**
4435
+ * Data API implementation
4436
+ */
4437
+
4438
+ enableDismissTrigger(Toast);
4439
+
4440
+ /**
4441
+ * jQuery
4442
+ */
4443
+
4444
+ defineJQueryPlugin(Toast);
4445
+
4446
+ export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Offcanvas, Popover, ScrollSpy, Tab, Toast, Tooltip };
4447
+ //# sourceMappingURL=bootstrap.esm.js.map