@tabler/core 1.0.0-beta10 → 1.0.0-beta12

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 (428) hide show
  1. package/README.md +66 -21
  2. package/dist/css/demo.css +251 -379
  3. package/dist/css/demo.min.css +3 -3
  4. package/dist/css/demo.rtl.css +251 -379
  5. package/dist/css/demo.rtl.min.css +3 -3
  6. package/dist/css/tabler-flags.css +266 -529
  7. package/dist/css/tabler-flags.min.css +3 -3
  8. package/dist/css/tabler-flags.rtl.css +266 -529
  9. package/dist/css/tabler-flags.rtl.min.css +3 -3
  10. package/dist/css/tabler-payments.css +127 -252
  11. package/dist/css/tabler-payments.min.css +2 -2
  12. package/dist/css/tabler-payments.rtl.css +127 -252
  13. package/dist/css/tabler-payments.rtl.min.css +2 -2
  14. package/dist/css/tabler-vendors.css +526 -611
  15. package/dist/css/tabler-vendors.min.css +3 -3
  16. package/dist/css/tabler-vendors.rtl.css +526 -611
  17. package/dist/css/tabler-vendors.rtl.min.css +3 -3
  18. package/dist/css/tabler.css +11259 -13083
  19. package/dist/css/tabler.min.css +4 -4
  20. package/dist/css/tabler.rtl.css +11251 -13090
  21. package/dist/css/tabler.rtl.min.css +4 -4
  22. package/dist/js/demo-theme.js +32 -0
  23. package/dist/js/demo-theme.min.js +9 -0
  24. package/dist/js/demo.js +2 -12
  25. package/dist/js/demo.min.js +3 -3
  26. package/dist/js/tabler.esm.js +1692 -1541
  27. package/dist/js/tabler.esm.min.js +9 -3
  28. package/dist/js/tabler.js +1687 -1514
  29. package/dist/js/tabler.min.js +9 -3
  30. package/dist/libs/apexcharts/dist/apexcharts.amd.js +2 -0
  31. package/dist/libs/apexcharts/dist/apexcharts.common.js +14 -0
  32. package/dist/libs/apexcharts/dist/apexcharts.css +691 -0
  33. package/dist/libs/apexcharts/dist/apexcharts.esm.js +14 -0
  34. package/dist/libs/apexcharts/dist/apexcharts.js +31979 -0
  35. package/dist/libs/apexcharts/dist/apexcharts.min.js +4 -4
  36. package/dist/libs/apexcharts/dist/locales/ar.json +63 -0
  37. package/dist/libs/apexcharts/dist/locales/ca.json +55 -0
  38. package/dist/libs/apexcharts/dist/locales/cs.json +55 -0
  39. package/dist/libs/apexcharts/dist/locales/de.json +55 -0
  40. package/dist/libs/apexcharts/dist/locales/el.json +55 -0
  41. package/dist/libs/apexcharts/dist/locales/en.json +55 -0
  42. package/dist/libs/apexcharts/dist/locales/es.json +55 -0
  43. package/dist/libs/apexcharts/dist/locales/et.json +63 -0
  44. package/dist/libs/apexcharts/dist/locales/fa.json +55 -0
  45. package/dist/libs/apexcharts/dist/locales/fi.json +55 -0
  46. package/dist/libs/apexcharts/dist/locales/fr.json +55 -0
  47. package/dist/libs/apexcharts/dist/locales/he.json +55 -0
  48. package/dist/libs/apexcharts/dist/locales/hi.json +55 -0
  49. package/dist/libs/apexcharts/dist/locales/hr.json +55 -0
  50. package/dist/libs/apexcharts/dist/locales/hu.json +64 -0
  51. package/dist/libs/apexcharts/dist/locales/hy.json +55 -0
  52. package/dist/libs/apexcharts/dist/locales/id.json +47 -0
  53. package/dist/libs/apexcharts/dist/locales/it.json +55 -0
  54. package/dist/libs/apexcharts/dist/locales/ja.json +55 -0
  55. package/dist/libs/apexcharts/dist/locales/ka.json +55 -0
  56. package/dist/libs/apexcharts/dist/locales/ko.json +55 -0
  57. package/dist/libs/apexcharts/dist/locales/lt.json +55 -0
  58. package/dist/libs/apexcharts/dist/locales/lv.json +64 -0
  59. package/dist/libs/apexcharts/dist/locales/nb.json +55 -0
  60. package/dist/libs/apexcharts/dist/locales/nl.json +55 -0
  61. package/dist/libs/apexcharts/dist/locales/pl.json +55 -0
  62. package/dist/libs/apexcharts/dist/locales/pt-br.json +55 -0
  63. package/dist/libs/apexcharts/dist/locales/pt.json +55 -0
  64. package/dist/libs/apexcharts/dist/locales/rs.json +55 -0
  65. package/dist/libs/apexcharts/dist/locales/ru.json +55 -0
  66. package/dist/libs/apexcharts/dist/locales/se.json +55 -0
  67. package/dist/libs/apexcharts/dist/locales/sk.json +55 -0
  68. package/dist/libs/apexcharts/dist/locales/sl.json +55 -0
  69. package/dist/libs/apexcharts/dist/locales/sq.json +55 -0
  70. package/dist/libs/apexcharts/dist/locales/th.json +55 -0
  71. package/dist/libs/apexcharts/dist/locales/tr.json +55 -0
  72. package/dist/libs/apexcharts/dist/locales/ua.json +55 -0
  73. package/dist/libs/apexcharts/dist/locales/zh-cn.json +55 -0
  74. package/dist/libs/apexcharts/dist/locales/zh-tw.json +55 -0
  75. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +7090 -0
  76. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
  77. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
  78. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
  79. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +5217 -0
  80. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
  81. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
  82. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
  83. package/dist/libs/bootstrap/dist/js/bootstrap.js +5264 -0
  84. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -0
  85. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +7 -0
  86. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -0
  87. package/dist/libs/countup.js/dist/countUp.d.ts +61 -0
  88. package/dist/libs/countup.js/dist/countUp.js +25 -22
  89. package/dist/libs/countup.js/dist/countUp.min.js +1 -0
  90. package/dist/libs/countup.js/dist/countUp.umd.js +293 -0
  91. package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +1 -0
  92. package/dist/libs/dropzone/dist/basic.css +1 -0
  93. package/dist/libs/dropzone/dist/basic.css.map +1 -0
  94. package/dist/libs/dropzone/dist/dropzone-min.js +2 -0
  95. package/dist/libs/dropzone/dist/dropzone-min.js.map +1 -0
  96. package/dist/libs/dropzone/dist/dropzone.css +1 -0
  97. package/dist/libs/dropzone/dist/dropzone.css.map +1 -0
  98. package/dist/libs/dropzone/dist/dropzone.js +3068 -0
  99. package/dist/libs/dropzone/dist/dropzone.js.map +1 -0
  100. package/dist/libs/dropzone/dist/dropzone.mjs +2111 -0
  101. package/dist/libs/dropzone/dist/dropzone.mjs.map +1 -0
  102. package/dist/libs/fslightbox/LICENSE +21 -0
  103. package/dist/libs/fslightbox/README.md +62 -0
  104. package/dist/libs/fslightbox/index.js +1 -0
  105. package/dist/libs/fslightbox/jest-setup.js +1 -0
  106. package/dist/libs/fslightbox/package.json +72 -0
  107. package/dist/libs/jsvectormap/dist/js/jsvectormap.js +2658 -0
  108. package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -1
  109. package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -1
  110. package/dist/libs/jsvectormap/dist/maps/world.js +1 -1
  111. package/dist/libs/list.js/dist/list.js +2020 -0
  112. package/dist/libs/list.js/dist/list.js.map +1 -0
  113. package/dist/libs/list.js/dist/list.min.js.map +1 -0
  114. package/dist/libs/litepicker/dist/bundle.js +52 -0
  115. package/dist/libs/litepicker/dist/css/litepicker.css +13 -0
  116. package/dist/libs/litepicker/dist/css/plugins/keyboardnav.js.css +12 -0
  117. package/dist/libs/litepicker/dist/css/plugins/mobilefriendly.js.css +133 -0
  118. package/dist/libs/litepicker/dist/css/plugins/multiselect.js.css +54 -0
  119. package/dist/libs/litepicker/dist/css/plugins/ranges.js.css +81 -0
  120. package/dist/libs/litepicker/dist/js/main.js +13 -0
  121. package/dist/libs/litepicker/dist/litepicker.amd.js +12 -0
  122. package/dist/libs/litepicker/dist/litepicker.commonjs2.js +12 -0
  123. package/dist/libs/litepicker/dist/litepicker.umd.js +12 -0
  124. package/dist/libs/litepicker/dist/nocss/litepicker.amd.js +12 -0
  125. package/dist/libs/litepicker/dist/nocss/litepicker.commonjs2.js +12 -0
  126. package/dist/libs/litepicker/dist/nocss/litepicker.js +12 -0
  127. package/dist/libs/litepicker/dist/nocss/litepicker.umd.js +12 -0
  128. package/dist/libs/litepicker/dist/nocss/plugins/keyboardnav.js +11 -0
  129. package/dist/libs/litepicker/dist/nocss/plugins/mobilefriendly.js +11 -0
  130. package/dist/libs/litepicker/dist/nocss/plugins/multiselect.js +11 -0
  131. package/dist/libs/litepicker/dist/nocss/plugins/ranges.js +11 -0
  132. package/dist/libs/litepicker/dist/plugins/keyboardnav.js +11 -0
  133. package/dist/libs/litepicker/dist/plugins/mobilefriendly.js +11 -0
  134. package/dist/libs/litepicker/dist/plugins/multiselect.js +11 -0
  135. package/dist/libs/litepicker/dist/plugins/ranges.js +11 -0
  136. package/dist/libs/litepicker/dist/types/calendar.d.ts +14 -0
  137. package/dist/libs/litepicker/dist/types/core.d.ts +23 -0
  138. package/dist/libs/litepicker/dist/types/datetime.d.ts +41 -0
  139. package/dist/libs/litepicker/dist/types/index.d.ts +4 -0
  140. package/dist/libs/litepicker/dist/types/interfaces.d.ts +80 -0
  141. package/dist/libs/litepicker/dist/types/litepicker.d.ts +25 -0
  142. package/dist/libs/litepicker/dist/types/methods.d.ts +20 -0
  143. package/dist/libs/litepicker/dist/types/utils.d.ts +4 -0
  144. package/dist/libs/litepicker/dist/types/window.d.ts +6 -0
  145. package/dist/libs/nouislider/dist/nouislider.css +304 -0
  146. package/dist/libs/nouislider/dist/nouislider.d.ts +198 -0
  147. package/dist/libs/nouislider/dist/nouislider.js +2254 -0
  148. package/dist/libs/nouislider/dist/nouislider.min.css +1 -0
  149. package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
  150. package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -0
  151. package/dist/libs/nouislider/dist/nouislider.mjs +2243 -0
  152. package/dist/libs/plyr/dist/plyr.css +1 -0
  153. package/dist/libs/plyr/dist/plyr.js +8764 -0
  154. package/dist/libs/plyr/dist/plyr.min.js +2 -0
  155. package/dist/libs/plyr/dist/plyr.min.js.map +1 -0
  156. package/dist/libs/plyr/dist/plyr.min.mjs +1 -0
  157. package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -0
  158. package/dist/libs/plyr/dist/plyr.mjs +8756 -0
  159. package/dist/libs/plyr/dist/plyr.polyfilled.js +9301 -0
  160. package/dist/libs/plyr/dist/plyr.polyfilled.min.js +2 -0
  161. package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -0
  162. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -0
  163. package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -0
  164. package/dist/libs/plyr/dist/plyr.polyfilled.mjs +9293 -0
  165. package/dist/libs/plyr/dist/plyr.svg +1 -0
  166. package/dist/libs/tinymce/CHANGELOG.md +2957 -0
  167. package/dist/libs/tinymce/README.md +71 -0
  168. package/dist/libs/tinymce/bower.json +27 -0
  169. package/dist/libs/tinymce/composer.json +52 -0
  170. package/dist/libs/tinymce/icons/default/icons.js +182 -0
  171. package/dist/libs/tinymce/icons/default/icons.min.js +1 -0
  172. package/dist/libs/tinymce/icons/default/index.js +7 -0
  173. package/dist/libs/tinymce/license.txt +21 -0
  174. package/dist/libs/tinymce/models/dom/index.js +7 -0
  175. package/dist/libs/tinymce/models/dom/model.js +7975 -0
  176. package/dist/libs/tinymce/models/dom/model.min.js +4 -0
  177. package/dist/libs/tinymce/package.json +32 -0
  178. package/dist/libs/tinymce/plugins/advlist/index.js +7 -0
  179. package/dist/libs/tinymce/plugins/advlist/plugin.js +246 -0
  180. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +4 -0
  181. package/dist/libs/tinymce/plugins/anchor/index.js +7 -0
  182. package/dist/libs/tinymce/plugins/anchor/plugin.js +195 -0
  183. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +4 -0
  184. package/dist/libs/tinymce/plugins/autolink/index.js +7 -0
  185. package/dist/libs/tinymce/plugins/autolink/plugin.js +232 -0
  186. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +4 -0
  187. package/dist/libs/tinymce/plugins/autoresize/index.js +7 -0
  188. package/dist/libs/tinymce/plugins/autoresize/plugin.js +156 -0
  189. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +4 -0
  190. package/dist/libs/tinymce/plugins/autosave/index.js +7 -0
  191. package/dist/libs/tinymce/plugins/autosave/plugin.js +232 -0
  192. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +4 -0
  193. package/dist/libs/tinymce/plugins/charmap/index.js +7 -0
  194. package/dist/libs/tinymce/plugins/charmap/plugin.js +1636 -0
  195. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +4 -0
  196. package/dist/libs/tinymce/plugins/code/index.js +7 -0
  197. package/dist/libs/tinymce/plugins/code/plugin.js +85 -0
  198. package/dist/libs/tinymce/plugins/code/plugin.min.js +4 -0
  199. package/dist/libs/tinymce/plugins/codesample/index.js +7 -0
  200. package/dist/libs/tinymce/plugins/codesample/plugin.js +2451 -0
  201. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +4 -0
  202. package/dist/libs/tinymce/plugins/directionality/index.js +7 -0
  203. package/dist/libs/tinymce/plugins/directionality/plugin.js +384 -0
  204. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +4 -0
  205. package/dist/libs/tinymce/plugins/emoticons/index.js +7 -0
  206. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  207. package/dist/libs/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  208. package/dist/libs/tinymce/plugins/emoticons/js/emojis.js +1 -0
  209. package/dist/libs/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  210. package/dist/libs/tinymce/plugins/emoticons/plugin.js +577 -0
  211. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +4 -0
  212. package/dist/libs/tinymce/plugins/fullscreen/index.js +7 -0
  213. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1190 -0
  214. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +4 -0
  215. package/dist/libs/tinymce/plugins/help/index.js +7 -0
  216. package/dist/libs/tinymce/plugins/help/plugin.js +848 -0
  217. package/dist/libs/tinymce/plugins/help/plugin.min.js +4 -0
  218. package/dist/libs/tinymce/plugins/image/index.js +7 -0
  219. package/dist/libs/tinymce/plugins/image/plugin.js +1475 -0
  220. package/dist/libs/tinymce/plugins/image/plugin.min.js +4 -0
  221. package/dist/libs/tinymce/plugins/importcss/index.js +7 -0
  222. package/dist/libs/tinymce/plugins/importcss/plugin.js +342 -0
  223. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +4 -0
  224. package/dist/libs/tinymce/plugins/insertdatetime/index.js +7 -0
  225. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +176 -0
  226. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
  227. package/dist/libs/tinymce/plugins/link/index.js +7 -0
  228. package/dist/libs/tinymce/plugins/link/plugin.js +1190 -0
  229. package/dist/libs/tinymce/plugins/link/plugin.min.js +4 -0
  230. package/dist/libs/tinymce/plugins/lists/index.js +7 -0
  231. package/dist/libs/tinymce/plugins/lists/plugin.js +1820 -0
  232. package/dist/libs/tinymce/plugins/lists/plugin.min.js +4 -0
  233. package/dist/libs/tinymce/plugins/media/index.js +7 -0
  234. package/dist/libs/tinymce/plugins/media/plugin.js +1157 -0
  235. package/dist/libs/tinymce/plugins/media/plugin.min.js +4 -0
  236. package/dist/libs/tinymce/plugins/nonbreaking/index.js +7 -0
  237. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +111 -0
  238. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
  239. package/dist/libs/tinymce/plugins/pagebreak/index.js +7 -0
  240. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +105 -0
  241. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +4 -0
  242. package/dist/libs/tinymce/plugins/preview/index.js +7 -0
  243. package/dist/libs/tinymce/plugins/preview/plugin.js +97 -0
  244. package/dist/libs/tinymce/plugins/preview/plugin.min.js +4 -0
  245. package/dist/libs/tinymce/plugins/quickbars/index.js +7 -0
  246. package/dist/libs/tinymce/plugins/quickbars/plugin.js +421 -0
  247. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +4 -0
  248. package/dist/libs/tinymce/plugins/save/index.js +7 -0
  249. package/dist/libs/tinymce/plugins/save/plugin.js +118 -0
  250. package/dist/libs/tinymce/plugins/save/plugin.min.js +4 -0
  251. package/dist/libs/tinymce/plugins/searchreplace/index.js +7 -0
  252. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +1079 -0
  253. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +4 -0
  254. package/dist/libs/tinymce/plugins/table/index.js +7 -0
  255. package/dist/libs/tinymce/plugins/table/plugin.js +3393 -0
  256. package/dist/libs/tinymce/plugins/table/plugin.min.js +4 -0
  257. package/dist/libs/tinymce/plugins/template/index.js +7 -0
  258. package/dist/libs/tinymce/plugins/template/plugin.js +548 -0
  259. package/dist/libs/tinymce/plugins/template/plugin.min.js +4 -0
  260. package/dist/libs/tinymce/plugins/visualblocks/index.js +7 -0
  261. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +98 -0
  262. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +4 -0
  263. package/dist/libs/tinymce/plugins/visualchars/index.js +7 -0
  264. package/dist/libs/tinymce/plugins/visualchars/plugin.js +506 -0
  265. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +4 -0
  266. package/dist/libs/tinymce/plugins/wordcount/index.js +7 -0
  267. package/dist/libs/tinymce/plugins/wordcount/plugin.js +404 -0
  268. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +4 -0
  269. package/dist/libs/tinymce/skins/content/dark/content.css +66 -0
  270. package/dist/libs/tinymce/skins/content/dark/content.min.css +1 -0
  271. package/dist/libs/tinymce/skins/content/default/content.css +61 -0
  272. package/dist/libs/tinymce/skins/content/default/content.min.css +1 -0
  273. package/dist/libs/tinymce/skins/content/document/content.css +66 -0
  274. package/dist/libs/tinymce/skins/content/document/content.min.css +1 -0
  275. package/dist/libs/tinymce/skins/content/tinymce-5/content.css +61 -0
  276. package/dist/libs/tinymce/skins/content/tinymce-5/content.min.css +1 -0
  277. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.css +66 -0
  278. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
  279. package/dist/libs/tinymce/skins/content/writer/content.css +62 -0
  280. package/dist/libs/tinymce/skins/content/writer/content.min.css +1 -0
  281. package/dist/libs/tinymce/skins/ui/oxide/content.css +747 -0
  282. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +741 -0
  283. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -0
  284. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -0
  285. package/dist/libs/tinymce/skins/ui/oxide/skin.css +3074 -0
  286. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -0
  287. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
  288. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  289. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +728 -0
  290. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +741 -0
  291. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -0
  292. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
  293. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +3077 -0
  294. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  295. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
  296. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  297. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +747 -0
  298. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +741 -0
  299. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
  300. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
  301. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +3158 -0
  302. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  303. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
  304. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  305. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +728 -0
  306. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +741 -0
  307. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  308. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
  309. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +3158 -0
  310. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  311. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
  312. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  313. package/dist/libs/tinymce/themes/silver/index.js +7 -0
  314. package/dist/libs/tinymce/themes/silver/theme.js +26184 -0
  315. package/dist/libs/tinymce/themes/silver/theme.min.js +4 -0
  316. package/dist/libs/tinymce/tinymce.d.ts +2895 -0
  317. package/dist/libs/tinymce/tinymce.js +29400 -0
  318. package/dist/libs/tinymce/tinymce.min.js +4 -0
  319. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +170 -0
  320. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -0
  321. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +58 -0
  322. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -0
  323. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +182 -0
  324. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -0
  325. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +99 -0
  326. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -0
  327. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +70 -0
  328. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -0
  329. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +126 -0
  330. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -0
  331. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +240 -0
  332. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -0
  333. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +84 -0
  334. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -0
  335. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +33 -0
  336. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -0
  337. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +40 -0
  338. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -0
  339. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +117 -0
  340. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -0
  341. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +154 -0
  342. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -0
  343. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +51 -0
  344. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -0
  345. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +279 -0
  346. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -0
  347. package/dist/libs/tom-select/dist/js/tom-select.base.js +4165 -0
  348. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -0
  349. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +144 -144
  350. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -0
  351. package/dist/libs/tom-select/dist/js/tom-select.complete.js +4978 -0
  352. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -0
  353. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +363 -0
  354. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -0
  355. package/dist/libs/tom-select/dist/js/tom-select.popular.js +4419 -0
  356. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -0
  357. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +323 -0
  358. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -0
  359. package/package.json +100 -33
  360. package/src/js/demo-theme.js +25 -0
  361. package/src/js/demo.js +0 -17
  362. package/src/js/src/tabler.js +17 -0
  363. package/src/js/tabler.js +2 -0
  364. package/src/scss/_bootstrap-components.scss +1 -1
  365. package/src/scss/_bootstrap-config.scss +1 -0
  366. package/src/scss/_core.scss +2 -0
  367. package/src/scss/_utilities.scss +2 -2
  368. package/src/scss/_variables.scss +218 -92
  369. package/src/scss/demo/_examples.scss +2 -2
  370. package/src/scss/demo/_highlight.scss +3 -3
  371. package/src/scss/demo.scss +5 -5
  372. package/src/scss/fonts/_webfonts.scss +0 -50
  373. package/src/scss/layout/_core.scss +10 -23
  374. package/src/scss/layout/_dark.scss +22 -16
  375. package/src/scss/layout/_footer.scss +2 -2
  376. package/src/scss/layout/_navbar.scss +18 -15
  377. package/src/scss/layout/_page.scss +8 -6
  378. package/src/scss/layout/_root.scss +37 -0
  379. package/src/scss/mixins/_functions.scss +2 -16
  380. package/src/scss/mixins/_mixins.scss +32 -5
  381. package/src/scss/tabler-vendors.scss +4 -0
  382. package/src/scss/ui/_accordion.scss +5 -1
  383. package/src/scss/ui/_alerts.scss +8 -8
  384. package/src/scss/ui/_avatars.scss +14 -14
  385. package/src/scss/ui/_badges.scss +2 -2
  386. package/src/scss/ui/_breadcrumbs.scss +1 -1
  387. package/src/scss/ui/_buttons.scss +100 -108
  388. package/src/scss/ui/_calendars.scss +8 -8
  389. package/src/scss/ui/_cards.scss +46 -52
  390. package/src/scss/ui/_carousel.scss +2 -2
  391. package/src/scss/ui/_chips.scss +0 -0
  392. package/src/scss/ui/_datagrid.scss +17 -0
  393. package/src/scss/ui/_empty.scss +3 -3
  394. package/src/scss/ui/_flags.scss +2 -2
  395. package/src/scss/ui/_forms.scss +12 -11
  396. package/src/scss/ui/_grid.scss +13 -14
  397. package/src/scss/ui/_icons.scss +64 -4
  398. package/src/scss/ui/_legend.scss +8 -4
  399. package/src/scss/ui/_lists.scss +17 -14
  400. package/src/scss/ui/_markdown.scss +2 -3
  401. package/src/scss/ui/_modals.scss +1 -1
  402. package/src/scss/ui/_nav.scss +7 -7
  403. package/src/scss/ui/_offcanvas.scss +3 -3
  404. package/src/scss/ui/_pagination.scss +10 -6
  405. package/src/scss/ui/_placeholder.scss +1 -1
  406. package/src/scss/ui/_progress.scss +45 -6
  407. package/src/scss/ui/_ribbons.scss +5 -5
  408. package/src/scss/ui/_status.scss +28 -27
  409. package/src/scss/ui/_steps.scss +2 -2
  410. package/src/scss/ui/_tables.scss +26 -5
  411. package/src/scss/ui/_toasts.scss +1 -2
  412. package/src/scss/ui/_type.scss +45 -30
  413. package/src/scss/ui/forms/_form-check.scss +26 -1
  414. package/src/scss/ui/forms/_form-colorinput.scss +2 -2
  415. package/src/scss/ui/forms/_form-custom.scss +2 -2
  416. package/src/scss/ui/forms/_form-icon.scss +1 -1
  417. package/src/scss/ui/forms/_form-imagecheck.scss +4 -4
  418. package/src/scss/ui/forms/_form-selectgroup.scss +7 -7
  419. package/src/scss/ui/forms/_validation.scss +1 -1
  420. package/src/scss/ui/typo/_hr.scss +2 -3
  421. package/src/scss/utils/_colors.scss +19 -8
  422. package/src/scss/vendor/_dropzone.scss +27 -0
  423. package/src/scss/vendor/_fslightbox.scss +13 -0
  424. package/src/scss/vendor/_jsvectormap.scss +8 -8
  425. package/src/scss/vendor/_litepicker.scss +14 -14
  426. package/src/scss/vendor/_plyr.scss +3 -0
  427. package/src/scss/vendor/_tinymce.scss +25 -0
  428. package/src/scss/vendor/_tom-select.scss +2 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Tabler v1.0.0-beta10 (https://tabler.io)
3
- * @version 1.0.0-beta10
2
+ * Tabler v1.0.0-beta12 (https://tabler.io)
3
+ * @version 1.0.0-beta12
4
4
  * @link https://tabler.io
5
5
  * Copyright 2018-2022 The Tabler Authors
6
6
  * Copyright 2018-2022 codecalm.net Paweł Kuna
@@ -3253,32 +3253,50 @@ var max = Math.max;
3253
3253
  var min = Math.min;
3254
3254
  var round = Math.round;
3255
3255
 
3256
- function getBoundingClientRect(element, includeScale) {
3256
+ function getUAString() {
3257
+ var uaData = navigator.userAgentData;
3258
+ if (uaData != null && uaData.brands) {
3259
+ return uaData.brands.map(function (item) {
3260
+ return item.brand + "/" + item.version;
3261
+ }).join(' ');
3262
+ }
3263
+ return navigator.userAgent;
3264
+ }
3265
+
3266
+ function isLayoutViewport() {
3267
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
3268
+ }
3269
+
3270
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
3257
3271
  if (includeScale === void 0) {
3258
3272
  includeScale = false;
3259
3273
  }
3260
- var rect = element.getBoundingClientRect();
3274
+ if (isFixedStrategy === void 0) {
3275
+ isFixedStrategy = false;
3276
+ }
3277
+ var clientRect = element.getBoundingClientRect();
3261
3278
  var scaleX = 1;
3262
3279
  var scaleY = 1;
3263
- if (isHTMLElement(element) && includeScale) {
3264
- var offsetHeight = element.offsetHeight;
3265
- var offsetWidth = element.offsetWidth;
3266
- if (offsetWidth > 0) {
3267
- scaleX = round(rect.width) / offsetWidth || 1;
3268
- }
3269
- if (offsetHeight > 0) {
3270
- scaleY = round(rect.height) / offsetHeight || 1;
3271
- }
3272
- }
3280
+ if (includeScale && isHTMLElement(element)) {
3281
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
3282
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
3283
+ }
3284
+ var _ref = isElement$1(element) ? getWindow(element) : window,
3285
+ visualViewport = _ref.visualViewport;
3286
+ var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
3287
+ var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
3288
+ var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
3289
+ var width = clientRect.width / scaleX;
3290
+ var height = clientRect.height / scaleY;
3273
3291
  return {
3274
- width: rect.width / scaleX,
3275
- height: rect.height / scaleY,
3276
- top: rect.top / scaleY,
3277
- right: rect.right / scaleX,
3278
- bottom: rect.bottom / scaleY,
3279
- left: rect.left / scaleX,
3280
- x: rect.left / scaleX,
3281
- y: rect.top / scaleY
3292
+ width: width,
3293
+ height: height,
3294
+ top: y,
3295
+ right: x + width,
3296
+ bottom: y + height,
3297
+ left: x,
3298
+ x: x,
3299
+ y: y
3282
3300
  };
3283
3301
  }
3284
3302
 
@@ -3350,8 +3368,8 @@ function getTrueOffsetParent(element) {
3350
3368
  return element.offsetParent;
3351
3369
  }
3352
3370
  function getContainingBlock(element) {
3353
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
3354
- var isIE = navigator.userAgent.indexOf('Trident') !== -1;
3371
+ var isFirefox = /firefox/i.test(getUAString());
3372
+ var isIE = /Trident/i.test(getUAString());
3355
3373
  if (isIE && isHTMLElement(element)) {
3356
3374
  var elementCss = getComputedStyle$1(element);
3357
3375
  if (elementCss.position === 'fixed') {
@@ -3698,7 +3716,7 @@ function getWindowScrollBarX(element) {
3698
3716
  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
3699
3717
  }
3700
3718
 
3701
- function getViewportRect(element) {
3719
+ function getViewportRect(element, strategy) {
3702
3720
  var win = getWindow(element);
3703
3721
  var html = getDocumentElement(element);
3704
3722
  var visualViewport = win.visualViewport;
@@ -3709,7 +3727,8 @@ function getViewportRect(element) {
3709
3727
  if (visualViewport) {
3710
3728
  width = visualViewport.width;
3711
3729
  height = visualViewport.height;
3712
- if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
3730
+ var layoutViewport = isLayoutViewport();
3731
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
3713
3732
  x = visualViewport.offsetLeft;
3714
3733
  y = visualViewport.offsetTop;
3715
3734
  }
@@ -3783,8 +3802,8 @@ function rectToClientRect(rect) {
3783
3802
  });
3784
3803
  }
3785
3804
 
3786
- function getInnerBoundingClientRect(element) {
3787
- var rect = getBoundingClientRect(element);
3805
+ function getInnerBoundingClientRect(element, strategy) {
3806
+ var rect = getBoundingClientRect(element, false, strategy === 'fixed');
3788
3807
  rect.top = rect.top + element.clientTop;
3789
3808
  rect.left = rect.left + element.clientLeft;
3790
3809
  rect.bottom = rect.top + element.clientHeight;
@@ -3795,8 +3814,8 @@ function getInnerBoundingClientRect(element) {
3795
3814
  rect.y = rect.top;
3796
3815
  return rect;
3797
3816
  }
3798
- function getClientRectFromMixedType(element, clippingParent) {
3799
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
3817
+ function getClientRectFromMixedType(element, clippingParent, strategy) {
3818
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
3800
3819
  }
3801
3820
  function getClippingParents(element) {
3802
3821
  var clippingParents = listScrollParents(getParentNode(element));
@@ -3809,18 +3828,18 @@ function getClippingParents(element) {
3809
3828
  return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
3810
3829
  });
3811
3830
  }
3812
- function getClippingRect(element, boundary, rootBoundary) {
3831
+ function getClippingRect(element, boundary, rootBoundary, strategy) {
3813
3832
  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
3814
3833
  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
3815
3834
  var firstClippingParent = clippingParents[0];
3816
3835
  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
3817
- var rect = getClientRectFromMixedType(element, clippingParent);
3836
+ var rect = getClientRectFromMixedType(element, clippingParent, strategy);
3818
3837
  accRect.top = max(rect.top, accRect.top);
3819
3838
  accRect.right = min(rect.right, accRect.right);
3820
3839
  accRect.bottom = min(rect.bottom, accRect.bottom);
3821
3840
  accRect.left = max(rect.left, accRect.left);
3822
3841
  return accRect;
3823
- }, getClientRectFromMixedType(element, firstClippingParent));
3842
+ }, getClientRectFromMixedType(element, firstClippingParent, strategy));
3824
3843
  clippingRect.width = clippingRect.right - clippingRect.left;
3825
3844
  clippingRect.height = clippingRect.bottom - clippingRect.top;
3826
3845
  clippingRect.x = clippingRect.left;
@@ -3890,6 +3909,8 @@ function detectOverflow(state, options) {
3890
3909
  var _options = options,
3891
3910
  _options$placement = _options.placement,
3892
3911
  placement = _options$placement === void 0 ? state.placement : _options$placement,
3912
+ _options$strategy = _options.strategy,
3913
+ strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
3893
3914
  _options$boundary = _options.boundary,
3894
3915
  boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
3895
3916
  _options$rootBoundary = _options.rootBoundary,
@@ -3904,7 +3925,7 @@ function detectOverflow(state, options) {
3904
3925
  var altContext = elementContext === popper ? reference : popper;
3905
3926
  var popperRect = state.rects.popper;
3906
3927
  var element = state.elements[altBoundary ? altContext : elementContext];
3907
- var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
3928
+ var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
3908
3929
  var referenceClientRect = getBoundingClientRect(state.elements.reference);
3909
3930
  var popperOffsets = computeOffsets({
3910
3931
  reference: referenceClientRect,
@@ -4339,7 +4360,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
4339
4360
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
4340
4361
  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
4341
4362
  var documentElement = getDocumentElement(offsetParent);
4342
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
4363
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
4343
4364
  var scroll = {
4344
4365
  scrollLeft: 0,
4345
4366
  scrollTop: 0
@@ -4632,18 +4653,18 @@ var Popper = /*#__PURE__*/Object.freeze({
4632
4653
  });
4633
4654
 
4634
4655
  /*!
4635
- * Bootstrap v5.1.3 (https://getbootstrap.com/)
4636
- * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4656
+ * Bootstrap v5.2.1 (https://getbootstrap.com/)
4657
+ * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4637
4658
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4638
4659
  */
4639
4660
  const MAX_UID = 1000000;
4640
4661
  const MILLISECONDS_MULTIPLIER = 1000;
4641
4662
  const TRANSITION_END = 'transitionend';
4642
- const toType = obj => {
4643
- if (obj === null || obj === undefined) {
4644
- return `${obj}`;
4663
+ const toType = object => {
4664
+ if (object === null || object === undefined) {
4665
+ return `${object}`;
4645
4666
  }
4646
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
4667
+ return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
4647
4668
  };
4648
4669
  const getUID = prefix => {
4649
4670
  do {
@@ -4654,14 +4675,14 @@ const getUID = prefix => {
4654
4675
  const getSelector = element => {
4655
4676
  let selector = element.getAttribute('data-bs-target');
4656
4677
  if (!selector || selector === '#') {
4657
- let hrefAttr = element.getAttribute('href');
4658
- if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
4678
+ let hrefAttribute = element.getAttribute('href');
4679
+ if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
4659
4680
  return null;
4660
4681
  }
4661
- if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
4662
- hrefAttr = `#${hrefAttr.split('#')[1]}`;
4682
+ if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
4683
+ hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
4663
4684
  }
4664
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
4685
+ selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
4665
4686
  }
4666
4687
  return selector;
4667
4688
  };
@@ -4696,39 +4717,43 @@ const getTransitionDurationFromElement = element => {
4696
4717
  const triggerTransitionEnd = element => {
4697
4718
  element.dispatchEvent(new Event(TRANSITION_END));
4698
4719
  };
4699
- const isElement = obj => {
4700
- if (!obj || typeof obj !== 'object') {
4720
+ const isElement = object => {
4721
+ if (!object || typeof object !== 'object') {
4701
4722
  return false;
4702
4723
  }
4703
- if (typeof obj.jquery !== 'undefined') {
4704
- obj = obj[0];
4724
+ if (typeof object.jquery !== 'undefined') {
4725
+ object = object[0];
4705
4726
  }
4706
- return typeof obj.nodeType !== 'undefined';
4727
+ return typeof object.nodeType !== 'undefined';
4707
4728
  };
4708
- const getElement = obj => {
4709
- if (isElement(obj)) {
4710
- return obj.jquery ? obj[0] : obj;
4729
+ const getElement = object => {
4730
+ if (isElement(object)) {
4731
+ return object.jquery ? object[0] : object;
4711
4732
  }
4712
- if (typeof obj === 'string' && obj.length > 0) {
4713
- return document.querySelector(obj);
4733
+ if (typeof object === 'string' && object.length > 0) {
4734
+ return document.querySelector(object);
4714
4735
  }
4715
4736
  return null;
4716
4737
  };
4717
- const typeCheckConfig = (componentName, config, configTypes) => {
4718
- Object.keys(configTypes).forEach(property => {
4719
- const expectedTypes = configTypes[property];
4720
- const value = config[property];
4721
- const valueType = value && isElement(value) ? 'element' : toType(value);
4722
- if (!new RegExp(expectedTypes).test(valueType)) {
4723
- throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
4724
- }
4725
- });
4726
- };
4727
4738
  const isVisible = element => {
4728
4739
  if (!isElement(element) || element.getClientRects().length === 0) {
4729
4740
  return false;
4730
4741
  }
4731
- return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
4742
+ const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
4743
+ const closedDetails = element.closest('details:not([open])');
4744
+ if (!closedDetails) {
4745
+ return elementIsVisible;
4746
+ }
4747
+ if (closedDetails !== element) {
4748
+ const summary = element.closest('summary');
4749
+ if (summary && summary.parentNode !== closedDetails) {
4750
+ return false;
4751
+ }
4752
+ if (summary === null) {
4753
+ return false;
4754
+ }
4755
+ }
4756
+ return elementIsVisible;
4732
4757
  };
4733
4758
  const isDisabled = element => {
4734
4759
  if (!element || element.nodeType !== Node.ELEMENT_NODE) {
@@ -4763,11 +4788,8 @@ const reflow = element => {
4763
4788
  element.offsetHeight;
4764
4789
  };
4765
4790
  const getjQuery = () => {
4766
- const {
4767
- jQuery
4768
- } = window;
4769
- if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
4770
- return jQuery;
4791
+ if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
4792
+ return window.jQuery;
4771
4793
  }
4772
4794
  return null;
4773
4795
  };
@@ -4776,7 +4798,9 @@ const onDOMContentLoaded = callback => {
4776
4798
  if (document.readyState === 'loading') {
4777
4799
  if (!DOMContentLoadedCallbacks.length) {
4778
4800
  document.addEventListener('DOMContentLoaded', () => {
4779
- DOMContentLoadedCallbacks.forEach(callback => callback());
4801
+ for (const callback of DOMContentLoadedCallbacks) {
4802
+ callback();
4803
+ }
4780
4804
  });
4781
4805
  }
4782
4806
  DOMContentLoadedCallbacks.push(callback);
@@ -4831,11 +4855,11 @@ const executeAfterTransition = (callback, transitionElement, waitForTransition =
4831
4855
  }, emulatedDuration);
4832
4856
  };
4833
4857
  const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
4858
+ const listLength = list.length;
4834
4859
  let index = list.indexOf(activeElement);
4835
4860
  if (index === -1) {
4836
- return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];
4861
+ return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];
4837
4862
  }
4838
- const listLength = list.length;
4839
4863
  index += shouldGetNext ? 1 : -1;
4840
4864
  if (isCycleAllowed) {
4841
4865
  index = (index + listLength) % listLength;
@@ -4851,20 +4875,21 @@ const customEvents = {
4851
4875
  mouseenter: 'mouseover',
4852
4876
  mouseleave: 'mouseout'
4853
4877
  };
4854
- const customEventsRegex = /^(mouseenter|mouseleave)/i;
4855
4878
  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']);
4856
- function getUidEvent(element, uid) {
4879
+ function makeEventUid(element, uid) {
4857
4880
  return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
4858
4881
  }
4859
- function getEvent(element) {
4860
- const uid = getUidEvent(element);
4882
+ function getElementEvents(element) {
4883
+ const uid = makeEventUid(element);
4861
4884
  element.uidEvent = uid;
4862
4885
  eventRegistry[uid] = eventRegistry[uid] || {};
4863
4886
  return eventRegistry[uid];
4864
4887
  }
4865
4888
  function bootstrapHandler(element, fn) {
4866
4889
  return function handler(event) {
4867
- event.delegateTarget = element;
4890
+ hydrateObj(event, {
4891
+ delegateTarget: element
4892
+ });
4868
4893
  if (handler.oneOff) {
4869
4894
  EventHandler.off(element, event.type, fn);
4870
4895
  }
@@ -4877,77 +4902,63 @@ function bootstrapDelegationHandler(element, selector, fn) {
4877
4902
  for (let {
4878
4903
  target
4879
4904
  } = event; target && target !== this; target = target.parentNode) {
4880
- for (let i = domElements.length; i--;) {
4881
- if (domElements[i] === target) {
4882
- event.delegateTarget = target;
4883
- if (handler.oneOff) {
4884
- EventHandler.off(element, event.type, selector, fn);
4885
- }
4886
- return fn.apply(target, [event]);
4905
+ for (const domElement of domElements) {
4906
+ if (domElement !== target) {
4907
+ continue;
4908
+ }
4909
+ hydrateObj(event, {
4910
+ delegateTarget: target
4911
+ });
4912
+ if (handler.oneOff) {
4913
+ EventHandler.off(element, event.type, selector, fn);
4887
4914
  }
4915
+ return fn.apply(target, [event]);
4888
4916
  }
4889
4917
  }
4890
- return null;
4891
4918
  };
4892
4919
  }
4893
- function findHandler(events, handler, delegationSelector = null) {
4894
- const uidEventList = Object.keys(events);
4895
- for (let i = 0, len = uidEventList.length; i < len; i++) {
4896
- const event = events[uidEventList[i]];
4897
- if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
4898
- return event;
4899
- }
4900
- }
4901
- return null;
4920
+ function findHandler(events, callable, delegationSelector = null) {
4921
+ return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
4902
4922
  }
4903
- function normalizeParams(originalTypeEvent, handler, delegationFn) {
4904
- const delegation = typeof handler === 'string';
4905
- const originalHandler = delegation ? delegationFn : handler;
4923
+ function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
4924
+ const isDelegated = typeof handler === 'string';
4925
+ const callable = isDelegated ? delegationFunction : handler || delegationFunction;
4906
4926
  let typeEvent = getTypeEvent(originalTypeEvent);
4907
- const isNative = nativeEvents.has(typeEvent);
4908
- if (!isNative) {
4927
+ if (!nativeEvents.has(typeEvent)) {
4909
4928
  typeEvent = originalTypeEvent;
4910
4929
  }
4911
- return [delegation, originalHandler, typeEvent];
4930
+ return [isDelegated, callable, typeEvent];
4912
4931
  }
4913
- function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
4932
+ function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
4914
4933
  if (typeof originalTypeEvent !== 'string' || !element) {
4915
4934
  return;
4916
4935
  }
4917
- if (!handler) {
4918
- handler = delegationFn;
4919
- delegationFn = null;
4920
- }
4921
- if (customEventsRegex.test(originalTypeEvent)) {
4922
- const wrapFn = fn => {
4936
+ let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
4937
+ if (originalTypeEvent in customEvents) {
4938
+ const wrapFunction = fn => {
4923
4939
  return function (event) {
4924
4940
  if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
4925
4941
  return fn.call(this, event);
4926
4942
  }
4927
4943
  };
4928
4944
  };
4929
- if (delegationFn) {
4930
- delegationFn = wrapFn(delegationFn);
4931
- } else {
4932
- handler = wrapFn(handler);
4933
- }
4945
+ callable = wrapFunction(callable);
4934
4946
  }
4935
- const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
4936
- const events = getEvent(element);
4947
+ const events = getElementEvents(element);
4937
4948
  const handlers = events[typeEvent] || (events[typeEvent] = {});
4938
- const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
4939
- if (previousFn) {
4940
- previousFn.oneOff = previousFn.oneOff && oneOff;
4949
+ const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
4950
+ if (previousFunction) {
4951
+ previousFunction.oneOff = previousFunction.oneOff && oneOff;
4941
4952
  return;
4942
4953
  }
4943
- const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
4944
- const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
4945
- fn.delegationSelector = delegation ? handler : null;
4946
- fn.originalHandler = originalHandler;
4954
+ const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
4955
+ const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
4956
+ fn.delegationSelector = isDelegated ? handler : null;
4957
+ fn.callable = callable;
4947
4958
  fn.oneOff = oneOff;
4948
4959
  fn.uidEvent = uid;
4949
4960
  handlers[uid] = fn;
4950
- element.addEventListener(typeEvent, fn, delegation);
4961
+ element.addEventListener(typeEvent, fn, isDelegated);
4951
4962
  }
4952
4963
  function removeHandler(element, events, typeEvent, handler, delegationSelector) {
4953
4964
  const fn = findHandler(events[typeEvent], handler, delegationSelector);
@@ -4959,52 +4970,52 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector)
4959
4970
  }
4960
4971
  function removeNamespacedHandlers(element, events, typeEvent, namespace) {
4961
4972
  const storeElementEvent = events[typeEvent] || {};
4962
- Object.keys(storeElementEvent).forEach(handlerKey => {
4973
+ for (const handlerKey of Object.keys(storeElementEvent)) {
4963
4974
  if (handlerKey.includes(namespace)) {
4964
4975
  const event = storeElementEvent[handlerKey];
4965
- removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
4976
+ removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
4966
4977
  }
4967
- });
4978
+ }
4968
4979
  }
4969
4980
  function getTypeEvent(event) {
4970
4981
  event = event.replace(stripNameRegex, '');
4971
4982
  return customEvents[event] || event;
4972
4983
  }
4973
4984
  const EventHandler = {
4974
- on(element, event, handler, delegationFn) {
4975
- addHandler(element, event, handler, delegationFn, false);
4985
+ on(element, event, handler, delegationFunction) {
4986
+ addHandler(element, event, handler, delegationFunction, false);
4976
4987
  },
4977
- one(element, event, handler, delegationFn) {
4978
- addHandler(element, event, handler, delegationFn, true);
4988
+ one(element, event, handler, delegationFunction) {
4989
+ addHandler(element, event, handler, delegationFunction, true);
4979
4990
  },
4980
- off(element, originalTypeEvent, handler, delegationFn) {
4991
+ off(element, originalTypeEvent, handler, delegationFunction) {
4981
4992
  if (typeof originalTypeEvent !== 'string' || !element) {
4982
4993
  return;
4983
4994
  }
4984
- const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
4995
+ const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
4985
4996
  const inNamespace = typeEvent !== originalTypeEvent;
4986
- const events = getEvent(element);
4997
+ const events = getElementEvents(element);
4998
+ const storeElementEvent = events[typeEvent] || {};
4987
4999
  const isNamespace = originalTypeEvent.startsWith('.');
4988
- if (typeof originalHandler !== 'undefined') {
4989
- if (!events || !events[typeEvent]) {
5000
+ if (typeof callable !== 'undefined') {
5001
+ if (!Object.keys(storeElementEvent).length) {
4990
5002
  return;
4991
5003
  }
4992
- removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
5004
+ removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
4993
5005
  return;
4994
5006
  }
4995
5007
  if (isNamespace) {
4996
- Object.keys(events).forEach(elementEvent => {
5008
+ for (const elementEvent of Object.keys(events)) {
4997
5009
  removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
4998
- });
5010
+ }
4999
5011
  }
5000
- const storeElementEvent = events[typeEvent] || {};
5001
- Object.keys(storeElementEvent).forEach(keyHandlers => {
5012
+ for (const keyHandlers of Object.keys(storeElementEvent)) {
5002
5013
  const handlerKey = keyHandlers.replace(stripUidRegex, '');
5003
5014
  if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
5004
5015
  const event = storeElementEvent[keyHandlers];
5005
- removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
5016
+ removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
5006
5017
  }
5007
- });
5018
+ }
5008
5019
  },
5009
5020
  trigger(element, event, args) {
5010
5021
  if (typeof event !== 'string' || !element) {
@@ -5013,12 +5024,10 @@ const EventHandler = {
5013
5024
  const $ = getjQuery();
5014
5025
  const typeEvent = getTypeEvent(event);
5015
5026
  const inNamespace = event !== typeEvent;
5016
- const isNative = nativeEvents.has(typeEvent);
5017
- let jQueryEvent;
5027
+ let jQueryEvent = null;
5018
5028
  let bubbles = true;
5019
5029
  let nativeDispatch = true;
5020
5030
  let defaultPrevented = false;
5021
- let evt = null;
5022
5031
  if (inNamespace && $) {
5023
5032
  jQueryEvent = $.Event(event, args);
5024
5033
  $(element).trigger(jQueryEvent);
@@ -5026,36 +5035,38 @@ const EventHandler = {
5026
5035
  nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
5027
5036
  defaultPrevented = jQueryEvent.isDefaultPrevented();
5028
5037
  }
5029
- if (isNative) {
5030
- evt = document.createEvent('HTMLEvents');
5031
- evt.initEvent(typeEvent, bubbles, true);
5032
- } else {
5033
- evt = new CustomEvent(event, {
5034
- bubbles,
5035
- cancelable: true
5036
- });
5037
- }
5038
- if (typeof args !== 'undefined') {
5039
- Object.keys(args).forEach(key => {
5040
- Object.defineProperty(evt, key, {
5041
- get() {
5042
- return args[key];
5043
- }
5044
- });
5045
- });
5046
- }
5038
+ let evt = new Event(event, {
5039
+ bubbles,
5040
+ cancelable: true
5041
+ });
5042
+ evt = hydrateObj(evt, args);
5047
5043
  if (defaultPrevented) {
5048
5044
  evt.preventDefault();
5049
5045
  }
5050
5046
  if (nativeDispatch) {
5051
5047
  element.dispatchEvent(evt);
5052
5048
  }
5053
- if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
5049
+ if (evt.defaultPrevented && jQueryEvent) {
5054
5050
  jQueryEvent.preventDefault();
5055
5051
  }
5056
5052
  return evt;
5057
5053
  }
5058
5054
  };
5055
+ function hydrateObj(obj, meta) {
5056
+ for (const [key, value] of Object.entries(meta || {})) {
5057
+ try {
5058
+ obj[key] = value;
5059
+ } catch (_unused) {
5060
+ Object.defineProperty(obj, key, {
5061
+ configurable: true,
5062
+ get() {
5063
+ return value;
5064
+ }
5065
+ });
5066
+ }
5067
+ }
5068
+ return obj;
5069
+ }
5059
5070
  const elementMap = new Map();
5060
5071
  const Data = {
5061
5072
  set(element, key, instance) {
@@ -5086,26 +5097,121 @@ const Data = {
5086
5097
  }
5087
5098
  }
5088
5099
  };
5089
- const VERSION = '5.1.3';
5090
- class BaseComponent {
5091
- constructor(element) {
5100
+ function normalizeData(value) {
5101
+ if (value === 'true') {
5102
+ return true;
5103
+ }
5104
+ if (value === 'false') {
5105
+ return false;
5106
+ }
5107
+ if (value === Number(value).toString()) {
5108
+ return Number(value);
5109
+ }
5110
+ if (value === '' || value === 'null') {
5111
+ return null;
5112
+ }
5113
+ if (typeof value !== 'string') {
5114
+ return value;
5115
+ }
5116
+ try {
5117
+ return JSON.parse(decodeURIComponent(value));
5118
+ } catch (_unused) {
5119
+ return value;
5120
+ }
5121
+ }
5122
+ function normalizeDataKey(key) {
5123
+ return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
5124
+ }
5125
+ const Manipulator = {
5126
+ setDataAttribute(element, key, value) {
5127
+ element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
5128
+ },
5129
+ removeDataAttribute(element, key) {
5130
+ element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
5131
+ },
5132
+ getDataAttributes(element) {
5133
+ if (!element) {
5134
+ return {};
5135
+ }
5136
+ const attributes = {};
5137
+ const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
5138
+ for (const key of bsKeys) {
5139
+ let pureKey = key.replace(/^bs/, '');
5140
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
5141
+ attributes[pureKey] = normalizeData(element.dataset[key]);
5142
+ }
5143
+ return attributes;
5144
+ },
5145
+ getDataAttribute(element, key) {
5146
+ return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
5147
+ }
5148
+ };
5149
+ class Config {
5150
+ static get Default() {
5151
+ return {};
5152
+ }
5153
+ static get DefaultType() {
5154
+ return {};
5155
+ }
5156
+ static get NAME() {
5157
+ throw new Error('You have to implement the static method "NAME", for each component!');
5158
+ }
5159
+ _getConfig(config) {
5160
+ config = this._mergeConfigObj(config);
5161
+ config = this._configAfterMerge(config);
5162
+ this._typeCheckConfig(config);
5163
+ return config;
5164
+ }
5165
+ _configAfterMerge(config) {
5166
+ return config;
5167
+ }
5168
+ _mergeConfigObj(config, element) {
5169
+ const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {};
5170
+ return { ...this.constructor.Default,
5171
+ ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
5172
+ ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),
5173
+ ...(typeof config === 'object' ? config : {})
5174
+ };
5175
+ }
5176
+ _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
5177
+ for (const property of Object.keys(configTypes)) {
5178
+ const expectedTypes = configTypes[property];
5179
+ const value = config[property];
5180
+ const valueType = isElement(value) ? 'element' : toType(value);
5181
+ if (!new RegExp(expectedTypes).test(valueType)) {
5182
+ throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
5183
+ }
5184
+ }
5185
+ }
5186
+ }
5187
+ const VERSION = '5.2.1';
5188
+ class BaseComponent extends Config {
5189
+ constructor(element, config) {
5190
+ super();
5092
5191
  element = getElement(element);
5093
5192
  if (!element) {
5094
5193
  return;
5095
5194
  }
5096
5195
  this._element = element;
5196
+ this._config = this._getConfig(config);
5097
5197
  Data.set(this._element, this.constructor.DATA_KEY, this);
5098
5198
  }
5099
5199
  dispose() {
5100
5200
  Data.remove(this._element, this.constructor.DATA_KEY);
5101
5201
  EventHandler.off(this._element, this.constructor.EVENT_KEY);
5102
- Object.getOwnPropertyNames(this).forEach(propertyName => {
5202
+ for (const propertyName of Object.getOwnPropertyNames(this)) {
5103
5203
  this[propertyName] = null;
5104
- });
5204
+ }
5105
5205
  }
5106
5206
  _queueCallback(callback, element, isAnimated = true) {
5107
5207
  executeAfterTransition(callback, element, isAnimated);
5108
5208
  }
5209
+ _getConfig(config) {
5210
+ config = this._mergeConfigObj(config, this._element);
5211
+ config = this._configAfterMerge(config);
5212
+ this._typeCheckConfig(config);
5213
+ return config;
5214
+ }
5109
5215
  static getInstance(element) {
5110
5216
  return Data.get(getElement(element), this.DATA_KEY);
5111
5217
  }
@@ -5115,15 +5221,15 @@ class BaseComponent {
5115
5221
  static get VERSION() {
5116
5222
  return VERSION;
5117
5223
  }
5118
- static get NAME() {
5119
- throw new Error('You have to implement the static method "NAME", for each component!');
5120
- }
5121
5224
  static get DATA_KEY() {
5122
5225
  return `bs.${this.NAME}`;
5123
5226
  }
5124
5227
  static get EVENT_KEY() {
5125
5228
  return `.${this.DATA_KEY}`;
5126
5229
  }
5230
+ static eventName(name) {
5231
+ return `${name}${this.EVENT_KEY}`;
5232
+ }
5127
5233
  }
5128
5234
  const enableDismissTrigger = (component, method = 'hide') => {
5129
5235
  const clickEvent = `click.dismiss${component.EVENT_KEY}`;
@@ -5140,16 +5246,16 @@ const enableDismissTrigger = (component, method = 'hide') => {
5140
5246
  instance[method]();
5141
5247
  });
5142
5248
  };
5143
- const NAME$d = 'alert';
5144
- const DATA_KEY$c = 'bs.alert';
5145
- const EVENT_KEY$c = `.${DATA_KEY$c}`;
5146
- const EVENT_CLOSE = `close${EVENT_KEY$c}`;
5147
- const EVENT_CLOSED = `closed${EVENT_KEY$c}`;
5249
+ const NAME$f = 'alert';
5250
+ const DATA_KEY$a = 'bs.alert';
5251
+ const EVENT_KEY$b = `.${DATA_KEY$a}`;
5252
+ const EVENT_CLOSE = `close${EVENT_KEY$b}`;
5253
+ const EVENT_CLOSED = `closed${EVENT_KEY$b}`;
5148
5254
  const CLASS_NAME_FADE$5 = 'fade';
5149
5255
  const CLASS_NAME_SHOW$8 = 'show';
5150
5256
  class Alert extends BaseComponent {
5151
5257
  static get NAME() {
5152
- return NAME$d;
5258
+ return NAME$f;
5153
5259
  }
5154
5260
  close() {
5155
5261
  const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
@@ -5180,16 +5286,16 @@ class Alert extends BaseComponent {
5180
5286
  }
5181
5287
  enableDismissTrigger(Alert, 'close');
5182
5288
  defineJQueryPlugin(Alert);
5183
- const NAME$c = 'button';
5184
- const DATA_KEY$b = 'bs.button';
5185
- const EVENT_KEY$b = `.${DATA_KEY$b}`;
5186
- const DATA_API_KEY$7 = '.data-api';
5289
+ const NAME$e = 'button';
5290
+ const DATA_KEY$9 = 'bs.button';
5291
+ const EVENT_KEY$a = `.${DATA_KEY$9}`;
5292
+ const DATA_API_KEY$6 = '.data-api';
5187
5293
  const CLASS_NAME_ACTIVE$3 = 'active';
5188
5294
  const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
5189
- const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
5295
+ const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
5190
5296
  class Button extends BaseComponent {
5191
5297
  static get NAME() {
5192
- return NAME$c;
5298
+ return NAME$e;
5193
5299
  }
5194
5300
  toggle() {
5195
5301
  this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));
@@ -5210,61 +5316,6 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event
5210
5316
  data.toggle();
5211
5317
  });
5212
5318
  defineJQueryPlugin(Button);
5213
- function normalizeData(val) {
5214
- if (val === 'true') {
5215
- return true;
5216
- }
5217
- if (val === 'false') {
5218
- return false;
5219
- }
5220
- if (val === Number(val).toString()) {
5221
- return Number(val);
5222
- }
5223
- if (val === '' || val === 'null') {
5224
- return null;
5225
- }
5226
- return val;
5227
- }
5228
- function normalizeDataKey(key) {
5229
- return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
5230
- }
5231
- const Manipulator = {
5232
- setDataAttribute(element, key, value) {
5233
- element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
5234
- },
5235
- removeDataAttribute(element, key) {
5236
- element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
5237
- },
5238
- getDataAttributes(element) {
5239
- if (!element) {
5240
- return {};
5241
- }
5242
- const attributes = {};
5243
- Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
5244
- let pureKey = key.replace(/^bs/, '');
5245
- pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
5246
- attributes[pureKey] = normalizeData(element.dataset[key]);
5247
- });
5248
- return attributes;
5249
- },
5250
- getDataAttribute(element, key) {
5251
- return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
5252
- },
5253
- offset(element) {
5254
- const rect = element.getBoundingClientRect();
5255
- return {
5256
- top: rect.top + window.pageYOffset,
5257
- left: rect.left + window.pageXOffset
5258
- };
5259
- },
5260
- position(element) {
5261
- return {
5262
- top: element.offsetTop,
5263
- left: element.offsetLeft
5264
- };
5265
- }
5266
- };
5267
- const NODE_TEXT = 3;
5268
5319
  const SelectorEngine = {
5269
5320
  find(selector, element = document.documentElement) {
5270
5321
  return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
@@ -5277,12 +5328,10 @@ const SelectorEngine = {
5277
5328
  },
5278
5329
  parents(element, selector) {
5279
5330
  const parents = [];
5280
- let ancestor = element.parentNode;
5281
- while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
5282
- if (ancestor.matches(selector)) {
5283
- parents.push(ancestor);
5284
- }
5285
- ancestor = ancestor.parentNode;
5331
+ let ancestor = element.parentNode.closest(selector);
5332
+ while (ancestor) {
5333
+ parents.push(ancestor);
5334
+ ancestor = ancestor.parentNode.closest(selector);
5286
5335
  }
5287
5336
  return parents;
5288
5337
  },
@@ -5307,55 +5356,123 @@ const SelectorEngine = {
5307
5356
  return [];
5308
5357
  },
5309
5358
  focusableChildren(element) {
5310
- const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
5359
+ const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
5311
5360
  return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
5312
5361
  }
5313
5362
  };
5314
- const NAME$b = 'carousel';
5315
- const DATA_KEY$a = 'bs.carousel';
5316
- const EVENT_KEY$a = `.${DATA_KEY$a}`;
5317
- const DATA_API_KEY$6 = '.data-api';
5318
- const ARROW_LEFT_KEY = 'ArrowLeft';
5319
- const ARROW_RIGHT_KEY = 'ArrowRight';
5320
- const TOUCHEVENT_COMPAT_WAIT = 500;
5363
+ const NAME$d = 'swipe';
5364
+ const EVENT_KEY$9 = '.bs.swipe';
5365
+ const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;
5366
+ const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;
5367
+ const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;
5368
+ const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;
5369
+ const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;
5370
+ const POINTER_TYPE_TOUCH = 'touch';
5371
+ const POINTER_TYPE_PEN = 'pen';
5372
+ const CLASS_NAME_POINTER_EVENT = 'pointer-event';
5321
5373
  const SWIPE_THRESHOLD = 40;
5322
- const Default$a = {
5323
- interval: 5000,
5324
- keyboard: true,
5325
- slide: false,
5326
- pause: 'hover',
5327
- wrap: true,
5328
- touch: true
5374
+ const Default$c = {
5375
+ endCallback: null,
5376
+ leftCallback: null,
5377
+ rightCallback: null
5329
5378
  };
5330
- const DefaultType$a = {
5331
- interval: '(number|boolean)',
5332
- keyboard: 'boolean',
5333
- slide: '(boolean|string)',
5334
- pause: '(string|boolean)',
5335
- wrap: 'boolean',
5336
- touch: 'boolean'
5379
+ const DefaultType$c = {
5380
+ endCallback: '(function|null)',
5381
+ leftCallback: '(function|null)',
5382
+ rightCallback: '(function|null)'
5337
5383
  };
5384
+ class Swipe extends Config {
5385
+ constructor(element, config) {
5386
+ super();
5387
+ this._element = element;
5388
+ if (!element || !Swipe.isSupported()) {
5389
+ return;
5390
+ }
5391
+ this._config = this._getConfig(config);
5392
+ this._deltaX = 0;
5393
+ this._supportPointerEvents = Boolean(window.PointerEvent);
5394
+ this._initEvents();
5395
+ }
5396
+ static get Default() {
5397
+ return Default$c;
5398
+ }
5399
+ static get DefaultType() {
5400
+ return DefaultType$c;
5401
+ }
5402
+ static get NAME() {
5403
+ return NAME$d;
5404
+ }
5405
+ dispose() {
5406
+ EventHandler.off(this._element, EVENT_KEY$9);
5407
+ }
5408
+ _start(event) {
5409
+ if (!this._supportPointerEvents) {
5410
+ this._deltaX = event.touches[0].clientX;
5411
+ return;
5412
+ }
5413
+ if (this._eventIsPointerPenTouch(event)) {
5414
+ this._deltaX = event.clientX;
5415
+ }
5416
+ }
5417
+ _end(event) {
5418
+ if (this._eventIsPointerPenTouch(event)) {
5419
+ this._deltaX = event.clientX - this._deltaX;
5420
+ }
5421
+ this._handleSwipe();
5422
+ execute(this._config.endCallback);
5423
+ }
5424
+ _move(event) {
5425
+ this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;
5426
+ }
5427
+ _handleSwipe() {
5428
+ const absDeltaX = Math.abs(this._deltaX);
5429
+ if (absDeltaX <= SWIPE_THRESHOLD) {
5430
+ return;
5431
+ }
5432
+ const direction = absDeltaX / this._deltaX;
5433
+ this._deltaX = 0;
5434
+ if (!direction) {
5435
+ return;
5436
+ }
5437
+ execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);
5438
+ }
5439
+ _initEvents() {
5440
+ if (this._supportPointerEvents) {
5441
+ EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));
5442
+ EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));
5443
+ this._element.classList.add(CLASS_NAME_POINTER_EVENT);
5444
+ } else {
5445
+ EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));
5446
+ EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));
5447
+ EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));
5448
+ }
5449
+ }
5450
+ _eventIsPointerPenTouch(event) {
5451
+ return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
5452
+ }
5453
+ static isSupported() {
5454
+ return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
5455
+ }
5456
+ }
5457
+ const NAME$c = 'carousel';
5458
+ const DATA_KEY$8 = 'bs.carousel';
5459
+ const EVENT_KEY$8 = `.${DATA_KEY$8}`;
5460
+ const DATA_API_KEY$5 = '.data-api';
5461
+ const ARROW_LEFT_KEY$1 = 'ArrowLeft';
5462
+ const ARROW_RIGHT_KEY$1 = 'ArrowRight';
5463
+ const TOUCHEVENT_COMPAT_WAIT = 500;
5338
5464
  const ORDER_NEXT = 'next';
5339
5465
  const ORDER_PREV = 'prev';
5340
5466
  const DIRECTION_LEFT = 'left';
5341
5467
  const DIRECTION_RIGHT = 'right';
5342
- const KEY_TO_DIRECTION = {
5343
- [ARROW_LEFT_KEY]: DIRECTION_RIGHT,
5344
- [ARROW_RIGHT_KEY]: DIRECTION_LEFT
5345
- };
5346
- const EVENT_SLIDE = `slide${EVENT_KEY$a}`;
5347
- const EVENT_SLID = `slid${EVENT_KEY$a}`;
5348
- const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;
5349
- const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;
5350
- const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;
5351
- const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;
5352
- const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;
5353
- const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;
5354
- const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;
5355
- const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;
5356
- const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;
5357
- const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;
5358
- const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
5468
+ const EVENT_SLIDE = `slide${EVENT_KEY$8}`;
5469
+ const EVENT_SLID = `slid${EVENT_KEY$8}`;
5470
+ const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;
5471
+ const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;
5472
+ const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;
5473
+ const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;
5474
+ const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;
5475
+ const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
5359
5476
  const CLASS_NAME_CAROUSEL = 'carousel';
5360
5477
  const CLASS_NAME_ACTIVE$2 = 'active';
5361
5478
  const CLASS_NAME_SLIDE = 'slide';
@@ -5363,40 +5480,55 @@ const CLASS_NAME_END = 'carousel-item-end';
5363
5480
  const CLASS_NAME_START = 'carousel-item-start';
5364
5481
  const CLASS_NAME_NEXT = 'carousel-item-next';
5365
5482
  const CLASS_NAME_PREV = 'carousel-item-prev';
5366
- const CLASS_NAME_POINTER_EVENT = 'pointer-event';
5367
- const SELECTOR_ACTIVE$1 = '.active';
5368
- const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
5483
+ const SELECTOR_ACTIVE = '.active';
5369
5484
  const SELECTOR_ITEM = '.carousel-item';
5485
+ const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;
5370
5486
  const SELECTOR_ITEM_IMG = '.carousel-item img';
5371
- const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
5372
5487
  const SELECTOR_INDICATORS = '.carousel-indicators';
5373
- const SELECTOR_INDICATOR = '[data-bs-target]';
5374
5488
  const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
5375
5489
  const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
5376
- const POINTER_TYPE_TOUCH = 'touch';
5377
- const POINTER_TYPE_PEN = 'pen';
5490
+ const KEY_TO_DIRECTION = {
5491
+ [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,
5492
+ [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT
5493
+ };
5494
+ const Default$b = {
5495
+ interval: 5000,
5496
+ keyboard: true,
5497
+ pause: 'hover',
5498
+ ride: false,
5499
+ touch: true,
5500
+ wrap: true
5501
+ };
5502
+ const DefaultType$b = {
5503
+ interval: '(number|boolean)',
5504
+ keyboard: 'boolean',
5505
+ pause: '(string|boolean)',
5506
+ ride: '(boolean|string)',
5507
+ touch: 'boolean',
5508
+ wrap: 'boolean'
5509
+ };
5378
5510
  class Carousel extends BaseComponent {
5379
5511
  constructor(element, config) {
5380
- super(element);
5381
- this._items = null;
5512
+ super(element, config);
5382
5513
  this._interval = null;
5383
5514
  this._activeElement = null;
5384
- this._isPaused = false;
5385
5515
  this._isSliding = false;
5386
5516
  this.touchTimeout = null;
5387
- this.touchStartX = 0;
5388
- this.touchDeltaX = 0;
5389
- this._config = this._getConfig(config);
5517
+ this._swipeHelper = null;
5390
5518
  this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
5391
- this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
5392
- this._pointerEvent = Boolean(window.PointerEvent);
5393
5519
  this._addEventListeners();
5520
+ if (this._config.ride === CLASS_NAME_CAROUSEL) {
5521
+ this.cycle();
5522
+ }
5394
5523
  }
5395
5524
  static get Default() {
5396
- return Default$a;
5525
+ return Default$b;
5526
+ }
5527
+ static get DefaultType() {
5528
+ return DefaultType$b;
5397
5529
  }
5398
5530
  static get NAME() {
5399
- return NAME$b;
5531
+ return NAME$c;
5400
5532
  }
5401
5533
  next() {
5402
5534
  this._slide(ORDER_NEXT);
@@ -5409,119 +5541,85 @@ class Carousel extends BaseComponent {
5409
5541
  prev() {
5410
5542
  this._slide(ORDER_PREV);
5411
5543
  }
5412
- pause(event) {
5413
- if (!event) {
5414
- this._isPaused = true;
5415
- }
5416
- if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
5544
+ pause() {
5545
+ if (this._isSliding) {
5417
5546
  triggerTransitionEnd(this._element);
5418
- this.cycle(true);
5419
5547
  }
5420
- clearInterval(this._interval);
5421
- this._interval = null;
5548
+ this._clearInterval();
5549
+ }
5550
+ cycle() {
5551
+ this._clearInterval();
5552
+ this._updateInterval();
5553
+ this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);
5422
5554
  }
5423
- cycle(event) {
5424
- if (!event) {
5425
- this._isPaused = false;
5555
+ _maybeEnableCycle() {
5556
+ if (!this._config.ride) {
5557
+ return;
5426
5558
  }
5427
- if (this._interval) {
5428
- clearInterval(this._interval);
5429
- this._interval = null;
5430
- }
5431
- if (this._config && this._config.interval && !this._isPaused) {
5432
- this._updateInterval();
5433
- this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
5559
+ if (this._isSliding) {
5560
+ EventHandler.one(this._element, EVENT_SLID, () => this.cycle());
5561
+ return;
5434
5562
  }
5563
+ this.cycle();
5435
5564
  }
5436
5565
  to(index) {
5437
- this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
5438
- const activeIndex = this._getItemIndex(this._activeElement);
5439
- if (index > this._items.length - 1 || index < 0) {
5566
+ const items = this._getItems();
5567
+ if (index > items.length - 1 || index < 0) {
5440
5568
  return;
5441
5569
  }
5442
5570
  if (this._isSliding) {
5443
5571
  EventHandler.one(this._element, EVENT_SLID, () => this.to(index));
5444
5572
  return;
5445
5573
  }
5574
+ const activeIndex = this._getItemIndex(this._getActive());
5446
5575
  if (activeIndex === index) {
5447
- this.pause();
5448
- this.cycle();
5449
5576
  return;
5450
5577
  }
5451
5578
  const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
5452
- this._slide(order, this._items[index]);
5453
- }
5454
- _getConfig(config) {
5455
- config = { ...Default$a,
5456
- ...Manipulator.getDataAttributes(this._element),
5457
- ...(typeof config === 'object' ? config : {})
5458
- };
5459
- typeCheckConfig(NAME$b, config, DefaultType$a);
5460
- return config;
5579
+ this._slide(order, items[index]);
5461
5580
  }
5462
- _handleSwipe() {
5463
- const absDeltax = Math.abs(this.touchDeltaX);
5464
- if (absDeltax <= SWIPE_THRESHOLD) {
5465
- return;
5466
- }
5467
- const direction = absDeltax / this.touchDeltaX;
5468
- this.touchDeltaX = 0;
5469
- if (!direction) {
5470
- return;
5581
+ dispose() {
5582
+ if (this._swipeHelper) {
5583
+ this._swipeHelper.dispose();
5471
5584
  }
5472
- this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT);
5585
+ super.dispose();
5586
+ }
5587
+ _configAfterMerge(config) {
5588
+ config.defaultInterval = config.interval;
5589
+ return config;
5473
5590
  }
5474
5591
  _addEventListeners() {
5475
5592
  if (this._config.keyboard) {
5476
- EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
5593
+ EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));
5477
5594
  }
5478
5595
  if (this._config.pause === 'hover') {
5479
- EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event));
5480
- EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event));
5596
+ EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());
5597
+ EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());
5481
5598
  }
5482
- if (this._config.touch && this._touchSupported) {
5599
+ if (this._config.touch && Swipe.isSupported()) {
5483
5600
  this._addTouchEventListeners();
5484
5601
  }
5485
5602
  }
5486
5603
  _addTouchEventListeners() {
5487
- const hasPointerPenTouch = event => {
5488
- return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
5489
- };
5490
- const start = event => {
5491
- if (hasPointerPenTouch(event)) {
5492
- this.touchStartX = event.clientX;
5493
- } else if (!this._pointerEvent) {
5494
- this.touchStartX = event.touches[0].clientX;
5604
+ for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {
5605
+ EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());
5606
+ }
5607
+ const endCallBack = () => {
5608
+ if (this._config.pause !== 'hover') {
5609
+ return;
5495
5610
  }
5496
- };
5497
- const move = event => {
5498
- this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX;
5499
- };
5500
- const end = event => {
5501
- if (hasPointerPenTouch(event)) {
5502
- this.touchDeltaX = event.clientX - this.touchStartX;
5503
- }
5504
- this._handleSwipe();
5505
- if (this._config.pause === 'hover') {
5506
- this.pause();
5507
- if (this.touchTimeout) {
5508
- clearTimeout(this.touchTimeout);
5509
- }
5510
- this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval);
5611
+ this.pause();
5612
+ if (this.touchTimeout) {
5613
+ clearTimeout(this.touchTimeout);
5511
5614
  }
5615
+ this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);
5512
5616
  };
5513
- SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
5514
- EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
5515
- });
5516
- if (this._pointerEvent) {
5517
- EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event));
5518
- EventHandler.on(this._element, EVENT_POINTERUP, event => end(event));
5519
- this._element.classList.add(CLASS_NAME_POINTER_EVENT);
5520
- } else {
5521
- EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event));
5522
- EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event));
5523
- EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event));
5524
- }
5617
+ const swipeConfig = {
5618
+ leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),
5619
+ rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),
5620
+ endCallback: endCallBack
5621
+ };
5622
+ this._swipeHelper = new Swipe(this._element, swipeConfig);
5525
5623
  }
5526
5624
  _keydown(event) {
5527
5625
  if (/input|textarea/i.test(event.target.tagName)) {
@@ -5530,207 +5628,162 @@ class Carousel extends BaseComponent {
5530
5628
  const direction = KEY_TO_DIRECTION[event.key];
5531
5629
  if (direction) {
5532
5630
  event.preventDefault();
5533
- this._slide(direction);
5631
+ this._slide(this._directionToOrder(direction));
5534
5632
  }
5535
5633
  }
5536
5634
  _getItemIndex(element) {
5537
- this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];
5538
- return this._items.indexOf(element);
5539
- }
5540
- _getItemByOrder(order, activeElement) {
5541
- const isNext = order === ORDER_NEXT;
5542
- return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);
5543
- }
5544
- _triggerSlideEvent(relatedTarget, eventDirectionName) {
5545
- const targetIndex = this._getItemIndex(relatedTarget);
5546
- const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));
5547
- return EventHandler.trigger(this._element, EVENT_SLIDE, {
5548
- relatedTarget,
5549
- direction: eventDirectionName,
5550
- from: fromIndex,
5551
- to: targetIndex
5552
- });
5635
+ return this._getItems().indexOf(element);
5553
5636
  }
5554
- _setActiveIndicatorElement(element) {
5555
- if (this._indicatorsElement) {
5556
- const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);
5557
- activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);
5558
- activeIndicator.removeAttribute('aria-current');
5559
- const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
5560
- for (let i = 0; i < indicators.length; i++) {
5561
- if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
5562
- indicators[i].classList.add(CLASS_NAME_ACTIVE$2);
5563
- indicators[i].setAttribute('aria-current', 'true');
5564
- break;
5565
- }
5566
- }
5637
+ _setActiveIndicatorElement(index) {
5638
+ if (!this._indicatorsElement) {
5639
+ return;
5640
+ }
5641
+ const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
5642
+ activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);
5643
+ activeIndicator.removeAttribute('aria-current');
5644
+ const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement);
5645
+ if (newActiveIndicator) {
5646
+ newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);
5647
+ newActiveIndicator.setAttribute('aria-current', 'true');
5567
5648
  }
5568
5649
  }
5569
5650
  _updateInterval() {
5570
- const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
5651
+ const element = this._activeElement || this._getActive();
5571
5652
  if (!element) {
5572
5653
  return;
5573
5654
  }
5574
5655
  const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
5575
- if (elementInterval) {
5576
- this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
5577
- this._config.interval = elementInterval;
5578
- } else {
5579
- this._config.interval = this._config.defaultInterval || this._config.interval;
5580
- }
5656
+ this._config.interval = elementInterval || this._config.defaultInterval;
5581
5657
  }
5582
- _slide(directionOrOrder, element) {
5583
- const order = this._directionToOrder(directionOrOrder);
5584
- const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
5585
- const activeElementIndex = this._getItemIndex(activeElement);
5586
- const nextElement = element || this._getItemByOrder(order, activeElement);
5587
- const nextElementIndex = this._getItemIndex(nextElement);
5588
- const isCycling = Boolean(this._interval);
5589
- const isNext = order === ORDER_NEXT;
5590
- const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
5591
- const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
5592
- const eventDirectionName = this._orderToDirection(order);
5593
- if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$2)) {
5594
- this._isSliding = false;
5658
+ _slide(order, element = null) {
5659
+ if (this._isSliding) {
5595
5660
  return;
5596
5661
  }
5597
- if (this._isSliding) {
5662
+ const activeElement = this._getActive();
5663
+ const isNext = order === ORDER_NEXT;
5664
+ const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);
5665
+ if (nextElement === activeElement) {
5598
5666
  return;
5599
5667
  }
5600
- const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
5668
+ const nextElementIndex = this._getItemIndex(nextElement);
5669
+ const triggerEvent = eventName => {
5670
+ return EventHandler.trigger(this._element, eventName, {
5671
+ relatedTarget: nextElement,
5672
+ direction: this._orderToDirection(order),
5673
+ from: this._getItemIndex(activeElement),
5674
+ to: nextElementIndex
5675
+ });
5676
+ };
5677
+ const slideEvent = triggerEvent(EVENT_SLIDE);
5601
5678
  if (slideEvent.defaultPrevented) {
5602
5679
  return;
5603
5680
  }
5604
5681
  if (!activeElement || !nextElement) {
5605
5682
  return;
5606
5683
  }
5684
+ const isCycling = Boolean(this._interval);
5685
+ this.pause();
5607
5686
  this._isSliding = true;
5608
- if (isCycling) {
5609
- this.pause();
5610
- }
5611
- this._setActiveIndicatorElement(nextElement);
5687
+ this._setActiveIndicatorElement(nextElementIndex);
5612
5688
  this._activeElement = nextElement;
5613
- const triggerSlidEvent = () => {
5614
- EventHandler.trigger(this._element, EVENT_SLID, {
5615
- relatedTarget: nextElement,
5616
- direction: eventDirectionName,
5617
- from: activeElementIndex,
5618
- to: nextElementIndex
5619
- });
5620
- };
5621
- if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
5622
- nextElement.classList.add(orderClassName);
5623
- reflow(nextElement);
5624
- activeElement.classList.add(directionalClassName);
5625
- nextElement.classList.add(directionalClassName);
5626
- const completeCallBack = () => {
5627
- nextElement.classList.remove(directionalClassName, orderClassName);
5628
- nextElement.classList.add(CLASS_NAME_ACTIVE$2);
5629
- activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);
5630
- this._isSliding = false;
5631
- setTimeout(triggerSlidEvent, 0);
5632
- };
5633
- this._queueCallback(completeCallBack, activeElement, true);
5634
- } else {
5635
- activeElement.classList.remove(CLASS_NAME_ACTIVE$2);
5689
+ const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
5690
+ const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
5691
+ nextElement.classList.add(orderClassName);
5692
+ reflow(nextElement);
5693
+ activeElement.classList.add(directionalClassName);
5694
+ nextElement.classList.add(directionalClassName);
5695
+ const completeCallBack = () => {
5696
+ nextElement.classList.remove(directionalClassName, orderClassName);
5636
5697
  nextElement.classList.add(CLASS_NAME_ACTIVE$2);
5698
+ activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);
5637
5699
  this._isSliding = false;
5638
- triggerSlidEvent();
5639
- }
5700
+ triggerEvent(EVENT_SLID);
5701
+ };
5702
+ this._queueCallback(completeCallBack, activeElement, this._isAnimated());
5640
5703
  if (isCycling) {
5641
5704
  this.cycle();
5642
5705
  }
5643
5706
  }
5644
- _directionToOrder(direction) {
5645
- if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {
5646
- return direction;
5707
+ _isAnimated() {
5708
+ return this._element.classList.contains(CLASS_NAME_SLIDE);
5709
+ }
5710
+ _getActive() {
5711
+ return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
5712
+ }
5713
+ _getItems() {
5714
+ return SelectorEngine.find(SELECTOR_ITEM, this._element);
5715
+ }
5716
+ _clearInterval() {
5717
+ if (this._interval) {
5718
+ clearInterval(this._interval);
5719
+ this._interval = null;
5647
5720
  }
5721
+ }
5722
+ _directionToOrder(direction) {
5648
5723
  if (isRTL()) {
5649
5724
  return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;
5650
5725
  }
5651
5726
  return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
5652
5727
  }
5653
5728
  _orderToDirection(order) {
5654
- if (![ORDER_NEXT, ORDER_PREV].includes(order)) {
5655
- return order;
5656
- }
5657
5729
  if (isRTL()) {
5658
5730
  return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
5659
5731
  }
5660
5732
  return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;
5661
5733
  }
5662
- static carouselInterface(element, config) {
5663
- const data = Carousel.getOrCreateInstance(element, config);
5664
- let {
5665
- _config
5666
- } = data;
5667
- if (typeof config === 'object') {
5668
- _config = { ..._config,
5669
- ...config
5670
- };
5671
- }
5672
- const action = typeof config === 'string' ? config : _config.slide;
5673
- if (typeof config === 'number') {
5674
- data.to(config);
5675
- } else if (typeof action === 'string') {
5676
- if (typeof data[action] === 'undefined') {
5677
- throw new TypeError(`No method named "${action}"`);
5678
- }
5679
- data[action]();
5680
- } else if (_config.interval && _config.ride) {
5681
- data.pause();
5682
- data.cycle();
5683
- }
5684
- }
5685
5734
  static jQueryInterface(config) {
5686
5735
  return this.each(function () {
5687
- Carousel.carouselInterface(this, config);
5736
+ const data = Carousel.getOrCreateInstance(this, config);
5737
+ if (typeof config === 'number') {
5738
+ data.to(config);
5739
+ return;
5740
+ }
5741
+ if (typeof config === 'string') {
5742
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
5743
+ throw new TypeError(`No method named "${config}"`);
5744
+ }
5745
+ data[config]();
5746
+ }
5688
5747
  });
5689
5748
  }
5690
- static dataApiClickHandler(event) {
5691
- const target = getElementFromSelector(this);
5692
- if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
5693
- return;
5694
- }
5695
- const config = { ...Manipulator.getDataAttributes(target),
5696
- ...Manipulator.getDataAttributes(this)
5697
- };
5698
- const slideIndex = this.getAttribute('data-bs-slide-to');
5699
- if (slideIndex) {
5700
- config.interval = false;
5701
- }
5702
- Carousel.carouselInterface(target, config);
5703
- if (slideIndex) {
5704
- Carousel.getInstance(target).to(slideIndex);
5705
- }
5706
- event.preventDefault();
5707
- }
5708
5749
  }
5709
- EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);
5710
- EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
5750
+ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {
5751
+ const target = getElementFromSelector(this);
5752
+ if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
5753
+ return;
5754
+ }
5755
+ event.preventDefault();
5756
+ const carousel = Carousel.getOrCreateInstance(target);
5757
+ const slideIndex = this.getAttribute('data-bs-slide-to');
5758
+ if (slideIndex) {
5759
+ carousel.to(slideIndex);
5760
+ carousel._maybeEnableCycle();
5761
+ return;
5762
+ }
5763
+ if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
5764
+ carousel.next();
5765
+ carousel._maybeEnableCycle();
5766
+ return;
5767
+ }
5768
+ carousel.prev();
5769
+ carousel._maybeEnableCycle();
5770
+ });
5771
+ EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {
5711
5772
  const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
5712
- for (let i = 0, len = carousels.length; i < len; i++) {
5713
- Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));
5773
+ for (const carousel of carousels) {
5774
+ Carousel.getOrCreateInstance(carousel);
5714
5775
  }
5715
5776
  });
5716
5777
  defineJQueryPlugin(Carousel);
5717
- const NAME$a = 'collapse';
5718
- const DATA_KEY$9 = 'bs.collapse';
5719
- const EVENT_KEY$9 = `.${DATA_KEY$9}`;
5720
- const DATA_API_KEY$5 = '.data-api';
5721
- const Default$9 = {
5722
- toggle: true,
5723
- parent: null
5724
- };
5725
- const DefaultType$9 = {
5726
- toggle: 'boolean',
5727
- parent: '(null|element)'
5728
- };
5729
- const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;
5730
- const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;
5731
- const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;
5732
- const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;
5733
- const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;
5778
+ const NAME$b = 'collapse';
5779
+ const DATA_KEY$7 = 'bs.collapse';
5780
+ const EVENT_KEY$7 = `.${DATA_KEY$7}`;
5781
+ const DATA_API_KEY$4 = '.data-api';
5782
+ const EVENT_SHOW$6 = `show${EVENT_KEY$7}`;
5783
+ const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;
5784
+ const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;
5785
+ const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;
5786
+ const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
5734
5787
  const CLASS_NAME_SHOW$7 = 'show';
5735
5788
  const CLASS_NAME_COLLAPSE = 'collapse';
5736
5789
  const CLASS_NAME_COLLAPSING = 'collapsing';
@@ -5741,19 +5794,24 @@ const WIDTH = 'width';
5741
5794
  const HEIGHT = 'height';
5742
5795
  const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
5743
5796
  const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
5797
+ const Default$a = {
5798
+ parent: null,
5799
+ toggle: true
5800
+ };
5801
+ const DefaultType$a = {
5802
+ parent: '(null|element)',
5803
+ toggle: 'boolean'
5804
+ };
5744
5805
  class Collapse extends BaseComponent {
5745
5806
  constructor(element, config) {
5746
- super(element);
5807
+ super(element, config);
5747
5808
  this._isTransitioning = false;
5748
- this._config = this._getConfig(config);
5749
5809
  this._triggerArray = [];
5750
5810
  const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
5751
- for (let i = 0, len = toggleList.length; i < len; i++) {
5752
- const elem = toggleList[i];
5811
+ for (const elem of toggleList) {
5753
5812
  const selector = getSelectorFromElement(elem);
5754
- const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element);
5813
+ const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
5755
5814
  if (selector !== null && filterElement.length) {
5756
- this._selector = selector;
5757
5815
  this._triggerArray.push(elem);
5758
5816
  }
5759
5817
  }
@@ -5766,10 +5824,13 @@ class Collapse extends BaseComponent {
5766
5824
  }
5767
5825
  }
5768
5826
  static get Default() {
5769
- return Default$9;
5827
+ return Default$a;
5828
+ }
5829
+ static get DefaultType() {
5830
+ return DefaultType$a;
5770
5831
  }
5771
5832
  static get NAME() {
5772
- return NAME$a;
5833
+ return NAME$b;
5773
5834
  }
5774
5835
  toggle() {
5775
5836
  if (this._isShown()) {
@@ -5782,34 +5843,22 @@ class Collapse extends BaseComponent {
5782
5843
  if (this._isTransitioning || this._isShown()) {
5783
5844
  return;
5784
5845
  }
5785
- let actives = [];
5786
- let activesData;
5846
+ let activeChildren = [];
5787
5847
  if (this._config.parent) {
5788
- const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
5789
- actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem));
5790
- }
5791
- const container = SelectorEngine.findOne(this._selector);
5792
- if (actives.length) {
5793
- const tempActiveData = actives.find(elem => container !== elem);
5794
- activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
5795
- if (activesData && activesData._isTransitioning) {
5796
- return;
5797
- }
5848
+ activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {
5849
+ toggle: false
5850
+ }));
5851
+ }
5852
+ if (activeChildren.length && activeChildren[0]._isTransitioning) {
5853
+ return;
5798
5854
  }
5799
- const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$5);
5855
+ const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);
5800
5856
  if (startEvent.defaultPrevented) {
5801
5857
  return;
5802
5858
  }
5803
- actives.forEach(elemActive => {
5804
- if (container !== elemActive) {
5805
- Collapse.getOrCreateInstance(elemActive, {
5806
- toggle: false
5807
- }).hide();
5808
- }
5809
- if (!activesData) {
5810
- Data.set(elemActive, DATA_KEY$9, null);
5811
- }
5812
- });
5859
+ for (const activeInstance of activeChildren) {
5860
+ activeInstance.hide();
5861
+ }
5813
5862
  const dimension = this._getDimension();
5814
5863
  this._element.classList.remove(CLASS_NAME_COLLAPSE);
5815
5864
  this._element.classList.add(CLASS_NAME_COLLAPSING);
@@ -5821,7 +5870,7 @@ class Collapse extends BaseComponent {
5821
5870
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
5822
5871
  this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
5823
5872
  this._element.style[dimension] = '';
5824
- EventHandler.trigger(this._element, EVENT_SHOWN$5);
5873
+ EventHandler.trigger(this._element, EVENT_SHOWN$6);
5825
5874
  };
5826
5875
  const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
5827
5876
  const scrollSize = `scroll${capitalizedDimension}`;
@@ -5832,7 +5881,7 @@ class Collapse extends BaseComponent {
5832
5881
  if (this._isTransitioning || !this._isShown()) {
5833
5882
  return;
5834
5883
  }
5835
- const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$5);
5884
+ const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);
5836
5885
  if (startEvent.defaultPrevented) {
5837
5886
  return;
5838
5887
  }
@@ -5841,11 +5890,9 @@ class Collapse extends BaseComponent {
5841
5890
  reflow(this._element);
5842
5891
  this._element.classList.add(CLASS_NAME_COLLAPSING);
5843
5892
  this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
5844
- const triggerArrayLength = this._triggerArray.length;
5845
- for (let i = 0; i < triggerArrayLength; i++) {
5846
- const trigger = this._triggerArray[i];
5847
- const elem = getElementFromSelector(trigger);
5848
- if (elem && !this._isShown(elem)) {
5893
+ for (const trigger of this._triggerArray) {
5894
+ const element = getElementFromSelector(trigger);
5895
+ if (element && !this._isShown(element)) {
5849
5896
  this._addAriaAndCollapsedClass([trigger], false);
5850
5897
  }
5851
5898
  }
@@ -5854,7 +5901,7 @@ class Collapse extends BaseComponent {
5854
5901
  this._isTransitioning = false;
5855
5902
  this._element.classList.remove(CLASS_NAME_COLLAPSING);
5856
5903
  this._element.classList.add(CLASS_NAME_COLLAPSE);
5857
- EventHandler.trigger(this._element, EVENT_HIDDEN$5);
5904
+ EventHandler.trigger(this._element, EVENT_HIDDEN$6);
5858
5905
  };
5859
5906
  this._element.style[dimension] = '';
5860
5907
  this._queueCallback(complete, this._element, true);
@@ -5862,14 +5909,9 @@ class Collapse extends BaseComponent {
5862
5909
  _isShown(element = this._element) {
5863
5910
  return element.classList.contains(CLASS_NAME_SHOW$7);
5864
5911
  }
5865
- _getConfig(config) {
5866
- config = { ...Default$9,
5867
- ...Manipulator.getDataAttributes(this._element),
5868
- ...config
5869
- };
5912
+ _configAfterMerge(config) {
5870
5913
  config.toggle = Boolean(config.toggle);
5871
5914
  config.parent = getElement(config.parent);
5872
- typeCheckConfig(NAME$a, config, DefaultType$9);
5873
5915
  return config;
5874
5916
  }
5875
5917
  _getDimension() {
@@ -5879,33 +5921,33 @@ class Collapse extends BaseComponent {
5879
5921
  if (!this._config.parent) {
5880
5922
  return;
5881
5923
  }
5882
- const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
5883
- SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
5924
+ const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);
5925
+ for (const element of children) {
5884
5926
  const selected = getElementFromSelector(element);
5885
5927
  if (selected) {
5886
5928
  this._addAriaAndCollapsedClass([element], this._isShown(selected));
5887
5929
  }
5888
- });
5930
+ }
5931
+ }
5932
+ _getFirstLevelChildren(selector) {
5933
+ const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
5934
+ return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));
5889
5935
  }
5890
5936
  _addAriaAndCollapsedClass(triggerArray, isOpen) {
5891
5937
  if (!triggerArray.length) {
5892
5938
  return;
5893
5939
  }
5894
- triggerArray.forEach(elem => {
5895
- if (isOpen) {
5896
- elem.classList.remove(CLASS_NAME_COLLAPSED);
5897
- } else {
5898
- elem.classList.add(CLASS_NAME_COLLAPSED);
5899
- }
5900
- elem.setAttribute('aria-expanded', isOpen);
5901
- });
5940
+ for (const element of triggerArray) {
5941
+ element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);
5942
+ element.setAttribute('aria-expanded', isOpen);
5943
+ }
5902
5944
  }
5903
5945
  static jQueryInterface(config) {
5946
+ const _config = {};
5947
+ if (typeof config === 'string' && /show|hide/.test(config)) {
5948
+ _config.toggle = false;
5949
+ }
5904
5950
  return this.each(function () {
5905
- const _config = {};
5906
- if (typeof config === 'string' && /show|hide/.test(config)) {
5907
- _config.toggle = false;
5908
- }
5909
5951
  const data = Collapse.getOrCreateInstance(this, _config);
5910
5952
  if (typeof config === 'string') {
5911
5953
  if (typeof data[config] === 'undefined') {
@@ -5922,38 +5964,39 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, functi
5922
5964
  }
5923
5965
  const selector = getSelectorFromElement(this);
5924
5966
  const selectorElements = SelectorEngine.find(selector);
5925
- selectorElements.forEach(element => {
5967
+ for (const element of selectorElements) {
5926
5968
  Collapse.getOrCreateInstance(element, {
5927
5969
  toggle: false
5928
5970
  }).toggle();
5929
- });
5971
+ }
5930
5972
  });
5931
5973
  defineJQueryPlugin(Collapse);
5932
- const NAME$9 = 'dropdown';
5933
- const DATA_KEY$8 = 'bs.dropdown';
5934
- const EVENT_KEY$8 = `.${DATA_KEY$8}`;
5935
- const DATA_API_KEY$4 = '.data-api';
5974
+ const NAME$a = 'dropdown';
5975
+ const DATA_KEY$6 = 'bs.dropdown';
5976
+ const EVENT_KEY$6 = `.${DATA_KEY$6}`;
5977
+ const DATA_API_KEY$3 = '.data-api';
5936
5978
  const ESCAPE_KEY$2 = 'Escape';
5937
- const SPACE_KEY = 'Space';
5938
5979
  const TAB_KEY$1 = 'Tab';
5939
- const ARROW_UP_KEY = 'ArrowUp';
5940
- const ARROW_DOWN_KEY = 'ArrowDown';
5980
+ const ARROW_UP_KEY$1 = 'ArrowUp';
5981
+ const ARROW_DOWN_KEY$1 = 'ArrowDown';
5941
5982
  const RIGHT_MOUSE_BUTTON = 2;
5942
- const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
5943
- const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;
5944
- const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
5945
- const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
5946
- const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
5947
- const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;
5948
- const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;
5949
- const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;
5983
+ const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;
5984
+ const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;
5985
+ const EVENT_SHOW$5 = `show${EVENT_KEY$6}`;
5986
+ const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;
5987
+ const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
5988
+ const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;
5989
+ const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;
5950
5990
  const CLASS_NAME_SHOW$6 = 'show';
5951
5991
  const CLASS_NAME_DROPUP = 'dropup';
5952
5992
  const CLASS_NAME_DROPEND = 'dropend';
5953
5993
  const CLASS_NAME_DROPSTART = 'dropstart';
5954
- const CLASS_NAME_NAVBAR = 'navbar';
5955
- const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]';
5994
+ const CLASS_NAME_DROPUP_CENTER = 'dropup-center';
5995
+ const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';
5996
+ const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';
5997
+ const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;
5956
5998
  const SELECTOR_MENU = '.dropdown-menu';
5999
+ const SELECTOR_NAVBAR = '.navbar';
5957
6000
  const SELECTOR_NAVBAR_NAV = '.navbar-nav';
5958
6001
  const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
5959
6002
  const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';
@@ -5962,70 +6005,69 @@ const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';
5962
6005
  const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
5963
6006
  const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
5964
6007
  const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
5965
- const Default$8 = {
5966
- offset: [0, 2],
6008
+ const PLACEMENT_TOPCENTER = 'top';
6009
+ const PLACEMENT_BOTTOMCENTER = 'bottom';
6010
+ const Default$9 = {
6011
+ autoClose: true,
5967
6012
  boundary: 'clippingParents',
5968
- reference: 'toggle',
5969
6013
  display: 'dynamic',
6014
+ offset: [0, 2],
5970
6015
  popperConfig: null,
5971
- autoClose: true
6016
+ reference: 'toggle'
5972
6017
  };
5973
- const DefaultType$8 = {
5974
- offset: '(array|string|function)',
6018
+ const DefaultType$9 = {
6019
+ autoClose: '(boolean|string)',
5975
6020
  boundary: '(string|element)',
5976
- reference: '(string|element|object)',
5977
6021
  display: 'string',
6022
+ offset: '(array|string|function)',
5978
6023
  popperConfig: '(null|object|function)',
5979
- autoClose: '(boolean|string)'
6024
+ reference: '(string|element|object)'
5980
6025
  };
5981
6026
  class Dropdown extends BaseComponent {
5982
6027
  constructor(element, config) {
5983
- super(element);
6028
+ super(element, config);
5984
6029
  this._popper = null;
5985
- this._config = this._getConfig(config);
5986
- this._menu = this._getMenuElement();
6030
+ this._parent = this._element.parentNode;
6031
+ this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0];
5987
6032
  this._inNavbar = this._detectNavbar();
5988
6033
  }
5989
6034
  static get Default() {
5990
- return Default$8;
6035
+ return Default$9;
5991
6036
  }
5992
6037
  static get DefaultType() {
5993
- return DefaultType$8;
6038
+ return DefaultType$9;
5994
6039
  }
5995
6040
  static get NAME() {
5996
- return NAME$9;
6041
+ return NAME$a;
5997
6042
  }
5998
6043
  toggle() {
5999
6044
  return this._isShown() ? this.hide() : this.show();
6000
6045
  }
6001
6046
  show() {
6002
- if (isDisabled(this._element) || this._isShown(this._menu)) {
6047
+ if (isDisabled(this._element) || this._isShown()) {
6003
6048
  return;
6004
6049
  }
6005
6050
  const relatedTarget = {
6006
6051
  relatedTarget: this._element
6007
6052
  };
6008
- const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget);
6053
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);
6009
6054
  if (showEvent.defaultPrevented) {
6010
6055
  return;
6011
6056
  }
6012
- const parent = Dropdown.getParentFromElement(this._element);
6013
- if (this._inNavbar) {
6014
- Manipulator.setDataAttribute(this._menu, 'popper', 'none');
6015
- } else {
6016
- this._createPopper(parent);
6017
- }
6018
- if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
6019
- [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop));
6057
+ this._createPopper();
6058
+ if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {
6059
+ for (const element of [].concat(...document.body.children)) {
6060
+ EventHandler.on(element, 'mouseover', noop);
6061
+ }
6020
6062
  }
6021
6063
  this._element.focus();
6022
6064
  this._element.setAttribute('aria-expanded', true);
6023
6065
  this._menu.classList.add(CLASS_NAME_SHOW$6);
6024
6066
  this._element.classList.add(CLASS_NAME_SHOW$6);
6025
- EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
6067
+ EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);
6026
6068
  }
6027
6069
  hide() {
6028
- if (isDisabled(this._element) || !this._isShown(this._menu)) {
6070
+ if (isDisabled(this._element) || !this._isShown()) {
6029
6071
  return;
6030
6072
  }
6031
6073
  const relatedTarget = {
@@ -6046,12 +6088,14 @@ class Dropdown extends BaseComponent {
6046
6088
  }
6047
6089
  }
6048
6090
  _completeHide(relatedTarget) {
6049
- const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
6091
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);
6050
6092
  if (hideEvent.defaultPrevented) {
6051
6093
  return;
6052
6094
  }
6053
6095
  if ('ontouchstart' in document.documentElement) {
6054
- [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop));
6096
+ for (const element of [].concat(...document.body.children)) {
6097
+ EventHandler.off(element, 'mouseover', noop);
6098
+ }
6055
6099
  }
6056
6100
  if (this._popper) {
6057
6101
  this._popper.destroy();
@@ -6060,52 +6104,47 @@ class Dropdown extends BaseComponent {
6060
6104
  this._element.classList.remove(CLASS_NAME_SHOW$6);
6061
6105
  this._element.setAttribute('aria-expanded', 'false');
6062
6106
  Manipulator.removeDataAttribute(this._menu, 'popper');
6063
- EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);
6107
+ EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);
6064
6108
  }
6065
6109
  _getConfig(config) {
6066
- config = { ...this.constructor.Default,
6067
- ...Manipulator.getDataAttributes(this._element),
6068
- ...config
6069
- };
6070
- typeCheckConfig(NAME$9, config, this.constructor.DefaultType);
6110
+ config = super._getConfig(config);
6071
6111
  if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
6072
- throw new TypeError(`${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
6112
+ throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
6073
6113
  }
6074
6114
  return config;
6075
6115
  }
6076
- _createPopper(parent) {
6116
+ _createPopper() {
6077
6117
  if (typeof Popper === 'undefined') {
6078
6118
  throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
6079
6119
  }
6080
6120
  let referenceElement = this._element;
6081
6121
  if (this._config.reference === 'parent') {
6082
- referenceElement = parent;
6122
+ referenceElement = this._parent;
6083
6123
  } else if (isElement(this._config.reference)) {
6084
6124
  referenceElement = getElement(this._config.reference);
6085
6125
  } else if (typeof this._config.reference === 'object') {
6086
6126
  referenceElement = this._config.reference;
6087
6127
  }
6088
6128
  const popperConfig = this._getPopperConfig();
6089
- const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
6090
6129
  this._popper = createPopper(referenceElement, this._menu, popperConfig);
6091
- if (isDisplayStatic) {
6092
- Manipulator.setDataAttribute(this._menu, 'popper', 'static');
6093
- }
6094
- }
6095
- _isShown(element = this._element) {
6096
- return element.classList.contains(CLASS_NAME_SHOW$6);
6097
6130
  }
6098
- _getMenuElement() {
6099
- return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
6131
+ _isShown() {
6132
+ return this._menu.classList.contains(CLASS_NAME_SHOW$6);
6100
6133
  }
6101
6134
  _getPlacement() {
6102
- const parentDropdown = this._element.parentNode;
6135
+ const parentDropdown = this._parent;
6103
6136
  if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
6104
6137
  return PLACEMENT_RIGHT;
6105
6138
  }
6106
6139
  if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
6107
6140
  return PLACEMENT_LEFT;
6108
6141
  }
6142
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {
6143
+ return PLACEMENT_TOPCENTER;
6144
+ }
6145
+ if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {
6146
+ return PLACEMENT_BOTTOMCENTER;
6147
+ }
6109
6148
  const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
6110
6149
  if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
6111
6150
  return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
@@ -6113,14 +6152,14 @@ class Dropdown extends BaseComponent {
6113
6152
  return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
6114
6153
  }
6115
6154
  _detectNavbar() {
6116
- return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;
6155
+ return this._element.closest(SELECTOR_NAVBAR) !== null;
6117
6156
  }
6118
6157
  _getOffset() {
6119
6158
  const {
6120
6159
  offset
6121
6160
  } = this._config;
6122
6161
  if (typeof offset === 'string') {
6123
- return offset.split(',').map(val => Number.parseInt(val, 10));
6162
+ return offset.split(',').map(value => Number.parseInt(value, 10));
6124
6163
  }
6125
6164
  if (typeof offset === 'function') {
6126
6165
  return popperData => offset(popperData, this._element);
@@ -6142,7 +6181,8 @@ class Dropdown extends BaseComponent {
6142
6181
  }
6143
6182
  }]
6144
6183
  };
6145
- if (this._config.display === 'static') {
6184
+ if (this._inNavbar || this._config.display === 'static') {
6185
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static');
6146
6186
  defaultBsPopperConfig.modifiers = [{
6147
6187
  name: 'applyStyles',
6148
6188
  enabled: false
@@ -6156,11 +6196,11 @@ class Dropdown extends BaseComponent {
6156
6196
  key,
6157
6197
  target
6158
6198
  }) {
6159
- const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
6199
+ const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));
6160
6200
  if (!items.length) {
6161
6201
  return;
6162
6202
  }
6163
- getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
6203
+ getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();
6164
6204
  }
6165
6205
  static jQueryInterface(config) {
6166
6206
  return this.each(function () {
@@ -6175,68 +6215,55 @@ class Dropdown extends BaseComponent {
6175
6215
  });
6176
6216
  }
6177
6217
  static clearMenus(event) {
6178
- if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
6218
+ if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {
6179
6219
  return;
6180
6220
  }
6181
- const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);
6182
- for (let i = 0, len = toggles.length; i < len; i++) {
6183
- const context = Dropdown.getInstance(toggles[i]);
6221
+ const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);
6222
+ for (const toggle of openToggles) {
6223
+ const context = Dropdown.getInstance(toggle);
6184
6224
  if (!context || context._config.autoClose === false) {
6185
6225
  continue;
6186
6226
  }
6187
- if (!context._isShown()) {
6227
+ const composedPath = event.composedPath();
6228
+ const isMenuTarget = composedPath.includes(context._menu);
6229
+ if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
6230
+ continue;
6231
+ }
6232
+ if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
6188
6233
  continue;
6189
6234
  }
6190
6235
  const relatedTarget = {
6191
6236
  relatedTarget: context._element
6192
6237
  };
6193
- if (event) {
6194
- const composedPath = event.composedPath();
6195
- const isMenuTarget = composedPath.includes(context._menu);
6196
- if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
6197
- continue;
6198
- }
6199
- if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
6200
- continue;
6201
- }
6202
- if (event.type === 'click') {
6203
- relatedTarget.clickEvent = event;
6204
- }
6238
+ if (event.type === 'click') {
6239
+ relatedTarget.clickEvent = event;
6205
6240
  }
6206
6241
  context._completeHide(relatedTarget);
6207
6242
  }
6208
6243
  }
6209
- static getParentFromElement(element) {
6210
- return getElementFromSelector(element) || element.parentNode;
6211
- }
6212
6244
  static dataApiKeydownHandler(event) {
6213
- if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {
6245
+ const isInput = /input|textarea/i.test(event.target.tagName);
6246
+ const isEscapeEvent = event.key === ESCAPE_KEY$2;
6247
+ const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);
6248
+ if (!isUpOrDownEvent && !isEscapeEvent) {
6214
6249
  return;
6215
6250
  }
6216
- const isActive = this.classList.contains(CLASS_NAME_SHOW$6);
6217
- if (!isActive && event.key === ESCAPE_KEY$2) {
6251
+ if (isInput && !isEscapeEvent) {
6218
6252
  return;
6219
6253
  }
6220
6254
  event.preventDefault();
6221
- event.stopPropagation();
6222
- if (isDisabled(this)) {
6223
- return;
6224
- }
6225
- const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
6255
+ 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];
6226
6256
  const instance = Dropdown.getOrCreateInstance(getToggleButton);
6227
- if (event.key === ESCAPE_KEY$2) {
6228
- instance.hide();
6229
- return;
6230
- }
6231
- if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
6232
- if (!isActive) {
6233
- instance.show();
6234
- }
6257
+ if (isUpOrDownEvent) {
6258
+ event.stopPropagation();
6259
+ instance.show();
6235
6260
  instance._selectMenuItem(event);
6236
6261
  return;
6237
6262
  }
6238
- if (!isActive || event.key === SPACE_KEY) {
6239
- Dropdown.clearMenus();
6263
+ if (instance._isShown()) {
6264
+ event.stopPropagation();
6265
+ instance.hide();
6266
+ getToggleButton.focus();
6240
6267
  }
6241
6268
  }
6242
6269
  }
@@ -6251,6 +6278,8 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, functi
6251
6278
  defineJQueryPlugin(Dropdown);
6252
6279
  const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
6253
6280
  const SELECTOR_STICKY_CONTENT = '.sticky-top';
6281
+ const PROPERTY_PADDING = 'padding-right';
6282
+ const PROPERTY_MARGIN = 'margin-right';
6254
6283
  class ScrollBarHelper {
6255
6284
  constructor() {
6256
6285
  this._element = document.body;
@@ -6262,95 +6291,108 @@ class ScrollBarHelper {
6262
6291
  hide() {
6263
6292
  const width = this.getWidth();
6264
6293
  this._disableOverFlow();
6265
- this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width);
6266
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
6267
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
6294
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
6295
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
6296
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
6297
+ }
6298
+ reset() {
6299
+ this._resetElementAttributes(this._element, 'overflow');
6300
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
6301
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
6302
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
6303
+ }
6304
+ isOverflowing() {
6305
+ return this.getWidth() > 0;
6268
6306
  }
6269
6307
  _disableOverFlow() {
6270
6308
  this._saveInitialAttribute(this._element, 'overflow');
6271
6309
  this._element.style.overflow = 'hidden';
6272
6310
  }
6273
- _setElementAttributes(selector, styleProp, callback) {
6311
+ _setElementAttributes(selector, styleProperty, callback) {
6274
6312
  const scrollbarWidth = this.getWidth();
6275
6313
  const manipulationCallBack = element => {
6276
6314
  if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
6277
6315
  return;
6278
6316
  }
6279
- this._saveInitialAttribute(element, styleProp);
6280
- const calculatedValue = window.getComputedStyle(element)[styleProp];
6281
- element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
6317
+ this._saveInitialAttribute(element, styleProperty);
6318
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
6319
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
6282
6320
  };
6283
6321
  this._applyManipulationCallback(selector, manipulationCallBack);
6284
6322
  }
6285
- reset() {
6286
- this._resetElementAttributes(this._element, 'overflow');
6287
- this._resetElementAttributes(this._element, 'paddingRight');
6288
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
6289
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
6290
- }
6291
- _saveInitialAttribute(element, styleProp) {
6292
- const actualValue = element.style[styleProp];
6323
+ _saveInitialAttribute(element, styleProperty) {
6324
+ const actualValue = element.style.getPropertyValue(styleProperty);
6293
6325
  if (actualValue) {
6294
- Manipulator.setDataAttribute(element, styleProp, actualValue);
6326
+ Manipulator.setDataAttribute(element, styleProperty, actualValue);
6295
6327
  }
6296
6328
  }
6297
- _resetElementAttributes(selector, styleProp) {
6329
+ _resetElementAttributes(selector, styleProperty) {
6298
6330
  const manipulationCallBack = element => {
6299
- const value = Manipulator.getDataAttribute(element, styleProp);
6300
- if (typeof value === 'undefined') {
6301
- element.style.removeProperty(styleProp);
6302
- } else {
6303
- Manipulator.removeDataAttribute(element, styleProp);
6304
- element.style[styleProp] = value;
6331
+ const value = Manipulator.getDataAttribute(element, styleProperty);
6332
+ if (value === null) {
6333
+ element.style.removeProperty(styleProperty);
6334
+ return;
6305
6335
  }
6336
+ Manipulator.removeDataAttribute(element, styleProperty);
6337
+ element.style.setProperty(styleProperty, value);
6306
6338
  };
6307
6339
  this._applyManipulationCallback(selector, manipulationCallBack);
6308
6340
  }
6309
6341
  _applyManipulationCallback(selector, callBack) {
6310
6342
  if (isElement(selector)) {
6311
6343
  callBack(selector);
6312
- } else {
6313
- SelectorEngine.find(selector, this._element).forEach(callBack);
6344
+ return;
6345
+ }
6346
+ for (const sel of SelectorEngine.find(selector, this._element)) {
6347
+ callBack(sel);
6314
6348
  }
6315
- }
6316
- isOverflowing() {
6317
- return this.getWidth() > 0;
6318
6349
  }
6319
6350
  }
6320
- const Default$7 = {
6351
+ const NAME$9 = 'backdrop';
6352
+ const CLASS_NAME_FADE$4 = 'fade';
6353
+ const CLASS_NAME_SHOW$5 = 'show';
6354
+ const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;
6355
+ const Default$8 = {
6321
6356
  className: 'modal-backdrop',
6322
- isVisible: true,
6357
+ clickCallback: null,
6323
6358
  isAnimated: false,
6324
- rootElement: 'body',
6325
- clickCallback: null
6359
+ isVisible: true,
6360
+ rootElement: 'body'
6326
6361
  };
6327
- const DefaultType$7 = {
6362
+ const DefaultType$8 = {
6328
6363
  className: 'string',
6329
- isVisible: 'boolean',
6364
+ clickCallback: '(function|null)',
6330
6365
  isAnimated: 'boolean',
6331
- rootElement: '(element|string)',
6332
- clickCallback: '(function|null)'
6366
+ isVisible: 'boolean',
6367
+ rootElement: '(element|string)'
6333
6368
  };
6334
- const NAME$8 = 'backdrop';
6335
- const CLASS_NAME_FADE$4 = 'fade';
6336
- const CLASS_NAME_SHOW$5 = 'show';
6337
- const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;
6338
- class Backdrop {
6369
+ class Backdrop extends Config {
6339
6370
  constructor(config) {
6371
+ super();
6340
6372
  this._config = this._getConfig(config);
6341
6373
  this._isAppended = false;
6342
6374
  this._element = null;
6343
6375
  }
6376
+ static get Default() {
6377
+ return Default$8;
6378
+ }
6379
+ static get DefaultType() {
6380
+ return DefaultType$8;
6381
+ }
6382
+ static get NAME() {
6383
+ return NAME$9;
6384
+ }
6344
6385
  show(callback) {
6345
6386
  if (!this._config.isVisible) {
6346
6387
  execute(callback);
6347
6388
  return;
6348
6389
  }
6349
6390
  this._append();
6391
+ const element = this._getElement();
6350
6392
  if (this._config.isAnimated) {
6351
- reflow(this._getElement());
6393
+ reflow(element);
6352
6394
  }
6353
- this._getElement().classList.add(CLASS_NAME_SHOW$5);
6395
+ element.classList.add(CLASS_NAME_SHOW$5);
6354
6396
  this._emulateAnimation(() => {
6355
6397
  execute(callback);
6356
6398
  });
@@ -6366,6 +6408,14 @@ class Backdrop {
6366
6408
  execute(callback);
6367
6409
  });
6368
6410
  }
6411
+ dispose() {
6412
+ if (!this._isAppended) {
6413
+ return;
6414
+ }
6415
+ EventHandler.off(this._element, EVENT_MOUSEDOWN);
6416
+ this._element.remove();
6417
+ this._isAppended = false;
6418
+ }
6369
6419
  _getElement() {
6370
6420
  if (!this._element) {
6371
6421
  const backdrop = document.createElement('div');
@@ -6377,71 +6427,66 @@ class Backdrop {
6377
6427
  }
6378
6428
  return this._element;
6379
6429
  }
6380
- _getConfig(config) {
6381
- config = { ...Default$7,
6382
- ...(typeof config === 'object' ? config : {})
6383
- };
6430
+ _configAfterMerge(config) {
6384
6431
  config.rootElement = getElement(config.rootElement);
6385
- typeCheckConfig(NAME$8, config, DefaultType$7);
6386
6432
  return config;
6387
6433
  }
6388
6434
  _append() {
6389
6435
  if (this._isAppended) {
6390
6436
  return;
6391
6437
  }
6392
- this._config.rootElement.append(this._getElement());
6393
- EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
6438
+ const element = this._getElement();
6439
+ this._config.rootElement.append(element);
6440
+ EventHandler.on(element, EVENT_MOUSEDOWN, () => {
6394
6441
  execute(this._config.clickCallback);
6395
6442
  });
6396
6443
  this._isAppended = true;
6397
6444
  }
6398
- dispose() {
6399
- if (!this._isAppended) {
6400
- return;
6401
- }
6402
- EventHandler.off(this._element, EVENT_MOUSEDOWN);
6403
- this._element.remove();
6404
- this._isAppended = false;
6405
- }
6406
6445
  _emulateAnimation(callback) {
6407
6446
  executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
6408
6447
  }
6409
6448
  }
6410
- const Default$6 = {
6411
- trapElement: null,
6412
- autofocus: true
6413
- };
6414
- const DefaultType$6 = {
6415
- trapElement: 'element',
6416
- autofocus: 'boolean'
6417
- };
6418
- const NAME$7 = 'focustrap';
6419
- const DATA_KEY$7 = 'bs.focustrap';
6420
- const EVENT_KEY$7 = `.${DATA_KEY$7}`;
6421
- const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;
6422
- const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;
6449
+ const NAME$8 = 'focustrap';
6450
+ const DATA_KEY$5 = 'bs.focustrap';
6451
+ const EVENT_KEY$5 = `.${DATA_KEY$5}`;
6452
+ const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;
6453
+ const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;
6423
6454
  const TAB_KEY = 'Tab';
6424
6455
  const TAB_NAV_FORWARD = 'forward';
6425
6456
  const TAB_NAV_BACKWARD = 'backward';
6426
- class FocusTrap {
6457
+ const Default$7 = {
6458
+ autofocus: true,
6459
+ trapElement: null
6460
+ };
6461
+ const DefaultType$7 = {
6462
+ autofocus: 'boolean',
6463
+ trapElement: 'element'
6464
+ };
6465
+ class FocusTrap extends Config {
6427
6466
  constructor(config) {
6467
+ super();
6428
6468
  this._config = this._getConfig(config);
6429
6469
  this._isActive = false;
6430
6470
  this._lastTabNavDirection = null;
6431
6471
  }
6472
+ static get Default() {
6473
+ return Default$7;
6474
+ }
6475
+ static get DefaultType() {
6476
+ return DefaultType$7;
6477
+ }
6478
+ static get NAME() {
6479
+ return NAME$8;
6480
+ }
6432
6481
  activate() {
6433
- const {
6434
- trapElement,
6435
- autofocus
6436
- } = this._config;
6437
6482
  if (this._isActive) {
6438
6483
  return;
6439
6484
  }
6440
- if (autofocus) {
6441
- trapElement.focus();
6485
+ if (this._config.autofocus) {
6486
+ this._config.trapElement.focus();
6442
6487
  }
6443
- EventHandler.off(document, EVENT_KEY$7);
6444
- EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
6488
+ EventHandler.off(document, EVENT_KEY$5);
6489
+ EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));
6445
6490
  EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
6446
6491
  this._isActive = true;
6447
6492
  }
@@ -6450,16 +6495,13 @@ class FocusTrap {
6450
6495
  return;
6451
6496
  }
6452
6497
  this._isActive = false;
6453
- EventHandler.off(document, EVENT_KEY$7);
6498
+ EventHandler.off(document, EVENT_KEY$5);
6454
6499
  }
6455
6500
  _handleFocusin(event) {
6456
- const {
6457
- target
6458
- } = event;
6459
6501
  const {
6460
6502
  trapElement
6461
6503
  } = this._config;
6462
- if (target === document || target === trapElement || trapElement.contains(target)) {
6504
+ if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {
6463
6505
  return;
6464
6506
  }
6465
6507
  const elements = SelectorEngine.focusableChildren(trapElement);
@@ -6477,40 +6519,22 @@ class FocusTrap {
6477
6519
  }
6478
6520
  this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
6479
6521
  }
6480
- _getConfig(config) {
6481
- config = { ...Default$6,
6482
- ...(typeof config === 'object' ? config : {})
6483
- };
6484
- typeCheckConfig(NAME$7, config, DefaultType$6);
6485
- return config;
6486
- }
6487
6522
  }
6488
- const NAME$6 = 'modal';
6489
- const DATA_KEY$6 = 'bs.modal';
6490
- const EVENT_KEY$6 = `.${DATA_KEY$6}`;
6491
- const DATA_API_KEY$3 = '.data-api';
6523
+ const NAME$7 = 'modal';
6524
+ const DATA_KEY$4 = 'bs.modal';
6525
+ const EVENT_KEY$4 = `.${DATA_KEY$4}`;
6526
+ const DATA_API_KEY$2 = '.data-api';
6492
6527
  const ESCAPE_KEY$1 = 'Escape';
6493
- const Default$5 = {
6494
- backdrop: true,
6495
- keyboard: true,
6496
- focus: true
6497
- };
6498
- const DefaultType$5 = {
6499
- backdrop: '(boolean|string)',
6500
- keyboard: 'boolean',
6501
- focus: 'boolean'
6502
- };
6503
- const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
6504
- const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`;
6505
- const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
6506
- const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
6507
- const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
6508
- const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
6509
- const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;
6510
- const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
6511
- const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
6512
- const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
6513
- const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
6528
+ const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;
6529
+ const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;
6530
+ const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;
6531
+ const EVENT_SHOW$4 = `show${EVENT_KEY$4}`;
6532
+ const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;
6533
+ const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;
6534
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;
6535
+ const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;
6536
+ const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;
6537
+ const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;
6514
6538
  const CLASS_NAME_OPEN = 'modal-open';
6515
6539
  const CLASS_NAME_FADE$3 = 'fade';
6516
6540
  const CLASS_NAME_SHOW$4 = 'show';
@@ -6519,23 +6543,35 @@ const OPEN_SELECTOR$1 = '.modal.show';
6519
6543
  const SELECTOR_DIALOG = '.modal-dialog';
6520
6544
  const SELECTOR_MODAL_BODY = '.modal-body';
6521
6545
  const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
6546
+ const Default$6 = {
6547
+ backdrop: true,
6548
+ focus: true,
6549
+ keyboard: true
6550
+ };
6551
+ const DefaultType$6 = {
6552
+ backdrop: '(boolean|string)',
6553
+ focus: 'boolean',
6554
+ keyboard: 'boolean'
6555
+ };
6522
6556
  class Modal extends BaseComponent {
6523
6557
  constructor(element, config) {
6524
- super(element);
6525
- this._config = this._getConfig(config);
6558
+ super(element, config);
6526
6559
  this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
6527
6560
  this._backdrop = this._initializeBackDrop();
6528
6561
  this._focustrap = this._initializeFocusTrap();
6529
6562
  this._isShown = false;
6530
- this._ignoreBackdropClick = false;
6531
6563
  this._isTransitioning = false;
6532
6564
  this._scrollBar = new ScrollBarHelper();
6565
+ this._addEventListeners();
6533
6566
  }
6534
6567
  static get Default() {
6535
- return Default$5;
6568
+ return Default$6;
6569
+ }
6570
+ static get DefaultType() {
6571
+ return DefaultType$6;
6536
6572
  }
6537
6573
  static get NAME() {
6538
- return NAME$6;
6574
+ return NAME$7;
6539
6575
  }
6540
6576
  toggle(relatedTarget) {
6541
6577
  return this._isShown ? this.hide() : this.show(relatedTarget);
@@ -6544,53 +6580,37 @@ class Modal extends BaseComponent {
6544
6580
  if (this._isShown || this._isTransitioning) {
6545
6581
  return;
6546
6582
  }
6547
- const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
6583
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {
6548
6584
  relatedTarget
6549
6585
  });
6550
6586
  if (showEvent.defaultPrevented) {
6551
6587
  return;
6552
6588
  }
6553
6589
  this._isShown = true;
6554
- if (this._isAnimated()) {
6555
- this._isTransitioning = true;
6556
- }
6590
+ this._isTransitioning = true;
6557
6591
  this._scrollBar.hide();
6558
6592
  document.body.classList.add(CLASS_NAME_OPEN);
6559
6593
  this._adjustDialog();
6560
- this._setEscapeEvent();
6561
- this._setResizeEvent();
6562
- EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
6563
- EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
6564
- if (event.target === this._element) {
6565
- this._ignoreBackdropClick = true;
6566
- }
6567
- });
6568
- });
6569
- this._showBackdrop(() => this._showElement(relatedTarget));
6594
+ this._backdrop.show(() => this._showElement(relatedTarget));
6570
6595
  }
6571
6596
  hide() {
6572
6597
  if (!this._isShown || this._isTransitioning) {
6573
6598
  return;
6574
6599
  }
6575
- const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);
6600
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
6576
6601
  if (hideEvent.defaultPrevented) {
6577
6602
  return;
6578
6603
  }
6579
6604
  this._isShown = false;
6580
- const isAnimated = this._isAnimated();
6581
- if (isAnimated) {
6582
- this._isTransitioning = true;
6583
- }
6584
- this._setEscapeEvent();
6585
- this._setResizeEvent();
6605
+ this._isTransitioning = true;
6586
6606
  this._focustrap.deactivate();
6587
6607
  this._element.classList.remove(CLASS_NAME_SHOW$4);
6588
- EventHandler.off(this._element, EVENT_CLICK_DISMISS);
6589
- EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
6590
- this._queueCallback(() => this._hideModal(), this._element, isAnimated);
6608
+ this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
6591
6609
  }
6592
6610
  dispose() {
6593
- [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));
6611
+ for (const htmlElement of [window, this._dialog]) {
6612
+ EventHandler.off(htmlElement, EVENT_KEY$4);
6613
+ }
6594
6614
  this._backdrop.dispose();
6595
6615
  this._focustrap.deactivate();
6596
6616
  super.dispose();
@@ -6609,18 +6629,8 @@ class Modal extends BaseComponent {
6609
6629
  trapElement: this._element
6610
6630
  });
6611
6631
  }
6612
- _getConfig(config) {
6613
- config = { ...Default$5,
6614
- ...Manipulator.getDataAttributes(this._element),
6615
- ...(typeof config === 'object' ? config : {})
6616
- };
6617
- typeCheckConfig(NAME$6, config, DefaultType$5);
6618
- return config;
6619
- }
6620
6632
  _showElement(relatedTarget) {
6621
- const isAnimated = this._isAnimated();
6622
- const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
6623
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
6633
+ if (!document.body.contains(this._element)) {
6624
6634
  document.body.append(this._element);
6625
6635
  }
6626
6636
  this._element.style.display = 'block';
@@ -6628,44 +6638,54 @@ class Modal extends BaseComponent {
6628
6638
  this._element.setAttribute('aria-modal', true);
6629
6639
  this._element.setAttribute('role', 'dialog');
6630
6640
  this._element.scrollTop = 0;
6641
+ const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
6631
6642
  if (modalBody) {
6632
6643
  modalBody.scrollTop = 0;
6633
6644
  }
6634
- if (isAnimated) {
6635
- reflow(this._element);
6636
- }
6645
+ reflow(this._element);
6637
6646
  this._element.classList.add(CLASS_NAME_SHOW$4);
6638
6647
  const transitionComplete = () => {
6639
6648
  if (this._config.focus) {
6640
6649
  this._focustrap.activate();
6641
6650
  }
6642
6651
  this._isTransitioning = false;
6643
- EventHandler.trigger(this._element, EVENT_SHOWN$3, {
6652
+ EventHandler.trigger(this._element, EVENT_SHOWN$4, {
6644
6653
  relatedTarget
6645
6654
  });
6646
6655
  };
6647
- this._queueCallback(transitionComplete, this._dialog, isAnimated);
6656
+ this._queueCallback(transitionComplete, this._dialog, this._isAnimated());
6648
6657
  }
6649
- _setEscapeEvent() {
6650
- if (this._isShown) {
6651
- EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
6652
- if (this._config.keyboard && event.key === ESCAPE_KEY$1) {
6653
- event.preventDefault();
6654
- this.hide();
6655
- } else if (!this._config.keyboard && event.key === ESCAPE_KEY$1) {
6658
+ _addEventListeners() {
6659
+ EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
6660
+ if (event.key !== ESCAPE_KEY$1) {
6661
+ return;
6662
+ }
6663
+ if (this._config.keyboard) {
6664
+ event.preventDefault();
6665
+ this.hide();
6666
+ return;
6667
+ }
6668
+ this._triggerBackdropTransition();
6669
+ });
6670
+ EventHandler.on(window, EVENT_RESIZE$1, () => {
6671
+ if (this._isShown && !this._isTransitioning) {
6672
+ this._adjustDialog();
6673
+ }
6674
+ });
6675
+ EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
6676
+ EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {
6677
+ if (this._dialog.contains(event.target) || this._dialog.contains(event2.target)) {
6678
+ return;
6679
+ }
6680
+ if (this._config.backdrop === 'static') {
6656
6681
  this._triggerBackdropTransition();
6682
+ return;
6683
+ }
6684
+ if (this._config.backdrop) {
6685
+ this.hide();
6657
6686
  }
6658
6687
  });
6659
- } else {
6660
- EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1);
6661
- }
6662
- }
6663
- _setResizeEvent() {
6664
- if (this._isShown) {
6665
- EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog());
6666
- } else {
6667
- EventHandler.off(window, EVENT_RESIZE);
6668
- }
6688
+ });
6669
6689
  }
6670
6690
  _hideModal() {
6671
6691
  this._element.style.display = 'none';
@@ -6677,54 +6697,31 @@ class Modal extends BaseComponent {
6677
6697
  document.body.classList.remove(CLASS_NAME_OPEN);
6678
6698
  this._resetAdjustments();
6679
6699
  this._scrollBar.reset();
6680
- EventHandler.trigger(this._element, EVENT_HIDDEN$3);
6681
- });
6682
- }
6683
- _showBackdrop(callback) {
6684
- EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
6685
- if (this._ignoreBackdropClick) {
6686
- this._ignoreBackdropClick = false;
6687
- return;
6688
- }
6689
- if (event.target !== event.currentTarget) {
6690
- return;
6691
- }
6692
- if (this._config.backdrop === true) {
6693
- this.hide();
6694
- } else if (this._config.backdrop === 'static') {
6695
- this._triggerBackdropTransition();
6696
- }
6700
+ EventHandler.trigger(this._element, EVENT_HIDDEN$4);
6697
6701
  });
6698
- this._backdrop.show(callback);
6699
6702
  }
6700
6703
  _isAnimated() {
6701
6704
  return this._element.classList.contains(CLASS_NAME_FADE$3);
6702
6705
  }
6703
6706
  _triggerBackdropTransition() {
6704
- const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
6707
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);
6705
6708
  if (hideEvent.defaultPrevented) {
6706
6709
  return;
6707
6710
  }
6708
- const {
6709
- classList,
6710
- scrollHeight,
6711
- style
6712
- } = this._element;
6713
- const isModalOverflowing = scrollHeight > document.documentElement.clientHeight;
6714
- if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {
6711
+ const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
6712
+ const initialOverflowY = this._element.style.overflowY;
6713
+ if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {
6715
6714
  return;
6716
6715
  }
6717
6716
  if (!isModalOverflowing) {
6718
- style.overflowY = 'hidden';
6717
+ this._element.style.overflowY = 'hidden';
6719
6718
  }
6720
- classList.add(CLASS_NAME_STATIC);
6719
+ this._element.classList.add(CLASS_NAME_STATIC);
6721
6720
  this._queueCallback(() => {
6722
- classList.remove(CLASS_NAME_STATIC);
6723
- if (!isModalOverflowing) {
6724
- this._queueCallback(() => {
6725
- style.overflowY = '';
6726
- }, this._dialog);
6727
- }
6721
+ this._element.classList.remove(CLASS_NAME_STATIC);
6722
+ this._queueCallback(() => {
6723
+ this._element.style.overflowY = initialOverflowY;
6724
+ }, this._dialog);
6728
6725
  }, this._dialog);
6729
6726
  this._element.focus();
6730
6727
  }
@@ -6732,11 +6729,13 @@ class Modal extends BaseComponent {
6732
6729
  const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
6733
6730
  const scrollbarWidth = this._scrollBar.getWidth();
6734
6731
  const isBodyOverflowing = scrollbarWidth > 0;
6735
- if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
6736
- this._element.style.paddingLeft = `${scrollbarWidth}px`;
6732
+ if (isBodyOverflowing && !isModalOverflowing) {
6733
+ const property = isRTL() ? 'paddingLeft' : 'paddingRight';
6734
+ this._element.style[property] = `${scrollbarWidth}px`;
6737
6735
  }
6738
- if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {
6739
- this._element.style.paddingRight = `${scrollbarWidth}px`;
6736
+ if (!isBodyOverflowing && isModalOverflowing) {
6737
+ const property = isRTL() ? 'paddingRight' : 'paddingLeft';
6738
+ this._element.style[property] = `${scrollbarWidth}px`;
6740
6739
  }
6741
6740
  }
6742
6741
  _resetAdjustments() {
@@ -6761,65 +6760,71 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, functi
6761
6760
  if (['A', 'AREA'].includes(this.tagName)) {
6762
6761
  event.preventDefault();
6763
6762
  }
6764
- EventHandler.one(target, EVENT_SHOW$3, showEvent => {
6763
+ EventHandler.one(target, EVENT_SHOW$4, showEvent => {
6765
6764
  if (showEvent.defaultPrevented) {
6766
6765
  return;
6767
6766
  }
6768
- EventHandler.one(target, EVENT_HIDDEN$3, () => {
6767
+ EventHandler.one(target, EVENT_HIDDEN$4, () => {
6769
6768
  if (isVisible(this)) {
6770
6769
  this.focus();
6771
6770
  }
6772
6771
  });
6773
6772
  });
6774
- const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
6775
- if (allReadyOpen) {
6776
- Modal.getInstance(allReadyOpen).hide();
6773
+ const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
6774
+ if (alreadyOpen) {
6775
+ Modal.getInstance(alreadyOpen).hide();
6777
6776
  }
6778
6777
  const data = Modal.getOrCreateInstance(target);
6779
6778
  data.toggle(this);
6780
6779
  });
6781
6780
  enableDismissTrigger(Modal);
6782
6781
  defineJQueryPlugin(Modal);
6783
- const NAME$5 = 'offcanvas';
6784
- const DATA_KEY$5 = 'bs.offcanvas';
6785
- const EVENT_KEY$5 = `.${DATA_KEY$5}`;
6786
- const DATA_API_KEY$2 = '.data-api';
6787
- const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`;
6782
+ const NAME$6 = 'offcanvas';
6783
+ const DATA_KEY$3 = 'bs.offcanvas';
6784
+ const EVENT_KEY$3 = `.${DATA_KEY$3}`;
6785
+ const DATA_API_KEY$1 = '.data-api';
6786
+ const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;
6788
6787
  const ESCAPE_KEY = 'Escape';
6789
- const Default$4 = {
6788
+ const CLASS_NAME_SHOW$3 = 'show';
6789
+ const CLASS_NAME_SHOWING$1 = 'showing';
6790
+ const CLASS_NAME_HIDING = 'hiding';
6791
+ const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
6792
+ const OPEN_SELECTOR = '.offcanvas.show';
6793
+ const EVENT_SHOW$3 = `show${EVENT_KEY$3}`;
6794
+ const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;
6795
+ const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;
6796
+ const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;
6797
+ const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;
6798
+ const EVENT_RESIZE = `resize${EVENT_KEY$3}`;
6799
+ const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;
6800
+ const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;
6801
+ const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
6802
+ const Default$5 = {
6790
6803
  backdrop: true,
6791
6804
  keyboard: true,
6792
6805
  scroll: false
6793
6806
  };
6794
- const DefaultType$4 = {
6795
- backdrop: 'boolean',
6807
+ const DefaultType$5 = {
6808
+ backdrop: '(boolean|string)',
6796
6809
  keyboard: 'boolean',
6797
6810
  scroll: 'boolean'
6798
6811
  };
6799
- const CLASS_NAME_SHOW$3 = 'show';
6800
- const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
6801
- const OPEN_SELECTOR = '.offcanvas.show';
6802
- const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
6803
- const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
6804
- const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
6805
- const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
6806
- const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
6807
- const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
6808
- const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
6809
6812
  class Offcanvas extends BaseComponent {
6810
6813
  constructor(element, config) {
6811
- super(element);
6812
- this._config = this._getConfig(config);
6814
+ super(element, config);
6813
6815
  this._isShown = false;
6814
6816
  this._backdrop = this._initializeBackDrop();
6815
6817
  this._focustrap = this._initializeFocusTrap();
6816
6818
  this._addEventListeners();
6817
6819
  }
6818
- static get NAME() {
6819
- return NAME$5;
6820
- }
6821
6820
  static get Default() {
6822
- return Default$4;
6821
+ return Default$5;
6822
+ }
6823
+ static get DefaultType() {
6824
+ return DefaultType$5;
6825
+ }
6826
+ static get NAME() {
6827
+ return NAME$6;
6823
6828
  }
6824
6829
  toggle(relatedTarget) {
6825
6830
  return this._isShown ? this.hide() : this.show(relatedTarget);
@@ -6828,27 +6833,27 @@ class Offcanvas extends BaseComponent {
6828
6833
  if (this._isShown) {
6829
6834
  return;
6830
6835
  }
6831
- const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {
6836
+ const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
6832
6837
  relatedTarget
6833
6838
  });
6834
6839
  if (showEvent.defaultPrevented) {
6835
6840
  return;
6836
6841
  }
6837
6842
  this._isShown = true;
6838
- this._element.style.visibility = 'visible';
6839
6843
  this._backdrop.show();
6840
6844
  if (!this._config.scroll) {
6841
6845
  new ScrollBarHelper().hide();
6842
6846
  }
6843
- this._element.removeAttribute('aria-hidden');
6844
6847
  this._element.setAttribute('aria-modal', true);
6845
6848
  this._element.setAttribute('role', 'dialog');
6846
- this._element.classList.add(CLASS_NAME_SHOW$3);
6849
+ this._element.classList.add(CLASS_NAME_SHOWING$1);
6847
6850
  const completeCallBack = () => {
6848
- if (!this._config.scroll) {
6851
+ if (!this._config.scroll || this._config.backdrop) {
6849
6852
  this._focustrap.activate();
6850
6853
  }
6851
- EventHandler.trigger(this._element, EVENT_SHOWN$2, {
6854
+ this._element.classList.add(CLASS_NAME_SHOW$3);
6855
+ this._element.classList.remove(CLASS_NAME_SHOWING$1);
6856
+ EventHandler.trigger(this._element, EVENT_SHOWN$3, {
6852
6857
  relatedTarget
6853
6858
  });
6854
6859
  };
@@ -6858,24 +6863,23 @@ class Offcanvas extends BaseComponent {
6858
6863
  if (!this._isShown) {
6859
6864
  return;
6860
6865
  }
6861
- const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);
6866
+ const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);
6862
6867
  if (hideEvent.defaultPrevented) {
6863
6868
  return;
6864
6869
  }
6865
6870
  this._focustrap.deactivate();
6866
6871
  this._element.blur();
6867
6872
  this._isShown = false;
6868
- this._element.classList.remove(CLASS_NAME_SHOW$3);
6873
+ this._element.classList.add(CLASS_NAME_HIDING);
6869
6874
  this._backdrop.hide();
6870
6875
  const completeCallback = () => {
6871
- this._element.setAttribute('aria-hidden', true);
6876
+ this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);
6872
6877
  this._element.removeAttribute('aria-modal');
6873
6878
  this._element.removeAttribute('role');
6874
- this._element.style.visibility = 'hidden';
6875
6879
  if (!this._config.scroll) {
6876
6880
  new ScrollBarHelper().reset();
6877
6881
  }
6878
- EventHandler.trigger(this._element, EVENT_HIDDEN$2);
6882
+ EventHandler.trigger(this._element, EVENT_HIDDEN$3);
6879
6883
  };
6880
6884
  this._queueCallback(completeCallback, this._element, true);
6881
6885
  }
@@ -6884,21 +6888,21 @@ class Offcanvas extends BaseComponent {
6884
6888
  this._focustrap.deactivate();
6885
6889
  super.dispose();
6886
6890
  }
6887
- _getConfig(config) {
6888
- config = { ...Default$4,
6889
- ...Manipulator.getDataAttributes(this._element),
6890
- ...(typeof config === 'object' ? config : {})
6891
- };
6892
- typeCheckConfig(NAME$5, config, DefaultType$4);
6893
- return config;
6894
- }
6895
6891
  _initializeBackDrop() {
6892
+ const clickCallback = () => {
6893
+ if (this._config.backdrop === 'static') {
6894
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
6895
+ return;
6896
+ }
6897
+ this.hide();
6898
+ };
6899
+ const isVisible = Boolean(this._config.backdrop);
6896
6900
  return new Backdrop({
6897
6901
  className: CLASS_NAME_BACKDROP,
6898
- isVisible: this._config.backdrop,
6902
+ isVisible,
6899
6903
  isAnimated: true,
6900
6904
  rootElement: this._element.parentNode,
6901
- clickCallback: () => this.hide()
6905
+ clickCallback: isVisible ? clickCallback : null
6902
6906
  });
6903
6907
  }
6904
6908
  _initializeFocusTrap() {
@@ -6908,9 +6912,14 @@ class Offcanvas extends BaseComponent {
6908
6912
  }
6909
6913
  _addEventListeners() {
6910
6914
  EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
6911
- if (this._config.keyboard && event.key === ESCAPE_KEY) {
6912
- this.hide();
6915
+ if (event.key !== ESCAPE_KEY) {
6916
+ return;
6917
+ }
6918
+ if (!this._config.keyboard) {
6919
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
6920
+ return;
6913
6921
  }
6922
+ this.hide();
6914
6923
  });
6915
6924
  }
6916
6925
  static jQueryInterface(config) {
@@ -6934,19 +6943,30 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, functi
6934
6943
  if (isDisabled(this)) {
6935
6944
  return;
6936
6945
  }
6937
- EventHandler.one(target, EVENT_HIDDEN$2, () => {
6946
+ EventHandler.one(target, EVENT_HIDDEN$3, () => {
6938
6947
  if (isVisible(this)) {
6939
6948
  this.focus();
6940
6949
  }
6941
6950
  });
6942
- const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
6943
- if (allReadyOpen && allReadyOpen !== target) {
6944
- Offcanvas.getInstance(allReadyOpen).hide();
6951
+ const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
6952
+ if (alreadyOpen && alreadyOpen !== target) {
6953
+ Offcanvas.getInstance(alreadyOpen).hide();
6945
6954
  }
6946
6955
  const data = Offcanvas.getOrCreateInstance(target);
6947
6956
  data.toggle(this);
6948
6957
  });
6949
- EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
6958
+ EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
6959
+ for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {
6960
+ Offcanvas.getOrCreateInstance(selector).show();
6961
+ }
6962
+ });
6963
+ EventHandler.on(window, EVENT_RESIZE, () => {
6964
+ for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {
6965
+ if (getComputedStyle(element).position !== 'fixed') {
6966
+ Offcanvas.getOrCreateInstance(element).hide();
6967
+ }
6968
+ }
6969
+ });
6950
6970
  enableDismissTrigger(Offcanvas);
6951
6971
  defineJQueryPlugin(Offcanvas);
6952
6972
  const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
@@ -6961,13 +6981,7 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
6961
6981
  }
6962
6982
  return true;
6963
6983
  }
6964
- const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp);
6965
- for (let i = 0, len = regExp.length; i < len; i++) {
6966
- if (regExp[i].test(attributeName)) {
6967
- return true;
6968
- }
6969
- }
6970
- return false;
6984
+ return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
6971
6985
  };
6972
6986
  const DefaultAllowlist = {
6973
6987
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
@@ -7001,18 +7015,17 @@ const DefaultAllowlist = {
7001
7015
  u: [],
7002
7016
  ul: []
7003
7017
  };
7004
- function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
7018
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
7005
7019
  if (!unsafeHtml.length) {
7006
7020
  return unsafeHtml;
7007
7021
  }
7008
- if (sanitizeFn && typeof sanitizeFn === 'function') {
7009
- return sanitizeFn(unsafeHtml);
7022
+ if (sanitizeFunction && typeof sanitizeFunction === 'function') {
7023
+ return sanitizeFunction(unsafeHtml);
7010
7024
  }
7011
7025
  const domParser = new window.DOMParser();
7012
7026
  const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
7013
7027
  const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
7014
- for (let i = 0, len = elements.length; i < len; i++) {
7015
- const element = elements[i];
7028
+ for (const element of elements) {
7016
7029
  const elementName = element.nodeName.toLowerCase();
7017
7030
  if (!Object.keys(allowList).includes(elementName)) {
7018
7031
  element.remove();
@@ -7020,117 +7033,218 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
7020
7033
  }
7021
7034
  const attributeList = [].concat(...element.attributes);
7022
7035
  const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
7023
- attributeList.forEach(attribute => {
7036
+ for (const attribute of attributeList) {
7024
7037
  if (!allowedAttribute(attribute, allowedAttributes)) {
7025
7038
  element.removeAttribute(attribute.nodeName);
7026
7039
  }
7027
- });
7040
+ }
7028
7041
  }
7029
7042
  return createdDocument.body.innerHTML;
7030
7043
  }
7031
- const NAME$4 = 'tooltip';
7032
- const DATA_KEY$4 = 'bs.tooltip';
7033
- const EVENT_KEY$4 = `.${DATA_KEY$4}`;
7034
- const CLASS_PREFIX$1 = 'bs-tooltip';
7035
- const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
7036
- const DefaultType$3 = {
7037
- animation: 'boolean',
7038
- template: 'string',
7039
- title: '(string|element|function)',
7040
- trigger: 'string',
7041
- delay: '(number|object)',
7042
- html: 'boolean',
7043
- selector: '(string|boolean)',
7044
- placement: '(string|function)',
7045
- offset: '(array|string|function)',
7046
- container: '(string|element|boolean)',
7047
- fallbackPlacements: 'array',
7048
- boundary: '(string|element)',
7049
- customClass: '(string|function)',
7050
- sanitize: 'boolean',
7051
- sanitizeFn: '(null|function)',
7052
- allowList: 'object',
7053
- popperConfig: '(null|object|function)'
7054
- };
7055
- const AttachmentMap = {
7056
- AUTO: 'auto',
7057
- TOP: 'top',
7058
- RIGHT: isRTL() ? 'left' : 'right',
7059
- BOTTOM: 'bottom',
7060
- LEFT: isRTL() ? 'right' : 'left'
7061
- };
7062
- const Default$3 = {
7063
- animation: true,
7064
- template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
7065
- trigger: 'hover focus',
7066
- title: '',
7067
- delay: 0,
7044
+ const NAME$5 = 'TemplateFactory';
7045
+ const Default$4 = {
7046
+ allowList: DefaultAllowlist,
7047
+ content: {},
7048
+ extraClass: '',
7068
7049
  html: false,
7069
- selector: false,
7070
- placement: 'top',
7071
- offset: [0, 0],
7072
- container: false,
7073
- fallbackPlacements: ['top', 'right', 'bottom', 'left'],
7074
- boundary: 'clippingParents',
7075
- customClass: '',
7076
7050
  sanitize: true,
7077
7051
  sanitizeFn: null,
7078
- allowList: DefaultAllowlist,
7079
- popperConfig: null
7052
+ template: '<div></div>'
7080
7053
  };
7081
- const Event$2 = {
7082
- HIDE: `hide${EVENT_KEY$4}`,
7083
- HIDDEN: `hidden${EVENT_KEY$4}`,
7084
- SHOW: `show${EVENT_KEY$4}`,
7085
- SHOWN: `shown${EVENT_KEY$4}`,
7086
- INSERTED: `inserted${EVENT_KEY$4}`,
7087
- CLICK: `click${EVENT_KEY$4}`,
7088
- FOCUSIN: `focusin${EVENT_KEY$4}`,
7089
- FOCUSOUT: `focusout${EVENT_KEY$4}`,
7090
- MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
7091
- MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
7054
+ const DefaultType$4 = {
7055
+ allowList: 'object',
7056
+ content: 'object',
7057
+ extraClass: '(string|function)',
7058
+ html: 'boolean',
7059
+ sanitize: 'boolean',
7060
+ sanitizeFn: '(null|function)',
7061
+ template: 'string'
7092
7062
  };
7093
- const CLASS_NAME_FADE$2 = 'fade';
7094
- const CLASS_NAME_MODAL = 'modal';
7095
- const CLASS_NAME_SHOW$2 = 'show';
7096
- const HOVER_STATE_SHOW = 'show';
7097
- const HOVER_STATE_OUT = 'out';
7098
- const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
7099
- const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
7100
- const EVENT_MODAL_HIDE = 'hide.bs.modal';
7101
- const TRIGGER_HOVER = 'hover';
7102
- const TRIGGER_FOCUS = 'focus';
7103
- const TRIGGER_CLICK = 'click';
7104
- const TRIGGER_MANUAL = 'manual';
7105
- class Tooltip extends BaseComponent {
7106
- constructor(element, config) {
7107
- if (typeof Popper === 'undefined') {
7108
- throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
7109
- }
7110
- super(element);
7111
- this._isEnabled = true;
7112
- this._timeout = 0;
7113
- this._hoverState = '';
7114
- this._activeTrigger = {};
7115
- this._popper = null;
7063
+ const DefaultContentType = {
7064
+ entry: '(string|element|function|null)',
7065
+ selector: '(string|element)'
7066
+ };
7067
+ class TemplateFactory extends Config {
7068
+ constructor(config) {
7069
+ super();
7116
7070
  this._config = this._getConfig(config);
7117
- this.tip = null;
7118
- this._setListeners();
7119
7071
  }
7120
7072
  static get Default() {
7121
- return Default$3;
7073
+ return Default$4;
7074
+ }
7075
+ static get DefaultType() {
7076
+ return DefaultType$4;
7122
7077
  }
7123
7078
  static get NAME() {
7124
- return NAME$4;
7079
+ return NAME$5;
7125
7080
  }
7126
- static get Event() {
7127
- return Event$2;
7081
+ getContent() {
7082
+ return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);
7128
7083
  }
7129
- static get DefaultType() {
7130
- return DefaultType$3;
7084
+ hasContent() {
7085
+ return this.getContent().length > 0;
7131
7086
  }
7132
- enable() {
7133
- this._isEnabled = true;
7087
+ changeContent(content) {
7088
+ this._checkContent(content);
7089
+ this._config.content = { ...this._config.content,
7090
+ ...content
7091
+ };
7092
+ return this;
7093
+ }
7094
+ toHtml() {
7095
+ const templateWrapper = document.createElement('div');
7096
+ templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
7097
+ for (const [selector, text] of Object.entries(this._config.content)) {
7098
+ this._setContent(templateWrapper, text, selector);
7099
+ }
7100
+ const template = templateWrapper.children[0];
7101
+ const extraClass = this._resolvePossibleFunction(this._config.extraClass);
7102
+ if (extraClass) {
7103
+ template.classList.add(...extraClass.split(' '));
7104
+ }
7105
+ return template;
7106
+ }
7107
+ _typeCheckConfig(config) {
7108
+ super._typeCheckConfig(config);
7109
+ this._checkContent(config.content);
7110
+ }
7111
+ _checkContent(arg) {
7112
+ for (const [selector, content] of Object.entries(arg)) {
7113
+ super._typeCheckConfig({
7114
+ selector,
7115
+ entry: content
7116
+ }, DefaultContentType);
7117
+ }
7118
+ }
7119
+ _setContent(template, content, selector) {
7120
+ const templateElement = SelectorEngine.findOne(selector, template);
7121
+ if (!templateElement) {
7122
+ return;
7123
+ }
7124
+ content = this._resolvePossibleFunction(content);
7125
+ if (!content) {
7126
+ templateElement.remove();
7127
+ return;
7128
+ }
7129
+ if (isElement(content)) {
7130
+ this._putElementInTemplate(getElement(content), templateElement);
7131
+ return;
7132
+ }
7133
+ if (this._config.html) {
7134
+ templateElement.innerHTML = this._maybeSanitize(content);
7135
+ return;
7136
+ }
7137
+ templateElement.textContent = content;
7138
+ }
7139
+ _maybeSanitize(arg) {
7140
+ return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
7141
+ }
7142
+ _resolvePossibleFunction(arg) {
7143
+ return typeof arg === 'function' ? arg(this) : arg;
7144
+ }
7145
+ _putElementInTemplate(element, templateElement) {
7146
+ if (this._config.html) {
7147
+ templateElement.innerHTML = '';
7148
+ templateElement.append(element);
7149
+ return;
7150
+ }
7151
+ templateElement.textContent = element.textContent;
7152
+ }
7153
+ }
7154
+ const NAME$4 = 'tooltip';
7155
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
7156
+ const CLASS_NAME_FADE$2 = 'fade';
7157
+ const CLASS_NAME_MODAL = 'modal';
7158
+ const CLASS_NAME_SHOW$2 = 'show';
7159
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
7160
+ const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
7161
+ const EVENT_MODAL_HIDE = 'hide.bs.modal';
7162
+ const TRIGGER_HOVER = 'hover';
7163
+ const TRIGGER_FOCUS = 'focus';
7164
+ const TRIGGER_CLICK = 'click';
7165
+ const TRIGGER_MANUAL = 'manual';
7166
+ const EVENT_HIDE$2 = 'hide';
7167
+ const EVENT_HIDDEN$2 = 'hidden';
7168
+ const EVENT_SHOW$2 = 'show';
7169
+ const EVENT_SHOWN$2 = 'shown';
7170
+ const EVENT_INSERTED = 'inserted';
7171
+ const EVENT_CLICK$1 = 'click';
7172
+ const EVENT_FOCUSIN$1 = 'focusin';
7173
+ const EVENT_FOCUSOUT$1 = 'focusout';
7174
+ const EVENT_MOUSEENTER = 'mouseenter';
7175
+ const EVENT_MOUSELEAVE = 'mouseleave';
7176
+ const AttachmentMap = {
7177
+ AUTO: 'auto',
7178
+ TOP: 'top',
7179
+ RIGHT: isRTL() ? 'left' : 'right',
7180
+ BOTTOM: 'bottom',
7181
+ LEFT: isRTL() ? 'right' : 'left'
7182
+ };
7183
+ const Default$3 = {
7184
+ allowList: DefaultAllowlist,
7185
+ animation: true,
7186
+ boundary: 'clippingParents',
7187
+ container: false,
7188
+ customClass: '',
7189
+ delay: 0,
7190
+ fallbackPlacements: ['top', 'right', 'bottom', 'left'],
7191
+ html: false,
7192
+ offset: [0, 0],
7193
+ placement: 'top',
7194
+ popperConfig: null,
7195
+ sanitize: true,
7196
+ sanitizeFn: null,
7197
+ selector: false,
7198
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
7199
+ title: '',
7200
+ trigger: 'hover focus'
7201
+ };
7202
+ const DefaultType$3 = {
7203
+ allowList: 'object',
7204
+ animation: 'boolean',
7205
+ boundary: '(string|element)',
7206
+ container: '(string|element|boolean)',
7207
+ customClass: '(string|function)',
7208
+ delay: '(number|object)',
7209
+ fallbackPlacements: 'array',
7210
+ html: 'boolean',
7211
+ offset: '(array|string|function)',
7212
+ placement: '(string|function)',
7213
+ popperConfig: '(null|object|function)',
7214
+ sanitize: 'boolean',
7215
+ sanitizeFn: '(null|function)',
7216
+ selector: '(string|boolean)',
7217
+ template: 'string',
7218
+ title: '(string|element|function)',
7219
+ trigger: 'string'
7220
+ };
7221
+ class Tooltip extends BaseComponent {
7222
+ constructor(element, config) {
7223
+ if (typeof Popper === 'undefined') {
7224
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
7225
+ }
7226
+ super(element, config);
7227
+ this._isEnabled = true;
7228
+ this._timeout = 0;
7229
+ this._isHovered = null;
7230
+ this._activeTrigger = {};
7231
+ this._popper = null;
7232
+ this._templateFactory = null;
7233
+ this._newContent = null;
7234
+ this.tip = null;
7235
+ this._setListeners();
7236
+ }
7237
+ static get Default() {
7238
+ return Default$3;
7239
+ }
7240
+ static get DefaultType() {
7241
+ return DefaultType$3;
7242
+ }
7243
+ static get NAME() {
7244
+ return NAME$4;
7245
+ }
7246
+ enable() {
7247
+ this._isEnabled = true;
7134
7248
  }
7135
7249
  disable() {
7136
7250
  this._isEnabled = false;
@@ -7146,17 +7260,17 @@ class Tooltip extends BaseComponent {
7146
7260
  const context = this._initializeOnDelegatedTarget(event);
7147
7261
  context._activeTrigger.click = !context._activeTrigger.click;
7148
7262
  if (context._isWithActiveTrigger()) {
7149
- context._enter(null, context);
7263
+ context._enter();
7150
7264
  } else {
7151
- context._leave(null, context);
7265
+ context._leave();
7152
7266
  }
7153
- } else {
7154
- if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {
7155
- this._leave(null, this);
7156
- return;
7157
- }
7158
- this._enter(null, this);
7267
+ return;
7159
7268
  }
7269
+ if (this._isShown()) {
7270
+ this._leave();
7271
+ return;
7272
+ }
7273
+ this._enter();
7160
7274
  }
7161
7275
  dispose() {
7162
7276
  clearTimeout(this._timeout);
@@ -7164,6 +7278,9 @@ class Tooltip extends BaseComponent {
7164
7278
  if (this.tip) {
7165
7279
  this.tip.remove();
7166
7280
  }
7281
+ if (this._config.originalTitle) {
7282
+ this._element.setAttribute('title', this._config.originalTitle);
7283
+ }
7167
7284
  this._disposePopper();
7168
7285
  super.dispose();
7169
7286
  }
@@ -7171,182 +7288,162 @@ class Tooltip extends BaseComponent {
7171
7288
  if (this._element.style.display === 'none') {
7172
7289
  throw new Error('Please use show on visible elements');
7173
7290
  }
7174
- if (!(this.isWithContent() && this._isEnabled)) {
7291
+ if (!(this._isWithContent() && this._isEnabled)) {
7175
7292
  return;
7176
7293
  }
7177
- const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
7294
+ const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));
7178
7295
  const shadowRoot = findShadowRoot(this._element);
7179
- const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
7296
+ const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);
7180
7297
  if (showEvent.defaultPrevented || !isInTheDom) {
7181
7298
  return;
7182
7299
  }
7183
- if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
7184
- this._disposePopper();
7300
+ if (this.tip) {
7185
7301
  this.tip.remove();
7186
7302
  this.tip = null;
7187
7303
  }
7188
- const tip = this.getTipElement();
7189
- const tipId = getUID(this.constructor.NAME);
7190
- tip.setAttribute('id', tipId);
7191
- this._element.setAttribute('aria-describedby', tipId);
7192
- if (this._config.animation) {
7193
- tip.classList.add(CLASS_NAME_FADE$2);
7194
- }
7195
- const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
7196
- const attachment = this._getAttachment(placement);
7197
- this._addAttachmentClass(attachment);
7304
+ const tip = this._getTipElement();
7305
+ this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
7198
7306
  const {
7199
7307
  container
7200
7308
  } = this._config;
7201
- Data.set(tip, this.constructor.DATA_KEY, this);
7202
7309
  if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
7203
7310
  container.append(tip);
7204
- EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
7311
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));
7205
7312
  }
7206
7313
  if (this._popper) {
7207
7314
  this._popper.update();
7208
7315
  } else {
7209
- this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
7316
+ this._popper = this._createPopper(tip);
7210
7317
  }
7211
7318
  tip.classList.add(CLASS_NAME_SHOW$2);
7212
- const customClass = this._resolvePossibleFunction(this._config.customClass);
7213
- if (customClass) {
7214
- tip.classList.add(...customClass.split(' '));
7215
- }
7216
7319
  if ('ontouchstart' in document.documentElement) {
7217
- [].concat(...document.body.children).forEach(element => {
7320
+ for (const element of [].concat(...document.body.children)) {
7218
7321
  EventHandler.on(element, 'mouseover', noop);
7219
- });
7322
+ }
7220
7323
  }
7221
7324
  const complete = () => {
7222
- const prevHoverState = this._hoverState;
7223
- this._hoverState = null;
7224
- EventHandler.trigger(this._element, this.constructor.Event.SHOWN);
7225
- if (prevHoverState === HOVER_STATE_OUT) {
7226
- this._leave(null, this);
7325
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));
7326
+ if (this._isHovered === false) {
7327
+ this._leave();
7227
7328
  }
7329
+ this._isHovered = false;
7228
7330
  };
7229
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
7230
- this._queueCallback(complete, this.tip, isAnimated);
7331
+ this._queueCallback(complete, this.tip, this._isAnimated());
7231
7332
  }
7232
7333
  hide() {
7233
- if (!this._popper) {
7334
+ if (!this._isShown()) {
7234
7335
  return;
7235
7336
  }
7236
- const tip = this.getTipElement();
7237
- const complete = () => {
7238
- if (this._isWithActiveTrigger()) {
7239
- return;
7240
- }
7241
- if (this._hoverState !== HOVER_STATE_SHOW) {
7242
- tip.remove();
7243
- }
7244
- this._cleanTipClass();
7245
- this._element.removeAttribute('aria-describedby');
7246
- EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
7247
- this._disposePopper();
7248
- };
7249
- const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
7337
+ const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));
7250
7338
  if (hideEvent.defaultPrevented) {
7251
7339
  return;
7252
7340
  }
7341
+ const tip = this._getTipElement();
7253
7342
  tip.classList.remove(CLASS_NAME_SHOW$2);
7254
7343
  if ('ontouchstart' in document.documentElement) {
7255
- [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop));
7344
+ for (const element of [].concat(...document.body.children)) {
7345
+ EventHandler.off(element, 'mouseover', noop);
7346
+ }
7256
7347
  }
7257
7348
  this._activeTrigger[TRIGGER_CLICK] = false;
7258
7349
  this._activeTrigger[TRIGGER_FOCUS] = false;
7259
7350
  this._activeTrigger[TRIGGER_HOVER] = false;
7260
- const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
7261
- this._queueCallback(complete, this.tip, isAnimated);
7262
- this._hoverState = '';
7351
+ this._isHovered = null;
7352
+ const complete = () => {
7353
+ if (this._isWithActiveTrigger()) {
7354
+ return;
7355
+ }
7356
+ if (!this._isHovered) {
7357
+ tip.remove();
7358
+ }
7359
+ this._element.removeAttribute('aria-describedby');
7360
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));
7361
+ this._disposePopper();
7362
+ };
7363
+ this._queueCallback(complete, this.tip, this._isAnimated());
7263
7364
  }
7264
7365
  update() {
7265
- if (this._popper !== null) {
7366
+ if (this._popper) {
7266
7367
  this._popper.update();
7267
7368
  }
7268
7369
  }
7269
- isWithContent() {
7270
- return Boolean(this.getTitle());
7370
+ _isWithContent() {
7371
+ return Boolean(this._getTitle());
7271
7372
  }
7272
- getTipElement() {
7273
- if (this.tip) {
7274
- return this.tip;
7373
+ _getTipElement() {
7374
+ if (!this.tip) {
7375
+ this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());
7275
7376
  }
7276
- const element = document.createElement('div');
7277
- element.innerHTML = this._config.template;
7278
- const tip = element.children[0];
7279
- this.setContent(tip);
7280
- tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
7281
- this.tip = tip;
7282
7377
  return this.tip;
7283
7378
  }
7284
- setContent(tip) {
7285
- this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
7286
- }
7287
- _sanitizeAndSetContent(template, content, selector) {
7288
- const templateElement = SelectorEngine.findOne(selector, template);
7289
- if (!content && templateElement) {
7290
- templateElement.remove();
7291
- return;
7379
+ _createTipElement(content) {
7380
+ const tip = this._getTemplateFactory(content).toHtml();
7381
+ if (!tip) {
7382
+ return null;
7292
7383
  }
7293
- this.setElementContent(templateElement, content);
7294
- }
7295
- setElementContent(element, content) {
7296
- if (element === null) {
7297
- return;
7384
+ tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
7385
+ tip.classList.add(`bs-${this.constructor.NAME}-auto`);
7386
+ const tipId = getUID(this.constructor.NAME).toString();
7387
+ tip.setAttribute('id', tipId);
7388
+ if (this._isAnimated()) {
7389
+ tip.classList.add(CLASS_NAME_FADE$2);
7298
7390
  }
7299
- if (isElement(content)) {
7300
- content = getElement(content);
7301
- if (this._config.html) {
7302
- if (content.parentNode !== element) {
7303
- element.innerHTML = '';
7304
- element.append(content);
7305
- }
7306
- } else {
7307
- element.textContent = content.textContent;
7308
- }
7309
- return;
7391
+ return tip;
7392
+ }
7393
+ setContent(content) {
7394
+ this._newContent = content;
7395
+ if (this._isShown()) {
7396
+ this._disposePopper();
7397
+ this.show();
7310
7398
  }
7311
- if (this._config.html) {
7312
- if (this._config.sanitize) {
7313
- content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
7314
- }
7315
- element.innerHTML = content;
7399
+ }
7400
+ _getTemplateFactory(content) {
7401
+ if (this._templateFactory) {
7402
+ this._templateFactory.changeContent(content);
7316
7403
  } else {
7317
- element.textContent = content;
7404
+ this._templateFactory = new TemplateFactory({ ...this._config,
7405
+ content,
7406
+ extraClass: this._resolvePossibleFunction(this._config.customClass)
7407
+ });
7318
7408
  }
7409
+ return this._templateFactory;
7319
7410
  }
7320
- getTitle() {
7321
- const title = this._element.getAttribute('data-bs-original-title') || this._config.title;
7322
- return this._resolvePossibleFunction(title);
7411
+ _getContentForTemplate() {
7412
+ return {
7413
+ [SELECTOR_TOOLTIP_INNER]: this._getTitle()
7414
+ };
7323
7415
  }
7324
- updateAttachment(attachment) {
7325
- if (attachment === 'right') {
7326
- return 'end';
7327
- }
7328
- if (attachment === 'left') {
7329
- return 'start';
7330
- }
7331
- return attachment;
7416
+ _getTitle() {
7417
+ return this._resolvePossibleFunction(this._config.title) || this._config.originalTitle;
7332
7418
  }
7333
- _initializeOnDelegatedTarget(event, context) {
7334
- return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
7419
+ _initializeOnDelegatedTarget(event) {
7420
+ return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
7421
+ }
7422
+ _isAnimated() {
7423
+ return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);
7424
+ }
7425
+ _isShown() {
7426
+ return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);
7427
+ }
7428
+ _createPopper(tip) {
7429
+ const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
7430
+ const attachment = AttachmentMap[placement.toUpperCase()];
7431
+ return createPopper(this._element, tip, this._getPopperConfig(attachment));
7335
7432
  }
7336
7433
  _getOffset() {
7337
7434
  const {
7338
7435
  offset
7339
7436
  } = this._config;
7340
7437
  if (typeof offset === 'string') {
7341
- return offset.split(',').map(val => Number.parseInt(val, 10));
7438
+ return offset.split(',').map(value => Number.parseInt(value, 10));
7342
7439
  }
7343
7440
  if (typeof offset === 'function') {
7344
7441
  return popperData => offset(popperData, this._element);
7345
7442
  }
7346
7443
  return offset;
7347
7444
  }
7348
- _resolvePossibleFunction(content) {
7349
- return typeof content === 'function' ? content.call(this._element) : content;
7445
+ _resolvePossibleFunction(arg) {
7446
+ return typeof arg === 'function' ? arg.call(this._element) : arg;
7350
7447
  }
7351
7448
  _getPopperConfig(attachment) {
7352
7449
  const defaultBsPopperConfig = {
@@ -7372,39 +7469,38 @@ class Tooltip extends BaseComponent {
7372
7469
  element: `.${this.constructor.NAME}-arrow`
7373
7470
  }
7374
7471
  }, {
7375
- name: 'onChange',
7472
+ name: 'preSetPlacement',
7376
7473
  enabled: true,
7377
- phase: 'afterWrite',
7378
- fn: data => this._handlePopperPlacementChange(data)
7379
- }],
7380
- onFirstUpdate: data => {
7381
- if (data.options.placement !== data.placement) {
7382
- this._handlePopperPlacementChange(data);
7474
+ phase: 'beforeMain',
7475
+ fn: data => {
7476
+ this._getTipElement().setAttribute('data-popper-placement', data.state.placement);
7383
7477
  }
7384
- }
7478
+ }]
7385
7479
  };
7386
7480
  return { ...defaultBsPopperConfig,
7387
7481
  ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
7388
7482
  };
7389
7483
  }
7390
- _addAttachmentClass(attachment) {
7391
- this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
7392
- }
7393
- _getAttachment(placement) {
7394
- return AttachmentMap[placement.toUpperCase()];
7395
- }
7396
7484
  _setListeners() {
7397
7485
  const triggers = this._config.trigger.split(' ');
7398
- triggers.forEach(trigger => {
7486
+ for (const trigger of triggers) {
7399
7487
  if (trigger === 'click') {
7400
- EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
7488
+ EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => this.toggle(event));
7401
7489
  } else if (trigger !== TRIGGER_MANUAL) {
7402
- const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
7403
- const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
7404
- EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event));
7405
- EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event));
7490
+ const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);
7491
+ const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);
7492
+ EventHandler.on(this._element, eventIn, this._config.selector, event => {
7493
+ const context = this._initializeOnDelegatedTarget(event);
7494
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
7495
+ context._enter();
7496
+ });
7497
+ EventHandler.on(this._element, eventOut, this._config.selector, event => {
7498
+ const context = this._initializeOnDelegatedTarget(event);
7499
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
7500
+ context._leave();
7501
+ });
7406
7502
  }
7407
- });
7503
+ }
7408
7504
  this._hideModalHandler = () => {
7409
7505
  if (this._element) {
7410
7506
  this.hide();
@@ -7421,76 +7517,61 @@ class Tooltip extends BaseComponent {
7421
7517
  }
7422
7518
  }
7423
7519
  _fixTitle() {
7424
- const title = this._element.getAttribute('title');
7425
- const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
7426
- if (title || originalTitleType !== 'string') {
7427
- this._element.setAttribute('data-bs-original-title', title || '');
7428
- if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
7429
- this._element.setAttribute('aria-label', title);
7430
- }
7431
- this._element.setAttribute('title', '');
7432
- }
7433
- }
7434
- _enter(event, context) {
7435
- context = this._initializeOnDelegatedTarget(event, context);
7436
- if (event) {
7437
- context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
7438
- }
7439
- if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {
7440
- context._hoverState = HOVER_STATE_SHOW;
7520
+ const title = this._config.originalTitle;
7521
+ if (!title) {
7441
7522
  return;
7442
7523
  }
7443
- clearTimeout(context._timeout);
7444
- context._hoverState = HOVER_STATE_SHOW;
7445
- if (!context._config.delay || !context._config.delay.show) {
7446
- context.show();
7447
- return;
7524
+ if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
7525
+ this._element.setAttribute('aria-label', title);
7448
7526
  }
7449
- context._timeout = setTimeout(() => {
7450
- if (context._hoverState === HOVER_STATE_SHOW) {
7451
- context.show();
7452
- }
7453
- }, context._config.delay.show);
7527
+ this._element.removeAttribute('title');
7454
7528
  }
7455
- _leave(event, context) {
7456
- context = this._initializeOnDelegatedTarget(event, context);
7457
- if (event) {
7458
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
7459
- }
7460
- if (context._isWithActiveTrigger()) {
7529
+ _enter() {
7530
+ if (this._isShown() || this._isHovered) {
7531
+ this._isHovered = true;
7461
7532
  return;
7462
7533
  }
7463
- clearTimeout(context._timeout);
7464
- context._hoverState = HOVER_STATE_OUT;
7465
- if (!context._config.delay || !context._config.delay.hide) {
7466
- context.hide();
7534
+ this._isHovered = true;
7535
+ this._setTimeout(() => {
7536
+ if (this._isHovered) {
7537
+ this.show();
7538
+ }
7539
+ }, this._config.delay.show);
7540
+ }
7541
+ _leave() {
7542
+ if (this._isWithActiveTrigger()) {
7467
7543
  return;
7468
7544
  }
7469
- context._timeout = setTimeout(() => {
7470
- if (context._hoverState === HOVER_STATE_OUT) {
7471
- context.hide();
7545
+ this._isHovered = false;
7546
+ this._setTimeout(() => {
7547
+ if (!this._isHovered) {
7548
+ this.hide();
7472
7549
  }
7473
- }, context._config.delay.hide);
7550
+ }, this._config.delay.hide);
7551
+ }
7552
+ _setTimeout(handler, timeout) {
7553
+ clearTimeout(this._timeout);
7554
+ this._timeout = setTimeout(handler, timeout);
7474
7555
  }
7475
7556
  _isWithActiveTrigger() {
7476
- for (const trigger in this._activeTrigger) {
7477
- if (this._activeTrigger[trigger]) {
7478
- return true;
7479
- }
7480
- }
7481
- return false;
7557
+ return Object.values(this._activeTrigger).includes(true);
7482
7558
  }
7483
7559
  _getConfig(config) {
7484
7560
  const dataAttributes = Manipulator.getDataAttributes(this._element);
7485
- Object.keys(dataAttributes).forEach(dataAttr => {
7486
- if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
7487
- delete dataAttributes[dataAttr];
7561
+ for (const dataAttribute of Object.keys(dataAttributes)) {
7562
+ if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
7563
+ delete dataAttributes[dataAttribute];
7488
7564
  }
7489
- });
7490
- config = { ...this.constructor.Default,
7491
- ...dataAttributes,
7565
+ }
7566
+ config = { ...dataAttributes,
7492
7567
  ...(typeof config === 'object' && config ? config : {})
7493
7568
  };
7569
+ config = this._mergeConfigObj(config);
7570
+ config = this._configAfterMerge(config);
7571
+ this._typeCheckConfig(config);
7572
+ return config;
7573
+ }
7574
+ _configAfterMerge(config) {
7494
7575
  config.container = config.container === false ? document.body : getElement(config.container);
7495
7576
  if (typeof config.delay === 'number') {
7496
7577
  config.delay = {
@@ -7498,16 +7579,13 @@ class Tooltip extends BaseComponent {
7498
7579
  hide: config.delay
7499
7580
  };
7500
7581
  }
7582
+ config.originalTitle = this._element.getAttribute('title') || '';
7501
7583
  if (typeof config.title === 'number') {
7502
7584
  config.title = config.title.toString();
7503
7585
  }
7504
7586
  if (typeof config.content === 'number') {
7505
7587
  config.content = config.content.toString();
7506
7588
  }
7507
- typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
7508
- if (config.sanitize) {
7509
- config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
7510
- }
7511
7589
  return config;
7512
7590
  }
7513
7591
  _getDelegateConfig() {
@@ -7519,28 +7597,6 @@ class Tooltip extends BaseComponent {
7519
7597
  }
7520
7598
  return config;
7521
7599
  }
7522
- _cleanTipClass() {
7523
- const tip = this.getTipElement();
7524
- const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
7525
- const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
7526
- if (tabClass !== null && tabClass.length > 0) {
7527
- tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
7528
- }
7529
- }
7530
- _getBasicClassPrefix() {
7531
- return CLASS_PREFIX$1;
7532
- }
7533
- _handlePopperPlacementChange(popperData) {
7534
- const {
7535
- state
7536
- } = popperData;
7537
- if (!state) {
7538
- return;
7539
- }
7540
- this.tip = state.elements.popper;
7541
- this._cleanTipClass();
7542
- this._addAttachmentClass(this._getAttachment(state.placement));
7543
- }
7544
7600
  _disposePopper() {
7545
7601
  if (this._popper) {
7546
7602
  this._popper.destroy();
@@ -7550,79 +7606,62 @@ class Tooltip extends BaseComponent {
7550
7606
  static jQueryInterface(config) {
7551
7607
  return this.each(function () {
7552
7608
  const data = Tooltip.getOrCreateInstance(this, config);
7553
- if (typeof config === 'string') {
7554
- if (typeof data[config] === 'undefined') {
7555
- throw new TypeError(`No method named "${config}"`);
7556
- }
7557
- data[config]();
7609
+ if (typeof config !== 'string') {
7610
+ return;
7558
7611
  }
7612
+ if (typeof data[config] === 'undefined') {
7613
+ throw new TypeError(`No method named "${config}"`);
7614
+ }
7615
+ data[config]();
7559
7616
  });
7560
7617
  }
7561
7618
  }
7562
7619
  defineJQueryPlugin(Tooltip);
7563
7620
  const NAME$3 = 'popover';
7564
- const DATA_KEY$3 = 'bs.popover';
7565
- const EVENT_KEY$3 = `.${DATA_KEY$3}`;
7566
- const CLASS_PREFIX = 'bs-popover';
7621
+ const SELECTOR_TITLE = '.popover-header';
7622
+ const SELECTOR_CONTENT = '.popover-body';
7567
7623
  const Default$2 = { ...Tooltip.Default,
7568
- placement: 'right',
7569
- offset: [0, 8],
7570
- trigger: 'click',
7571
7624
  content: '',
7572
- template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
7625
+ offset: [0, 8],
7626
+ placement: 'right',
7627
+ template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>',
7628
+ trigger: 'click'
7573
7629
  };
7574
7630
  const DefaultType$2 = { ...Tooltip.DefaultType,
7575
- content: '(string|element|function)'
7576
- };
7577
- const Event$1 = {
7578
- HIDE: `hide${EVENT_KEY$3}`,
7579
- HIDDEN: `hidden${EVENT_KEY$3}`,
7580
- SHOW: `show${EVENT_KEY$3}`,
7581
- SHOWN: `shown${EVENT_KEY$3}`,
7582
- INSERTED: `inserted${EVENT_KEY$3}`,
7583
- CLICK: `click${EVENT_KEY$3}`,
7584
- FOCUSIN: `focusin${EVENT_KEY$3}`,
7585
- FOCUSOUT: `focusout${EVENT_KEY$3}`,
7586
- MOUSEENTER: `mouseenter${EVENT_KEY$3}`,
7587
- MOUSELEAVE: `mouseleave${EVENT_KEY$3}`
7631
+ content: '(null|string|element|function)'
7588
7632
  };
7589
- const SELECTOR_TITLE = '.popover-header';
7590
- const SELECTOR_CONTENT = '.popover-body';
7591
7633
  class Popover extends Tooltip {
7592
7634
  static get Default() {
7593
7635
  return Default$2;
7594
7636
  }
7595
- static get NAME() {
7596
- return NAME$3;
7597
- }
7598
- static get Event() {
7599
- return Event$1;
7600
- }
7601
7637
  static get DefaultType() {
7602
7638
  return DefaultType$2;
7603
7639
  }
7604
- isWithContent() {
7605
- return this.getTitle() || this._getContent();
7640
+ static get NAME() {
7641
+ return NAME$3;
7642
+ }
7643
+ _isWithContent() {
7644
+ return this._getTitle() || this._getContent();
7606
7645
  }
7607
- setContent(tip) {
7608
- this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
7609
- this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
7646
+ _getContentForTemplate() {
7647
+ return {
7648
+ [SELECTOR_TITLE]: this._getTitle(),
7649
+ [SELECTOR_CONTENT]: this._getContent()
7650
+ };
7610
7651
  }
7611
7652
  _getContent() {
7612
7653
  return this._resolvePossibleFunction(this._config.content);
7613
7654
  }
7614
- _getBasicClassPrefix() {
7615
- return CLASS_PREFIX;
7616
- }
7617
7655
  static jQueryInterface(config) {
7618
7656
  return this.each(function () {
7619
7657
  const data = Popover.getOrCreateInstance(this, config);
7620
- if (typeof config === 'string') {
7621
- if (typeof data[config] === 'undefined') {
7622
- throw new TypeError(`No method named "${config}"`);
7623
- }
7624
- data[config]();
7658
+ if (typeof config !== 'string') {
7659
+ return;
7660
+ }
7661
+ if (typeof data[config] === 'undefined') {
7662
+ throw new TypeError(`No method named "${config}"`);
7625
7663
  }
7664
+ data[config]();
7626
7665
  });
7627
7666
  }
7628
7667
  }
@@ -7630,144 +7669,184 @@ defineJQueryPlugin(Popover);
7630
7669
  const NAME$2 = 'scrollspy';
7631
7670
  const DATA_KEY$2 = 'bs.scrollspy';
7632
7671
  const EVENT_KEY$2 = `.${DATA_KEY$2}`;
7633
- const DATA_API_KEY$1 = '.data-api';
7634
- const Default$1 = {
7635
- offset: 10,
7636
- method: 'auto',
7637
- target: ''
7638
- };
7639
- const DefaultType$1 = {
7640
- offset: 'number',
7641
- method: 'string',
7642
- target: '(string|element)'
7643
- };
7672
+ const DATA_API_KEY = '.data-api';
7644
7673
  const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;
7645
- const EVENT_SCROLL = `scroll${EVENT_KEY$2}`;
7646
- const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`;
7674
+ const EVENT_CLICK = `click${EVENT_KEY$2}`;
7675
+ const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;
7647
7676
  const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
7648
7677
  const CLASS_NAME_ACTIVE$1 = 'active';
7649
7678
  const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
7650
- const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
7679
+ const SELECTOR_TARGET_LINKS = '[href]';
7680
+ const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
7651
7681
  const SELECTOR_NAV_LINKS = '.nav-link';
7652
7682
  const SELECTOR_NAV_ITEMS = '.nav-item';
7653
7683
  const SELECTOR_LIST_ITEMS = '.list-group-item';
7654
- const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;
7655
- const SELECTOR_DROPDOWN$1 = '.dropdown';
7684
+ const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;
7685
+ const SELECTOR_DROPDOWN = '.dropdown';
7656
7686
  const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
7657
- const METHOD_OFFSET = 'offset';
7658
- const METHOD_POSITION = 'position';
7687
+ const Default$1 = {
7688
+ offset: null,
7689
+ rootMargin: '0px 0px -25%',
7690
+ smoothScroll: false,
7691
+ target: null,
7692
+ threshold: [0.1, 0.5, 1]
7693
+ };
7694
+ const DefaultType$1 = {
7695
+ offset: '(number|null)',
7696
+ rootMargin: 'string',
7697
+ smoothScroll: 'boolean',
7698
+ target: 'element',
7699
+ threshold: 'array'
7700
+ };
7659
7701
  class ScrollSpy extends BaseComponent {
7660
7702
  constructor(element, config) {
7661
- super(element);
7662
- this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;
7663
- this._config = this._getConfig(config);
7664
- this._offsets = [];
7665
- this._targets = [];
7703
+ super(element, config);
7704
+ this._targetLinks = new Map();
7705
+ this._observableSections = new Map();
7706
+ this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;
7666
7707
  this._activeTarget = null;
7667
- this._scrollHeight = 0;
7668
- EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process());
7708
+ this._observer = null;
7709
+ this._previousScrollData = {
7710
+ visibleEntryTop: 0,
7711
+ parentScrollTop: 0
7712
+ };
7669
7713
  this.refresh();
7670
- this._process();
7671
7714
  }
7672
7715
  static get Default() {
7673
7716
  return Default$1;
7674
7717
  }
7718
+ static get DefaultType() {
7719
+ return DefaultType$1;
7720
+ }
7675
7721
  static get NAME() {
7676
7722
  return NAME$2;
7677
7723
  }
7678
7724
  refresh() {
7679
- const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
7680
- const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
7681
- const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
7682
- this._offsets = [];
7683
- this._targets = [];
7684
- this._scrollHeight = this._getScrollHeight();
7685
- const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);
7686
- targets.map(element => {
7687
- const targetSelector = getSelectorFromElement(element);
7688
- const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
7689
- if (target) {
7690
- const targetBCR = target.getBoundingClientRect();
7691
- if (targetBCR.width || targetBCR.height) {
7692
- return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
7693
- }
7694
- }
7695
- return null;
7696
- }).filter(item => item).sort((a, b) => a[0] - b[0]).forEach(item => {
7697
- this._offsets.push(item[0]);
7698
- this._targets.push(item[1]);
7699
- });
7725
+ this._initializeTargetsAndObservables();
7726
+ this._maybeEnableSmoothScroll();
7727
+ if (this._observer) {
7728
+ this._observer.disconnect();
7729
+ } else {
7730
+ this._observer = this._getNewObserver();
7731
+ }
7732
+ for (const section of this._observableSections.values()) {
7733
+ this._observer.observe(section);
7734
+ }
7700
7735
  }
7701
7736
  dispose() {
7702
- EventHandler.off(this._scrollElement, EVENT_KEY$2);
7737
+ this._observer.disconnect();
7703
7738
  super.dispose();
7704
7739
  }
7705
- _getConfig(config) {
7706
- config = { ...Default$1,
7707
- ...Manipulator.getDataAttributes(this._element),
7708
- ...(typeof config === 'object' && config ? config : {})
7709
- };
7710
- config.target = getElement(config.target) || document.documentElement;
7711
- typeCheckConfig(NAME$2, config, DefaultType$1);
7740
+ _configAfterMerge(config) {
7741
+ config.target = getElement(config.target) || document.body;
7742
+ config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
7743
+ if (typeof config.threshold === 'string') {
7744
+ config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));
7745
+ }
7712
7746
  return config;
7713
7747
  }
7714
- _getScrollTop() {
7715
- return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
7716
- }
7717
- _getScrollHeight() {
7718
- return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
7748
+ _maybeEnableSmoothScroll() {
7749
+ if (!this._config.smoothScroll) {
7750
+ return;
7751
+ }
7752
+ EventHandler.off(this._config.target, EVENT_CLICK);
7753
+ EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {
7754
+ const observableSection = this._observableSections.get(event.target.hash);
7755
+ if (observableSection) {
7756
+ event.preventDefault();
7757
+ const root = this._rootElement || window;
7758
+ const height = observableSection.offsetTop - this._element.offsetTop;
7759
+ if (root.scrollTo) {
7760
+ root.scrollTo({
7761
+ top: height,
7762
+ behavior: 'smooth'
7763
+ });
7764
+ return;
7765
+ }
7766
+ root.scrollTop = height;
7767
+ }
7768
+ });
7719
7769
  }
7720
- _getOffsetHeight() {
7721
- return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
7770
+ _getNewObserver() {
7771
+ const options = {
7772
+ root: this._rootElement,
7773
+ threshold: this._config.threshold,
7774
+ rootMargin: this._config.rootMargin
7775
+ };
7776
+ return new IntersectionObserver(entries => this._observerCallback(entries), options);
7722
7777
  }
7723
- _process() {
7724
- const scrollTop = this._getScrollTop() + this._config.offset;
7725
- const scrollHeight = this._getScrollHeight();
7726
- const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
7727
- if (this._scrollHeight !== scrollHeight) {
7728
- this.refresh();
7778
+ _observerCallback(entries) {
7779
+ const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);
7780
+ const activate = entry => {
7781
+ this._previousScrollData.visibleEntryTop = entry.target.offsetTop;
7782
+ this._process(targetElement(entry));
7783
+ };
7784
+ const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;
7785
+ const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;
7786
+ this._previousScrollData.parentScrollTop = parentScrollTop;
7787
+ for (const entry of entries) {
7788
+ if (!entry.isIntersecting) {
7789
+ this._activeTarget = null;
7790
+ this._clearActiveClass(targetElement(entry));
7791
+ continue;
7792
+ }
7793
+ const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;
7794
+ if (userScrollsDown && entryIsLowerThanPrevious) {
7795
+ activate(entry);
7796
+ if (!parentScrollTop) {
7797
+ return;
7798
+ }
7799
+ continue;
7800
+ }
7801
+ if (!userScrollsDown && !entryIsLowerThanPrevious) {
7802
+ activate(entry);
7803
+ }
7729
7804
  }
7730
- if (scrollTop >= maxScroll) {
7731
- const target = this._targets[this._targets.length - 1];
7732
- if (this._activeTarget !== target) {
7733
- this._activate(target);
7805
+ }
7806
+ _initializeTargetsAndObservables() {
7807
+ this._targetLinks = new Map();
7808
+ this._observableSections = new Map();
7809
+ const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);
7810
+ for (const anchor of targetLinks) {
7811
+ if (!anchor.hash || isDisabled(anchor)) {
7812
+ continue;
7734
7813
  }
7814
+ const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
7815
+ if (isVisible(observableSection)) {
7816
+ this._targetLinks.set(anchor.hash, anchor);
7817
+ this._observableSections.set(anchor.hash, observableSection);
7818
+ }
7819
+ }
7820
+ }
7821
+ _process(target) {
7822
+ if (this._activeTarget === target) {
7735
7823
  return;
7736
7824
  }
7737
- if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
7738
- this._activeTarget = null;
7739
- this._clear();
7825
+ this._clearActiveClass(this._config.target);
7826
+ this._activeTarget = target;
7827
+ target.classList.add(CLASS_NAME_ACTIVE$1);
7828
+ this._activateParents(target);
7829
+ EventHandler.trigger(this._element, EVENT_ACTIVATE, {
7830
+ relatedTarget: target
7831
+ });
7832
+ }
7833
+ _activateParents(target) {
7834
+ if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
7835
+ SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);
7740
7836
  return;
7741
7837
  }
7742
- for (let i = this._offsets.length; i--;) {
7743
- const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
7744
- if (isActiveTarget) {
7745
- this._activate(this._targets[i]);
7838
+ for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {
7839
+ for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) {
7840
+ item.classList.add(CLASS_NAME_ACTIVE$1);
7746
7841
  }
7747
7842
  }
7748
7843
  }
7749
- _activate(target) {
7750
- this._activeTarget = target;
7751
- this._clear();
7752
- const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
7753
- const link = SelectorEngine.findOne(queries.join(','), this._config.target);
7754
- link.classList.add(CLASS_NAME_ACTIVE$1);
7755
- if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
7756
- SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);
7757
- } else {
7758
- SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {
7759
- SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1));
7760
- SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(navItem => {
7761
- SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1));
7762
- });
7763
- });
7844
+ _clearActiveClass(parent) {
7845
+ parent.classList.remove(CLASS_NAME_ACTIVE$1);
7846
+ const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent);
7847
+ for (const node of activeNodes) {
7848
+ node.classList.remove(CLASS_NAME_ACTIVE$1);
7764
7849
  }
7765
- EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
7766
- relatedTarget: target
7767
- });
7768
- }
7769
- _clear() {
7770
- SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
7771
7850
  }
7772
7851
  static jQueryInterface(config) {
7773
7852
  return this.each(function () {
@@ -7775,132 +7854,208 @@ class ScrollSpy extends BaseComponent {
7775
7854
  if (typeof config !== 'string') {
7776
7855
  return;
7777
7856
  }
7778
- if (typeof data[config] === 'undefined') {
7857
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
7779
7858
  throw new TypeError(`No method named "${config}"`);
7780
7859
  }
7781
7860
  data[config]();
7782
7861
  });
7783
7862
  }
7784
7863
  }
7785
- EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
7786
- SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy));
7864
+ EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {
7865
+ for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) {
7866
+ ScrollSpy.getOrCreateInstance(spy);
7867
+ }
7787
7868
  });
7788
7869
  defineJQueryPlugin(ScrollSpy);
7789
7870
  const NAME$1 = 'tab';
7790
7871
  const DATA_KEY$1 = 'bs.tab';
7791
7872
  const EVENT_KEY$1 = `.${DATA_KEY$1}`;
7792
- const DATA_API_KEY = '.data-api';
7793
7873
  const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;
7794
7874
  const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;
7795
7875
  const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;
7796
7876
  const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;
7797
- const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY}`;
7798
- const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
7877
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`;
7878
+ const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`;
7879
+ const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`;
7880
+ const ARROW_LEFT_KEY = 'ArrowLeft';
7881
+ const ARROW_RIGHT_KEY = 'ArrowRight';
7882
+ const ARROW_UP_KEY = 'ArrowUp';
7883
+ const ARROW_DOWN_KEY = 'ArrowDown';
7799
7884
  const CLASS_NAME_ACTIVE = 'active';
7800
7885
  const CLASS_NAME_FADE$1 = 'fade';
7801
7886
  const CLASS_NAME_SHOW$1 = 'show';
7802
- const SELECTOR_DROPDOWN = '.dropdown';
7803
- const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
7804
- const SELECTOR_ACTIVE = '.active';
7805
- const SELECTOR_ACTIVE_UL = ':scope > li > .active';
7806
- const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
7887
+ const CLASS_DROPDOWN = 'dropdown';
7807
7888
  const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
7808
- const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
7889
+ const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
7890
+ const SELECTOR_DROPDOWN_ITEM = '.dropdown-item';
7891
+ const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)';
7892
+ const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
7893
+ const SELECTOR_OUTER = '.nav-item, .list-group-item';
7894
+ const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
7895
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
7896
+ const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
7897
+ 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"]`;
7809
7898
  class Tab extends BaseComponent {
7899
+ constructor(element) {
7900
+ super(element);
7901
+ this._parent = this._element.closest(SELECTOR_TAB_PANEL);
7902
+ if (!this._parent) {
7903
+ return;
7904
+ }
7905
+ this._setInitialAttributes(this._parent, this._getChildren());
7906
+ EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
7907
+ }
7810
7908
  static get NAME() {
7811
7909
  return NAME$1;
7812
7910
  }
7813
7911
  show() {
7814
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
7912
+ const innerElem = this._element;
7913
+ if (this._elemIsActive(innerElem)) {
7815
7914
  return;
7816
7915
  }
7817
- let previous;
7818
- const target = getElementFromSelector(this._element);
7819
- const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
7820
- if (listElement) {
7821
- const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
7822
- previous = SelectorEngine.find(itemSelector, listElement);
7823
- previous = previous[previous.length - 1];
7824
- }
7825
- const hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$1, {
7826
- relatedTarget: this._element
7916
+ const active = this._getActiveElem();
7917
+ const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, {
7918
+ relatedTarget: innerElem
7827
7919
  }) : null;
7828
- const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, {
7829
- relatedTarget: previous
7920
+ const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, {
7921
+ relatedTarget: active
7830
7922
  });
7831
- if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
7923
+ if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) {
7832
7924
  return;
7833
7925
  }
7834
- this._activate(this._element, listElement);
7926
+ this._deactivate(active, innerElem);
7927
+ this._activate(innerElem, active);
7928
+ }
7929
+ _activate(element, relatedElem) {
7930
+ if (!element) {
7931
+ return;
7932
+ }
7933
+ element.classList.add(CLASS_NAME_ACTIVE);
7934
+ this._activate(getElementFromSelector(element));
7835
7935
  const complete = () => {
7836
- EventHandler.trigger(previous, EVENT_HIDDEN$1, {
7837
- relatedTarget: this._element
7936
+ if (element.getAttribute('role') !== 'tab') {
7937
+ element.classList.add(CLASS_NAME_SHOW$1);
7938
+ return;
7939
+ }
7940
+ element.focus();
7941
+ element.removeAttribute('tabindex');
7942
+ element.setAttribute('aria-selected', true);
7943
+ this._toggleDropDown(element, true);
7944
+ EventHandler.trigger(element, EVENT_SHOWN$1, {
7945
+ relatedTarget: relatedElem
7838
7946
  });
7839
- EventHandler.trigger(this._element, EVENT_SHOWN$1, {
7840
- relatedTarget: previous
7947
+ };
7948
+ this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
7949
+ }
7950
+ _deactivate(element, relatedElem) {
7951
+ if (!element) {
7952
+ return;
7953
+ }
7954
+ element.classList.remove(CLASS_NAME_ACTIVE);
7955
+ element.blur();
7956
+ this._deactivate(getElementFromSelector(element));
7957
+ const complete = () => {
7958
+ if (element.getAttribute('role') !== 'tab') {
7959
+ element.classList.remove(CLASS_NAME_SHOW$1);
7960
+ return;
7961
+ }
7962
+ element.setAttribute('aria-selected', false);
7963
+ element.setAttribute('tabindex', '-1');
7964
+ this._toggleDropDown(element, false);
7965
+ EventHandler.trigger(element, EVENT_HIDDEN$1, {
7966
+ relatedTarget: relatedElem
7841
7967
  });
7842
7968
  };
7843
- if (target) {
7844
- this._activate(target, target.parentNode, complete);
7845
- } else {
7846
- complete();
7969
+ this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
7970
+ }
7971
+ _keydown(event) {
7972
+ if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) {
7973
+ return;
7974
+ }
7975
+ event.stopPropagation();
7976
+ event.preventDefault();
7977
+ const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
7978
+ const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true);
7979
+ if (nextActiveElement) {
7980
+ Tab.getOrCreateInstance(nextActiveElement).show();
7847
7981
  }
7848
7982
  }
7849
- _activate(element, container, callback) {
7850
- const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE);
7851
- const active = activeElements[0];
7852
- const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$1);
7853
- const complete = () => this._transitionComplete(element, active, callback);
7854
- if (active && isTransitioning) {
7855
- active.classList.remove(CLASS_NAME_SHOW$1);
7856
- this._queueCallback(complete, element, true);
7857
- } else {
7858
- complete();
7983
+ _getChildren() {
7984
+ return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent);
7985
+ }
7986
+ _getActiveElem() {
7987
+ return this._getChildren().find(child => this._elemIsActive(child)) || null;
7988
+ }
7989
+ _setInitialAttributes(parent, children) {
7990
+ this._setAttributeIfNotExists(parent, 'role', 'tablist');
7991
+ for (const child of children) {
7992
+ this._setInitialAttributesOnChild(child);
7859
7993
  }
7860
7994
  }
7861
- _transitionComplete(element, active, callback) {
7862
- if (active) {
7863
- active.classList.remove(CLASS_NAME_ACTIVE);
7864
- const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
7865
- if (dropdownChild) {
7866
- dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
7867
- }
7868
- if (active.getAttribute('role') === 'tab') {
7869
- active.setAttribute('aria-selected', false);
7870
- }
7995
+ _setInitialAttributesOnChild(child) {
7996
+ child = this._getInnerElement(child);
7997
+ const isActive = this._elemIsActive(child);
7998
+ const outerElem = this._getOuterElement(child);
7999
+ child.setAttribute('aria-selected', isActive);
8000
+ if (outerElem !== child) {
8001
+ this._setAttributeIfNotExists(outerElem, 'role', 'presentation');
7871
8002
  }
7872
- element.classList.add(CLASS_NAME_ACTIVE);
7873
- if (element.getAttribute('role') === 'tab') {
7874
- element.setAttribute('aria-selected', true);
8003
+ if (!isActive) {
8004
+ child.setAttribute('tabindex', '-1');
8005
+ }
8006
+ this._setAttributeIfNotExists(child, 'role', 'tab');
8007
+ this._setInitialAttributesOnTargetPanel(child);
8008
+ }
8009
+ _setInitialAttributesOnTargetPanel(child) {
8010
+ const target = getElementFromSelector(child);
8011
+ if (!target) {
8012
+ return;
7875
8013
  }
7876
- reflow(element);
7877
- if (element.classList.contains(CLASS_NAME_FADE$1)) {
7878
- element.classList.add(CLASS_NAME_SHOW$1);
8014
+ this._setAttributeIfNotExists(target, 'role', 'tabpanel');
8015
+ if (child.id) {
8016
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
7879
8017
  }
7880
- let parent = element.parentNode;
7881
- if (parent && parent.nodeName === 'LI') {
7882
- parent = parent.parentNode;
8018
+ }
8019
+ _toggleDropDown(element, open) {
8020
+ const outerElem = this._getOuterElement(element);
8021
+ if (!outerElem.classList.contains(CLASS_DROPDOWN)) {
8022
+ return;
7883
8023
  }
7884
- if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
7885
- const dropdownElement = element.closest(SELECTOR_DROPDOWN);
7886
- if (dropdownElement) {
7887
- SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
8024
+ const toggle = (selector, className) => {
8025
+ const element = SelectorEngine.findOne(selector, outerElem);
8026
+ if (element) {
8027
+ element.classList.toggle(className, open);
7888
8028
  }
7889
- element.setAttribute('aria-expanded', true);
7890
- }
7891
- if (callback) {
7892
- callback();
8029
+ };
8030
+ toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE);
8031
+ toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1);
8032
+ toggle(SELECTOR_DROPDOWN_ITEM, CLASS_NAME_ACTIVE);
8033
+ outerElem.setAttribute('aria-expanded', open);
8034
+ }
8035
+ _setAttributeIfNotExists(element, attribute, value) {
8036
+ if (!element.hasAttribute(attribute)) {
8037
+ element.setAttribute(attribute, value);
7893
8038
  }
7894
8039
  }
8040
+ _elemIsActive(elem) {
8041
+ return elem.classList.contains(CLASS_NAME_ACTIVE);
8042
+ }
8043
+ _getInnerElement(elem) {
8044
+ return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem);
8045
+ }
8046
+ _getOuterElement(elem) {
8047
+ return elem.closest(SELECTOR_OUTER) || elem;
8048
+ }
7895
8049
  static jQueryInterface(config) {
7896
8050
  return this.each(function () {
7897
8051
  const data = Tab.getOrCreateInstance(this);
7898
- if (typeof config === 'string') {
7899
- if (typeof data[config] === 'undefined') {
7900
- throw new TypeError(`No method named "${config}"`);
7901
- }
7902
- data[config]();
8052
+ if (typeof config !== 'string') {
8053
+ return;
7903
8054
  }
8055
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
8056
+ throw new TypeError(`No method named "${config}"`);
8057
+ }
8058
+ data[config]();
7904
8059
  });
7905
8060
  }
7906
8061
  }
@@ -7911,8 +8066,12 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
7911
8066
  if (isDisabled(this)) {
7912
8067
  return;
7913
8068
  }
7914
- const data = Tab.getOrCreateInstance(this);
7915
- data.show();
8069
+ Tab.getOrCreateInstance(this).show();
8070
+ });
8071
+ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
8072
+ for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) {
8073
+ Tab.getOrCreateInstance(element);
8074
+ }
7916
8075
  });
7917
8076
  defineJQueryPlugin(Tab);
7918
8077
  const NAME = 'toast';
@@ -7942,19 +8101,18 @@ const Default = {
7942
8101
  };
7943
8102
  class Toast extends BaseComponent {
7944
8103
  constructor(element, config) {
7945
- super(element);
7946
- this._config = this._getConfig(config);
8104
+ super(element, config);
7947
8105
  this._timeout = null;
7948
8106
  this._hasMouseInteraction = false;
7949
8107
  this._hasKeyboardInteraction = false;
7950
8108
  this._setListeners();
7951
8109
  }
7952
- static get DefaultType() {
7953
- return DefaultType;
7954
- }
7955
8110
  static get Default() {
7956
8111
  return Default;
7957
8112
  }
8113
+ static get DefaultType() {
8114
+ return DefaultType;
8115
+ }
7958
8116
  static get NAME() {
7959
8117
  return NAME;
7960
8118
  }
@@ -7974,12 +8132,11 @@ class Toast extends BaseComponent {
7974
8132
  };
7975
8133
  this._element.classList.remove(CLASS_NAME_HIDE);
7976
8134
  reflow(this._element);
7977
- this._element.classList.add(CLASS_NAME_SHOW);
7978
- this._element.classList.add(CLASS_NAME_SHOWING);
8135
+ this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING);
7979
8136
  this._queueCallback(complete, this._element, this._config.animation);
7980
8137
  }
7981
8138
  hide() {
7982
- if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
8139
+ if (!this.isShown()) {
7983
8140
  return;
7984
8141
  }
7985
8142
  const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
@@ -7988,8 +8145,7 @@ class Toast extends BaseComponent {
7988
8145
  }
7989
8146
  const complete = () => {
7990
8147
  this._element.classList.add(CLASS_NAME_HIDE);
7991
- this._element.classList.remove(CLASS_NAME_SHOWING);
7992
- this._element.classList.remove(CLASS_NAME_SHOW);
8148
+ this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW);
7993
8149
  EventHandler.trigger(this._element, EVENT_HIDDEN);
7994
8150
  };
7995
8151
  this._element.classList.add(CLASS_NAME_SHOWING);
@@ -7997,18 +8153,13 @@ class Toast extends BaseComponent {
7997
8153
  }
7998
8154
  dispose() {
7999
8155
  this._clearTimeout();
8000
- if (this._element.classList.contains(CLASS_NAME_SHOW)) {
8156
+ if (this.isShown()) {
8001
8157
  this._element.classList.remove(CLASS_NAME_SHOW);
8002
8158
  }
8003
8159
  super.dispose();
8004
8160
  }
8005
- _getConfig(config) {
8006
- config = { ...Default,
8007
- ...Manipulator.getDataAttributes(this._element),
8008
- ...(typeof config === 'object' && config ? config : {})
8009
- };
8010
- typeCheckConfig(NAME, config, this.constructor.DefaultType);
8011
- return config;
8161
+ isShown() {
8162
+ return this._element.classList.contains(CLASS_NAME_SHOW);
8012
8163
  }
8013
8164
  _maybeScheduleHide() {
8014
8165
  if (!this._config.autohide) {