bootstrap 4.6.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap/alert.js +192 -112
  5. data/assets/javascripts/bootstrap/base-component.js +63 -0
  6. data/assets/javascripts/bootstrap/button.js +96 -176
  7. data/assets/javascripts/bootstrap/carousel.js +470 -355
  8. data/assets/javascripts/bootstrap/collapse.js +377 -221
  9. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  13. data/assets/javascripts/bootstrap/dropdown.js +470 -351
  14. data/assets/javascripts/bootstrap/modal.js +611 -435
  15. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  16. data/assets/javascripts/bootstrap/popover.js +137 -165
  17. data/assets/javascripts/bootstrap/scrollspy.js +249 -191
  18. data/assets/javascripts/bootstrap/tab.js +241 -141
  19. data/assets/javascripts/bootstrap/toast.js +221 -153
  20. data/assets/javascripts/bootstrap/tooltip.js +649 -483
  21. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  22. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  23. data/assets/javascripts/bootstrap-sprockets.js +14 -7
  24. data/assets/javascripts/bootstrap.js +3272 -2586
  25. data/assets/javascripts/bootstrap.min.js +2 -2
  26. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  27. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  28. data/assets/stylesheets/_bootstrap.scss +16 -8
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
  35. data/assets/stylesheets/bootstrap/_card.scss +20 -91
  36. data/assets/stylesheets/bootstrap/_carousel.scss +64 -35
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  41. data/assets/stylesheets/bootstrap/_functions.scss +84 -69
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  45. data/assets/stylesheets/bootstrap/_list-group.scss +28 -8
  46. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  47. data/assets/stylesheets/bootstrap/_modal.scss +45 -57
  48. data/assets/stylesheets/bootstrap/_nav.scss +23 -4
  49. data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
  50. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  51. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  52. data/assets/stylesheets/bootstrap/_popover.scss +24 -36
  53. data/assets/stylesheets/bootstrap/_progress.scss +5 -4
  54. data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
  55. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  56. data/assets/stylesheets/bootstrap/_spinners.scss +9 -5
  57. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  58. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  59. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  60. data/assets/stylesheets/bootstrap/_transitions.scss +2 -1
  61. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  62. data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
  63. data/assets/stylesheets/bootstrap/_variables.scss +801 -485
  64. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  65. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  71. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  72. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  73. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  74. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  75. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  76. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  77. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  78. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  79. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  80. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  81. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  82. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  83. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  84. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  85. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
  86. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  87. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  88. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  89. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  90. data/assets/stylesheets/bootstrap/mixins/_forms.scss +39 -97
  91. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  92. data/assets/stylesheets/bootstrap/mixins/_grid.scss +90 -34
  93. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  94. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  95. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  96. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  97. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  98. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  99. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  100. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  101. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  102. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  103. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +214 -130
  104. data/bootstrap.gemspec +1 -3
  105. data/lib/bootstrap/version.rb +2 -2
  106. data/tasks/updater/js.rb +20 -5
  107. data/tasks/updater/network.rb +7 -1
  108. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  109. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  110. data/test/dummy_rails/app/views/pages/root.html +89 -0
  111. data/test/dummy_rails/config/application.rb +0 -3
  112. data/test/gemfiles/rails_6_1.gemfile +7 -0
  113. metadata +45 -73
  114. data/assets/javascripts/bootstrap/util.js +0 -189
  115. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  116. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  117. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  118. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  119. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  120. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  121. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  122. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  123. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  124. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  125. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  126. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  128. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  129. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  130. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  131. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  132. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  133. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  134. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  135. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  136. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  137. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  138. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  139. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  140. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  141. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  142. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  143. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  144. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  145. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  146. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  147. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  148. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  149. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  150. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,63 +1,245 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v4.6.1 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.0 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
- })(this, (function ($, Popper, Util) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
+ }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
16
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
17
-
18
- function _defineProperties(target, props) {
19
- for (var i = 0; i < props.length; i++) {
20
- var descriptor = props[i];
21
- descriptor.enumerable = descriptor.enumerable || false;
22
- descriptor.configurable = true;
23
- if ("value" in descriptor) descriptor.writable = true;
24
- Object.defineProperty(target, descriptor.key, descriptor);
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return e[k];
25
+ }
26
+ });
27
+ }
28
+ });
25
29
  }
30
+ n['default'] = e;
31
+ return Object.freeze(n);
26
32
  }
27
33
 
28
- function _createClass(Constructor, protoProps, staticProps) {
29
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
30
- if (staticProps) _defineProperties(Constructor, staticProps);
31
- return Constructor;
32
- }
34
+ var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
+ var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
39
+ var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
33
40
 
34
- function _extends() {
35
- _extends = Object.assign || function (target) {
36
- for (var i = 1; i < arguments.length; i++) {
37
- var source = arguments[i];
41
+ /**
42
+ * --------------------------------------------------------------------------
43
+ * Bootstrap (v5.0.0): util/index.js
44
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
45
+ * --------------------------------------------------------------------------
46
+ */
47
+ const MAX_UID = 1000000;
48
+ const MILLISECONDS_MULTIPLIER = 1000;
49
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
38
50
 
39
- for (var key in source) {
40
- if (Object.prototype.hasOwnProperty.call(source, key)) {
41
- target[key] = source[key];
42
- }
43
- }
51
+ const toType = obj => {
52
+ if (obj === null || obj === undefined) {
53
+ return `${obj}`;
54
+ }
55
+
56
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
57
+ };
58
+ /**
59
+ * --------------------------------------------------------------------------
60
+ * Public Util Api
61
+ * --------------------------------------------------------------------------
62
+ */
63
+
64
+
65
+ const getUID = prefix => {
66
+ do {
67
+ prefix += Math.floor(Math.random() * MAX_UID);
68
+ } while (document.getElementById(prefix));
69
+
70
+ return prefix;
71
+ };
72
+
73
+ const getTransitionDurationFromElement = element => {
74
+ if (!element) {
75
+ return 0;
76
+ } // Get transition-duration of the element
77
+
78
+
79
+ let {
80
+ transitionDuration,
81
+ transitionDelay
82
+ } = window.getComputedStyle(element);
83
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
84
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
85
+
86
+ if (!floatTransitionDuration && !floatTransitionDelay) {
87
+ return 0;
88
+ } // If multiple durations are defined, take the first
89
+
90
+
91
+ transitionDuration = transitionDuration.split(',')[0];
92
+ transitionDelay = transitionDelay.split(',')[0];
93
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
94
+ };
95
+
96
+ const triggerTransitionEnd = element => {
97
+ element.dispatchEvent(new Event(TRANSITION_END));
98
+ };
99
+
100
+ const isElement = obj => (obj[0] || obj).nodeType;
101
+
102
+ const emulateTransitionEnd = (element, duration) => {
103
+ let called = false;
104
+ const durationPadding = 5;
105
+ const emulatedDuration = duration + durationPadding;
106
+
107
+ function listener() {
108
+ called = true;
109
+ element.removeEventListener(TRANSITION_END, listener);
110
+ }
111
+
112
+ element.addEventListener(TRANSITION_END, listener);
113
+ setTimeout(() => {
114
+ if (!called) {
115
+ triggerTransitionEnd(element);
44
116
  }
117
+ }, emulatedDuration);
118
+ };
45
119
 
46
- return target;
47
- };
120
+ const typeCheckConfig = (componentName, config, configTypes) => {
121
+ Object.keys(configTypes).forEach(property => {
122
+ const expectedTypes = configTypes[property];
123
+ const value = config[property];
124
+ const valueType = value && isElement(value) ? 'element' : toType(value);
48
125
 
49
- return _extends.apply(this, arguments);
50
- }
126
+ if (!new RegExp(expectedTypes).test(valueType)) {
127
+ throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
128
+ }
129
+ });
130
+ };
131
+
132
+ const findShadowRoot = element => {
133
+ if (!document.documentElement.attachShadow) {
134
+ return null;
135
+ } // Can find the shadow root otherwise it'll return the document
136
+
137
+
138
+ if (typeof element.getRootNode === 'function') {
139
+ const root = element.getRootNode();
140
+ return root instanceof ShadowRoot ? root : null;
141
+ }
142
+
143
+ if (element instanceof ShadowRoot) {
144
+ return element;
145
+ } // when we don't find a shadow root
146
+
147
+
148
+ if (!element.parentNode) {
149
+ return null;
150
+ }
151
+
152
+ return findShadowRoot(element.parentNode);
153
+ };
154
+
155
+ const noop = () => {};
156
+
157
+ const getjQuery = () => {
158
+ const {
159
+ jQuery
160
+ } = window;
161
+
162
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
163
+ return jQuery;
164
+ }
165
+
166
+ return null;
167
+ };
168
+
169
+ const onDOMContentLoaded = callback => {
170
+ if (document.readyState === 'loading') {
171
+ document.addEventListener('DOMContentLoaded', callback);
172
+ } else {
173
+ callback();
174
+ }
175
+ };
176
+
177
+ const isRTL = () => document.documentElement.dir === 'rtl';
178
+
179
+ const defineJQueryPlugin = (name, plugin) => {
180
+ onDOMContentLoaded(() => {
181
+ const $ = getjQuery();
182
+ /* istanbul ignore if */
183
+
184
+ if ($) {
185
+ const JQUERY_NO_CONFLICT = $.fn[name];
186
+ $.fn[name] = plugin.jQueryInterface;
187
+ $.fn[name].Constructor = plugin;
188
+
189
+ $.fn[name].noConflict = () => {
190
+ $.fn[name] = JQUERY_NO_CONFLICT;
191
+ return plugin.jQueryInterface;
192
+ };
193
+ }
194
+ });
195
+ };
51
196
 
52
197
  /**
53
198
  * --------------------------------------------------------------------------
54
- * Bootstrap (v4.6.1): tools/sanitizer.js
199
+ * Bootstrap (v5.0.0): util/sanitizer.js
55
200
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
56
201
  * --------------------------------------------------------------------------
57
202
  */
58
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
59
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
60
- var DefaultWhitelist = {
203
+ const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
204
+ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
205
+ /**
206
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
207
+ *
208
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
209
+ */
210
+
211
+ const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
212
+ /**
213
+ * A pattern that matches safe data URLs. Only matches image, video and audio types.
214
+ *
215
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
216
+ */
217
+
218
+ const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
219
+
220
+ const allowedAttribute = (attr, allowedAttributeList) => {
221
+ const attrName = attr.nodeName.toLowerCase();
222
+
223
+ if (allowedAttributeList.includes(attrName)) {
224
+ if (uriAttrs.has(attrName)) {
225
+ return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
226
+ }
227
+
228
+ return true;
229
+ }
230
+
231
+ const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
232
+
233
+ for (let i = 0, len = regExp.length; i < len; i++) {
234
+ if (regExp[i].test(attrName)) {
235
+ return true;
236
+ }
237
+ }
238
+
239
+ return false;
240
+ };
241
+
242
+ const DefaultAllowlist = {
61
243
  // Global attributes allowed on any supplied element below.
62
244
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
63
245
  a: ['target', 'href', 'title', 'rel'],
@@ -90,47 +272,8 @@
90
272
  u: [],
91
273
  ul: []
92
274
  };
93
- /**
94
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
95
- *
96
- * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
97
- */
98
-
99
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
100
- /**
101
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
102
- *
103
- * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
104
- */
105
-
106
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
107
-
108
- function allowedAttribute(attr, allowedAttributeList) {
109
- var attrName = attr.nodeName.toLowerCase();
110
-
111
- if (allowedAttributeList.indexOf(attrName) !== -1) {
112
- if (uriAttrs.indexOf(attrName) !== -1) {
113
- return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
114
- }
115
-
116
- return true;
117
- }
118
-
119
- var regExp = allowedAttributeList.filter(function (attrRegex) {
120
- return attrRegex instanceof RegExp;
121
- }); // Check if a regular expression validates the attribute.
122
-
123
- for (var i = 0, len = regExp.length; i < len; i++) {
124
- if (regExp[i].test(attrName)) {
125
- return true;
126
- }
127
- }
128
-
129
- return false;
130
- }
131
-
132
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
133
- if (unsafeHtml.length === 0) {
275
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
276
+ if (!unsafeHtml.length) {
134
277
  return unsafeHtml;
135
278
  }
136
279
 
@@ -138,128 +281,130 @@
138
281
  return sanitizeFn(unsafeHtml);
139
282
  }
140
283
 
141
- var domParser = new window.DOMParser();
142
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
143
- var whitelistKeys = Object.keys(whiteList);
144
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
284
+ const domParser = new window.DOMParser();
285
+ const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
286
+ const allowlistKeys = Object.keys(allowList);
287
+ const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
145
288
 
146
- var _loop = function _loop(i, len) {
147
- var el = elements[i];
148
- var elName = el.nodeName.toLowerCase();
289
+ for (let i = 0, len = elements.length; i < len; i++) {
290
+ const el = elements[i];
291
+ const elName = el.nodeName.toLowerCase();
149
292
 
150
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
293
+ if (!allowlistKeys.includes(elName)) {
151
294
  el.parentNode.removeChild(el);
152
- return "continue";
295
+ continue;
153
296
  }
154
297
 
155
- var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread
156
-
157
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
158
- attributeList.forEach(function (attr) {
159
- if (!allowedAttribute(attr, whitelistedAttributes)) {
298
+ const attributeList = [].concat(...el.attributes);
299
+ const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
300
+ attributeList.forEach(attr => {
301
+ if (!allowedAttribute(attr, allowedAttributes)) {
160
302
  el.removeAttribute(attr.nodeName);
161
303
  }
162
304
  });
163
- };
164
-
165
- for (var i = 0, len = elements.length; i < len; i++) {
166
- var _ret = _loop(i);
167
-
168
- if (_ret === "continue") continue;
169
305
  }
170
306
 
171
307
  return createdDocument.body.innerHTML;
172
308
  }
173
309
 
174
310
  /**
311
+ * --------------------------------------------------------------------------
312
+ * Bootstrap (v5.0.0): tooltip.js
313
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
314
+ * --------------------------------------------------------------------------
315
+ */
316
+ /**
317
+ * ------------------------------------------------------------------------
175
318
  * Constants
319
+ * ------------------------------------------------------------------------
176
320
  */
177
321
 
178
- var NAME = 'tooltip';
179
- var VERSION = '4.6.1';
180
- var DATA_KEY = 'bs.tooltip';
181
- var EVENT_KEY = "." + DATA_KEY;
182
- var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
183
- var CLASS_PREFIX = 'bs-tooltip';
184
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
185
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
186
- var CLASS_NAME_FADE = 'fade';
187
- var CLASS_NAME_SHOW = 'show';
188
- var HOVER_STATE_SHOW = 'show';
189
- var HOVER_STATE_OUT = 'out';
190
- var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
191
- var SELECTOR_ARROW = '.arrow';
192
- var TRIGGER_HOVER = 'hover';
193
- var TRIGGER_FOCUS = 'focus';
194
- var TRIGGER_CLICK = 'click';
195
- var TRIGGER_MANUAL = 'manual';
196
- var AttachmentMap = {
322
+ const NAME = 'tooltip';
323
+ const DATA_KEY = 'bs.tooltip';
324
+ const EVENT_KEY = `.${DATA_KEY}`;
325
+ const CLASS_PREFIX = 'bs-tooltip';
326
+ const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
327
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
328
+ const DefaultType = {
329
+ animation: 'boolean',
330
+ template: 'string',
331
+ title: '(string|element|function)',
332
+ trigger: 'string',
333
+ delay: '(number|object)',
334
+ html: 'boolean',
335
+ selector: '(string|boolean)',
336
+ placement: '(string|function)',
337
+ offset: '(array|string|function)',
338
+ container: '(string|element|boolean)',
339
+ fallbackPlacements: 'array',
340
+ boundary: '(string|element)',
341
+ customClass: '(string|function)',
342
+ sanitize: 'boolean',
343
+ sanitizeFn: '(null|function)',
344
+ allowList: 'object',
345
+ popperConfig: '(null|object|function)'
346
+ };
347
+ const AttachmentMap = {
197
348
  AUTO: 'auto',
198
349
  TOP: 'top',
199
- RIGHT: 'right',
350
+ RIGHT: isRTL() ? 'left' : 'right',
200
351
  BOTTOM: 'bottom',
201
- LEFT: 'left'
352
+ LEFT: isRTL() ? 'right' : 'left'
202
353
  };
203
- var Default = {
354
+ const Default = {
204
355
  animation: true,
205
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
356
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
206
357
  trigger: 'hover focus',
207
358
  title: '',
208
359
  delay: 0,
209
360
  html: false,
210
361
  selector: false,
211
362
  placement: 'top',
212
- offset: 0,
363
+ offset: [0, 0],
213
364
  container: false,
214
- fallbackPlacement: 'flip',
215
- boundary: 'scrollParent',
365
+ fallbackPlacements: ['top', 'right', 'bottom', 'left'],
366
+ boundary: 'clippingParents',
216
367
  customClass: '',
217
368
  sanitize: true,
218
369
  sanitizeFn: null,
219
- whiteList: DefaultWhitelist,
370
+ allowList: DefaultAllowlist,
220
371
  popperConfig: null
221
372
  };
222
- var DefaultType = {
223
- animation: 'boolean',
224
- template: 'string',
225
- title: '(string|element|function)',
226
- trigger: 'string',
227
- delay: '(number|object)',
228
- html: 'boolean',
229
- selector: '(string|boolean)',
230
- placement: '(string|function)',
231
- offset: '(number|string|function)',
232
- container: '(string|element|boolean)',
233
- fallbackPlacement: '(string|array)',
234
- boundary: '(string|element)',
235
- customClass: '(string|function)',
236
- sanitize: 'boolean',
237
- sanitizeFn: '(null|function)',
238
- whiteList: 'object',
239
- popperConfig: '(null|object)'
240
- };
241
- var Event = {
242
- HIDE: "hide" + EVENT_KEY,
243
- HIDDEN: "hidden" + EVENT_KEY,
244
- SHOW: "show" + EVENT_KEY,
245
- SHOWN: "shown" + EVENT_KEY,
246
- INSERTED: "inserted" + EVENT_KEY,
247
- CLICK: "click" + EVENT_KEY,
248
- FOCUSIN: "focusin" + EVENT_KEY,
249
- FOCUSOUT: "focusout" + EVENT_KEY,
250
- MOUSEENTER: "mouseenter" + EVENT_KEY,
251
- MOUSELEAVE: "mouseleave" + EVENT_KEY
373
+ const Event$1 = {
374
+ HIDE: `hide${EVENT_KEY}`,
375
+ HIDDEN: `hidden${EVENT_KEY}`,
376
+ SHOW: `show${EVENT_KEY}`,
377
+ SHOWN: `shown${EVENT_KEY}`,
378
+ INSERTED: `inserted${EVENT_KEY}`,
379
+ CLICK: `click${EVENT_KEY}`,
380
+ FOCUSIN: `focusin${EVENT_KEY}`,
381
+ FOCUSOUT: `focusout${EVENT_KEY}`,
382
+ MOUSEENTER: `mouseenter${EVENT_KEY}`,
383
+ MOUSELEAVE: `mouseleave${EVENT_KEY}`
252
384
  };
385
+ const CLASS_NAME_FADE = 'fade';
386
+ const CLASS_NAME_MODAL = 'modal';
387
+ const CLASS_NAME_SHOW = 'show';
388
+ const HOVER_STATE_SHOW = 'show';
389
+ const HOVER_STATE_OUT = 'out';
390
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
391
+ const TRIGGER_HOVER = 'hover';
392
+ const TRIGGER_FOCUS = 'focus';
393
+ const TRIGGER_CLICK = 'click';
394
+ const TRIGGER_MANUAL = 'manual';
253
395
  /**
254
- * Class definition
396
+ * ------------------------------------------------------------------------
397
+ * Class Definition
398
+ * ------------------------------------------------------------------------
255
399
  */
256
400
 
257
- var Tooltip = /*#__PURE__*/function () {
258
- function Tooltip(element, config) {
259
- if (typeof Popper__default["default"] === 'undefined') {
401
+ class Tooltip extends BaseComponent__default['default'] {
402
+ constructor(element, config) {
403
+ if (typeof Popper__namespace === 'undefined') {
260
404
  throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
261
- } // Private
405
+ }
262
406
 
407
+ super(element); // private
263
408
 
264
409
  this._isEnabled = true;
265
410
  this._timeout = 0;
@@ -267,7 +412,6 @@
267
412
  this._activeTrigger = {};
268
413
  this._popper = null; // Protected
269
414
 
270
- this.element = element;
271
415
  this.config = this._getConfig(config);
272
416
  this.tip = null;
273
417
 
@@ -275,34 +419,50 @@
275
419
  } // Getters
276
420
 
277
421
 
278
- var _proto = Tooltip.prototype;
422
+ static get Default() {
423
+ return Default;
424
+ }
425
+
426
+ static get NAME() {
427
+ return NAME;
428
+ }
429
+
430
+ static get DATA_KEY() {
431
+ return DATA_KEY;
432
+ }
433
+
434
+ static get Event() {
435
+ return Event$1;
436
+ }
437
+
438
+ static get EVENT_KEY() {
439
+ return EVENT_KEY;
440
+ }
441
+
442
+ static get DefaultType() {
443
+ return DefaultType;
444
+ } // Public
445
+
279
446
 
280
- // Public
281
- _proto.enable = function enable() {
447
+ enable() {
282
448
  this._isEnabled = true;
283
- };
449
+ }
284
450
 
285
- _proto.disable = function disable() {
451
+ disable() {
286
452
  this._isEnabled = false;
287
- };
453
+ }
288
454
 
289
- _proto.toggleEnabled = function toggleEnabled() {
455
+ toggleEnabled() {
290
456
  this._isEnabled = !this._isEnabled;
291
- };
457
+ }
292
458
 
293
- _proto.toggle = function toggle(event) {
459
+ toggle(event) {
294
460
  if (!this._isEnabled) {
295
461
  return;
296
462
  }
297
463
 
298
464
  if (event) {
299
- var dataKey = this.constructor.DATA_KEY;
300
- var context = $__default["default"](event.currentTarget).data(dataKey);
301
-
302
- if (!context) {
303
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
304
- $__default["default"](event.currentTarget).data(dataKey, context);
305
- }
465
+ const context = this._initializeOnDelegatedTarget(event);
306
466
 
307
467
  context._activeTrigger.click = !context._activeTrigger.click;
308
468
 
@@ -312,7 +472,7 @@
312
472
  context._leave(null, context);
313
473
  }
314
474
  } else {
315
- if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
475
+ if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
316
476
  this._leave(null, this);
317
477
 
318
478
  return;
@@ -320,16 +480,14 @@
320
480
 
321
481
  this._enter(null, this);
322
482
  }
323
- };
483
+ }
324
484
 
325
- _proto.dispose = function dispose() {
485
+ dispose() {
326
486
  clearTimeout(this._timeout);
327
- $__default["default"].removeData(this.element, this.constructor.DATA_KEY);
328
- $__default["default"](this.element).off(this.constructor.EVENT_KEY);
329
- $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
487
+ EventHandler__default['default'].off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
330
488
 
331
- if (this.tip) {
332
- $__default["default"](this.tip).remove();
489
+ if (this.tip && this.tip.parentNode) {
490
+ this.tip.parentNode.removeChild(this.tip);
333
491
  }
334
492
 
335
493
  this._isEnabled = null;
@@ -342,176 +500,200 @@
342
500
  }
343
501
 
344
502
  this._popper = null;
345
- this.element = null;
346
503
  this.config = null;
347
504
  this.tip = null;
348
- };
349
-
350
- _proto.show = function show() {
351
- var _this = this;
505
+ super.dispose();
506
+ }
352
507
 
353
- if ($__default["default"](this.element).css('display') === 'none') {
508
+ show() {
509
+ if (this._element.style.display === 'none') {
354
510
  throw new Error('Please use show on visible elements');
355
511
  }
356
512
 
357
- var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);
513
+ if (!(this.isWithContent() && this._isEnabled)) {
514
+ return;
515
+ }
358
516
 
359
- if (this.isWithContent() && this._isEnabled) {
360
- $__default["default"](this.element).trigger(showEvent);
361
- var shadowRoot = Util__default["default"].findShadowRoot(this.element);
362
- var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
517
+ const showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
518
+ const shadowRoot = findShadowRoot(this._element);
519
+ const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
363
520
 
364
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
365
- return;
366
- }
521
+ if (showEvent.defaultPrevented || !isInTheDom) {
522
+ return;
523
+ }
367
524
 
368
- var tip = this.getTipElement();
369
- var tipId = Util__default["default"].getUID(this.constructor.NAME);
370
- tip.setAttribute('id', tipId);
371
- this.element.setAttribute('aria-describedby', tipId);
372
- this.setContent();
525
+ const tip = this.getTipElement();
526
+ const tipId = getUID(this.constructor.NAME);
527
+ tip.setAttribute('id', tipId);
373
528
 
374
- if (this.config.animation) {
375
- $__default["default"](tip).addClass(CLASS_NAME_FADE);
376
- }
529
+ this._element.setAttribute('aria-describedby', tipId);
377
530
 
378
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
531
+ this.setContent();
379
532
 
380
- var attachment = this._getAttachment(placement);
533
+ if (this.config.animation) {
534
+ tip.classList.add(CLASS_NAME_FADE);
535
+ }
381
536
 
382
- this.addAttachmentClass(attachment);
537
+ const placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
383
538
 
384
- var container = this._getContainer();
539
+ const attachment = this._getAttachment(placement);
385
540
 
386
- $__default["default"](tip).data(this.constructor.DATA_KEY, this);
541
+ this._addAttachmentClass(attachment);
387
542
 
388
- if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {
389
- $__default["default"](tip).appendTo(container);
390
- }
543
+ const container = this._getContainer();
391
544
 
392
- $__default["default"](this.element).trigger(this.constructor.Event.INSERTED);
393
- this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment));
394
- $__default["default"](tip).addClass(CLASS_NAME_SHOW);
395
- $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra
396
- // empty mouseover listeners to the body's immediate children;
397
- // only needed because of broken event delegation on iOS
398
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
545
+ Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
399
546
 
400
- if ('ontouchstart' in document.documentElement) {
401
- $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);
402
- }
547
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
548
+ container.appendChild(tip);
549
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
550
+ }
403
551
 
404
- var complete = function complete() {
405
- if (_this.config.animation) {
406
- _this._fixTransition();
407
- }
552
+ if (this._popper) {
553
+ this._popper.update();
554
+ } else {
555
+ this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
556
+ }
408
557
 
409
- var prevHoverState = _this._hoverState;
410
- _this._hoverState = null;
411
- $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);
558
+ tip.classList.add(CLASS_NAME_SHOW);
559
+ const customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
412
560
 
413
- if (prevHoverState === HOVER_STATE_OUT) {
414
- _this._leave(null, _this);
415
- }
416
- };
561
+ if (customClass) {
562
+ tip.classList.add(...customClass.split(' '));
563
+ } // If this is a touch-enabled device we add extra
564
+ // empty mouseover listeners to the body's immediate children;
565
+ // only needed because of broken event delegation on iOS
566
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
417
567
 
418
- if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
419
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this.tip);
420
- $__default["default"](this.tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
421
- } else {
422
- complete();
568
+
569
+ if ('ontouchstart' in document.documentElement) {
570
+ [].concat(...document.body.children).forEach(element => {
571
+ EventHandler__default['default'].on(element, 'mouseover', noop);
572
+ });
573
+ }
574
+
575
+ const complete = () => {
576
+ const prevHoverState = this._hoverState;
577
+ this._hoverState = null;
578
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOWN);
579
+
580
+ if (prevHoverState === HOVER_STATE_OUT) {
581
+ this._leave(null, this);
423
582
  }
583
+ };
584
+
585
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
586
+ const transitionDuration = getTransitionDurationFromElement(this.tip);
587
+ EventHandler__default['default'].one(this.tip, 'transitionend', complete);
588
+ emulateTransitionEnd(this.tip, transitionDuration);
589
+ } else {
590
+ complete();
424
591
  }
425
- };
592
+ }
426
593
 
427
- _proto.hide = function hide(callback) {
428
- var _this2 = this;
594
+ hide() {
595
+ if (!this._popper) {
596
+ return;
597
+ }
429
598
 
430
- var tip = this.getTipElement();
431
- var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);
599
+ const tip = this.getTipElement();
432
600
 
433
- var complete = function complete() {
434
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
601
+ const complete = () => {
602
+ if (this._isWithActiveTrigger()) {
603
+ return;
604
+ }
605
+
606
+ if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
435
607
  tip.parentNode.removeChild(tip);
436
608
  }
437
609
 
438
- _this2._cleanTipClass();
610
+ this._cleanTipClass();
439
611
 
440
- _this2.element.removeAttribute('aria-describedby');
612
+ this._element.removeAttribute('aria-describedby');
441
613
 
442
- $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
614
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDDEN);
443
615
 
444
- if (_this2._popper !== null) {
445
- _this2._popper.destroy();
446
- }
616
+ if (this._popper) {
617
+ this._popper.destroy();
447
618
 
448
- if (callback) {
449
- callback();
619
+ this._popper = null;
450
620
  }
451
621
  };
452
622
 
453
- $__default["default"](this.element).trigger(hideEvent);
623
+ const hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
454
624
 
455
- if (hideEvent.isDefaultPrevented()) {
625
+ if (hideEvent.defaultPrevented) {
456
626
  return;
457
627
  }
458
628
 
459
- $__default["default"](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
629
+ tip.classList.remove(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
460
630
  // empty mouseover listeners we added for iOS support
461
631
 
462
632
  if ('ontouchstart' in document.documentElement) {
463
- $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);
633
+ [].concat(...document.body.children).forEach(element => EventHandler__default['default'].off(element, 'mouseover', noop));
464
634
  }
465
635
 
466
636
  this._activeTrigger[TRIGGER_CLICK] = false;
467
637
  this._activeTrigger[TRIGGER_FOCUS] = false;
468
638
  this._activeTrigger[TRIGGER_HOVER] = false;
469
639
 
470
- if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
471
- var transitionDuration = Util__default["default"].getTransitionDurationFromElement(tip);
472
- $__default["default"](tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
640
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
641
+ const transitionDuration = getTransitionDurationFromElement(tip);
642
+ EventHandler__default['default'].one(tip, 'transitionend', complete);
643
+ emulateTransitionEnd(tip, transitionDuration);
473
644
  } else {
474
645
  complete();
475
646
  }
476
647
 
477
648
  this._hoverState = '';
478
- };
649
+ }
479
650
 
480
- _proto.update = function update() {
651
+ update() {
481
652
  if (this._popper !== null) {
482
- this._popper.scheduleUpdate();
653
+ this._popper.update();
483
654
  }
484
655
  } // Protected
485
- ;
486
656
 
487
- _proto.isWithContent = function isWithContent() {
657
+
658
+ isWithContent() {
488
659
  return Boolean(this.getTitle());
489
- };
660
+ }
490
661
 
491
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
492
- $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
493
- };
662
+ getTipElement() {
663
+ if (this.tip) {
664
+ return this.tip;
665
+ }
494
666
 
495
- _proto.getTipElement = function getTipElement() {
496
- this.tip = this.tip || $__default["default"](this.config.template)[0];
667
+ const element = document.createElement('div');
668
+ element.innerHTML = this.config.template;
669
+ this.tip = element.children[0];
497
670
  return this.tip;
498
- };
671
+ }
672
+
673
+ setContent() {
674
+ const tip = this.getTipElement();
675
+ this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
676
+ tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
677
+ }
678
+
679
+ setElementContent(element, content) {
680
+ if (element === null) {
681
+ return;
682
+ }
683
+
684
+ if (typeof content === 'object' && isElement(content)) {
685
+ if (content.jquery) {
686
+ content = content[0];
687
+ } // content is a DOM node or a jQuery
499
688
 
500
- _proto.setContent = function setContent() {
501
- var tip = this.getTipElement();
502
- this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
503
- $__default["default"](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
504
- };
505
689
 
506
- _proto.setElementContent = function setElementContent($element, content) {
507
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
508
- // Content is a DOM node or a jQuery
509
690
  if (this.config.html) {
510
- if (!$__default["default"](content).parent().is($element)) {
511
- $element.empty().append(content);
691
+ if (content.parentNode !== element) {
692
+ element.innerHTML = '';
693
+ element.appendChild(content);
512
694
  }
513
695
  } else {
514
- $element.text($__default["default"](content).text());
696
+ element.textContent = content.textContent;
515
697
  }
516
698
 
517
699
  return;
@@ -519,149 +701,181 @@
519
701
 
520
702
  if (this.config.html) {
521
703
  if (this.config.sanitize) {
522
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
704
+ content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
523
705
  }
524
706
 
525
- $element.html(content);
707
+ element.innerHTML = content;
526
708
  } else {
527
- $element.text(content);
709
+ element.textContent = content;
528
710
  }
529
- };
711
+ }
530
712
 
531
- _proto.getTitle = function getTitle() {
532
- var title = this.element.getAttribute('data-original-title');
713
+ getTitle() {
714
+ let title = this._element.getAttribute('data-bs-original-title');
533
715
 
534
716
  if (!title) {
535
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
717
+ title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
536
718
  }
537
719
 
538
720
  return title;
721
+ }
722
+
723
+ updateAttachment(attachment) {
724
+ if (attachment === 'right') {
725
+ return 'end';
726
+ }
727
+
728
+ if (attachment === 'left') {
729
+ return 'start';
730
+ }
731
+
732
+ return attachment;
539
733
  } // Private
540
- ;
541
734
 
542
- _proto._getPopperConfig = function _getPopperConfig(attachment) {
543
- var _this3 = this;
544
735
 
545
- var defaultBsConfig = {
546
- placement: attachment,
547
- modifiers: {
548
- offset: this._getOffset(),
549
- flip: {
550
- behavior: this.config.fallbackPlacement
551
- },
552
- arrow: {
553
- element: SELECTOR_ARROW
554
- },
555
- preventOverflow: {
556
- boundariesElement: this.config.boundary
557
- }
558
- },
559
- onCreate: function onCreate(data) {
560
- if (data.originalPlacement !== data.placement) {
561
- _this3._handlePopperPlacementChange(data);
562
- }
563
- },
564
- onUpdate: function onUpdate(data) {
565
- return _this3._handlePopperPlacementChange(data);
566
- }
567
- };
568
- return _extends({}, defaultBsConfig, this.config.popperConfig);
569
- };
736
+ _initializeOnDelegatedTarget(event, context) {
737
+ const dataKey = this.constructor.DATA_KEY;
738
+ context = context || Data__default['default'].get(event.delegateTarget, dataKey);
570
739
 
571
- _proto._getOffset = function _getOffset() {
572
- var _this4 = this;
740
+ if (!context) {
741
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
742
+ Data__default['default'].set(event.delegateTarget, dataKey, context);
743
+ }
573
744
 
574
- var offset = {};
745
+ return context;
746
+ }
575
747
 
576
- if (typeof this.config.offset === 'function') {
577
- offset.fn = function (data) {
578
- data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));
579
- return data;
580
- };
581
- } else {
582
- offset.offset = this.config.offset;
748
+ _getOffset() {
749
+ const {
750
+ offset
751
+ } = this.config;
752
+
753
+ if (typeof offset === 'string') {
754
+ return offset.split(',').map(val => Number.parseInt(val, 10));
755
+ }
756
+
757
+ if (typeof offset === 'function') {
758
+ return popperData => offset(popperData, this._element);
583
759
  }
584
760
 
585
761
  return offset;
586
- };
762
+ }
587
763
 
588
- _proto._getContainer = function _getContainer() {
764
+ _getPopperConfig(attachment) {
765
+ const defaultBsPopperConfig = {
766
+ placement: attachment,
767
+ modifiers: [{
768
+ name: 'flip',
769
+ options: {
770
+ fallbackPlacements: this.config.fallbackPlacements
771
+ }
772
+ }, {
773
+ name: 'offset',
774
+ options: {
775
+ offset: this._getOffset()
776
+ }
777
+ }, {
778
+ name: 'preventOverflow',
779
+ options: {
780
+ boundary: this.config.boundary
781
+ }
782
+ }, {
783
+ name: 'arrow',
784
+ options: {
785
+ element: `.${this.constructor.NAME}-arrow`
786
+ }
787
+ }, {
788
+ name: 'onChange',
789
+ enabled: true,
790
+ phase: 'afterWrite',
791
+ fn: data => this._handlePopperPlacementChange(data)
792
+ }],
793
+ onFirstUpdate: data => {
794
+ if (data.options.placement !== data.placement) {
795
+ this._handlePopperPlacementChange(data);
796
+ }
797
+ }
798
+ };
799
+ return { ...defaultBsPopperConfig,
800
+ ...(typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig)
801
+ };
802
+ }
803
+
804
+ _addAttachmentClass(attachment) {
805
+ this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
806
+ }
807
+
808
+ _getContainer() {
589
809
  if (this.config.container === false) {
590
810
  return document.body;
591
811
  }
592
812
 
593
- if (Util__default["default"].isElement(this.config.container)) {
594
- return $__default["default"](this.config.container);
813
+ if (isElement(this.config.container)) {
814
+ return this.config.container;
595
815
  }
596
816
 
597
- return $__default["default"](document).find(this.config.container);
598
- };
817
+ return SelectorEngine__default['default'].findOne(this.config.container);
818
+ }
599
819
 
600
- _proto._getAttachment = function _getAttachment(placement) {
820
+ _getAttachment(placement) {
601
821
  return AttachmentMap[placement.toUpperCase()];
602
- };
603
-
604
- _proto._setListeners = function _setListeners() {
605
- var _this5 = this;
822
+ }
606
823
 
607
- var triggers = this.config.trigger.split(' ');
608
- triggers.forEach(function (trigger) {
824
+ _setListeners() {
825
+ const triggers = this.config.trigger.split(' ');
826
+ triggers.forEach(trigger => {
609
827
  if (trigger === 'click') {
610
- $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
611
- return _this5.toggle(event);
612
- });
828
+ EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this.config.selector, event => this.toggle(event));
613
829
  } else if (trigger !== TRIGGER_MANUAL) {
614
- var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
615
- var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
616
- $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {
617
- return _this5._enter(event);
618
- }).on(eventOut, _this5.config.selector, function (event) {
619
- return _this5._leave(event);
620
- });
830
+ const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
831
+ const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
832
+ EventHandler__default['default'].on(this._element, eventIn, this.config.selector, event => this._enter(event));
833
+ EventHandler__default['default'].on(this._element, eventOut, this.config.selector, event => this._leave(event));
621
834
  }
622
835
  });
623
836
 
624
- this._hideModalHandler = function () {
625
- if (_this5.element) {
626
- _this5.hide();
837
+ this._hideModalHandler = () => {
838
+ if (this._element) {
839
+ this.hide();
627
840
  }
628
841
  };
629
842
 
630
- $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
843
+ EventHandler__default['default'].on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
631
844
 
632
845
  if (this.config.selector) {
633
- this.config = _extends({}, this.config, {
846
+ this.config = { ...this.config,
634
847
  trigger: 'manual',
635
848
  selector: ''
636
- });
849
+ };
637
850
  } else {
638
851
  this._fixTitle();
639
852
  }
640
- };
853
+ }
641
854
 
642
- _proto._fixTitle = function _fixTitle() {
643
- var titleType = typeof this.element.getAttribute('data-original-title');
855
+ _fixTitle() {
856
+ const title = this._element.getAttribute('title');
644
857
 
645
- if (this.element.getAttribute('title') || titleType !== 'string') {
646
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
647
- this.element.setAttribute('title', '');
648
- }
649
- };
858
+ const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
650
859
 
651
- _proto._enter = function _enter(event, context) {
652
- var dataKey = this.constructor.DATA_KEY;
653
- context = context || $__default["default"](event.currentTarget).data(dataKey);
860
+ if (title || originalTitleType !== 'string') {
861
+ this._element.setAttribute('data-bs-original-title', title || '');
654
862
 
655
- if (!context) {
656
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
657
- $__default["default"](event.currentTarget).data(dataKey, context);
863
+ if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
864
+ this._element.setAttribute('aria-label', title);
865
+ }
866
+
867
+ this._element.setAttribute('title', '');
658
868
  }
869
+ }
870
+
871
+ _enter(event, context) {
872
+ context = this._initializeOnDelegatedTarget(event, context);
659
873
 
660
874
  if (event) {
661
875
  context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
662
876
  }
663
877
 
664
- if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
878
+ if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
665
879
  context._hoverState = HOVER_STATE_SHOW;
666
880
  return;
667
881
  }
@@ -674,24 +888,18 @@
674
888
  return;
675
889
  }
676
890
 
677
- context._timeout = setTimeout(function () {
891
+ context._timeout = setTimeout(() => {
678
892
  if (context._hoverState === HOVER_STATE_SHOW) {
679
893
  context.show();
680
894
  }
681
895
  }, context.config.delay.show);
682
- };
683
-
684
- _proto._leave = function _leave(event, context) {
685
- var dataKey = this.constructor.DATA_KEY;
686
- context = context || $__default["default"](event.currentTarget).data(dataKey);
896
+ }
687
897
 
688
- if (!context) {
689
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
690
- $__default["default"](event.currentTarget).data(dataKey, context);
691
- }
898
+ _leave(event, context) {
899
+ context = this._initializeOnDelegatedTarget(event, context);
692
900
 
693
901
  if (event) {
694
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
902
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
695
903
  }
696
904
 
697
905
  if (context._isWithActiveTrigger()) {
@@ -706,31 +914,39 @@
706
914
  return;
707
915
  }
708
916
 
709
- context._timeout = setTimeout(function () {
917
+ context._timeout = setTimeout(() => {
710
918
  if (context._hoverState === HOVER_STATE_OUT) {
711
919
  context.hide();
712
920
  }
713
921
  }, context.config.delay.hide);
714
- };
922
+ }
715
923
 
716
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
717
- for (var trigger in this._activeTrigger) {
924
+ _isWithActiveTrigger() {
925
+ for (const trigger in this._activeTrigger) {
718
926
  if (this._activeTrigger[trigger]) {
719
927
  return true;
720
928
  }
721
929
  }
722
930
 
723
931
  return false;
724
- };
932
+ }
725
933
 
726
- _proto._getConfig = function _getConfig(config) {
727
- var dataAttributes = $__default["default"](this.element).data();
728
- Object.keys(dataAttributes).forEach(function (dataAttr) {
729
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
934
+ _getConfig(config) {
935
+ const dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
936
+ Object.keys(dataAttributes).forEach(dataAttr => {
937
+ if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
730
938
  delete dataAttributes[dataAttr];
731
939
  }
732
940
  });
733
- config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
941
+
942
+ if (config && typeof config.container === 'object' && config.container.jquery) {
943
+ config.container = config.container[0];
944
+ }
945
+
946
+ config = { ...this.constructor.Default,
947
+ ...dataAttributes,
948
+ ...(typeof config === 'object' && config ? config : {})
949
+ };
734
950
 
735
951
  if (typeof config.delay === 'number') {
736
952
  config.delay = {
@@ -747,20 +963,20 @@
747
963
  config.content = config.content.toString();
748
964
  }
749
965
 
750
- Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
966
+ typeCheckConfig(NAME, config, this.constructor.DefaultType);
751
967
 
752
968
  if (config.sanitize) {
753
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
969
+ config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
754
970
  }
755
971
 
756
972
  return config;
757
- };
973
+ }
758
974
 
759
- _proto._getDelegateConfig = function _getDelegateConfig() {
760
- var config = {};
975
+ _getDelegateConfig() {
976
+ const config = {};
761
977
 
762
978
  if (this.config) {
763
- for (var key in this.config) {
979
+ for (const key in this.config) {
764
980
  if (this.constructor.Default[key] !== this.config[key]) {
765
981
  config[key] = this.config[key];
766
982
  }
@@ -768,47 +984,39 @@
768
984
  }
769
985
 
770
986
  return config;
771
- };
987
+ }
772
988
 
773
- _proto._cleanTipClass = function _cleanTipClass() {
774
- var $tip = $__default["default"](this.getTipElement());
775
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
989
+ _cleanTipClass() {
990
+ const tip = this.getTipElement();
991
+ const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
776
992
 
777
- if (tabClass !== null && tabClass.length) {
778
- $tip.removeClass(tabClass.join(''));
993
+ if (tabClass !== null && tabClass.length > 0) {
994
+ tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
779
995
  }
780
- };
781
-
782
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
783
- this.tip = popperData.instance.popper;
784
-
785
- this._cleanTipClass();
786
-
787
- this.addAttachmentClass(this._getAttachment(popperData.placement));
788
- };
996
+ }
789
997
 
790
- _proto._fixTransition = function _fixTransition() {
791
- var tip = this.getTipElement();
792
- var initConfigAnimation = this.config.animation;
998
+ _handlePopperPlacementChange(popperData) {
999
+ const {
1000
+ state
1001
+ } = popperData;
793
1002
 
794
- if (tip.getAttribute('x-placement') !== null) {
1003
+ if (!state) {
795
1004
  return;
796
1005
  }
797
1006
 
798
- $__default["default"](tip).removeClass(CLASS_NAME_FADE);
799
- this.config.animation = false;
800
- this.hide();
801
- this.show();
802
- this.config.animation = initConfigAnimation;
1007
+ this.tip = state.elements.popper;
1008
+
1009
+ this._cleanTipClass();
1010
+
1011
+ this._addAttachmentClass(this._getAttachment(state.placement));
803
1012
  } // Static
804
- ;
805
1013
 
806
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
1014
+
1015
+ static jQueryInterface(config) {
807
1016
  return this.each(function () {
808
- var $element = $__default["default"](this);
809
- var data = $element.data(DATA_KEY);
1017
+ let data = Data__default['default'].get(this, DATA_KEY);
810
1018
 
811
- var _config = typeof config === 'object' && config;
1019
+ const _config = typeof config === 'object' && config;
812
1020
 
813
1021
  if (!data && /dispose|hide/.test(config)) {
814
1022
  return;
@@ -816,71 +1024,29 @@
816
1024
 
817
1025
  if (!data) {
818
1026
  data = new Tooltip(this, _config);
819
- $element.data(DATA_KEY, data);
820
1027
  }
821
1028
 
822
1029
  if (typeof config === 'string') {
823
1030
  if (typeof data[config] === 'undefined') {
824
- throw new TypeError("No method named \"" + config + "\"");
1031
+ throw new TypeError(`No method named "${config}"`);
825
1032
  }
826
1033
 
827
1034
  data[config]();
828
1035
  }
829
1036
  });
830
- };
831
-
832
- _createClass(Tooltip, null, [{
833
- key: "VERSION",
834
- get: function get() {
835
- return VERSION;
836
- }
837
- }, {
838
- key: "Default",
839
- get: function get() {
840
- return Default;
841
- }
842
- }, {
843
- key: "NAME",
844
- get: function get() {
845
- return NAME;
846
- }
847
- }, {
848
- key: "DATA_KEY",
849
- get: function get() {
850
- return DATA_KEY;
851
- }
852
- }, {
853
- key: "Event",
854
- get: function get() {
855
- return Event;
856
- }
857
- }, {
858
- key: "EVENT_KEY",
859
- get: function get() {
860
- return EVENT_KEY;
861
- }
862
- }, {
863
- key: "DefaultType",
864
- get: function get() {
865
- return DefaultType;
866
- }
867
- }]);
868
-
869
- return Tooltip;
870
- }();
1037
+ }
1038
+
1039
+ }
871
1040
  /**
1041
+ * ------------------------------------------------------------------------
872
1042
  * jQuery
1043
+ * ------------------------------------------------------------------------
1044
+ * add .Tooltip to jQuery only if jQuery is present
873
1045
  */
874
1046
 
875
1047
 
876
- $__default["default"].fn[NAME] = Tooltip._jQueryInterface;
877
- $__default["default"].fn[NAME].Constructor = Tooltip;
878
-
879
- $__default["default"].fn[NAME].noConflict = function () {
880
- $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
881
- return Tooltip._jQueryInterface;
882
- };
1048
+ defineJQueryPlugin(NAME, Tooltip);
883
1049
 
884
1050
  return Tooltip;
885
1051
 
886
- }));
1052
+ })));