bootstrap.bundle.js 240 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
XhmikosR's avatar
XhmikosR committed
2
  * Bootstrap v5.0.0-alpha2 (https://getbootstrap.com/)
XhmikosR's avatar
XhmikosR committed
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
XhmikosR's avatar
XhmikosR committed
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
Mark Otto's avatar
dist  
Mark Otto committed
5
  */
Mark Otto's avatar
dist    
Mark Otto committed
6
(function (global, factory) {
XhmikosR's avatar
Dist.    
XhmikosR committed
7
8
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
XhmikosR's avatar
XhmikosR committed
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
XhmikosR's avatar
XhmikosR committed
10
}(this, (function () { 'use strict';
Mark Otto's avatar
dist  
Mark Otto committed
11

Mark Otto's avatar
dist    
Mark Otto committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
Mark Otto's avatar
Mark Otto committed
26
27
  }

XhmikosR's avatar
XhmikosR committed
28
29
30
31
  function _extends() {
    _extends = Object.assign || function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
Mark Otto's avatar
dist    
Mark Otto committed
32

XhmikosR's avatar
XhmikosR committed
33
34
35
36
37
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
Mark Otto's avatar
dist    
Mark Otto committed
38
39
      }

XhmikosR's avatar
XhmikosR committed
40
41
42
43
      return target;
    };

    return _extends.apply(this, arguments);
Mark Otto's avatar
dist    
Mark Otto committed
44
  }
Mark Otto's avatar
Mark Otto committed
45

Mark Otto's avatar
dist    
Mark Otto committed
46
47
48
49
50
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }
Mark Otto's avatar
dist  
Mark Otto committed
51
52

  /**
Mark Otto's avatar
dist    
Mark Otto committed
53
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
54
   * Bootstrap (v5.0.0-alpha2): util/index.js
XhmikosR's avatar
XhmikosR committed
55
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
Mark Otto's avatar
dist    
Mark Otto committed
56
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
57
   */
XhmikosR's avatar
XhmikosR committed
58
59
  var MAX_UID = 1000000;
  var MILLISECONDS_MULTIPLIER = 1000;
XhmikosR's avatar
XhmikosR committed
60
  var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
XhmikosR's avatar
XhmikosR committed
61
62

  var toType = function toType(obj) {
XhmikosR's avatar
XhmikosR committed
63
64
65
66
    if (obj === null || obj === undefined) {
      return "" + obj;
    }

XhmikosR's avatar
XhmikosR committed
67
68
    return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  };
XhmikosR's avatar
Dist    
XhmikosR committed
69
  /**
XhmikosR's avatar
XhmikosR committed
70
71
72
   * --------------------------------------------------------------------------
   * Public Util Api
   * --------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
73
   */
Mark Otto's avatar
dist  
Mark Otto committed
74
75


XhmikosR's avatar
XhmikosR committed
76
77
  var getUID = function getUID(prefix) {
    do {
Mark Otto's avatar
Mark Otto committed
78
      prefix += Math.floor(Math.random() * MAX_UID);
XhmikosR's avatar
XhmikosR committed
79
    } while (document.getElementById(prefix));
Mark Otto's avatar
dist  
Mark Otto committed
80

XhmikosR's avatar
XhmikosR committed
81
82
    return prefix;
  };
Mark Otto's avatar
dist  
Mark Otto committed
83

XhmikosR's avatar
XhmikosR committed
84
  var getSelector = function getSelector(element) {
XhmikosR's avatar
XhmikosR committed
85
86
87
88
    var selector = element.getAttribute('data-target');

    if (!selector || selector === '#') {
      var hrefAttr = element.getAttribute('href');
XhmikosR's avatar
XhmikosR committed
89
      selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
XhmikosR's avatar
XhmikosR committed
90
91
    }

XhmikosR's avatar
XhmikosR committed
92
93
94
95
96
97
98
    return selector;
  };

  var getSelectorFromElement = function getSelectorFromElement(element) {
    var selector = getSelector(element);

    if (selector) {
XhmikosR's avatar
XhmikosR committed
99
100
      return document.querySelector(selector) ? selector : null;
    }
XhmikosR's avatar
XhmikosR committed
101
102
103
104
105
106
107

    return null;
  };

  var getElementFromSelector = function getElementFromSelector(element) {
    var selector = getSelector(element);
    return selector ? document.querySelector(selector) : null;
XhmikosR's avatar
XhmikosR committed
108
  };
Mark Otto's avatar
dist  
Mark Otto committed
109

XhmikosR's avatar
XhmikosR committed
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
  var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
    if (!element) {
      return 0;
    } // Get transition-duration of the element


    var _window$getComputedSt = window.getComputedStyle(element),
        transitionDuration = _window$getComputedSt.transitionDuration,
        transitionDelay = _window$getComputedSt.transitionDelay;

    var floatTransitionDuration = parseFloat(transitionDuration);
    var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found

    if (!floatTransitionDuration && !floatTransitionDelay) {
      return 0;
    } // If multiple durations are defined, take the first


    transitionDuration = transitionDuration.split(',')[0];
    transitionDelay = transitionDelay.split(',')[0];
    return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  };

  var triggerTransitionEnd = function triggerTransitionEnd(element) {
XhmikosR's avatar
XhmikosR committed
134
    element.dispatchEvent(new Event(TRANSITION_END));
XhmikosR's avatar
XhmikosR committed
135
  };
Mark Otto's avatar
dist  
Mark Otto committed
136

XhmikosR's avatar
XhmikosR committed
137
138
139
140
141
  var isElement = function isElement(obj) {
    return (obj[0] || obj).nodeType;
  };

  var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
XhmikosR's avatar
Dist    
XhmikosR committed
142
    var called = false;
XhmikosR's avatar
XhmikosR committed
143
144
145
146
    var durationPadding = 5;
    var emulatedDuration = duration + durationPadding;

    function listener() {
XhmikosR's avatar
Dist    
XhmikosR committed
147
      called = true;
XhmikosR's avatar
XhmikosR committed
148
149
150
151
      element.removeEventListener(TRANSITION_END, listener);
    }

    element.addEventListener(TRANSITION_END, listener);
XhmikosR's avatar
Dist    
XhmikosR committed
152
153
    setTimeout(function () {
      if (!called) {
XhmikosR's avatar
XhmikosR committed
154
        triggerTransitionEnd(element);
XhmikosR's avatar
Dist    
XhmikosR committed
155
      }
XhmikosR's avatar
XhmikosR committed
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
    }, emulatedDuration);
  };

  var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
    Object.keys(configTypes).forEach(function (property) {
      var expectedTypes = configTypes[property];
      var value = config[property];
      var valueType = value && isElement(value) ? 'element' : toType(value);

      if (!new RegExp(expectedTypes).test(valueType)) {
        throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
      }
    });
  };

  var isVisible = function isVisible(element) {
    if (!element) {
      return false;
    }

    if (element.style && element.parentNode && element.parentNode.style) {
XhmikosR's avatar
XhmikosR committed
177
178
179
      var elementStyle = getComputedStyle(element);
      var parentNodeStyle = getComputedStyle(element.parentNode);
      return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
XhmikosR's avatar
XhmikosR committed
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
    }

    return false;
  };

  var findShadowRoot = function findShadowRoot(element) {
    if (!document.documentElement.attachShadow) {
      return null;
    } // Can find the shadow root otherwise it'll return the document


    if (typeof element.getRootNode === 'function') {
      var root = element.getRootNode();
      return root instanceof ShadowRoot ? root : null;
    }

    if (element instanceof ShadowRoot) {
      return element;
    } // when we don't find a shadow root


    if (!element.parentNode) {
      return null;
    }

    return findShadowRoot(element.parentNode);
XhmikosR's avatar
XhmikosR committed
206
  };
XhmikosR's avatar
XhmikosR committed
207
208
209
210
211
212
213
214

  var noop = function noop() {
    return function () {};
  };

  var reflow = function reflow(element) {
    return element.offsetHeight;
  };
XhmikosR's avatar
Dist    
XhmikosR committed
215

XhmikosR's avatar
XhmikosR committed
216
217
218
219
220
221
222
223
224
225
226
  var getjQuery = function getjQuery() {
    var _window = window,
        jQuery = _window.jQuery;

    if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
      return jQuery;
    }

    return null;
  };

XhmikosR's avatar
Dist    
XhmikosR committed
227
228
  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
229
   * Bootstrap (v5.0.0-alpha2): dom/data.js
XhmikosR's avatar
XhmikosR committed
230
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
XhmikosR's avatar
Dist    
XhmikosR committed
231
232
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
233

XhmikosR's avatar
XhmikosR committed
234
235
236
237
238
239
240
241
242
243
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var mapData = function () {
    var storeData = {};
    var id = 1;
    return {
      set: function set(element, key, data) {
XhmikosR's avatar
XhmikosR committed
244
245
        if (typeof element.bsKey === 'undefined') {
          element.bsKey = {
XhmikosR's avatar
XhmikosR committed
246
247
248
249
250
251
            key: key,
            id: id
          };
          id++;
        }

XhmikosR's avatar
XhmikosR committed
252
        storeData[element.bsKey.id] = data;
XhmikosR's avatar
XhmikosR committed
253
254
      },
      get: function get(element, key) {
XhmikosR's avatar
XhmikosR committed
255
        if (!element || typeof element.bsKey === 'undefined') {
XhmikosR's avatar
XhmikosR committed
256
257
          return null;
        }
Mark Otto's avatar
dist  
Mark Otto committed
258

XhmikosR's avatar
XhmikosR committed
259
        var keyProperties = element.bsKey;
Mark Otto's avatar
dist    
Mark Otto committed
260

XhmikosR's avatar
XhmikosR committed
261
262
263
        if (keyProperties.key === key) {
          return storeData[keyProperties.id];
        }
Mark Otto's avatar
dist    
Mark Otto committed
264

XhmikosR's avatar
XhmikosR committed
265
266
267
        return null;
      },
      delete: function _delete(element, key) {
XhmikosR's avatar
XhmikosR committed
268
        if (typeof element.bsKey === 'undefined') {
XhmikosR's avatar
XhmikosR committed
269
270
271
          return;
        }

XhmikosR's avatar
XhmikosR committed
272
        var keyProperties = element.bsKey;
XhmikosR's avatar
XhmikosR committed
273
274
275

        if (keyProperties.key === key) {
          delete storeData[keyProperties.id];
XhmikosR's avatar
XhmikosR committed
276
          delete element.bsKey;
XhmikosR's avatar
XhmikosR committed
277
        }
XhmikosR's avatar
Dist    
XhmikosR committed
278
      }
XhmikosR's avatar
XhmikosR committed
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
    };
  }();

  var Data = {
    setData: function setData(instance, key, data) {
      mapData.set(instance, key, data);
    },
    getData: function getData(instance, key) {
      return mapData.get(instance, key);
    },
    removeData: function removeData(instance, key) {
      mapData.delete(instance, key);
    }
  };

XhmikosR's avatar
XhmikosR committed
294
295
  /* istanbul ignore file */
  var find = Element.prototype.querySelectorAll;
XhmikosR's avatar
XhmikosR committed
296
  var findOne = Element.prototype.querySelector; // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
XhmikosR's avatar
XhmikosR committed
297

XhmikosR's avatar
XhmikosR committed
298
  var defaultPreventedPreservedOnDispatch = function () {
XhmikosR's avatar
XhmikosR committed
299
    var e = new CustomEvent('Bootstrap', {
XhmikosR's avatar
XhmikosR committed
300
301
302
303
304
305
306
307
308
309
      cancelable: true
    });
    var element = document.createElement('div');
    element.addEventListener('Bootstrap', function () {
      return null;
    });
    e.preventDefault();
    element.dispatchEvent(e);
    return e.defaultPrevented;
  }();
XhmikosR's avatar
XhmikosR committed
310

XhmikosR's avatar
XhmikosR committed
311
  var scopeSelectorRegex = /:scope\b/;
XhmikosR's avatar
XhmikosR committed
312

XhmikosR's avatar
XhmikosR committed
313
314
  var supportScopeQuery = function () {
    var element = document.createElement('div');
XhmikosR's avatar
XhmikosR committed
315

XhmikosR's avatar
XhmikosR committed
316
317
    try {
      element.querySelectorAll(':scope *');
XhmikosR's avatar
XhmikosR committed
318
    } catch (_) {
XhmikosR's avatar
XhmikosR committed
319
      return false;
XhmikosR's avatar
XhmikosR committed
320
321
    }

XhmikosR's avatar
XhmikosR committed
322
    return true;
XhmikosR's avatar
XhmikosR committed
323
324
  }();

XhmikosR's avatar
XhmikosR committed
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
  if (!supportScopeQuery) {
    find = function find(selector) {
      if (!scopeSelectorRegex.test(selector)) {
        return this.querySelectorAll(selector);
      }

      var hasId = Boolean(this.id);

      if (!hasId) {
        this.id = getUID('scope');
      }

      var nodeList = null;

      try {
        selector = selector.replace(scopeSelectorRegex, "#" + this.id);
        nodeList = this.querySelectorAll(selector);
      } finally {
        if (!hasId) {
          this.removeAttribute('id');
        }
      }

      return nodeList;
    };

    findOne = function findOne(selector) {
      if (!scopeSelectorRegex.test(selector)) {
        return this.querySelector(selector);
      }

      var matches = find.call(this, selector);

      if (typeof matches[0] !== 'undefined') {
        return matches[0];
      }

      return null;
    };
  }

XhmikosR's avatar
XhmikosR committed
366
367
  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
368
   * Bootstrap (v5.0.0-alpha2): dom/event-handler.js
XhmikosR's avatar
XhmikosR committed
369
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
XhmikosR's avatar
XhmikosR committed
370
371
372
373
374
375
376
377
   * --------------------------------------------------------------------------
   */
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

XhmikosR's avatar
XhmikosR committed
378
  var $ = getjQuery();
XhmikosR's avatar
XhmikosR committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
  var namespaceRegex = /[^.]*(?=\..*)\.|.*/;
  var stripNameRegex = /\..*/;
  var stripUidRegex = /::\d+$/;
  var eventRegistry = {}; // Events storage

  var uidEvent = 1;
  var customEvents = {
    mouseenter: 'mouseover',
    mouseleave: 'mouseout'
  };
  var nativeEvents = ['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'];
  /**
   * ------------------------------------------------------------------------
   * Private methods
   * ------------------------------------------------------------------------
   */

  function getUidEvent(element, uid) {
    return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++;
  }

  function getEvent(element) {
    var uid = getUidEvent(element);
    element.uidEvent = uid;
XhmikosR's avatar
Dist.    
XhmikosR committed
403
404
    eventRegistry[uid] = eventRegistry[uid] || {};
    return eventRegistry[uid];
XhmikosR's avatar
XhmikosR committed
405
406
407
408
  }

  function bootstrapHandler(element, fn) {
    return function handler(event) {
XhmikosR's avatar
XhmikosR committed
409
410
      event.delegateTarget = element;

XhmikosR's avatar
XhmikosR committed
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
      if (handler.oneOff) {
        EventHandler.off(element, event.type, fn);
      }

      return fn.apply(element, [event]);
    };
  }

  function bootstrapDelegationHandler(element, selector, fn) {
    return function handler(event) {
      var domElements = element.querySelectorAll(selector);

      for (var target = event.target; target && target !== this; target = target.parentNode) {
        for (var i = domElements.length; i--;) {
          if (domElements[i] === target) {
XhmikosR's avatar
XhmikosR committed
426
427
            event.delegateTarget = target;

XhmikosR's avatar
XhmikosR committed
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
            if (handler.oneOff) {
              EventHandler.off(element, event.type, fn);
            }

            return fn.apply(target, [event]);
          }
        }
      } // To please ESLint


      return null;
    };
  }

  function findHandler(events, handler, delegationSelector) {
    if (delegationSelector === void 0) {
      delegationSelector = null;
    }

Mark Otto's avatar
dist v5    
Mark Otto committed
447
448
449
450
    var uidEventList = Object.keys(events);

    for (var i = 0, len = uidEventList.length; i < len; i++) {
      var event = events[uidEventList[i]];
XhmikosR's avatar
XhmikosR committed
451
452

      if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
Mark Otto's avatar
dist v5    
Mark Otto committed
453
        return event;
XhmikosR's avatar
XhmikosR committed
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
      }
    }

    return null;
  }

  function normalizeParams(originalTypeEvent, handler, delegationFn) {
    var delegation = typeof handler === 'string';
    var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')

    var typeEvent = originalTypeEvent.replace(stripNameRegex, '');
    var custom = customEvents[typeEvent];

    if (custom) {
      typeEvent = custom;
    }

    var isNative = nativeEvents.indexOf(typeEvent) > -1;

    if (!isNative) {
      typeEvent = originalTypeEvent;
    }

    return [delegation, originalHandler, typeEvent];
  }

  function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
    if (typeof originalTypeEvent !== 'string' || !element) {
      return;
    }

    if (!handler) {
      handler = delegationFn;
      delegationFn = null;
    }

    var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
        delegation = _normalizeParams[0],
        originalHandler = _normalizeParams[1],
        typeEvent = _normalizeParams[2];

    var events = getEvent(element);
    var handlers = events[typeEvent] || (events[typeEvent] = {});
    var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);

    if (previousFn) {
      previousFn.oneOff = previousFn.oneOff && oneOff;
      return;
    }

    var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
XhmikosR's avatar
Dist.    
XhmikosR committed
505
    var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
XhmikosR's avatar
XhmikosR committed
506
507
508
509
510
511
512
513
514
515
516
    fn.delegationSelector = delegation ? handler : null;
    fn.originalHandler = originalHandler;
    fn.oneOff = oneOff;
    fn.uidEvent = uid;
    handlers[uid] = fn;
    element.addEventListener(typeEvent, fn, delegation);
  }

  function removeHandler(element, events, typeEvent, handler, delegationSelector) {
    var fn = findHandler(events[typeEvent], handler, delegationSelector);

Mark Otto's avatar
dist v5    
Mark Otto committed
517
    if (!fn) {
XhmikosR's avatar
XhmikosR committed
518
519
520
521
522
523
524
525
526
527
528
529
530
      return;
    }

    element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
    delete events[typeEvent][fn.uidEvent];
  }

  function removeNamespacedHandlers(element, events, typeEvent, namespace) {
    var storeElementEvent = events[typeEvent] || {};
    Object.keys(storeElementEvent).forEach(function (handlerKey) {
      if (handlerKey.indexOf(namespace) > -1) {
        var event = storeElementEvent[handlerKey];
        removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
Mark Otto's avatar
Mark Otto committed
531
      }
XhmikosR's avatar
XhmikosR committed
532
533
534
535
536
537
    });
  }

  var EventHandler = {
    on: function on(element, event, handler, delegationFn) {
      addHandler(element, event, handler, delegationFn, false);
XhmikosR's avatar
Dist    
XhmikosR committed
538
    },
XhmikosR's avatar
XhmikosR committed
539
540
541
542
543
544
545
    one: function one(element, event, handler, delegationFn) {
      addHandler(element, event, handler, delegationFn, true);
    },
    off: function off(element, originalTypeEvent, handler, delegationFn) {
      if (typeof originalTypeEvent !== 'string' || !element) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
546

XhmikosR's avatar
XhmikosR committed
547
548
549
550
      var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn),
          delegation = _normalizeParams2[0],
          originalHandler = _normalizeParams2[1],
          typeEvent = _normalizeParams2[2];
Mark Otto's avatar
dist    
Mark Otto committed
551

XhmikosR's avatar
XhmikosR committed
552
553
554
      var inNamespace = typeEvent !== originalTypeEvent;
      var events = getEvent(element);
      var isNamespace = originalTypeEvent.charAt(0) === '.';
Mark Otto's avatar
dist    
Mark Otto committed
555

XhmikosR's avatar
XhmikosR committed
556
557
558
559
560
561
562
563
564
565
566
567
      if (typeof originalHandler !== 'undefined') {
        // Simplest case: handler is passed, remove that listener ONLY.
        if (!events || !events[typeEvent]) {
          return;
        }

        removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
        return;
      }

      if (isNamespace) {
        Object.keys(events).forEach(function (elementEvent) {
XhmikosR's avatar
XhmikosR committed
568
          removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
XhmikosR's avatar
XhmikosR committed
569
570
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
571

XhmikosR's avatar
XhmikosR committed
572
573
574
      var storeElementEvent = events[typeEvent] || {};
      Object.keys(storeElementEvent).forEach(function (keyHandlers) {
        var handlerKey = keyHandlers.replace(stripUidRegex, '');
Mark Otto's avatar
dist    
Mark Otto committed
575

XhmikosR's avatar
XhmikosR committed
576
577
578
579
580
        if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
          var event = storeElementEvent[keyHandlers];
          removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
        }
      });
XhmikosR's avatar
Dist    
XhmikosR committed
581
    },
XhmikosR's avatar
XhmikosR committed
582
583
584
585
586
587
588
589
590
591
592
593
594
595
    trigger: function trigger(element, event, args) {
      if (typeof event !== 'string' || !element) {
        return null;
      }

      var typeEvent = event.replace(stripNameRegex, '');
      var inNamespace = event !== typeEvent;
      var isNative = nativeEvents.indexOf(typeEvent) > -1;
      var jQueryEvent;
      var bubbles = true;
      var nativeDispatch = true;
      var defaultPrevented = false;
      var evt = null;

XhmikosR's avatar
XhmikosR committed
596
597
598
      if (inNamespace && $) {
        jQueryEvent = $.Event(event, args);
        $(element).trigger(jQueryEvent);
XhmikosR's avatar
XhmikosR committed
599
600
601
602
603
604
605
606
607
        bubbles = !jQueryEvent.isPropagationStopped();
        nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
        defaultPrevented = jQueryEvent.isDefaultPrevented();
      }

      if (isNative) {
        evt = document.createEvent('HTMLEvents');
        evt.initEvent(typeEvent, bubbles, true);
      } else {
XhmikosR's avatar
XhmikosR committed
608
        evt = new CustomEvent(event, {
XhmikosR's avatar
XhmikosR committed
609
610
611
          bubbles: bubbles,
          cancelable: true
        });
XhmikosR's avatar
XhmikosR committed
612
      } // merge custom information in our event
XhmikosR's avatar
XhmikosR committed
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627


      if (typeof args !== 'undefined') {
        Object.keys(args).forEach(function (key) {
          Object.defineProperty(evt, key, {
            get: function get() {
              return args[key];
            }
          });
        });
      }

      if (defaultPrevented) {
        evt.preventDefault();

XhmikosR's avatar
XhmikosR committed
628
        if (!defaultPreventedPreservedOnDispatch) {
XhmikosR's avatar
XhmikosR committed
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
          Object.defineProperty(evt, 'defaultPrevented', {
            get: function get() {
              return true;
            }
          });
        }
      }

      if (nativeDispatch) {
        element.dispatchEvent(evt);
      }

      if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
        jQueryEvent.preventDefault();
      }

      return evt;
    }
  };

XhmikosR's avatar
Dist    
XhmikosR committed
649
650
651
652
653
654
655
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'alert';
XhmikosR's avatar
XhmikosR committed
656
  var VERSION = '5.0.0-alpha2';
XhmikosR's avatar
Dist    
XhmikosR committed
657
658
659
  var DATA_KEY = 'bs.alert';
  var EVENT_KEY = "." + DATA_KEY;
  var DATA_API_KEY = '.data-api';
XhmikosR's avatar
XhmikosR committed
660
661
662
663
664
665
666
  var SELECTOR_DISMISS = '[data-dismiss="alert"]';
  var EVENT_CLOSE = "close" + EVENT_KEY;
  var EVENT_CLOSED = "closed" + EVENT_KEY;
  var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
  var CLASSNAME_ALERT = 'alert';
  var CLASSNAME_FADE = 'fade';
  var CLASSNAME_SHOW = 'show';
XhmikosR's avatar
XhmikosR committed
667
668
669
670
671
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
672

XhmikosR's avatar
XhmikosR committed
673
  var Alert = /*#__PURE__*/function () {
XhmikosR's avatar
Dist    
XhmikosR committed
674
675
    function Alert(element) {
      this._element = element;
XhmikosR's avatar
XhmikosR committed
676
677
678
679

      if (this._element) {
        Data.setData(element, DATA_KEY, this);
      }
XhmikosR's avatar
Dist    
XhmikosR committed
680
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
681
682


XhmikosR's avatar
Dist    
XhmikosR committed
683
    var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
684

XhmikosR's avatar
Dist    
XhmikosR committed
685
686
    // Public
    _proto.close = function close(element) {
XhmikosR's avatar
XhmikosR committed
687
      var rootElement = element ? this._getRootElement(element) : this._element;
Mark Otto's avatar
dist    
Mark Otto committed
688

XhmikosR's avatar
Dist    
XhmikosR committed
689
      var customEvent = this._triggerCloseEvent(rootElement);
Mark Otto's avatar
dist  
Mark Otto committed
690

XhmikosR's avatar
XhmikosR committed
691
      if (customEvent === null || customEvent.defaultPrevented) {
XhmikosR's avatar
Dist    
XhmikosR committed
692
693
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
694

XhmikosR's avatar
Dist    
XhmikosR committed
695
696
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
697

XhmikosR's avatar
Dist    
XhmikosR committed
698
    _proto.dispose = function dispose() {
XhmikosR's avatar
XhmikosR committed
699
      Data.removeData(this._element, DATA_KEY);
XhmikosR's avatar
Dist    
XhmikosR committed
700
      this._element = null;
Mark Otto's avatar
Mark Otto committed
701
702
    } // Private
    ;
Mark Otto's avatar
dist  
Mark Otto committed
703

XhmikosR's avatar
Dist    
XhmikosR committed
704
    _proto._getRootElement = function _getRootElement(element) {
XhmikosR's avatar
XhmikosR committed
705
      return getElementFromSelector(element) || element.closest("." + CLASSNAME_ALERT);
XhmikosR's avatar
Dist    
XhmikosR committed
706
    };
Mark Otto's avatar
dist  
Mark Otto committed
707

XhmikosR's avatar
Dist    
XhmikosR committed
708
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
XhmikosR's avatar
XhmikosR committed
709
      return EventHandler.trigger(element, EVENT_CLOSE);
XhmikosR's avatar
Dist    
XhmikosR committed
710
    };
Mark Otto's avatar
dist  
Mark Otto committed
711

XhmikosR's avatar
Dist    
XhmikosR committed
712
713
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
714

XhmikosR's avatar
XhmikosR committed
715
      element.classList.remove(CLASSNAME_SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
716

XhmikosR's avatar
XhmikosR committed
717
      if (!element.classList.contains(CLASSNAME_FADE)) {
XhmikosR's avatar
Dist    
XhmikosR committed
718
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
719

XhmikosR's avatar
Dist    
XhmikosR committed
720
721
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
722

XhmikosR's avatar
XhmikosR committed
723
      var transitionDuration = getTransitionDurationFromElement(element);
724
725
      EventHandler.one(element, TRANSITION_END, function () {
        return _this._destroyElement(element);
XhmikosR's avatar
XhmikosR committed
726
727
      });
      emulateTransitionEnd(element, transitionDuration);
XhmikosR's avatar
Dist    
XhmikosR committed
728
    };
Mark Otto's avatar
dist  
Mark Otto committed
729

XhmikosR's avatar
Dist    
XhmikosR committed
730
    _proto._destroyElement = function _destroyElement(element) {
XhmikosR's avatar
XhmikosR committed
731
732
733
734
      if (element.parentNode) {
        element.parentNode.removeChild(element);
      }

XhmikosR's avatar
XhmikosR committed
735
      EventHandler.trigger(element, EVENT_CLOSED);
Mark Otto's avatar
Mark Otto committed
736
737
    } // Static
    ;
Mark Otto's avatar
dist  
Mark Otto committed
738

XhmikosR's avatar
XhmikosR committed
739
    Alert.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
740
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
741
        var data = Data.getData(this, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
742

XhmikosR's avatar
Dist    
XhmikosR committed
743
744
745
        if (!data) {
          data = new Alert(this);
        }
Mark Otto's avatar
dist  
Mark Otto committed
746

XhmikosR's avatar
Dist    
XhmikosR committed
747
748
749
750
751
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
752

XhmikosR's avatar
XhmikosR committed
753
    Alert.handleDismiss = function handleDismiss(alertInstance) {
XhmikosR's avatar
Dist    
XhmikosR committed
754
755
756
757
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
758

XhmikosR's avatar
Dist    
XhmikosR committed
759
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
760
      };
XhmikosR's avatar
Dist    
XhmikosR committed
761
    };
Mark Otto's avatar
dist  
Mark Otto committed
762

XhmikosR's avatar
XhmikosR committed
763
    Alert.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
764
765
766
      return Data.getData(element, DATA_KEY);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
767
768
769
770
771
772
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
773

XhmikosR's avatar
Dist    
XhmikosR committed
774
775
776
777
778
779
780
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
781

Mark Otto's avatar
dist    
Mark Otto committed
782

XhmikosR's avatar
XhmikosR committed
783
  EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
XhmikosR's avatar
XhmikosR committed
784
  var $$1 = getjQuery();
XhmikosR's avatar
Dist    
XhmikosR committed
785
786
787
788
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
789
   * add .alert to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
790
   */
Mark Otto's avatar
dist  
Mark Otto committed
791

792
793
  /* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
794
795
796
797
  if ($$1) {
    var JQUERY_NO_CONFLICT = $$1.fn[NAME];
    $$1.fn[NAME] = Alert.jQueryInterface;
    $$1.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
798

XhmikosR's avatar
XhmikosR committed
799
800
801
    $$1.fn[NAME].noConflict = function () {
      $$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Alert.jQueryInterface;
XhmikosR's avatar
XhmikosR committed
802
803
    };
  }
Mark Otto's avatar
dist  
Mark Otto committed
804

XhmikosR's avatar
Dist    
XhmikosR committed
805
806
807
808
809
810
811
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$1 = 'button';
XhmikosR's avatar
XhmikosR committed
812
  var VERSION$1 = '5.0.0-alpha2';
XhmikosR's avatar
Dist    
XhmikosR committed
813
814
815
  var DATA_KEY$1 = 'bs.button';
  var EVENT_KEY$1 = "." + DATA_KEY$1;
  var DATA_API_KEY$1 = '.data-api';
XhmikosR's avatar
XhmikosR committed
816
  var CLASS_NAME_ACTIVE = 'active';
XhmikosR's avatar
XhmikosR committed
817
  var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
XhmikosR's avatar
XhmikosR committed
818
  var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
XhmikosR's avatar
XhmikosR committed
819
820
821
822
823
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
824

XhmikosR's avatar
XhmikosR committed
825
  var Button = /*#__PURE__*/function () {
XhmikosR's avatar
Dist    
XhmikosR committed
826
827
    function Button(element) {
      this._element = element;
XhmikosR's avatar
XhmikosR committed
828
      Data.setData(element, DATA_KEY$1, this);
XhmikosR's avatar
Dist    
XhmikosR committed
829
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
830
831


XhmikosR's avatar
Dist    
XhmikosR committed
832
    var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
833

XhmikosR's avatar
Dist    
XhmikosR committed
834
835
    // Public
    _proto.toggle = function toggle() {
XhmikosR's avatar
XhmikosR committed
836
837
      // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
      this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
XhmikosR's avatar
Dist    
XhmikosR committed
838
    };
Mark Otto's avatar
dist  
Mark Otto committed
839

XhmikosR's avatar
Dist    
XhmikosR committed
840
    _proto.dispose = function dispose() {
XhmikosR's avatar
XhmikosR committed
841
      Data.removeData(this._element, DATA_KEY$1);
XhmikosR's avatar
Dist    
XhmikosR committed
842
      this._element = null;
Mark Otto's avatar
Mark Otto committed
843
844
    } // Static
    ;
Mark Otto's avatar
dist  
Mark Otto committed
845

XhmikosR's avatar
XhmikosR committed
846
    Button.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
847
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
848
        var data = Data.getData(this, DATA_KEY$1);
Mark Otto's avatar
dist  
Mark Otto committed
849

XhmikosR's avatar
Dist    
XhmikosR committed
850
851
852
        if (!data) {
          data = new Button(this);
        }
Mark Otto's avatar
dist  
Mark Otto committed
853

XhmikosR's avatar
Dist    
XhmikosR committed
854
855
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
856
        }
XhmikosR's avatar
Dist    
XhmikosR committed
857
858
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
859

XhmikosR's avatar
XhmikosR committed
860
    Button.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
861
862
863
      return Data.getData(element, DATA_KEY$1);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
864
865
866
867
868
869
    _createClass(Button, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$1;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
870

XhmikosR's avatar
Dist    
XhmikosR committed
871
872
873
874
875
876
877
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
878
879


XhmikosR's avatar
XhmikosR committed
880
  EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE, function (event) {
XhmikosR's avatar
Dist    
XhmikosR committed
881
    event.preventDefault();
XhmikosR's avatar
XhmikosR committed
882
    var button = event.target.closest(SELECTOR_DATA_TOGGLE);
XhmikosR's avatar
XhmikosR committed
883
884
885
886
    var data = Data.getData(button, DATA_KEY$1);

    if (!data) {
      data = new Button(button);
XhmikosR's avatar
Dist    
XhmikosR committed
887
    }
Mark Otto's avatar
dist    
Mark Otto committed
888

XhmikosR's avatar
XhmikosR committed
889
890
    data.toggle();
  });
XhmikosR's avatar
XhmikosR committed
891
  var $$2 = getjQuery();
XhmikosR's avatar
Dist    
XhmikosR committed
892
893
894
895
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
896
   * add .button to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
897
   */
Mark Otto's avatar
dist  
Mark Otto committed
898

899
900
  /* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
901
902
903
904
  if ($$2) {
    var JQUERY_NO_CONFLICT$1 = $$2.fn[NAME$1];
    $$2.fn[NAME$1] = Button.jQueryInterface;
    $$2.fn[NAME$1].Constructor = Button;
XhmikosR's avatar
XhmikosR committed
905

XhmikosR's avatar
XhmikosR committed
906
907
908
    $$2.fn[NAME$1].noConflict = function () {
      $$2.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
      return Button.jQueryInterface;
XhmikosR's avatar
XhmikosR committed
909
910
911
912
913
    };
  }

  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
914
   * Bootstrap (v5.0.0-alpha2): dom/manipulator.js
XhmikosR's avatar
XhmikosR committed
915
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
XhmikosR's avatar
XhmikosR committed
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
   * --------------------------------------------------------------------------
   */
  function normalizeData(val) {
    if (val === 'true') {
      return true;
    }

    if (val === 'false') {
      return false;
    }

    if (val === Number(val).toString()) {
      return Number(val);
    }

    if (val === '' || val === 'null') {
      return null;
    }

    return val;
  }

  function normalizeDataKey(key) {
    return key.replace(/[A-Z]/g, function (chr) {
XhmikosR's avatar
XhmikosR committed
940
      return "-" + chr.toLowerCase();
XhmikosR's avatar
XhmikosR committed
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
    });
  }

  var Manipulator = {
    setDataAttribute: function setDataAttribute(element, key, value) {
      element.setAttribute("data-" + normalizeDataKey(key), value);
    },
    removeDataAttribute: function removeDataAttribute(element, key) {
      element.removeAttribute("data-" + normalizeDataKey(key));
    },
    getDataAttributes: function getDataAttributes(element) {
      if (!element) {
        return {};
      }

XhmikosR's avatar
XhmikosR committed
956
      var attributes = _extends({}, element.dataset);
Mark Otto's avatar
dist  
Mark Otto committed
957

XhmikosR's avatar
XhmikosR committed
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
      Object.keys(attributes).forEach(function (key) {
        attributes[key] = normalizeData(attributes[key]);
      });
      return attributes;
    },
    getDataAttribute: function getDataAttribute(element, key) {
      return normalizeData(element.getAttribute("data-" + normalizeDataKey(key)));
    },
    offset: function offset(element) {
      var rect = element.getBoundingClientRect();
      return {
        top: rect.top + document.body.scrollTop,
        left: rect.left + document.body.scrollLeft
      };
    },
    position: function position(element) {
      return {
        top: element.offsetTop,
        left: element.offsetLeft
      };
    },
    toggleClass: function toggleClass(element, className) {
      if (!element) {
        return;
      }

      if (element.classList.contains(className)) {
        element.classList.remove(className);
      } else {
        element.classList.add(className);
      }
    }
XhmikosR's avatar
Dist    
XhmikosR committed
990
  };
Mark Otto's avatar
dist  
Mark Otto committed
991

XhmikosR's avatar
XhmikosR committed
992
993
  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
994
   * Bootstrap (v5.0.0-alpha2): dom/selector-engine.js
XhmikosR's avatar
XhmikosR committed
995
996
997
998
999
1000
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */
  /**
   * ------------------------------------------------------------------------
   * Constants
For faster browsing, not all history is shown. View entire blame