phcthemes_admin_panel_pack 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,94 @@
1
+ var coverVid = function (elem, width, height) {
2
+
3
+ // call sizeVideo on load
4
+ sizeVideo();
5
+
6
+ // debounce for resize function
7
+ function debounce(fn, delay) {
8
+ var timer = null;
9
+
10
+ return function () {
11
+ var context = this,
12
+ args = arguments;
13
+
14
+ window.clearTimeout(timer);
15
+
16
+ timer = window.setTimeout(function () {
17
+ fn.apply(context, args);
18
+ }, delay);
19
+ };
20
+ }
21
+
22
+ // call sizeVideo on resize
23
+ window.addEventListener('resize', debounce(sizeVideo, 50));
24
+
25
+ // Set necessary styles to position video "center center"
26
+ elem.style.position = 'absolute';
27
+ elem.style.top = '50%';
28
+ elem.style.left = '50%';
29
+ elem.style['-webkit-transform'] = 'translate(-50%, -50%)';
30
+ elem.style['-ms-transform'] = 'translate(-50%, -50%)';
31
+ elem.style.transform = 'translate(-50%, -50%)';
32
+
33
+ // Set overflow hidden on parent element
34
+ elem.parentNode.style.overflow = 'hidden';
35
+
36
+ // Get image defined on poster attribute of video
37
+ var posterImage = elem.getAttribute('poster');
38
+
39
+ // Remove poster to disable
40
+ elem.removeAttribute('poster');
41
+
42
+ // Set poster image as a background cover image on parent element
43
+ elem.parentNode.style.backgroundImage = 'url(' + posterImage + ')';
44
+ elem.parentNode.style.backgroundSize = 'cover';
45
+ elem.parentNode.style.backgroundPosition = 'center center';
46
+
47
+ // Define the attached selector
48
+ function sizeVideo() {
49
+
50
+ // Get parent element height and width
51
+ var parentHeight = elem.parentNode.offsetHeight;
52
+ var parentWidth = elem.parentNode.offsetWidth;
53
+
54
+ // Get native video width and height
55
+ var nativeWidth = width;
56
+ var nativeHeight = height;
57
+
58
+ // Get the scale factors
59
+ var heightScaleFactor = parentHeight / nativeHeight;
60
+ var widthScaleFactor = parentWidth / nativeWidth;
61
+
62
+ // Based on highest scale factor set width and height
63
+ if (widthScaleFactor > heightScaleFactor) {
64
+ elem.style.height = 'auto';
65
+ elem.style.width = parentWidth+'px';
66
+ } else {
67
+ elem.style.height = parentHeight+'px';
68
+ elem.style.width = 'auto';
69
+ }
70
+ }
71
+
72
+ // Check for video support
73
+ var supportsVideo = (typeof(elem.canPlayType) != 'undefined') ? true : false;
74
+
75
+ // Check if mobile
76
+ var isMobile = false;
77
+ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
78
+ || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))
79
+ isMobile = true;
80
+
81
+ // Remove video if not supported or mobile
82
+ if (!supportsVideo || isMobile) {
83
+ elem && elem.parentNode && elem.parentNode.removeChild(elem);
84
+ }
85
+ };
86
+
87
+ if (window.jQuery) {
88
+ jQuery.fn.extend({
89
+ 'coverVid': function () {
90
+ coverVid(this[0], arguments[0], arguments[1]);
91
+ return this;
92
+ }
93
+ });
94
+ }
@@ -0,0 +1,11 @@
1
+ // Beating Heart Effect for PHCNetco Websites
2
+ .hanna_hearts {
3
+ color: #E23636;
4
+ animation: pulse 1s ease infinite,
5
+ }
6
+
7
+ @keyframes pulse {
8
+ 0% { transform: scale(1); }
9
+ 50% { transform: scale(1.3); }
10
+ 100% { transform: scale(1); }
11
+ }
@@ -2,8 +2,8 @@
2
2
  @import "jquery-ui";
3
3
 
4
4
  // Load Common Files
5
- @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.0/css/bootstrap.css");
6
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
5
+ @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.2/css/bootstrap.css");
6
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
7
7
  @import url("https://cdn.phcnetworks.net/jquery/forms/daterangepicker/version-3.0.5/daterangepicker.css");
8
8
  @import url("https://cdn.phcnetworks.net/jquery/maps/jvectormap/version-2.0.4/jquery-jvectormap.css");
9
9
 
@@ -13,4 +13,4 @@
13
13
  @import url("https://frmwrks.phcnetworks.net/adminlte/version-2.4.12/dist/css/skins/_all-skins.css");
14
14
 
15
15
  // Load PHCNetco Files
16
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
16
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -5,8 +5,8 @@
5
5
  @import url("https://fonts.googleapis.com/css?family=Nunito:400,600,700,800|Roboto:400,500,700");
6
6
 
7
7
  // Load Common Files
8
- @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.0/css/bootstrap.css");
9
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
8
+ @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.2/css/bootstrap.css");
9
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
10
10
  @import url("https://cdn.phcnetworks.net/jquery/sliders/swipper/version-4.5.0/css/swiper.css");
11
11
  @import url("https://cdn.phcnetworks.net/css/animations/hamburgers/version-1.1.3/hamburgers.css");
12
12
  @import url("https://cdn.phcnetworks.net/css/animations/animate-css/version-3.7.2/animate.css");
@@ -24,4 +24,4 @@
24
24
  @import url("https://frmwrks.phcnetworks.net/boomerang/version-3.6.1/assets/css/custom-style.css");
25
25
 
26
26
  // Load PHCNetco Files
27
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
27
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -2,11 +2,11 @@
2
2
  @import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");
3
3
 
4
4
  // Load Common Files
5
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
5
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
6
6
  @import url("https://cdn.phcnetworks.net/css/animations/animate-css/version-3.7.2/animate.css");
7
7
 
8
8
  // Load Theme Files
9
9
  @import url("https://frmwrks.phcnetworks.net/coloradmin/version-4.5.0/admin/template/assets/css/default/app.min.css");
10
10
 
11
11
  // Load PHCNetco Files
12
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
12
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -5,8 +5,8 @@
5
5
  @import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&lang=en");
6
6
 
7
7
  // Load Common Files
8
- @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.0/css/bootstrap.css");
9
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
8
+ @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.2/css/bootstrap.css");
9
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
10
10
  @import url("https://cdn.phcnetworks.net/css/animations/animate-css/version-3.7.2/animate.css");
11
11
  @import url("https://cdn.phcnetworks.net/javascript/notifications/toastr/version-2.1.1/toastr.css");
12
12
 
@@ -15,4 +15,4 @@
15
15
  @import url("https://frmwrks.phcnetworks.net/inspinia/version-2.9.2/HTML5_Full_Version/css/style.css");
16
16
 
17
17
  // Load PHCNetco Files
18
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
18
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -2,9 +2,9 @@
2
2
  @import "jquery-ui";
3
3
 
4
4
  // Load Theme Files
5
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
5
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
6
6
  @import url("https://frmwrks.phcnetworks.net/metronic/version-6.0.4/theme/default/dist/assets/vendors/global/vendors.bundle.css");
7
7
  @import url("https://cdn.phcnetworks.net/jquery/tables/version-1.10.18/datatables.css");
8
8
 
9
9
  // Load PHCNetco Files
10
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
10
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -5,8 +5,8 @@
5
5
  @import url("https://fonts.googleapis.com/css?family=Montserrat:300,400,500,700&subset=latin-ext");
6
6
 
7
7
  // Load Common Files
8
- @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.0/css/bootstrap.css");
9
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
8
+ @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.2/css/bootstrap.css");
9
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
10
10
  @import url("https://cdn.phcnetworks.net/css/animations/hamburgers/version-1.1.3/hamburgers.css");
11
11
 
12
12
  // Load Theme Files
@@ -16,4 +16,4 @@
16
16
  @import url("https://frmwrks.phcnetworks.net/quilpro/version-1.7.0/Files/assets/css/quillpro/quillpro.css");
17
17
 
18
18
  // Load PHCNetco Files
19
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
19
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -2,8 +2,8 @@
2
2
  @import "jquery-ui";
3
3
 
4
4
  // Load Common Files
5
- @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.0/css/bootstrap.css");
6
- @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.13.1/css/all.css");
5
+ @import url("https://cdn.phcnetworks.net/frameworks/css/bootstrap/version-4.5.2/css/bootstrap.css");
6
+ @import url("https://cdn.phcnetworks.net/icons/fonts/fontawesome-pro/version-5.14.0/css/all.css");
7
7
 
8
8
  // Load Theme Files
9
9
  @import url("https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css");
@@ -12,4 +12,4 @@
12
12
  @import url("http://frmwrks.phcnetworks.net/starlight/version-1.1.0/template/css/starlight.css");
13
13
 
14
14
  // Load PHCNetco Files
15
- @import url("https://static.phcnetworks.net/phc_sites/all_sites/animations/hanna_hearts/hanna_hearts.css");
15
+ @import "common/hanna_hearts/hanna_hearts.scss";
@@ -1,3 +1,3 @@
1
1
  module PhcthemesAdminPanelPack
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcthemes_admin_panel_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-19 00:00:00.000000000 Z
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -307,7 +307,6 @@ files:
307
307
  - app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map
308
308
  - app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js
309
309
  - app/assets/javascripts/common/bootstrap/bootstrap.bundle.js
310
- - app/assets/javascripts/common/bootstrap/bootstrap.js
311
310
  - app/assets/javascripts/common/bootstrap/bootstrap.three.js
312
311
  - app/assets/javascripts/common/chartjs/chart.js
313
312
  - app/assets/javascripts/common/ckeditor/ckeditor.js
@@ -372,7 +371,7 @@ files:
372
371
  - app/assets/javascripts/common/ckeditor/translations/zh-cn.js
373
372
  - app/assets/javascripts/common/ckeditor/translations/zh.js
374
373
  - app/assets/javascripts/common/clipboardjs/clipboard.js
375
- - app/assets/javascripts/common/covervid/covervid.min.js
374
+ - app/assets/javascripts/common/covervid/covervid.js
376
375
  - app/assets/javascripts/common/custom/custom.js
377
376
  - app/assets/javascripts/common/datatables/datatables.js
378
377
  - app/assets/javascripts/common/daterangepicker/daterangepicker.js
@@ -482,6 +481,7 @@ files:
482
481
  - app/assets/javascripts/themes/inspinia/theme/inspinia.js
483
482
  - app/assets/javascripts/themes/metronic/theme/scripts.bundle.js
484
483
  - app/assets/javascripts/themes/metronic/theme/vendors.bundle.js
484
+ - app/assets/stylesheets/common/hanna_hearts/hanna_hearts.scss
485
485
  - app/assets/stylesheets/phcthemes_admin_panel_pack_adminlte.scss
486
486
  - app/assets/stylesheets/phcthemes_admin_panel_pack_boomerang.scss
487
487
  - app/assets/stylesheets/phcthemes_admin_panel_pack_coloradmin.scss
@@ -1,4420 +0,0 @@
1
- /*!
2
- * Bootstrap v4.5.0 (https://getbootstrap.com/)
3
- * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :
8
- typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :
9
- (global = global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper));
10
- }(this, (function (exports, $, Popper) { 'use strict';
11
-
12
- $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
13
- Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
14
-
15
- function _defineProperties(target, props) {
16
- for (var i = 0; i < props.length; i++) {
17
- var descriptor = props[i];
18
- descriptor.enumerable = descriptor.enumerable || false;
19
- descriptor.configurable = true;
20
- if ("value" in descriptor) descriptor.writable = true;
21
- Object.defineProperty(target, descriptor.key, descriptor);
22
- }
23
- }
24
-
25
- function _createClass(Constructor, protoProps, staticProps) {
26
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
- if (staticProps) _defineProperties(Constructor, staticProps);
28
- return Constructor;
29
- }
30
-
31
- function _defineProperty(obj, key, value) {
32
- if (key in obj) {
33
- Object.defineProperty(obj, key, {
34
- value: value,
35
- enumerable: true,
36
- configurable: true,
37
- writable: true
38
- });
39
- } else {
40
- obj[key] = value;
41
- }
42
-
43
- return obj;
44
- }
45
-
46
- function ownKeys(object, enumerableOnly) {
47
- var keys = Object.keys(object);
48
-
49
- if (Object.getOwnPropertySymbols) {
50
- var symbols = Object.getOwnPropertySymbols(object);
51
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
52
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
53
- });
54
- keys.push.apply(keys, symbols);
55
- }
56
-
57
- return keys;
58
- }
59
-
60
- function _objectSpread2(target) {
61
- for (var i = 1; i < arguments.length; i++) {
62
- var source = arguments[i] != null ? arguments[i] : {};
63
-
64
- if (i % 2) {
65
- ownKeys(Object(source), true).forEach(function (key) {
66
- _defineProperty(target, key, source[key]);
67
- });
68
- } else if (Object.getOwnPropertyDescriptors) {
69
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
70
- } else {
71
- ownKeys(Object(source)).forEach(function (key) {
72
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
73
- });
74
- }
75
- }
76
-
77
- return target;
78
- }
79
-
80
- function _inheritsLoose(subClass, superClass) {
81
- subClass.prototype = Object.create(superClass.prototype);
82
- subClass.prototype.constructor = subClass;
83
- subClass.__proto__ = superClass;
84
- }
85
-
86
- /**
87
- * --------------------------------------------------------------------------
88
- * Bootstrap (v4.5.0): util.js
89
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
90
- * --------------------------------------------------------------------------
91
- */
92
- /**
93
- * ------------------------------------------------------------------------
94
- * Private TransitionEnd Helpers
95
- * ------------------------------------------------------------------------
96
- */
97
-
98
- var TRANSITION_END = 'transitionend';
99
- var MAX_UID = 1000000;
100
- var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
101
-
102
- function toType(obj) {
103
- if (obj === null || typeof obj === 'undefined') {
104
- return "" + obj;
105
- }
106
-
107
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
108
- }
109
-
110
- function getSpecialTransitionEndEvent() {
111
- return {
112
- bindType: TRANSITION_END,
113
- delegateType: TRANSITION_END,
114
- handle: function handle(event) {
115
- if ($(event.target).is(this)) {
116
- return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
117
- }
118
-
119
- return undefined;
120
- }
121
- };
122
- }
123
-
124
- function transitionEndEmulator(duration) {
125
- var _this = this;
126
-
127
- var called = false;
128
- $(this).one(Util.TRANSITION_END, function () {
129
- called = true;
130
- });
131
- setTimeout(function () {
132
- if (!called) {
133
- Util.triggerTransitionEnd(_this);
134
- }
135
- }, duration);
136
- return this;
137
- }
138
-
139
- function setTransitionEndSupport() {
140
- $.fn.emulateTransitionEnd = transitionEndEmulator;
141
- $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
142
- }
143
- /**
144
- * --------------------------------------------------------------------------
145
- * Public Util Api
146
- * --------------------------------------------------------------------------
147
- */
148
-
149
-
150
- var Util = {
151
- TRANSITION_END: 'bsTransitionEnd',
152
- getUID: function getUID(prefix) {
153
- do {
154
- // eslint-disable-next-line no-bitwise
155
- prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
156
- } while (document.getElementById(prefix));
157
-
158
- return prefix;
159
- },
160
- getSelectorFromElement: function getSelectorFromElement(element) {
161
- var selector = element.getAttribute('data-target');
162
-
163
- if (!selector || selector === '#') {
164
- var hrefAttr = element.getAttribute('href');
165
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
166
- }
167
-
168
- try {
169
- return document.querySelector(selector) ? selector : null;
170
- } catch (err) {
171
- return null;
172
- }
173
- },
174
- getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
175
- if (!element) {
176
- return 0;
177
- } // Get transition-duration of the element
178
-
179
-
180
- var transitionDuration = $(element).css('transition-duration');
181
- var transitionDelay = $(element).css('transition-delay');
182
- var floatTransitionDuration = parseFloat(transitionDuration);
183
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
184
-
185
- if (!floatTransitionDuration && !floatTransitionDelay) {
186
- return 0;
187
- } // If multiple durations are defined, take the first
188
-
189
-
190
- transitionDuration = transitionDuration.split(',')[0];
191
- transitionDelay = transitionDelay.split(',')[0];
192
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
193
- },
194
- reflow: function reflow(element) {
195
- return element.offsetHeight;
196
- },
197
- triggerTransitionEnd: function triggerTransitionEnd(element) {
198
- $(element).trigger(TRANSITION_END);
199
- },
200
- // TODO: Remove in v5
201
- supportsTransitionEnd: function supportsTransitionEnd() {
202
- return Boolean(TRANSITION_END);
203
- },
204
- isElement: function isElement(obj) {
205
- return (obj[0] || obj).nodeType;
206
- },
207
- typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
208
- for (var property in configTypes) {
209
- if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
210
- var expectedTypes = configTypes[property];
211
- var value = config[property];
212
- var valueType = value && Util.isElement(value) ? 'element' : toType(value);
213
-
214
- if (!new RegExp(expectedTypes).test(valueType)) {
215
- throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
216
- }
217
- }
218
- }
219
- },
220
- findShadowRoot: function findShadowRoot(element) {
221
- if (!document.documentElement.attachShadow) {
222
- return null;
223
- } // Can find the shadow root otherwise it'll return the document
224
-
225
-
226
- if (typeof element.getRootNode === 'function') {
227
- var root = element.getRootNode();
228
- return root instanceof ShadowRoot ? root : null;
229
- }
230
-
231
- if (element instanceof ShadowRoot) {
232
- return element;
233
- } // when we don't find a shadow root
234
-
235
-
236
- if (!element.parentNode) {
237
- return null;
238
- }
239
-
240
- return Util.findShadowRoot(element.parentNode);
241
- },
242
- jQueryDetection: function jQueryDetection() {
243
- if (typeof $ === 'undefined') {
244
- throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
245
- }
246
-
247
- var version = $.fn.jquery.split(' ')[0].split('.');
248
- var minMajor = 1;
249
- var ltMajor = 2;
250
- var minMinor = 9;
251
- var minPatch = 1;
252
- var maxMajor = 4;
253
-
254
- if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
255
- throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
256
- }
257
- }
258
- };
259
- Util.jQueryDetection();
260
- setTransitionEndSupport();
261
-
262
- /**
263
- * ------------------------------------------------------------------------
264
- * Constants
265
- * ------------------------------------------------------------------------
266
- */
267
-
268
- var NAME = 'alert';
269
- var VERSION = '4.5.0';
270
- var DATA_KEY = 'bs.alert';
271
- var EVENT_KEY = "." + DATA_KEY;
272
- var DATA_API_KEY = '.data-api';
273
- var JQUERY_NO_CONFLICT = $.fn[NAME];
274
- var SELECTOR_DISMISS = '[data-dismiss="alert"]';
275
- var EVENT_CLOSE = "close" + EVENT_KEY;
276
- var EVENT_CLOSED = "closed" + EVENT_KEY;
277
- var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
278
- var CLASS_NAME_ALERT = 'alert';
279
- var CLASS_NAME_FADE = 'fade';
280
- var CLASS_NAME_SHOW = 'show';
281
- /**
282
- * ------------------------------------------------------------------------
283
- * Class Definition
284
- * ------------------------------------------------------------------------
285
- */
286
-
287
- var Alert = /*#__PURE__*/function () {
288
- function Alert(element) {
289
- this._element = element;
290
- } // Getters
291
-
292
-
293
- var _proto = Alert.prototype;
294
-
295
- // Public
296
- _proto.close = function close(element) {
297
- var rootElement = this._element;
298
-
299
- if (element) {
300
- rootElement = this._getRootElement(element);
301
- }
302
-
303
- var customEvent = this._triggerCloseEvent(rootElement);
304
-
305
- if (customEvent.isDefaultPrevented()) {
306
- return;
307
- }
308
-
309
- this._removeElement(rootElement);
310
- };
311
-
312
- _proto.dispose = function dispose() {
313
- $.removeData(this._element, DATA_KEY);
314
- this._element = null;
315
- } // Private
316
- ;
317
-
318
- _proto._getRootElement = function _getRootElement(element) {
319
- var selector = Util.getSelectorFromElement(element);
320
- var parent = false;
321
-
322
- if (selector) {
323
- parent = document.querySelector(selector);
324
- }
325
-
326
- if (!parent) {
327
- parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
328
- }
329
-
330
- return parent;
331
- };
332
-
333
- _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
334
- var closeEvent = $.Event(EVENT_CLOSE);
335
- $(element).trigger(closeEvent);
336
- return closeEvent;
337
- };
338
-
339
- _proto._removeElement = function _removeElement(element) {
340
- var _this = this;
341
-
342
- $(element).removeClass(CLASS_NAME_SHOW);
343
-
344
- if (!$(element).hasClass(CLASS_NAME_FADE)) {
345
- this._destroyElement(element);
346
-
347
- return;
348
- }
349
-
350
- var transitionDuration = Util.getTransitionDurationFromElement(element);
351
- $(element).one(Util.TRANSITION_END, function (event) {
352
- return _this._destroyElement(element, event);
353
- }).emulateTransitionEnd(transitionDuration);
354
- };
355
-
356
- _proto._destroyElement = function _destroyElement(element) {
357
- $(element).detach().trigger(EVENT_CLOSED).remove();
358
- } // Static
359
- ;
360
-
361
- Alert._jQueryInterface = function _jQueryInterface(config) {
362
- return this.each(function () {
363
- var $element = $(this);
364
- var data = $element.data(DATA_KEY);
365
-
366
- if (!data) {
367
- data = new Alert(this);
368
- $element.data(DATA_KEY, data);
369
- }
370
-
371
- if (config === 'close') {
372
- data[config](this);
373
- }
374
- });
375
- };
376
-
377
- Alert._handleDismiss = function _handleDismiss(alertInstance) {
378
- return function (event) {
379
- if (event) {
380
- event.preventDefault();
381
- }
382
-
383
- alertInstance.close(this);
384
- };
385
- };
386
-
387
- _createClass(Alert, null, [{
388
- key: "VERSION",
389
- get: function get() {
390
- return VERSION;
391
- }
392
- }]);
393
-
394
- return Alert;
395
- }();
396
- /**
397
- * ------------------------------------------------------------------------
398
- * Data Api implementation
399
- * ------------------------------------------------------------------------
400
- */
401
-
402
-
403
- $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
404
- /**
405
- * ------------------------------------------------------------------------
406
- * jQuery
407
- * ------------------------------------------------------------------------
408
- */
409
-
410
- $.fn[NAME] = Alert._jQueryInterface;
411
- $.fn[NAME].Constructor = Alert;
412
-
413
- $.fn[NAME].noConflict = function () {
414
- $.fn[NAME] = JQUERY_NO_CONFLICT;
415
- return Alert._jQueryInterface;
416
- };
417
-
418
- /**
419
- * ------------------------------------------------------------------------
420
- * Constants
421
- * ------------------------------------------------------------------------
422
- */
423
-
424
- var NAME$1 = 'button';
425
- var VERSION$1 = '4.5.0';
426
- var DATA_KEY$1 = 'bs.button';
427
- var EVENT_KEY$1 = "." + DATA_KEY$1;
428
- var DATA_API_KEY$1 = '.data-api';
429
- var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
430
- var CLASS_NAME_ACTIVE = 'active';
431
- var CLASS_NAME_BUTTON = 'btn';
432
- var CLASS_NAME_FOCUS = 'focus';
433
- var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
434
- var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
435
- var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
436
- var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
437
- var SELECTOR_INPUT = 'input:not([type="hidden"])';
438
- var SELECTOR_ACTIVE = '.active';
439
- var SELECTOR_BUTTON = '.btn';
440
- var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
441
- var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1);
442
- var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1;
443
- /**
444
- * ------------------------------------------------------------------------
445
- * Class Definition
446
- * ------------------------------------------------------------------------
447
- */
448
-
449
- var Button = /*#__PURE__*/function () {
450
- function Button(element) {
451
- this._element = element;
452
- } // Getters
453
-
454
-
455
- var _proto = Button.prototype;
456
-
457
- // Public
458
- _proto.toggle = function toggle() {
459
- var triggerChangeEvent = true;
460
- var addAriaPressed = true;
461
- var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
462
-
463
- if (rootElement) {
464
- var input = this._element.querySelector(SELECTOR_INPUT);
465
-
466
- if (input) {
467
- if (input.type === 'radio') {
468
- if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
469
- triggerChangeEvent = false;
470
- } else {
471
- var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
472
-
473
- if (activeElement) {
474
- $(activeElement).removeClass(CLASS_NAME_ACTIVE);
475
- }
476
- }
477
- }
478
-
479
- if (triggerChangeEvent) {
480
- // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
481
- if (input.type === 'checkbox' || input.type === 'radio') {
482
- input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
483
- }
484
-
485
- $(input).trigger('change');
486
- }
487
-
488
- input.focus();
489
- addAriaPressed = false;
490
- }
491
- }
492
-
493
- if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
494
- if (addAriaPressed) {
495
- this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
496
- }
497
-
498
- if (triggerChangeEvent) {
499
- $(this._element).toggleClass(CLASS_NAME_ACTIVE);
500
- }
501
- }
502
- };
503
-
504
- _proto.dispose = function dispose() {
505
- $.removeData(this._element, DATA_KEY$1);
506
- this._element = null;
507
- } // Static
508
- ;
509
-
510
- Button._jQueryInterface = function _jQueryInterface(config) {
511
- return this.each(function () {
512
- var data = $(this).data(DATA_KEY$1);
513
-
514
- if (!data) {
515
- data = new Button(this);
516
- $(this).data(DATA_KEY$1, data);
517
- }
518
-
519
- if (config === 'toggle') {
520
- data[config]();
521
- }
522
- });
523
- };
524
-
525
- _createClass(Button, null, [{
526
- key: "VERSION",
527
- get: function get() {
528
- return VERSION$1;
529
- }
530
- }]);
531
-
532
- return Button;
533
- }();
534
- /**
535
- * ------------------------------------------------------------------------
536
- * Data Api implementation
537
- * ------------------------------------------------------------------------
538
- */
539
-
540
-
541
- $(document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
542
- var button = event.target;
543
- var initialButton = button;
544
-
545
- if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
546
- button = $(button).closest(SELECTOR_BUTTON)[0];
547
- }
548
-
549
- if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
550
- event.preventDefault(); // work around Firefox bug #1540995
551
- } else {
552
- var inputBtn = button.querySelector(SELECTOR_INPUT);
553
-
554
- if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
555
- event.preventDefault(); // work around Firefox bug #1540995
556
-
557
- return;
558
- }
559
-
560
- if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
561
- event.preventDefault(); // work around event sent to label and input
562
- }
563
-
564
- Button._jQueryInterface.call($(button), 'toggle');
565
- }
566
- }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
567
- var button = $(event.target).closest(SELECTOR_BUTTON)[0];
568
- $(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
569
- });
570
- $(window).on(EVENT_LOAD_DATA_API, function () {
571
- // ensure correct active class is set to match the controls' actual values/states
572
- // find all checkboxes/readio buttons inside data-toggle groups
573
- var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
574
-
575
- for (var i = 0, len = buttons.length; i < len; i++) {
576
- var button = buttons[i];
577
- var input = button.querySelector(SELECTOR_INPUT);
578
-
579
- if (input.checked || input.hasAttribute('checked')) {
580
- button.classList.add(CLASS_NAME_ACTIVE);
581
- } else {
582
- button.classList.remove(CLASS_NAME_ACTIVE);
583
- }
584
- } // find all button toggles
585
-
586
-
587
- buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
588
-
589
- for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
590
- var _button = buttons[_i];
591
-
592
- if (_button.getAttribute('aria-pressed') === 'true') {
593
- _button.classList.add(CLASS_NAME_ACTIVE);
594
- } else {
595
- _button.classList.remove(CLASS_NAME_ACTIVE);
596
- }
597
- }
598
- });
599
- /**
600
- * ------------------------------------------------------------------------
601
- * jQuery
602
- * ------------------------------------------------------------------------
603
- */
604
-
605
- $.fn[NAME$1] = Button._jQueryInterface;
606
- $.fn[NAME$1].Constructor = Button;
607
-
608
- $.fn[NAME$1].noConflict = function () {
609
- $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
610
- return Button._jQueryInterface;
611
- };
612
-
613
- /**
614
- * ------------------------------------------------------------------------
615
- * Constants
616
- * ------------------------------------------------------------------------
617
- */
618
-
619
- var NAME$2 = 'carousel';
620
- var VERSION$2 = '4.5.0';
621
- var DATA_KEY$2 = 'bs.carousel';
622
- var EVENT_KEY$2 = "." + DATA_KEY$2;
623
- var DATA_API_KEY$2 = '.data-api';
624
- var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
625
- var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
626
-
627
- var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
628
-
629
- var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
630
-
631
- var SWIPE_THRESHOLD = 40;
632
- var Default = {
633
- interval: 5000,
634
- keyboard: true,
635
- slide: false,
636
- pause: 'hover',
637
- wrap: true,
638
- touch: true
639
- };
640
- var DefaultType = {
641
- interval: '(number|boolean)',
642
- keyboard: 'boolean',
643
- slide: '(boolean|string)',
644
- pause: '(string|boolean)',
645
- wrap: 'boolean',
646
- touch: 'boolean'
647
- };
648
- var DIRECTION_NEXT = 'next';
649
- var DIRECTION_PREV = 'prev';
650
- var DIRECTION_LEFT = 'left';
651
- var DIRECTION_RIGHT = 'right';
652
- var EVENT_SLIDE = "slide" + EVENT_KEY$2;
653
- var EVENT_SLID = "slid" + EVENT_KEY$2;
654
- var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
655
- var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
656
- var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
657
- var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
658
- var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
659
- var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
660
- var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
661
- var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
662
- var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
663
- var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
664
- var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
665
- var CLASS_NAME_CAROUSEL = 'carousel';
666
- var CLASS_NAME_ACTIVE$1 = 'active';
667
- var CLASS_NAME_SLIDE = 'slide';
668
- var CLASS_NAME_RIGHT = 'carousel-item-right';
669
- var CLASS_NAME_LEFT = 'carousel-item-left';
670
- var CLASS_NAME_NEXT = 'carousel-item-next';
671
- var CLASS_NAME_PREV = 'carousel-item-prev';
672
- var CLASS_NAME_POINTER_EVENT = 'pointer-event';
673
- var SELECTOR_ACTIVE$1 = '.active';
674
- var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
675
- var SELECTOR_ITEM = '.carousel-item';
676
- var SELECTOR_ITEM_IMG = '.carousel-item img';
677
- var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
678
- var SELECTOR_INDICATORS = '.carousel-indicators';
679
- var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
680
- var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
681
- var PointerType = {
682
- TOUCH: 'touch',
683
- PEN: 'pen'
684
- };
685
- /**
686
- * ------------------------------------------------------------------------
687
- * Class Definition
688
- * ------------------------------------------------------------------------
689
- */
690
-
691
- var Carousel = /*#__PURE__*/function () {
692
- function Carousel(element, config) {
693
- this._items = null;
694
- this._interval = null;
695
- this._activeElement = null;
696
- this._isPaused = false;
697
- this._isSliding = false;
698
- this.touchTimeout = null;
699
- this.touchStartX = 0;
700
- this.touchDeltaX = 0;
701
- this._config = this._getConfig(config);
702
- this._element = element;
703
- this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
704
- this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
705
- this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
706
-
707
- this._addEventListeners();
708
- } // Getters
709
-
710
-
711
- var _proto = Carousel.prototype;
712
-
713
- // Public
714
- _proto.next = function next() {
715
- if (!this._isSliding) {
716
- this._slide(DIRECTION_NEXT);
717
- }
718
- };
719
-
720
- _proto.nextWhenVisible = function nextWhenVisible() {
721
- // Don't call next when the page isn't visible
722
- // or the carousel or its parent isn't visible
723
- if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
724
- this.next();
725
- }
726
- };
727
-
728
- _proto.prev = function prev() {
729
- if (!this._isSliding) {
730
- this._slide(DIRECTION_PREV);
731
- }
732
- };
733
-
734
- _proto.pause = function pause(event) {
735
- if (!event) {
736
- this._isPaused = true;
737
- }
738
-
739
- if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
740
- Util.triggerTransitionEnd(this._element);
741
- this.cycle(true);
742
- }
743
-
744
- clearInterval(this._interval);
745
- this._interval = null;
746
- };
747
-
748
- _proto.cycle = function cycle(event) {
749
- if (!event) {
750
- this._isPaused = false;
751
- }
752
-
753
- if (this._interval) {
754
- clearInterval(this._interval);
755
- this._interval = null;
756
- }
757
-
758
- if (this._config.interval && !this._isPaused) {
759
- this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
760
- }
761
- };
762
-
763
- _proto.to = function to(index) {
764
- var _this = this;
765
-
766
- this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
767
-
768
- var activeIndex = this._getItemIndex(this._activeElement);
769
-
770
- if (index > this._items.length - 1 || index < 0) {
771
- return;
772
- }
773
-
774
- if (this._isSliding) {
775
- $(this._element).one(EVENT_SLID, function () {
776
- return _this.to(index);
777
- });
778
- return;
779
- }
780
-
781
- if (activeIndex === index) {
782
- this.pause();
783
- this.cycle();
784
- return;
785
- }
786
-
787
- var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
788
-
789
- this._slide(direction, this._items[index]);
790
- };
791
-
792
- _proto.dispose = function dispose() {
793
- $(this._element).off(EVENT_KEY$2);
794
- $.removeData(this._element, DATA_KEY$2);
795
- this._items = null;
796
- this._config = null;
797
- this._element = null;
798
- this._interval = null;
799
- this._isPaused = null;
800
- this._isSliding = null;
801
- this._activeElement = null;
802
- this._indicatorsElement = null;
803
- } // Private
804
- ;
805
-
806
- _proto._getConfig = function _getConfig(config) {
807
- config = _objectSpread2(_objectSpread2({}, Default), config);
808
- Util.typeCheckConfig(NAME$2, config, DefaultType);
809
- return config;
810
- };
811
-
812
- _proto._handleSwipe = function _handleSwipe() {
813
- var absDeltax = Math.abs(this.touchDeltaX);
814
-
815
- if (absDeltax <= SWIPE_THRESHOLD) {
816
- return;
817
- }
818
-
819
- var direction = absDeltax / this.touchDeltaX;
820
- this.touchDeltaX = 0; // swipe left
821
-
822
- if (direction > 0) {
823
- this.prev();
824
- } // swipe right
825
-
826
-
827
- if (direction < 0) {
828
- this.next();
829
- }
830
- };
831
-
832
- _proto._addEventListeners = function _addEventListeners() {
833
- var _this2 = this;
834
-
835
- if (this._config.keyboard) {
836
- $(this._element).on(EVENT_KEYDOWN, function (event) {
837
- return _this2._keydown(event);
838
- });
839
- }
840
-
841
- if (this._config.pause === 'hover') {
842
- $(this._element).on(EVENT_MOUSEENTER, function (event) {
843
- return _this2.pause(event);
844
- }).on(EVENT_MOUSELEAVE, function (event) {
845
- return _this2.cycle(event);
846
- });
847
- }
848
-
849
- if (this._config.touch) {
850
- this._addTouchEventListeners();
851
- }
852
- };
853
-
854
- _proto._addTouchEventListeners = function _addTouchEventListeners() {
855
- var _this3 = this;
856
-
857
- if (!this._touchSupported) {
858
- return;
859
- }
860
-
861
- var start = function start(event) {
862
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
863
- _this3.touchStartX = event.originalEvent.clientX;
864
- } else if (!_this3._pointerEvent) {
865
- _this3.touchStartX = event.originalEvent.touches[0].clientX;
866
- }
867
- };
868
-
869
- var move = function move(event) {
870
- // ensure swiping with one touch and not pinching
871
- if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
872
- _this3.touchDeltaX = 0;
873
- } else {
874
- _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
875
- }
876
- };
877
-
878
- var end = function end(event) {
879
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
880
- _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
881
- }
882
-
883
- _this3._handleSwipe();
884
-
885
- if (_this3._config.pause === 'hover') {
886
- // If it's a touch-enabled device, mouseenter/leave are fired as
887
- // part of the mouse compatibility events on first tap - the carousel
888
- // would stop cycling until user tapped out of it;
889
- // here, we listen for touchend, explicitly pause the carousel
890
- // (as if it's the second time we tap on it, mouseenter compat event
891
- // is NOT fired) and after a timeout (to allow for mouse compatibility
892
- // events to fire) we explicitly restart cycling
893
- _this3.pause();
894
-
895
- if (_this3.touchTimeout) {
896
- clearTimeout(_this3.touchTimeout);
897
- }
898
-
899
- _this3.touchTimeout = setTimeout(function (event) {
900
- return _this3.cycle(event);
901
- }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
902
- }
903
- };
904
-
905
- $(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
906
- return e.preventDefault();
907
- });
908
-
909
- if (this._pointerEvent) {
910
- $(this._element).on(EVENT_POINTERDOWN, function (event) {
911
- return start(event);
912
- });
913
- $(this._element).on(EVENT_POINTERUP, function (event) {
914
- return end(event);
915
- });
916
-
917
- this._element.classList.add(CLASS_NAME_POINTER_EVENT);
918
- } else {
919
- $(this._element).on(EVENT_TOUCHSTART, function (event) {
920
- return start(event);
921
- });
922
- $(this._element).on(EVENT_TOUCHMOVE, function (event) {
923
- return move(event);
924
- });
925
- $(this._element).on(EVENT_TOUCHEND, function (event) {
926
- return end(event);
927
- });
928
- }
929
- };
930
-
931
- _proto._keydown = function _keydown(event) {
932
- if (/input|textarea/i.test(event.target.tagName)) {
933
- return;
934
- }
935
-
936
- switch (event.which) {
937
- case ARROW_LEFT_KEYCODE:
938
- event.preventDefault();
939
- this.prev();
940
- break;
941
-
942
- case ARROW_RIGHT_KEYCODE:
943
- event.preventDefault();
944
- this.next();
945
- break;
946
- }
947
- };
948
-
949
- _proto._getItemIndex = function _getItemIndex(element) {
950
- this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
951
- return this._items.indexOf(element);
952
- };
953
-
954
- _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
955
- var isNextDirection = direction === DIRECTION_NEXT;
956
- var isPrevDirection = direction === DIRECTION_PREV;
957
-
958
- var activeIndex = this._getItemIndex(activeElement);
959
-
960
- var lastItemIndex = this._items.length - 1;
961
- var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
962
-
963
- if (isGoingToWrap && !this._config.wrap) {
964
- return activeElement;
965
- }
966
-
967
- var delta = direction === DIRECTION_PREV ? -1 : 1;
968
- var itemIndex = (activeIndex + delta) % this._items.length;
969
- return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
970
- };
971
-
972
- _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
973
- var targetIndex = this._getItemIndex(relatedTarget);
974
-
975
- var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
976
-
977
- var slideEvent = $.Event(EVENT_SLIDE, {
978
- relatedTarget: relatedTarget,
979
- direction: eventDirectionName,
980
- from: fromIndex,
981
- to: targetIndex
982
- });
983
- $(this._element).trigger(slideEvent);
984
- return slideEvent;
985
- };
986
-
987
- _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
988
- if (this._indicatorsElement) {
989
- var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));
990
- $(indicators).removeClass(CLASS_NAME_ACTIVE$1);
991
-
992
- var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
993
-
994
- if (nextIndicator) {
995
- $(nextIndicator).addClass(CLASS_NAME_ACTIVE$1);
996
- }
997
- }
998
- };
999
-
1000
- _proto._slide = function _slide(direction, element) {
1001
- var _this4 = this;
1002
-
1003
- var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
1004
-
1005
- var activeElementIndex = this._getItemIndex(activeElement);
1006
-
1007
- var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
1008
-
1009
- var nextElementIndex = this._getItemIndex(nextElement);
1010
-
1011
- var isCycling = Boolean(this._interval);
1012
- var directionalClassName;
1013
- var orderClassName;
1014
- var eventDirectionName;
1015
-
1016
- if (direction === DIRECTION_NEXT) {
1017
- directionalClassName = CLASS_NAME_LEFT;
1018
- orderClassName = CLASS_NAME_NEXT;
1019
- eventDirectionName = DIRECTION_LEFT;
1020
- } else {
1021
- directionalClassName = CLASS_NAME_RIGHT;
1022
- orderClassName = CLASS_NAME_PREV;
1023
- eventDirectionName = DIRECTION_RIGHT;
1024
- }
1025
-
1026
- if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {
1027
- this._isSliding = false;
1028
- return;
1029
- }
1030
-
1031
- var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
1032
-
1033
- if (slideEvent.isDefaultPrevented()) {
1034
- return;
1035
- }
1036
-
1037
- if (!activeElement || !nextElement) {
1038
- // Some weirdness is happening, so we bail
1039
- return;
1040
- }
1041
-
1042
- this._isSliding = true;
1043
-
1044
- if (isCycling) {
1045
- this.pause();
1046
- }
1047
-
1048
- this._setActiveIndicatorElement(nextElement);
1049
-
1050
- var slidEvent = $.Event(EVENT_SLID, {
1051
- relatedTarget: nextElement,
1052
- direction: eventDirectionName,
1053
- from: activeElementIndex,
1054
- to: nextElementIndex
1055
- });
1056
-
1057
- if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
1058
- $(nextElement).addClass(orderClassName);
1059
- Util.reflow(nextElement);
1060
- $(activeElement).addClass(directionalClassName);
1061
- $(nextElement).addClass(directionalClassName);
1062
- var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
1063
-
1064
- if (nextElementInterval) {
1065
- this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
1066
- this._config.interval = nextElementInterval;
1067
- } else {
1068
- this._config.interval = this._config.defaultInterval || this._config.interval;
1069
- }
1070
-
1071
- var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
1072
- $(activeElement).one(Util.TRANSITION_END, function () {
1073
- $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1);
1074
- $(activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName);
1075
- _this4._isSliding = false;
1076
- setTimeout(function () {
1077
- return $(_this4._element).trigger(slidEvent);
1078
- }, 0);
1079
- }).emulateTransitionEnd(transitionDuration);
1080
- } else {
1081
- $(activeElement).removeClass(CLASS_NAME_ACTIVE$1);
1082
- $(nextElement).addClass(CLASS_NAME_ACTIVE$1);
1083
- this._isSliding = false;
1084
- $(this._element).trigger(slidEvent);
1085
- }
1086
-
1087
- if (isCycling) {
1088
- this.cycle();
1089
- }
1090
- } // Static
1091
- ;
1092
-
1093
- Carousel._jQueryInterface = function _jQueryInterface(config) {
1094
- return this.each(function () {
1095
- var data = $(this).data(DATA_KEY$2);
1096
-
1097
- var _config = _objectSpread2(_objectSpread2({}, Default), $(this).data());
1098
-
1099
- if (typeof config === 'object') {
1100
- _config = _objectSpread2(_objectSpread2({}, _config), config);
1101
- }
1102
-
1103
- var action = typeof config === 'string' ? config : _config.slide;
1104
-
1105
- if (!data) {
1106
- data = new Carousel(this, _config);
1107
- $(this).data(DATA_KEY$2, data);
1108
- }
1109
-
1110
- if (typeof config === 'number') {
1111
- data.to(config);
1112
- } else if (typeof action === 'string') {
1113
- if (typeof data[action] === 'undefined') {
1114
- throw new TypeError("No method named \"" + action + "\"");
1115
- }
1116
-
1117
- data[action]();
1118
- } else if (_config.interval && _config.ride) {
1119
- data.pause();
1120
- data.cycle();
1121
- }
1122
- });
1123
- };
1124
-
1125
- Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
1126
- var selector = Util.getSelectorFromElement(this);
1127
-
1128
- if (!selector) {
1129
- return;
1130
- }
1131
-
1132
- var target = $(selector)[0];
1133
-
1134
- if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
1135
- return;
1136
- }
1137
-
1138
- var config = _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
1139
-
1140
- var slideIndex = this.getAttribute('data-slide-to');
1141
-
1142
- if (slideIndex) {
1143
- config.interval = false;
1144
- }
1145
-
1146
- Carousel._jQueryInterface.call($(target), config);
1147
-
1148
- if (slideIndex) {
1149
- $(target).data(DATA_KEY$2).to(slideIndex);
1150
- }
1151
-
1152
- event.preventDefault();
1153
- };
1154
-
1155
- _createClass(Carousel, null, [{
1156
- key: "VERSION",
1157
- get: function get() {
1158
- return VERSION$2;
1159
- }
1160
- }, {
1161
- key: "Default",
1162
- get: function get() {
1163
- return Default;
1164
- }
1165
- }]);
1166
-
1167
- return Carousel;
1168
- }();
1169
- /**
1170
- * ------------------------------------------------------------------------
1171
- * Data Api implementation
1172
- * ------------------------------------------------------------------------
1173
- */
1174
-
1175
-
1176
- $(document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
1177
- $(window).on(EVENT_LOAD_DATA_API$1, function () {
1178
- var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
1179
-
1180
- for (var i = 0, len = carousels.length; i < len; i++) {
1181
- var $carousel = $(carousels[i]);
1182
-
1183
- Carousel._jQueryInterface.call($carousel, $carousel.data());
1184
- }
1185
- });
1186
- /**
1187
- * ------------------------------------------------------------------------
1188
- * jQuery
1189
- * ------------------------------------------------------------------------
1190
- */
1191
-
1192
- $.fn[NAME$2] = Carousel._jQueryInterface;
1193
- $.fn[NAME$2].Constructor = Carousel;
1194
-
1195
- $.fn[NAME$2].noConflict = function () {
1196
- $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
1197
- return Carousel._jQueryInterface;
1198
- };
1199
-
1200
- /**
1201
- * ------------------------------------------------------------------------
1202
- * Constants
1203
- * ------------------------------------------------------------------------
1204
- */
1205
-
1206
- var NAME$3 = 'collapse';
1207
- var VERSION$3 = '4.5.0';
1208
- var DATA_KEY$3 = 'bs.collapse';
1209
- var EVENT_KEY$3 = "." + DATA_KEY$3;
1210
- var DATA_API_KEY$3 = '.data-api';
1211
- var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
1212
- var Default$1 = {
1213
- toggle: true,
1214
- parent: ''
1215
- };
1216
- var DefaultType$1 = {
1217
- toggle: 'boolean',
1218
- parent: '(string|element)'
1219
- };
1220
- var EVENT_SHOW = "show" + EVENT_KEY$3;
1221
- var EVENT_SHOWN = "shown" + EVENT_KEY$3;
1222
- var EVENT_HIDE = "hide" + EVENT_KEY$3;
1223
- var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
1224
- var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
1225
- var CLASS_NAME_SHOW$1 = 'show';
1226
- var CLASS_NAME_COLLAPSE = 'collapse';
1227
- var CLASS_NAME_COLLAPSING = 'collapsing';
1228
- var CLASS_NAME_COLLAPSED = 'collapsed';
1229
- var DIMENSION_WIDTH = 'width';
1230
- var DIMENSION_HEIGHT = 'height';
1231
- var SELECTOR_ACTIVES = '.show, .collapsing';
1232
- var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
1233
- /**
1234
- * ------------------------------------------------------------------------
1235
- * Class Definition
1236
- * ------------------------------------------------------------------------
1237
- */
1238
-
1239
- var Collapse = /*#__PURE__*/function () {
1240
- function Collapse(element, config) {
1241
- this._isTransitioning = false;
1242
- this._element = element;
1243
- this._config = this._getConfig(config);
1244
- this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
1245
- var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));
1246
-
1247
- for (var i = 0, len = toggleList.length; i < len; i++) {
1248
- var elem = toggleList[i];
1249
- var selector = Util.getSelectorFromElement(elem);
1250
- var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
1251
- return foundElem === element;
1252
- });
1253
-
1254
- if (selector !== null && filterElement.length > 0) {
1255
- this._selector = selector;
1256
-
1257
- this._triggerArray.push(elem);
1258
- }
1259
- }
1260
-
1261
- this._parent = this._config.parent ? this._getParent() : null;
1262
-
1263
- if (!this._config.parent) {
1264
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1265
- }
1266
-
1267
- if (this._config.toggle) {
1268
- this.toggle();
1269
- }
1270
- } // Getters
1271
-
1272
-
1273
- var _proto = Collapse.prototype;
1274
-
1275
- // Public
1276
- _proto.toggle = function toggle() {
1277
- if ($(this._element).hasClass(CLASS_NAME_SHOW$1)) {
1278
- this.hide();
1279
- } else {
1280
- this.show();
1281
- }
1282
- };
1283
-
1284
- _proto.show = function show() {
1285
- var _this = this;
1286
-
1287
- if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW$1)) {
1288
- return;
1289
- }
1290
-
1291
- var actives;
1292
- var activesData;
1293
-
1294
- if (this._parent) {
1295
- actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
1296
- if (typeof _this._config.parent === 'string') {
1297
- return elem.getAttribute('data-parent') === _this._config.parent;
1298
- }
1299
-
1300
- return elem.classList.contains(CLASS_NAME_COLLAPSE);
1301
- });
1302
-
1303
- if (actives.length === 0) {
1304
- actives = null;
1305
- }
1306
- }
1307
-
1308
- if (actives) {
1309
- activesData = $(actives).not(this._selector).data(DATA_KEY$3);
1310
-
1311
- if (activesData && activesData._isTransitioning) {
1312
- return;
1313
- }
1314
- }
1315
-
1316
- var startEvent = $.Event(EVENT_SHOW);
1317
- $(this._element).trigger(startEvent);
1318
-
1319
- if (startEvent.isDefaultPrevented()) {
1320
- return;
1321
- }
1322
-
1323
- if (actives) {
1324
- Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
1325
-
1326
- if (!activesData) {
1327
- $(actives).data(DATA_KEY$3, null);
1328
- }
1329
- }
1330
-
1331
- var dimension = this._getDimension();
1332
-
1333
- $(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
1334
- this._element.style[dimension] = 0;
1335
-
1336
- if (this._triggerArray.length) {
1337
- $(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
1338
- }
1339
-
1340
- this.setTransitioning(true);
1341
-
1342
- var complete = function complete() {
1343
- $(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
1344
- _this._element.style[dimension] = '';
1345
-
1346
- _this.setTransitioning(false);
1347
-
1348
- $(_this._element).trigger(EVENT_SHOWN);
1349
- };
1350
-
1351
- var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1352
- var scrollSize = "scroll" + capitalizedDimension;
1353
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
1354
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
1355
- this._element.style[dimension] = this._element[scrollSize] + "px";
1356
- };
1357
-
1358
- _proto.hide = function hide() {
1359
- var _this2 = this;
1360
-
1361
- if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW$1)) {
1362
- return;
1363
- }
1364
-
1365
- var startEvent = $.Event(EVENT_HIDE);
1366
- $(this._element).trigger(startEvent);
1367
-
1368
- if (startEvent.isDefaultPrevented()) {
1369
- return;
1370
- }
1371
-
1372
- var dimension = this._getDimension();
1373
-
1374
- this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
1375
- Util.reflow(this._element);
1376
- $(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
1377
- var triggerArrayLength = this._triggerArray.length;
1378
-
1379
- if (triggerArrayLength > 0) {
1380
- for (var i = 0; i < triggerArrayLength; i++) {
1381
- var trigger = this._triggerArray[i];
1382
- var selector = Util.getSelectorFromElement(trigger);
1383
-
1384
- if (selector !== null) {
1385
- var $elem = $([].slice.call(document.querySelectorAll(selector)));
1386
-
1387
- if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {
1388
- $(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
1389
- }
1390
- }
1391
- }
1392
- }
1393
-
1394
- this.setTransitioning(true);
1395
-
1396
- var complete = function complete() {
1397
- _this2.setTransitioning(false);
1398
-
1399
- $(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
1400
- };
1401
-
1402
- this._element.style[dimension] = '';
1403
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
1404
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
1405
- };
1406
-
1407
- _proto.setTransitioning = function setTransitioning(isTransitioning) {
1408
- this._isTransitioning = isTransitioning;
1409
- };
1410
-
1411
- _proto.dispose = function dispose() {
1412
- $.removeData(this._element, DATA_KEY$3);
1413
- this._config = null;
1414
- this._parent = null;
1415
- this._element = null;
1416
- this._triggerArray = null;
1417
- this._isTransitioning = null;
1418
- } // Private
1419
- ;
1420
-
1421
- _proto._getConfig = function _getConfig(config) {
1422
- config = _objectSpread2(_objectSpread2({}, Default$1), config);
1423
- config.toggle = Boolean(config.toggle); // Coerce string values
1424
-
1425
- Util.typeCheckConfig(NAME$3, config, DefaultType$1);
1426
- return config;
1427
- };
1428
-
1429
- _proto._getDimension = function _getDimension() {
1430
- var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
1431
- return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
1432
- };
1433
-
1434
- _proto._getParent = function _getParent() {
1435
- var _this3 = this;
1436
-
1437
- var parent;
1438
-
1439
- if (Util.isElement(this._config.parent)) {
1440
- parent = this._config.parent; // It's a jQuery object
1441
-
1442
- if (typeof this._config.parent.jquery !== 'undefined') {
1443
- parent = this._config.parent[0];
1444
- }
1445
- } else {
1446
- parent = document.querySelector(this._config.parent);
1447
- }
1448
-
1449
- var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
1450
- var children = [].slice.call(parent.querySelectorAll(selector));
1451
- $(children).each(function (i, element) {
1452
- _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
1453
- });
1454
- return parent;
1455
- };
1456
-
1457
- _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
1458
- var isOpen = $(element).hasClass(CLASS_NAME_SHOW$1);
1459
-
1460
- if (triggerArray.length) {
1461
- $(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
1462
- }
1463
- } // Static
1464
- ;
1465
-
1466
- Collapse._getTargetFromElement = function _getTargetFromElement(element) {
1467
- var selector = Util.getSelectorFromElement(element);
1468
- return selector ? document.querySelector(selector) : null;
1469
- };
1470
-
1471
- Collapse._jQueryInterface = function _jQueryInterface(config) {
1472
- return this.each(function () {
1473
- var $this = $(this);
1474
- var data = $this.data(DATA_KEY$3);
1475
-
1476
- var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$1), $this.data()), typeof config === 'object' && config ? config : {});
1477
-
1478
- if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
1479
- _config.toggle = false;
1480
- }
1481
-
1482
- if (!data) {
1483
- data = new Collapse(this, _config);
1484
- $this.data(DATA_KEY$3, data);
1485
- }
1486
-
1487
- if (typeof config === 'string') {
1488
- if (typeof data[config] === 'undefined') {
1489
- throw new TypeError("No method named \"" + config + "\"");
1490
- }
1491
-
1492
- data[config]();
1493
- }
1494
- });
1495
- };
1496
-
1497
- _createClass(Collapse, null, [{
1498
- key: "VERSION",
1499
- get: function get() {
1500
- return VERSION$3;
1501
- }
1502
- }, {
1503
- key: "Default",
1504
- get: function get() {
1505
- return Default$1;
1506
- }
1507
- }]);
1508
-
1509
- return Collapse;
1510
- }();
1511
- /**
1512
- * ------------------------------------------------------------------------
1513
- * Data Api implementation
1514
- * ------------------------------------------------------------------------
1515
- */
1516
-
1517
-
1518
- $(document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
1519
- // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
1520
- if (event.currentTarget.tagName === 'A') {
1521
- event.preventDefault();
1522
- }
1523
-
1524
- var $trigger = $(this);
1525
- var selector = Util.getSelectorFromElement(this);
1526
- var selectors = [].slice.call(document.querySelectorAll(selector));
1527
- $(selectors).each(function () {
1528
- var $target = $(this);
1529
- var data = $target.data(DATA_KEY$3);
1530
- var config = data ? 'toggle' : $trigger.data();
1531
-
1532
- Collapse._jQueryInterface.call($target, config);
1533
- });
1534
- });
1535
- /**
1536
- * ------------------------------------------------------------------------
1537
- * jQuery
1538
- * ------------------------------------------------------------------------
1539
- */
1540
-
1541
- $.fn[NAME$3] = Collapse._jQueryInterface;
1542
- $.fn[NAME$3].Constructor = Collapse;
1543
-
1544
- $.fn[NAME$3].noConflict = function () {
1545
- $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
1546
- return Collapse._jQueryInterface;
1547
- };
1548
-
1549
- /**
1550
- * ------------------------------------------------------------------------
1551
- * Constants
1552
- * ------------------------------------------------------------------------
1553
- */
1554
-
1555
- var NAME$4 = 'dropdown';
1556
- var VERSION$4 = '4.5.0';
1557
- var DATA_KEY$4 = 'bs.dropdown';
1558
- var EVENT_KEY$4 = "." + DATA_KEY$4;
1559
- var DATA_API_KEY$4 = '.data-api';
1560
- var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
1561
- var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
1562
-
1563
- var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
1564
-
1565
- var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
1566
-
1567
- var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
1568
-
1569
- var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
1570
-
1571
- var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
1572
-
1573
- var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
1574
- var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
1575
- var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
1576
- var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
1577
- var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
1578
- var EVENT_CLICK = "click" + EVENT_KEY$4;
1579
- var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
1580
- var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
1581
- var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
1582
- var CLASS_NAME_DISABLED = 'disabled';
1583
- var CLASS_NAME_SHOW$2 = 'show';
1584
- var CLASS_NAME_DROPUP = 'dropup';
1585
- var CLASS_NAME_DROPRIGHT = 'dropright';
1586
- var CLASS_NAME_DROPLEFT = 'dropleft';
1587
- var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
1588
- var CLASS_NAME_POSITION_STATIC = 'position-static';
1589
- var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
1590
- var SELECTOR_FORM_CHILD = '.dropdown form';
1591
- var SELECTOR_MENU = '.dropdown-menu';
1592
- var SELECTOR_NAVBAR_NAV = '.navbar-nav';
1593
- var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
1594
- var PLACEMENT_TOP = 'top-start';
1595
- var PLACEMENT_TOPEND = 'top-end';
1596
- var PLACEMENT_BOTTOM = 'bottom-start';
1597
- var PLACEMENT_BOTTOMEND = 'bottom-end';
1598
- var PLACEMENT_RIGHT = 'right-start';
1599
- var PLACEMENT_LEFT = 'left-start';
1600
- var Default$2 = {
1601
- offset: 0,
1602
- flip: true,
1603
- boundary: 'scrollParent',
1604
- reference: 'toggle',
1605
- display: 'dynamic',
1606
- popperConfig: null
1607
- };
1608
- var DefaultType$2 = {
1609
- offset: '(number|string|function)',
1610
- flip: 'boolean',
1611
- boundary: '(string|element)',
1612
- reference: '(string|element)',
1613
- display: 'string',
1614
- popperConfig: '(null|object)'
1615
- };
1616
- /**
1617
- * ------------------------------------------------------------------------
1618
- * Class Definition
1619
- * ------------------------------------------------------------------------
1620
- */
1621
-
1622
- var Dropdown = /*#__PURE__*/function () {
1623
- function Dropdown(element, config) {
1624
- this._element = element;
1625
- this._popper = null;
1626
- this._config = this._getConfig(config);
1627
- this._menu = this._getMenuElement();
1628
- this._inNavbar = this._detectNavbar();
1629
-
1630
- this._addEventListeners();
1631
- } // Getters
1632
-
1633
-
1634
- var _proto = Dropdown.prototype;
1635
-
1636
- // Public
1637
- _proto.toggle = function toggle() {
1638
- if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
1639
- return;
1640
- }
1641
-
1642
- var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW$2);
1643
-
1644
- Dropdown._clearMenus();
1645
-
1646
- if (isActive) {
1647
- return;
1648
- }
1649
-
1650
- this.show(true);
1651
- };
1652
-
1653
- _proto.show = function show(usePopper) {
1654
- if (usePopper === void 0) {
1655
- usePopper = false;
1656
- }
1657
-
1658
- if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
1659
- return;
1660
- }
1661
-
1662
- var relatedTarget = {
1663
- relatedTarget: this._element
1664
- };
1665
- var showEvent = $.Event(EVENT_SHOW$1, relatedTarget);
1666
-
1667
- var parent = Dropdown._getParentFromElement(this._element);
1668
-
1669
- $(parent).trigger(showEvent);
1670
-
1671
- if (showEvent.isDefaultPrevented()) {
1672
- return;
1673
- } // Disable totally Popper.js for Dropdown in Navbar
1674
-
1675
-
1676
- if (!this._inNavbar && usePopper) {
1677
- /**
1678
- * Check for Popper dependency
1679
- * Popper - https://popper.js.org
1680
- */
1681
- if (typeof Popper === 'undefined') {
1682
- throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
1683
- }
1684
-
1685
- var referenceElement = this._element;
1686
-
1687
- if (this._config.reference === 'parent') {
1688
- referenceElement = parent;
1689
- } else if (Util.isElement(this._config.reference)) {
1690
- referenceElement = this._config.reference; // Check if it's jQuery element
1691
-
1692
- if (typeof this._config.reference.jquery !== 'undefined') {
1693
- referenceElement = this._config.reference[0];
1694
- }
1695
- } // If boundary is not `scrollParent`, then set position to `static`
1696
- // to allow the menu to "escape" the scroll parent's boundaries
1697
- // https://github.com/twbs/bootstrap/issues/24251
1698
-
1699
-
1700
- if (this._config.boundary !== 'scrollParent') {
1701
- $(parent).addClass(CLASS_NAME_POSITION_STATIC);
1702
- }
1703
-
1704
- this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
1705
- } // If this is a touch-enabled device we add extra
1706
- // empty mouseover listeners to the body's immediate children;
1707
- // only needed because of broken event delegation on iOS
1708
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
1709
-
1710
-
1711
- if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
1712
- $(document.body).children().on('mouseover', null, $.noop);
1713
- }
1714
-
1715
- this._element.focus();
1716
-
1717
- this._element.setAttribute('aria-expanded', true);
1718
-
1719
- $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
1720
- $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_SHOWN$1, relatedTarget));
1721
- };
1722
-
1723
- _proto.hide = function hide() {
1724
- if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
1725
- return;
1726
- }
1727
-
1728
- var relatedTarget = {
1729
- relatedTarget: this._element
1730
- };
1731
- var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
1732
-
1733
- var parent = Dropdown._getParentFromElement(this._element);
1734
-
1735
- $(parent).trigger(hideEvent);
1736
-
1737
- if (hideEvent.isDefaultPrevented()) {
1738
- return;
1739
- }
1740
-
1741
- if (this._popper) {
1742
- this._popper.destroy();
1743
- }
1744
-
1745
- $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
1746
- $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
1747
- };
1748
-
1749
- _proto.dispose = function dispose() {
1750
- $.removeData(this._element, DATA_KEY$4);
1751
- $(this._element).off(EVENT_KEY$4);
1752
- this._element = null;
1753
- this._menu = null;
1754
-
1755
- if (this._popper !== null) {
1756
- this._popper.destroy();
1757
-
1758
- this._popper = null;
1759
- }
1760
- };
1761
-
1762
- _proto.update = function update() {
1763
- this._inNavbar = this._detectNavbar();
1764
-
1765
- if (this._popper !== null) {
1766
- this._popper.scheduleUpdate();
1767
- }
1768
- } // Private
1769
- ;
1770
-
1771
- _proto._addEventListeners = function _addEventListeners() {
1772
- var _this = this;
1773
-
1774
- $(this._element).on(EVENT_CLICK, function (event) {
1775
- event.preventDefault();
1776
- event.stopPropagation();
1777
-
1778
- _this.toggle();
1779
- });
1780
- };
1781
-
1782
- _proto._getConfig = function _getConfig(config) {
1783
- config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), $(this._element).data()), config);
1784
- Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
1785
- return config;
1786
- };
1787
-
1788
- _proto._getMenuElement = function _getMenuElement() {
1789
- if (!this._menu) {
1790
- var parent = Dropdown._getParentFromElement(this._element);
1791
-
1792
- if (parent) {
1793
- this._menu = parent.querySelector(SELECTOR_MENU);
1794
- }
1795
- }
1796
-
1797
- return this._menu;
1798
- };
1799
-
1800
- _proto._getPlacement = function _getPlacement() {
1801
- var $parentDropdown = $(this._element.parentNode);
1802
- var placement = PLACEMENT_BOTTOM; // Handle dropup
1803
-
1804
- if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
1805
- placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
1806
- } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
1807
- placement = PLACEMENT_RIGHT;
1808
- } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
1809
- placement = PLACEMENT_LEFT;
1810
- } else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
1811
- placement = PLACEMENT_BOTTOMEND;
1812
- }
1813
-
1814
- return placement;
1815
- };
1816
-
1817
- _proto._detectNavbar = function _detectNavbar() {
1818
- return $(this._element).closest('.navbar').length > 0;
1819
- };
1820
-
1821
- _proto._getOffset = function _getOffset() {
1822
- var _this2 = this;
1823
-
1824
- var offset = {};
1825
-
1826
- if (typeof this._config.offset === 'function') {
1827
- offset.fn = function (data) {
1828
- data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {});
1829
- return data;
1830
- };
1831
- } else {
1832
- offset.offset = this._config.offset;
1833
- }
1834
-
1835
- return offset;
1836
- };
1837
-
1838
- _proto._getPopperConfig = function _getPopperConfig() {
1839
- var popperConfig = {
1840
- placement: this._getPlacement(),
1841
- modifiers: {
1842
- offset: this._getOffset(),
1843
- flip: {
1844
- enabled: this._config.flip
1845
- },
1846
- preventOverflow: {
1847
- boundariesElement: this._config.boundary
1848
- }
1849
- }
1850
- }; // Disable Popper.js if we have a static display
1851
-
1852
- if (this._config.display === 'static') {
1853
- popperConfig.modifiers.applyStyle = {
1854
- enabled: false
1855
- };
1856
- }
1857
-
1858
- return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
1859
- } // Static
1860
- ;
1861
-
1862
- Dropdown._jQueryInterface = function _jQueryInterface(config) {
1863
- return this.each(function () {
1864
- var data = $(this).data(DATA_KEY$4);
1865
-
1866
- var _config = typeof config === 'object' ? config : null;
1867
-
1868
- if (!data) {
1869
- data = new Dropdown(this, _config);
1870
- $(this).data(DATA_KEY$4, data);
1871
- }
1872
-
1873
- if (typeof config === 'string') {
1874
- if (typeof data[config] === 'undefined') {
1875
- throw new TypeError("No method named \"" + config + "\"");
1876
- }
1877
-
1878
- data[config]();
1879
- }
1880
- });
1881
- };
1882
-
1883
- Dropdown._clearMenus = function _clearMenus(event) {
1884
- if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
1885
- return;
1886
- }
1887
-
1888
- var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));
1889
-
1890
- for (var i = 0, len = toggles.length; i < len; i++) {
1891
- var parent = Dropdown._getParentFromElement(toggles[i]);
1892
-
1893
- var context = $(toggles[i]).data(DATA_KEY$4);
1894
- var relatedTarget = {
1895
- relatedTarget: toggles[i]
1896
- };
1897
-
1898
- if (event && event.type === 'click') {
1899
- relatedTarget.clickEvent = event;
1900
- }
1901
-
1902
- if (!context) {
1903
- continue;
1904
- }
1905
-
1906
- var dropdownMenu = context._menu;
1907
-
1908
- if (!$(parent).hasClass(CLASS_NAME_SHOW$2)) {
1909
- continue;
1910
- }
1911
-
1912
- if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
1913
- continue;
1914
- }
1915
-
1916
- var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
1917
- $(parent).trigger(hideEvent);
1918
-
1919
- if (hideEvent.isDefaultPrevented()) {
1920
- continue;
1921
- } // If this is a touch-enabled device we remove the extra
1922
- // empty mouseover listeners we added for iOS support
1923
-
1924
-
1925
- if ('ontouchstart' in document.documentElement) {
1926
- $(document.body).children().off('mouseover', null, $.noop);
1927
- }
1928
-
1929
- toggles[i].setAttribute('aria-expanded', 'false');
1930
-
1931
- if (context._popper) {
1932
- context._popper.destroy();
1933
- }
1934
-
1935
- $(dropdownMenu).removeClass(CLASS_NAME_SHOW$2);
1936
- $(parent).removeClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
1937
- }
1938
- };
1939
-
1940
- Dropdown._getParentFromElement = function _getParentFromElement(element) {
1941
- var parent;
1942
- var selector = Util.getSelectorFromElement(element);
1943
-
1944
- if (selector) {
1945
- parent = document.querySelector(selector);
1946
- }
1947
-
1948
- return parent || element.parentNode;
1949
- } // eslint-disable-next-line complexity
1950
- ;
1951
-
1952
- Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
1953
- // If not input/textarea:
1954
- // - And not a key in REGEXP_KEYDOWN => not a dropdown command
1955
- // If input/textarea:
1956
- // - If space key => not a dropdown command
1957
- // - If key is other than escape
1958
- // - If key is not up or down => not a dropdown command
1959
- // - If trigger inside the menu => not a dropdown command
1960
- if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
1961
- return;
1962
- }
1963
-
1964
- if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
1965
- return;
1966
- }
1967
-
1968
- var parent = Dropdown._getParentFromElement(this);
1969
-
1970
- var isActive = $(parent).hasClass(CLASS_NAME_SHOW$2);
1971
-
1972
- if (!isActive && event.which === ESCAPE_KEYCODE) {
1973
- return;
1974
- }
1975
-
1976
- event.preventDefault();
1977
- event.stopPropagation();
1978
-
1979
- if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
1980
- if (event.which === ESCAPE_KEYCODE) {
1981
- $(parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');
1982
- }
1983
-
1984
- $(this).trigger('click');
1985
- return;
1986
- }
1987
-
1988
- var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
1989
- return $(item).is(':visible');
1990
- });
1991
-
1992
- if (items.length === 0) {
1993
- return;
1994
- }
1995
-
1996
- var index = items.indexOf(event.target);
1997
-
1998
- if (event.which === ARROW_UP_KEYCODE && index > 0) {
1999
- // Up
2000
- index--;
2001
- }
2002
-
2003
- if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
2004
- // Down
2005
- index++;
2006
- }
2007
-
2008
- if (index < 0) {
2009
- index = 0;
2010
- }
2011
-
2012
- items[index].focus();
2013
- };
2014
-
2015
- _createClass(Dropdown, null, [{
2016
- key: "VERSION",
2017
- get: function get() {
2018
- return VERSION$4;
2019
- }
2020
- }, {
2021
- key: "Default",
2022
- get: function get() {
2023
- return Default$2;
2024
- }
2025
- }, {
2026
- key: "DefaultType",
2027
- get: function get() {
2028
- return DefaultType$2;
2029
- }
2030
- }]);
2031
-
2032
- return Dropdown;
2033
- }();
2034
- /**
2035
- * ------------------------------------------------------------------------
2036
- * Data Api implementation
2037
- * ------------------------------------------------------------------------
2038
- */
2039
-
2040
-
2041
- $(document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
2042
- event.preventDefault();
2043
- event.stopPropagation();
2044
-
2045
- Dropdown._jQueryInterface.call($(this), 'toggle');
2046
- }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
2047
- e.stopPropagation();
2048
- });
2049
- /**
2050
- * ------------------------------------------------------------------------
2051
- * jQuery
2052
- * ------------------------------------------------------------------------
2053
- */
2054
-
2055
- $.fn[NAME$4] = Dropdown._jQueryInterface;
2056
- $.fn[NAME$4].Constructor = Dropdown;
2057
-
2058
- $.fn[NAME$4].noConflict = function () {
2059
- $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
2060
- return Dropdown._jQueryInterface;
2061
- };
2062
-
2063
- /**
2064
- * ------------------------------------------------------------------------
2065
- * Constants
2066
- * ------------------------------------------------------------------------
2067
- */
2068
-
2069
- var NAME$5 = 'modal';
2070
- var VERSION$5 = '4.5.0';
2071
- var DATA_KEY$5 = 'bs.modal';
2072
- var EVENT_KEY$5 = "." + DATA_KEY$5;
2073
- var DATA_API_KEY$5 = '.data-api';
2074
- var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
2075
- var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
2076
-
2077
- var Default$3 = {
2078
- backdrop: true,
2079
- keyboard: true,
2080
- focus: true,
2081
- show: true
2082
- };
2083
- var DefaultType$3 = {
2084
- backdrop: '(boolean|string)',
2085
- keyboard: 'boolean',
2086
- focus: 'boolean',
2087
- show: 'boolean'
2088
- };
2089
- var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
2090
- var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
2091
- var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
2092
- var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
2093
- var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
2094
- var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
2095
- var EVENT_RESIZE = "resize" + EVENT_KEY$5;
2096
- var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
2097
- var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
2098
- var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
2099
- var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
2100
- var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
2101
- var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
2102
- var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
2103
- var CLASS_NAME_BACKDROP = 'modal-backdrop';
2104
- var CLASS_NAME_OPEN = 'modal-open';
2105
- var CLASS_NAME_FADE$1 = 'fade';
2106
- var CLASS_NAME_SHOW$3 = 'show';
2107
- var CLASS_NAME_STATIC = 'modal-static';
2108
- var SELECTOR_DIALOG = '.modal-dialog';
2109
- var SELECTOR_MODAL_BODY = '.modal-body';
2110
- var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
2111
- var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
2112
- var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2113
- var SELECTOR_STICKY_CONTENT = '.sticky-top';
2114
- /**
2115
- * ------------------------------------------------------------------------
2116
- * Class Definition
2117
- * ------------------------------------------------------------------------
2118
- */
2119
-
2120
- var Modal = /*#__PURE__*/function () {
2121
- function Modal(element, config) {
2122
- this._config = this._getConfig(config);
2123
- this._element = element;
2124
- this._dialog = element.querySelector(SELECTOR_DIALOG);
2125
- this._backdrop = null;
2126
- this._isShown = false;
2127
- this._isBodyOverflowing = false;
2128
- this._ignoreBackdropClick = false;
2129
- this._isTransitioning = false;
2130
- this._scrollbarWidth = 0;
2131
- } // Getters
2132
-
2133
-
2134
- var _proto = Modal.prototype;
2135
-
2136
- // Public
2137
- _proto.toggle = function toggle(relatedTarget) {
2138
- return this._isShown ? this.hide() : this.show(relatedTarget);
2139
- };
2140
-
2141
- _proto.show = function show(relatedTarget) {
2142
- var _this = this;
2143
-
2144
- if (this._isShown || this._isTransitioning) {
2145
- return;
2146
- }
2147
-
2148
- if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
2149
- this._isTransitioning = true;
2150
- }
2151
-
2152
- var showEvent = $.Event(EVENT_SHOW$2, {
2153
- relatedTarget: relatedTarget
2154
- });
2155
- $(this._element).trigger(showEvent);
2156
-
2157
- if (this._isShown || showEvent.isDefaultPrevented()) {
2158
- return;
2159
- }
2160
-
2161
- this._isShown = true;
2162
-
2163
- this._checkScrollbar();
2164
-
2165
- this._setScrollbar();
2166
-
2167
- this._adjustDialog();
2168
-
2169
- this._setEscapeEvent();
2170
-
2171
- this._setResizeEvent();
2172
-
2173
- $(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
2174
- return _this.hide(event);
2175
- });
2176
- $(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
2177
- $(_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
2178
- if ($(event.target).is(_this._element)) {
2179
- _this._ignoreBackdropClick = true;
2180
- }
2181
- });
2182
- });
2183
-
2184
- this._showBackdrop(function () {
2185
- return _this._showElement(relatedTarget);
2186
- });
2187
- };
2188
-
2189
- _proto.hide = function hide(event) {
2190
- var _this2 = this;
2191
-
2192
- if (event) {
2193
- event.preventDefault();
2194
- }
2195
-
2196
- if (!this._isShown || this._isTransitioning) {
2197
- return;
2198
- }
2199
-
2200
- var hideEvent = $.Event(EVENT_HIDE$2);
2201
- $(this._element).trigger(hideEvent);
2202
-
2203
- if (!this._isShown || hideEvent.isDefaultPrevented()) {
2204
- return;
2205
- }
2206
-
2207
- this._isShown = false;
2208
- var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
2209
-
2210
- if (transition) {
2211
- this._isTransitioning = true;
2212
- }
2213
-
2214
- this._setEscapeEvent();
2215
-
2216
- this._setResizeEvent();
2217
-
2218
- $(document).off(EVENT_FOCUSIN);
2219
- $(this._element).removeClass(CLASS_NAME_SHOW$3);
2220
- $(this._element).off(EVENT_CLICK_DISMISS);
2221
- $(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
2222
-
2223
- if (transition) {
2224
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
2225
- $(this._element).one(Util.TRANSITION_END, function (event) {
2226
- return _this2._hideModal(event);
2227
- }).emulateTransitionEnd(transitionDuration);
2228
- } else {
2229
- this._hideModal();
2230
- }
2231
- };
2232
-
2233
- _proto.dispose = function dispose() {
2234
- [window, this._element, this._dialog].forEach(function (htmlElement) {
2235
- return $(htmlElement).off(EVENT_KEY$5);
2236
- });
2237
- /**
2238
- * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
2239
- * Do not move `document` in `htmlElements` array
2240
- * It will remove `EVENT_CLICK_DATA_API` event that should remain
2241
- */
2242
-
2243
- $(document).off(EVENT_FOCUSIN);
2244
- $.removeData(this._element, DATA_KEY$5);
2245
- this._config = null;
2246
- this._element = null;
2247
- this._dialog = null;
2248
- this._backdrop = null;
2249
- this._isShown = null;
2250
- this._isBodyOverflowing = null;
2251
- this._ignoreBackdropClick = null;
2252
- this._isTransitioning = null;
2253
- this._scrollbarWidth = null;
2254
- };
2255
-
2256
- _proto.handleUpdate = function handleUpdate() {
2257
- this._adjustDialog();
2258
- } // Private
2259
- ;
2260
-
2261
- _proto._getConfig = function _getConfig(config) {
2262
- config = _objectSpread2(_objectSpread2({}, Default$3), config);
2263
- Util.typeCheckConfig(NAME$5, config, DefaultType$3);
2264
- return config;
2265
- };
2266
-
2267
- _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
2268
- var _this3 = this;
2269
-
2270
- if (this._config.backdrop === 'static') {
2271
- var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED);
2272
- $(this._element).trigger(hideEventPrevented);
2273
-
2274
- if (hideEventPrevented.defaultPrevented) {
2275
- return;
2276
- }
2277
-
2278
- this._element.classList.add(CLASS_NAME_STATIC);
2279
-
2280
- var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
2281
- $(this._element).one(Util.TRANSITION_END, function () {
2282
- _this3._element.classList.remove(CLASS_NAME_STATIC);
2283
- }).emulateTransitionEnd(modalTransitionDuration);
2284
-
2285
- this._element.focus();
2286
- } else {
2287
- this.hide();
2288
- }
2289
- };
2290
-
2291
- _proto._showElement = function _showElement(relatedTarget) {
2292
- var _this4 = this;
2293
-
2294
- var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
2295
- var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
2296
-
2297
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
2298
- // Don't move modal's DOM position
2299
- document.body.appendChild(this._element);
2300
- }
2301
-
2302
- this._element.style.display = 'block';
2303
-
2304
- this._element.removeAttribute('aria-hidden');
2305
-
2306
- this._element.setAttribute('aria-modal', true);
2307
-
2308
- if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
2309
- modalBody.scrollTop = 0;
2310
- } else {
2311
- this._element.scrollTop = 0;
2312
- }
2313
-
2314
- if (transition) {
2315
- Util.reflow(this._element);
2316
- }
2317
-
2318
- $(this._element).addClass(CLASS_NAME_SHOW$3);
2319
-
2320
- if (this._config.focus) {
2321
- this._enforceFocus();
2322
- }
2323
-
2324
- var shownEvent = $.Event(EVENT_SHOWN$2, {
2325
- relatedTarget: relatedTarget
2326
- });
2327
-
2328
- var transitionComplete = function transitionComplete() {
2329
- if (_this4._config.focus) {
2330
- _this4._element.focus();
2331
- }
2332
-
2333
- _this4._isTransitioning = false;
2334
- $(_this4._element).trigger(shownEvent);
2335
- };
2336
-
2337
- if (transition) {
2338
- var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
2339
- $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
2340
- } else {
2341
- transitionComplete();
2342
- }
2343
- };
2344
-
2345
- _proto._enforceFocus = function _enforceFocus() {
2346
- var _this5 = this;
2347
-
2348
- $(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
2349
- .on(EVENT_FOCUSIN, function (event) {
2350
- if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
2351
- _this5._element.focus();
2352
- }
2353
- });
2354
- };
2355
-
2356
- _proto._setEscapeEvent = function _setEscapeEvent() {
2357
- var _this6 = this;
2358
-
2359
- if (this._isShown) {
2360
- $(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
2361
- if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
2362
- event.preventDefault();
2363
-
2364
- _this6.hide();
2365
- } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
2366
- _this6._triggerBackdropTransition();
2367
- }
2368
- });
2369
- } else if (!this._isShown) {
2370
- $(this._element).off(EVENT_KEYDOWN_DISMISS);
2371
- }
2372
- };
2373
-
2374
- _proto._setResizeEvent = function _setResizeEvent() {
2375
- var _this7 = this;
2376
-
2377
- if (this._isShown) {
2378
- $(window).on(EVENT_RESIZE, function (event) {
2379
- return _this7.handleUpdate(event);
2380
- });
2381
- } else {
2382
- $(window).off(EVENT_RESIZE);
2383
- }
2384
- };
2385
-
2386
- _proto._hideModal = function _hideModal() {
2387
- var _this8 = this;
2388
-
2389
- this._element.style.display = 'none';
2390
-
2391
- this._element.setAttribute('aria-hidden', true);
2392
-
2393
- this._element.removeAttribute('aria-modal');
2394
-
2395
- this._isTransitioning = false;
2396
-
2397
- this._showBackdrop(function () {
2398
- $(document.body).removeClass(CLASS_NAME_OPEN);
2399
-
2400
- _this8._resetAdjustments();
2401
-
2402
- _this8._resetScrollbar();
2403
-
2404
- $(_this8._element).trigger(EVENT_HIDDEN$2);
2405
- });
2406
- };
2407
-
2408
- _proto._removeBackdrop = function _removeBackdrop() {
2409
- if (this._backdrop) {
2410
- $(this._backdrop).remove();
2411
- this._backdrop = null;
2412
- }
2413
- };
2414
-
2415
- _proto._showBackdrop = function _showBackdrop(callback) {
2416
- var _this9 = this;
2417
-
2418
- var animate = $(this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
2419
-
2420
- if (this._isShown && this._config.backdrop) {
2421
- this._backdrop = document.createElement('div');
2422
- this._backdrop.className = CLASS_NAME_BACKDROP;
2423
-
2424
- if (animate) {
2425
- this._backdrop.classList.add(animate);
2426
- }
2427
-
2428
- $(this._backdrop).appendTo(document.body);
2429
- $(this._element).on(EVENT_CLICK_DISMISS, function (event) {
2430
- if (_this9._ignoreBackdropClick) {
2431
- _this9._ignoreBackdropClick = false;
2432
- return;
2433
- }
2434
-
2435
- if (event.target !== event.currentTarget) {
2436
- return;
2437
- }
2438
-
2439
- _this9._triggerBackdropTransition();
2440
- });
2441
-
2442
- if (animate) {
2443
- Util.reflow(this._backdrop);
2444
- }
2445
-
2446
- $(this._backdrop).addClass(CLASS_NAME_SHOW$3);
2447
-
2448
- if (!callback) {
2449
- return;
2450
- }
2451
-
2452
- if (!animate) {
2453
- callback();
2454
- return;
2455
- }
2456
-
2457
- var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
2458
- $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
2459
- } else if (!this._isShown && this._backdrop) {
2460
- $(this._backdrop).removeClass(CLASS_NAME_SHOW$3);
2461
-
2462
- var callbackRemove = function callbackRemove() {
2463
- _this9._removeBackdrop();
2464
-
2465
- if (callback) {
2466
- callback();
2467
- }
2468
- };
2469
-
2470
- if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
2471
- var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
2472
-
2473
- $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
2474
- } else {
2475
- callbackRemove();
2476
- }
2477
- } else if (callback) {
2478
- callback();
2479
- }
2480
- } // ----------------------------------------------------------------------
2481
- // the following methods are used to handle overflowing modals
2482
- // todo (fat): these should probably be refactored out of modal.js
2483
- // ----------------------------------------------------------------------
2484
- ;
2485
-
2486
- _proto._adjustDialog = function _adjustDialog() {
2487
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
2488
-
2489
- if (!this._isBodyOverflowing && isModalOverflowing) {
2490
- this._element.style.paddingLeft = this._scrollbarWidth + "px";
2491
- }
2492
-
2493
- if (this._isBodyOverflowing && !isModalOverflowing) {
2494
- this._element.style.paddingRight = this._scrollbarWidth + "px";
2495
- }
2496
- };
2497
-
2498
- _proto._resetAdjustments = function _resetAdjustments() {
2499
- this._element.style.paddingLeft = '';
2500
- this._element.style.paddingRight = '';
2501
- };
2502
-
2503
- _proto._checkScrollbar = function _checkScrollbar() {
2504
- var rect = document.body.getBoundingClientRect();
2505
- this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
2506
- this._scrollbarWidth = this._getScrollbarWidth();
2507
- };
2508
-
2509
- _proto._setScrollbar = function _setScrollbar() {
2510
- var _this10 = this;
2511
-
2512
- if (this._isBodyOverflowing) {
2513
- // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
2514
- // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
2515
- var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
2516
- var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
2517
-
2518
- $(fixedContent).each(function (index, element) {
2519
- var actualPadding = element.style.paddingRight;
2520
- var calculatedPadding = $(element).css('padding-right');
2521
- $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
2522
- }); // Adjust sticky content margin
2523
-
2524
- $(stickyContent).each(function (index, element) {
2525
- var actualMargin = element.style.marginRight;
2526
- var calculatedMargin = $(element).css('margin-right');
2527
- $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
2528
- }); // Adjust body padding
2529
-
2530
- var actualPadding = document.body.style.paddingRight;
2531
- var calculatedPadding = $(document.body).css('padding-right');
2532
- $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
2533
- }
2534
-
2535
- $(document.body).addClass(CLASS_NAME_OPEN);
2536
- };
2537
-
2538
- _proto._resetScrollbar = function _resetScrollbar() {
2539
- // Restore fixed content padding
2540
- var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
2541
- $(fixedContent).each(function (index, element) {
2542
- var padding = $(element).data('padding-right');
2543
- $(element).removeData('padding-right');
2544
- element.style.paddingRight = padding ? padding : '';
2545
- }); // Restore sticky content
2546
-
2547
- var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
2548
- $(elements).each(function (index, element) {
2549
- var margin = $(element).data('margin-right');
2550
-
2551
- if (typeof margin !== 'undefined') {
2552
- $(element).css('margin-right', margin).removeData('margin-right');
2553
- }
2554
- }); // Restore body padding
2555
-
2556
- var padding = $(document.body).data('padding-right');
2557
- $(document.body).removeData('padding-right');
2558
- document.body.style.paddingRight = padding ? padding : '';
2559
- };
2560
-
2561
- _proto._getScrollbarWidth = function _getScrollbarWidth() {
2562
- // thx d.walsh
2563
- var scrollDiv = document.createElement('div');
2564
- scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
2565
- document.body.appendChild(scrollDiv);
2566
- var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
2567
- document.body.removeChild(scrollDiv);
2568
- return scrollbarWidth;
2569
- } // Static
2570
- ;
2571
-
2572
- Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
2573
- return this.each(function () {
2574
- var data = $(this).data(DATA_KEY$5);
2575
-
2576
- var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$3), $(this).data()), typeof config === 'object' && config ? config : {});
2577
-
2578
- if (!data) {
2579
- data = new Modal(this, _config);
2580
- $(this).data(DATA_KEY$5, data);
2581
- }
2582
-
2583
- if (typeof config === 'string') {
2584
- if (typeof data[config] === 'undefined') {
2585
- throw new TypeError("No method named \"" + config + "\"");
2586
- }
2587
-
2588
- data[config](relatedTarget);
2589
- } else if (_config.show) {
2590
- data.show(relatedTarget);
2591
- }
2592
- });
2593
- };
2594
-
2595
- _createClass(Modal, null, [{
2596
- key: "VERSION",
2597
- get: function get() {
2598
- return VERSION$5;
2599
- }
2600
- }, {
2601
- key: "Default",
2602
- get: function get() {
2603
- return Default$3;
2604
- }
2605
- }]);
2606
-
2607
- return Modal;
2608
- }();
2609
- /**
2610
- * ------------------------------------------------------------------------
2611
- * Data Api implementation
2612
- * ------------------------------------------------------------------------
2613
- */
2614
-
2615
-
2616
- $(document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
2617
- var _this11 = this;
2618
-
2619
- var target;
2620
- var selector = Util.getSelectorFromElement(this);
2621
-
2622
- if (selector) {
2623
- target = document.querySelector(selector);
2624
- }
2625
-
2626
- var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
2627
-
2628
- if (this.tagName === 'A' || this.tagName === 'AREA') {
2629
- event.preventDefault();
2630
- }
2631
-
2632
- var $target = $(target).one(EVENT_SHOW$2, function (showEvent) {
2633
- if (showEvent.isDefaultPrevented()) {
2634
- // Only register focus restorer if modal will actually get shown
2635
- return;
2636
- }
2637
-
2638
- $target.one(EVENT_HIDDEN$2, function () {
2639
- if ($(_this11).is(':visible')) {
2640
- _this11.focus();
2641
- }
2642
- });
2643
- });
2644
-
2645
- Modal._jQueryInterface.call($(target), config, this);
2646
- });
2647
- /**
2648
- * ------------------------------------------------------------------------
2649
- * jQuery
2650
- * ------------------------------------------------------------------------
2651
- */
2652
-
2653
- $.fn[NAME$5] = Modal._jQueryInterface;
2654
- $.fn[NAME$5].Constructor = Modal;
2655
-
2656
- $.fn[NAME$5].noConflict = function () {
2657
- $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
2658
- return Modal._jQueryInterface;
2659
- };
2660
-
2661
- /**
2662
- * --------------------------------------------------------------------------
2663
- * Bootstrap (v4.5.0): tools/sanitizer.js
2664
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2665
- * --------------------------------------------------------------------------
2666
- */
2667
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
2668
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
2669
- var DefaultWhitelist = {
2670
- // Global attributes allowed on any supplied element below.
2671
- '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
2672
- a: ['target', 'href', 'title', 'rel'],
2673
- area: [],
2674
- b: [],
2675
- br: [],
2676
- col: [],
2677
- code: [],
2678
- div: [],
2679
- em: [],
2680
- hr: [],
2681
- h1: [],
2682
- h2: [],
2683
- h3: [],
2684
- h4: [],
2685
- h5: [],
2686
- h6: [],
2687
- i: [],
2688
- img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
2689
- li: [],
2690
- ol: [],
2691
- p: [],
2692
- pre: [],
2693
- s: [],
2694
- small: [],
2695
- span: [],
2696
- sub: [],
2697
- sup: [],
2698
- strong: [],
2699
- u: [],
2700
- ul: []
2701
- };
2702
- /**
2703
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
2704
- *
2705
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
2706
- */
2707
-
2708
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
2709
- /**
2710
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
2711
- *
2712
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
2713
- */
2714
-
2715
- 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;
2716
-
2717
- function allowedAttribute(attr, allowedAttributeList) {
2718
- var attrName = attr.nodeName.toLowerCase();
2719
-
2720
- if (allowedAttributeList.indexOf(attrName) !== -1) {
2721
- if (uriAttrs.indexOf(attrName) !== -1) {
2722
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
2723
- }
2724
-
2725
- return true;
2726
- }
2727
-
2728
- var regExp = allowedAttributeList.filter(function (attrRegex) {
2729
- return attrRegex instanceof RegExp;
2730
- }); // Check if a regular expression validates the attribute.
2731
-
2732
- for (var i = 0, len = regExp.length; i < len; i++) {
2733
- if (attrName.match(regExp[i])) {
2734
- return true;
2735
- }
2736
- }
2737
-
2738
- return false;
2739
- }
2740
-
2741
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
2742
- if (unsafeHtml.length === 0) {
2743
- return unsafeHtml;
2744
- }
2745
-
2746
- if (sanitizeFn && typeof sanitizeFn === 'function') {
2747
- return sanitizeFn(unsafeHtml);
2748
- }
2749
-
2750
- var domParser = new window.DOMParser();
2751
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
2752
- var whitelistKeys = Object.keys(whiteList);
2753
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
2754
-
2755
- var _loop = function _loop(i, len) {
2756
- var el = elements[i];
2757
- var elName = el.nodeName.toLowerCase();
2758
-
2759
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
2760
- el.parentNode.removeChild(el);
2761
- return "continue";
2762
- }
2763
-
2764
- var attributeList = [].slice.call(el.attributes);
2765
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
2766
- attributeList.forEach(function (attr) {
2767
- if (!allowedAttribute(attr, whitelistedAttributes)) {
2768
- el.removeAttribute(attr.nodeName);
2769
- }
2770
- });
2771
- };
2772
-
2773
- for (var i = 0, len = elements.length; i < len; i++) {
2774
- var _ret = _loop(i);
2775
-
2776
- if (_ret === "continue") continue;
2777
- }
2778
-
2779
- return createdDocument.body.innerHTML;
2780
- }
2781
-
2782
- /**
2783
- * ------------------------------------------------------------------------
2784
- * Constants
2785
- * ------------------------------------------------------------------------
2786
- */
2787
-
2788
- var NAME$6 = 'tooltip';
2789
- var VERSION$6 = '4.5.0';
2790
- var DATA_KEY$6 = 'bs.tooltip';
2791
- var EVENT_KEY$6 = "." + DATA_KEY$6;
2792
- var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
2793
- var CLASS_PREFIX = 'bs-tooltip';
2794
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
2795
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
2796
- var DefaultType$4 = {
2797
- animation: 'boolean',
2798
- template: 'string',
2799
- title: '(string|element|function)',
2800
- trigger: 'string',
2801
- delay: '(number|object)',
2802
- html: 'boolean',
2803
- selector: '(string|boolean)',
2804
- placement: '(string|function)',
2805
- offset: '(number|string|function)',
2806
- container: '(string|element|boolean)',
2807
- fallbackPlacement: '(string|array)',
2808
- boundary: '(string|element)',
2809
- sanitize: 'boolean',
2810
- sanitizeFn: '(null|function)',
2811
- whiteList: 'object',
2812
- popperConfig: '(null|object)'
2813
- };
2814
- var AttachmentMap = {
2815
- AUTO: 'auto',
2816
- TOP: 'top',
2817
- RIGHT: 'right',
2818
- BOTTOM: 'bottom',
2819
- LEFT: 'left'
2820
- };
2821
- var Default$4 = {
2822
- animation: true,
2823
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
2824
- trigger: 'hover focus',
2825
- title: '',
2826
- delay: 0,
2827
- html: false,
2828
- selector: false,
2829
- placement: 'top',
2830
- offset: 0,
2831
- container: false,
2832
- fallbackPlacement: 'flip',
2833
- boundary: 'scrollParent',
2834
- sanitize: true,
2835
- sanitizeFn: null,
2836
- whiteList: DefaultWhitelist,
2837
- popperConfig: null
2838
- };
2839
- var HOVER_STATE_SHOW = 'show';
2840
- var HOVER_STATE_OUT = 'out';
2841
- var Event = {
2842
- HIDE: "hide" + EVENT_KEY$6,
2843
- HIDDEN: "hidden" + EVENT_KEY$6,
2844
- SHOW: "show" + EVENT_KEY$6,
2845
- SHOWN: "shown" + EVENT_KEY$6,
2846
- INSERTED: "inserted" + EVENT_KEY$6,
2847
- CLICK: "click" + EVENT_KEY$6,
2848
- FOCUSIN: "focusin" + EVENT_KEY$6,
2849
- FOCUSOUT: "focusout" + EVENT_KEY$6,
2850
- MOUSEENTER: "mouseenter" + EVENT_KEY$6,
2851
- MOUSELEAVE: "mouseleave" + EVENT_KEY$6
2852
- };
2853
- var CLASS_NAME_FADE$2 = 'fade';
2854
- var CLASS_NAME_SHOW$4 = 'show';
2855
- var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
2856
- var SELECTOR_ARROW = '.arrow';
2857
- var TRIGGER_HOVER = 'hover';
2858
- var TRIGGER_FOCUS = 'focus';
2859
- var TRIGGER_CLICK = 'click';
2860
- var TRIGGER_MANUAL = 'manual';
2861
- /**
2862
- * ------------------------------------------------------------------------
2863
- * Class Definition
2864
- * ------------------------------------------------------------------------
2865
- */
2866
-
2867
- var Tooltip = /*#__PURE__*/function () {
2868
- function Tooltip(element, config) {
2869
- if (typeof Popper === 'undefined') {
2870
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
2871
- } // private
2872
-
2873
-
2874
- this._isEnabled = true;
2875
- this._timeout = 0;
2876
- this._hoverState = '';
2877
- this._activeTrigger = {};
2878
- this._popper = null; // Protected
2879
-
2880
- this.element = element;
2881
- this.config = this._getConfig(config);
2882
- this.tip = null;
2883
-
2884
- this._setListeners();
2885
- } // Getters
2886
-
2887
-
2888
- var _proto = Tooltip.prototype;
2889
-
2890
- // Public
2891
- _proto.enable = function enable() {
2892
- this._isEnabled = true;
2893
- };
2894
-
2895
- _proto.disable = function disable() {
2896
- this._isEnabled = false;
2897
- };
2898
-
2899
- _proto.toggleEnabled = function toggleEnabled() {
2900
- this._isEnabled = !this._isEnabled;
2901
- };
2902
-
2903
- _proto.toggle = function toggle(event) {
2904
- if (!this._isEnabled) {
2905
- return;
2906
- }
2907
-
2908
- if (event) {
2909
- var dataKey = this.constructor.DATA_KEY;
2910
- var context = $(event.currentTarget).data(dataKey);
2911
-
2912
- if (!context) {
2913
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
2914
- $(event.currentTarget).data(dataKey, context);
2915
- }
2916
-
2917
- context._activeTrigger.click = !context._activeTrigger.click;
2918
-
2919
- if (context._isWithActiveTrigger()) {
2920
- context._enter(null, context);
2921
- } else {
2922
- context._leave(null, context);
2923
- }
2924
- } else {
2925
- if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {
2926
- this._leave(null, this);
2927
-
2928
- return;
2929
- }
2930
-
2931
- this._enter(null, this);
2932
- }
2933
- };
2934
-
2935
- _proto.dispose = function dispose() {
2936
- clearTimeout(this._timeout);
2937
- $.removeData(this.element, this.constructor.DATA_KEY);
2938
- $(this.element).off(this.constructor.EVENT_KEY);
2939
- $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
2940
-
2941
- if (this.tip) {
2942
- $(this.tip).remove();
2943
- }
2944
-
2945
- this._isEnabled = null;
2946
- this._timeout = null;
2947
- this._hoverState = null;
2948
- this._activeTrigger = null;
2949
-
2950
- if (this._popper) {
2951
- this._popper.destroy();
2952
- }
2953
-
2954
- this._popper = null;
2955
- this.element = null;
2956
- this.config = null;
2957
- this.tip = null;
2958
- };
2959
-
2960
- _proto.show = function show() {
2961
- var _this = this;
2962
-
2963
- if ($(this.element).css('display') === 'none') {
2964
- throw new Error('Please use show on visible elements');
2965
- }
2966
-
2967
- var showEvent = $.Event(this.constructor.Event.SHOW);
2968
-
2969
- if (this.isWithContent() && this._isEnabled) {
2970
- $(this.element).trigger(showEvent);
2971
- var shadowRoot = Util.findShadowRoot(this.element);
2972
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
2973
-
2974
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
2975
- return;
2976
- }
2977
-
2978
- var tip = this.getTipElement();
2979
- var tipId = Util.getUID(this.constructor.NAME);
2980
- tip.setAttribute('id', tipId);
2981
- this.element.setAttribute('aria-describedby', tipId);
2982
- this.setContent();
2983
-
2984
- if (this.config.animation) {
2985
- $(tip).addClass(CLASS_NAME_FADE$2);
2986
- }
2987
-
2988
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
2989
-
2990
- var attachment = this._getAttachment(placement);
2991
-
2992
- this.addAttachmentClass(attachment);
2993
-
2994
- var container = this._getContainer();
2995
-
2996
- $(tip).data(this.constructor.DATA_KEY, this);
2997
-
2998
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
2999
- $(tip).appendTo(container);
3000
- }
3001
-
3002
- $(this.element).trigger(this.constructor.Event.INSERTED);
3003
- this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
3004
- $(tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra
3005
- // empty mouseover listeners to the body's immediate children;
3006
- // only needed because of broken event delegation on iOS
3007
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
3008
-
3009
- if ('ontouchstart' in document.documentElement) {
3010
- $(document.body).children().on('mouseover', null, $.noop);
3011
- }
3012
-
3013
- var complete = function complete() {
3014
- if (_this.config.animation) {
3015
- _this._fixTransition();
3016
- }
3017
-
3018
- var prevHoverState = _this._hoverState;
3019
- _this._hoverState = null;
3020
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
3021
-
3022
- if (prevHoverState === HOVER_STATE_OUT) {
3023
- _this._leave(null, _this);
3024
- }
3025
- };
3026
-
3027
- if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
3028
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
3029
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
3030
- } else {
3031
- complete();
3032
- }
3033
- }
3034
- };
3035
-
3036
- _proto.hide = function hide(callback) {
3037
- var _this2 = this;
3038
-
3039
- var tip = this.getTipElement();
3040
- var hideEvent = $.Event(this.constructor.Event.HIDE);
3041
-
3042
- var complete = function complete() {
3043
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
3044
- tip.parentNode.removeChild(tip);
3045
- }
3046
-
3047
- _this2._cleanTipClass();
3048
-
3049
- _this2.element.removeAttribute('aria-describedby');
3050
-
3051
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
3052
-
3053
- if (_this2._popper !== null) {
3054
- _this2._popper.destroy();
3055
- }
3056
-
3057
- if (callback) {
3058
- callback();
3059
- }
3060
- };
3061
-
3062
- $(this.element).trigger(hideEvent);
3063
-
3064
- if (hideEvent.isDefaultPrevented()) {
3065
- return;
3066
- }
3067
-
3068
- $(tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
3069
- // empty mouseover listeners we added for iOS support
3070
-
3071
- if ('ontouchstart' in document.documentElement) {
3072
- $(document.body).children().off('mouseover', null, $.noop);
3073
- }
3074
-
3075
- this._activeTrigger[TRIGGER_CLICK] = false;
3076
- this._activeTrigger[TRIGGER_FOCUS] = false;
3077
- this._activeTrigger[TRIGGER_HOVER] = false;
3078
-
3079
- if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
3080
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
3081
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
3082
- } else {
3083
- complete();
3084
- }
3085
-
3086
- this._hoverState = '';
3087
- };
3088
-
3089
- _proto.update = function update() {
3090
- if (this._popper !== null) {
3091
- this._popper.scheduleUpdate();
3092
- }
3093
- } // Protected
3094
- ;
3095
-
3096
- _proto.isWithContent = function isWithContent() {
3097
- return Boolean(this.getTitle());
3098
- };
3099
-
3100
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
3101
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
3102
- };
3103
-
3104
- _proto.getTipElement = function getTipElement() {
3105
- this.tip = this.tip || $(this.config.template)[0];
3106
- return this.tip;
3107
- };
3108
-
3109
- _proto.setContent = function setContent() {
3110
- var tip = this.getTipElement();
3111
- this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
3112
- $(tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4);
3113
- };
3114
-
3115
- _proto.setElementContent = function setElementContent($element, content) {
3116
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
3117
- // Content is a DOM node or a jQuery
3118
- if (this.config.html) {
3119
- if (!$(content).parent().is($element)) {
3120
- $element.empty().append(content);
3121
- }
3122
- } else {
3123
- $element.text($(content).text());
3124
- }
3125
-
3126
- return;
3127
- }
3128
-
3129
- if (this.config.html) {
3130
- if (this.config.sanitize) {
3131
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
3132
- }
3133
-
3134
- $element.html(content);
3135
- } else {
3136
- $element.text(content);
3137
- }
3138
- };
3139
-
3140
- _proto.getTitle = function getTitle() {
3141
- var title = this.element.getAttribute('data-original-title');
3142
-
3143
- if (!title) {
3144
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
3145
- }
3146
-
3147
- return title;
3148
- } // Private
3149
- ;
3150
-
3151
- _proto._getPopperConfig = function _getPopperConfig(attachment) {
3152
- var _this3 = this;
3153
-
3154
- var defaultBsConfig = {
3155
- placement: attachment,
3156
- modifiers: {
3157
- offset: this._getOffset(),
3158
- flip: {
3159
- behavior: this.config.fallbackPlacement
3160
- },
3161
- arrow: {
3162
- element: SELECTOR_ARROW
3163
- },
3164
- preventOverflow: {
3165
- boundariesElement: this.config.boundary
3166
- }
3167
- },
3168
- onCreate: function onCreate(data) {
3169
- if (data.originalPlacement !== data.placement) {
3170
- _this3._handlePopperPlacementChange(data);
3171
- }
3172
- },
3173
- onUpdate: function onUpdate(data) {
3174
- return _this3._handlePopperPlacementChange(data);
3175
- }
3176
- };
3177
- return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
3178
- };
3179
-
3180
- _proto._getOffset = function _getOffset() {
3181
- var _this4 = this;
3182
-
3183
- var offset = {};
3184
-
3185
- if (typeof this.config.offset === 'function') {
3186
- offset.fn = function (data) {
3187
- data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
3188
- return data;
3189
- };
3190
- } else {
3191
- offset.offset = this.config.offset;
3192
- }
3193
-
3194
- return offset;
3195
- };
3196
-
3197
- _proto._getContainer = function _getContainer() {
3198
- if (this.config.container === false) {
3199
- return document.body;
3200
- }
3201
-
3202
- if (Util.isElement(this.config.container)) {
3203
- return $(this.config.container);
3204
- }
3205
-
3206
- return $(document).find(this.config.container);
3207
- };
3208
-
3209
- _proto._getAttachment = function _getAttachment(placement) {
3210
- return AttachmentMap[placement.toUpperCase()];
3211
- };
3212
-
3213
- _proto._setListeners = function _setListeners() {
3214
- var _this5 = this;
3215
-
3216
- var triggers = this.config.trigger.split(' ');
3217
- triggers.forEach(function (trigger) {
3218
- if (trigger === 'click') {
3219
- $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
3220
- return _this5.toggle(event);
3221
- });
3222
- } else if (trigger !== TRIGGER_MANUAL) {
3223
- var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
3224
- var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
3225
- $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
3226
- return _this5._enter(event);
3227
- }).on(eventOut, _this5.config.selector, function (event) {
3228
- return _this5._leave(event);
3229
- });
3230
- }
3231
- });
3232
-
3233
- this._hideModalHandler = function () {
3234
- if (_this5.element) {
3235
- _this5.hide();
3236
- }
3237
- };
3238
-
3239
- $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
3240
-
3241
- if (this.config.selector) {
3242
- this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
3243
- trigger: 'manual',
3244
- selector: ''
3245
- });
3246
- } else {
3247
- this._fixTitle();
3248
- }
3249
- };
3250
-
3251
- _proto._fixTitle = function _fixTitle() {
3252
- var titleType = typeof this.element.getAttribute('data-original-title');
3253
-
3254
- if (this.element.getAttribute('title') || titleType !== 'string') {
3255
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
3256
- this.element.setAttribute('title', '');
3257
- }
3258
- };
3259
-
3260
- _proto._enter = function _enter(event, context) {
3261
- var dataKey = this.constructor.DATA_KEY;
3262
- context = context || $(event.currentTarget).data(dataKey);
3263
-
3264
- if (!context) {
3265
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3266
- $(event.currentTarget).data(dataKey, context);
3267
- }
3268
-
3269
- if (event) {
3270
- context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
3271
- }
3272
-
3273
- if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
3274
- context._hoverState = HOVER_STATE_SHOW;
3275
- return;
3276
- }
3277
-
3278
- clearTimeout(context._timeout);
3279
- context._hoverState = HOVER_STATE_SHOW;
3280
-
3281
- if (!context.config.delay || !context.config.delay.show) {
3282
- context.show();
3283
- return;
3284
- }
3285
-
3286
- context._timeout = setTimeout(function () {
3287
- if (context._hoverState === HOVER_STATE_SHOW) {
3288
- context.show();
3289
- }
3290
- }, context.config.delay.show);
3291
- };
3292
-
3293
- _proto._leave = function _leave(event, context) {
3294
- var dataKey = this.constructor.DATA_KEY;
3295
- context = context || $(event.currentTarget).data(dataKey);
3296
-
3297
- if (!context) {
3298
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3299
- $(event.currentTarget).data(dataKey, context);
3300
- }
3301
-
3302
- if (event) {
3303
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
3304
- }
3305
-
3306
- if (context._isWithActiveTrigger()) {
3307
- return;
3308
- }
3309
-
3310
- clearTimeout(context._timeout);
3311
- context._hoverState = HOVER_STATE_OUT;
3312
-
3313
- if (!context.config.delay || !context.config.delay.hide) {
3314
- context.hide();
3315
- return;
3316
- }
3317
-
3318
- context._timeout = setTimeout(function () {
3319
- if (context._hoverState === HOVER_STATE_OUT) {
3320
- context.hide();
3321
- }
3322
- }, context.config.delay.hide);
3323
- };
3324
-
3325
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
3326
- for (var trigger in this._activeTrigger) {
3327
- if (this._activeTrigger[trigger]) {
3328
- return true;
3329
- }
3330
- }
3331
-
3332
- return false;
3333
- };
3334
-
3335
- _proto._getConfig = function _getConfig(config) {
3336
- var dataAttributes = $(this.element).data();
3337
- Object.keys(dataAttributes).forEach(function (dataAttr) {
3338
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
3339
- delete dataAttributes[dataAttr];
3340
- }
3341
- });
3342
- config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {});
3343
-
3344
- if (typeof config.delay === 'number') {
3345
- config.delay = {
3346
- show: config.delay,
3347
- hide: config.delay
3348
- };
3349
- }
3350
-
3351
- if (typeof config.title === 'number') {
3352
- config.title = config.title.toString();
3353
- }
3354
-
3355
- if (typeof config.content === 'number') {
3356
- config.content = config.content.toString();
3357
- }
3358
-
3359
- Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
3360
-
3361
- if (config.sanitize) {
3362
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
3363
- }
3364
-
3365
- return config;
3366
- };
3367
-
3368
- _proto._getDelegateConfig = function _getDelegateConfig() {
3369
- var config = {};
3370
-
3371
- if (this.config) {
3372
- for (var key in this.config) {
3373
- if (this.constructor.Default[key] !== this.config[key]) {
3374
- config[key] = this.config[key];
3375
- }
3376
- }
3377
- }
3378
-
3379
- return config;
3380
- };
3381
-
3382
- _proto._cleanTipClass = function _cleanTipClass() {
3383
- var $tip = $(this.getTipElement());
3384
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
3385
-
3386
- if (tabClass !== null && tabClass.length) {
3387
- $tip.removeClass(tabClass.join(''));
3388
- }
3389
- };
3390
-
3391
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
3392
- this.tip = popperData.instance.popper;
3393
-
3394
- this._cleanTipClass();
3395
-
3396
- this.addAttachmentClass(this._getAttachment(popperData.placement));
3397
- };
3398
-
3399
- _proto._fixTransition = function _fixTransition() {
3400
- var tip = this.getTipElement();
3401
- var initConfigAnimation = this.config.animation;
3402
-
3403
- if (tip.getAttribute('x-placement') !== null) {
3404
- return;
3405
- }
3406
-
3407
- $(tip).removeClass(CLASS_NAME_FADE$2);
3408
- this.config.animation = false;
3409
- this.hide();
3410
- this.show();
3411
- this.config.animation = initConfigAnimation;
3412
- } // Static
3413
- ;
3414
-
3415
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
3416
- return this.each(function () {
3417
- var data = $(this).data(DATA_KEY$6);
3418
-
3419
- var _config = typeof config === 'object' && config;
3420
-
3421
- if (!data && /dispose|hide/.test(config)) {
3422
- return;
3423
- }
3424
-
3425
- if (!data) {
3426
- data = new Tooltip(this, _config);
3427
- $(this).data(DATA_KEY$6, data);
3428
- }
3429
-
3430
- if (typeof config === 'string') {
3431
- if (typeof data[config] === 'undefined') {
3432
- throw new TypeError("No method named \"" + config + "\"");
3433
- }
3434
-
3435
- data[config]();
3436
- }
3437
- });
3438
- };
3439
-
3440
- _createClass(Tooltip, null, [{
3441
- key: "VERSION",
3442
- get: function get() {
3443
- return VERSION$6;
3444
- }
3445
- }, {
3446
- key: "Default",
3447
- get: function get() {
3448
- return Default$4;
3449
- }
3450
- }, {
3451
- key: "NAME",
3452
- get: function get() {
3453
- return NAME$6;
3454
- }
3455
- }, {
3456
- key: "DATA_KEY",
3457
- get: function get() {
3458
- return DATA_KEY$6;
3459
- }
3460
- }, {
3461
- key: "Event",
3462
- get: function get() {
3463
- return Event;
3464
- }
3465
- }, {
3466
- key: "EVENT_KEY",
3467
- get: function get() {
3468
- return EVENT_KEY$6;
3469
- }
3470
- }, {
3471
- key: "DefaultType",
3472
- get: function get() {
3473
- return DefaultType$4;
3474
- }
3475
- }]);
3476
-
3477
- return Tooltip;
3478
- }();
3479
- /**
3480
- * ------------------------------------------------------------------------
3481
- * jQuery
3482
- * ------------------------------------------------------------------------
3483
- */
3484
-
3485
-
3486
- $.fn[NAME$6] = Tooltip._jQueryInterface;
3487
- $.fn[NAME$6].Constructor = Tooltip;
3488
-
3489
- $.fn[NAME$6].noConflict = function () {
3490
- $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
3491
- return Tooltip._jQueryInterface;
3492
- };
3493
-
3494
- /**
3495
- * ------------------------------------------------------------------------
3496
- * Constants
3497
- * ------------------------------------------------------------------------
3498
- */
3499
-
3500
- var NAME$7 = 'popover';
3501
- var VERSION$7 = '4.5.0';
3502
- var DATA_KEY$7 = 'bs.popover';
3503
- var EVENT_KEY$7 = "." + DATA_KEY$7;
3504
- var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
3505
- var CLASS_PREFIX$1 = 'bs-popover';
3506
- var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
3507
-
3508
- var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
3509
- placement: 'right',
3510
- trigger: 'click',
3511
- content: '',
3512
- template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
3513
- });
3514
-
3515
- var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
3516
- content: '(string|element|function)'
3517
- });
3518
-
3519
- var CLASS_NAME_FADE$3 = 'fade';
3520
- var CLASS_NAME_SHOW$5 = 'show';
3521
- var SELECTOR_TITLE = '.popover-header';
3522
- var SELECTOR_CONTENT = '.popover-body';
3523
- var Event$1 = {
3524
- HIDE: "hide" + EVENT_KEY$7,
3525
- HIDDEN: "hidden" + EVENT_KEY$7,
3526
- SHOW: "show" + EVENT_KEY$7,
3527
- SHOWN: "shown" + EVENT_KEY$7,
3528
- INSERTED: "inserted" + EVENT_KEY$7,
3529
- CLICK: "click" + EVENT_KEY$7,
3530
- FOCUSIN: "focusin" + EVENT_KEY$7,
3531
- FOCUSOUT: "focusout" + EVENT_KEY$7,
3532
- MOUSEENTER: "mouseenter" + EVENT_KEY$7,
3533
- MOUSELEAVE: "mouseleave" + EVENT_KEY$7
3534
- };
3535
- /**
3536
- * ------------------------------------------------------------------------
3537
- * Class Definition
3538
- * ------------------------------------------------------------------------
3539
- */
3540
-
3541
- var Popover = /*#__PURE__*/function (_Tooltip) {
3542
- _inheritsLoose(Popover, _Tooltip);
3543
-
3544
- function Popover() {
3545
- return _Tooltip.apply(this, arguments) || this;
3546
- }
3547
-
3548
- var _proto = Popover.prototype;
3549
-
3550
- // Overrides
3551
- _proto.isWithContent = function isWithContent() {
3552
- return this.getTitle() || this._getContent();
3553
- };
3554
-
3555
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
3556
- $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
3557
- };
3558
-
3559
- _proto.getTipElement = function getTipElement() {
3560
- this.tip = this.tip || $(this.config.template)[0];
3561
- return this.tip;
3562
- };
3563
-
3564
- _proto.setContent = function setContent() {
3565
- var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
3566
-
3567
- this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
3568
-
3569
- var content = this._getContent();
3570
-
3571
- if (typeof content === 'function') {
3572
- content = content.call(this.element);
3573
- }
3574
-
3575
- this.setElementContent($tip.find(SELECTOR_CONTENT), content);
3576
- $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5);
3577
- } // Private
3578
- ;
3579
-
3580
- _proto._getContent = function _getContent() {
3581
- return this.element.getAttribute('data-content') || this.config.content;
3582
- };
3583
-
3584
- _proto._cleanTipClass = function _cleanTipClass() {
3585
- var $tip = $(this.getTipElement());
3586
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
3587
-
3588
- if (tabClass !== null && tabClass.length > 0) {
3589
- $tip.removeClass(tabClass.join(''));
3590
- }
3591
- } // Static
3592
- ;
3593
-
3594
- Popover._jQueryInterface = function _jQueryInterface(config) {
3595
- return this.each(function () {
3596
- var data = $(this).data(DATA_KEY$7);
3597
-
3598
- var _config = typeof config === 'object' ? config : null;
3599
-
3600
- if (!data && /dispose|hide/.test(config)) {
3601
- return;
3602
- }
3603
-
3604
- if (!data) {
3605
- data = new Popover(this, _config);
3606
- $(this).data(DATA_KEY$7, data);
3607
- }
3608
-
3609
- if (typeof config === 'string') {
3610
- if (typeof data[config] === 'undefined') {
3611
- throw new TypeError("No method named \"" + config + "\"");
3612
- }
3613
-
3614
- data[config]();
3615
- }
3616
- });
3617
- };
3618
-
3619
- _createClass(Popover, null, [{
3620
- key: "VERSION",
3621
- // Getters
3622
- get: function get() {
3623
- return VERSION$7;
3624
- }
3625
- }, {
3626
- key: "Default",
3627
- get: function get() {
3628
- return Default$5;
3629
- }
3630
- }, {
3631
- key: "NAME",
3632
- get: function get() {
3633
- return NAME$7;
3634
- }
3635
- }, {
3636
- key: "DATA_KEY",
3637
- get: function get() {
3638
- return DATA_KEY$7;
3639
- }
3640
- }, {
3641
- key: "Event",
3642
- get: function get() {
3643
- return Event$1;
3644
- }
3645
- }, {
3646
- key: "EVENT_KEY",
3647
- get: function get() {
3648
- return EVENT_KEY$7;
3649
- }
3650
- }, {
3651
- key: "DefaultType",
3652
- get: function get() {
3653
- return DefaultType$5;
3654
- }
3655
- }]);
3656
-
3657
- return Popover;
3658
- }(Tooltip);
3659
- /**
3660
- * ------------------------------------------------------------------------
3661
- * jQuery
3662
- * ------------------------------------------------------------------------
3663
- */
3664
-
3665
-
3666
- $.fn[NAME$7] = Popover._jQueryInterface;
3667
- $.fn[NAME$7].Constructor = Popover;
3668
-
3669
- $.fn[NAME$7].noConflict = function () {
3670
- $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
3671
- return Popover._jQueryInterface;
3672
- };
3673
-
3674
- /**
3675
- * ------------------------------------------------------------------------
3676
- * Constants
3677
- * ------------------------------------------------------------------------
3678
- */
3679
-
3680
- var NAME$8 = 'scrollspy';
3681
- var VERSION$8 = '4.5.0';
3682
- var DATA_KEY$8 = 'bs.scrollspy';
3683
- var EVENT_KEY$8 = "." + DATA_KEY$8;
3684
- var DATA_API_KEY$6 = '.data-api';
3685
- var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
3686
- var Default$6 = {
3687
- offset: 10,
3688
- method: 'auto',
3689
- target: ''
3690
- };
3691
- var DefaultType$6 = {
3692
- offset: 'number',
3693
- method: 'string',
3694
- target: '(string|element)'
3695
- };
3696
- var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
3697
- var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
3698
- var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
3699
- var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
3700
- var CLASS_NAME_ACTIVE$2 = 'active';
3701
- var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
3702
- var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
3703
- var SELECTOR_NAV_LINKS = '.nav-link';
3704
- var SELECTOR_NAV_ITEMS = '.nav-item';
3705
- var SELECTOR_LIST_ITEMS = '.list-group-item';
3706
- var SELECTOR_DROPDOWN = '.dropdown';
3707
- var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
3708
- var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
3709
- var METHOD_OFFSET = 'offset';
3710
- var METHOD_POSITION = 'position';
3711
- /**
3712
- * ------------------------------------------------------------------------
3713
- * Class Definition
3714
- * ------------------------------------------------------------------------
3715
- */
3716
-
3717
- var ScrollSpy = /*#__PURE__*/function () {
3718
- function ScrollSpy(element, config) {
3719
- var _this = this;
3720
-
3721
- this._element = element;
3722
- this._scrollElement = element.tagName === 'BODY' ? window : element;
3723
- this._config = this._getConfig(config);
3724
- this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
3725
- this._offsets = [];
3726
- this._targets = [];
3727
- this._activeTarget = null;
3728
- this._scrollHeight = 0;
3729
- $(this._scrollElement).on(EVENT_SCROLL, function (event) {
3730
- return _this._process(event);
3731
- });
3732
- this.refresh();
3733
-
3734
- this._process();
3735
- } // Getters
3736
-
3737
-
3738
- var _proto = ScrollSpy.prototype;
3739
-
3740
- // Public
3741
- _proto.refresh = function refresh() {
3742
- var _this2 = this;
3743
-
3744
- var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
3745
- var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
3746
- var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
3747
- this._offsets = [];
3748
- this._targets = [];
3749
- this._scrollHeight = this._getScrollHeight();
3750
- var targets = [].slice.call(document.querySelectorAll(this._selector));
3751
- targets.map(function (element) {
3752
- var target;
3753
- var targetSelector = Util.getSelectorFromElement(element);
3754
-
3755
- if (targetSelector) {
3756
- target = document.querySelector(targetSelector);
3757
- }
3758
-
3759
- if (target) {
3760
- var targetBCR = target.getBoundingClientRect();
3761
-
3762
- if (targetBCR.width || targetBCR.height) {
3763
- // TODO (fat): remove sketch reliance on jQuery position/offset
3764
- return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
3765
- }
3766
- }
3767
-
3768
- return null;
3769
- }).filter(function (item) {
3770
- return item;
3771
- }).sort(function (a, b) {
3772
- return a[0] - b[0];
3773
- }).forEach(function (item) {
3774
- _this2._offsets.push(item[0]);
3775
-
3776
- _this2._targets.push(item[1]);
3777
- });
3778
- };
3779
-
3780
- _proto.dispose = function dispose() {
3781
- $.removeData(this._element, DATA_KEY$8);
3782
- $(this._scrollElement).off(EVENT_KEY$8);
3783
- this._element = null;
3784
- this._scrollElement = null;
3785
- this._config = null;
3786
- this._selector = null;
3787
- this._offsets = null;
3788
- this._targets = null;
3789
- this._activeTarget = null;
3790
- this._scrollHeight = null;
3791
- } // Private
3792
- ;
3793
-
3794
- _proto._getConfig = function _getConfig(config) {
3795
- config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {});
3796
-
3797
- if (typeof config.target !== 'string' && Util.isElement(config.target)) {
3798
- var id = $(config.target).attr('id');
3799
-
3800
- if (!id) {
3801
- id = Util.getUID(NAME$8);
3802
- $(config.target).attr('id', id);
3803
- }
3804
-
3805
- config.target = "#" + id;
3806
- }
3807
-
3808
- Util.typeCheckConfig(NAME$8, config, DefaultType$6);
3809
- return config;
3810
- };
3811
-
3812
- _proto._getScrollTop = function _getScrollTop() {
3813
- return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
3814
- };
3815
-
3816
- _proto._getScrollHeight = function _getScrollHeight() {
3817
- return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
3818
- };
3819
-
3820
- _proto._getOffsetHeight = function _getOffsetHeight() {
3821
- return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
3822
- };
3823
-
3824
- _proto._process = function _process() {
3825
- var scrollTop = this._getScrollTop() + this._config.offset;
3826
-
3827
- var scrollHeight = this._getScrollHeight();
3828
-
3829
- var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
3830
-
3831
- if (this._scrollHeight !== scrollHeight) {
3832
- this.refresh();
3833
- }
3834
-
3835
- if (scrollTop >= maxScroll) {
3836
- var target = this._targets[this._targets.length - 1];
3837
-
3838
- if (this._activeTarget !== target) {
3839
- this._activate(target);
3840
- }
3841
-
3842
- return;
3843
- }
3844
-
3845
- if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
3846
- this._activeTarget = null;
3847
-
3848
- this._clear();
3849
-
3850
- return;
3851
- }
3852
-
3853
- for (var i = this._offsets.length; i--;) {
3854
- var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
3855
-
3856
- if (isActiveTarget) {
3857
- this._activate(this._targets[i]);
3858
- }
3859
- }
3860
- };
3861
-
3862
- _proto._activate = function _activate(target) {
3863
- this._activeTarget = target;
3864
-
3865
- this._clear();
3866
-
3867
- var queries = this._selector.split(',').map(function (selector) {
3868
- return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
3869
- });
3870
-
3871
- var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
3872
-
3873
- if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
3874
- $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);
3875
- $link.addClass(CLASS_NAME_ACTIVE$2);
3876
- } else {
3877
- // Set triggered link as active
3878
- $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active
3879
- // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
3880
-
3881
- $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item
3882
-
3883
- $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2);
3884
- }
3885
-
3886
- $(this._scrollElement).trigger(EVENT_ACTIVATE, {
3887
- relatedTarget: target
3888
- });
3889
- };
3890
-
3891
- _proto._clear = function _clear() {
3892
- [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
3893
- return node.classList.contains(CLASS_NAME_ACTIVE$2);
3894
- }).forEach(function (node) {
3895
- return node.classList.remove(CLASS_NAME_ACTIVE$2);
3896
- });
3897
- } // Static
3898
- ;
3899
-
3900
- ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
3901
- return this.each(function () {
3902
- var data = $(this).data(DATA_KEY$8);
3903
-
3904
- var _config = typeof config === 'object' && config;
3905
-
3906
- if (!data) {
3907
- data = new ScrollSpy(this, _config);
3908
- $(this).data(DATA_KEY$8, data);
3909
- }
3910
-
3911
- if (typeof config === 'string') {
3912
- if (typeof data[config] === 'undefined') {
3913
- throw new TypeError("No method named \"" + config + "\"");
3914
- }
3915
-
3916
- data[config]();
3917
- }
3918
- });
3919
- };
3920
-
3921
- _createClass(ScrollSpy, null, [{
3922
- key: "VERSION",
3923
- get: function get() {
3924
- return VERSION$8;
3925
- }
3926
- }, {
3927
- key: "Default",
3928
- get: function get() {
3929
- return Default$6;
3930
- }
3931
- }]);
3932
-
3933
- return ScrollSpy;
3934
- }();
3935
- /**
3936
- * ------------------------------------------------------------------------
3937
- * Data Api implementation
3938
- * ------------------------------------------------------------------------
3939
- */
3940
-
3941
-
3942
- $(window).on(EVENT_LOAD_DATA_API$2, function () {
3943
- var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
3944
- var scrollSpysLength = scrollSpys.length;
3945
-
3946
- for (var i = scrollSpysLength; i--;) {
3947
- var $spy = $(scrollSpys[i]);
3948
-
3949
- ScrollSpy._jQueryInterface.call($spy, $spy.data());
3950
- }
3951
- });
3952
- /**
3953
- * ------------------------------------------------------------------------
3954
- * jQuery
3955
- * ------------------------------------------------------------------------
3956
- */
3957
-
3958
- $.fn[NAME$8] = ScrollSpy._jQueryInterface;
3959
- $.fn[NAME$8].Constructor = ScrollSpy;
3960
-
3961
- $.fn[NAME$8].noConflict = function () {
3962
- $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
3963
- return ScrollSpy._jQueryInterface;
3964
- };
3965
-
3966
- /**
3967
- * ------------------------------------------------------------------------
3968
- * Constants
3969
- * ------------------------------------------------------------------------
3970
- */
3971
-
3972
- var NAME$9 = 'tab';
3973
- var VERSION$9 = '4.5.0';
3974
- var DATA_KEY$9 = 'bs.tab';
3975
- var EVENT_KEY$9 = "." + DATA_KEY$9;
3976
- var DATA_API_KEY$7 = '.data-api';
3977
- var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
3978
- var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
3979
- var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
3980
- var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
3981
- var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
3982
- var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
3983
- var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
3984
- var CLASS_NAME_ACTIVE$3 = 'active';
3985
- var CLASS_NAME_DISABLED$1 = 'disabled';
3986
- var CLASS_NAME_FADE$4 = 'fade';
3987
- var CLASS_NAME_SHOW$6 = 'show';
3988
- var SELECTOR_DROPDOWN$1 = '.dropdown';
3989
- var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
3990
- var SELECTOR_ACTIVE$2 = '.active';
3991
- var SELECTOR_ACTIVE_UL = '> li > .active';
3992
- var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
3993
- var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
3994
- var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
3995
- /**
3996
- * ------------------------------------------------------------------------
3997
- * Class Definition
3998
- * ------------------------------------------------------------------------
3999
- */
4000
-
4001
- var Tab = /*#__PURE__*/function () {
4002
- function Tab(element) {
4003
- this._element = element;
4004
- } // Getters
4005
-
4006
-
4007
- var _proto = Tab.prototype;
4008
-
4009
- // Public
4010
- _proto.show = function show() {
4011
- var _this = this;
4012
-
4013
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE$3) || $(this._element).hasClass(CLASS_NAME_DISABLED$1)) {
4014
- return;
4015
- }
4016
-
4017
- var target;
4018
- var previous;
4019
- var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0];
4020
- var selector = Util.getSelectorFromElement(this._element);
4021
-
4022
- if (listElement) {
4023
- var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
4024
- previous = $.makeArray($(listElement).find(itemSelector));
4025
- previous = previous[previous.length - 1];
4026
- }
4027
-
4028
- var hideEvent = $.Event(EVENT_HIDE$3, {
4029
- relatedTarget: this._element
4030
- });
4031
- var showEvent = $.Event(EVENT_SHOW$3, {
4032
- relatedTarget: previous
4033
- });
4034
-
4035
- if (previous) {
4036
- $(previous).trigger(hideEvent);
4037
- }
4038
-
4039
- $(this._element).trigger(showEvent);
4040
-
4041
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
4042
- return;
4043
- }
4044
-
4045
- if (selector) {
4046
- target = document.querySelector(selector);
4047
- }
4048
-
4049
- this._activate(this._element, listElement);
4050
-
4051
- var complete = function complete() {
4052
- var hiddenEvent = $.Event(EVENT_HIDDEN$3, {
4053
- relatedTarget: _this._element
4054
- });
4055
- var shownEvent = $.Event(EVENT_SHOWN$3, {
4056
- relatedTarget: previous
4057
- });
4058
- $(previous).trigger(hiddenEvent);
4059
- $(_this._element).trigger(shownEvent);
4060
- };
4061
-
4062
- if (target) {
4063
- this._activate(target, target.parentNode, complete);
4064
- } else {
4065
- complete();
4066
- }
4067
- };
4068
-
4069
- _proto.dispose = function dispose() {
4070
- $.removeData(this._element, DATA_KEY$9);
4071
- this._element = null;
4072
- } // Private
4073
- ;
4074
-
4075
- _proto._activate = function _activate(element, container, callback) {
4076
- var _this2 = this;
4077
-
4078
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE$2);
4079
- var active = activeElements[0];
4080
- var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE$4);
4081
-
4082
- var complete = function complete() {
4083
- return _this2._transitionComplete(element, active, callback);
4084
- };
4085
-
4086
- if (active && isTransitioning) {
4087
- var transitionDuration = Util.getTransitionDurationFromElement(active);
4088
- $(active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
4089
- } else {
4090
- complete();
4091
- }
4092
- };
4093
-
4094
- _proto._transitionComplete = function _transitionComplete(element, active, callback) {
4095
- if (active) {
4096
- $(active).removeClass(CLASS_NAME_ACTIVE$3);
4097
- var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
4098
-
4099
- if (dropdownChild) {
4100
- $(dropdownChild).removeClass(CLASS_NAME_ACTIVE$3);
4101
- }
4102
-
4103
- if (active.getAttribute('role') === 'tab') {
4104
- active.setAttribute('aria-selected', false);
4105
- }
4106
- }
4107
-
4108
- $(element).addClass(CLASS_NAME_ACTIVE$3);
4109
-
4110
- if (element.getAttribute('role') === 'tab') {
4111
- element.setAttribute('aria-selected', true);
4112
- }
4113
-
4114
- Util.reflow(element);
4115
-
4116
- if (element.classList.contains(CLASS_NAME_FADE$4)) {
4117
- element.classList.add(CLASS_NAME_SHOW$6);
4118
- }
4119
-
4120
- if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
4121
- var dropdownElement = $(element).closest(SELECTOR_DROPDOWN$1)[0];
4122
-
4123
- if (dropdownElement) {
4124
- var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1));
4125
- $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3);
4126
- }
4127
-
4128
- element.setAttribute('aria-expanded', true);
4129
- }
4130
-
4131
- if (callback) {
4132
- callback();
4133
- }
4134
- } // Static
4135
- ;
4136
-
4137
- Tab._jQueryInterface = function _jQueryInterface(config) {
4138
- return this.each(function () {
4139
- var $this = $(this);
4140
- var data = $this.data(DATA_KEY$9);
4141
-
4142
- if (!data) {
4143
- data = new Tab(this);
4144
- $this.data(DATA_KEY$9, data);
4145
- }
4146
-
4147
- if (typeof config === 'string') {
4148
- if (typeof data[config] === 'undefined') {
4149
- throw new TypeError("No method named \"" + config + "\"");
4150
- }
4151
-
4152
- data[config]();
4153
- }
4154
- });
4155
- };
4156
-
4157
- _createClass(Tab, null, [{
4158
- key: "VERSION",
4159
- get: function get() {
4160
- return VERSION$9;
4161
- }
4162
- }]);
4163
-
4164
- return Tab;
4165
- }();
4166
- /**
4167
- * ------------------------------------------------------------------------
4168
- * Data Api implementation
4169
- * ------------------------------------------------------------------------
4170
- */
4171
-
4172
-
4173
- $(document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
4174
- event.preventDefault();
4175
-
4176
- Tab._jQueryInterface.call($(this), 'show');
4177
- });
4178
- /**
4179
- * ------------------------------------------------------------------------
4180
- * jQuery
4181
- * ------------------------------------------------------------------------
4182
- */
4183
-
4184
- $.fn[NAME$9] = Tab._jQueryInterface;
4185
- $.fn[NAME$9].Constructor = Tab;
4186
-
4187
- $.fn[NAME$9].noConflict = function () {
4188
- $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
4189
- return Tab._jQueryInterface;
4190
- };
4191
-
4192
- /**
4193
- * ------------------------------------------------------------------------
4194
- * Constants
4195
- * ------------------------------------------------------------------------
4196
- */
4197
-
4198
- var NAME$a = 'toast';
4199
- var VERSION$a = '4.5.0';
4200
- var DATA_KEY$a = 'bs.toast';
4201
- var EVENT_KEY$a = "." + DATA_KEY$a;
4202
- var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
4203
- var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
4204
- var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
4205
- var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
4206
- var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
4207
- var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
4208
- var CLASS_NAME_FADE$5 = 'fade';
4209
- var CLASS_NAME_HIDE = 'hide';
4210
- var CLASS_NAME_SHOW$7 = 'show';
4211
- var CLASS_NAME_SHOWING = 'showing';
4212
- var DefaultType$7 = {
4213
- animation: 'boolean',
4214
- autohide: 'boolean',
4215
- delay: 'number'
4216
- };
4217
- var Default$7 = {
4218
- animation: true,
4219
- autohide: true,
4220
- delay: 500
4221
- };
4222
- var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
4223
- /**
4224
- * ------------------------------------------------------------------------
4225
- * Class Definition
4226
- * ------------------------------------------------------------------------
4227
- */
4228
-
4229
- var Toast = /*#__PURE__*/function () {
4230
- function Toast(element, config) {
4231
- this._element = element;
4232
- this._config = this._getConfig(config);
4233
- this._timeout = null;
4234
-
4235
- this._setListeners();
4236
- } // Getters
4237
-
4238
-
4239
- var _proto = Toast.prototype;
4240
-
4241
- // Public
4242
- _proto.show = function show() {
4243
- var _this = this;
4244
-
4245
- var showEvent = $.Event(EVENT_SHOW$4);
4246
- $(this._element).trigger(showEvent);
4247
-
4248
- if (showEvent.isDefaultPrevented()) {
4249
- return;
4250
- }
4251
-
4252
- if (this._config.animation) {
4253
- this._element.classList.add(CLASS_NAME_FADE$5);
4254
- }
4255
-
4256
- var complete = function complete() {
4257
- _this._element.classList.remove(CLASS_NAME_SHOWING);
4258
-
4259
- _this._element.classList.add(CLASS_NAME_SHOW$7);
4260
-
4261
- $(_this._element).trigger(EVENT_SHOWN$4);
4262
-
4263
- if (_this._config.autohide) {
4264
- _this._timeout = setTimeout(function () {
4265
- _this.hide();
4266
- }, _this._config.delay);
4267
- }
4268
- };
4269
-
4270
- this._element.classList.remove(CLASS_NAME_HIDE);
4271
-
4272
- Util.reflow(this._element);
4273
-
4274
- this._element.classList.add(CLASS_NAME_SHOWING);
4275
-
4276
- if (this._config.animation) {
4277
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
4278
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
4279
- } else {
4280
- complete();
4281
- }
4282
- };
4283
-
4284
- _proto.hide = function hide() {
4285
- if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
4286
- return;
4287
- }
4288
-
4289
- var hideEvent = $.Event(EVENT_HIDE$4);
4290
- $(this._element).trigger(hideEvent);
4291
-
4292
- if (hideEvent.isDefaultPrevented()) {
4293
- return;
4294
- }
4295
-
4296
- this._close();
4297
- };
4298
-
4299
- _proto.dispose = function dispose() {
4300
- clearTimeout(this._timeout);
4301
- this._timeout = null;
4302
-
4303
- if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
4304
- this._element.classList.remove(CLASS_NAME_SHOW$7);
4305
- }
4306
-
4307
- $(this._element).off(EVENT_CLICK_DISMISS$1);
4308
- $.removeData(this._element, DATA_KEY$a);
4309
- this._element = null;
4310
- this._config = null;
4311
- } // Private
4312
- ;
4313
-
4314
- _proto._getConfig = function _getConfig(config) {
4315
- config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$7), $(this._element).data()), typeof config === 'object' && config ? config : {});
4316
- Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
4317
- return config;
4318
- };
4319
-
4320
- _proto._setListeners = function _setListeners() {
4321
- var _this2 = this;
4322
-
4323
- $(this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
4324
- return _this2.hide();
4325
- });
4326
- };
4327
-
4328
- _proto._close = function _close() {
4329
- var _this3 = this;
4330
-
4331
- var complete = function complete() {
4332
- _this3._element.classList.add(CLASS_NAME_HIDE);
4333
-
4334
- $(_this3._element).trigger(EVENT_HIDDEN$4);
4335
- };
4336
-
4337
- this._element.classList.remove(CLASS_NAME_SHOW$7);
4338
-
4339
- if (this._config.animation) {
4340
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
4341
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
4342
- } else {
4343
- complete();
4344
- }
4345
- } // Static
4346
- ;
4347
-
4348
- Toast._jQueryInterface = function _jQueryInterface(config) {
4349
- return this.each(function () {
4350
- var $element = $(this);
4351
- var data = $element.data(DATA_KEY$a);
4352
-
4353
- var _config = typeof config === 'object' && config;
4354
-
4355
- if (!data) {
4356
- data = new Toast(this, _config);
4357
- $element.data(DATA_KEY$a, data);
4358
- }
4359
-
4360
- if (typeof config === 'string') {
4361
- if (typeof data[config] === 'undefined') {
4362
- throw new TypeError("No method named \"" + config + "\"");
4363
- }
4364
-
4365
- data[config](this);
4366
- }
4367
- });
4368
- };
4369
-
4370
- _createClass(Toast, null, [{
4371
- key: "VERSION",
4372
- get: function get() {
4373
- return VERSION$a;
4374
- }
4375
- }, {
4376
- key: "DefaultType",
4377
- get: function get() {
4378
- return DefaultType$7;
4379
- }
4380
- }, {
4381
- key: "Default",
4382
- get: function get() {
4383
- return Default$7;
4384
- }
4385
- }]);
4386
-
4387
- return Toast;
4388
- }();
4389
- /**
4390
- * ------------------------------------------------------------------------
4391
- * jQuery
4392
- * ------------------------------------------------------------------------
4393
- */
4394
-
4395
-
4396
- $.fn[NAME$a] = Toast._jQueryInterface;
4397
- $.fn[NAME$a].Constructor = Toast;
4398
-
4399
- $.fn[NAME$a].noConflict = function () {
4400
- $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
4401
- return Toast._jQueryInterface;
4402
- };
4403
-
4404
- exports.Alert = Alert;
4405
- exports.Button = Button;
4406
- exports.Carousel = Carousel;
4407
- exports.Collapse = Collapse;
4408
- exports.Dropdown = Dropdown;
4409
- exports.Modal = Modal;
4410
- exports.Popover = Popover;
4411
- exports.Scrollspy = ScrollSpy;
4412
- exports.Tab = Tab;
4413
- exports.Toast = Toast;
4414
- exports.Tooltip = Tooltip;
4415
- exports.Util = Util;
4416
-
4417
- Object.defineProperty(exports, '__esModule', { value: true });
4418
-
4419
- })));
4420
- //# sourceMappingURL=bootstrap.js.map