UNPKG

403 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) :
4 (global = global || self, factory(global.Reactstrap = {}, global.React, global.ReactDOM));
5}(this, (function (exports, React, ReactDOM) { 'use strict';
6
7 var React__default = 'default' in React ? React['default'] : React;
8 ReactDOM = ReactDOM && Object.prototype.hasOwnProperty.call(ReactDOM, 'default') ? ReactDOM['default'] : ReactDOM;
9
10 function _extends() {
11 _extends = Object.assign || function (target) {
12 for (var i = 1; i < arguments.length; i++) {
13 var source = arguments[i];
14
15 for (var key in source) {
16 if (Object.prototype.hasOwnProperty.call(source, key)) {
17 target[key] = source[key];
18 }
19 }
20 }
21
22 return target;
23 };
24
25 return _extends.apply(this, arguments);
26 }
27
28 function _inheritsLoose(subClass, superClass) {
29 subClass.prototype = Object.create(superClass.prototype);
30 subClass.prototype.constructor = subClass;
31 subClass.__proto__ = superClass;
32 }
33
34 function _objectWithoutPropertiesLoose(source, excluded) {
35 if (source == null) return {};
36 var target = {};
37 var sourceKeys = Object.keys(source);
38 var key, i;
39
40 for (i = 0; i < sourceKeys.length; i++) {
41 key = sourceKeys[i];
42 if (excluded.indexOf(key) >= 0) continue;
43 target[key] = source[key];
44 }
45
46 return target;
47 }
48
49 function _assertThisInitialized(self) {
50 if (self === void 0) {
51 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
52 }
53
54 return self;
55 }
56
57 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
58
59 function unwrapExports (x) {
60 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
61 }
62
63 function createCommonjsModule(fn, module) {
64 return module = { exports: {} }, fn(module, module.exports), module.exports;
65 }
66
67 /** @license React v16.13.1
68 * react-is.production.min.js
69 *
70 * Copyright (c) Facebook, Inc. and its affiliates.
71 *
72 * This source code is licensed under the MIT license found in the
73 * LICENSE file in the root directory of this source tree.
74 */
75
76 var b = "function" === typeof Symbol && Symbol.for,
77 c = b ? Symbol.for("react.element") : 60103,
78 d = b ? Symbol.for("react.portal") : 60106,
79 e = b ? Symbol.for("react.fragment") : 60107,
80 f = b ? Symbol.for("react.strict_mode") : 60108,
81 g = b ? Symbol.for("react.profiler") : 60114,
82 h = b ? Symbol.for("react.provider") : 60109,
83 k = b ? Symbol.for("react.context") : 60110,
84 l = b ? Symbol.for("react.async_mode") : 60111,
85 m = b ? Symbol.for("react.concurrent_mode") : 60111,
86 n = b ? Symbol.for("react.forward_ref") : 60112,
87 p = b ? Symbol.for("react.suspense") : 60113,
88 q = b ? Symbol.for("react.suspense_list") : 60120,
89 r = b ? Symbol.for("react.memo") : 60115,
90 t = b ? Symbol.for("react.lazy") : 60116,
91 v = b ? Symbol.for("react.block") : 60121,
92 w = b ? Symbol.for("react.fundamental") : 60117,
93 x = b ? Symbol.for("react.responder") : 60118,
94 y = b ? Symbol.for("react.scope") : 60119;
95
96 function z(a) {
97 if ("object" === typeof a && null !== a) {
98 var u = a.$$typeof;
99
100 switch (u) {
101 case c:
102 switch (a = a.type, a) {
103 case l:
104 case m:
105 case e:
106 case g:
107 case f:
108 case p:
109 return a;
110
111 default:
112 switch (a = a && a.$$typeof, a) {
113 case k:
114 case n:
115 case t:
116 case r:
117 case h:
118 return a;
119
120 default:
121 return u;
122 }
123
124 }
125
126 case d:
127 return u;
128 }
129 }
130 }
131
132 function A(a) {
133 return z(a) === m;
134 }
135
136 var AsyncMode = l;
137 var ConcurrentMode = m;
138 var ContextConsumer = k;
139 var ContextProvider = h;
140 var Element = c;
141 var ForwardRef = n;
142 var Fragment = e;
143 var Lazy = t;
144 var Memo = r;
145 var Portal = d;
146 var Profiler = g;
147 var StrictMode = f;
148 var Suspense = p;
149
150 var isAsyncMode = function isAsyncMode(a) {
151 return A(a) || z(a) === l;
152 };
153
154 var isConcurrentMode = A;
155
156 var isContextConsumer = function isContextConsumer(a) {
157 return z(a) === k;
158 };
159
160 var isContextProvider = function isContextProvider(a) {
161 return z(a) === h;
162 };
163
164 var isElement = function isElement(a) {
165 return "object" === typeof a && null !== a && a.$$typeof === c;
166 };
167
168 var isForwardRef = function isForwardRef(a) {
169 return z(a) === n;
170 };
171
172 var isFragment = function isFragment(a) {
173 return z(a) === e;
174 };
175
176 var isLazy = function isLazy(a) {
177 return z(a) === t;
178 };
179
180 var isMemo = function isMemo(a) {
181 return z(a) === r;
182 };
183
184 var isPortal = function isPortal(a) {
185 return z(a) === d;
186 };
187
188 var isProfiler = function isProfiler(a) {
189 return z(a) === g;
190 };
191
192 var isStrictMode = function isStrictMode(a) {
193 return z(a) === f;
194 };
195
196 var isSuspense = function isSuspense(a) {
197 return z(a) === p;
198 };
199
200 var isValidElementType = function isValidElementType(a) {
201 return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
202 };
203
204 var typeOf = z;
205 var reactIs_production_min = {
206 AsyncMode: AsyncMode,
207 ConcurrentMode: ConcurrentMode,
208 ContextConsumer: ContextConsumer,
209 ContextProvider: ContextProvider,
210 Element: Element,
211 ForwardRef: ForwardRef,
212 Fragment: Fragment,
213 Lazy: Lazy,
214 Memo: Memo,
215 Portal: Portal,
216 Profiler: Profiler,
217 StrictMode: StrictMode,
218 Suspense: Suspense,
219 isAsyncMode: isAsyncMode,
220 isConcurrentMode: isConcurrentMode,
221 isContextConsumer: isContextConsumer,
222 isContextProvider: isContextProvider,
223 isElement: isElement,
224 isForwardRef: isForwardRef,
225 isFragment: isFragment,
226 isLazy: isLazy,
227 isMemo: isMemo,
228 isPortal: isPortal,
229 isProfiler: isProfiler,
230 isStrictMode: isStrictMode,
231 isSuspense: isSuspense,
232 isValidElementType: isValidElementType,
233 typeOf: typeOf
234 };
235
236 var reactIs_development = createCommonjsModule(function (module, exports) {
237 });
238 var reactIs_development_1 = reactIs_development.AsyncMode;
239 var reactIs_development_2 = reactIs_development.ConcurrentMode;
240 var reactIs_development_3 = reactIs_development.ContextConsumer;
241 var reactIs_development_4 = reactIs_development.ContextProvider;
242 var reactIs_development_5 = reactIs_development.Element;
243 var reactIs_development_6 = reactIs_development.ForwardRef;
244 var reactIs_development_7 = reactIs_development.Fragment;
245 var reactIs_development_8 = reactIs_development.Lazy;
246 var reactIs_development_9 = reactIs_development.Memo;
247 var reactIs_development_10 = reactIs_development.Portal;
248 var reactIs_development_11 = reactIs_development.Profiler;
249 var reactIs_development_12 = reactIs_development.StrictMode;
250 var reactIs_development_13 = reactIs_development.Suspense;
251 var reactIs_development_14 = reactIs_development.isAsyncMode;
252 var reactIs_development_15 = reactIs_development.isConcurrentMode;
253 var reactIs_development_16 = reactIs_development.isContextConsumer;
254 var reactIs_development_17 = reactIs_development.isContextProvider;
255 var reactIs_development_18 = reactIs_development.isElement;
256 var reactIs_development_19 = reactIs_development.isForwardRef;
257 var reactIs_development_20 = reactIs_development.isFragment;
258 var reactIs_development_21 = reactIs_development.isLazy;
259 var reactIs_development_22 = reactIs_development.isMemo;
260 var reactIs_development_23 = reactIs_development.isPortal;
261 var reactIs_development_24 = reactIs_development.isProfiler;
262 var reactIs_development_25 = reactIs_development.isStrictMode;
263 var reactIs_development_26 = reactIs_development.isSuspense;
264 var reactIs_development_27 = reactIs_development.isValidElementType;
265 var reactIs_development_28 = reactIs_development.typeOf;
266
267 var reactIs = createCommonjsModule(function (module) {
268
269 {
270 module.exports = reactIs_production_min;
271 }
272 });
273
274 /*
275 object-assign
276 (c) Sindre Sorhus
277 @license MIT
278 */
279 /* eslint-disable no-unused-vars */
280
281 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
282 var hasOwnProperty = Object.prototype.hasOwnProperty;
283 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
284
285 function toObject(val) {
286 if (val === null || val === undefined) {
287 throw new TypeError('Object.assign cannot be called with null or undefined');
288 }
289
290 return Object(val);
291 }
292
293 function shouldUseNative() {
294 try {
295 if (!Object.assign) {
296 return false;
297 } // Detect buggy property enumeration order in older V8 versions.
298 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
299
300
301 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
302
303 test1[5] = 'de';
304
305 if (Object.getOwnPropertyNames(test1)[0] === '5') {
306 return false;
307 } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
308
309
310 var test2 = {};
311
312 for (var i = 0; i < 10; i++) {
313 test2['_' + String.fromCharCode(i)] = i;
314 }
315
316 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
317 return test2[n];
318 });
319
320 if (order2.join('') !== '0123456789') {
321 return false;
322 } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
323
324
325 var test3 = {};
326 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
327 test3[letter] = letter;
328 });
329
330 if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
331 return false;
332 }
333
334 return true;
335 } catch (err) {
336 // We don't expect any of the above to throw, but better to be safe.
337 return false;
338 }
339 }
340
341 var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
342 var from;
343 var to = toObject(target);
344 var symbols;
345
346 for (var s = 1; s < arguments.length; s++) {
347 from = Object(arguments[s]);
348
349 for (var key in from) {
350 if (hasOwnProperty.call(from, key)) {
351 to[key] = from[key];
352 }
353 }
354
355 if (getOwnPropertySymbols) {
356 symbols = getOwnPropertySymbols(from);
357
358 for (var i = 0; i < symbols.length; i++) {
359 if (propIsEnumerable.call(from, symbols[i])) {
360 to[symbols[i]] = from[symbols[i]];
361 }
362 }
363 }
364 }
365
366 return to;
367 };
368
369 /**
370 * Copyright (c) 2013-present, Facebook, Inc.
371 *
372 * This source code is licensed under the MIT license found in the
373 * LICENSE file in the root directory of this source tree.
374 */
375
376 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
377 var ReactPropTypesSecret_1 = ReactPropTypesSecret;
378
379 var has = Function.call.bind(Object.prototype.hasOwnProperty);
380
381 function emptyFunction() {}
382
383 function emptyFunctionWithReset() {}
384
385 emptyFunctionWithReset.resetWarningCache = emptyFunction;
386
387 var factoryWithThrowingShims = function factoryWithThrowingShims() {
388 function shim(props, propName, componentName, location, propFullName, secret) {
389 if (secret === ReactPropTypesSecret_1) {
390 // It is still safe when called from React.
391 return;
392 }
393
394 var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
395 err.name = 'Invariant Violation';
396 throw err;
397 }
398 shim.isRequired = shim;
399
400 function getShim() {
401 return shim;
402 }
403 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
404
405 var ReactPropTypes = {
406 array: shim,
407 bool: shim,
408 func: shim,
409 number: shim,
410 object: shim,
411 string: shim,
412 symbol: shim,
413 any: shim,
414 arrayOf: getShim,
415 element: shim,
416 elementType: shim,
417 instanceOf: getShim,
418 node: shim,
419 objectOf: getShim,
420 oneOf: getShim,
421 oneOfType: getShim,
422 shape: getShim,
423 exact: getShim,
424 checkPropTypes: emptyFunctionWithReset,
425 resetWarningCache: emptyFunction
426 };
427 ReactPropTypes.PropTypes = ReactPropTypes;
428 return ReactPropTypes;
429 };
430
431 var propTypes = createCommonjsModule(function (module) {
432 /**
433 * Copyright (c) 2013-present, Facebook, Inc.
434 *
435 * This source code is licensed under the MIT license found in the
436 * LICENSE file in the root directory of this source tree.
437 */
438 {
439 // By explicitly using `prop-types` you are opting into new production behavior.
440 // http://fb.me/prop-types-in-prod
441 module.exports = factoryWithThrowingShims();
442 }
443 });
444
445 var classnames = createCommonjsModule(function (module) {
446 /*!
447 Copyright (c) 2017 Jed Watson.
448 Licensed under the MIT License (MIT), see
449 http://jedwatson.github.io/classnames
450 */
451
452 /* global define */
453 (function () {
454
455 var hasOwn = {}.hasOwnProperty;
456
457 function classNames() {
458 var classes = [];
459
460 for (var i = 0; i < arguments.length; i++) {
461 var arg = arguments[i];
462 if (!arg) continue;
463 var argType = typeof arg;
464
465 if (argType === 'string' || argType === 'number') {
466 classes.push(arg);
467 } else if (Array.isArray(arg) && arg.length) {
468 var inner = classNames.apply(null, arg);
469
470 if (inner) {
471 classes.push(inner);
472 }
473 } else if (argType === 'object') {
474 for (var key in arg) {
475 if (hasOwn.call(arg, key) && arg[key]) {
476 classes.push(key);
477 }
478 }
479 }
480 }
481
482 return classes.join(' ');
483 }
484
485 if ( module.exports) {
486 classNames.default = classNames;
487 module.exports = classNames;
488 } else {
489 window.classNames = classNames;
490 }
491 })();
492 });
493
494 function getScrollbarWidth() {
495 var scrollDiv = document.createElement('div'); // .modal-scrollbar-measure styles // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.4/scss/_modal.scss#L106-L113
496
497 scrollDiv.style.position = 'absolute';
498 scrollDiv.style.top = '-9999px';
499 scrollDiv.style.width = '50px';
500 scrollDiv.style.height = '50px';
501 scrollDiv.style.overflow = 'scroll';
502 document.body.appendChild(scrollDiv);
503 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
504 document.body.removeChild(scrollDiv);
505 return scrollbarWidth;
506 }
507 function setScrollbarWidth(padding) {
508 document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
509 }
510 function isBodyOverflowing() {
511 return document.body.clientWidth < window.innerWidth;
512 }
513 function getOriginalBodyPadding() {
514 var style = window.getComputedStyle(document.body, null);
515 return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
516 }
517 function conditionallyUpdateScrollbar() {
518 var scrollbarWidth = getScrollbarWidth(); // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433
519
520 var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
521 var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
522
523 if (isBodyOverflowing()) {
524 setScrollbarWidth(bodyPadding + scrollbarWidth);
525 }
526 }
527 var globalCssModule;
528 function setGlobalCssModule(cssModule) {
529 globalCssModule = cssModule;
530 }
531 function mapToCssModules(className, cssModule) {
532 if (className === void 0) {
533 className = '';
534 }
535
536 if (cssModule === void 0) {
537 cssModule = globalCssModule;
538 }
539
540 if (!cssModule) return className;
541 return className.split(' ').map(function (c) {
542 return cssModule[c] || c;
543 }).join(' ');
544 }
545 /**
546 * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
547 */
548
549 function omit(obj, omitKeys) {
550 var result = {};
551 Object.keys(obj).forEach(function (key) {
552 if (omitKeys.indexOf(key) === -1) {
553 result[key] = obj[key];
554 }
555 });
556 return result;
557 }
558 /**
559 * Returns a filtered copy of an object with only the specified keys.
560 */
561
562 function pick(obj, keys) {
563 var pickKeys = Array.isArray(keys) ? keys : [keys];
564 var length = pickKeys.length;
565 var key;
566 var result = {};
567
568 while (length > 0) {
569 length -= 1;
570 key = pickKeys[length];
571 result[key] = obj[key];
572 }
573
574 return result;
575 }
576 var warned = {};
577 function warnOnce(message) {
578 if (!warned[message]) {
579 /* istanbul ignore else */
580 if (typeof console !== 'undefined') {
581 console.error(message); // eslint-disable-line no-console
582 }
583
584 warned[message] = true;
585 }
586 }
587 function deprecated(propType, explanation) {
588 return function validate(props, propName, componentName) {
589 if (props[propName] !== null && typeof props[propName] !== 'undefined') {
590 warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
591 }
592
593 for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
594 rest[_key - 3] = arguments[_key];
595 }
596
597 return propType.apply(void 0, [props, propName, componentName].concat(rest));
598 };
599 } // Shim Element if needed (e.g. in Node environment)
600
601 var Element$1 = typeof window === 'object' && window.Element || function () {};
602
603 function DOMElement(props, propName, componentName) {
604 if (!(props[propName] instanceof Element$1)) {
605 return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
606 }
607 }
608 var targetPropType = propTypes.oneOfType([propTypes.string, propTypes.func, DOMElement, propTypes.shape({
609 current: propTypes.any
610 })]);
611 var tagPropType = propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
612 $$typeof: propTypes.symbol,
613 render: propTypes.func
614 }), propTypes.arrayOf(propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
615 $$typeof: propTypes.symbol,
616 render: propTypes.func
617 })]))]);
618 /* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */
619 // These are all setup to match what is in the bootstrap _variables.scss
620 // https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
621
622 var TransitionTimeouts = {
623 Fade: 150,
624 // $transition-fade
625 Collapse: 350,
626 // $transition-collapse
627 Modal: 300,
628 // $modal-transition
629 Carousel: 600 // $carousel-transition
630
631 }; // Duplicated Transition.propType keys to ensure that Reactstrap builds
632 // for distribution properly exclude these keys for nested child HTML attributes
633 // since `react-transition-group` removes propTypes in production builds.
634
635 var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
636 var TransitionStatuses = {
637 ENTERING: 'entering',
638 ENTERED: 'entered',
639 EXITING: 'exiting',
640 EXITED: 'exited'
641 };
642 var keyCodes = {
643 esc: 27,
644 space: 32,
645 enter: 13,
646 tab: 9,
647 up: 38,
648 down: 40,
649 home: 36,
650 end: 35,
651 n: 78,
652 p: 80
653 };
654 var PopperPlacements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
655 var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
656 function isReactRefObj(target) {
657 if (target && typeof target === 'object') {
658 return 'current' in target;
659 }
660
661 return false;
662 }
663
664 function getTag(value) {
665 if (value == null) {
666 return value === undefined ? '[object Undefined]' : '[object Null]';
667 }
668
669 return Object.prototype.toString.call(value);
670 }
671
672 function toNumber(value) {
673 var type = typeof value;
674 var NAN = 0 / 0;
675
676 if (type === 'number') {
677 return value;
678 }
679
680 if (type === 'symbol' || type === 'object' && getTag(value) === '[object Symbol]') {
681 return NAN;
682 }
683
684 if (isObject(value)) {
685 var other = typeof value.valueOf === 'function' ? value.valueOf() : value;
686 value = isObject(other) ? "" + other : other;
687 }
688
689 if (type !== 'string') {
690 return value === 0 ? value : +value;
691 }
692
693 value = value.replace(/^\s+|\s+$/g, '');
694 var isBinary = /^0b[01]+$/i.test(value);
695 return isBinary || /^0o[0-7]+$/i.test(value) ? parseInt(value.slice(2), isBinary ? 2 : 8) : /^[-+]0x[0-9a-f]+$/i.test(value) ? NAN : +value;
696 }
697 function isObject(value) {
698 var type = typeof value;
699 return value != null && (type === 'object' || type === 'function');
700 }
701 function isFunction(value) {
702 if (!isObject(value)) {
703 return false;
704 }
705
706 var tag = getTag(value);
707 return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object Proxy]';
708 }
709 function findDOMElements(target) {
710 if (isReactRefObj(target)) {
711 return target.current;
712 }
713
714 if (isFunction(target)) {
715 return target();
716 }
717
718 if (typeof target === 'string' && canUseDOM) {
719 var selection = document.querySelectorAll(target);
720
721 if (!selection.length) {
722 selection = document.querySelectorAll("#" + target);
723 }
724
725 if (!selection.length) {
726 throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
727 }
728
729 return selection;
730 }
731
732 return target;
733 }
734 function isArrayOrNodeList(els) {
735 if (els === null) {
736 return false;
737 }
738
739 return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
740 }
741 function getTarget(target, allElements) {
742 var els = findDOMElements(target);
743
744 if (allElements) {
745 if (isArrayOrNodeList(els)) {
746 return els;
747 }
748
749 if (els === null) {
750 return [];
751 }
752
753 return [els];
754 } else {
755 if (isArrayOrNodeList(els)) {
756 return els[0];
757 }
758
759 return els;
760 }
761 }
762 var defaultToggleEvents = ['touchstart', 'click'];
763 function addMultipleEventListeners(_els, handler, _events, useCapture) {
764 var els = _els;
765
766 if (!isArrayOrNodeList(els)) {
767 els = [els];
768 }
769
770 var events = _events;
771
772 if (typeof events === 'string') {
773 events = events.split(/\s+/);
774 }
775
776 if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
777 throw new Error("\n The first argument of this function must be DOM node or an array on DOM nodes or NodeList.\n The second must be a function.\n The third is a string or an array of strings that represents DOM events\n ");
778 }
779
780 Array.prototype.forEach.call(events, function (event) {
781 Array.prototype.forEach.call(els, function (el) {
782 el.addEventListener(event, handler, useCapture);
783 });
784 });
785 return function removeEvents() {
786 Array.prototype.forEach.call(events, function (event) {
787 Array.prototype.forEach.call(els, function (el) {
788 el.removeEventListener(event, handler, useCapture);
789 });
790 });
791 };
792 }
793 var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'object', 'embed', '[tabindex]:not(.modal)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'];
794
795 var utils = /*#__PURE__*/Object.freeze({
796 __proto__: null,
797 getScrollbarWidth: getScrollbarWidth,
798 setScrollbarWidth: setScrollbarWidth,
799 isBodyOverflowing: isBodyOverflowing,
800 getOriginalBodyPadding: getOriginalBodyPadding,
801 conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
802 setGlobalCssModule: setGlobalCssModule,
803 mapToCssModules: mapToCssModules,
804 omit: omit,
805 pick: pick,
806 warnOnce: warnOnce,
807 deprecated: deprecated,
808 DOMElement: DOMElement,
809 targetPropType: targetPropType,
810 tagPropType: tagPropType,
811 TransitionTimeouts: TransitionTimeouts,
812 TransitionPropTypeKeys: TransitionPropTypeKeys,
813 TransitionStatuses: TransitionStatuses,
814 keyCodes: keyCodes,
815 PopperPlacements: PopperPlacements,
816 canUseDOM: canUseDOM,
817 isReactRefObj: isReactRefObj,
818 toNumber: toNumber,
819 isObject: isObject,
820 isFunction: isFunction,
821 findDOMElements: findDOMElements,
822 isArrayOrNodeList: isArrayOrNodeList,
823 getTarget: getTarget,
824 defaultToggleEvents: defaultToggleEvents,
825 addMultipleEventListeners: addMultipleEventListeners,
826 focusableElements: focusableElements
827 });
828
829 var propTypes$1 = {
830 tag: tagPropType,
831 fluid: propTypes.oneOfType([propTypes.bool, propTypes.string]),
832 className: propTypes.string,
833 cssModule: propTypes.object
834 };
835 var defaultProps = {
836 tag: 'div'
837 };
838
839 var Container = function Container(props) {
840 var className = props.className,
841 cssModule = props.cssModule,
842 fluid = props.fluid,
843 Tag = props.tag,
844 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "fluid", "tag"]);
845
846 var containerClass = 'container';
847
848 if (fluid === true) {
849 containerClass = 'container-fluid';
850 } else if (fluid) {
851 containerClass = "container-" + fluid;
852 }
853
854 var classes = mapToCssModules(classnames(className, containerClass), cssModule);
855 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
856 className: classes
857 }));
858 };
859
860 Container.propTypes = propTypes$1;
861 Container.defaultProps = defaultProps;
862
863 var rowColWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
864 var rowColsPropType = propTypes.oneOfType([propTypes.number, propTypes.string]);
865 var propTypes$2 = {
866 tag: tagPropType,
867 noGutters: propTypes.bool,
868 className: propTypes.string,
869 cssModule: propTypes.object,
870 form: propTypes.bool,
871 xs: rowColsPropType,
872 sm: rowColsPropType,
873 md: rowColsPropType,
874 lg: rowColsPropType,
875 xl: rowColsPropType
876 };
877 var defaultProps$1 = {
878 tag: 'div',
879 widths: rowColWidths
880 };
881
882 var Row = function Row(props) {
883 var className = props.className,
884 cssModule = props.cssModule,
885 noGutters = props.noGutters,
886 Tag = props.tag,
887 form = props.form,
888 widths = props.widths,
889 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "noGutters", "tag", "form", "widths"]);
890
891 var colClasses = [];
892 widths.forEach(function (colWidth, i) {
893 var colSize = props[colWidth];
894 delete attributes[colWidth];
895
896 if (!colSize) {
897 return;
898 }
899
900 var isXs = !i;
901 colClasses.push(isXs ? "row-cols-" + colSize : "row-cols-" + colWidth + "-" + colSize);
902 });
903 var classes = mapToCssModules(classnames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row', colClasses), cssModule);
904 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
905 className: classes
906 }));
907 };
908
909 Row.propTypes = propTypes$2;
910 Row.defaultProps = defaultProps$1;
911
912 var colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
913 var stringOrNumberProp = propTypes.oneOfType([propTypes.number, propTypes.string]);
914 var columnProps = propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string, propTypes.shape({
915 size: propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string]),
916 order: stringOrNumberProp,
917 offset: stringOrNumberProp
918 })]);
919 var propTypes$3 = {
920 tag: tagPropType,
921 xs: columnProps,
922 sm: columnProps,
923 md: columnProps,
924 lg: columnProps,
925 xl: columnProps,
926 className: propTypes.string,
927 cssModule: propTypes.object,
928 widths: propTypes.array
929 };
930 var defaultProps$2 = {
931 tag: 'div',
932 widths: colWidths
933 };
934
935 var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
936 if (colSize === true || colSize === '') {
937 return isXs ? 'col' : "col-" + colWidth;
938 } else if (colSize === 'auto') {
939 return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
940 }
941
942 return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
943 };
944
945 var Col = function Col(props) {
946 var className = props.className,
947 cssModule = props.cssModule,
948 widths = props.widths,
949 Tag = props.tag,
950 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "widths", "tag"]);
951
952 var colClasses = [];
953 widths.forEach(function (colWidth, i) {
954 var columnProp = props[colWidth];
955 delete attributes[colWidth];
956
957 if (!columnProp && columnProp !== '') {
958 return;
959 }
960
961 var isXs = !i;
962
963 if (isObject(columnProp)) {
964 var _classNames;
965
966 var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
967 var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
968 colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames)), cssModule));
969 } else {
970 var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
971
972 colClasses.push(_colClass);
973 }
974 });
975
976 if (!colClasses.length) {
977 colClasses.push('col');
978 }
979
980 var classes = mapToCssModules(classnames(className, colClasses), cssModule);
981 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
982 className: classes
983 }));
984 };
985
986 Col.propTypes = propTypes$3;
987 Col.defaultProps = defaultProps$2;
988
989 var propTypes$4 = {
990 light: propTypes.bool,
991 dark: propTypes.bool,
992 full: propTypes.bool,
993 fixed: propTypes.string,
994 sticky: propTypes.string,
995 color: propTypes.string,
996 role: propTypes.string,
997 tag: tagPropType,
998 className: propTypes.string,
999 cssModule: propTypes.object,
1000 expand: propTypes.oneOfType([propTypes.bool, propTypes.string])
1001 };
1002 var defaultProps$3 = {
1003 tag: 'nav',
1004 expand: false
1005 };
1006
1007 var getExpandClass = function getExpandClass(expand) {
1008 if (expand === false) {
1009 return false;
1010 } else if (expand === true || expand === 'xs') {
1011 return 'navbar-expand';
1012 }
1013
1014 return "navbar-expand-" + expand;
1015 };
1016
1017 var Navbar = function Navbar(props) {
1018 var _classNames;
1019
1020 var expand = props.expand,
1021 className = props.className,
1022 cssModule = props.cssModule,
1023 light = props.light,
1024 dark = props.dark,
1025 fixed = props.fixed,
1026 sticky = props.sticky,
1027 color = props.color,
1028 Tag = props.tag,
1029 attributes = _objectWithoutPropertiesLoose(props, ["expand", "className", "cssModule", "light", "dark", "fixed", "sticky", "color", "tag"]);
1030
1031 var classes = mapToCssModules(classnames(className, 'navbar', getExpandClass(expand), (_classNames = {
1032 'navbar-light': light,
1033 'navbar-dark': dark
1034 }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
1035 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1036 className: classes
1037 }));
1038 };
1039
1040 Navbar.propTypes = propTypes$4;
1041 Navbar.defaultProps = defaultProps$3;
1042
1043 var propTypes$5 = {
1044 tag: tagPropType,
1045 className: propTypes.string,
1046 cssModule: propTypes.object
1047 };
1048 var defaultProps$4 = {
1049 tag: 'a'
1050 };
1051
1052 var NavbarBrand = function NavbarBrand(props) {
1053 var className = props.className,
1054 cssModule = props.cssModule,
1055 Tag = props.tag,
1056 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
1057
1058 var classes = mapToCssModules(classnames(className, 'navbar-brand'), cssModule);
1059 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1060 className: classes
1061 }));
1062 };
1063
1064 NavbarBrand.propTypes = propTypes$5;
1065 NavbarBrand.defaultProps = defaultProps$4;
1066
1067 var propTypes$6 = {
1068 tag: tagPropType,
1069 className: propTypes.string,
1070 cssModule: propTypes.object
1071 };
1072 var defaultProps$5 = {
1073 tag: 'span'
1074 };
1075
1076 var NavbarText = function NavbarText(props) {
1077 var className = props.className,
1078 cssModule = props.cssModule,
1079 active = props.active,
1080 Tag = props.tag,
1081 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
1082
1083 var classes = mapToCssModules(classnames(className, 'navbar-text'), cssModule);
1084 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1085 className: classes
1086 }));
1087 };
1088
1089 NavbarText.propTypes = propTypes$6;
1090 NavbarText.defaultProps = defaultProps$5;
1091
1092 var propTypes$7 = {
1093 tag: tagPropType,
1094 type: propTypes.string,
1095 className: propTypes.string,
1096 cssModule: propTypes.object,
1097 children: propTypes.node
1098 };
1099 var defaultProps$6 = {
1100 tag: 'button',
1101 type: 'button'
1102 };
1103
1104 var NavbarToggler = function NavbarToggler(props) {
1105 var className = props.className,
1106 cssModule = props.cssModule,
1107 children = props.children,
1108 Tag = props.tag,
1109 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "tag"]);
1110
1111 var classes = mapToCssModules(classnames(className, 'navbar-toggler'), cssModule);
1112 return /*#__PURE__*/React__default.createElement(Tag, _extends({
1113 "aria-label": "Toggle navigation"
1114 }, attributes, {
1115 className: classes
1116 }), children || /*#__PURE__*/React__default.createElement("span", {
1117 className: mapToCssModules('navbar-toggler-icon', cssModule)
1118 }));
1119 };
1120
1121 NavbarToggler.propTypes = propTypes$7;
1122 NavbarToggler.defaultProps = defaultProps$6;
1123
1124 var propTypes$8 = {
1125 tabs: propTypes.bool,
1126 pills: propTypes.bool,
1127 vertical: propTypes.oneOfType([propTypes.bool, propTypes.string]),
1128 horizontal: propTypes.string,
1129 justified: propTypes.bool,
1130 fill: propTypes.bool,
1131 navbar: propTypes.bool,
1132 card: propTypes.bool,
1133 tag: tagPropType,
1134 className: propTypes.string,
1135 cssModule: propTypes.object
1136 };
1137 var defaultProps$7 = {
1138 tag: 'ul',
1139 vertical: false
1140 };
1141
1142 var getVerticalClass = function getVerticalClass(vertical) {
1143 if (vertical === false) {
1144 return false;
1145 } else if (vertical === true || vertical === 'xs') {
1146 return 'flex-column';
1147 }
1148
1149 return "flex-" + vertical + "-column";
1150 };
1151
1152 var Nav = function Nav(props) {
1153 var className = props.className,
1154 cssModule = props.cssModule,
1155 tabs = props.tabs,
1156 pills = props.pills,
1157 vertical = props.vertical,
1158 horizontal = props.horizontal,
1159 justified = props.justified,
1160 fill = props.fill,
1161 navbar = props.navbar,
1162 card = props.card,
1163 Tag = props.tag,
1164 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"]);
1165
1166 var classes = mapToCssModules(classnames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
1167 'nav-tabs': tabs,
1168 'card-header-tabs': card && tabs,
1169 'nav-pills': pills,
1170 'card-header-pills': card && pills,
1171 'nav-justified': justified,
1172 'nav-fill': fill
1173 }), cssModule);
1174 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1175 className: classes
1176 }));
1177 };
1178
1179 Nav.propTypes = propTypes$8;
1180 Nav.defaultProps = defaultProps$7;
1181
1182 var propTypes$9 = {
1183 tag: tagPropType,
1184 active: propTypes.bool,
1185 className: propTypes.string,
1186 cssModule: propTypes.object
1187 };
1188 var defaultProps$8 = {
1189 tag: 'li'
1190 };
1191
1192 var NavItem = function NavItem(props) {
1193 var className = props.className,
1194 cssModule = props.cssModule,
1195 active = props.active,
1196 Tag = props.tag,
1197 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
1198
1199 var classes = mapToCssModules(classnames(className, 'nav-item', active ? 'active' : false), cssModule);
1200 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1201 className: classes
1202 }));
1203 };
1204
1205 NavItem.propTypes = propTypes$9;
1206 NavItem.defaultProps = defaultProps$8;
1207
1208 var propTypes$a = {
1209 tag: tagPropType,
1210 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
1211 disabled: propTypes.bool,
1212 active: propTypes.bool,
1213 className: propTypes.string,
1214 cssModule: propTypes.object,
1215 onClick: propTypes.func,
1216 href: propTypes.any
1217 };
1218 var defaultProps$9 = {
1219 tag: 'a'
1220 };
1221
1222 var NavLink = /*#__PURE__*/function (_React$Component) {
1223 _inheritsLoose(NavLink, _React$Component);
1224
1225 function NavLink(props) {
1226 var _this;
1227
1228 _this = _React$Component.call(this, props) || this;
1229 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
1230 return _this;
1231 }
1232
1233 var _proto = NavLink.prototype;
1234
1235 _proto.onClick = function onClick(e) {
1236 if (this.props.disabled) {
1237 e.preventDefault();
1238 return;
1239 }
1240
1241 if (this.props.href === '#') {
1242 e.preventDefault();
1243 }
1244
1245 if (this.props.onClick) {
1246 this.props.onClick(e);
1247 }
1248 };
1249
1250 _proto.render = function render() {
1251 var _this$props = this.props,
1252 className = _this$props.className,
1253 cssModule = _this$props.cssModule,
1254 active = _this$props.active,
1255 Tag = _this$props.tag,
1256 innerRef = _this$props.innerRef,
1257 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "active", "tag", "innerRef"]);
1258
1259 var classes = mapToCssModules(classnames(className, 'nav-link', {
1260 disabled: attributes.disabled,
1261 active: active
1262 }), cssModule);
1263 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1264 ref: innerRef,
1265 onClick: this.onClick,
1266 className: classes
1267 }));
1268 };
1269
1270 return NavLink;
1271 }(React__default.Component);
1272
1273 NavLink.propTypes = propTypes$a;
1274 NavLink.defaultProps = defaultProps$9;
1275
1276 var propTypes$b = {
1277 tag: tagPropType,
1278 listTag: tagPropType,
1279 className: propTypes.string,
1280 listClassName: propTypes.string,
1281 cssModule: propTypes.object,
1282 children: propTypes.node,
1283 'aria-label': propTypes.string
1284 };
1285 var defaultProps$a = {
1286 tag: 'nav',
1287 listTag: 'ol',
1288 'aria-label': 'breadcrumb'
1289 };
1290
1291 var Breadcrumb = function Breadcrumb(props) {
1292 var className = props.className,
1293 listClassName = props.listClassName,
1294 cssModule = props.cssModule,
1295 children = props.children,
1296 Tag = props.tag,
1297 ListTag = props.listTag,
1298 label = props['aria-label'],
1299 attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
1300
1301 var classes = mapToCssModules(classnames(className), cssModule);
1302 var listClasses = mapToCssModules(classnames('breadcrumb', listClassName), cssModule);
1303 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1304 className: classes,
1305 "aria-label": label
1306 }), /*#__PURE__*/React__default.createElement(ListTag, {
1307 className: listClasses
1308 }, children));
1309 };
1310
1311 Breadcrumb.propTypes = propTypes$b;
1312 Breadcrumb.defaultProps = defaultProps$a;
1313
1314 var propTypes$c = {
1315 tag: tagPropType,
1316 active: propTypes.bool,
1317 className: propTypes.string,
1318 cssModule: propTypes.object
1319 };
1320 var defaultProps$b = {
1321 tag: 'li'
1322 };
1323
1324 var BreadcrumbItem = function BreadcrumbItem(props) {
1325 var className = props.className,
1326 cssModule = props.cssModule,
1327 active = props.active,
1328 Tag = props.tag,
1329 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
1330
1331 var classes = mapToCssModules(classnames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
1332 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
1333 className: classes,
1334 "aria-current": active ? 'page' : undefined
1335 }));
1336 };
1337
1338 BreadcrumbItem.propTypes = propTypes$c;
1339 BreadcrumbItem.defaultProps = defaultProps$b;
1340
1341 var propTypes$d = {
1342 active: propTypes.bool,
1343 'aria-label': propTypes.string,
1344 block: propTypes.bool,
1345 color: propTypes.string,
1346 disabled: propTypes.bool,
1347 outline: propTypes.bool,
1348 tag: tagPropType,
1349 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
1350 onClick: propTypes.func,
1351 size: propTypes.string,
1352 children: propTypes.node,
1353 className: propTypes.string,
1354 cssModule: propTypes.object,
1355 close: propTypes.bool
1356 };
1357 var defaultProps$c = {
1358 color: 'secondary',
1359 tag: 'button'
1360 };
1361
1362 var Button = /*#__PURE__*/function (_React$Component) {
1363 _inheritsLoose(Button, _React$Component);
1364
1365 function Button(props) {
1366 var _this;
1367
1368 _this = _React$Component.call(this, props) || this;
1369 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
1370 return _this;
1371 }
1372
1373 var _proto = Button.prototype;
1374
1375 _proto.onClick = function onClick(e) {
1376 if (this.props.disabled) {
1377 e.preventDefault();
1378 return;
1379 }
1380
1381 if (this.props.onClick) {
1382 return this.props.onClick(e);
1383 }
1384 };
1385
1386 _proto.render = function render() {
1387 var _this$props = this.props,
1388 active = _this$props.active,
1389 ariaLabel = _this$props['aria-label'],
1390 block = _this$props.block,
1391 className = _this$props.className,
1392 close = _this$props.close,
1393 cssModule = _this$props.cssModule,
1394 color = _this$props.color,
1395 outline = _this$props.outline,
1396 size = _this$props.size,
1397 Tag = _this$props.tag,
1398 innerRef = _this$props.innerRef,
1399 attributes = _objectWithoutPropertiesLoose(_this$props, ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"]);
1400
1401 if (close && typeof attributes.children === 'undefined') {
1402 attributes.children = /*#__PURE__*/React__default.createElement("span", {
1403 "aria-hidden": true
1404 }, "\xD7");
1405 }
1406
1407 var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
1408 var classes = mapToCssModules(classnames(className, {
1409 close: close
1410 }, close || 'btn', close || btnOutlineColor, size ? "btn-" + size : false, block ? 'btn-block' : false, {
1411 active: active,
1412 disabled: this.props.disabled
1413 }), cssModule);
1414
1415 if (attributes.href && Tag === 'button') {
1416 Tag = 'a';
1417 }
1418
1419 var defaultAriaLabel = close ? 'Close' : null;
1420 return /*#__PURE__*/React__default.createElement(Tag, _extends({
1421 type: Tag === 'button' && attributes.onClick ? 'button' : undefined
1422 }, attributes, {
1423 className: classes,
1424 ref: innerRef,
1425 onClick: this.onClick,
1426 "aria-label": ariaLabel || defaultAriaLabel
1427 }));
1428 };
1429
1430 return Button;
1431 }(React__default.Component);
1432
1433 Button.propTypes = propTypes$d;
1434 Button.defaultProps = defaultProps$c;
1435
1436 var propTypes$e = {
1437 onClick: propTypes.func,
1438 onBlur: propTypes.func,
1439 onFocus: propTypes.func,
1440 defaultValue: propTypes.bool
1441 };
1442 var defaultProps$d = {
1443 defaultValue: false
1444 };
1445
1446 var ButtonToggle = /*#__PURE__*/function (_React$Component) {
1447 _inheritsLoose(ButtonToggle, _React$Component);
1448
1449 function ButtonToggle(props) {
1450 var _this;
1451
1452 _this = _React$Component.call(this, props) || this;
1453 _this.state = {
1454 toggled: props.defaultValue,
1455 focus: false
1456 };
1457 _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));
1458 _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));
1459 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
1460 return _this;
1461 }
1462
1463 var _proto = ButtonToggle.prototype;
1464
1465 _proto.onBlur = function onBlur(e) {
1466 if (this.props.onBlur) {
1467 this.props.onBlur(e);
1468 }
1469
1470 this.setState({
1471 focus: false
1472 });
1473 };
1474
1475 _proto.onFocus = function onFocus(e) {
1476 if (this.props.onFocus) {
1477 this.props.onFocus(e);
1478 }
1479
1480 this.setState({
1481 focus: true
1482 });
1483 };
1484
1485 _proto.onClick = function onClick(e) {
1486 if (this.props.onClick) {
1487 this.props.onClick(e);
1488 }
1489
1490 this.setState(function (_ref) {
1491 var toggled = _ref.toggled;
1492 return {
1493 toggled: !toggled
1494 };
1495 });
1496 };
1497
1498 _proto.render = function render() {
1499 var _this$props = this.props,
1500 className = _this$props.className,
1501 attributes = _objectWithoutPropertiesLoose(_this$props, ["className"]);
1502
1503 var classes = mapToCssModules(classnames(className, {
1504 focus: this.state.focus
1505 }), this.props.cssModule);
1506 return /*#__PURE__*/React__default.createElement(Button, _extends({
1507 active: this.state.toggled,
1508 onBlur: this.onBlur,
1509 onFocus: this.onFocus,
1510 onClick: this.onClick,
1511 className: classes
1512 }, attributes));
1513 };
1514
1515 return ButtonToggle;
1516 }(React__default.Component);
1517
1518 ButtonToggle.propTypes = propTypes$e;
1519 ButtonToggle.defaultProps = defaultProps$d;
1520
1521 function _objectWithoutPropertiesLoose$1(source, excluded) {
1522 if (source == null) return {};
1523 var target = {};
1524 var sourceKeys = Object.keys(source);
1525 var key, i;
1526
1527 for (i = 0; i < sourceKeys.length; i++) {
1528 key = sourceKeys[i];
1529 if (excluded.indexOf(key) >= 0) continue;
1530 target[key] = source[key];
1531 }
1532
1533 return target;
1534 }
1535
1536 var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose$1;
1537
1538 var _extends_1 = createCommonjsModule(function (module) {
1539 function _extends() {
1540 module.exports = _extends = Object.assign || function (target) {
1541 for (var i = 1; i < arguments.length; i++) {
1542 var source = arguments[i];
1543
1544 for (var key in source) {
1545 if (Object.prototype.hasOwnProperty.call(source, key)) {
1546 target[key] = source[key];
1547 }
1548 }
1549 }
1550
1551 return target;
1552 };
1553
1554 return _extends.apply(this, arguments);
1555 }
1556
1557 module.exports = _extends;
1558 });
1559
1560 function _assertThisInitialized$1(self) {
1561 if (self === void 0) {
1562 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1563 }
1564
1565 return self;
1566 }
1567
1568 var assertThisInitialized = _assertThisInitialized$1;
1569
1570 function _inheritsLoose$1(subClass, superClass) {
1571 subClass.prototype = Object.create(superClass.prototype);
1572 subClass.prototype.constructor = subClass;
1573 subClass.__proto__ = superClass;
1574 }
1575
1576 var inheritsLoose = _inheritsLoose$1;
1577
1578 function _defineProperty(obj, key, value) {
1579 if (key in obj) {
1580 Object.defineProperty(obj, key, {
1581 value: value,
1582 enumerable: true,
1583 configurable: true,
1584 writable: true
1585 });
1586 } else {
1587 obj[key] = value;
1588 }
1589
1590 return obj;
1591 }
1592
1593 var defineProperty = _defineProperty;
1594
1595 var toStr = Object.prototype.toString;
1596
1597 var isArguments = function isArguments(value) {
1598 var str = toStr.call(value);
1599 var isArgs = str === '[object Arguments]';
1600
1601 if (!isArgs) {
1602 isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]';
1603 }
1604
1605 return isArgs;
1606 };
1607
1608 var keysShim;
1609
1610 if (!Object.keys) {
1611 // modified from https://github.com/es-shims/es5-shim
1612 var has$1 = Object.prototype.hasOwnProperty;
1613 var toStr$1 = Object.prototype.toString;
1614 var isArgs = isArguments; // eslint-disable-line global-require
1615
1616 var isEnumerable = Object.prototype.propertyIsEnumerable;
1617 var hasDontEnumBug = !isEnumerable.call({
1618 toString: null
1619 }, 'toString');
1620 var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
1621 var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
1622
1623 var equalsConstructorPrototype = function equalsConstructorPrototype(o) {
1624 var ctor = o.constructor;
1625 return ctor && ctor.prototype === o;
1626 };
1627
1628 var excludedKeys = {
1629 $applicationCache: true,
1630 $console: true,
1631 $external: true,
1632 $frame: true,
1633 $frameElement: true,
1634 $frames: true,
1635 $innerHeight: true,
1636 $innerWidth: true,
1637 $onmozfullscreenchange: true,
1638 $onmozfullscreenerror: true,
1639 $outerHeight: true,
1640 $outerWidth: true,
1641 $pageXOffset: true,
1642 $pageYOffset: true,
1643 $parent: true,
1644 $scrollLeft: true,
1645 $scrollTop: true,
1646 $scrollX: true,
1647 $scrollY: true,
1648 $self: true,
1649 $webkitIndexedDB: true,
1650 $webkitStorageInfo: true,
1651 $window: true
1652 };
1653
1654 var hasAutomationEqualityBug = function () {
1655 /* global window */
1656 if (typeof window === 'undefined') {
1657 return false;
1658 }
1659
1660 for (var k in window) {
1661 try {
1662 if (!excludedKeys['$' + k] && has$1.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
1663 try {
1664 equalsConstructorPrototype(window[k]);
1665 } catch (e) {
1666 return true;
1667 }
1668 }
1669 } catch (e) {
1670 return true;
1671 }
1672 }
1673
1674 return false;
1675 }();
1676
1677 var equalsConstructorPrototypeIfNotBuggy = function equalsConstructorPrototypeIfNotBuggy(o) {
1678 /* global window */
1679 if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
1680 return equalsConstructorPrototype(o);
1681 }
1682
1683 try {
1684 return equalsConstructorPrototype(o);
1685 } catch (e) {
1686 return false;
1687 }
1688 };
1689
1690 keysShim = function keys(object) {
1691 var isObject = object !== null && typeof object === 'object';
1692 var isFunction = toStr$1.call(object) === '[object Function]';
1693 var isArguments = isArgs(object);
1694 var isString = isObject && toStr$1.call(object) === '[object String]';
1695 var theKeys = [];
1696
1697 if (!isObject && !isFunction && !isArguments) {
1698 throw new TypeError('Object.keys called on a non-object');
1699 }
1700
1701 var skipProto = hasProtoEnumBug && isFunction;
1702
1703 if (isString && object.length > 0 && !has$1.call(object, 0)) {
1704 for (var i = 0; i < object.length; ++i) {
1705 theKeys.push(String(i));
1706 }
1707 }
1708
1709 if (isArguments && object.length > 0) {
1710 for (var j = 0; j < object.length; ++j) {
1711 theKeys.push(String(j));
1712 }
1713 } else {
1714 for (var name in object) {
1715 if (!(skipProto && name === 'prototype') && has$1.call(object, name)) {
1716 theKeys.push(String(name));
1717 }
1718 }
1719 }
1720
1721 if (hasDontEnumBug) {
1722 var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
1723
1724 for (var k = 0; k < dontEnums.length; ++k) {
1725 if (!(skipConstructor && dontEnums[k] === 'constructor') && has$1.call(object, dontEnums[k])) {
1726 theKeys.push(dontEnums[k]);
1727 }
1728 }
1729 }
1730
1731 return theKeys;
1732 };
1733 }
1734
1735 var implementation = keysShim;
1736
1737 var slice = Array.prototype.slice;
1738 var origKeys = Object.keys;
1739 var keysShim$1 = origKeys ? function keys(o) {
1740 return origKeys(o);
1741 } : implementation;
1742 var originalKeys = Object.keys;
1743
1744 keysShim$1.shim = function shimObjectKeys() {
1745 if (Object.keys) {
1746 var keysWorksWithArguments = function () {
1747 // Safari 5.0 bug
1748 var args = Object.keys(arguments);
1749 return args && args.length === arguments.length;
1750 }(1, 2);
1751
1752 if (!keysWorksWithArguments) {
1753 Object.keys = function keys(object) {
1754 // eslint-disable-line func-name-matching
1755 if (isArguments(object)) {
1756 return originalKeys(slice.call(object));
1757 }
1758
1759 return originalKeys(object);
1760 };
1761 }
1762 } else {
1763 Object.keys = keysShim$1;
1764 }
1765
1766 return Object.keys || keysShim$1;
1767 };
1768
1769 var objectKeys = keysShim$1;
1770
1771 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
1772 var toStr$2 = Object.prototype.toString;
1773
1774 var isStandardArguments = function isArguments(value) {
1775 if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
1776 return false;
1777 }
1778
1779 return toStr$2.call(value) === '[object Arguments]';
1780 };
1781
1782 var isLegacyArguments = function isArguments(value) {
1783 if (isStandardArguments(value)) {
1784 return true;
1785 }
1786
1787 return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr$2.call(value) !== '[object Array]' && toStr$2.call(value.callee) === '[object Function]';
1788 };
1789
1790 var supportsStandardArguments = function () {
1791 return isStandardArguments(arguments);
1792 }();
1793
1794 isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
1795
1796 var isArguments$1 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
1797
1798 var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
1799 var toStr$3 = Object.prototype.toString;
1800 var concat = Array.prototype.concat;
1801 var origDefineProperty = Object.defineProperty;
1802
1803 var isFunction$1 = function isFunction(fn) {
1804 return typeof fn === 'function' && toStr$3.call(fn) === '[object Function]';
1805 };
1806
1807 var arePropertyDescriptorsSupported = function arePropertyDescriptorsSupported() {
1808 var obj = {};
1809
1810 try {
1811 origDefineProperty(obj, 'x', {
1812 enumerable: false,
1813 value: obj
1814 }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax
1815
1816 for (var _ in obj) {
1817 // jscs:ignore disallowUnusedVariables
1818 return false;
1819 }
1820
1821 return obj.x === obj;
1822 } catch (e) {
1823 /* this is IE 8. */
1824 return false;
1825 }
1826 };
1827
1828 var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
1829
1830 var defineProperty$1 = function defineProperty(object, name, value, predicate) {
1831 if (name in object && (!isFunction$1(predicate) || !predicate())) {
1832 return;
1833 }
1834
1835 if (supportsDescriptors) {
1836 origDefineProperty(object, name, {
1837 configurable: true,
1838 enumerable: false,
1839 value: value,
1840 writable: true
1841 });
1842 } else {
1843 object[name] = value;
1844 }
1845 };
1846
1847 var defineProperties = function defineProperties(object, map) {
1848 var predicates = arguments.length > 2 ? arguments[2] : {};
1849 var props = objectKeys(map);
1850
1851 if (hasSymbols) {
1852 props = concat.call(props, Object.getOwnPropertySymbols(map));
1853 }
1854
1855 for (var i = 0; i < props.length; i += 1) {
1856 defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
1857 }
1858 };
1859
1860 defineProperties.supportsDescriptors = !!supportsDescriptors;
1861 var defineProperties_1 = defineProperties;
1862
1863 /* eslint no-invalid-this: 1 */
1864
1865 var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1866 var slice$1 = Array.prototype.slice;
1867 var toStr$4 = Object.prototype.toString;
1868 var funcType = '[object Function]';
1869
1870 var implementation$1 = function bind(that) {
1871 var target = this;
1872
1873 if (typeof target !== 'function' || toStr$4.call(target) !== funcType) {
1874 throw new TypeError(ERROR_MESSAGE + target);
1875 }
1876
1877 var args = slice$1.call(arguments, 1);
1878 var bound;
1879
1880 var binder = function binder() {
1881 if (this instanceof bound) {
1882 var result = target.apply(this, args.concat(slice$1.call(arguments)));
1883
1884 if (Object(result) === result) {
1885 return result;
1886 }
1887
1888 return this;
1889 } else {
1890 return target.apply(that, args.concat(slice$1.call(arguments)));
1891 }
1892 };
1893
1894 var boundLength = Math.max(0, target.length - args.length);
1895 var boundArgs = [];
1896
1897 for (var i = 0; i < boundLength; i++) {
1898 boundArgs.push('$' + i);
1899 }
1900
1901 bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1902
1903 if (target.prototype) {
1904 var Empty = function Empty() {};
1905
1906 Empty.prototype = target.prototype;
1907 bound.prototype = new Empty();
1908 Empty.prototype = null;
1909 }
1910
1911 return bound;
1912 };
1913
1914 var functionBind = Function.prototype.bind || implementation$1;
1915
1916 /* eslint complexity: [2, 18], max-statements: [2, 33] */
1917
1918 var shams = function hasSymbols() {
1919 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
1920 return false;
1921 }
1922
1923 if (typeof Symbol.iterator === 'symbol') {
1924 return true;
1925 }
1926
1927 var obj = {};
1928 var sym = Symbol('test');
1929 var symObj = Object(sym);
1930
1931 if (typeof sym === 'string') {
1932 return false;
1933 }
1934
1935 if (Object.prototype.toString.call(sym) !== '[object Symbol]') {
1936 return false;
1937 }
1938
1939 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') {
1940 return false;
1941 } // temp disabled per https://github.com/ljharb/object.assign/issues/17
1942 // if (sym instanceof Symbol) { return false; }
1943 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
1944 // if (!(symObj instanceof Symbol)) { return false; }
1945 // if (typeof Symbol.prototype.toString !== 'function') { return false; }
1946 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
1947
1948
1949 var symVal = 42;
1950 obj[sym] = symVal;
1951
1952 for (sym in obj) {
1953 return false;
1954 } // eslint-disable-line no-restricted-syntax
1955
1956
1957 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {
1958 return false;
1959 }
1960
1961 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) {
1962 return false;
1963 }
1964
1965 var syms = Object.getOwnPropertySymbols(obj);
1966
1967 if (syms.length !== 1 || syms[0] !== sym) {
1968 return false;
1969 }
1970
1971 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
1972 return false;
1973 }
1974
1975 if (typeof Object.getOwnPropertyDescriptor === 'function') {
1976 var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
1977
1978 if (descriptor.value !== symVal || descriptor.enumerable !== true) {
1979 return false;
1980 }
1981 }
1982
1983 return true;
1984 };
1985
1986 var origSymbol = commonjsGlobal.Symbol;
1987
1988 var hasSymbols$1 = function hasNativeSymbols() {
1989 if (typeof origSymbol !== 'function') {
1990 return false;
1991 }
1992
1993 if (typeof Symbol !== 'function') {
1994 return false;
1995 }
1996
1997 if (typeof origSymbol('foo') !== 'symbol') {
1998 return false;
1999 }
2000
2001 if (typeof Symbol('bar') !== 'symbol') {
2002 return false;
2003 }
2004
2005 return shams();
2006 };
2007
2008 /* globals
2009 Atomics,
2010 SharedArrayBuffer,
2011 */
2012
2013
2014 var undefined$1;
2015 var $TypeError = TypeError;
2016 var $gOPD = Object.getOwnPropertyDescriptor;
2017
2018 if ($gOPD) {
2019 try {
2020 $gOPD({}, '');
2021 } catch (e) {
2022 $gOPD = null; // this is IE 8, which has a broken gOPD
2023 }
2024 }
2025
2026 var throwTypeError = function throwTypeError() {
2027 throw new $TypeError();
2028 };
2029
2030 var ThrowTypeError = $gOPD ? function () {
2031 try {
2032 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
2033 arguments.callee; // IE 8 does not throw here
2034
2035 return throwTypeError;
2036 } catch (calleeThrows) {
2037 try {
2038 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
2039 return $gOPD(arguments, 'callee').get;
2040 } catch (gOPDthrows) {
2041 return throwTypeError;
2042 }
2043 }
2044 }() : throwTypeError;
2045 var hasSymbols$2 = hasSymbols$1();
2046
2047 var getProto = Object.getPrototypeOf || function (x) {
2048 return x.__proto__;
2049 }; // eslint-disable-line no-proto
2050
2051 var generatorFunction = undefined$1;
2052
2053 var asyncFunction = undefined$1;
2054
2055 var asyncGenFunction = undefined$1;
2056 var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
2057 var INTRINSICS = {
2058 '%Array%': Array,
2059 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
2060 '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype,
2061 '%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1,
2062 '%ArrayPrototype%': Array.prototype,
2063 '%ArrayProto_entries%': Array.prototype.entries,
2064 '%ArrayProto_forEach%': Array.prototype.forEach,
2065 '%ArrayProto_keys%': Array.prototype.keys,
2066 '%ArrayProto_values%': Array.prototype.values,
2067 '%AsyncFromSyncIteratorPrototype%': undefined$1,
2068 '%AsyncFunction%': asyncFunction,
2069 '%AsyncFunctionPrototype%': undefined$1,
2070 '%AsyncGenerator%': undefined$1,
2071 '%AsyncGeneratorFunction%': asyncGenFunction,
2072 '%AsyncGeneratorPrototype%': undefined$1,
2073 '%AsyncIteratorPrototype%': undefined$1,
2074 '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
2075 '%Boolean%': Boolean,
2076 '%BooleanPrototype%': Boolean.prototype,
2077 '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
2078 '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype,
2079 '%Date%': Date,
2080 '%DatePrototype%': Date.prototype,
2081 '%decodeURI%': decodeURI,
2082 '%decodeURIComponent%': decodeURIComponent,
2083 '%encodeURI%': encodeURI,
2084 '%encodeURIComponent%': encodeURIComponent,
2085 '%Error%': Error,
2086 '%ErrorPrototype%': Error.prototype,
2087 '%eval%': eval,
2088 // eslint-disable-line no-eval
2089 '%EvalError%': EvalError,
2090 '%EvalErrorPrototype%': EvalError.prototype,
2091 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
2092 '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype,
2093 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
2094 '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype,
2095 '%Function%': Function,
2096 '%FunctionPrototype%': Function.prototype,
2097 '%Generator%': undefined$1,
2098 '%GeneratorFunction%': generatorFunction,
2099 '%GeneratorPrototype%': undefined$1,
2100 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
2101 '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype,
2102 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
2103 '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype,
2104 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
2105 '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype,
2106 '%isFinite%': isFinite,
2107 '%isNaN%': isNaN,
2108 '%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
2109 '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
2110 '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1,
2111 '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
2112 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
2113 '%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype,
2114 '%Math%': Math,
2115 '%Number%': Number,
2116 '%NumberPrototype%': Number.prototype,
2117 '%Object%': Object,
2118 '%ObjectPrototype%': Object.prototype,
2119 '%ObjProto_toString%': Object.prototype.toString,
2120 '%ObjProto_valueOf%': Object.prototype.valueOf,
2121 '%parseFloat%': parseFloat,
2122 '%parseInt%': parseInt,
2123 '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
2124 '%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype,
2125 '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then,
2126 '%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all,
2127 '%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject,
2128 '%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve,
2129 '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
2130 '%RangeError%': RangeError,
2131 '%RangeErrorPrototype%': RangeError.prototype,
2132 '%ReferenceError%': ReferenceError,
2133 '%ReferenceErrorPrototype%': ReferenceError.prototype,
2134 '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
2135 '%RegExp%': RegExp,
2136 '%RegExpPrototype%': RegExp.prototype,
2137 '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
2138 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
2139 '%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype,
2140 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
2141 '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype,
2142 '%String%': String,
2143 '%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1,
2144 '%StringPrototype%': String.prototype,
2145 '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
2146 '%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1,
2147 '%SyntaxError%': SyntaxError,
2148 '%SyntaxErrorPrototype%': SyntaxError.prototype,
2149 '%ThrowTypeError%': ThrowTypeError,
2150 '%TypedArray%': TypedArray,
2151 '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1,
2152 '%TypeError%': $TypeError,
2153 '%TypeErrorPrototype%': $TypeError.prototype,
2154 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
2155 '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype,
2156 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
2157 '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype,
2158 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
2159 '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype,
2160 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
2161 '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype,
2162 '%URIError%': URIError,
2163 '%URIErrorPrototype%': URIError.prototype,
2164 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
2165 '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype,
2166 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
2167 '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype
2168 };
2169 var $replace = functionBind.call(Function.call, String.prototype.replace);
2170 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
2171
2172 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
2173 var reEscapeChar = /\\(\\)?/g;
2174 /** Used to match backslashes in property paths. */
2175
2176 var stringToPath = function stringToPath(string) {
2177 var result = [];
2178 $replace(string, rePropName, function (match, number, quote, subString) {
2179 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
2180 });
2181 return result;
2182 };
2183 /* end adaptation */
2184
2185
2186 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
2187 if (!(name in INTRINSICS)) {
2188 throw new SyntaxError('intrinsic ' + name + ' does not exist!');
2189 } // istanbul ignore if // hopefully this is impossible to test :-)
2190
2191
2192 if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
2193 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
2194 }
2195
2196 return INTRINSICS[name];
2197 };
2198
2199 var GetIntrinsic = function GetIntrinsic(name, allowMissing) {
2200 if (typeof name !== 'string' || name.length === 0) {
2201 throw new TypeError('intrinsic name must be a non-empty string');
2202 }
2203
2204 if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
2205 throw new TypeError('"allowMissing" argument must be a boolean');
2206 }
2207
2208 var parts = stringToPath(name);
2209 var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
2210
2211 for (var i = 1; i < parts.length; i += 1) {
2212 if (value != null) {
2213 if ($gOPD && i + 1 >= parts.length) {
2214 var desc = $gOPD(value, parts[i]);
2215
2216 if (!allowMissing && !(parts[i] in value)) {
2217 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
2218 }
2219
2220 value = desc ? desc.get || desc.value : value[parts[i]];
2221 } else {
2222 value = value[parts[i]];
2223 }
2224 }
2225 }
2226
2227 return value;
2228 };
2229
2230 var $apply = GetIntrinsic('%Function.prototype.apply%');
2231 var $call = GetIntrinsic('%Function.prototype.call%');
2232 var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
2233
2234 var callBind = function callBind() {
2235 return $reflectApply(functionBind, $call, arguments);
2236 };
2237
2238 var apply = function applyBind() {
2239 return $reflectApply(functionBind, $apply, arguments);
2240 };
2241 callBind.apply = apply;
2242
2243 var numberIsNaN = function numberIsNaN(value) {
2244 return value !== value;
2245 };
2246
2247 var implementation$2 = function is(a, b) {
2248 if (a === 0 && b === 0) {
2249 return 1 / a === 1 / b;
2250 }
2251
2252 if (a === b) {
2253 return true;
2254 }
2255
2256 if (numberIsNaN(a) && numberIsNaN(b)) {
2257 return true;
2258 }
2259
2260 return false;
2261 };
2262
2263 var polyfill = function getPolyfill() {
2264 return typeof Object.is === 'function' ? Object.is : implementation$2;
2265 };
2266
2267 var shim = function shimObjectIs() {
2268 var polyfill$1 = polyfill();
2269 defineProperties_1(Object, {
2270 is: polyfill$1
2271 }, {
2272 is: function testObjectIs() {
2273 return Object.is !== polyfill$1;
2274 }
2275 });
2276 return polyfill$1;
2277 };
2278
2279 var polyfill$1 = callBind(polyfill(), Object);
2280 defineProperties_1(polyfill$1, {
2281 getPolyfill: polyfill,
2282 implementation: implementation$2,
2283 shim: shim
2284 });
2285 var objectIs = polyfill$1;
2286
2287 var hasSymbols$3 = hasSymbols$1();
2288 var hasToStringTag$1 = hasSymbols$3 && typeof Symbol.toStringTag === 'symbol';
2289 var regexExec;
2290 var isRegexMarker;
2291 var badStringifier;
2292
2293 if (hasToStringTag$1) {
2294 regexExec = Function.call.bind(RegExp.prototype.exec);
2295 isRegexMarker = {};
2296
2297 var throwRegexMarker = function throwRegexMarker() {
2298 throw isRegexMarker;
2299 };
2300
2301 badStringifier = {
2302 toString: throwRegexMarker,
2303 valueOf: throwRegexMarker
2304 };
2305
2306 if (typeof Symbol.toPrimitive === 'symbol') {
2307 badStringifier[Symbol.toPrimitive] = throwRegexMarker;
2308 }
2309 }
2310
2311 var toStr$5 = Object.prototype.toString;
2312 var regexClass = '[object RegExp]';
2313 var isRegex = hasToStringTag$1 // eslint-disable-next-line consistent-return
2314 ? function isRegex(value) {
2315 if (!value || typeof value !== 'object') {
2316 return false;
2317 }
2318
2319 try {
2320 regexExec(value, badStringifier);
2321 } catch (e) {
2322 return e === isRegexMarker;
2323 }
2324 } : function isRegex(value) {
2325 // In older browsers, typeof regex incorrectly returns 'function'
2326 if (!value || typeof value !== 'object' && typeof value !== 'function') {
2327 return false;
2328 }
2329
2330 return toStr$5.call(value) === regexClass;
2331 };
2332
2333 var $Object = Object;
2334 var $TypeError$1 = TypeError;
2335
2336 var implementation$3 = function flags() {
2337 if (this != null && this !== $Object(this)) {
2338 throw new $TypeError$1('RegExp.prototype.flags getter called on non-object');
2339 }
2340
2341 var result = '';
2342
2343 if (this.global) {
2344 result += 'g';
2345 }
2346
2347 if (this.ignoreCase) {
2348 result += 'i';
2349 }
2350
2351 if (this.multiline) {
2352 result += 'm';
2353 }
2354
2355 if (this.dotAll) {
2356 result += 's';
2357 }
2358
2359 if (this.unicode) {
2360 result += 'u';
2361 }
2362
2363 if (this.sticky) {
2364 result += 'y';
2365 }
2366
2367 return result;
2368 };
2369
2370 var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
2371 var $gOPD$1 = Object.getOwnPropertyDescriptor;
2372 var $TypeError$2 = TypeError;
2373
2374 var polyfill$2 = function getPolyfill() {
2375 if (!supportsDescriptors$1) {
2376 throw new $TypeError$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
2377 }
2378
2379 if (/a/mig.flags === 'gim') {
2380 var descriptor = $gOPD$1(RegExp.prototype, 'flags');
2381
2382 if (descriptor && typeof descriptor.get === 'function' && typeof /a/.dotAll === 'boolean') {
2383 return descriptor.get;
2384 }
2385 }
2386
2387 return implementation$3;
2388 };
2389
2390 var supportsDescriptors$2 = defineProperties_1.supportsDescriptors;
2391 var gOPD = Object.getOwnPropertyDescriptor;
2392 var defineProperty$2 = Object.defineProperty;
2393 var TypeErr = TypeError;
2394 var getProto$1 = Object.getPrototypeOf;
2395 var regex = /a/;
2396
2397 var shim$1 = function shimFlags() {
2398 if (!supportsDescriptors$2 || !getProto$1) {
2399 throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
2400 }
2401
2402 var polyfill = polyfill$2();
2403 var proto = getProto$1(regex);
2404 var descriptor = gOPD(proto, 'flags');
2405
2406 if (!descriptor || descriptor.get !== polyfill) {
2407 defineProperty$2(proto, 'flags', {
2408 configurable: true,
2409 enumerable: false,
2410 get: polyfill
2411 });
2412 }
2413
2414 return polyfill;
2415 };
2416
2417 var flagsBound = callBind(implementation$3);
2418 defineProperties_1(flagsBound, {
2419 getPolyfill: polyfill$2,
2420 implementation: implementation$3,
2421 shim: shim$1
2422 });
2423 var regexp_prototype_flags = flagsBound;
2424
2425 var getDay = Date.prototype.getDay;
2426
2427 var tryDateObject = function tryDateGetDayCall(value) {
2428 try {
2429 getDay.call(value);
2430 return true;
2431 } catch (e) {
2432 return false;
2433 }
2434 };
2435
2436 var toStr$6 = Object.prototype.toString;
2437 var dateClass = '[object Date]';
2438 var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2439
2440 var isDateObject = function isDateObject(value) {
2441 if (typeof value !== 'object' || value === null) {
2442 return false;
2443 }
2444
2445 return hasToStringTag$2 ? tryDateObject(value) : toStr$6.call(value) === dateClass;
2446 };
2447
2448 var getTime = Date.prototype.getTime;
2449
2450 function deepEqual(actual, expected, options) {
2451 var opts = options || {}; // 7.1. All identical values are equivalent, as determined by ===.
2452
2453 if (opts.strict ? objectIs(actual, expected) : actual === expected) {
2454 return true;
2455 } // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
2456
2457
2458 if (!actual || !expected || typeof actual !== 'object' && typeof expected !== 'object') {
2459 return opts.strict ? objectIs(actual, expected) : actual == expected;
2460 }
2461 /*
2462 * 7.4. For all other Object pairs, including Array objects, equivalence is
2463 * determined by having the same number of owned properties (as verified
2464 * with Object.prototype.hasOwnProperty.call), the same set of keys
2465 * (although not necessarily the same order), equivalent values for every
2466 * corresponding key, and an identical 'prototype' property. Note: this
2467 * accounts for both named and indexed properties on Arrays.
2468 */
2469 // eslint-disable-next-line no-use-before-define
2470
2471
2472 return objEquiv(actual, expected, opts);
2473 }
2474
2475 function isUndefinedOrNull(value) {
2476 return value === null || value === undefined;
2477 }
2478
2479 function isBuffer(x) {
2480 if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
2481 return false;
2482 }
2483
2484 if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
2485 return false;
2486 }
2487
2488 if (x.length > 0 && typeof x[0] !== 'number') {
2489 return false;
2490 }
2491
2492 return true;
2493 }
2494
2495 function objEquiv(a, b, opts) {
2496 /* eslint max-statements: [2, 50] */
2497 var i, key;
2498
2499 if (typeof a !== typeof b) {
2500 return false;
2501 }
2502
2503 if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) {
2504 return false;
2505 } // an identical 'prototype' property.
2506
2507
2508 if (a.prototype !== b.prototype) {
2509 return false;
2510 }
2511
2512 if (isArguments$1(a) !== isArguments$1(b)) {
2513 return false;
2514 }
2515
2516 var aIsRegex = isRegex(a);
2517 var bIsRegex = isRegex(b);
2518
2519 if (aIsRegex !== bIsRegex) {
2520 return false;
2521 }
2522
2523 if (aIsRegex || bIsRegex) {
2524 return a.source === b.source && regexp_prototype_flags(a) === regexp_prototype_flags(b);
2525 }
2526
2527 if (isDateObject(a) && isDateObject(b)) {
2528 return getTime.call(a) === getTime.call(b);
2529 }
2530
2531 var aIsBuffer = isBuffer(a);
2532 var bIsBuffer = isBuffer(b);
2533
2534 if (aIsBuffer !== bIsBuffer) {
2535 return false;
2536 }
2537
2538 if (aIsBuffer || bIsBuffer) {
2539 // && would work too, because both are true or both false here
2540 if (a.length !== b.length) {
2541 return false;
2542 }
2543
2544 for (i = 0; i < a.length; i++) {
2545 if (a[i] !== b[i]) {
2546 return false;
2547 }
2548 }
2549
2550 return true;
2551 }
2552
2553 if (typeof a !== typeof b) {
2554 return false;
2555 }
2556
2557 try {
2558 var ka = objectKeys(a);
2559 var kb = objectKeys(b);
2560 } catch (e) {
2561 // happens when one is a string literal and the other isn't
2562 return false;
2563 } // having the same number of owned properties (keys incorporates hasOwnProperty)
2564
2565
2566 if (ka.length !== kb.length) {
2567 return false;
2568 } // the same set of keys (although not necessarily the same order),
2569
2570
2571 ka.sort();
2572 kb.sort(); // ~~~cheap key test
2573
2574 for (i = ka.length - 1; i >= 0; i--) {
2575 if (ka[i] != kb[i]) {
2576 return false;
2577 }
2578 } // equivalent values for every corresponding key, and ~~~possibly expensive deep test
2579
2580
2581 for (i = ka.length - 1; i >= 0; i--) {
2582 key = ka[i];
2583
2584 if (!deepEqual(a[key], b[key], opts)) {
2585 return false;
2586 }
2587 }
2588
2589 return true;
2590 }
2591
2592 var deepEqual_1 = deepEqual;
2593
2594 /**!
2595 * @fileOverview Kickass library to create and place poppers near their reference elements.
2596 * @version 1.16.1
2597 * @license
2598 * Copyright (c) 2016 Federico Zivolo and contributors
2599 *
2600 * Permission is hereby granted, free of charge, to any person obtaining a copy
2601 * of this software and associated documentation files (the "Software"), to deal
2602 * in the Software without restriction, including without limitation the rights
2603 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2604 * copies of the Software, and to permit persons to whom the Software is
2605 * furnished to do so, subject to the following conditions:
2606 *
2607 * The above copyright notice and this permission notice shall be included in all
2608 * copies or substantial portions of the Software.
2609 *
2610 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2611 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2612 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2613 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2614 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2615 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2616 * SOFTWARE.
2617 */
2618 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
2619
2620 var timeoutDuration = function () {
2621 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
2622
2623 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
2624 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
2625 return 1;
2626 }
2627 }
2628
2629 return 0;
2630 }();
2631
2632 function microtaskDebounce(fn) {
2633 var called = false;
2634 return function () {
2635 if (called) {
2636 return;
2637 }
2638
2639 called = true;
2640 window.Promise.resolve().then(function () {
2641 called = false;
2642 fn();
2643 });
2644 };
2645 }
2646
2647 function taskDebounce(fn) {
2648 var scheduled = false;
2649 return function () {
2650 if (!scheduled) {
2651 scheduled = true;
2652 setTimeout(function () {
2653 scheduled = false;
2654 fn();
2655 }, timeoutDuration);
2656 }
2657 };
2658 }
2659
2660 var supportsMicroTasks = isBrowser && window.Promise;
2661 /**
2662 * Create a debounced version of a method, that's asynchronously deferred
2663 * but called in the minimum time possible.
2664 *
2665 * @method
2666 * @memberof Popper.Utils
2667 * @argument {Function} fn
2668 * @returns {Function}
2669 */
2670
2671 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
2672 /**
2673 * Check if the given variable is a function
2674 * @method
2675 * @memberof Popper.Utils
2676 * @argument {Any} functionToCheck - variable to check
2677 * @returns {Boolean} answer to: is a function?
2678 */
2679
2680 function isFunction$2(functionToCheck) {
2681 var getType = {};
2682 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2683 }
2684 /**
2685 * Get CSS computed property of the given element
2686 * @method
2687 * @memberof Popper.Utils
2688 * @argument {Eement} element
2689 * @argument {String} property
2690 */
2691
2692
2693 function getStyleComputedProperty(element, property) {
2694 if (element.nodeType !== 1) {
2695 return [];
2696 } // NOTE: 1 DOM access here
2697
2698
2699 var window = element.ownerDocument.defaultView;
2700 var css = window.getComputedStyle(element, null);
2701 return property ? css[property] : css;
2702 }
2703 /**
2704 * Returns the parentNode or the host of the element
2705 * @method
2706 * @memberof Popper.Utils
2707 * @argument {Element} element
2708 * @returns {Element} parent
2709 */
2710
2711
2712 function getParentNode(element) {
2713 if (element.nodeName === 'HTML') {
2714 return element;
2715 }
2716
2717 return element.parentNode || element.host;
2718 }
2719 /**
2720 * Returns the scrolling parent of the given element
2721 * @method
2722 * @memberof Popper.Utils
2723 * @argument {Element} element
2724 * @returns {Element} scroll parent
2725 */
2726
2727
2728 function getScrollParent(element) {
2729 // Return body, `getScroll` will take care to get the correct `scrollTop` from it
2730 if (!element) {
2731 return document.body;
2732 }
2733
2734 switch (element.nodeName) {
2735 case 'HTML':
2736 case 'BODY':
2737 return element.ownerDocument.body;
2738
2739 case '#document':
2740 return element.body;
2741 } // Firefox want us to check `-x` and `-y` variations as well
2742
2743
2744 var _getStyleComputedProp = getStyleComputedProperty(element),
2745 overflow = _getStyleComputedProp.overflow,
2746 overflowX = _getStyleComputedProp.overflowX,
2747 overflowY = _getStyleComputedProp.overflowY;
2748
2749 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
2750 return element;
2751 }
2752
2753 return getScrollParent(getParentNode(element));
2754 }
2755 /**
2756 * Returns the reference node of the reference object, or the reference object itself.
2757 * @method
2758 * @memberof Popper.Utils
2759 * @param {Element|Object} reference - the reference element (the popper will be relative to this)
2760 * @returns {Element} parent
2761 */
2762
2763
2764 function getReferenceNode(reference) {
2765 return reference && reference.referenceNode ? reference.referenceNode : reference;
2766 }
2767
2768 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
2769 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
2770 /**
2771 * Determines if the browser is Internet Explorer
2772 * @method
2773 * @memberof Popper.Utils
2774 * @param {Number} version to check
2775 * @returns {Boolean} isIE
2776 */
2777
2778 function isIE(version) {
2779 if (version === 11) {
2780 return isIE11;
2781 }
2782
2783 if (version === 10) {
2784 return isIE10;
2785 }
2786
2787 return isIE11 || isIE10;
2788 }
2789 /**
2790 * Returns the offset parent of the given element
2791 * @method
2792 * @memberof Popper.Utils
2793 * @argument {Element} element
2794 * @returns {Element} offset parent
2795 */
2796
2797
2798 function getOffsetParent(element) {
2799 if (!element) {
2800 return document.documentElement;
2801 }
2802
2803 var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here
2804
2805 var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent
2806
2807 while (offsetParent === noOffsetParent && element.nextElementSibling) {
2808 offsetParent = (element = element.nextElementSibling).offsetParent;
2809 }
2810
2811 var nodeName = offsetParent && offsetParent.nodeName;
2812
2813 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
2814 return element ? element.ownerDocument.documentElement : document.documentElement;
2815 } // .offsetParent will return the closest TH, TD or TABLE in case
2816 // no offsetParent is present, I hate this job...
2817
2818
2819 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
2820 return getOffsetParent(offsetParent);
2821 }
2822
2823 return offsetParent;
2824 }
2825
2826 function isOffsetContainer(element) {
2827 var nodeName = element.nodeName;
2828
2829 if (nodeName === 'BODY') {
2830 return false;
2831 }
2832
2833 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
2834 }
2835 /**
2836 * Finds the root node (document, shadowDOM root) of the given element
2837 * @method
2838 * @memberof Popper.Utils
2839 * @argument {Element} node
2840 * @returns {Element} root node
2841 */
2842
2843
2844 function getRoot(node) {
2845 if (node.parentNode !== null) {
2846 return getRoot(node.parentNode);
2847 }
2848
2849 return node;
2850 }
2851 /**
2852 * Finds the offset parent common to the two provided nodes
2853 * @method
2854 * @memberof Popper.Utils
2855 * @argument {Element} element1
2856 * @argument {Element} element2
2857 * @returns {Element} common offset parent
2858 */
2859
2860
2861 function findCommonOffsetParent(element1, element2) {
2862 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
2863 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
2864 return document.documentElement;
2865 } // Here we make sure to give as "start" the element that comes first in the DOM
2866
2867
2868 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
2869 var start = order ? element1 : element2;
2870 var end = order ? element2 : element1; // Get common ancestor container
2871
2872 var range = document.createRange();
2873 range.setStart(start, 0);
2874 range.setEnd(end, 0);
2875 var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document
2876
2877 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
2878 if (isOffsetContainer(commonAncestorContainer)) {
2879 return commonAncestorContainer;
2880 }
2881
2882 return getOffsetParent(commonAncestorContainer);
2883 } // one of the nodes is inside shadowDOM, find which one
2884
2885
2886 var element1root = getRoot(element1);
2887
2888 if (element1root.host) {
2889 return findCommonOffsetParent(element1root.host, element2);
2890 } else {
2891 return findCommonOffsetParent(element1, getRoot(element2).host);
2892 }
2893 }
2894 /**
2895 * Gets the scroll value of the given element in the given side (top and left)
2896 * @method
2897 * @memberof Popper.Utils
2898 * @argument {Element} element
2899 * @argument {String} side `top` or `left`
2900 * @returns {number} amount of scrolled pixels
2901 */
2902
2903
2904 function getScroll(element) {
2905 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
2906 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
2907 var nodeName = element.nodeName;
2908
2909 if (nodeName === 'BODY' || nodeName === 'HTML') {
2910 var html = element.ownerDocument.documentElement;
2911 var scrollingElement = element.ownerDocument.scrollingElement || html;
2912 return scrollingElement[upperSide];
2913 }
2914
2915 return element[upperSide];
2916 }
2917 /*
2918 * Sum or subtract the element scroll values (left and top) from a given rect object
2919 * @method
2920 * @memberof Popper.Utils
2921 * @param {Object} rect - Rect object you want to change
2922 * @param {HTMLElement} element - The element from the function reads the scroll values
2923 * @param {Boolean} subtract - set to true if you want to subtract the scroll values
2924 * @return {Object} rect - The modifier rect object
2925 */
2926
2927
2928 function includeScroll(rect, element) {
2929 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2930 var scrollTop = getScroll(element, 'top');
2931 var scrollLeft = getScroll(element, 'left');
2932 var modifier = subtract ? -1 : 1;
2933 rect.top += scrollTop * modifier;
2934 rect.bottom += scrollTop * modifier;
2935 rect.left += scrollLeft * modifier;
2936 rect.right += scrollLeft * modifier;
2937 return rect;
2938 }
2939 /*
2940 * Helper to detect borders of a given element
2941 * @method
2942 * @memberof Popper.Utils
2943 * @param {CSSStyleDeclaration} styles
2944 * Result of `getStyleComputedProperty` on the given element
2945 * @param {String} axis - `x` or `y`
2946 * @return {number} borders - The borders size of the given axis
2947 */
2948
2949
2950 function getBordersSize(styles, axis) {
2951 var sideA = axis === 'x' ? 'Left' : 'Top';
2952 var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
2953 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
2954 }
2955
2956 function getSize(axis, body, html, computedStyle) {
2957 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
2958 }
2959
2960 function getWindowSizes(document) {
2961 var body = document.body;
2962 var html = document.documentElement;
2963 var computedStyle = isIE(10) && getComputedStyle(html);
2964 return {
2965 height: getSize('Height', body, html, computedStyle),
2966 width: getSize('Width', body, html, computedStyle)
2967 };
2968 }
2969
2970 var classCallCheck = function classCallCheck(instance, Constructor) {
2971 if (!(instance instanceof Constructor)) {
2972 throw new TypeError("Cannot call a class as a function");
2973 }
2974 };
2975
2976 var createClass = function () {
2977 function defineProperties(target, props) {
2978 for (var i = 0; i < props.length; i++) {
2979 var descriptor = props[i];
2980 descriptor.enumerable = descriptor.enumerable || false;
2981 descriptor.configurable = true;
2982 if ("value" in descriptor) descriptor.writable = true;
2983 Object.defineProperty(target, descriptor.key, descriptor);
2984 }
2985 }
2986
2987 return function (Constructor, protoProps, staticProps) {
2988 if (protoProps) defineProperties(Constructor.prototype, protoProps);
2989 if (staticProps) defineProperties(Constructor, staticProps);
2990 return Constructor;
2991 };
2992 }();
2993
2994 var defineProperty$3 = function defineProperty(obj, key, value) {
2995 if (key in obj) {
2996 Object.defineProperty(obj, key, {
2997 value: value,
2998 enumerable: true,
2999 configurable: true,
3000 writable: true
3001 });
3002 } else {
3003 obj[key] = value;
3004 }
3005
3006 return obj;
3007 };
3008
3009 var _extends$1 = Object.assign || function (target) {
3010 for (var i = 1; i < arguments.length; i++) {
3011 var source = arguments[i];
3012
3013 for (var key in source) {
3014 if (Object.prototype.hasOwnProperty.call(source, key)) {
3015 target[key] = source[key];
3016 }
3017 }
3018 }
3019
3020 return target;
3021 };
3022 /**
3023 * Given element offsets, generate an output similar to getBoundingClientRect
3024 * @method
3025 * @memberof Popper.Utils
3026 * @argument {Object} offsets
3027 * @returns {Object} ClientRect like output
3028 */
3029
3030
3031 function getClientRect(offsets) {
3032 return _extends$1({}, offsets, {
3033 right: offsets.left + offsets.width,
3034 bottom: offsets.top + offsets.height
3035 });
3036 }
3037 /**
3038 * Get bounding client rect of given element
3039 * @method
3040 * @memberof Popper.Utils
3041 * @param {HTMLElement} element
3042 * @return {Object} client rect
3043 */
3044
3045
3046 function getBoundingClientRect(element) {
3047 var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't
3048 // considered in DOM in some circumstances...
3049 // This isn't reproducible in IE10 compatibility mode of IE11
3050
3051 try {
3052 if (isIE(10)) {
3053 rect = element.getBoundingClientRect();
3054 var scrollTop = getScroll(element, 'top');
3055 var scrollLeft = getScroll(element, 'left');
3056 rect.top += scrollTop;
3057 rect.left += scrollLeft;
3058 rect.bottom += scrollTop;
3059 rect.right += scrollLeft;
3060 } else {
3061 rect = element.getBoundingClientRect();
3062 }
3063 } catch (e) {}
3064
3065 var result = {
3066 left: rect.left,
3067 top: rect.top,
3068 width: rect.right - rect.left,
3069 height: rect.bottom - rect.top
3070 }; // subtract scrollbar size from sizes
3071
3072 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
3073 var width = sizes.width || element.clientWidth || result.width;
3074 var height = sizes.height || element.clientHeight || result.height;
3075 var horizScrollbar = element.offsetWidth - width;
3076 var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
3077 // we make this check conditional for performance reasons
3078
3079 if (horizScrollbar || vertScrollbar) {
3080 var styles = getStyleComputedProperty(element);
3081 horizScrollbar -= getBordersSize(styles, 'x');
3082 vertScrollbar -= getBordersSize(styles, 'y');
3083 result.width -= horizScrollbar;
3084 result.height -= vertScrollbar;
3085 }
3086
3087 return getClientRect(result);
3088 }
3089
3090 function getOffsetRectRelativeToArbitraryNode(children, parent) {
3091 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3092 var isIE10 = isIE(10);
3093 var isHTML = parent.nodeName === 'HTML';
3094 var childrenRect = getBoundingClientRect(children);
3095 var parentRect = getBoundingClientRect(parent);
3096 var scrollParent = getScrollParent(children);
3097 var styles = getStyleComputedProperty(parent);
3098 var borderTopWidth = parseFloat(styles.borderTopWidth);
3099 var borderLeftWidth = parseFloat(styles.borderLeftWidth); // In cases where the parent is fixed, we must ignore negative scroll in offset calc
3100
3101 if (fixedPosition && isHTML) {
3102 parentRect.top = Math.max(parentRect.top, 0);
3103 parentRect.left = Math.max(parentRect.left, 0);
3104 }
3105
3106 var offsets = getClientRect({
3107 top: childrenRect.top - parentRect.top - borderTopWidth,
3108 left: childrenRect.left - parentRect.left - borderLeftWidth,
3109 width: childrenRect.width,
3110 height: childrenRect.height
3111 });
3112 offsets.marginTop = 0;
3113 offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent
3114 // we do this only on HTML because it's the only element that behaves
3115 // differently when margins are applied to it. The margins are included in
3116 // the box of the documentElement, in the other cases not.
3117
3118 if (!isIE10 && isHTML) {
3119 var marginTop = parseFloat(styles.marginTop);
3120 var marginLeft = parseFloat(styles.marginLeft);
3121 offsets.top -= borderTopWidth - marginTop;
3122 offsets.bottom -= borderTopWidth - marginTop;
3123 offsets.left -= borderLeftWidth - marginLeft;
3124 offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them
3125
3126 offsets.marginTop = marginTop;
3127 offsets.marginLeft = marginLeft;
3128 }
3129
3130 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
3131 offsets = includeScroll(offsets, parent);
3132 }
3133
3134 return offsets;
3135 }
3136
3137 function getViewportOffsetRectRelativeToArtbitraryNode(element) {
3138 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3139 var html = element.ownerDocument.documentElement;
3140 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
3141 var width = Math.max(html.clientWidth, window.innerWidth || 0);
3142 var height = Math.max(html.clientHeight, window.innerHeight || 0);
3143 var scrollTop = !excludeScroll ? getScroll(html) : 0;
3144 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
3145 var offset = {
3146 top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
3147 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
3148 width: width,
3149 height: height
3150 };
3151 return getClientRect(offset);
3152 }
3153 /**
3154 * Check if the given element is fixed or is inside a fixed parent
3155 * @method
3156 * @memberof Popper.Utils
3157 * @argument {Element} element
3158 * @argument {Element} customContainer
3159 * @returns {Boolean} answer to "isFixed?"
3160 */
3161
3162
3163 function isFixed(element) {
3164 var nodeName = element.nodeName;
3165
3166 if (nodeName === 'BODY' || nodeName === 'HTML') {
3167 return false;
3168 }
3169
3170 if (getStyleComputedProperty(element, 'position') === 'fixed') {
3171 return true;
3172 }
3173
3174 var parentNode = getParentNode(element);
3175
3176 if (!parentNode) {
3177 return false;
3178 }
3179
3180 return isFixed(parentNode);
3181 }
3182 /**
3183 * Finds the first parent of an element that has a transformed property defined
3184 * @method
3185 * @memberof Popper.Utils
3186 * @argument {Element} element
3187 * @returns {Element} first transformed parent or documentElement
3188 */
3189
3190
3191 function getFixedPositionOffsetParent(element) {
3192 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
3193 if (!element || !element.parentElement || isIE()) {
3194 return document.documentElement;
3195 }
3196
3197 var el = element.parentElement;
3198
3199 while (el && getStyleComputedProperty(el, 'transform') === 'none') {
3200 el = el.parentElement;
3201 }
3202
3203 return el || document.documentElement;
3204 }
3205 /**
3206 * Computed the boundaries limits and return them
3207 * @method
3208 * @memberof Popper.Utils
3209 * @param {HTMLElement} popper
3210 * @param {HTMLElement} reference
3211 * @param {number} padding
3212 * @param {HTMLElement} boundariesElement - Element used to define the boundaries
3213 * @param {Boolean} fixedPosition - Is in fixed position mode
3214 * @returns {Object} Coordinates of the boundaries
3215 */
3216
3217
3218 function getBoundaries(popper, reference, padding, boundariesElement) {
3219 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here
3220
3221 var boundaries = {
3222 top: 0,
3223 left: 0
3224 };
3225 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); // Handle viewport case
3226
3227 if (boundariesElement === 'viewport') {
3228 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
3229 } else {
3230 // Handle other cases based on DOM element used as boundaries
3231 var boundariesNode = void 0;
3232
3233 if (boundariesElement === 'scrollParent') {
3234 boundariesNode = getScrollParent(getParentNode(reference));
3235
3236 if (boundariesNode.nodeName === 'BODY') {
3237 boundariesNode = popper.ownerDocument.documentElement;
3238 }
3239 } else if (boundariesElement === 'window') {
3240 boundariesNode = popper.ownerDocument.documentElement;
3241 } else {
3242 boundariesNode = boundariesElement;
3243 }
3244
3245 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation
3246
3247 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
3248 var _getWindowSizes = getWindowSizes(popper.ownerDocument),
3249 height = _getWindowSizes.height,
3250 width = _getWindowSizes.width;
3251
3252 boundaries.top += offsets.top - offsets.marginTop;
3253 boundaries.bottom = height + offsets.top;
3254 boundaries.left += offsets.left - offsets.marginLeft;
3255 boundaries.right = width + offsets.left;
3256 } else {
3257 // for all the other DOM elements, this one is good
3258 boundaries = offsets;
3259 }
3260 } // Add paddings
3261
3262
3263 padding = padding || 0;
3264 var isPaddingNumber = typeof padding === 'number';
3265 boundaries.left += isPaddingNumber ? padding : padding.left || 0;
3266 boundaries.top += isPaddingNumber ? padding : padding.top || 0;
3267 boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
3268 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
3269 return boundaries;
3270 }
3271
3272 function getArea(_ref) {
3273 var width = _ref.width,
3274 height = _ref.height;
3275 return width * height;
3276 }
3277 /**
3278 * Utility used to transform the `auto` placement to the placement with more
3279 * available space.
3280 * @method
3281 * @memberof Popper.Utils
3282 * @argument {Object} data - The data object generated by update method
3283 * @argument {Object} options - Modifiers configuration and options
3284 * @returns {Object} The data object, properly modified
3285 */
3286
3287
3288 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
3289 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
3290
3291 if (placement.indexOf('auto') === -1) {
3292 return placement;
3293 }
3294
3295 var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
3296 var rects = {
3297 top: {
3298 width: boundaries.width,
3299 height: refRect.top - boundaries.top
3300 },
3301 right: {
3302 width: boundaries.right - refRect.right,
3303 height: boundaries.height
3304 },
3305 bottom: {
3306 width: boundaries.width,
3307 height: boundaries.bottom - refRect.bottom
3308 },
3309 left: {
3310 width: refRect.left - boundaries.left,
3311 height: boundaries.height
3312 }
3313 };
3314 var sortedAreas = Object.keys(rects).map(function (key) {
3315 return _extends$1({
3316 key: key
3317 }, rects[key], {
3318 area: getArea(rects[key])
3319 });
3320 }).sort(function (a, b) {
3321 return b.area - a.area;
3322 });
3323 var filteredAreas = sortedAreas.filter(function (_ref2) {
3324 var width = _ref2.width,
3325 height = _ref2.height;
3326 return width >= popper.clientWidth && height >= popper.clientHeight;
3327 });
3328 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
3329 var variation = placement.split('-')[1];
3330 return computedPlacement + (variation ? '-' + variation : '');
3331 }
3332 /**
3333 * Get offsets to the reference element
3334 * @method
3335 * @memberof Popper.Utils
3336 * @param {Object} state
3337 * @param {Element} popper - the popper element
3338 * @param {Element} reference - the reference element (the popper will be relative to this)
3339 * @param {Element} fixedPosition - is in fixed position mode
3340 * @returns {Object} An object containing the offsets which will be applied to the popper
3341 */
3342
3343
3344 function getReferenceOffsets(state, popper, reference) {
3345 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
3346 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
3347 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
3348 }
3349 /**
3350 * Get the outer sizes of the given element (offset size + margins)
3351 * @method
3352 * @memberof Popper.Utils
3353 * @argument {Element} element
3354 * @returns {Object} object containing width and height properties
3355 */
3356
3357
3358 function getOuterSizes(element) {
3359 var window = element.ownerDocument.defaultView;
3360 var styles = window.getComputedStyle(element);
3361 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
3362 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
3363 var result = {
3364 width: element.offsetWidth + y,
3365 height: element.offsetHeight + x
3366 };
3367 return result;
3368 }
3369 /**
3370 * Get the opposite placement of the given one
3371 * @method
3372 * @memberof Popper.Utils
3373 * @argument {String} placement
3374 * @returns {String} flipped placement
3375 */
3376
3377
3378 function getOppositePlacement(placement) {
3379 var hash = {
3380 left: 'right',
3381 right: 'left',
3382 bottom: 'top',
3383 top: 'bottom'
3384 };
3385 return placement.replace(/left|right|bottom|top/g, function (matched) {
3386 return hash[matched];
3387 });
3388 }
3389 /**
3390 * Get offsets to the popper
3391 * @method
3392 * @memberof Popper.Utils
3393 * @param {Object} position - CSS position the Popper will get applied
3394 * @param {HTMLElement} popper - the popper element
3395 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
3396 * @param {String} placement - one of the valid placement options
3397 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
3398 */
3399
3400
3401 function getPopperOffsets(popper, referenceOffsets, placement) {
3402 placement = placement.split('-')[0]; // Get popper node sizes
3403
3404 var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object
3405
3406 var popperOffsets = {
3407 width: popperRect.width,
3408 height: popperRect.height
3409 }; // depending by the popper placement we have to compute its offsets slightly differently
3410
3411 var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
3412 var mainSide = isHoriz ? 'top' : 'left';
3413 var secondarySide = isHoriz ? 'left' : 'top';
3414 var measurement = isHoriz ? 'height' : 'width';
3415 var secondaryMeasurement = !isHoriz ? 'height' : 'width';
3416 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
3417
3418 if (placement === secondarySide) {
3419 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
3420 } else {
3421 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
3422 }
3423
3424 return popperOffsets;
3425 }
3426 /**
3427 * Mimics the `find` method of Array
3428 * @method
3429 * @memberof Popper.Utils
3430 * @argument {Array} arr
3431 * @argument prop
3432 * @argument value
3433 * @returns index or -1
3434 */
3435
3436
3437 function find(arr, check) {
3438 // use native find if supported
3439 if (Array.prototype.find) {
3440 return arr.find(check);
3441 } // use `filter` to obtain the same behavior of `find`
3442
3443
3444 return arr.filter(check)[0];
3445 }
3446 /**
3447 * Return the index of the matching object
3448 * @method
3449 * @memberof Popper.Utils
3450 * @argument {Array} arr
3451 * @argument prop
3452 * @argument value
3453 * @returns index or -1
3454 */
3455
3456
3457 function findIndex(arr, prop, value) {
3458 // use native findIndex if supported
3459 if (Array.prototype.findIndex) {
3460 return arr.findIndex(function (cur) {
3461 return cur[prop] === value;
3462 });
3463 } // use `find` + `indexOf` if `findIndex` isn't supported
3464
3465
3466 var match = find(arr, function (obj) {
3467 return obj[prop] === value;
3468 });
3469 return arr.indexOf(match);
3470 }
3471 /**
3472 * Loop trough the list of modifiers and run them in order,
3473 * each of them will then edit the data object.
3474 * @method
3475 * @memberof Popper.Utils
3476 * @param {dataObject} data
3477 * @param {Array} modifiers
3478 * @param {String} ends - Optional modifier name used as stopper
3479 * @returns {dataObject}
3480 */
3481
3482
3483 function runModifiers(modifiers, data, ends) {
3484 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
3485 modifiersToRun.forEach(function (modifier) {
3486 if (modifier['function']) {
3487 // eslint-disable-line dot-notation
3488 console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
3489 }
3490
3491 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
3492
3493 if (modifier.enabled && isFunction$2(fn)) {
3494 // Add properties to offsets to make them a complete clientRect object
3495 // we do this before each modifier to make sure the previous one doesn't
3496 // mess with these values
3497 data.offsets.popper = getClientRect(data.offsets.popper);
3498 data.offsets.reference = getClientRect(data.offsets.reference);
3499 data = fn(data, modifier);
3500 }
3501 });
3502 return data;
3503 }
3504 /**
3505 * Updates the position of the popper, computing the new offsets and applying
3506 * the new style.<br />
3507 * Prefer `scheduleUpdate` over `update` because of performance reasons.
3508 * @method
3509 * @memberof Popper
3510 */
3511
3512
3513 function update() {
3514 // if popper is destroyed, don't perform any further update
3515 if (this.state.isDestroyed) {
3516 return;
3517 }
3518
3519 var data = {
3520 instance: this,
3521 styles: {},
3522 arrowStyles: {},
3523 attributes: {},
3524 flipped: false,
3525 offsets: {}
3526 }; // compute reference element offsets
3527
3528 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object,
3529 // modifiers will be able to edit `placement` if needed
3530 // and refer to originalPlacement to know the original value
3531
3532 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement`
3533
3534 data.originalPlacement = data.placement;
3535 data.positionFixed = this.options.positionFixed; // compute the popper offsets
3536
3537 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
3538 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers
3539
3540 data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback
3541 // the other ones will call `onUpdate` callback
3542
3543 if (!this.state.isCreated) {
3544 this.state.isCreated = true;
3545 this.options.onCreate(data);
3546 } else {
3547 this.options.onUpdate(data);
3548 }
3549 }
3550 /**
3551 * Helper used to know if the given modifier is enabled.
3552 * @method
3553 * @memberof Popper.Utils
3554 * @returns {Boolean}
3555 */
3556
3557
3558 function isModifierEnabled(modifiers, modifierName) {
3559 return modifiers.some(function (_ref) {
3560 var name = _ref.name,
3561 enabled = _ref.enabled;
3562 return enabled && name === modifierName;
3563 });
3564 }
3565 /**
3566 * Get the prefixed supported property name
3567 * @method
3568 * @memberof Popper.Utils
3569 * @argument {String} property (camelCase)
3570 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
3571 */
3572
3573
3574 function getSupportedPropertyName(property) {
3575 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
3576 var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
3577
3578 for (var i = 0; i < prefixes.length; i++) {
3579 var prefix = prefixes[i];
3580 var toCheck = prefix ? '' + prefix + upperProp : property;
3581
3582 if (typeof document.body.style[toCheck] !== 'undefined') {
3583 return toCheck;
3584 }
3585 }
3586
3587 return null;
3588 }
3589 /**
3590 * Destroys the popper.
3591 * @method
3592 * @memberof Popper
3593 */
3594
3595
3596 function destroy() {
3597 this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled
3598
3599 if (isModifierEnabled(this.modifiers, 'applyStyle')) {
3600 this.popper.removeAttribute('x-placement');
3601 this.popper.style.position = '';
3602 this.popper.style.top = '';
3603 this.popper.style.left = '';
3604 this.popper.style.right = '';
3605 this.popper.style.bottom = '';
3606 this.popper.style.willChange = '';
3607 this.popper.style[getSupportedPropertyName('transform')] = '';
3608 }
3609
3610 this.disableEventListeners(); // remove the popper if user explicitly asked for the deletion on destroy
3611 // do not use `remove` because IE11 doesn't support it
3612
3613 if (this.options.removeOnDestroy) {
3614 this.popper.parentNode.removeChild(this.popper);
3615 }
3616
3617 return this;
3618 }
3619 /**
3620 * Get the window associated with the element
3621 * @argument {Element} element
3622 * @returns {Window}
3623 */
3624
3625
3626 function getWindow(element) {
3627 var ownerDocument = element.ownerDocument;
3628 return ownerDocument ? ownerDocument.defaultView : window;
3629 }
3630
3631 function attachToScrollParents(scrollParent, event, callback, scrollParents) {
3632 var isBody = scrollParent.nodeName === 'BODY';
3633 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
3634 target.addEventListener(event, callback, {
3635 passive: true
3636 });
3637
3638 if (!isBody) {
3639 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
3640 }
3641
3642 scrollParents.push(target);
3643 }
3644 /**
3645 * Setup needed event listeners used to update the popper position
3646 * @method
3647 * @memberof Popper.Utils
3648 * @private
3649 */
3650
3651
3652 function setupEventListeners(reference, options, state, updateBound) {
3653 // Resize event listener on window
3654 state.updateBound = updateBound;
3655 getWindow(reference).addEventListener('resize', state.updateBound, {
3656 passive: true
3657 }); // Scroll event listener on scroll parents
3658
3659 var scrollElement = getScrollParent(reference);
3660 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
3661 state.scrollElement = scrollElement;
3662 state.eventsEnabled = true;
3663 return state;
3664 }
3665 /**
3666 * It will add resize/scroll events and start recalculating
3667 * position of the popper element when they are triggered.
3668 * @method
3669 * @memberof Popper
3670 */
3671
3672
3673 function enableEventListeners() {
3674 if (!this.state.eventsEnabled) {
3675 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
3676 }
3677 }
3678 /**
3679 * Remove event listeners used to update the popper position
3680 * @method
3681 * @memberof Popper.Utils
3682 * @private
3683 */
3684
3685
3686 function removeEventListeners(reference, state) {
3687 // Remove resize event listener on window
3688 getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents
3689
3690 state.scrollParents.forEach(function (target) {
3691 target.removeEventListener('scroll', state.updateBound);
3692 }); // Reset state
3693
3694 state.updateBound = null;
3695 state.scrollParents = [];
3696 state.scrollElement = null;
3697 state.eventsEnabled = false;
3698 return state;
3699 }
3700 /**
3701 * It will remove resize/scroll events and won't recalculate popper position
3702 * when they are triggered. It also won't trigger `onUpdate` callback anymore,
3703 * unless you call `update` method manually.
3704 * @method
3705 * @memberof Popper
3706 */
3707
3708
3709 function disableEventListeners() {
3710 if (this.state.eventsEnabled) {
3711 cancelAnimationFrame(this.scheduleUpdate);
3712 this.state = removeEventListeners(this.reference, this.state);
3713 }
3714 }
3715 /**
3716 * Tells if a given input is a number
3717 * @method
3718 * @memberof Popper.Utils
3719 * @param {*} input to check
3720 * @return {Boolean}
3721 */
3722
3723
3724 function isNumeric(n) {
3725 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
3726 }
3727 /**
3728 * Set the style to the given popper
3729 * @method
3730 * @memberof Popper.Utils
3731 * @argument {Element} element - Element to apply the style to
3732 * @argument {Object} styles
3733 * Object with a list of properties and values which will be applied to the element
3734 */
3735
3736
3737 function setStyles(element, styles) {
3738 Object.keys(styles).forEach(function (prop) {
3739 var unit = ''; // add unit if the value is numeric and is one of the following
3740
3741 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
3742 unit = 'px';
3743 }
3744
3745 element.style[prop] = styles[prop] + unit;
3746 });
3747 }
3748 /**
3749 * Set the attributes to the given popper
3750 * @method
3751 * @memberof Popper.Utils
3752 * @argument {Element} element - Element to apply the attributes to
3753 * @argument {Object} styles
3754 * Object with a list of properties and values which will be applied to the element
3755 */
3756
3757
3758 function setAttributes(element, attributes) {
3759 Object.keys(attributes).forEach(function (prop) {
3760 var value = attributes[prop];
3761
3762 if (value !== false) {
3763 element.setAttribute(prop, attributes[prop]);
3764 } else {
3765 element.removeAttribute(prop);
3766 }
3767 });
3768 }
3769 /**
3770 * @function
3771 * @memberof Modifiers
3772 * @argument {Object} data - The data object generated by `update` method
3773 * @argument {Object} data.styles - List of style properties - values to apply to popper element
3774 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
3775 * @argument {Object} options - Modifiers configuration and options
3776 * @returns {Object} The same data object
3777 */
3778
3779
3780 function applyStyle(data) {
3781 // any property present in `data.styles` will be applied to the popper,
3782 // in this way we can make the 3rd party modifiers add custom styles to it
3783 // Be aware, modifiers could override the properties defined in the previous
3784 // lines of this modifier!
3785 setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper,
3786 // they will be set as HTML attributes of the element
3787
3788 setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties
3789
3790 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
3791 setStyles(data.arrowElement, data.arrowStyles);
3792 }
3793
3794 return data;
3795 }
3796 /**
3797 * Set the x-placement attribute before everything else because it could be used
3798 * to add margins to the popper margins needs to be calculated to get the
3799 * correct popper offsets.
3800 * @method
3801 * @memberof Popper.modifiers
3802 * @param {HTMLElement} reference - The reference element used to position the popper
3803 * @param {HTMLElement} popper - The HTML element used as popper
3804 * @param {Object} options - Popper.js options
3805 */
3806
3807
3808 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
3809 // compute reference element offsets
3810 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object,
3811 // modifiers will be able to edit `placement` if needed
3812 // and refer to originalPlacement to know the original value
3813
3814 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
3815 popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because
3816 // without the position applied we can't guarantee correct computations
3817
3818 setStyles(popper, {
3819 position: options.positionFixed ? 'fixed' : 'absolute'
3820 });
3821 return options;
3822 }
3823 /**
3824 * @function
3825 * @memberof Popper.Utils
3826 * @argument {Object} data - The data object generated by `update` method
3827 * @argument {Boolean} shouldRound - If the offsets should be rounded at all
3828 * @returns {Object} The popper's position offsets rounded
3829 *
3830 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
3831 * good as it can be within reason.
3832 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
3833 *
3834 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
3835 * as well on High DPI screens).
3836 *
3837 * Firefox prefers no rounding for positioning and does not have blurriness on
3838 * high DPI screens.
3839 *
3840 * Only horizontal placement and left/right values need to be considered.
3841 */
3842
3843
3844 function getRoundedOffsets(data, shouldRound) {
3845 var _data$offsets = data.offsets,
3846 popper = _data$offsets.popper,
3847 reference = _data$offsets.reference;
3848 var round = Math.round,
3849 floor = Math.floor;
3850
3851 var noRound = function noRound(v) {
3852 return v;
3853 };
3854
3855 var referenceWidth = round(reference.width);
3856 var popperWidth = round(popper.width);
3857 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
3858 var isVariation = data.placement.indexOf('-') !== -1;
3859 var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
3860 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
3861 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
3862 var verticalToInteger = !shouldRound ? noRound : round;
3863 return {
3864 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
3865 top: verticalToInteger(popper.top),
3866 bottom: verticalToInteger(popper.bottom),
3867 right: horizontalToInteger(popper.right)
3868 };
3869 }
3870
3871 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
3872 /**
3873 * @function
3874 * @memberof Modifiers
3875 * @argument {Object} data - The data object generated by `update` method
3876 * @argument {Object} options - Modifiers configuration and options
3877 * @returns {Object} The data object, properly modified
3878 */
3879
3880 function computeStyle(data, options) {
3881 var x = options.x,
3882 y = options.y;
3883 var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2
3884
3885 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
3886 return modifier.name === 'applyStyle';
3887 }).gpuAcceleration;
3888
3889 if (legacyGpuAccelerationOption !== undefined) {
3890 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
3891 }
3892
3893 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
3894 var offsetParent = getOffsetParent(data.instance.popper);
3895 var offsetParentRect = getBoundingClientRect(offsetParent); // Styles
3896
3897 var styles = {
3898 position: popper.position
3899 };
3900 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
3901 var sideA = x === 'bottom' ? 'top' : 'bottom';
3902 var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported,
3903 // we use `translate3d` to apply the position to the popper we
3904 // automatically use the supported prefixed version if needed
3905
3906 var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?)
3907 // If the content of the popper grows once it's been positioned, it
3908 // may happen that the popper gets misplaced because of the new content
3909 // overflowing its reference element
3910 // To avoid this problem, we provide two options (x and y), which allow
3911 // the consumer to define the offset origin.
3912 // If we position a popper on top of a reference element, we can set
3913 // `x` to `top` to make the popper grow towards its top instead of
3914 // its bottom.
3915
3916 var left = void 0,
3917 top = void 0;
3918
3919 if (sideA === 'bottom') {
3920 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
3921 // and not the bottom of the html element
3922 if (offsetParent.nodeName === 'HTML') {
3923 top = -offsetParent.clientHeight + offsets.bottom;
3924 } else {
3925 top = -offsetParentRect.height + offsets.bottom;
3926 }
3927 } else {
3928 top = offsets.top;
3929 }
3930
3931 if (sideB === 'right') {
3932 if (offsetParent.nodeName === 'HTML') {
3933 left = -offsetParent.clientWidth + offsets.right;
3934 } else {
3935 left = -offsetParentRect.width + offsets.right;
3936 }
3937 } else {
3938 left = offsets.left;
3939 }
3940
3941 if (gpuAcceleration && prefixedProperty) {
3942 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
3943 styles[sideA] = 0;
3944 styles[sideB] = 0;
3945 styles.willChange = 'transform';
3946 } else {
3947 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
3948 var invertTop = sideA === 'bottom' ? -1 : 1;
3949 var invertLeft = sideB === 'right' ? -1 : 1;
3950 styles[sideA] = top * invertTop;
3951 styles[sideB] = left * invertLeft;
3952 styles.willChange = sideA + ', ' + sideB;
3953 } // Attributes
3954
3955
3956 var attributes = {
3957 'x-placement': data.placement
3958 }; // Update `data` attributes, styles and arrowStyles
3959
3960 data.attributes = _extends$1({}, attributes, data.attributes);
3961 data.styles = _extends$1({}, styles, data.styles);
3962 data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
3963 return data;
3964 }
3965 /**
3966 * Helper used to know if the given modifier depends from another one.<br />
3967 * It checks if the needed modifier is listed and enabled.
3968 * @method
3969 * @memberof Popper.Utils
3970 * @param {Array} modifiers - list of modifiers
3971 * @param {String} requestingName - name of requesting modifier
3972 * @param {String} requestedName - name of requested modifier
3973 * @returns {Boolean}
3974 */
3975
3976
3977 function isModifierRequired(modifiers, requestingName, requestedName) {
3978 var requesting = find(modifiers, function (_ref) {
3979 var name = _ref.name;
3980 return name === requestingName;
3981 });
3982 var isRequired = !!requesting && modifiers.some(function (modifier) {
3983 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
3984 });
3985
3986 if (!isRequired) {
3987 var _requesting = '`' + requestingName + '`';
3988
3989 var requested = '`' + requestedName + '`';
3990 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
3991 }
3992
3993 return isRequired;
3994 }
3995 /**
3996 * @function
3997 * @memberof Modifiers
3998 * @argument {Object} data - The data object generated by update method
3999 * @argument {Object} options - Modifiers configuration and options
4000 * @returns {Object} The data object, properly modified
4001 */
4002
4003
4004 function arrow(data, options) {
4005 var _data$offsets$arrow; // arrow depends on keepTogether in order to work
4006
4007
4008 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
4009 return data;
4010 }
4011
4012 var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector
4013
4014 if (typeof arrowElement === 'string') {
4015 arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier
4016
4017 if (!arrowElement) {
4018 return data;
4019 }
4020 } else {
4021 // if the arrowElement isn't a query selector we must check that the
4022 // provided DOM node is child of its popper node
4023 if (!data.instance.popper.contains(arrowElement)) {
4024 console.warn('WARNING: `arrow.element` must be child of its popper element!');
4025 return data;
4026 }
4027 }
4028
4029 var placement = data.placement.split('-')[0];
4030 var _data$offsets = data.offsets,
4031 popper = _data$offsets.popper,
4032 reference = _data$offsets.reference;
4033 var isVertical = ['left', 'right'].indexOf(placement) !== -1;
4034 var len = isVertical ? 'height' : 'width';
4035 var sideCapitalized = isVertical ? 'Top' : 'Left';
4036 var side = sideCapitalized.toLowerCase();
4037 var altSide = isVertical ? 'left' : 'top';
4038 var opSide = isVertical ? 'bottom' : 'right';
4039 var arrowElementSize = getOuterSizes(arrowElement)[len]; //
4040 // extends keepTogether behavior making sure the popper and its
4041 // reference have enough pixels in conjunction
4042 //
4043 // top/left side
4044
4045 if (reference[opSide] - arrowElementSize < popper[side]) {
4046 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
4047 } // bottom/right side
4048
4049
4050 if (reference[side] + arrowElementSize > popper[opSide]) {
4051 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
4052 }
4053
4054 data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper
4055
4056 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets
4057 // take popper margin in account because we don't have this info available
4058
4059 var css = getStyleComputedProperty(data.instance.popper);
4060 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
4061 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
4062 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper
4063
4064 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
4065 data.arrowElement = arrowElement;
4066 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty$3(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty$3(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
4067 return data;
4068 }
4069 /**
4070 * Get the opposite placement variation of the given one
4071 * @method
4072 * @memberof Popper.Utils
4073 * @argument {String} placement variation
4074 * @returns {String} flipped placement variation
4075 */
4076
4077
4078 function getOppositeVariation(variation) {
4079 if (variation === 'end') {
4080 return 'start';
4081 } else if (variation === 'start') {
4082 return 'end';
4083 }
4084
4085 return variation;
4086 }
4087 /**
4088 * List of accepted placements to use as values of the `placement` option.<br />
4089 * Valid placements are:
4090 * - `auto`
4091 * - `top`
4092 * - `right`
4093 * - `bottom`
4094 * - `left`
4095 *
4096 * Each placement can have a variation from this list:
4097 * - `-start`
4098 * - `-end`
4099 *
4100 * Variations are interpreted easily if you think of them as the left to right
4101 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
4102 * is right.<br />
4103 * Vertically (`left` and `right`), `start` is top and `end` is bottom.
4104 *
4105 * Some valid examples are:
4106 * - `top-end` (on top of reference, right aligned)
4107 * - `right-start` (on right of reference, top aligned)
4108 * - `bottom` (on bottom, centered)
4109 * - `auto-end` (on the side with more space available, alignment depends by placement)
4110 *
4111 * @static
4112 * @type {Array}
4113 * @enum {String}
4114 * @readonly
4115 * @method placements
4116 * @memberof Popper
4117 */
4118
4119
4120 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // Get rid of `auto` `auto-start` and `auto-end`
4121
4122 var validPlacements = placements.slice(3);
4123 /**
4124 * Given an initial placement, returns all the subsequent placements
4125 * clockwise (or counter-clockwise).
4126 *
4127 * @method
4128 * @memberof Popper.Utils
4129 * @argument {String} placement - A valid placement (it accepts variations)
4130 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
4131 * @returns {Array} placements including their variations
4132 */
4133
4134 function clockwise(placement) {
4135 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4136 var index = validPlacements.indexOf(placement);
4137 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
4138 return counter ? arr.reverse() : arr;
4139 }
4140
4141 var BEHAVIORS = {
4142 FLIP: 'flip',
4143 CLOCKWISE: 'clockwise',
4144 COUNTERCLOCKWISE: 'counterclockwise'
4145 };
4146 /**
4147 * @function
4148 * @memberof Modifiers
4149 * @argument {Object} data - The data object generated by update method
4150 * @argument {Object} options - Modifiers configuration and options
4151 * @returns {Object} The data object, properly modified
4152 */
4153
4154 function flip(data, options) {
4155 // if `inner` modifier is enabled, we can't use the `flip` modifier
4156 if (isModifierEnabled(data.instance.modifiers, 'inner')) {
4157 return data;
4158 }
4159
4160 if (data.flipped && data.placement === data.originalPlacement) {
4161 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
4162 return data;
4163 }
4164
4165 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
4166 var placement = data.placement.split('-')[0];
4167 var placementOpposite = getOppositePlacement(placement);
4168 var variation = data.placement.split('-')[1] || '';
4169 var flipOrder = [];
4170
4171 switch (options.behavior) {
4172 case BEHAVIORS.FLIP:
4173 flipOrder = [placement, placementOpposite];
4174 break;
4175
4176 case BEHAVIORS.CLOCKWISE:
4177 flipOrder = clockwise(placement);
4178 break;
4179
4180 case BEHAVIORS.COUNTERCLOCKWISE:
4181 flipOrder = clockwise(placement, true);
4182 break;
4183
4184 default:
4185 flipOrder = options.behavior;
4186 }
4187
4188 flipOrder.forEach(function (step, index) {
4189 if (placement !== step || flipOrder.length === index + 1) {
4190 return data;
4191 }
4192
4193 placement = data.placement.split('-')[0];
4194 placementOpposite = getOppositePlacement(placement);
4195 var popperOffsets = data.offsets.popper;
4196 var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here
4197
4198 var floor = Math.floor;
4199 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
4200 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
4201 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
4202 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
4203 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
4204 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required
4205
4206 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; // flips variation if reference element overflows boundaries
4207
4208 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); // flips variation if popper content overflows boundaries
4209
4210 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
4211 var flippedVariation = flippedVariationByRef || flippedVariationByContent;
4212
4213 if (overlapsRef || overflowsBoundaries || flippedVariation) {
4214 // this boolean to detect any flip loop
4215 data.flipped = true;
4216
4217 if (overlapsRef || overflowsBoundaries) {
4218 placement = flipOrder[index + 1];
4219 }
4220
4221 if (flippedVariation) {
4222 variation = getOppositeVariation(variation);
4223 }
4224
4225 data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with
4226 // any additional property we may add in the future
4227
4228 data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
4229 data = runModifiers(data.instance.modifiers, data, 'flip');
4230 }
4231 });
4232 return data;
4233 }
4234 /**
4235 * @function
4236 * @memberof Modifiers
4237 * @argument {Object} data - The data object generated by update method
4238 * @argument {Object} options - Modifiers configuration and options
4239 * @returns {Object} The data object, properly modified
4240 */
4241
4242
4243 function keepTogether(data) {
4244 var _data$offsets = data.offsets,
4245 popper = _data$offsets.popper,
4246 reference = _data$offsets.reference;
4247 var placement = data.placement.split('-')[0];
4248 var floor = Math.floor;
4249 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
4250 var side = isVertical ? 'right' : 'bottom';
4251 var opSide = isVertical ? 'left' : 'top';
4252 var measurement = isVertical ? 'width' : 'height';
4253
4254 if (popper[side] < floor(reference[opSide])) {
4255 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
4256 }
4257
4258 if (popper[opSide] > floor(reference[side])) {
4259 data.offsets.popper[opSide] = floor(reference[side]);
4260 }
4261
4262 return data;
4263 }
4264 /**
4265 * Converts a string containing value + unit into a px value number
4266 * @function
4267 * @memberof {modifiers~offset}
4268 * @private
4269 * @argument {String} str - Value + unit string
4270 * @argument {String} measurement - `height` or `width`
4271 * @argument {Object} popperOffsets
4272 * @argument {Object} referenceOffsets
4273 * @returns {Number|String}
4274 * Value in pixels, or original string if no values were extracted
4275 */
4276
4277
4278 function toValue(str, measurement, popperOffsets, referenceOffsets) {
4279 // separate value from unit
4280 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
4281 var value = +split[1];
4282 var unit = split[2]; // If it's not a number it's an operator, I guess
4283
4284 if (!value) {
4285 return str;
4286 }
4287
4288 if (unit.indexOf('%') === 0) {
4289 var element = void 0;
4290
4291 switch (unit) {
4292 case '%p':
4293 element = popperOffsets;
4294 break;
4295
4296 case '%':
4297 case '%r':
4298 default:
4299 element = referenceOffsets;
4300 }
4301
4302 var rect = getClientRect(element);
4303 return rect[measurement] / 100 * value;
4304 } else if (unit === 'vh' || unit === 'vw') {
4305 // if is a vh or vw, we calculate the size based on the viewport
4306 var size = void 0;
4307
4308 if (unit === 'vh') {
4309 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
4310 } else {
4311 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
4312 }
4313
4314 return size / 100 * value;
4315 } else {
4316 // if is an explicit pixel unit, we get rid of the unit and keep the value
4317 // if is an implicit unit, it's px, and we return just the value
4318 return value;
4319 }
4320 }
4321 /**
4322 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
4323 * @function
4324 * @memberof {modifiers~offset}
4325 * @private
4326 * @argument {String} offset
4327 * @argument {Object} popperOffsets
4328 * @argument {Object} referenceOffsets
4329 * @argument {String} basePlacement
4330 * @returns {Array} a two cells array with x and y offsets in numbers
4331 */
4332
4333
4334 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
4335 var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width
4336 // in this way the first offset will use an axis and the second one
4337 // will use the other one
4338
4339 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands
4340 // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
4341
4342 var fragments = offset.split(/(\+|\-)/).map(function (frag) {
4343 return frag.trim();
4344 }); // Detect if the offset string contains a pair of values or a single one
4345 // they could be separated by comma or space
4346
4347 var divider = fragments.indexOf(find(fragments, function (frag) {
4348 return frag.search(/,|\s/) !== -1;
4349 }));
4350
4351 if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
4352 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
4353 } // If divider is found, we divide the list of values and operands to divide
4354 // them by ofset X and Y.
4355
4356
4357 var splitRegex = /\s*,\s*|\s+/;
4358 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // Convert the values with units to absolute pixels to allow our computations
4359
4360 ops = ops.map(function (op, index) {
4361 // Most of the units rely on the orientation of the popper
4362 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
4363 var mergeWithPrevious = false;
4364 return op // This aggregates any `+` or `-` sign that aren't considered operators
4365 // e.g.: 10 + +5 => [10, +, +5]
4366 .reduce(function (a, b) {
4367 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
4368 a[a.length - 1] = b;
4369 mergeWithPrevious = true;
4370 return a;
4371 } else if (mergeWithPrevious) {
4372 a[a.length - 1] += b;
4373 mergeWithPrevious = false;
4374 return a;
4375 } else {
4376 return a.concat(b);
4377 }
4378 }, []) // Here we convert the string values into number values (in px)
4379 .map(function (str) {
4380 return toValue(str, measurement, popperOffsets, referenceOffsets);
4381 });
4382 }); // Loop trough the offsets arrays and execute the operations
4383
4384 ops.forEach(function (op, index) {
4385 op.forEach(function (frag, index2) {
4386 if (isNumeric(frag)) {
4387 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
4388 }
4389 });
4390 });
4391 return offsets;
4392 }
4393 /**
4394 * @function
4395 * @memberof Modifiers
4396 * @argument {Object} data - The data object generated by update method
4397 * @argument {Object} options - Modifiers configuration and options
4398 * @argument {Number|String} options.offset=0
4399 * The offset value as described in the modifier description
4400 * @returns {Object} The data object, properly modified
4401 */
4402
4403
4404 function offset(data, _ref) {
4405 var offset = _ref.offset;
4406 var placement = data.placement,
4407 _data$offsets = data.offsets,
4408 popper = _data$offsets.popper,
4409 reference = _data$offsets.reference;
4410 var basePlacement = placement.split('-')[0];
4411 var offsets = void 0;
4412
4413 if (isNumeric(+offset)) {
4414 offsets = [+offset, 0];
4415 } else {
4416 offsets = parseOffset(offset, popper, reference, basePlacement);
4417 }
4418
4419 if (basePlacement === 'left') {
4420 popper.top += offsets[0];
4421 popper.left -= offsets[1];
4422 } else if (basePlacement === 'right') {
4423 popper.top += offsets[0];
4424 popper.left += offsets[1];
4425 } else if (basePlacement === 'top') {
4426 popper.left += offsets[0];
4427 popper.top -= offsets[1];
4428 } else if (basePlacement === 'bottom') {
4429 popper.left += offsets[0];
4430 popper.top += offsets[1];
4431 }
4432
4433 data.popper = popper;
4434 return data;
4435 }
4436 /**
4437 * @function
4438 * @memberof Modifiers
4439 * @argument {Object} data - The data object generated by `update` method
4440 * @argument {Object} options - Modifiers configuration and options
4441 * @returns {Object} The data object, properly modified
4442 */
4443
4444
4445 function preventOverflow(data, options) {
4446 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to
4447 // go one step up and use the next offsetParent as reference to
4448 // avoid to make this modifier completely useless and look like broken
4449
4450 if (data.instance.reference === boundariesElement) {
4451 boundariesElement = getOffsetParent(boundariesElement);
4452 } // NOTE: DOM access here
4453 // resets the popper's position so that the document size can be calculated excluding
4454 // the size of the popper element itself
4455
4456
4457 var transformProp = getSupportedPropertyName('transform');
4458 var popperStyles = data.instance.popper.style; // assignment to help minification
4459
4460 var top = popperStyles.top,
4461 left = popperStyles.left,
4462 transform = popperStyles[transformProp];
4463 popperStyles.top = '';
4464 popperStyles.left = '';
4465 popperStyles[transformProp] = '';
4466 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here
4467 // restores the original style properties after the offsets have been computed
4468
4469 popperStyles.top = top;
4470 popperStyles.left = left;
4471 popperStyles[transformProp] = transform;
4472 options.boundaries = boundaries;
4473 var order = options.priority;
4474 var popper = data.offsets.popper;
4475 var check = {
4476 primary: function primary(placement) {
4477 var value = popper[placement];
4478
4479 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
4480 value = Math.max(popper[placement], boundaries[placement]);
4481 }
4482
4483 return defineProperty$3({}, placement, value);
4484 },
4485 secondary: function secondary(placement) {
4486 var mainSide = placement === 'right' ? 'left' : 'top';
4487 var value = popper[mainSide];
4488
4489 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
4490 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
4491 }
4492
4493 return defineProperty$3({}, mainSide, value);
4494 }
4495 };
4496 order.forEach(function (placement) {
4497 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
4498 popper = _extends$1({}, popper, check[side](placement));
4499 });
4500 data.offsets.popper = popper;
4501 return data;
4502 }
4503 /**
4504 * @function
4505 * @memberof Modifiers
4506 * @argument {Object} data - The data object generated by `update` method
4507 * @argument {Object} options - Modifiers configuration and options
4508 * @returns {Object} The data object, properly modified
4509 */
4510
4511
4512 function shift(data) {
4513 var placement = data.placement;
4514 var basePlacement = placement.split('-')[0];
4515 var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier
4516
4517 if (shiftvariation) {
4518 var _data$offsets = data.offsets,
4519 reference = _data$offsets.reference,
4520 popper = _data$offsets.popper;
4521 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
4522 var side = isVertical ? 'left' : 'top';
4523 var measurement = isVertical ? 'width' : 'height';
4524 var shiftOffsets = {
4525 start: defineProperty$3({}, side, reference[side]),
4526 end: defineProperty$3({}, side, reference[side] + reference[measurement] - popper[measurement])
4527 };
4528 data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
4529 }
4530
4531 return data;
4532 }
4533 /**
4534 * @function
4535 * @memberof Modifiers
4536 * @argument {Object} data - The data object generated by update method
4537 * @argument {Object} options - Modifiers configuration and options
4538 * @returns {Object} The data object, properly modified
4539 */
4540
4541
4542 function hide(data) {
4543 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
4544 return data;
4545 }
4546
4547 var refRect = data.offsets.reference;
4548 var bound = find(data.instance.modifiers, function (modifier) {
4549 return modifier.name === 'preventOverflow';
4550 }).boundaries;
4551
4552 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
4553 // Avoid unnecessary DOM access if visibility hasn't changed
4554 if (data.hide === true) {
4555 return data;
4556 }
4557
4558 data.hide = true;
4559 data.attributes['x-out-of-boundaries'] = '';
4560 } else {
4561 // Avoid unnecessary DOM access if visibility hasn't changed
4562 if (data.hide === false) {
4563 return data;
4564 }
4565
4566 data.hide = false;
4567 data.attributes['x-out-of-boundaries'] = false;
4568 }
4569
4570 return data;
4571 }
4572 /**
4573 * @function
4574 * @memberof Modifiers
4575 * @argument {Object} data - The data object generated by `update` method
4576 * @argument {Object} options - Modifiers configuration and options
4577 * @returns {Object} The data object, properly modified
4578 */
4579
4580
4581 function inner(data) {
4582 var placement = data.placement;
4583 var basePlacement = placement.split('-')[0];
4584 var _data$offsets = data.offsets,
4585 popper = _data$offsets.popper,
4586 reference = _data$offsets.reference;
4587 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
4588 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
4589 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
4590 data.placement = getOppositePlacement(placement);
4591 data.offsets.popper = getClientRect(popper);
4592 return data;
4593 }
4594 /**
4595 * Modifier function, each modifier can have a function of this type assigned
4596 * to its `fn` property.<br />
4597 * These functions will be called on each update, this means that you must
4598 * make sure they are performant enough to avoid performance bottlenecks.
4599 *
4600 * @function ModifierFn
4601 * @argument {dataObject} data - The data object generated by `update` method
4602 * @argument {Object} options - Modifiers configuration and options
4603 * @returns {dataObject} The data object, properly modified
4604 */
4605
4606 /**
4607 * Modifiers are plugins used to alter the behavior of your poppers.<br />
4608 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
4609 * needed by the library.
4610 *
4611 * Usually you don't want to override the `order`, `fn` and `onLoad` props.
4612 * All the other properties are configurations that could be tweaked.
4613 * @namespace modifiers
4614 */
4615
4616
4617 var modifiers = {
4618 /**
4619 * Modifier used to shift the popper on the start or end of its reference
4620 * element.<br />
4621 * It will read the variation of the `placement` property.<br />
4622 * It can be one either `-end` or `-start`.
4623 * @memberof modifiers
4624 * @inner
4625 */
4626 shift: {
4627 /** @prop {number} order=100 - Index used to define the order of execution */
4628 order: 100,
4629
4630 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4631 enabled: true,
4632
4633 /** @prop {ModifierFn} */
4634 fn: shift
4635 },
4636
4637 /**
4638 * The `offset` modifier can shift your popper on both its axis.
4639 *
4640 * It accepts the following units:
4641 * - `px` or unit-less, interpreted as pixels
4642 * - `%` or `%r`, percentage relative to the length of the reference element
4643 * - `%p`, percentage relative to the length of the popper element
4644 * - `vw`, CSS viewport width unit
4645 * - `vh`, CSS viewport height unit
4646 *
4647 * For length is intended the main axis relative to the placement of the popper.<br />
4648 * This means that if the placement is `top` or `bottom`, the length will be the
4649 * `width`. In case of `left` or `right`, it will be the `height`.
4650 *
4651 * You can provide a single value (as `Number` or `String`), or a pair of values
4652 * as `String` divided by a comma or one (or more) white spaces.<br />
4653 * The latter is a deprecated method because it leads to confusion and will be
4654 * removed in v2.<br />
4655 * Additionally, it accepts additions and subtractions between different units.
4656 * Note that multiplications and divisions aren't supported.
4657 *
4658 * Valid examples are:
4659 * ```
4660 * 10
4661 * '10%'
4662 * '10, 10'
4663 * '10%, 10'
4664 * '10 + 10%'
4665 * '10 - 5vh + 3%'
4666 * '-10px + 5vh, 5px - 6%'
4667 * ```
4668 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
4669 * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
4670 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
4671 *
4672 * @memberof modifiers
4673 * @inner
4674 */
4675 offset: {
4676 /** @prop {number} order=200 - Index used to define the order of execution */
4677 order: 200,
4678
4679 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4680 enabled: true,
4681
4682 /** @prop {ModifierFn} */
4683 fn: offset,
4684
4685 /** @prop {Number|String} offset=0
4686 * The offset value as described in the modifier description
4687 */
4688 offset: 0
4689 },
4690
4691 /**
4692 * Modifier used to prevent the popper from being positioned outside the boundary.
4693 *
4694 * A scenario exists where the reference itself is not within the boundaries.<br />
4695 * We can say it has "escaped the boundaries" — or just "escaped".<br />
4696 * In this case we need to decide whether the popper should either:
4697 *
4698 * - detach from the reference and remain "trapped" in the boundaries, or
4699 * - if it should ignore the boundary and "escape with its reference"
4700 *
4701 * When `escapeWithReference` is set to`true` and reference is completely
4702 * outside its boundaries, the popper will overflow (or completely leave)
4703 * the boundaries in order to remain attached to the edge of the reference.
4704 *
4705 * @memberof modifiers
4706 * @inner
4707 */
4708 preventOverflow: {
4709 /** @prop {number} order=300 - Index used to define the order of execution */
4710 order: 300,
4711
4712 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4713 enabled: true,
4714
4715 /** @prop {ModifierFn} */
4716 fn: preventOverflow,
4717
4718 /**
4719 * @prop {Array} [priority=['left','right','top','bottom']]
4720 * Popper will try to prevent overflow following these priorities by default,
4721 * then, it could overflow on the left and on top of the `boundariesElement`
4722 */
4723 priority: ['left', 'right', 'top', 'bottom'],
4724
4725 /**
4726 * @prop {number} padding=5
4727 * Amount of pixel used to define a minimum distance between the boundaries
4728 * and the popper. This makes sure the popper always has a little padding
4729 * between the edges of its container
4730 */
4731 padding: 5,
4732
4733 /**
4734 * @prop {String|HTMLElement} boundariesElement='scrollParent'
4735 * Boundaries used by the modifier. Can be `scrollParent`, `window`,
4736 * `viewport` or any DOM element.
4737 */
4738 boundariesElement: 'scrollParent'
4739 },
4740
4741 /**
4742 * Modifier used to make sure the reference and its popper stay near each other
4743 * without leaving any gap between the two. Especially useful when the arrow is
4744 * enabled and you want to ensure that it points to its reference element.
4745 * It cares only about the first axis. You can still have poppers with margin
4746 * between the popper and its reference element.
4747 * @memberof modifiers
4748 * @inner
4749 */
4750 keepTogether: {
4751 /** @prop {number} order=400 - Index used to define the order of execution */
4752 order: 400,
4753
4754 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4755 enabled: true,
4756
4757 /** @prop {ModifierFn} */
4758 fn: keepTogether
4759 },
4760
4761 /**
4762 * This modifier is used to move the `arrowElement` of the popper to make
4763 * sure it is positioned between the reference element and its popper element.
4764 * It will read the outer size of the `arrowElement` node to detect how many
4765 * pixels of conjunction are needed.
4766 *
4767 * It has no effect if no `arrowElement` is provided.
4768 * @memberof modifiers
4769 * @inner
4770 */
4771 arrow: {
4772 /** @prop {number} order=500 - Index used to define the order of execution */
4773 order: 500,
4774
4775 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4776 enabled: true,
4777
4778 /** @prop {ModifierFn} */
4779 fn: arrow,
4780
4781 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
4782 element: '[x-arrow]'
4783 },
4784
4785 /**
4786 * Modifier used to flip the popper's placement when it starts to overlap its
4787 * reference element.
4788 *
4789 * Requires the `preventOverflow` modifier before it in order to work.
4790 *
4791 * **NOTE:** this modifier will interrupt the current update cycle and will
4792 * restart it if it detects the need to flip the placement.
4793 * @memberof modifiers
4794 * @inner
4795 */
4796 flip: {
4797 /** @prop {number} order=600 - Index used to define the order of execution */
4798 order: 600,
4799
4800 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4801 enabled: true,
4802
4803 /** @prop {ModifierFn} */
4804 fn: flip,
4805
4806 /**
4807 * @prop {String|Array} behavior='flip'
4808 * The behavior used to change the popper's placement. It can be one of
4809 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
4810 * placements (with optional variations)
4811 */
4812 behavior: 'flip',
4813
4814 /**
4815 * @prop {number} padding=5
4816 * The popper will flip if it hits the edges of the `boundariesElement`
4817 */
4818 padding: 5,
4819
4820 /**
4821 * @prop {String|HTMLElement} boundariesElement='viewport'
4822 * The element which will define the boundaries of the popper position.
4823 * The popper will never be placed outside of the defined boundaries
4824 * (except if `keepTogether` is enabled)
4825 */
4826 boundariesElement: 'viewport',
4827
4828 /**
4829 * @prop {Boolean} flipVariations=false
4830 * The popper will switch placement variation between `-start` and `-end` when
4831 * the reference element overlaps its boundaries.
4832 *
4833 * The original placement should have a set variation.
4834 */
4835 flipVariations: false,
4836
4837 /**
4838 * @prop {Boolean} flipVariationsByContent=false
4839 * The popper will switch placement variation between `-start` and `-end` when
4840 * the popper element overlaps its reference boundaries.
4841 *
4842 * The original placement should have a set variation.
4843 */
4844 flipVariationsByContent: false
4845 },
4846
4847 /**
4848 * Modifier used to make the popper flow toward the inner of the reference element.
4849 * By default, when this modifier is disabled, the popper will be placed outside
4850 * the reference element.
4851 * @memberof modifiers
4852 * @inner
4853 */
4854 inner: {
4855 /** @prop {number} order=700 - Index used to define the order of execution */
4856 order: 700,
4857
4858 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
4859 enabled: false,
4860
4861 /** @prop {ModifierFn} */
4862 fn: inner
4863 },
4864
4865 /**
4866 * Modifier used to hide the popper when its reference element is outside of the
4867 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
4868 * be used to hide with a CSS selector the popper when its reference is
4869 * out of boundaries.
4870 *
4871 * Requires the `preventOverflow` modifier before it in order to work.
4872 * @memberof modifiers
4873 * @inner
4874 */
4875 hide: {
4876 /** @prop {number} order=800 - Index used to define the order of execution */
4877 order: 800,
4878
4879 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4880 enabled: true,
4881
4882 /** @prop {ModifierFn} */
4883 fn: hide
4884 },
4885
4886 /**
4887 * Computes the style that will be applied to the popper element to gets
4888 * properly positioned.
4889 *
4890 * Note that this modifier will not touch the DOM, it just prepares the styles
4891 * so that `applyStyle` modifier can apply it. This separation is useful
4892 * in case you need to replace `applyStyle` with a custom implementation.
4893 *
4894 * This modifier has `850` as `order` value to maintain backward compatibility
4895 * with previous versions of Popper.js. Expect the modifiers ordering method
4896 * to change in future major versions of the library.
4897 *
4898 * @memberof modifiers
4899 * @inner
4900 */
4901 computeStyle: {
4902 /** @prop {number} order=850 - Index used to define the order of execution */
4903 order: 850,
4904
4905 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4906 enabled: true,
4907
4908 /** @prop {ModifierFn} */
4909 fn: computeStyle,
4910
4911 /**
4912 * @prop {Boolean} gpuAcceleration=true
4913 * If true, it uses the CSS 3D transformation to position the popper.
4914 * Otherwise, it will use the `top` and `left` properties
4915 */
4916 gpuAcceleration: true,
4917
4918 /**
4919 * @prop {string} [x='bottom']
4920 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
4921 * Change this if your popper should grow in a direction different from `bottom`
4922 */
4923 x: 'bottom',
4924
4925 /**
4926 * @prop {string} [x='left']
4927 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
4928 * Change this if your popper should grow in a direction different from `right`
4929 */
4930 y: 'right'
4931 },
4932
4933 /**
4934 * Applies the computed styles to the popper element.
4935 *
4936 * All the DOM manipulations are limited to this modifier. This is useful in case
4937 * you want to integrate Popper.js inside a framework or view library and you
4938 * want to delegate all the DOM manipulations to it.
4939 *
4940 * Note that if you disable this modifier, you must make sure the popper element
4941 * has its position set to `absolute` before Popper.js can do its work!
4942 *
4943 * Just disable this modifier and define your own to achieve the desired effect.
4944 *
4945 * @memberof modifiers
4946 * @inner
4947 */
4948 applyStyle: {
4949 /** @prop {number} order=900 - Index used to define the order of execution */
4950 order: 900,
4951
4952 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
4953 enabled: true,
4954
4955 /** @prop {ModifierFn} */
4956 fn: applyStyle,
4957
4958 /** @prop {Function} */
4959 onLoad: applyStyleOnLoad,
4960
4961 /**
4962 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
4963 * @prop {Boolean} gpuAcceleration=true
4964 * If true, it uses the CSS 3D transformation to position the popper.
4965 * Otherwise, it will use the `top` and `left` properties
4966 */
4967 gpuAcceleration: undefined
4968 }
4969 };
4970 /**
4971 * The `dataObject` is an object containing all the information used by Popper.js.
4972 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
4973 * @name dataObject
4974 * @property {Object} data.instance The Popper.js instance
4975 * @property {String} data.placement Placement applied to popper
4976 * @property {String} data.originalPlacement Placement originally defined on init
4977 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
4978 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
4979 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
4980 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
4981 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
4982 * @property {Object} data.boundaries Offsets of the popper boundaries
4983 * @property {Object} data.offsets The measurements of popper, reference and arrow elements
4984 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
4985 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
4986 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
4987 */
4988
4989 /**
4990 * Default options provided to Popper.js constructor.<br />
4991 * These can be overridden using the `options` argument of Popper.js.<br />
4992 * To override an option, simply pass an object with the same
4993 * structure of the `options` object, as the 3rd argument. For example:
4994 * ```
4995 * new Popper(ref, pop, {
4996 * modifiers: {
4997 * preventOverflow: { enabled: false }
4998 * }
4999 * })
5000 * ```
5001 * @type {Object}
5002 * @static
5003 * @memberof Popper
5004 */
5005
5006 var Defaults = {
5007 /**
5008 * Popper's placement.
5009 * @prop {Popper.placements} placement='bottom'
5010 */
5011 placement: 'bottom',
5012
5013 /**
5014 * Set this to true if you want popper to position it self in 'fixed' mode
5015 * @prop {Boolean} positionFixed=false
5016 */
5017 positionFixed: false,
5018
5019 /**
5020 * Whether events (resize, scroll) are initially enabled.
5021 * @prop {Boolean} eventsEnabled=true
5022 */
5023 eventsEnabled: true,
5024
5025 /**
5026 * Set to true if you want to automatically remove the popper when
5027 * you call the `destroy` method.
5028 * @prop {Boolean} removeOnDestroy=false
5029 */
5030 removeOnDestroy: false,
5031
5032 /**
5033 * Callback called when the popper is created.<br />
5034 * By default, it is set to no-op.<br />
5035 * Access Popper.js instance with `data.instance`.
5036 * @prop {onCreate}
5037 */
5038 onCreate: function onCreate() {},
5039
5040 /**
5041 * Callback called when the popper is updated. This callback is not called
5042 * on the initialization/creation of the popper, but only on subsequent
5043 * updates.<br />
5044 * By default, it is set to no-op.<br />
5045 * Access Popper.js instance with `data.instance`.
5046 * @prop {onUpdate}
5047 */
5048 onUpdate: function onUpdate() {},
5049
5050 /**
5051 * List of modifiers used to modify the offsets before they are applied to the popper.
5052 * They provide most of the functionalities of Popper.js.
5053 * @prop {modifiers}
5054 */
5055 modifiers: modifiers
5056 };
5057 /**
5058 * @callback onCreate
5059 * @param {dataObject} data
5060 */
5061
5062 /**
5063 * @callback onUpdate
5064 * @param {dataObject} data
5065 */
5066 // Utils
5067 // Methods
5068
5069 var Popper = function () {
5070 /**
5071 * Creates a new Popper.js instance.
5072 * @class Popper
5073 * @param {Element|referenceObject} reference - The reference element used to position the popper
5074 * @param {Element} popper - The HTML / XML element used as the popper
5075 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
5076 * @return {Object} instance - The generated Popper.js instance
5077 */
5078 function Popper(reference, popper) {
5079 var _this = this;
5080
5081 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
5082 classCallCheck(this, Popper);
5083
5084 this.scheduleUpdate = function () {
5085 return requestAnimationFrame(_this.update);
5086 }; // make update() debounced, so that it only runs at most once-per-tick
5087
5088
5089 this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it
5090
5091 this.options = _extends$1({}, Popper.Defaults, options); // init state
5092
5093 this.state = {
5094 isDestroyed: false,
5095 isCreated: false,
5096 scrollParents: []
5097 }; // get reference and popper elements (allow jQuery wrappers)
5098
5099 this.reference = reference && reference.jquery ? reference[0] : reference;
5100 this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options
5101
5102 this.options.modifiers = {};
5103 Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
5104 _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
5105 }); // Refactoring modifiers' list (Object => Array)
5106
5107 this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
5108 return _extends$1({
5109 name: name
5110 }, _this.options.modifiers[name]);
5111 }) // sort the modifiers by order
5112 .sort(function (a, b) {
5113 return a.order - b.order;
5114 }); // modifiers have the ability to execute arbitrary code when Popper.js get inited
5115 // such code is executed in the same order of its modifier
5116 // they could add new properties to their options configuration
5117 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
5118
5119 this.modifiers.forEach(function (modifierOptions) {
5120 if (modifierOptions.enabled && isFunction$2(modifierOptions.onLoad)) {
5121 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
5122 }
5123 }); // fire the first update to position the popper in the right place
5124
5125 this.update();
5126 var eventsEnabled = this.options.eventsEnabled;
5127
5128 if (eventsEnabled) {
5129 // setup event listeners, they will take care of update the position in specific situations
5130 this.enableEventListeners();
5131 }
5132
5133 this.state.eventsEnabled = eventsEnabled;
5134 } // We can't use class properties because they don't get listed in the
5135 // class prototype and break stuff like Sinon stubs
5136
5137
5138 createClass(Popper, [{
5139 key: 'update',
5140 value: function update$$1() {
5141 return update.call(this);
5142 }
5143 }, {
5144 key: 'destroy',
5145 value: function destroy$$1() {
5146 return destroy.call(this);
5147 }
5148 }, {
5149 key: 'enableEventListeners',
5150 value: function enableEventListeners$$1() {
5151 return enableEventListeners.call(this);
5152 }
5153 }, {
5154 key: 'disableEventListeners',
5155 value: function disableEventListeners$$1() {
5156 return disableEventListeners.call(this);
5157 }
5158 /**
5159 * Schedules an update. It will run on the next UI update available.
5160 * @method scheduleUpdate
5161 * @memberof Popper
5162 */
5163
5164 /**
5165 * Collection of utilities useful when writing custom modifiers.
5166 * Starting from version 1.7, this method is available only if you
5167 * include `popper-utils.js` before `popper.js`.
5168 *
5169 * **DEPRECATION**: This way to access PopperUtils is deprecated
5170 * and will be removed in v2! Use the PopperUtils module directly instead.
5171 * Due to the high instability of the methods contained in Utils, we can't
5172 * guarantee them to follow semver. Use them at your own risk!
5173 * @static
5174 * @private
5175 * @type {Object}
5176 * @deprecated since version 1.8
5177 * @member Utils
5178 * @memberof Popper
5179 */
5180
5181 }]);
5182 return Popper;
5183 }();
5184 /**
5185 * The `referenceObject` is an object that provides an interface compatible with Popper.js
5186 * and lets you use it as replacement of a real DOM node.<br />
5187 * You can use this method to position a popper relatively to a set of coordinates
5188 * in case you don't have a DOM node to use as reference.
5189 *
5190 * ```
5191 * new Popper(referenceObject, popperNode);
5192 * ```
5193 *
5194 * NB: This feature isn't supported in Internet Explorer 10.
5195 * @name referenceObject
5196 * @property {Function} data.getBoundingClientRect
5197 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
5198 * @property {number} data.clientWidth
5199 * An ES6 getter that will return the width of the virtual reference element.
5200 * @property {number} data.clientHeight
5201 * An ES6 getter that will return the height of the virtual reference element.
5202 */
5203
5204
5205 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
5206 Popper.placements = placements;
5207 Popper.Defaults = Defaults;
5208
5209 var key = '__global_unique_id__';
5210
5211 var gud = function gud() {
5212 return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
5213 };
5214
5215 /**
5216 * Copyright (c) 2014-present, Facebook, Inc.
5217 *
5218 * This source code is licensed under the MIT license found in the
5219 * LICENSE file in the root directory of this source tree.
5220 */
5221
5222 var warning = function warning() {};
5223
5224 var warning_1 = warning;
5225
5226 var implementation$4 = createCommonjsModule(function (module, exports) {
5227
5228 exports.__esModule = true;
5229
5230 var _react2 = _interopRequireDefault(React__default);
5231
5232 var _propTypes2 = _interopRequireDefault(propTypes);
5233
5234 var _gud2 = _interopRequireDefault(gud);
5235
5236 var _warning2 = _interopRequireDefault(warning_1);
5237
5238 function _interopRequireDefault(obj) {
5239 return obj && obj.__esModule ? obj : {
5240 default: obj
5241 };
5242 }
5243
5244 function _classCallCheck(instance, Constructor) {
5245 if (!(instance instanceof Constructor)) {
5246 throw new TypeError("Cannot call a class as a function");
5247 }
5248 }
5249
5250 function _possibleConstructorReturn(self, call) {
5251 if (!self) {
5252 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5253 }
5254
5255 return call && (typeof call === "object" || typeof call === "function") ? call : self;
5256 }
5257
5258 function _inherits(subClass, superClass) {
5259 if (typeof superClass !== "function" && superClass !== null) {
5260 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
5261 }
5262
5263 subClass.prototype = Object.create(superClass && superClass.prototype, {
5264 constructor: {
5265 value: subClass,
5266 enumerable: false,
5267 writable: true,
5268 configurable: true
5269 }
5270 });
5271 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
5272 }
5273
5274 var MAX_SIGNED_31_BIT_INT = 1073741823; // Inlined Object.is polyfill.
5275 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5276
5277 function objectIs(x, y) {
5278 if (x === y) {
5279 return x !== 0 || 1 / x === 1 / y;
5280 } else {
5281 return x !== x && y !== y;
5282 }
5283 }
5284
5285 function createEventEmitter(value) {
5286 var handlers = [];
5287 return {
5288 on: function on(handler) {
5289 handlers.push(handler);
5290 },
5291 off: function off(handler) {
5292 handlers = handlers.filter(function (h) {
5293 return h !== handler;
5294 });
5295 },
5296 get: function get() {
5297 return value;
5298 },
5299 set: function set(newValue, changedBits) {
5300 value = newValue;
5301 handlers.forEach(function (handler) {
5302 return handler(value, changedBits);
5303 });
5304 }
5305 };
5306 }
5307
5308 function onlyChild(children) {
5309 return Array.isArray(children) ? children[0] : children;
5310 }
5311
5312 function createReactContext(defaultValue, calculateChangedBits) {
5313 var _Provider$childContex, _Consumer$contextType;
5314
5315 var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
5316
5317 var Provider = function (_Component) {
5318 _inherits(Provider, _Component);
5319
5320 function Provider() {
5321 var _temp, _this, _ret;
5322
5323 _classCallCheck(this, Provider);
5324
5325 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
5326 args[_key] = arguments[_key];
5327 }
5328
5329 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
5330 }
5331
5332 Provider.prototype.getChildContext = function getChildContext() {
5333 var _ref;
5334
5335 return _ref = {}, _ref[contextProp] = this.emitter, _ref;
5336 };
5337
5338 Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
5339 if (this.props.value !== nextProps.value) {
5340 var oldValue = this.props.value;
5341 var newValue = nextProps.value;
5342 var changedBits = void 0;
5343
5344 if (objectIs(oldValue, newValue)) {
5345 changedBits = 0; // No change
5346 } else {
5347 changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
5348
5349 changedBits |= 0;
5350
5351 if (changedBits !== 0) {
5352 this.emitter.set(nextProps.value, changedBits);
5353 }
5354 }
5355 }
5356 };
5357
5358 Provider.prototype.render = function render() {
5359 return this.props.children;
5360 };
5361
5362 return Provider;
5363 }(React__default.Component);
5364
5365 Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
5366
5367 var Consumer = function (_Component2) {
5368 _inherits(Consumer, _Component2);
5369
5370 function Consumer() {
5371 var _temp2, _this2, _ret2;
5372
5373 _classCallCheck(this, Consumer);
5374
5375 for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
5376 args[_key2] = arguments[_key2];
5377 }
5378
5379 return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
5380 value: _this2.getValue()
5381 }, _this2.onUpdate = function (newValue, changedBits) {
5382 var observedBits = _this2.observedBits | 0;
5383
5384 if ((observedBits & changedBits) !== 0) {
5385 _this2.setState({
5386 value: _this2.getValue()
5387 });
5388 }
5389 }, _temp2), _possibleConstructorReturn(_this2, _ret2);
5390 }
5391
5392 Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
5393 var observedBits = nextProps.observedBits;
5394 this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
5395 : observedBits;
5396 };
5397
5398 Consumer.prototype.componentDidMount = function componentDidMount() {
5399 if (this.context[contextProp]) {
5400 this.context[contextProp].on(this.onUpdate);
5401 }
5402
5403 var observedBits = this.props.observedBits;
5404 this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
5405 : observedBits;
5406 };
5407
5408 Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
5409 if (this.context[contextProp]) {
5410 this.context[contextProp].off(this.onUpdate);
5411 }
5412 };
5413
5414 Consumer.prototype.getValue = function getValue() {
5415 if (this.context[contextProp]) {
5416 return this.context[contextProp].get();
5417 } else {
5418 return defaultValue;
5419 }
5420 };
5421
5422 Consumer.prototype.render = function render() {
5423 return onlyChild(this.props.children)(this.state.value);
5424 };
5425
5426 return Consumer;
5427 }(React__default.Component);
5428
5429 Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
5430 return {
5431 Provider: Provider,
5432 Consumer: Consumer
5433 };
5434 }
5435
5436 exports.default = createReactContext;
5437 module.exports = exports['default'];
5438 });
5439 unwrapExports(implementation$4);
5440
5441 var lib = createCommonjsModule(function (module, exports) {
5442
5443 exports.__esModule = true;
5444
5445 var _react2 = _interopRequireDefault(React__default);
5446
5447 var _implementation2 = _interopRequireDefault(implementation$4);
5448
5449 function _interopRequireDefault(obj) {
5450 return obj && obj.__esModule ? obj : {
5451 default: obj
5452 };
5453 }
5454
5455 exports.default = _react2.default.createContext || _implementation2.default;
5456 module.exports = exports['default'];
5457 });
5458 var createContext = unwrapExports(lib);
5459
5460 var ManagerReferenceNodeContext = createContext();
5461 var ManagerReferenceNodeSetterContext = createContext();
5462
5463 var Manager = /*#__PURE__*/function (_React$Component) {
5464 inheritsLoose(Manager, _React$Component);
5465
5466 function Manager() {
5467 var _this;
5468
5469 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5470 args[_key] = arguments[_key];
5471 }
5472
5473 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
5474
5475 defineProperty(assertThisInitialized(_this), "referenceNode", void 0);
5476
5477 defineProperty(assertThisInitialized(_this), "setReferenceNode", function (newReferenceNode) {
5478 if (newReferenceNode && _this.referenceNode !== newReferenceNode) {
5479 _this.referenceNode = newReferenceNode;
5480
5481 _this.forceUpdate();
5482 }
5483 });
5484
5485 return _this;
5486 }
5487
5488 var _proto = Manager.prototype;
5489
5490 _proto.componentWillUnmount = function componentWillUnmount() {
5491 this.referenceNode = null;
5492 };
5493
5494 _proto.render = function render() {
5495 return /*#__PURE__*/React.createElement(ManagerReferenceNodeContext.Provider, {
5496 value: this.referenceNode
5497 }, /*#__PURE__*/React.createElement(ManagerReferenceNodeSetterContext.Provider, {
5498 value: this.setReferenceNode
5499 }, this.props.children));
5500 };
5501
5502 return Manager;
5503 }(React.Component);
5504
5505 /**
5506 * Takes an argument and if it's an array, returns the first item in the array,
5507 * otherwise returns the argument. Used for Preact compatibility.
5508 */
5509 var unwrapArray = function unwrapArray(arg) {
5510 return Array.isArray(arg) ? arg[0] : arg;
5511 };
5512 /**
5513 * Takes a maybe-undefined function and arbitrary args and invokes the function
5514 * only if it is defined.
5515 */
5516
5517 var safeInvoke = function safeInvoke(fn) {
5518 if (typeof fn === "function") {
5519 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5520 args[_key - 1] = arguments[_key];
5521 }
5522
5523 return fn.apply(void 0, args);
5524 }
5525 };
5526 /**
5527 * Sets a ref using either a ref callback or a ref object
5528 */
5529
5530 var setRef = function setRef(ref, node) {
5531 // if its a function call it
5532 if (typeof ref === "function") {
5533 return safeInvoke(ref, node);
5534 } // otherwise we should treat it as a ref object
5535 else if (ref != null) {
5536 ref.current = node;
5537 }
5538 };
5539
5540 var initialStyle = {
5541 position: 'absolute',
5542 top: 0,
5543 left: 0,
5544 opacity: 0,
5545 pointerEvents: 'none'
5546 };
5547 var initialArrowStyle = {};
5548 var InnerPopper = /*#__PURE__*/function (_React$Component) {
5549 inheritsLoose(InnerPopper, _React$Component);
5550
5551 function InnerPopper() {
5552 var _this;
5553
5554 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5555 args[_key] = arguments[_key];
5556 }
5557
5558 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
5559
5560 defineProperty(assertThisInitialized(_this), "state", {
5561 data: undefined,
5562 placement: undefined
5563 });
5564
5565 defineProperty(assertThisInitialized(_this), "popperInstance", void 0);
5566
5567 defineProperty(assertThisInitialized(_this), "popperNode", null);
5568
5569 defineProperty(assertThisInitialized(_this), "arrowNode", null);
5570
5571 defineProperty(assertThisInitialized(_this), "setPopperNode", function (popperNode) {
5572 if (!popperNode || _this.popperNode === popperNode) return;
5573 setRef(_this.props.innerRef, popperNode);
5574 _this.popperNode = popperNode;
5575
5576 _this.updatePopperInstance();
5577 });
5578
5579 defineProperty(assertThisInitialized(_this), "setArrowNode", function (arrowNode) {
5580 _this.arrowNode = arrowNode;
5581 });
5582
5583 defineProperty(assertThisInitialized(_this), "updateStateModifier", {
5584 enabled: true,
5585 order: 900,
5586 fn: function fn(data) {
5587 var placement = data.placement;
5588
5589 _this.setState({
5590 data: data,
5591 placement: placement
5592 });
5593
5594 return data;
5595 }
5596 });
5597
5598 defineProperty(assertThisInitialized(_this), "getOptions", function () {
5599 return {
5600 placement: _this.props.placement,
5601 eventsEnabled: _this.props.eventsEnabled,
5602 positionFixed: _this.props.positionFixed,
5603 modifiers: _extends_1({}, _this.props.modifiers, {
5604 arrow: _extends_1({}, _this.props.modifiers && _this.props.modifiers.arrow, {
5605 enabled: !!_this.arrowNode,
5606 element: _this.arrowNode
5607 }),
5608 applyStyle: {
5609 enabled: false
5610 },
5611 updateStateModifier: _this.updateStateModifier
5612 })
5613 };
5614 });
5615
5616 defineProperty(assertThisInitialized(_this), "getPopperStyle", function () {
5617 return !_this.popperNode || !_this.state.data ? initialStyle : _extends_1({
5618 position: _this.state.data.offsets.popper.position
5619 }, _this.state.data.styles);
5620 });
5621
5622 defineProperty(assertThisInitialized(_this), "getPopperPlacement", function () {
5623 return !_this.state.data ? undefined : _this.state.placement;
5624 });
5625
5626 defineProperty(assertThisInitialized(_this), "getArrowStyle", function () {
5627 return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
5628 });
5629
5630 defineProperty(assertThisInitialized(_this), "getOutOfBoundariesState", function () {
5631 return _this.state.data ? _this.state.data.hide : undefined;
5632 });
5633
5634 defineProperty(assertThisInitialized(_this), "destroyPopperInstance", function () {
5635 if (!_this.popperInstance) return;
5636
5637 _this.popperInstance.destroy();
5638
5639 _this.popperInstance = null;
5640 });
5641
5642 defineProperty(assertThisInitialized(_this), "updatePopperInstance", function () {
5643 _this.destroyPopperInstance();
5644
5645 var _assertThisInitialize = assertThisInitialized(_this),
5646 popperNode = _assertThisInitialize.popperNode;
5647
5648 var referenceElement = _this.props.referenceElement;
5649 if (!referenceElement || !popperNode) return;
5650 _this.popperInstance = new Popper(referenceElement, popperNode, _this.getOptions());
5651 });
5652
5653 defineProperty(assertThisInitialized(_this), "scheduleUpdate", function () {
5654 if (_this.popperInstance) {
5655 _this.popperInstance.scheduleUpdate();
5656 }
5657 });
5658
5659 return _this;
5660 }
5661
5662 var _proto = InnerPopper.prototype;
5663
5664 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
5665 // If the Popper.js options have changed, update the instance (destroy + create)
5666 if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || !deepEqual_1(this.props.modifiers, prevProps.modifiers, {
5667 strict: true
5668 })) {
5669
5670 this.updatePopperInstance();
5671 } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
5672 this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
5673 } // A placement difference in state means popper determined a new placement
5674 // apart from the props value. By the time the popper element is rendered with
5675 // the new position Popper has already measured it, if the place change triggers
5676 // a size change it will result in a misaligned popper. So we schedule an update to be sure.
5677
5678
5679 if (prevState.placement !== this.state.placement) {
5680 this.scheduleUpdate();
5681 }
5682 };
5683
5684 _proto.componentWillUnmount = function componentWillUnmount() {
5685 setRef(this.props.innerRef, null);
5686 this.destroyPopperInstance();
5687 };
5688
5689 _proto.render = function render() {
5690 return unwrapArray(this.props.children)({
5691 ref: this.setPopperNode,
5692 style: this.getPopperStyle(),
5693 placement: this.getPopperPlacement(),
5694 outOfBoundaries: this.getOutOfBoundariesState(),
5695 scheduleUpdate: this.scheduleUpdate,
5696 arrowProps: {
5697 ref: this.setArrowNode,
5698 style: this.getArrowStyle()
5699 }
5700 });
5701 };
5702
5703 return InnerPopper;
5704 }(React.Component);
5705
5706 defineProperty(InnerPopper, "defaultProps", {
5707 placement: 'bottom',
5708 eventsEnabled: true,
5709 referenceElement: undefined,
5710 positionFixed: false
5711 });
5712 function Popper$1(_ref) {
5713 var referenceElement = _ref.referenceElement,
5714 props = objectWithoutPropertiesLoose(_ref, ["referenceElement"]);
5715
5716 return /*#__PURE__*/React.createElement(ManagerReferenceNodeContext.Consumer, null, function (referenceNode) {
5717 return /*#__PURE__*/React.createElement(InnerPopper, _extends_1({
5718 referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
5719 }, props));
5720 });
5721 }
5722
5723 /**
5724 * Copyright (c) 2014-present, Facebook, Inc.
5725 *
5726 * This source code is licensed under the MIT license found in the
5727 * LICENSE file in the root directory of this source tree.
5728 */
5729
5730 var warning$1 = function warning() {};
5731
5732 var warning_1$1 = warning$1;
5733
5734 var InnerReference = /*#__PURE__*/function (_React$Component) {
5735 inheritsLoose(InnerReference, _React$Component);
5736
5737 function InnerReference() {
5738 var _this;
5739
5740 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5741 args[_key] = arguments[_key];
5742 }
5743
5744 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
5745
5746 defineProperty(assertThisInitialized(_this), "refHandler", function (node) {
5747 setRef(_this.props.innerRef, node);
5748 safeInvoke(_this.props.setReferenceNode, node);
5749 });
5750
5751 return _this;
5752 }
5753
5754 var _proto = InnerReference.prototype;
5755
5756 _proto.componentWillUnmount = function componentWillUnmount() {
5757 setRef(this.props.innerRef, null);
5758 };
5759
5760 _proto.render = function render() {
5761 warning_1$1(Boolean(this.props.setReferenceNode));
5762 return unwrapArray(this.props.children)({
5763 ref: this.refHandler
5764 });
5765 };
5766
5767 return InnerReference;
5768 }(React.Component);
5769
5770 function Reference(props) {
5771 return /*#__PURE__*/React.createElement(ManagerReferenceNodeSetterContext.Consumer, null, function (setReferenceNode) {
5772 return /*#__PURE__*/React.createElement(InnerReference, _extends_1({
5773 setReferenceNode: setReferenceNode
5774 }, props));
5775 });
5776 }
5777
5778 /**
5779 * DropdownContext
5780 * {
5781 * toggle: PropTypes.func.isRequired,
5782 * isOpen: PropTypes.bool.isRequired,
5783 * direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
5784 * inNavbar: PropTypes.bool.isRequired,
5785 * disabled: PropTypes.bool
5786 * }
5787 */
5788
5789 var DropdownContext = /*#__PURE__*/React__default.createContext({});
5790
5791 var propTypes$f = {
5792 a11y: propTypes.bool,
5793 disabled: propTypes.bool,
5794 direction: propTypes.oneOf(['up', 'down', 'left', 'right']),
5795 group: propTypes.bool,
5796 isOpen: propTypes.bool,
5797 nav: propTypes.bool,
5798 active: propTypes.bool,
5799 addonType: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['prepend', 'append'])]),
5800 size: propTypes.string,
5801 tag: tagPropType,
5802 toggle: propTypes.func,
5803 children: propTypes.node,
5804 className: propTypes.string,
5805 cssModule: propTypes.object,
5806 inNavbar: propTypes.bool,
5807 setActiveFromChild: propTypes.bool
5808 };
5809 var defaultProps$e = {
5810 a11y: true,
5811 isOpen: false,
5812 direction: 'down',
5813 nav: false,
5814 active: false,
5815 addonType: false,
5816 inNavbar: false,
5817 setActiveFromChild: false
5818 };
5819 var preventDefaultKeys = [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down, keyCodes.end, keyCodes.home];
5820
5821 var Dropdown = /*#__PURE__*/function (_React$Component) {
5822 _inheritsLoose(Dropdown, _React$Component);
5823
5824 function Dropdown(props) {
5825 var _this;
5826
5827 _this = _React$Component.call(this, props) || this;
5828 _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_this));
5829 _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
5830 _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
5831 _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_this));
5832 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
5833 _this.containerRef = /*#__PURE__*/React__default.createRef();
5834 return _this;
5835 }
5836
5837 var _proto = Dropdown.prototype;
5838
5839 _proto.getContextValue = function getContextValue() {
5840 return {
5841 toggle: this.toggle,
5842 isOpen: this.props.isOpen,
5843 direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
5844 inNavbar: this.props.inNavbar,
5845 disabled: this.props.disabled
5846 };
5847 };
5848
5849 _proto.componentDidMount = function componentDidMount() {
5850 this.handleProps();
5851 };
5852
5853 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
5854 if (this.props.isOpen !== prevProps.isOpen) {
5855 this.handleProps();
5856 }
5857 };
5858
5859 _proto.componentWillUnmount = function componentWillUnmount() {
5860 this.removeEvents();
5861 };
5862
5863 _proto.getContainer = function getContainer() {
5864 return this.containerRef.current;
5865 };
5866
5867 _proto.getMenuCtrl = function getMenuCtrl() {
5868 if (this._$menuCtrl) return this._$menuCtrl;
5869 this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
5870 return this._$menuCtrl;
5871 };
5872
5873 _proto.getMenuItems = function getMenuItems() {
5874 return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
5875 };
5876
5877 _proto.addEvents = function addEvents() {
5878 var _this2 = this;
5879
5880 ['click', 'touchstart', 'keyup'].forEach(function (event) {
5881 return document.addEventListener(event, _this2.handleDocumentClick, true);
5882 });
5883 };
5884
5885 _proto.removeEvents = function removeEvents() {
5886 var _this3 = this;
5887
5888 ['click', 'touchstart', 'keyup'].forEach(function (event) {
5889 return document.removeEventListener(event, _this3.handleDocumentClick, true);
5890 });
5891 };
5892
5893 _proto.handleDocumentClick = function handleDocumentClick(e) {
5894 if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
5895 var container = this.getContainer();
5896
5897 if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
5898 return;
5899 }
5900
5901 this.toggle(e);
5902 };
5903
5904 _proto.handleKeyDown = function handleKeyDown(e) {
5905 var _this4 = this;
5906
5907 if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && (e.target.getAttribute('role') !== 'menuitem' || !this.props.a11y)) {
5908 return;
5909 }
5910
5911 if (preventDefaultKeys.indexOf(e.which) !== -1 || e.which >= 48 && e.which <= 90) {
5912 e.preventDefault();
5913 }
5914
5915 if (this.props.disabled) return;
5916
5917 if (this.getMenuCtrl() === e.target) {
5918 if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
5919 this.toggle(e);
5920 setTimeout(function () {
5921 return _this4.getMenuItems()[0].focus();
5922 });
5923 } else if (this.props.isOpen && e.which === keyCodes.esc) {
5924 this.toggle(e);
5925 }
5926 }
5927
5928 if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
5929 if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
5930 this.toggle(e);
5931 this.getMenuCtrl().focus();
5932 } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
5933 e.target.click();
5934 this.getMenuCtrl().focus();
5935 } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
5936 var $menuitems = this.getMenuItems();
5937 var index = $menuitems.indexOf(e.target);
5938
5939 if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
5940 index = index !== 0 ? index - 1 : $menuitems.length - 1;
5941 } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
5942 index = index === $menuitems.length - 1 ? 0 : index + 1;
5943 }
5944
5945 $menuitems[index].focus();
5946 } else if (keyCodes.end === e.which) {
5947 var _$menuitems = this.getMenuItems();
5948
5949 _$menuitems[_$menuitems.length - 1].focus();
5950 } else if (keyCodes.home === e.which) {
5951 var _$menuitems2 = this.getMenuItems();
5952
5953 _$menuitems2[0].focus();
5954 } else if (e.which >= 48 && e.which <= 90) {
5955 var _$menuitems3 = this.getMenuItems();
5956
5957 var charPressed = String.fromCharCode(e.which).toLowerCase();
5958
5959 for (var i = 0; i < _$menuitems3.length; i += 1) {
5960 var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
5961
5962 if (firstLetter === charPressed) {
5963 _$menuitems3[i].focus();
5964
5965 break;
5966 }
5967 }
5968 }
5969 }
5970 };
5971
5972 _proto.handleProps = function handleProps() {
5973 if (this.props.isOpen) {
5974 this.addEvents();
5975 } else {
5976 this.removeEvents();
5977 }
5978 };
5979
5980 _proto.toggle = function toggle(e) {
5981 if (this.props.disabled) {
5982 return e && e.preventDefault();
5983 }
5984
5985 return this.props.toggle(e);
5986 };
5987
5988 _proto.render = function render() {
5989 var _classNames, _ref;
5990
5991 var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'a11y']),
5992 className = _omit.className,
5993 cssModule = _omit.cssModule,
5994 direction = _omit.direction,
5995 isOpen = _omit.isOpen,
5996 group = _omit.group,
5997 size = _omit.size,
5998 nav = _omit.nav,
5999 setActiveFromChild = _omit.setActiveFromChild,
6000 active = _omit.active,
6001 addonType = _omit.addonType,
6002 tag = _omit.tag,
6003 attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "direction", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType", "tag"]);
6004
6005 var Tag = tag || (nav ? 'li' : 'div');
6006 var subItemIsActive = false;
6007
6008 if (setActiveFromChild) {
6009 React__default.Children.map(this.props.children[1].props.children, function (dropdownItem) {
6010 if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
6011 });
6012 }
6013
6014 var classes = mapToCssModules(classnames(className, direction !== 'down' && "drop" + direction, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {}, _classNames["input-group-" + addonType] = addonType, _classNames['btn-group'] = group, _classNames["btn-group-" + size] = !!size, _classNames.dropdown = !group && !addonType, _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);
6015 return /*#__PURE__*/React__default.createElement(DropdownContext.Provider, {
6016 value: this.getContextValue()
6017 }, /*#__PURE__*/React__default.createElement(Manager, null, /*#__PURE__*/React__default.createElement(Tag, _extends({}, attrs, (_ref = {}, _ref[typeof Tag === 'string' ? 'ref' : 'innerRef'] = this.containerRef, _ref), {
6018 onKeyDown: this.handleKeyDown,
6019 className: classes
6020 }))));
6021 };
6022
6023 return Dropdown;
6024 }(React__default.Component);
6025
6026 Dropdown.propTypes = propTypes$f;
6027 Dropdown.defaultProps = defaultProps$e;
6028
6029 var propTypes$g = {
6030 children: propTypes.node
6031 };
6032
6033 var ButtonDropdown = function ButtonDropdown(props) {
6034 return /*#__PURE__*/React__default.createElement(Dropdown, _extends({
6035 group: true
6036 }, props));
6037 };
6038
6039 ButtonDropdown.propTypes = propTypes$g;
6040
6041 var propTypes$h = {
6042 tag: tagPropType,
6043 'aria-label': propTypes.string,
6044 className: propTypes.string,
6045 cssModule: propTypes.object,
6046 role: propTypes.string,
6047 size: propTypes.string,
6048 vertical: propTypes.bool
6049 };
6050 var defaultProps$f = {
6051 tag: 'div',
6052 role: 'group'
6053 };
6054
6055 var ButtonGroup = function ButtonGroup(props) {
6056 var className = props.className,
6057 cssModule = props.cssModule,
6058 size = props.size,
6059 vertical = props.vertical,
6060 Tag = props.tag,
6061 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
6062
6063 var classes = mapToCssModules(classnames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
6064 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
6065 className: classes
6066 }));
6067 };
6068
6069 ButtonGroup.propTypes = propTypes$h;
6070 ButtonGroup.defaultProps = defaultProps$f;
6071
6072 var propTypes$i = {
6073 tag: tagPropType,
6074 'aria-label': propTypes.string,
6075 className: propTypes.string,
6076 cssModule: propTypes.object,
6077 role: propTypes.string
6078 };
6079 var defaultProps$g = {
6080 tag: 'div',
6081 role: 'toolbar'
6082 };
6083
6084 var ButtonToolbar = function ButtonToolbar(props) {
6085 var className = props.className,
6086 cssModule = props.cssModule,
6087 Tag = props.tag,
6088 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
6089
6090 var classes = mapToCssModules(classnames(className, 'btn-toolbar'), cssModule);
6091 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
6092 className: classes
6093 }));
6094 };
6095
6096 ButtonToolbar.propTypes = propTypes$i;
6097 ButtonToolbar.defaultProps = defaultProps$g;
6098
6099 var propTypes$j = {
6100 children: propTypes.node,
6101 active: propTypes.bool,
6102 disabled: propTypes.bool,
6103 divider: propTypes.bool,
6104 tag: tagPropType,
6105 header: propTypes.bool,
6106 onClick: propTypes.func,
6107 className: propTypes.string,
6108 cssModule: propTypes.object,
6109 toggle: propTypes.bool
6110 };
6111 var defaultProps$h = {
6112 tag: 'button',
6113 toggle: true
6114 };
6115
6116 var DropdownItem = /*#__PURE__*/function (_React$Component) {
6117 _inheritsLoose(DropdownItem, _React$Component);
6118
6119 function DropdownItem(props) {
6120 var _this;
6121
6122 _this = _React$Component.call(this, props) || this;
6123 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
6124 _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));
6125 return _this;
6126 }
6127
6128 var _proto = DropdownItem.prototype;
6129
6130 _proto.onClick = function onClick(e) {
6131 if (this.props.disabled || this.props.header || this.props.divider) {
6132 e.preventDefault();
6133 return;
6134 }
6135
6136 if (this.props.onClick) {
6137 this.props.onClick(e);
6138 }
6139
6140 if (this.props.toggle) {
6141 this.context.toggle(e);
6142 }
6143 };
6144
6145 _proto.getTabIndex = function getTabIndex() {
6146 if (this.props.disabled || this.props.header || this.props.divider) {
6147 return '-1';
6148 }
6149
6150 return '0';
6151 };
6152
6153 _proto.render = function render() {
6154 var tabIndex = this.getTabIndex();
6155 var role = tabIndex > -1 ? 'menuitem' : undefined;
6156
6157 var _omit = omit(this.props, ['toggle']),
6158 className = _omit.className,
6159 cssModule = _omit.cssModule,
6160 divider = _omit.divider,
6161 Tag = _omit.tag,
6162 header = _omit.header,
6163 active = _omit.active,
6164 props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
6165
6166 var classes = mapToCssModules(classnames(className, {
6167 disabled: props.disabled,
6168 'dropdown-item': !divider && !header,
6169 active: active,
6170 'dropdown-header': header,
6171 'dropdown-divider': divider
6172 }), cssModule);
6173
6174 if (Tag === 'button') {
6175 if (header) {
6176 Tag = 'h6';
6177 } else if (divider) {
6178 Tag = 'div';
6179 } else if (props.href) {
6180 Tag = 'a';
6181 }
6182 }
6183
6184 return /*#__PURE__*/React__default.createElement(Tag, _extends({
6185 type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
6186 }, props, {
6187 tabIndex: tabIndex,
6188 role: role,
6189 className: classes,
6190 onClick: this.onClick
6191 }));
6192 };
6193
6194 return DropdownItem;
6195 }(React__default.Component);
6196
6197 DropdownItem.propTypes = propTypes$j;
6198 DropdownItem.defaultProps = defaultProps$h;
6199 DropdownItem.contextType = DropdownContext;
6200
6201 var propTypes$k = {
6202 tag: tagPropType,
6203 children: propTypes.node.isRequired,
6204 right: propTypes.bool,
6205 flip: propTypes.bool,
6206 modifiers: propTypes.object,
6207 className: propTypes.string,
6208 cssModule: propTypes.object,
6209 persist: propTypes.bool,
6210 positionFixed: propTypes.bool
6211 };
6212 var defaultProps$i = {
6213 tag: 'div',
6214 flip: true
6215 };
6216 var noFlipModifier = {
6217 flip: {
6218 enabled: false
6219 }
6220 };
6221 var directionPositionMap = {
6222 up: 'top',
6223 left: 'left',
6224 right: 'right',
6225 down: 'bottom'
6226 };
6227
6228 var DropdownMenu = /*#__PURE__*/function (_React$Component) {
6229 _inheritsLoose(DropdownMenu, _React$Component);
6230
6231 function DropdownMenu() {
6232 return _React$Component.apply(this, arguments) || this;
6233 }
6234
6235 var _proto = DropdownMenu.prototype;
6236
6237 _proto.render = function render() {
6238 var _this = this;
6239
6240 var _this$props = this.props,
6241 className = _this$props.className,
6242 cssModule = _this$props.cssModule,
6243 right = _this$props.right,
6244 tag = _this$props.tag,
6245 flip = _this$props.flip,
6246 modifiers = _this$props.modifiers,
6247 persist = _this$props.persist,
6248 positionFixed = _this$props.positionFixed,
6249 attrs = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist", "positionFixed"]);
6250
6251 var classes = mapToCssModules(classnames(className, 'dropdown-menu', {
6252 'dropdown-menu-right': right,
6253 show: this.context.isOpen
6254 }), cssModule);
6255 var Tag = tag;
6256
6257 if (persist || this.context.isOpen && !this.context.inNavbar) {
6258 var position1 = directionPositionMap[this.context.direction] || 'bottom';
6259 var position2 = right ? 'end' : 'start';
6260 var poperPlacement = position1 + "-" + position2;
6261 var poperModifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
6262 var popperPositionFixed = !!positionFixed;
6263 return /*#__PURE__*/React__default.createElement(Popper$1, {
6264 placement: poperPlacement,
6265 modifiers: poperModifiers,
6266 positionFixed: popperPositionFixed
6267 }, function (_ref) {
6268 var ref = _ref.ref,
6269 style = _ref.style,
6270 placement = _ref.placement;
6271 return /*#__PURE__*/React__default.createElement(Tag, _extends({
6272 tabIndex: "-1",
6273 role: "menu",
6274 ref: ref,
6275 style: style
6276 }, attrs, {
6277 "aria-hidden": !_this.context.isOpen,
6278 className: classes,
6279 "x-placement": placement
6280 }));
6281 });
6282 }
6283
6284 return /*#__PURE__*/React__default.createElement(Tag, _extends({
6285 tabIndex: "-1",
6286 role: "menu"
6287 }, attrs, {
6288 "aria-hidden": !this.context.isOpen,
6289 className: classes,
6290 "x-placement": attrs.placement
6291 }));
6292 };
6293
6294 return DropdownMenu;
6295 }(React__default.Component);
6296 DropdownMenu.propTypes = propTypes$k;
6297 DropdownMenu.defaultProps = defaultProps$i;
6298 DropdownMenu.contextType = DropdownContext;
6299
6300 var propTypes$l = {
6301 caret: propTypes.bool,
6302 color: propTypes.string,
6303 children: propTypes.node,
6304 className: propTypes.string,
6305 cssModule: propTypes.object,
6306 disabled: propTypes.bool,
6307 onClick: propTypes.func,
6308 'aria-haspopup': propTypes.bool,
6309 split: propTypes.bool,
6310 tag: tagPropType,
6311 nav: propTypes.bool
6312 };
6313 var defaultProps$j = {
6314 'aria-haspopup': true,
6315 color: 'secondary'
6316 };
6317
6318 var DropdownToggle = /*#__PURE__*/function (_React$Component) {
6319 _inheritsLoose(DropdownToggle, _React$Component);
6320
6321 function DropdownToggle(props) {
6322 var _this;
6323
6324 _this = _React$Component.call(this, props) || this;
6325 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
6326 return _this;
6327 }
6328
6329 var _proto = DropdownToggle.prototype;
6330
6331 _proto.onClick = function onClick(e) {
6332 if (this.props.disabled || this.context.disabled) {
6333 e.preventDefault();
6334 return;
6335 }
6336
6337 if (this.props.nav && !this.props.tag) {
6338 e.preventDefault();
6339 }
6340
6341 if (this.props.onClick) {
6342 this.props.onClick(e);
6343 }
6344
6345 this.context.toggle(e);
6346 };
6347
6348 _proto.render = function render() {
6349 var _this2 = this;
6350
6351 var _this$props = this.props,
6352 className = _this$props.className,
6353 color = _this$props.color,
6354 cssModule = _this$props.cssModule,
6355 caret = _this$props.caret,
6356 split = _this$props.split,
6357 nav = _this$props.nav,
6358 tag = _this$props.tag,
6359 innerRef = _this$props.innerRef,
6360 props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag", "innerRef"]);
6361
6362 var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
6363 var classes = mapToCssModules(classnames(className, {
6364 'dropdown-toggle': caret || split,
6365 'dropdown-toggle-split': split,
6366 'nav-link': nav
6367 }), cssModule);
6368 var children = typeof props.children !== 'undefined' ? props.children : /*#__PURE__*/React__default.createElement("span", {
6369 className: "sr-only"
6370 }, ariaLabel);
6371 var Tag;
6372
6373 if (nav && !tag) {
6374 Tag = 'a';
6375 props.href = '#';
6376 } else if (!tag) {
6377 Tag = Button;
6378 props.color = color;
6379 props.cssModule = cssModule;
6380 } else {
6381 Tag = tag;
6382 }
6383
6384 if (this.context.inNavbar) {
6385 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, props, {
6386 className: classes,
6387 onClick: this.onClick,
6388 "aria-expanded": this.context.isOpen,
6389 children: children
6390 }));
6391 }
6392
6393 return /*#__PURE__*/React__default.createElement(Reference, {
6394 innerRef: innerRef
6395 }, function (_ref) {
6396 var _ref2;
6397
6398 var ref = _ref.ref;
6399 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {
6400 className: classes,
6401 onClick: _this2.onClick,
6402 "aria-expanded": _this2.context.isOpen,
6403 children: children
6404 }));
6405 });
6406 };
6407
6408 return DropdownToggle;
6409 }(React__default.Component);
6410
6411 DropdownToggle.propTypes = propTypes$l;
6412 DropdownToggle.defaultProps = defaultProps$j;
6413 DropdownToggle.contextType = DropdownContext;
6414
6415 var interopRequireDefault = createCommonjsModule(function (module) {
6416 function _interopRequireDefault(obj) {
6417 return obj && obj.__esModule ? obj : {
6418 "default": obj
6419 };
6420 }
6421
6422 module.exports = _interopRequireDefault;
6423 });
6424 unwrapExports(interopRequireDefault);
6425
6426 var hasClass_1 = createCommonjsModule(function (module, exports) {
6427
6428 exports.__esModule = true;
6429 exports.default = hasClass;
6430
6431 function hasClass(element, className) {
6432 if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
6433 }
6434
6435 module.exports = exports["default"];
6436 });
6437 unwrapExports(hasClass_1);
6438
6439 var addClass_1 = createCommonjsModule(function (module, exports) {
6440
6441 exports.__esModule = true;
6442 exports.default = addClass;
6443
6444 var _hasClass = interopRequireDefault(hasClass_1);
6445
6446 function addClass(element, className) {
6447 if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
6448 }
6449
6450 module.exports = exports["default"];
6451 });
6452 unwrapExports(addClass_1);
6453
6454 function replaceClassName(origClass, classToRemove) {
6455 return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
6456 }
6457
6458 var removeClass = function removeClass(element, className) {
6459 if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
6460 };
6461
6462 /**
6463 * Copyright (c) 2013-present, Facebook, Inc.
6464 *
6465 * This source code is licensed under the MIT license found in the
6466 * LICENSE file in the root directory of this source tree.
6467 */
6468 function componentWillMount() {
6469 // Call this.constructor.gDSFP to support sub-classes.
6470 var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
6471
6472 if (state !== null && state !== undefined) {
6473 this.setState(state);
6474 }
6475 }
6476
6477 function componentWillReceiveProps(nextProps) {
6478 // Call this.constructor.gDSFP to support sub-classes.
6479 // Use the setState() updater to ensure state isn't stale in certain edge cases.
6480 function updater(prevState) {
6481 var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
6482 return state !== null && state !== undefined ? state : null;
6483 } // Binding "this" is important for shallow renderer support.
6484
6485
6486 this.setState(updater.bind(this));
6487 }
6488
6489 function componentWillUpdate(nextProps, nextState) {
6490 try {
6491 var prevProps = this.props;
6492 var prevState = this.state;
6493 this.props = nextProps;
6494 this.state = nextState;
6495 this.__reactInternalSnapshotFlag = true;
6496 this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
6497 } finally {
6498 this.props = prevProps;
6499 this.state = prevState;
6500 }
6501 } // React may warn about cWM/cWRP/cWU methods being deprecated.
6502 // Add a flag to suppress these warnings for this special case.
6503
6504
6505 componentWillMount.__suppressDeprecationWarning = true;
6506 componentWillReceiveProps.__suppressDeprecationWarning = true;
6507 componentWillUpdate.__suppressDeprecationWarning = true;
6508
6509 function polyfill$3(Component) {
6510 var prototype = Component.prototype;
6511
6512 if (!prototype || !prototype.isReactComponent) {
6513 throw new Error('Can only polyfill class components');
6514 }
6515
6516 if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
6517 return Component;
6518 } // If new component APIs are defined, "unsafe" lifecycles won't be called.
6519 // Error if any of these lifecycles are present,
6520 // Because they would work differently between older and newer (16.3+) versions of React.
6521
6522
6523 var foundWillMountName = null;
6524 var foundWillReceivePropsName = null;
6525 var foundWillUpdateName = null;
6526
6527 if (typeof prototype.componentWillMount === 'function') {
6528 foundWillMountName = 'componentWillMount';
6529 } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
6530 foundWillMountName = 'UNSAFE_componentWillMount';
6531 }
6532
6533 if (typeof prototype.componentWillReceiveProps === 'function') {
6534 foundWillReceivePropsName = 'componentWillReceiveProps';
6535 } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
6536 foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
6537 }
6538
6539 if (typeof prototype.componentWillUpdate === 'function') {
6540 foundWillUpdateName = 'componentWillUpdate';
6541 } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
6542 foundWillUpdateName = 'UNSAFE_componentWillUpdate';
6543 }
6544
6545 if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
6546 var componentName = Component.displayName || Component.name;
6547 var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
6548 throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
6549 } // React <= 16.2 does not support static getDerivedStateFromProps.
6550 // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
6551 // Newer versions of React will ignore these lifecycles if gDSFP exists.
6552
6553
6554 if (typeof Component.getDerivedStateFromProps === 'function') {
6555 prototype.componentWillMount = componentWillMount;
6556 prototype.componentWillReceiveProps = componentWillReceiveProps;
6557 } // React <= 16.2 does not support getSnapshotBeforeUpdate.
6558 // As a workaround, use cWU to invoke the new lifecycle.
6559 // Newer versions of React will ignore that lifecycle if gSBU exists.
6560
6561
6562 if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
6563 if (typeof prototype.componentDidUpdate !== 'function') {
6564 throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
6565 }
6566
6567 prototype.componentWillUpdate = componentWillUpdate;
6568 var componentDidUpdate = prototype.componentDidUpdate;
6569
6570 prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
6571 // 16.3+ will not execute our will-update method;
6572 // It will pass a snapshot value to did-update though.
6573 // Older versions will require our polyfilled will-update value.
6574 // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
6575 // Because for <= 15.x versions this might be a "prevContext" object.
6576 // We also can't just check "__reactInternalSnapshot",
6577 // Because get-snapshot might return a falsy value.
6578 // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
6579 var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
6580 componentDidUpdate.call(this, prevProps, prevState, snapshot);
6581 };
6582 }
6583
6584 return Component;
6585 }
6586
6587 var reactLifecyclesCompat_es = /*#__PURE__*/Object.freeze({
6588 __proto__: null,
6589 polyfill: polyfill$3
6590 });
6591
6592 var PropTypes = createCommonjsModule(function (module, exports) {
6593
6594 exports.__esModule = true;
6595 exports.classNamesShape = exports.timeoutsShape = void 0;
6596
6597 var _propTypes = _interopRequireDefault(propTypes);
6598
6599 function _interopRequireDefault(obj) {
6600 return obj && obj.__esModule ? obj : {
6601 default: obj
6602 };
6603 }
6604
6605 var timeoutsShape = null;
6606 exports.timeoutsShape = timeoutsShape;
6607 var classNamesShape = null;
6608 exports.classNamesShape = classNamesShape;
6609 });
6610 unwrapExports(PropTypes);
6611 var PropTypes_1 = PropTypes.classNamesShape;
6612 var PropTypes_2 = PropTypes.timeoutsShape;
6613
6614 var Transition_1 = createCommonjsModule(function (module, exports) {
6615
6616 exports.__esModule = true;
6617 exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
6618
6619 var PropTypes = _interopRequireWildcard(propTypes);
6620
6621 var _react = _interopRequireDefault(React__default);
6622
6623 var _reactDom = _interopRequireDefault(ReactDOM);
6624
6625 function _interopRequireDefault(obj) {
6626 return obj && obj.__esModule ? obj : {
6627 default: obj
6628 };
6629 }
6630
6631 function _interopRequireWildcard(obj) {
6632 if (obj && obj.__esModule) {
6633 return obj;
6634 } else {
6635 var newObj = {};
6636
6637 if (obj != null) {
6638 for (var key in obj) {
6639 if (Object.prototype.hasOwnProperty.call(obj, key)) {
6640 var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
6641
6642 if (desc.get || desc.set) {
6643 Object.defineProperty(newObj, key, desc);
6644 } else {
6645 newObj[key] = obj[key];
6646 }
6647 }
6648 }
6649 }
6650
6651 newObj.default = obj;
6652 return newObj;
6653 }
6654 }
6655
6656 function _objectWithoutPropertiesLoose(source, excluded) {
6657 if (source == null) return {};
6658 var target = {};
6659 var sourceKeys = Object.keys(source);
6660 var key, i;
6661
6662 for (i = 0; i < sourceKeys.length; i++) {
6663 key = sourceKeys[i];
6664 if (excluded.indexOf(key) >= 0) continue;
6665 target[key] = source[key];
6666 }
6667
6668 return target;
6669 }
6670
6671 function _inheritsLoose(subClass, superClass) {
6672 subClass.prototype = Object.create(superClass.prototype);
6673 subClass.prototype.constructor = subClass;
6674 subClass.__proto__ = superClass;
6675 }
6676
6677 var UNMOUNTED = 'unmounted';
6678 exports.UNMOUNTED = UNMOUNTED;
6679 var EXITED = 'exited';
6680 exports.EXITED = EXITED;
6681 var ENTERING = 'entering';
6682 exports.ENTERING = ENTERING;
6683 var ENTERED = 'entered';
6684 exports.ENTERED = ENTERED;
6685 var EXITING = 'exiting';
6686 /**
6687 * The Transition component lets you describe a transition from one component
6688 * state to another _over time_ with a simple declarative API. Most commonly
6689 * it's used to animate the mounting and unmounting of a component, but can also
6690 * be used to describe in-place transition states as well.
6691 *
6692 * ---
6693 *
6694 * **Note**: `Transition` is a platform-agnostic base component. If you're using
6695 * transitions in CSS, you'll probably want to use
6696 * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
6697 * instead. It inherits all the features of `Transition`, but contains
6698 * additional features necessary to play nice with CSS transitions (hence the
6699 * name of the component).
6700 *
6701 * ---
6702 *
6703 * By default the `Transition` component does not alter the behavior of the
6704 * component it renders, it only tracks "enter" and "exit" states for the
6705 * components. It's up to you to give meaning and effect to those states. For
6706 * example we can add styles to a component when it enters or exits:
6707 *
6708 * ```jsx
6709 * import { Transition } from 'react-transition-group';
6710 *
6711 * const duration = 300;
6712 *
6713 * const defaultStyle = {
6714 * transition: `opacity ${duration}ms ease-in-out`,
6715 * opacity: 0,
6716 * }
6717 *
6718 * const transitionStyles = {
6719 * entering: { opacity: 0 },
6720 * entered: { opacity: 1 },
6721 * };
6722 *
6723 * const Fade = ({ in: inProp }) => (
6724 * <Transition in={inProp} timeout={duration}>
6725 * {state => (
6726 * <div style={{
6727 * ...defaultStyle,
6728 * ...transitionStyles[state]
6729 * }}>
6730 * I'm a fade Transition!
6731 * </div>
6732 * )}
6733 * </Transition>
6734 * );
6735 * ```
6736 *
6737 * There are 4 main states a Transition can be in:
6738 * - `'entering'`
6739 * - `'entered'`
6740 * - `'exiting'`
6741 * - `'exited'`
6742 *
6743 * Transition state is toggled via the `in` prop. When `true` the component
6744 * begins the "Enter" stage. During this stage, the component will shift from
6745 * its current transition state, to `'entering'` for the duration of the
6746 * transition and then to the `'entered'` stage once it's complete. Let's take
6747 * the following example (we'll use the
6748 * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
6749 *
6750 * ```jsx
6751 * function App() {
6752 * const [inProp, setInProp] = useState(false);
6753 * return (
6754 * <div>
6755 * <Transition in={inProp} timeout={500}>
6756 * {state => (
6757 * // ...
6758 * )}
6759 * </Transition>
6760 * <button onClick={() => setInProp(true)}>
6761 * Click to Enter
6762 * </button>
6763 * </div>
6764 * );
6765 * }
6766 * ```
6767 *
6768 * When the button is clicked the component will shift to the `'entering'` state
6769 * and stay there for 500ms (the value of `timeout`) before it finally switches
6770 * to `'entered'`.
6771 *
6772 * When `in` is `false` the same thing happens except the state moves from
6773 * `'exiting'` to `'exited'`.
6774 */
6775
6776 exports.EXITING = EXITING;
6777
6778 var Transition = /*#__PURE__*/function (_React$Component) {
6779 _inheritsLoose(Transition, _React$Component);
6780
6781 function Transition(props, context) {
6782 var _this;
6783
6784 _this = _React$Component.call(this, props, context) || this;
6785 var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears
6786
6787 var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
6788 var initialStatus;
6789 _this.appearStatus = null;
6790
6791 if (props.in) {
6792 if (appear) {
6793 initialStatus = EXITED;
6794 _this.appearStatus = ENTERING;
6795 } else {
6796 initialStatus = ENTERED;
6797 }
6798 } else {
6799 if (props.unmountOnExit || props.mountOnEnter) {
6800 initialStatus = UNMOUNTED;
6801 } else {
6802 initialStatus = EXITED;
6803 }
6804 }
6805
6806 _this.state = {
6807 status: initialStatus
6808 };
6809 _this.nextCallback = null;
6810 return _this;
6811 }
6812
6813 var _proto = Transition.prototype;
6814
6815 _proto.getChildContext = function getChildContext() {
6816 return {
6817 transitionGroup: null // allows for nested Transitions
6818
6819 };
6820 };
6821
6822 Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
6823 var nextIn = _ref.in;
6824
6825 if (nextIn && prevState.status === UNMOUNTED) {
6826 return {
6827 status: EXITED
6828 };
6829 }
6830
6831 return null;
6832 }; // getSnapshotBeforeUpdate(prevProps) {
6833 // let nextStatus = null
6834 // if (prevProps !== this.props) {
6835 // const { status } = this.state
6836 // if (this.props.in) {
6837 // if (status !== ENTERING && status !== ENTERED) {
6838 // nextStatus = ENTERING
6839 // }
6840 // } else {
6841 // if (status === ENTERING || status === ENTERED) {
6842 // nextStatus = EXITING
6843 // }
6844 // }
6845 // }
6846 // return { nextStatus }
6847 // }
6848
6849
6850 _proto.componentDidMount = function componentDidMount() {
6851 this.updateStatus(true, this.appearStatus);
6852 };
6853
6854 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
6855 var nextStatus = null;
6856
6857 if (prevProps !== this.props) {
6858 var status = this.state.status;
6859
6860 if (this.props.in) {
6861 if (status !== ENTERING && status !== ENTERED) {
6862 nextStatus = ENTERING;
6863 }
6864 } else {
6865 if (status === ENTERING || status === ENTERED) {
6866 nextStatus = EXITING;
6867 }
6868 }
6869 }
6870
6871 this.updateStatus(false, nextStatus);
6872 };
6873
6874 _proto.componentWillUnmount = function componentWillUnmount() {
6875 this.cancelNextCallback();
6876 };
6877
6878 _proto.getTimeouts = function getTimeouts() {
6879 var timeout = this.props.timeout;
6880 var exit, enter, appear;
6881 exit = enter = appear = timeout;
6882
6883 if (timeout != null && typeof timeout !== 'number') {
6884 exit = timeout.exit;
6885 enter = timeout.enter; // TODO: remove fallback for next major
6886
6887 appear = timeout.appear !== undefined ? timeout.appear : enter;
6888 }
6889
6890 return {
6891 exit: exit,
6892 enter: enter,
6893 appear: appear
6894 };
6895 };
6896
6897 _proto.updateStatus = function updateStatus(mounting, nextStatus) {
6898 if (mounting === void 0) {
6899 mounting = false;
6900 }
6901
6902 if (nextStatus !== null) {
6903 // nextStatus will always be ENTERING or EXITING.
6904 this.cancelNextCallback();
6905
6906 var node = _reactDom.default.findDOMNode(this);
6907
6908 if (nextStatus === ENTERING) {
6909 this.performEnter(node, mounting);
6910 } else {
6911 this.performExit(node);
6912 }
6913 } else if (this.props.unmountOnExit && this.state.status === EXITED) {
6914 this.setState({
6915 status: UNMOUNTED
6916 });
6917 }
6918 };
6919
6920 _proto.performEnter = function performEnter(node, mounting) {
6921 var _this2 = this;
6922
6923 var enter = this.props.enter;
6924 var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
6925 var timeouts = this.getTimeouts();
6926 var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
6927 // if we are mounting and running this it means appear _must_ be set
6928
6929 if (!mounting && !enter) {
6930 this.safeSetState({
6931 status: ENTERED
6932 }, function () {
6933 _this2.props.onEntered(node);
6934 });
6935 return;
6936 }
6937
6938 this.props.onEnter(node, appearing);
6939 this.safeSetState({
6940 status: ENTERING
6941 }, function () {
6942 _this2.props.onEntering(node, appearing);
6943
6944 _this2.onTransitionEnd(node, enterTimeout, function () {
6945 _this2.safeSetState({
6946 status: ENTERED
6947 }, function () {
6948 _this2.props.onEntered(node, appearing);
6949 });
6950 });
6951 });
6952 };
6953
6954 _proto.performExit = function performExit(node) {
6955 var _this3 = this;
6956
6957 var exit = this.props.exit;
6958 var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
6959
6960 if (!exit) {
6961 this.safeSetState({
6962 status: EXITED
6963 }, function () {
6964 _this3.props.onExited(node);
6965 });
6966 return;
6967 }
6968
6969 this.props.onExit(node);
6970 this.safeSetState({
6971 status: EXITING
6972 }, function () {
6973 _this3.props.onExiting(node);
6974
6975 _this3.onTransitionEnd(node, timeouts.exit, function () {
6976 _this3.safeSetState({
6977 status: EXITED
6978 }, function () {
6979 _this3.props.onExited(node);
6980 });
6981 });
6982 });
6983 };
6984
6985 _proto.cancelNextCallback = function cancelNextCallback() {
6986 if (this.nextCallback !== null) {
6987 this.nextCallback.cancel();
6988 this.nextCallback = null;
6989 }
6990 };
6991
6992 _proto.safeSetState = function safeSetState(nextState, callback) {
6993 // This shouldn't be necessary, but there are weird race conditions with
6994 // setState callbacks and unmounting in testing, so always make sure that
6995 // we can cancel any pending setState callbacks after we unmount.
6996 callback = this.setNextCallback(callback);
6997 this.setState(nextState, callback);
6998 };
6999
7000 _proto.setNextCallback = function setNextCallback(callback) {
7001 var _this4 = this;
7002
7003 var active = true;
7004
7005 this.nextCallback = function (event) {
7006 if (active) {
7007 active = false;
7008 _this4.nextCallback = null;
7009 callback(event);
7010 }
7011 };
7012
7013 this.nextCallback.cancel = function () {
7014 active = false;
7015 };
7016
7017 return this.nextCallback;
7018 };
7019
7020 _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
7021 this.setNextCallback(handler);
7022 var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
7023
7024 if (!node || doesNotHaveTimeoutOrListener) {
7025 setTimeout(this.nextCallback, 0);
7026 return;
7027 }
7028
7029 if (this.props.addEndListener) {
7030 this.props.addEndListener(node, this.nextCallback);
7031 }
7032
7033 if (timeout != null) {
7034 setTimeout(this.nextCallback, timeout);
7035 }
7036 };
7037
7038 _proto.render = function render() {
7039 var status = this.state.status;
7040
7041 if (status === UNMOUNTED) {
7042 return null;
7043 }
7044
7045 var _this$props = this.props,
7046 children = _this$props.children,
7047 childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]); // filter props for Transtition
7048
7049
7050 delete childProps.in;
7051 delete childProps.mountOnEnter;
7052 delete childProps.unmountOnExit;
7053 delete childProps.appear;
7054 delete childProps.enter;
7055 delete childProps.exit;
7056 delete childProps.timeout;
7057 delete childProps.addEndListener;
7058 delete childProps.onEnter;
7059 delete childProps.onEntering;
7060 delete childProps.onEntered;
7061 delete childProps.onExit;
7062 delete childProps.onExiting;
7063 delete childProps.onExited;
7064
7065 if (typeof children === 'function') {
7066 return children(status, childProps);
7067 }
7068
7069 var child = _react.default.Children.only(children);
7070
7071 return _react.default.cloneElement(child, childProps);
7072 };
7073
7074 return Transition;
7075 }(_react.default.Component);
7076
7077 Transition.contextTypes = {
7078 transitionGroup: PropTypes.object
7079 };
7080 Transition.childContextTypes = {
7081 transitionGroup: function transitionGroup() {}
7082 };
7083 Transition.propTypes = {};
7084
7085 function noop() {}
7086
7087 Transition.defaultProps = {
7088 in: false,
7089 mountOnEnter: false,
7090 unmountOnExit: false,
7091 appear: false,
7092 enter: true,
7093 exit: true,
7094 onEnter: noop,
7095 onEntering: noop,
7096 onEntered: noop,
7097 onExit: noop,
7098 onExiting: noop,
7099 onExited: noop
7100 };
7101 Transition.UNMOUNTED = 0;
7102 Transition.EXITED = 1;
7103 Transition.ENTERING = 2;
7104 Transition.ENTERED = 3;
7105 Transition.EXITING = 4;
7106
7107 var _default = (0, reactLifecyclesCompat_es.polyfill)(Transition);
7108
7109 exports.default = _default;
7110 });
7111 unwrapExports(Transition_1);
7112 var Transition_2 = Transition_1.EXITING;
7113 var Transition_3 = Transition_1.ENTERED;
7114 var Transition_4 = Transition_1.ENTERING;
7115 var Transition_5 = Transition_1.EXITED;
7116 var Transition_6 = Transition_1.UNMOUNTED;
7117
7118 var CSSTransition_1 = createCommonjsModule(function (module, exports) {
7119
7120 exports.__esModule = true;
7121 exports.default = void 0;
7122
7123 var PropTypes = _interopRequireWildcard(propTypes);
7124
7125 var _addClass = _interopRequireDefault(addClass_1);
7126
7127 var _removeClass = _interopRequireDefault(removeClass);
7128
7129 var _react = _interopRequireDefault(React__default);
7130
7131 var _Transition = _interopRequireDefault(Transition_1);
7132
7133 function _interopRequireDefault(obj) {
7134 return obj && obj.__esModule ? obj : {
7135 default: obj
7136 };
7137 }
7138
7139 function _interopRequireWildcard(obj) {
7140 if (obj && obj.__esModule) {
7141 return obj;
7142 } else {
7143 var newObj = {};
7144
7145 if (obj != null) {
7146 for (var key in obj) {
7147 if (Object.prototype.hasOwnProperty.call(obj, key)) {
7148 var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
7149
7150 if (desc.get || desc.set) {
7151 Object.defineProperty(newObj, key, desc);
7152 } else {
7153 newObj[key] = obj[key];
7154 }
7155 }
7156 }
7157 }
7158
7159 newObj.default = obj;
7160 return newObj;
7161 }
7162 }
7163
7164 function _extends() {
7165 _extends = Object.assign || function (target) {
7166 for (var i = 1; i < arguments.length; i++) {
7167 var source = arguments[i];
7168
7169 for (var key in source) {
7170 if (Object.prototype.hasOwnProperty.call(source, key)) {
7171 target[key] = source[key];
7172 }
7173 }
7174 }
7175
7176 return target;
7177 };
7178
7179 return _extends.apply(this, arguments);
7180 }
7181
7182 function _inheritsLoose(subClass, superClass) {
7183 subClass.prototype = Object.create(superClass.prototype);
7184 subClass.prototype.constructor = subClass;
7185 subClass.__proto__ = superClass;
7186 }
7187
7188 var addClass = function addClass(node, classes) {
7189 return node && classes && classes.split(' ').forEach(function (c) {
7190 return (0, _addClass.default)(node, c);
7191 });
7192 };
7193
7194 var removeClass$1 = function removeClass(node, classes) {
7195 return node && classes && classes.split(' ').forEach(function (c) {
7196 return (0, _removeClass.default)(node, c);
7197 });
7198 };
7199 /**
7200 * A transition component inspired by the excellent
7201 * [ng-animate](http://www.nganimate.org/) library, you should use it if you're
7202 * using CSS transitions or animations. It's built upon the
7203 * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
7204 * component, so it inherits all of its props.
7205 *
7206 * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
7207 * and `exit` states of the transition. The first class is applied and then a
7208 * second `*-active` class in order to activate the CSSS transition. After the
7209 * transition, matching `*-done` class names are applied to persist the
7210 * transition state.
7211 *
7212 * ```jsx
7213 * function App() {
7214 * const [inProp, setInProp] = useState(false);
7215 * return (
7216 * <div>
7217 * <CSSTransition in={inProp} timeout={200} classNames="my-node">
7218 * <div>
7219 * {"I'll receive my-node-* classes"}
7220 * </div>
7221 * </CSSTransition>
7222 * <button type="button" onClick={() => setInProp(true)}>
7223 * Click to Enter
7224 * </button>
7225 * </div>
7226 * );
7227 * }
7228 * ```
7229 *
7230 * When the `in` prop is set to `true`, the child component will first receive
7231 * the class `example-enter`, then the `example-enter-active` will be added in
7232 * the next tick. `CSSTransition` [forces a
7233 * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
7234 * between before adding the `example-enter-active`. This is an important trick
7235 * because it allows us to transition between `example-enter` and
7236 * `example-enter-active` even though they were added immediately one after
7237 * another. Most notably, this is what makes it possible for us to animate
7238 * _appearance_.
7239 *
7240 * ```css
7241 * .my-node-enter {
7242 * opacity: 0;
7243 * }
7244 * .my-node-enter-active {
7245 * opacity: 1;
7246 * transition: opacity 200ms;
7247 * }
7248 * .my-node-exit {
7249 * opacity: 1;
7250 * }
7251 * .my-node-exit-active {
7252 * opacity: 0;
7253 * transition: opacity: 200ms;
7254 * }
7255 * ```
7256 *
7257 * `*-active` classes represent which styles you want to animate **to**.
7258 */
7259
7260
7261 var CSSTransition = /*#__PURE__*/function (_React$Component) {
7262 _inheritsLoose(CSSTransition, _React$Component);
7263
7264 function CSSTransition() {
7265 var _this;
7266
7267 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7268 args[_key] = arguments[_key];
7269 }
7270
7271 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
7272
7273 _this.onEnter = function (node, appearing) {
7274 var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'),
7275 className = _this$getClassNames.className;
7276
7277 _this.removeClasses(node, 'exit');
7278
7279 addClass(node, className);
7280
7281 if (_this.props.onEnter) {
7282 _this.props.onEnter(node, appearing);
7283 }
7284 };
7285
7286 _this.onEntering = function (node, appearing) {
7287 var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'),
7288 activeClassName = _this$getClassNames2.activeClassName;
7289
7290 _this.reflowAndAddClass(node, activeClassName);
7291
7292 if (_this.props.onEntering) {
7293 _this.props.onEntering(node, appearing);
7294 }
7295 };
7296
7297 _this.onEntered = function (node, appearing) {
7298 var appearClassName = _this.getClassNames('appear').doneClassName;
7299
7300 var enterClassName = _this.getClassNames('enter').doneClassName;
7301
7302 var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
7303
7304 _this.removeClasses(node, appearing ? 'appear' : 'enter');
7305
7306 addClass(node, doneClassName);
7307
7308 if (_this.props.onEntered) {
7309 _this.props.onEntered(node, appearing);
7310 }
7311 };
7312
7313 _this.onExit = function (node) {
7314 var _this$getClassNames3 = _this.getClassNames('exit'),
7315 className = _this$getClassNames3.className;
7316
7317 _this.removeClasses(node, 'appear');
7318
7319 _this.removeClasses(node, 'enter');
7320
7321 addClass(node, className);
7322
7323 if (_this.props.onExit) {
7324 _this.props.onExit(node);
7325 }
7326 };
7327
7328 _this.onExiting = function (node) {
7329 var _this$getClassNames4 = _this.getClassNames('exit'),
7330 activeClassName = _this$getClassNames4.activeClassName;
7331
7332 _this.reflowAndAddClass(node, activeClassName);
7333
7334 if (_this.props.onExiting) {
7335 _this.props.onExiting(node);
7336 }
7337 };
7338
7339 _this.onExited = function (node) {
7340 var _this$getClassNames5 = _this.getClassNames('exit'),
7341 doneClassName = _this$getClassNames5.doneClassName;
7342
7343 _this.removeClasses(node, 'exit');
7344
7345 addClass(node, doneClassName);
7346
7347 if (_this.props.onExited) {
7348 _this.props.onExited(node);
7349 }
7350 };
7351
7352 _this.getClassNames = function (type) {
7353 var classNames = _this.props.classNames;
7354 var isStringClassNames = typeof classNames === 'string';
7355 var prefix = isStringClassNames && classNames ? classNames + '-' : '';
7356 var className = isStringClassNames ? prefix + type : classNames[type];
7357 var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];
7358 var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];
7359 return {
7360 className: className,
7361 activeClassName: activeClassName,
7362 doneClassName: doneClassName
7363 };
7364 };
7365
7366 return _this;
7367 }
7368
7369 var _proto = CSSTransition.prototype;
7370
7371 _proto.removeClasses = function removeClasses(node, type) {
7372 var _this$getClassNames6 = this.getClassNames(type),
7373 className = _this$getClassNames6.className,
7374 activeClassName = _this$getClassNames6.activeClassName,
7375 doneClassName = _this$getClassNames6.doneClassName;
7376
7377 className && removeClass$1(node, className);
7378 activeClassName && removeClass$1(node, activeClassName);
7379 doneClassName && removeClass$1(node, doneClassName);
7380 };
7381
7382 _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
7383 // This is for to force a repaint,
7384 // which is necessary in order to transition styles when adding a class name.
7385 if (className) {
7386 /* eslint-disable no-unused-expressions */
7387 node && node.scrollTop;
7388 /* eslint-enable no-unused-expressions */
7389
7390 addClass(node, className);
7391 }
7392 };
7393
7394 _proto.render = function render() {
7395 var props = _extends({}, this.props);
7396
7397 delete props.classNames;
7398 return _react.default.createElement(_Transition.default, _extends({}, props, {
7399 onEnter: this.onEnter,
7400 onEntered: this.onEntered,
7401 onEntering: this.onEntering,
7402 onExit: this.onExit,
7403 onExiting: this.onExiting,
7404 onExited: this.onExited
7405 }));
7406 };
7407
7408 return CSSTransition;
7409 }(_react.default.Component);
7410
7411 CSSTransition.defaultProps = {
7412 classNames: ''
7413 };
7414 CSSTransition.propTypes = {};
7415 var _default = CSSTransition;
7416 exports.default = _default;
7417 module.exports = exports["default"];
7418 });
7419 unwrapExports(CSSTransition_1);
7420
7421 var ChildMapping = createCommonjsModule(function (module, exports) {
7422
7423 exports.__esModule = true;
7424 exports.getChildMapping = getChildMapping;
7425 exports.mergeChildMappings = mergeChildMappings;
7426 exports.getInitialChildMapping = getInitialChildMapping;
7427 exports.getNextChildMapping = getNextChildMapping;
7428 /**
7429 * Given `this.props.children`, return an object mapping key to child.
7430 *
7431 * @param {*} children `this.props.children`
7432 * @return {object} Mapping of key to child
7433 */
7434
7435 function getChildMapping(children, mapFn) {
7436 var mapper = function mapper(child) {
7437 return mapFn && (0, React__default.isValidElement)(child) ? mapFn(child) : child;
7438 };
7439
7440 var result = Object.create(null);
7441 if (children) React__default.Children.map(children, function (c) {
7442 return c;
7443 }).forEach(function (child) {
7444 // run the map function here instead so that the key is the computed one
7445 result[child.key] = mapper(child);
7446 });
7447 return result;
7448 }
7449 /**
7450 * When you're adding or removing children some may be added or removed in the
7451 * same render pass. We want to show *both* since we want to simultaneously
7452 * animate elements in and out. This function takes a previous set of keys
7453 * and a new set of keys and merges them with its best guess of the correct
7454 * ordering. In the future we may expose some of the utilities in
7455 * ReactMultiChild to make this easy, but for now React itself does not
7456 * directly have this concept of the union of prevChildren and nextChildren
7457 * so we implement it here.
7458 *
7459 * @param {object} prev prev children as returned from
7460 * `ReactTransitionChildMapping.getChildMapping()`.
7461 * @param {object} next next children as returned from
7462 * `ReactTransitionChildMapping.getChildMapping()`.
7463 * @return {object} a key set that contains all keys in `prev` and all keys
7464 * in `next` in a reasonable order.
7465 */
7466
7467
7468 function mergeChildMappings(prev, next) {
7469 prev = prev || {};
7470 next = next || {};
7471
7472 function getValueForKey(key) {
7473 return key in next ? next[key] : prev[key];
7474 } // For each key of `next`, the list of keys to insert before that key in
7475 // the combined list
7476
7477
7478 var nextKeysPending = Object.create(null);
7479 var pendingKeys = [];
7480
7481 for (var prevKey in prev) {
7482 if (prevKey in next) {
7483 if (pendingKeys.length) {
7484 nextKeysPending[prevKey] = pendingKeys;
7485 pendingKeys = [];
7486 }
7487 } else {
7488 pendingKeys.push(prevKey);
7489 }
7490 }
7491
7492 var i;
7493 var childMapping = {};
7494
7495 for (var nextKey in next) {
7496 if (nextKeysPending[nextKey]) {
7497 for (i = 0; i < nextKeysPending[nextKey].length; i++) {
7498 var pendingNextKey = nextKeysPending[nextKey][i];
7499 childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
7500 }
7501 }
7502
7503 childMapping[nextKey] = getValueForKey(nextKey);
7504 } // Finally, add the keys which didn't appear before any key in `next`
7505
7506
7507 for (i = 0; i < pendingKeys.length; i++) {
7508 childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
7509 }
7510
7511 return childMapping;
7512 }
7513
7514 function getProp(child, prop, props) {
7515 return props[prop] != null ? props[prop] : child.props[prop];
7516 }
7517
7518 function getInitialChildMapping(props, onExited) {
7519 return getChildMapping(props.children, function (child) {
7520 return (0, React__default.cloneElement)(child, {
7521 onExited: onExited.bind(null, child),
7522 in: true,
7523 appear: getProp(child, 'appear', props),
7524 enter: getProp(child, 'enter', props),
7525 exit: getProp(child, 'exit', props)
7526 });
7527 });
7528 }
7529
7530 function getNextChildMapping(nextProps, prevChildMapping, onExited) {
7531 var nextChildMapping = getChildMapping(nextProps.children);
7532 var children = mergeChildMappings(prevChildMapping, nextChildMapping);
7533 Object.keys(children).forEach(function (key) {
7534 var child = children[key];
7535 if (!(0, React__default.isValidElement)(child)) return;
7536 var hasPrev = (key in prevChildMapping);
7537 var hasNext = (key in nextChildMapping);
7538 var prevChild = prevChildMapping[key];
7539 var isLeaving = (0, React__default.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)
7540
7541 if (hasNext && (!hasPrev || isLeaving)) {
7542 // console.log('entering', key)
7543 children[key] = (0, React__default.cloneElement)(child, {
7544 onExited: onExited.bind(null, child),
7545 in: true,
7546 exit: getProp(child, 'exit', nextProps),
7547 enter: getProp(child, 'enter', nextProps)
7548 });
7549 } else if (!hasNext && hasPrev && !isLeaving) {
7550 // item is old (exiting)
7551 // console.log('leaving', key)
7552 children[key] = (0, React__default.cloneElement)(child, {
7553 in: false
7554 });
7555 } else if (hasNext && hasPrev && (0, React__default.isValidElement)(prevChild)) {
7556 // item hasn't changed transition states
7557 // copy over the last transition props;
7558 // console.log('unchanged', key)
7559 children[key] = (0, React__default.cloneElement)(child, {
7560 onExited: onExited.bind(null, child),
7561 in: prevChild.props.in,
7562 exit: getProp(child, 'exit', nextProps),
7563 enter: getProp(child, 'enter', nextProps)
7564 });
7565 }
7566 });
7567 return children;
7568 }
7569 });
7570 unwrapExports(ChildMapping);
7571 var ChildMapping_1 = ChildMapping.getChildMapping;
7572 var ChildMapping_2 = ChildMapping.mergeChildMappings;
7573 var ChildMapping_3 = ChildMapping.getInitialChildMapping;
7574 var ChildMapping_4 = ChildMapping.getNextChildMapping;
7575
7576 var TransitionGroup_1 = createCommonjsModule(function (module, exports) {
7577
7578 exports.__esModule = true;
7579 exports.default = void 0;
7580
7581 var _propTypes = _interopRequireDefault(propTypes);
7582
7583 var _react = _interopRequireDefault(React__default);
7584
7585 function _interopRequireDefault(obj) {
7586 return obj && obj.__esModule ? obj : {
7587 default: obj
7588 };
7589 }
7590
7591 function _objectWithoutPropertiesLoose(source, excluded) {
7592 if (source == null) return {};
7593 var target = {};
7594 var sourceKeys = Object.keys(source);
7595 var key, i;
7596
7597 for (i = 0; i < sourceKeys.length; i++) {
7598 key = sourceKeys[i];
7599 if (excluded.indexOf(key) >= 0) continue;
7600 target[key] = source[key];
7601 }
7602
7603 return target;
7604 }
7605
7606 function _extends() {
7607 _extends = Object.assign || function (target) {
7608 for (var i = 1; i < arguments.length; i++) {
7609 var source = arguments[i];
7610
7611 for (var key in source) {
7612 if (Object.prototype.hasOwnProperty.call(source, key)) {
7613 target[key] = source[key];
7614 }
7615 }
7616 }
7617
7618 return target;
7619 };
7620
7621 return _extends.apply(this, arguments);
7622 }
7623
7624 function _inheritsLoose(subClass, superClass) {
7625 subClass.prototype = Object.create(superClass.prototype);
7626 subClass.prototype.constructor = subClass;
7627 subClass.__proto__ = superClass;
7628 }
7629
7630 function _assertThisInitialized(self) {
7631 if (self === void 0) {
7632 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7633 }
7634
7635 return self;
7636 }
7637
7638 var values = Object.values || function (obj) {
7639 return Object.keys(obj).map(function (k) {
7640 return obj[k];
7641 });
7642 };
7643
7644 var defaultProps = {
7645 component: 'div',
7646 childFactory: function childFactory(child) {
7647 return child;
7648 }
7649 /**
7650 * The `<TransitionGroup>` component manages a set of transition components
7651 * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
7652 * components, `<TransitionGroup>` is a state machine for managing the mounting
7653 * and unmounting of components over time.
7654 *
7655 * Consider the example below. As items are removed or added to the TodoList the
7656 * `in` prop is toggled automatically by the `<TransitionGroup>`.
7657 *
7658 * Note that `<TransitionGroup>` does not define any animation behavior!
7659 * Exactly _how_ a list item animates is up to the individual transition
7660 * component. This means you can mix and match animations across different list
7661 * items.
7662 */
7663
7664 };
7665
7666 var TransitionGroup = /*#__PURE__*/function (_React$Component) {
7667 _inheritsLoose(TransitionGroup, _React$Component);
7668
7669 function TransitionGroup(props, context) {
7670 var _this;
7671
7672 _this = _React$Component.call(this, props, context) || this;
7673
7674 var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear
7675
7676
7677 _this.state = {
7678 handleExited: handleExited,
7679 firstRender: true
7680 };
7681 return _this;
7682 }
7683
7684 var _proto = TransitionGroup.prototype;
7685
7686 _proto.getChildContext = function getChildContext() {
7687 return {
7688 transitionGroup: {
7689 isMounting: !this.appeared
7690 }
7691 };
7692 };
7693
7694 _proto.componentDidMount = function componentDidMount() {
7695 this.appeared = true;
7696 this.mounted = true;
7697 };
7698
7699 _proto.componentWillUnmount = function componentWillUnmount() {
7700 this.mounted = false;
7701 };
7702
7703 TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
7704 var prevChildMapping = _ref.children,
7705 handleExited = _ref.handleExited,
7706 firstRender = _ref.firstRender;
7707 return {
7708 children: firstRender ? (0, ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
7709 firstRender: false
7710 };
7711 };
7712
7713 _proto.handleExited = function handleExited(child, node) {
7714 var currentChildMapping = (0, ChildMapping.getChildMapping)(this.props.children);
7715 if (child.key in currentChildMapping) return;
7716
7717 if (child.props.onExited) {
7718 child.props.onExited(node);
7719 }
7720
7721 if (this.mounted) {
7722 this.setState(function (state) {
7723 var children = _extends({}, state.children);
7724
7725 delete children[child.key];
7726 return {
7727 children: children
7728 };
7729 });
7730 }
7731 };
7732
7733 _proto.render = function render() {
7734 var _this$props = this.props,
7735 Component = _this$props.component,
7736 childFactory = _this$props.childFactory,
7737 props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
7738
7739 var children = values(this.state.children).map(childFactory);
7740 delete props.appear;
7741 delete props.enter;
7742 delete props.exit;
7743
7744 if (Component === null) {
7745 return children;
7746 }
7747
7748 return _react.default.createElement(Component, props, children);
7749 };
7750
7751 return TransitionGroup;
7752 }(_react.default.Component);
7753
7754 TransitionGroup.childContextTypes = {
7755 transitionGroup: _propTypes.default.object.isRequired
7756 };
7757 TransitionGroup.propTypes = {};
7758 TransitionGroup.defaultProps = defaultProps;
7759
7760 var _default = (0, reactLifecyclesCompat_es.polyfill)(TransitionGroup);
7761
7762 exports.default = _default;
7763 module.exports = exports["default"];
7764 });
7765 unwrapExports(TransitionGroup_1);
7766
7767 var ReplaceTransition_1 = createCommonjsModule(function (module, exports) {
7768
7769 exports.__esModule = true;
7770 exports.default = void 0;
7771
7772 var _propTypes = _interopRequireDefault(propTypes);
7773
7774 var _react = _interopRequireDefault(React__default);
7775
7776 var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
7777
7778 function _interopRequireDefault(obj) {
7779 return obj && obj.__esModule ? obj : {
7780 default: obj
7781 };
7782 }
7783
7784 function _objectWithoutPropertiesLoose(source, excluded) {
7785 if (source == null) return {};
7786 var target = {};
7787 var sourceKeys = Object.keys(source);
7788 var key, i;
7789
7790 for (i = 0; i < sourceKeys.length; i++) {
7791 key = sourceKeys[i];
7792 if (excluded.indexOf(key) >= 0) continue;
7793 target[key] = source[key];
7794 }
7795
7796 return target;
7797 }
7798
7799 function _inheritsLoose(subClass, superClass) {
7800 subClass.prototype = Object.create(superClass.prototype);
7801 subClass.prototype.constructor = subClass;
7802 subClass.__proto__ = superClass;
7803 }
7804 /**
7805 * The `<ReplaceTransition>` component is a specialized `Transition` component
7806 * that animates between two children.
7807 *
7808 * ```jsx
7809 * <ReplaceTransition in>
7810 * <Fade><div>I appear first</div></Fade>
7811 * <Fade><div>I replace the above</div></Fade>
7812 * </ReplaceTransition>
7813 * ```
7814 */
7815
7816
7817 var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
7818 _inheritsLoose(ReplaceTransition, _React$Component);
7819
7820 function ReplaceTransition() {
7821 var _this;
7822
7823 for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
7824 _args[_key] = arguments[_key];
7825 }
7826
7827 _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
7828
7829 _this.handleEnter = function () {
7830 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
7831 args[_key2] = arguments[_key2];
7832 }
7833
7834 return _this.handleLifecycle('onEnter', 0, args);
7835 };
7836
7837 _this.handleEntering = function () {
7838 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
7839 args[_key3] = arguments[_key3];
7840 }
7841
7842 return _this.handleLifecycle('onEntering', 0, args);
7843 };
7844
7845 _this.handleEntered = function () {
7846 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
7847 args[_key4] = arguments[_key4];
7848 }
7849
7850 return _this.handleLifecycle('onEntered', 0, args);
7851 };
7852
7853 _this.handleExit = function () {
7854 for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
7855 args[_key5] = arguments[_key5];
7856 }
7857
7858 return _this.handleLifecycle('onExit', 1, args);
7859 };
7860
7861 _this.handleExiting = function () {
7862 for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
7863 args[_key6] = arguments[_key6];
7864 }
7865
7866 return _this.handleLifecycle('onExiting', 1, args);
7867 };
7868
7869 _this.handleExited = function () {
7870 for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
7871 args[_key7] = arguments[_key7];
7872 }
7873
7874 return _this.handleLifecycle('onExited', 1, args);
7875 };
7876
7877 return _this;
7878 }
7879
7880 var _proto = ReplaceTransition.prototype;
7881
7882 _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
7883 var _child$props;
7884
7885 var children = this.props.children;
7886
7887 var child = _react.default.Children.toArray(children)[idx];
7888
7889 if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
7890 if (this.props[handler]) this.props[handler]((0, ReactDOM.findDOMNode)(this));
7891 };
7892
7893 _proto.render = function render() {
7894 var _this$props = this.props,
7895 children = _this$props.children,
7896 inProp = _this$props.in,
7897 props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
7898
7899 var _React$Children$toArr = _react.default.Children.toArray(children),
7900 first = _React$Children$toArr[0],
7901 second = _React$Children$toArr[1];
7902
7903 delete props.onEnter;
7904 delete props.onEntering;
7905 delete props.onEntered;
7906 delete props.onExit;
7907 delete props.onExiting;
7908 delete props.onExited;
7909 return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
7910 key: 'first',
7911 onEnter: this.handleEnter,
7912 onEntering: this.handleEntering,
7913 onEntered: this.handleEntered
7914 }) : _react.default.cloneElement(second, {
7915 key: 'second',
7916 onEnter: this.handleExit,
7917 onEntering: this.handleExiting,
7918 onEntered: this.handleExited
7919 }));
7920 };
7921
7922 return ReplaceTransition;
7923 }(_react.default.Component);
7924
7925 ReplaceTransition.propTypes = {};
7926 var _default = ReplaceTransition;
7927 exports.default = _default;
7928 module.exports = exports["default"];
7929 });
7930 unwrapExports(ReplaceTransition_1);
7931
7932 var reactTransitionGroup = createCommonjsModule(function (module) {
7933
7934 var _CSSTransition = _interopRequireDefault(CSSTransition_1);
7935
7936 var _ReplaceTransition = _interopRequireDefault(ReplaceTransition_1);
7937
7938 var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
7939
7940 var _Transition = _interopRequireDefault(Transition_1);
7941
7942 function _interopRequireDefault(obj) {
7943 return obj && obj.__esModule ? obj : {
7944 default: obj
7945 };
7946 }
7947
7948 module.exports = {
7949 Transition: _Transition.default,
7950 TransitionGroup: _TransitionGroup.default,
7951 ReplaceTransition: _ReplaceTransition.default,
7952 CSSTransition: _CSSTransition.default
7953 };
7954 });
7955 unwrapExports(reactTransitionGroup);
7956 var reactTransitionGroup_1 = reactTransitionGroup.Transition;
7957 var reactTransitionGroup_2 = reactTransitionGroup.TransitionGroup;
7958 var reactTransitionGroup_3 = reactTransitionGroup.ReplaceTransition;
7959 var reactTransitionGroup_4 = reactTransitionGroup.CSSTransition;
7960
7961 var propTypes$m = _extends({}, reactTransitionGroup_1.propTypes, {
7962 children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
7963 tag: tagPropType,
7964 baseClass: propTypes.string,
7965 baseClassActive: propTypes.string,
7966 className: propTypes.string,
7967 cssModule: propTypes.object,
7968 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
7969 });
7970
7971 var defaultProps$k = _extends({}, reactTransitionGroup_1.defaultProps, {
7972 tag: 'div',
7973 baseClass: 'fade',
7974 baseClassActive: 'show',
7975 timeout: TransitionTimeouts.Fade,
7976 appear: true,
7977 enter: true,
7978 exit: true,
7979 in: true
7980 });
7981
7982 function Fade(props) {
7983 var Tag = props.tag,
7984 baseClass = props.baseClass,
7985 baseClassActive = props.baseClassActive,
7986 className = props.className,
7987 cssModule = props.cssModule,
7988 children = props.children,
7989 innerRef = props.innerRef,
7990 otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
7991
7992 var transitionProps = pick(otherProps, TransitionPropTypeKeys);
7993 var childProps = omit(otherProps, TransitionPropTypeKeys);
7994 return /*#__PURE__*/React__default.createElement(reactTransitionGroup_1, transitionProps, function (status) {
7995 var isActive = status === 'entered';
7996 var classes = mapToCssModules(classnames(className, baseClass, isActive && baseClassActive), cssModule);
7997 return /*#__PURE__*/React__default.createElement(Tag, _extends({
7998 className: classes
7999 }, childProps, {
8000 ref: innerRef
8001 }), children);
8002 });
8003 }
8004
8005 Fade.propTypes = propTypes$m;
8006 Fade.defaultProps = defaultProps$k;
8007
8008 var propTypes$n = {
8009 color: propTypes.string,
8010 pill: propTypes.bool,
8011 tag: tagPropType,
8012 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
8013 children: propTypes.node,
8014 className: propTypes.string,
8015 cssModule: propTypes.object
8016 };
8017 var defaultProps$l = {
8018 color: 'secondary',
8019 pill: false,
8020 tag: 'span'
8021 };
8022
8023 var Badge = function Badge(props) {
8024 var className = props.className,
8025 cssModule = props.cssModule,
8026 color = props.color,
8027 innerRef = props.innerRef,
8028 pill = props.pill,
8029 Tag = props.tag,
8030 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
8031
8032 var classes = mapToCssModules(classnames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
8033
8034 if (attributes.href && Tag === 'span') {
8035 Tag = 'a';
8036 }
8037
8038 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8039 className: classes,
8040 ref: innerRef
8041 }));
8042 };
8043
8044 Badge.propTypes = propTypes$n;
8045 Badge.defaultProps = defaultProps$l;
8046
8047 var propTypes$o = {
8048 tag: tagPropType,
8049 inverse: propTypes.bool,
8050 color: propTypes.string,
8051 body: propTypes.bool,
8052 outline: propTypes.bool,
8053 className: propTypes.string,
8054 cssModule: propTypes.object,
8055 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
8056 };
8057 var defaultProps$m = {
8058 tag: 'div'
8059 };
8060
8061 var Card = function Card(props) {
8062 var className = props.className,
8063 cssModule = props.cssModule,
8064 color = props.color,
8065 body = props.body,
8066 inverse = props.inverse,
8067 outline = props.outline,
8068 Tag = props.tag,
8069 innerRef = props.innerRef,
8070 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "body", "inverse", "outline", "tag", "innerRef"]);
8071
8072 var classes = mapToCssModules(classnames(className, 'card', inverse ? 'text-white' : false, body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
8073 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8074 className: classes,
8075 ref: innerRef
8076 }));
8077 };
8078
8079 Card.propTypes = propTypes$o;
8080 Card.defaultProps = defaultProps$m;
8081
8082 var propTypes$p = {
8083 tag: tagPropType,
8084 className: propTypes.string,
8085 cssModule: propTypes.object
8086 };
8087 var defaultProps$n = {
8088 tag: 'div'
8089 };
8090
8091 var CardGroup = function CardGroup(props) {
8092 var className = props.className,
8093 cssModule = props.cssModule,
8094 Tag = props.tag,
8095 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8096
8097 var classes = mapToCssModules(classnames(className, 'card-group'), cssModule);
8098 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8099 className: classes
8100 }));
8101 };
8102
8103 CardGroup.propTypes = propTypes$p;
8104 CardGroup.defaultProps = defaultProps$n;
8105
8106 var propTypes$q = {
8107 tag: tagPropType,
8108 className: propTypes.string,
8109 cssModule: propTypes.object
8110 };
8111 var defaultProps$o = {
8112 tag: 'div'
8113 };
8114
8115 var CardDeck = function CardDeck(props) {
8116 var className = props.className,
8117 cssModule = props.cssModule,
8118 Tag = props.tag,
8119 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8120
8121 var classes = mapToCssModules(classnames(className, 'card-deck'), cssModule);
8122 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8123 className: classes
8124 }));
8125 };
8126
8127 CardDeck.propTypes = propTypes$q;
8128 CardDeck.defaultProps = defaultProps$o;
8129
8130 var propTypes$r = {
8131 tag: tagPropType,
8132 className: propTypes.string,
8133 cssModule: propTypes.object
8134 };
8135 var defaultProps$p = {
8136 tag: 'div'
8137 };
8138
8139 var CardColumns = function CardColumns(props) {
8140 var className = props.className,
8141 cssModule = props.cssModule,
8142 Tag = props.tag,
8143 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8144
8145 var classes = mapToCssModules(classnames(className, 'card-columns'), cssModule);
8146 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8147 className: classes
8148 }));
8149 };
8150
8151 CardColumns.propTypes = propTypes$r;
8152 CardColumns.defaultProps = defaultProps$p;
8153
8154 var propTypes$s = {
8155 tag: tagPropType,
8156 className: propTypes.string,
8157 cssModule: propTypes.object,
8158 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
8159 };
8160 var defaultProps$q = {
8161 tag: 'div'
8162 };
8163
8164 var CardBody = function CardBody(props) {
8165 var className = props.className,
8166 cssModule = props.cssModule,
8167 innerRef = props.innerRef,
8168 Tag = props.tag,
8169 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
8170
8171 var classes = mapToCssModules(classnames(className, 'card-body'), cssModule);
8172 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8173 className: classes,
8174 ref: innerRef
8175 }));
8176 };
8177
8178 CardBody.propTypes = propTypes$s;
8179 CardBody.defaultProps = defaultProps$q;
8180
8181 var propTypes$t = {
8182 tag: tagPropType,
8183 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
8184 className: propTypes.string,
8185 cssModule: propTypes.object
8186 };
8187 var defaultProps$r = {
8188 tag: 'a'
8189 };
8190
8191 var CardLink = function CardLink(props) {
8192 var className = props.className,
8193 cssModule = props.cssModule,
8194 Tag = props.tag,
8195 innerRef = props.innerRef,
8196 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
8197
8198 var classes = mapToCssModules(classnames(className, 'card-link'), cssModule);
8199 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8200 ref: innerRef,
8201 className: classes
8202 }));
8203 };
8204
8205 CardLink.propTypes = propTypes$t;
8206 CardLink.defaultProps = defaultProps$r;
8207
8208 var propTypes$u = {
8209 tag: tagPropType,
8210 className: propTypes.string,
8211 cssModule: propTypes.object
8212 };
8213 var defaultProps$s = {
8214 tag: 'div'
8215 };
8216
8217 var CardFooter = function CardFooter(props) {
8218 var className = props.className,
8219 cssModule = props.cssModule,
8220 Tag = props.tag,
8221 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8222
8223 var classes = mapToCssModules(classnames(className, 'card-footer'), cssModule);
8224 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8225 className: classes
8226 }));
8227 };
8228
8229 CardFooter.propTypes = propTypes$u;
8230 CardFooter.defaultProps = defaultProps$s;
8231
8232 var propTypes$v = {
8233 tag: tagPropType,
8234 className: propTypes.string,
8235 cssModule: propTypes.object
8236 };
8237 var defaultProps$t = {
8238 tag: 'div'
8239 };
8240
8241 var CardHeader = function CardHeader(props) {
8242 var className = props.className,
8243 cssModule = props.cssModule,
8244 Tag = props.tag,
8245 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8246
8247 var classes = mapToCssModules(classnames(className, 'card-header'), cssModule);
8248 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8249 className: classes
8250 }));
8251 };
8252
8253 CardHeader.propTypes = propTypes$v;
8254 CardHeader.defaultProps = defaultProps$t;
8255
8256 var propTypes$w = {
8257 tag: tagPropType,
8258 top: propTypes.bool,
8259 bottom: propTypes.bool,
8260 className: propTypes.string,
8261 cssModule: propTypes.object
8262 };
8263 var defaultProps$u = {
8264 tag: 'img'
8265 };
8266
8267 var CardImg = function CardImg(props) {
8268 var className = props.className,
8269 cssModule = props.cssModule,
8270 top = props.top,
8271 bottom = props.bottom,
8272 Tag = props.tag,
8273 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
8274
8275 var cardImgClassName = 'card-img';
8276
8277 if (top) {
8278 cardImgClassName = 'card-img-top';
8279 }
8280
8281 if (bottom) {
8282 cardImgClassName = 'card-img-bottom';
8283 }
8284
8285 var classes = mapToCssModules(classnames(className, cardImgClassName), cssModule);
8286 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8287 className: classes
8288 }));
8289 };
8290
8291 CardImg.propTypes = propTypes$w;
8292 CardImg.defaultProps = defaultProps$u;
8293
8294 var propTypes$x = {
8295 tag: tagPropType,
8296 className: propTypes.string,
8297 cssModule: propTypes.object
8298 };
8299 var defaultProps$v = {
8300 tag: 'div'
8301 };
8302
8303 var CardImgOverlay = function CardImgOverlay(props) {
8304 var className = props.className,
8305 cssModule = props.cssModule,
8306 Tag = props.tag,
8307 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8308
8309 var classes = mapToCssModules(classnames(className, 'card-img-overlay'), cssModule);
8310 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8311 className: classes
8312 }));
8313 };
8314
8315 CardImgOverlay.propTypes = propTypes$x;
8316 CardImgOverlay.defaultProps = defaultProps$v;
8317
8318 var CarouselItem = /*#__PURE__*/function (_React$Component) {
8319 _inheritsLoose(CarouselItem, _React$Component);
8320
8321 function CarouselItem(props) {
8322 var _this;
8323
8324 _this = _React$Component.call(this, props) || this;
8325 _this.state = {
8326 startAnimation: false
8327 };
8328 _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this));
8329 _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this));
8330 _this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
8331 _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
8332 _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
8333 return _this;
8334 }
8335
8336 var _proto = CarouselItem.prototype;
8337
8338 _proto.onEnter = function onEnter(node, isAppearing) {
8339 this.setState({
8340 startAnimation: false
8341 });
8342 this.props.onEnter(node, isAppearing);
8343 };
8344
8345 _proto.onEntering = function onEntering(node, isAppearing) {
8346 // getting this variable triggers a reflow
8347 var offsetHeight = node.offsetHeight;
8348 this.setState({
8349 startAnimation: true
8350 });
8351 this.props.onEntering(node, isAppearing);
8352 return offsetHeight;
8353 };
8354
8355 _proto.onExit = function onExit(node) {
8356 this.setState({
8357 startAnimation: false
8358 });
8359 this.props.onExit(node);
8360 };
8361
8362 _proto.onExiting = function onExiting(node) {
8363 this.setState({
8364 startAnimation: true
8365 });
8366 node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
8367 this.props.onExiting(node);
8368 };
8369
8370 _proto.onExited = function onExited(node) {
8371 node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
8372 this.props.onExited(node);
8373 };
8374
8375 _proto.render = function render() {
8376 var _this2 = this;
8377
8378 var _this$props = this.props,
8379 isIn = _this$props.in,
8380 children = _this$props.children,
8381 cssModule = _this$props.cssModule,
8382 slide = _this$props.slide,
8383 Tag = _this$props.tag,
8384 className = _this$props.className,
8385 transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
8386
8387 return /*#__PURE__*/React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
8388 enter: slide,
8389 exit: slide,
8390 in: isIn,
8391 onEnter: this.onEnter,
8392 onEntering: this.onEntering,
8393 onExit: this.onExit,
8394 onExiting: this.onExiting,
8395 onExited: this.onExited
8396 }), function (status) {
8397 var direction = _this2.context.direction;
8398 var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
8399 var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
8400 var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
8401 var itemClasses = mapToCssModules(classnames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
8402 return /*#__PURE__*/React__default.createElement(Tag, {
8403 className: itemClasses
8404 }, children);
8405 });
8406 };
8407
8408 return CarouselItem;
8409 }(React__default.Component);
8410
8411 CarouselItem.propTypes = _extends({}, reactTransitionGroup_1.propTypes, {
8412 tag: tagPropType,
8413 in: propTypes.bool,
8414 cssModule: propTypes.object,
8415 children: propTypes.node,
8416 slide: propTypes.bool,
8417 className: propTypes.string
8418 });
8419 CarouselItem.defaultProps = _extends({}, reactTransitionGroup_1.defaultProps, {
8420 tag: 'div',
8421 timeout: TransitionTimeouts.Carousel,
8422 slide: true
8423 });
8424 CarouselItem.contextTypes = {
8425 direction: propTypes.string
8426 };
8427
8428 var SWIPE_THRESHOLD = 40;
8429
8430 var Carousel = /*#__PURE__*/function (_React$Component) {
8431 _inheritsLoose(Carousel, _React$Component);
8432
8433 function Carousel(props) {
8434 var _this;
8435
8436 _this = _React$Component.call(this, props) || this;
8437 _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
8438 _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_this));
8439 _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_this));
8440 _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_this));
8441 _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_this));
8442 _this.handleTouchEnd = _this.handleTouchEnd.bind(_assertThisInitialized(_this));
8443 _this.touchStartX = 0;
8444 _this.touchStartY = 0;
8445 _this.state = {
8446 activeIndex: _this.props.activeIndex,
8447 direction: 'right',
8448 indicatorClicked: false
8449 };
8450 return _this;
8451 }
8452
8453 var _proto = Carousel.prototype;
8454
8455 _proto.getChildContext = function getChildContext() {
8456 return {
8457 direction: this.state.direction
8458 };
8459 };
8460
8461 _proto.componentDidMount = function componentDidMount() {
8462 // Set up the cycle
8463 if (this.props.ride === 'carousel') {
8464 this.setInterval();
8465 } // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page.
8466
8467
8468 document.addEventListener('keyup', this.handleKeyPress);
8469 };
8470
8471 Carousel.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
8472 var newState = null;
8473 var activeIndex = prevState.activeIndex,
8474 direction = prevState.direction,
8475 indicatorClicked = prevState.indicatorClicked;
8476
8477 if (nextProps.activeIndex !== activeIndex) {
8478 // Calculate the direction to turn
8479 if (nextProps.activeIndex === activeIndex + 1) {
8480 direction = 'right';
8481 } else if (nextProps.activeIndex === activeIndex - 1) {
8482 direction = 'left';
8483 } else if (nextProps.activeIndex < activeIndex) {
8484 direction = indicatorClicked ? 'left' : 'right';
8485 } else if (nextProps.activeIndex !== activeIndex) {
8486 direction = indicatorClicked ? 'right' : 'left';
8487 }
8488
8489 newState = {
8490 activeIndex: nextProps.activeIndex,
8491 direction: direction,
8492 indicatorClicked: false
8493 };
8494 }
8495
8496 return newState;
8497 };
8498
8499 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
8500 if (prevState.activeIndex === this.state.activeIndex) return;
8501 this.setInterval(this.props);
8502 };
8503
8504 _proto.componentWillUnmount = function componentWillUnmount() {
8505 this.clearInterval();
8506 document.removeEventListener('keyup', this.handleKeyPress);
8507 };
8508
8509 _proto.setInterval = function (_setInterval) {
8510 function setInterval() {
8511 return _setInterval.apply(this, arguments);
8512 }
8513
8514 setInterval.toString = function () {
8515 return _setInterval.toString();
8516 };
8517
8518 return setInterval;
8519 }(function (props) {
8520 if (props === void 0) {
8521 props = this.props;
8522 }
8523
8524 // make sure not to have multiple intervals going...
8525 this.clearInterval();
8526
8527 if (props.interval) {
8528 this.cycleInterval = setInterval(function () {
8529 props.next();
8530 }, parseInt(props.interval, 10));
8531 }
8532 });
8533
8534 _proto.clearInterval = function (_clearInterval) {
8535 function clearInterval() {
8536 return _clearInterval.apply(this, arguments);
8537 }
8538
8539 clearInterval.toString = function () {
8540 return _clearInterval.toString();
8541 };
8542
8543 return clearInterval;
8544 }(function () {
8545 clearInterval(this.cycleInterval);
8546 });
8547
8548 _proto.hoverStart = function hoverStart() {
8549 if (this.props.pause === 'hover') {
8550 this.clearInterval();
8551 }
8552
8553 if (this.props.mouseEnter) {
8554 var _this$props;
8555
8556 (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
8557 }
8558 };
8559
8560 _proto.hoverEnd = function hoverEnd() {
8561 if (this.props.pause === 'hover') {
8562 this.setInterval();
8563 }
8564
8565 if (this.props.mouseLeave) {
8566 var _this$props2;
8567
8568 (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
8569 }
8570 };
8571
8572 _proto.handleKeyPress = function handleKeyPress(evt) {
8573 if (this.props.keyboard) {
8574 if (evt.keyCode === 37) {
8575 this.props.previous();
8576 } else if (evt.keyCode === 39) {
8577 this.props.next();
8578 }
8579 }
8580 };
8581
8582 _proto.handleTouchStart = function handleTouchStart(e) {
8583 if (!this.props.enableTouch) {
8584 return;
8585 }
8586
8587 this.touchStartX = e.changedTouches[0].screenX;
8588 this.touchStartY = e.changedTouches[0].screenY;
8589 };
8590
8591 _proto.handleTouchEnd = function handleTouchEnd(e) {
8592 if (!this.props.enableTouch) {
8593 return;
8594 }
8595
8596 var currentX = e.changedTouches[0].screenX;
8597 var currentY = e.changedTouches[0].screenY;
8598 var diffX = Math.abs(this.touchStartX - currentX);
8599 var diffY = Math.abs(this.touchStartY - currentY); // Don't swipe if Y-movement is bigger than X-movement
8600
8601 if (diffX < diffY) {
8602 return;
8603 }
8604
8605 if (diffX < SWIPE_THRESHOLD) {
8606 return;
8607 }
8608
8609 if (currentX < this.touchStartX) {
8610 this.props.next();
8611 } else {
8612 this.props.previous();
8613 }
8614 };
8615
8616 _proto.renderItems = function renderItems(carouselItems, className) {
8617 var _this2 = this;
8618
8619 var slide = this.props.slide;
8620 return /*#__PURE__*/React__default.createElement("div", {
8621 className: className
8622 }, carouselItems.map(function (item, index) {
8623 var isIn = index === _this2.state.activeIndex;
8624 return /*#__PURE__*/React__default.cloneElement(item, {
8625 in: isIn,
8626 slide: slide
8627 });
8628 }));
8629 };
8630
8631 _proto.render = function render() {
8632 var _this3 = this;
8633
8634 var _this$props3 = this.props,
8635 cssModule = _this$props3.cssModule,
8636 slide = _this$props3.slide,
8637 className = _this$props3.className;
8638 var outerClasses = mapToCssModules(classnames(className, 'carousel', slide && 'slide'), cssModule);
8639 var innerClasses = mapToCssModules(classnames('carousel-inner'), cssModule); // filter out booleans, null, or undefined
8640
8641 var children = this.props.children.filter(function (child) {
8642 return child !== null && child !== undefined && typeof child !== 'boolean';
8643 });
8644 var slidesOnly = children.every(function (child) {
8645 return child.type === CarouselItem;
8646 }); // Rendering only slides
8647
8648 if (slidesOnly) {
8649 return /*#__PURE__*/React__default.createElement("div", {
8650 className: outerClasses,
8651 onMouseEnter: this.hoverStart,
8652 onMouseLeave: this.hoverEnd
8653 }, this.renderItems(children, innerClasses));
8654 } // Rendering slides and controls
8655
8656
8657 if (children[0] instanceof Array) {
8658 var _carouselItems = children[0];
8659 var _controlLeft = children[1];
8660 var _controlRight = children[2];
8661 return /*#__PURE__*/React__default.createElement("div", {
8662 className: outerClasses,
8663 onMouseEnter: this.hoverStart,
8664 onMouseLeave: this.hoverEnd
8665 }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
8666 } // Rendering indicators, slides and controls
8667
8668
8669 var indicators = children[0];
8670
8671 var wrappedOnClick = function wrappedOnClick(e) {
8672 if (typeof indicators.props.onClickHandler === 'function') {
8673 _this3.setState({
8674 indicatorClicked: true
8675 }, function () {
8676 return indicators.props.onClickHandler(e);
8677 });
8678 }
8679 };
8680
8681 var wrappedIndicators = /*#__PURE__*/React__default.cloneElement(indicators, {
8682 onClickHandler: wrappedOnClick
8683 });
8684 var carouselItems = children[1];
8685 var controlLeft = children[2];
8686 var controlRight = children[3];
8687 return /*#__PURE__*/React__default.createElement("div", {
8688 className: outerClasses,
8689 onMouseEnter: this.hoverStart,
8690 onMouseLeave: this.hoverEnd,
8691 onTouchStart: this.handleTouchStart,
8692 onTouchEnd: this.handleTouchEnd
8693 }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
8694 };
8695
8696 return Carousel;
8697 }(React__default.Component);
8698
8699 Carousel.propTypes = {
8700 // the current active slide of the carousel
8701 activeIndex: propTypes.number,
8702 // a function which should advance the carousel to the next slide (via activeIndex)
8703 next: propTypes.func.isRequired,
8704 // a function which should advance the carousel to the previous slide (via activeIndex)
8705 previous: propTypes.func.isRequired,
8706 // controls if the left and right arrow keys should control the carousel
8707 keyboard: propTypes.bool,
8708
8709 /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
8710 * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
8711 */
8712 pause: propTypes.oneOf(['hover', false]),
8713 // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
8714 // This is how bootstrap defines it... I would prefer a bool named autoplay or something...
8715 ride: propTypes.oneOf(['carousel']),
8716 // the interval at which the carousel automatically cycles (default: 5000)
8717 // eslint-disable-next-line react/no-unused-prop-types
8718 interval: propTypes.oneOfType([propTypes.number, propTypes.string, propTypes.bool]),
8719 children: propTypes.array,
8720 // called when the mouse enters the Carousel
8721 mouseEnter: propTypes.func,
8722 // called when the mouse exits the Carousel
8723 mouseLeave: propTypes.func,
8724 // controls whether the slide animation on the Carousel works or not
8725 slide: propTypes.bool,
8726 cssModule: propTypes.object,
8727 className: propTypes.string,
8728 enableTouch: propTypes.bool
8729 };
8730 Carousel.defaultProps = {
8731 interval: 5000,
8732 pause: 'hover',
8733 keyboard: true,
8734 slide: true,
8735 enableTouch: true
8736 };
8737 Carousel.childContextTypes = {
8738 direction: propTypes.string
8739 };
8740
8741 var CarouselControl = function CarouselControl(props) {
8742 var direction = props.direction,
8743 onClickHandler = props.onClickHandler,
8744 cssModule = props.cssModule,
8745 directionText = props.directionText,
8746 className = props.className;
8747 var anchorClasses = mapToCssModules(classnames(className, "carousel-control-" + direction), cssModule);
8748 var iconClasses = mapToCssModules(classnames("carousel-control-" + direction + "-icon"), cssModule);
8749 var screenReaderClasses = mapToCssModules(classnames('sr-only'), cssModule);
8750 return /*#__PURE__*/React__default.createElement("a", {
8751 className: anchorClasses,
8752 style: {
8753 cursor: "pointer"
8754 },
8755 role: "button",
8756 tabIndex: "0",
8757 onClick: function onClick(e) {
8758 e.preventDefault();
8759 onClickHandler();
8760 }
8761 }, /*#__PURE__*/React__default.createElement("span", {
8762 className: iconClasses,
8763 "aria-hidden": "true"
8764 }), /*#__PURE__*/React__default.createElement("span", {
8765 className: screenReaderClasses
8766 }, directionText || direction));
8767 };
8768
8769 CarouselControl.propTypes = {
8770 direction: propTypes.oneOf(['prev', 'next']).isRequired,
8771 onClickHandler: propTypes.func.isRequired,
8772 cssModule: propTypes.object,
8773 directionText: propTypes.string,
8774 className: propTypes.string
8775 };
8776
8777 var CarouselIndicators = function CarouselIndicators(props) {
8778 var items = props.items,
8779 activeIndex = props.activeIndex,
8780 cssModule = props.cssModule,
8781 onClickHandler = props.onClickHandler,
8782 className = props.className;
8783 var listClasses = mapToCssModules(classnames(className, 'carousel-indicators'), cssModule);
8784 var indicators = items.map(function (item, idx) {
8785 var indicatorClasses = mapToCssModules(classnames({
8786 active: activeIndex === idx
8787 }), cssModule);
8788 return /*#__PURE__*/React__default.createElement("li", {
8789 key: "" + (item.key || Object.values(item).join('')),
8790 onClick: function onClick(e) {
8791 e.preventDefault();
8792 onClickHandler(idx);
8793 },
8794 className: indicatorClasses
8795 });
8796 });
8797 return /*#__PURE__*/React__default.createElement("ol", {
8798 className: listClasses
8799 }, indicators);
8800 };
8801
8802 CarouselIndicators.propTypes = {
8803 items: propTypes.array.isRequired,
8804 activeIndex: propTypes.number.isRequired,
8805 cssModule: propTypes.object,
8806 onClickHandler: propTypes.func.isRequired,
8807 className: propTypes.string
8808 };
8809
8810 var CarouselCaption = function CarouselCaption(props) {
8811 var captionHeader = props.captionHeader,
8812 captionText = props.captionText,
8813 cssModule = props.cssModule,
8814 className = props.className;
8815 var classes = mapToCssModules(classnames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
8816 return /*#__PURE__*/React__default.createElement("div", {
8817 className: classes
8818 }, /*#__PURE__*/React__default.createElement("h3", null, captionHeader), /*#__PURE__*/React__default.createElement("p", null, captionText));
8819 };
8820
8821 CarouselCaption.propTypes = {
8822 captionHeader: propTypes.node,
8823 captionText: propTypes.node.isRequired,
8824 cssModule: propTypes.object,
8825 className: propTypes.string
8826 };
8827
8828 var propTypes$y = {
8829 items: propTypes.array.isRequired,
8830 indicators: propTypes.bool,
8831 controls: propTypes.bool,
8832 autoPlay: propTypes.bool,
8833 defaultActiveIndex: propTypes.number,
8834 activeIndex: propTypes.number,
8835 next: propTypes.func,
8836 previous: propTypes.func,
8837 goToIndex: propTypes.func
8838 };
8839
8840 var UncontrolledCarousel = /*#__PURE__*/function (_Component) {
8841 _inheritsLoose(UncontrolledCarousel, _Component);
8842
8843 function UncontrolledCarousel(props) {
8844 var _this;
8845
8846 _this = _Component.call(this, props) || this;
8847 _this.animating = false;
8848 _this.state = {
8849 activeIndex: props.defaultActiveIndex || 0
8850 };
8851 _this.next = _this.next.bind(_assertThisInitialized(_this));
8852 _this.previous = _this.previous.bind(_assertThisInitialized(_this));
8853 _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_this));
8854 _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
8855 _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
8856 return _this;
8857 }
8858
8859 var _proto = UncontrolledCarousel.prototype;
8860
8861 _proto.onExiting = function onExiting() {
8862 this.animating = true;
8863 };
8864
8865 _proto.onExited = function onExited() {
8866 this.animating = false;
8867 };
8868
8869 _proto.next = function next() {
8870 if (this.animating) return;
8871 var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
8872 this.setState({
8873 activeIndex: nextIndex
8874 });
8875 };
8876
8877 _proto.previous = function previous() {
8878 if (this.animating) return;
8879 var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
8880 this.setState({
8881 activeIndex: nextIndex
8882 });
8883 };
8884
8885 _proto.goToIndex = function goToIndex(newIndex) {
8886 if (this.animating) return;
8887 this.setState({
8888 activeIndex: newIndex
8889 });
8890 };
8891
8892 _proto.render = function render() {
8893 var _this2 = this;
8894
8895 var _this$props = this.props,
8896 defaultActiveIndex = _this$props.defaultActiveIndex,
8897 autoPlay = _this$props.autoPlay,
8898 indicators = _this$props.indicators,
8899 controls = _this$props.controls,
8900 items = _this$props.items,
8901 goToIndex = _this$props.goToIndex,
8902 props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
8903
8904 var activeIndex = this.state.activeIndex;
8905 var slides = items.map(function (item) {
8906 var key = item.key || item.src;
8907 return /*#__PURE__*/React__default.createElement(CarouselItem, {
8908 onExiting: _this2.onExiting,
8909 onExited: _this2.onExited,
8910 key: key
8911 }, /*#__PURE__*/React__default.createElement("img", {
8912 className: "d-block w-100",
8913 src: item.src,
8914 alt: item.altText
8915 }), /*#__PURE__*/React__default.createElement(CarouselCaption, {
8916 captionText: item.caption,
8917 captionHeader: item.header || item.caption
8918 }));
8919 });
8920 return /*#__PURE__*/React__default.createElement(Carousel, _extends({
8921 activeIndex: activeIndex,
8922 next: this.next,
8923 previous: this.previous,
8924 ride: autoPlay ? 'carousel' : undefined
8925 }, props), indicators && /*#__PURE__*/React__default.createElement(CarouselIndicators, {
8926 items: items,
8927 activeIndex: props.activeIndex || activeIndex,
8928 onClickHandler: goToIndex || this.goToIndex
8929 }), slides, controls && /*#__PURE__*/React__default.createElement(CarouselControl, {
8930 direction: "prev",
8931 directionText: "Previous",
8932 onClickHandler: props.previous || this.previous
8933 }), controls && /*#__PURE__*/React__default.createElement(CarouselControl, {
8934 direction: "next",
8935 directionText: "Next",
8936 onClickHandler: props.next || this.next
8937 }));
8938 };
8939
8940 return UncontrolledCarousel;
8941 }(React.Component);
8942
8943 UncontrolledCarousel.propTypes = propTypes$y;
8944 UncontrolledCarousel.defaultProps = {
8945 controls: true,
8946 indicators: true,
8947 autoPlay: true
8948 };
8949
8950 var propTypes$z = {
8951 tag: tagPropType,
8952 className: propTypes.string,
8953 cssModule: propTypes.object
8954 };
8955 var defaultProps$w = {
8956 tag: 'div'
8957 };
8958
8959 var CardSubtitle = function CardSubtitle(props) {
8960 var className = props.className,
8961 cssModule = props.cssModule,
8962 Tag = props.tag,
8963 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8964
8965 var classes = mapToCssModules(classnames(className, 'card-subtitle'), cssModule);
8966 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8967 className: classes
8968 }));
8969 };
8970
8971 CardSubtitle.propTypes = propTypes$z;
8972 CardSubtitle.defaultProps = defaultProps$w;
8973
8974 var propTypes$A = {
8975 tag: tagPropType,
8976 className: propTypes.string,
8977 cssModule: propTypes.object
8978 };
8979 var defaultProps$x = {
8980 tag: 'p'
8981 };
8982
8983 var CardText = function CardText(props) {
8984 var className = props.className,
8985 cssModule = props.cssModule,
8986 Tag = props.tag,
8987 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8988
8989 var classes = mapToCssModules(classnames(className, 'card-text'), cssModule);
8990 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
8991 className: classes
8992 }));
8993 };
8994
8995 CardText.propTypes = propTypes$A;
8996 CardText.defaultProps = defaultProps$x;
8997
8998 var propTypes$B = {
8999 tag: tagPropType,
9000 className: propTypes.string,
9001 cssModule: propTypes.object
9002 };
9003 var defaultProps$y = {
9004 tag: 'div'
9005 };
9006
9007 var CardTitle = function CardTitle(props) {
9008 var className = props.className,
9009 cssModule = props.cssModule,
9010 Tag = props.tag,
9011 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9012
9013 var classes = mapToCssModules(classnames(className, 'card-title'), cssModule);
9014 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
9015 className: classes
9016 }));
9017 };
9018
9019 CardTitle.propTypes = propTypes$B;
9020 CardTitle.defaultProps = defaultProps$y;
9021
9022 var propTypes$C = {
9023 className: propTypes.string,
9024 id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
9025 label: propTypes.node,
9026 valid: propTypes.bool,
9027 invalid: propTypes.bool,
9028 bsSize: propTypes.string,
9029 htmlFor: propTypes.string,
9030 cssModule: propTypes.object,
9031 onChange: propTypes.func,
9032 children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
9033 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
9034 };
9035
9036 var CustomFileInput = /*#__PURE__*/function (_React$Component) {
9037 _inheritsLoose(CustomFileInput, _React$Component);
9038
9039 function CustomFileInput(props) {
9040 var _this;
9041
9042 _this = _React$Component.call(this, props) || this;
9043 _this.state = {
9044 files: null
9045 };
9046 _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
9047 return _this;
9048 }
9049
9050 var _proto = CustomFileInput.prototype;
9051
9052 _proto.onChange = function onChange(e) {
9053 var input = e.target;
9054 var onChange = this.props.onChange;
9055 var files = this.getSelectedFiles(input);
9056
9057 if (typeof onChange === "function") {
9058 onChange.apply(void 0, arguments);
9059 }
9060
9061 this.setState({
9062 files: files
9063 });
9064 };
9065
9066 _proto.getSelectedFiles = function getSelectedFiles(input) {
9067 var multiple = this.props.multiple;
9068
9069 if (multiple && input.files) {
9070 var files = [].slice.call(input.files);
9071 return files.map(function (file) {
9072 return file.name;
9073 }).join(", ");
9074 }
9075
9076 if (input.value.indexOf("fakepath") !== -1) {
9077 var parts = input.value.split("\\");
9078 return parts[parts.length - 1];
9079 }
9080
9081 return input.value;
9082 };
9083
9084 _proto.render = function render() {
9085 var _this$props = this.props,
9086 className = _this$props.className,
9087 label = _this$props.label,
9088 valid = _this$props.valid,
9089 invalid = _this$props.invalid,
9090 cssModule = _this$props.cssModule,
9091 children = _this$props.children,
9092 bsSize = _this$props.bsSize,
9093 innerRef = _this$props.innerRef,
9094 htmlFor = _this$props.htmlFor,
9095 type = _this$props.type,
9096 onChange = _this$props.onChange,
9097 dataBrowse = _this$props.dataBrowse,
9098 hidden = _this$props.hidden,
9099 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "label", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef", "htmlFor", "type", "onChange", "dataBrowse", "hidden"]);
9100
9101 var customClass = mapToCssModules(classnames(className, "custom-file"), cssModule);
9102 var validationClassNames = mapToCssModules(classnames(invalid && "is-invalid", valid && "is-valid"), cssModule);
9103 var labelHtmlFor = htmlFor || attributes.id;
9104 var files = this.state.files;
9105 return /*#__PURE__*/React__default.createElement("div", {
9106 className: customClass,
9107 hidden: hidden || false
9108 }, /*#__PURE__*/React__default.createElement("input", _extends({
9109 type: "file"
9110 }, attributes, {
9111 ref: innerRef,
9112 "aria-invalid": invalid,
9113 className: classnames(validationClassNames, mapToCssModules("custom-file-input", cssModule)),
9114 onChange: this.onChange
9115 })), /*#__PURE__*/React__default.createElement("label", {
9116 className: mapToCssModules("custom-file-label", cssModule),
9117 htmlFor: labelHtmlFor,
9118 "data-browse": dataBrowse
9119 }, files || label || "Choose file"), children);
9120 };
9121
9122 return CustomFileInput;
9123 }(React__default.Component);
9124
9125 CustomFileInput.propTypes = propTypes$C;
9126
9127 var propTypes$D = {
9128 className: propTypes.string,
9129 id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
9130 type: propTypes.string.isRequired,
9131 label: propTypes.node,
9132 inline: propTypes.bool,
9133 valid: propTypes.bool,
9134 invalid: propTypes.bool,
9135 bsSize: propTypes.string,
9136 htmlFor: propTypes.string,
9137 cssModule: propTypes.object,
9138 children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
9139 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
9140 };
9141
9142 function CustomInput(props) {
9143 var className = props.className,
9144 label = props.label,
9145 inline = props.inline,
9146 valid = props.valid,
9147 invalid = props.invalid,
9148 cssModule = props.cssModule,
9149 children = props.children,
9150 bsSize = props.bsSize,
9151 innerRef = props.innerRef,
9152 htmlFor = props.htmlFor,
9153 attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef", "htmlFor"]);
9154
9155 var type = attributes.type;
9156 var customClass = mapToCssModules(classnames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
9157 var validationClassNames = mapToCssModules(classnames(invalid && "is-invalid", valid && "is-valid"), cssModule);
9158 var labelHtmlFor = htmlFor || attributes.id;
9159
9160 if (type === "select") {
9161 var _type = attributes.type,
9162 _rest = _objectWithoutPropertiesLoose(attributes, ["type"]);
9163
9164 return /*#__PURE__*/React__default.createElement("select", _extends({}, _rest, {
9165 ref: innerRef,
9166 className: classnames(validationClassNames, customClass),
9167 "aria-invalid": invalid
9168 }), children);
9169 }
9170
9171 if (type === "file") {
9172 return /*#__PURE__*/React__default.createElement(CustomFileInput, props);
9173 }
9174
9175 if (type !== "checkbox" && type !== "radio" && type !== "switch") {
9176 return /*#__PURE__*/React__default.createElement("input", _extends({}, attributes, {
9177 ref: innerRef,
9178 "aria-invalid": invalid,
9179 className: classnames(validationClassNames, customClass)
9180 }));
9181 }
9182
9183 var wrapperClasses = classnames(customClass, mapToCssModules(classnames("custom-control", {
9184 "custom-control-inline": inline
9185 }), cssModule));
9186
9187 var hidden = attributes.hidden,
9188 rest = _objectWithoutPropertiesLoose(attributes, ["hidden"]);
9189
9190 return /*#__PURE__*/React__default.createElement("div", {
9191 className: wrapperClasses,
9192 hidden: hidden || false
9193 }, /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
9194 type: type === "switch" ? "checkbox" : type,
9195 ref: innerRef,
9196 "aria-invalid": invalid,
9197 className: classnames(validationClassNames, mapToCssModules("custom-control-input", cssModule))
9198 })), /*#__PURE__*/React__default.createElement("label", {
9199 className: mapToCssModules("custom-control-label", cssModule),
9200 htmlFor: labelHtmlFor
9201 }, label), children);
9202 }
9203
9204 CustomInput.propTypes = propTypes$D;
9205
9206 function noop() {}
9207
9208 var propTypes$E = {
9209 children: propTypes.oneOfType([propTypes.node, propTypes.func]).isRequired,
9210 popperClassName: propTypes.string,
9211 placement: propTypes.string,
9212 placementPrefix: propTypes.string,
9213 arrowClassName: propTypes.string,
9214 hideArrow: propTypes.bool,
9215 tag: tagPropType,
9216 isOpen: propTypes.bool.isRequired,
9217 cssModule: propTypes.object,
9218 offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
9219 fallbackPlacement: propTypes.oneOfType([propTypes.string, propTypes.array]),
9220 flip: propTypes.bool,
9221 container: targetPropType,
9222 target: targetPropType.isRequired,
9223 modifiers: propTypes.object,
9224 boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
9225 onClosed: propTypes.func,
9226 fade: propTypes.bool,
9227 transition: propTypes.shape(Fade.propTypes)
9228 };
9229 var defaultProps$z = {
9230 boundariesElement: 'scrollParent',
9231 placement: 'auto',
9232 hideArrow: false,
9233 isOpen: false,
9234 offset: 0,
9235 fallbackPlacement: 'flip',
9236 flip: true,
9237 container: 'body',
9238 modifiers: {},
9239 onClosed: noop,
9240 fade: true,
9241 transition: _extends({}, Fade.defaultProps)
9242 };
9243
9244 var PopperContent = /*#__PURE__*/function (_React$Component) {
9245 _inheritsLoose(PopperContent, _React$Component);
9246
9247 function PopperContent(props) {
9248 var _this;
9249
9250 _this = _React$Component.call(this, props) || this;
9251 _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_this));
9252 _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_this));
9253 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
9254 _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
9255 _this.state = {
9256 isOpen: props.isOpen
9257 };
9258 return _this;
9259 }
9260
9261 PopperContent.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
9262 if (props.isOpen && !state.isOpen) {
9263 return {
9264 isOpen: props.isOpen
9265 };
9266 } else return null;
9267 };
9268
9269 var _proto = PopperContent.prototype;
9270
9271 _proto.componentDidUpdate = function componentDidUpdate() {
9272 if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
9273 this._element.childNodes[0].focus();
9274 }
9275 };
9276
9277 _proto.setTargetNode = function setTargetNode(node) {
9278 this.targetNode = typeof node === 'string' ? getTarget(node) : node;
9279 };
9280
9281 _proto.getTargetNode = function getTargetNode() {
9282 return this.targetNode;
9283 };
9284
9285 _proto.getContainerNode = function getContainerNode() {
9286 return getTarget(this.props.container);
9287 };
9288
9289 _proto.getRef = function getRef(ref) {
9290 this._element = ref;
9291 };
9292
9293 _proto.onClosed = function onClosed() {
9294 this.props.onClosed();
9295 this.setState({
9296 isOpen: false
9297 });
9298 };
9299
9300 _proto.renderChildren = function renderChildren() {
9301 var _this$props = this.props,
9302 cssModule = _this$props.cssModule,
9303 children = _this$props.children,
9304 isOpen = _this$props.isOpen,
9305 flip = _this$props.flip,
9306 target = _this$props.target,
9307 offset = _this$props.offset,
9308 fallbackPlacement = _this$props.fallbackPlacement,
9309 placementPrefix = _this$props.placementPrefix,
9310 _arrowClassName = _this$props.arrowClassName,
9311 hideArrow = _this$props.hideArrow,
9312 _popperClassName = _this$props.popperClassName,
9313 tag = _this$props.tag,
9314 container = _this$props.container,
9315 modifiers = _this$props.modifiers,
9316 boundariesElement = _this$props.boundariesElement,
9317 onClosed = _this$props.onClosed,
9318 fade = _this$props.fade,
9319 transition = _this$props.transition,
9320 placement = _this$props.placement,
9321 attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "popperClassName", "tag", "container", "modifiers", "boundariesElement", "onClosed", "fade", "transition", "placement"]);
9322
9323 var arrowClassName = mapToCssModules(classnames('arrow', _arrowClassName), cssModule);
9324 var popperClassName = mapToCssModules(classnames(_popperClassName, placementPrefix ? placementPrefix + "-auto" : ''), this.props.cssModule);
9325
9326 var extendedModifiers = _extends({
9327 offset: {
9328 offset: offset
9329 },
9330 flip: {
9331 enabled: flip,
9332 behavior: fallbackPlacement
9333 },
9334 preventOverflow: {
9335 boundariesElement: boundariesElement
9336 }
9337 }, modifiers);
9338
9339 var popperTransition = _extends({}, Fade.defaultProps, transition, {
9340 baseClass: fade ? transition.baseClass : '',
9341 timeout: fade ? transition.timeout : 0
9342 });
9343
9344 return /*#__PURE__*/React__default.createElement(Fade, _extends({}, popperTransition, attrs, {
9345 in: isOpen,
9346 onExited: this.onClosed,
9347 tag: tag
9348 }), /*#__PURE__*/React__default.createElement(Popper$1, {
9349 referenceElement: this.targetNode,
9350 modifiers: extendedModifiers,
9351 placement: placement
9352 }, function (_ref) {
9353 var ref = _ref.ref,
9354 style = _ref.style,
9355 placement = _ref.placement,
9356 outOfBoundaries = _ref.outOfBoundaries,
9357 arrowProps = _ref.arrowProps,
9358 scheduleUpdate = _ref.scheduleUpdate;
9359 return /*#__PURE__*/React__default.createElement("div", {
9360 ref: ref,
9361 style: style,
9362 className: popperClassName,
9363 "x-placement": placement,
9364 "x-out-of-boundaries": outOfBoundaries ? 'true' : undefined
9365 }, typeof children === 'function' ? children({
9366 scheduleUpdate: scheduleUpdate
9367 }) : children, !hideArrow && /*#__PURE__*/React__default.createElement("span", {
9368 ref: arrowProps.ref,
9369 className: arrowClassName,
9370 style: arrowProps.style
9371 }));
9372 }));
9373 };
9374
9375 _proto.render = function render() {
9376 this.setTargetNode(this.props.target);
9377
9378 if (this.state.isOpen) {
9379 return this.props.container === 'inline' ? this.renderChildren() : /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement("div", {
9380 ref: this.getRef
9381 }, this.renderChildren()), this.getContainerNode());
9382 }
9383
9384 return null;
9385 };
9386
9387 return PopperContent;
9388 }(React__default.Component);
9389
9390 PopperContent.propTypes = propTypes$E;
9391 PopperContent.defaultProps = defaultProps$z;
9392
9393 var PopperTargetHelper = function PopperTargetHelper(props, context) {
9394 context.popperManager.setTargetNode(getTarget(props.target));
9395 return null;
9396 };
9397
9398 PopperTargetHelper.contextTypes = {
9399 popperManager: propTypes.object.isRequired
9400 };
9401 PopperTargetHelper.propTypes = {
9402 target: targetPropType.isRequired
9403 };
9404
9405 var propTypes$F = {
9406 children: propTypes.oneOfType([propTypes.node, propTypes.func]),
9407 placement: propTypes.oneOf(PopperPlacements),
9408 target: targetPropType.isRequired,
9409 container: targetPropType,
9410 isOpen: propTypes.bool,
9411 disabled: propTypes.bool,
9412 hideArrow: propTypes.bool,
9413 boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
9414 className: propTypes.string,
9415 innerClassName: propTypes.string,
9416 arrowClassName: propTypes.string,
9417 popperClassName: propTypes.string,
9418 cssModule: propTypes.object,
9419 toggle: propTypes.func,
9420 autohide: propTypes.bool,
9421 placementPrefix: propTypes.string,
9422 delay: propTypes.oneOfType([propTypes.shape({
9423 show: propTypes.number,
9424 hide: propTypes.number
9425 }), propTypes.number]),
9426 modifiers: propTypes.object,
9427 offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
9428 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object]),
9429 trigger: propTypes.string,
9430 fade: propTypes.bool,
9431 flip: propTypes.bool
9432 };
9433 var DEFAULT_DELAYS = {
9434 show: 0,
9435 hide: 50
9436 };
9437 var defaultProps$A = {
9438 isOpen: false,
9439 hideArrow: false,
9440 autohide: false,
9441 delay: DEFAULT_DELAYS,
9442 toggle: function toggle() {},
9443 trigger: 'click',
9444 fade: true
9445 };
9446
9447 function isInDOMSubtree(element, subtreeRoot) {
9448 return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
9449 }
9450
9451 function isInDOMSubtrees(element, subtreeRoots) {
9452 if (subtreeRoots === void 0) {
9453 subtreeRoots = [];
9454 }
9455
9456 return subtreeRoots && subtreeRoots.length && subtreeRoots.filter(function (subTreeRoot) {
9457 return isInDOMSubtree(element, subTreeRoot);
9458 })[0];
9459 }
9460
9461 var TooltipPopoverWrapper = /*#__PURE__*/function (_React$Component) {
9462 _inheritsLoose(TooltipPopoverWrapper, _React$Component);
9463
9464 function TooltipPopoverWrapper(props) {
9465 var _this;
9466
9467 _this = _React$Component.call(this, props) || this;
9468 _this._targets = [];
9469 _this.currentTargetElement = null;
9470 _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_this));
9471 _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
9472 _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_this));
9473 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
9474 _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_this));
9475 _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_this));
9476 _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_this));
9477 _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_this));
9478 _this.show = _this.show.bind(_assertThisInitialized(_this));
9479 _this.hide = _this.hide.bind(_assertThisInitialized(_this));
9480 _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_this));
9481 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
9482 _this.state = {
9483 isOpen: props.isOpen
9484 };
9485 _this._isMounted = false;
9486 return _this;
9487 }
9488
9489 var _proto = TooltipPopoverWrapper.prototype;
9490
9491 _proto.componentDidMount = function componentDidMount() {
9492 this._isMounted = true;
9493 this.updateTarget();
9494 };
9495
9496 _proto.componentWillUnmount = function componentWillUnmount() {
9497 this._isMounted = false;
9498 this.removeTargetEvents();
9499 this._targets = null;
9500 this.clearShowTimeout();
9501 this.clearHideTimeout();
9502 };
9503
9504 TooltipPopoverWrapper.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
9505 if (props.isOpen && !state.isOpen) {
9506 return {
9507 isOpen: props.isOpen
9508 };
9509 } else return null;
9510 };
9511
9512 _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
9513 if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
9514 if (this._hideTimeout) {
9515 this.clearHideTimeout();
9516 }
9517
9518 if (this.state.isOpen && !this.props.isOpen) {
9519 this.toggle();
9520 }
9521 }
9522 };
9523
9524 _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
9525 if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
9526 if (this._showTimeout) {
9527 this.clearShowTimeout();
9528 }
9529
9530 e.persist();
9531 this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
9532 }
9533 };
9534
9535 _proto.onEscKeyDown = function onEscKeyDown(e) {
9536 if (e.key === 'Escape') {
9537 this.hide(e);
9538 }
9539 };
9540
9541 _proto.getRef = function getRef(ref) {
9542 var innerRef = this.props.innerRef;
9543
9544 if (innerRef) {
9545 if (typeof innerRef === 'function') {
9546 innerRef(ref);
9547 } else if (typeof innerRef === 'object') {
9548 innerRef.current = ref;
9549 }
9550 }
9551
9552 this._popover = ref;
9553 };
9554
9555 _proto.getDelay = function getDelay(key) {
9556 var delay = this.props.delay;
9557
9558 if (typeof delay === 'object') {
9559 return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
9560 }
9561
9562 return delay;
9563 };
9564
9565 _proto.show = function show(e) {
9566 if (!this.props.isOpen) {
9567 this.clearShowTimeout();
9568 this.currentTargetElement = e ? e.currentTarget || e.target : null;
9569
9570 if (e && e.composedPath && typeof e.composedPath === 'function') {
9571 var path = e.composedPath();
9572 this.currentTargetElement = path && path[0] || this.currentTargetElement;
9573 }
9574
9575 this.toggle(e);
9576 }
9577 };
9578
9579 _proto.showWithDelay = function showWithDelay(e) {
9580 if (this._hideTimeout) {
9581 this.clearHideTimeout();
9582 }
9583
9584 this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
9585 };
9586
9587 _proto.hide = function hide(e) {
9588 if (this.props.isOpen) {
9589 this.clearHideTimeout();
9590 this.currentTargetElement = null;
9591 this.toggle(e);
9592 }
9593 };
9594
9595 _proto.hideWithDelay = function hideWithDelay(e) {
9596 if (this._showTimeout) {
9597 this.clearShowTimeout();
9598 }
9599
9600 this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
9601 };
9602
9603 _proto.clearShowTimeout = function clearShowTimeout() {
9604 clearTimeout(this._showTimeout);
9605 this._showTimeout = undefined;
9606 };
9607
9608 _proto.clearHideTimeout = function clearHideTimeout() {
9609 clearTimeout(this._hideTimeout);
9610 this._hideTimeout = undefined;
9611 };
9612
9613 _proto.handleDocumentClick = function handleDocumentClick(e) {
9614 var triggers = this.props.trigger.split(' ');
9615
9616 if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtrees(e.target, this._targets))) {
9617 if (this._hideTimeout) {
9618 this.clearHideTimeout();
9619 }
9620
9621 if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
9622 this.hideWithDelay(e);
9623 } else if (!this.props.isOpen) {
9624 this.showWithDelay(e);
9625 }
9626 } else if (triggers.indexOf('click') > -1 && isInDOMSubtrees(e.target, this._targets)) {
9627 if (this._hideTimeout) {
9628 this.clearHideTimeout();
9629 }
9630
9631 if (!this.props.isOpen) {
9632 this.showWithDelay(e);
9633 } else {
9634 this.hideWithDelay(e);
9635 }
9636 }
9637 };
9638
9639 _proto.addEventOnTargets = function addEventOnTargets(type, handler, isBubble) {
9640 this._targets.forEach(function (target) {
9641 target.addEventListener(type, handler, isBubble);
9642 });
9643 };
9644
9645 _proto.removeEventOnTargets = function removeEventOnTargets(type, handler, isBubble) {
9646 this._targets.forEach(function (target) {
9647 target.removeEventListener(type, handler, isBubble);
9648 });
9649 };
9650
9651 _proto.addTargetEvents = function addTargetEvents() {
9652 if (this.props.trigger) {
9653 var triggers = this.props.trigger.split(' ');
9654
9655 if (triggers.indexOf('manual') === -1) {
9656 if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
9657 document.addEventListener('click', this.handleDocumentClick, true);
9658 }
9659
9660 if (this._targets && this._targets.length) {
9661 if (triggers.indexOf('hover') > -1) {
9662 this.addEventOnTargets('mouseover', this.showWithDelay, true);
9663 this.addEventOnTargets('mouseout', this.hideWithDelay, true);
9664 }
9665
9666 if (triggers.indexOf('focus') > -1) {
9667 this.addEventOnTargets('focusin', this.show, true);
9668 this.addEventOnTargets('focusout', this.hide, true);
9669 }
9670
9671 this.addEventOnTargets('keydown', this.onEscKeyDown, true);
9672 }
9673 }
9674 }
9675 };
9676
9677 _proto.removeTargetEvents = function removeTargetEvents() {
9678 if (this._targets) {
9679 this.removeEventOnTargets('mouseover', this.showWithDelay, true);
9680 this.removeEventOnTargets('mouseout', this.hideWithDelay, true);
9681 this.removeEventOnTargets('keydown', this.onEscKeyDown, true);
9682 this.removeEventOnTargets('focusin', this.show, true);
9683 this.removeEventOnTargets('focusout', this.hide, true);
9684 }
9685
9686 document.removeEventListener('click', this.handleDocumentClick, true);
9687 };
9688
9689 _proto.updateTarget = function updateTarget() {
9690 var newTarget = getTarget(this.props.target, true);
9691
9692 if (newTarget !== this._targets) {
9693 this.removeTargetEvents();
9694 this._targets = newTarget ? Array.from(newTarget) : [];
9695 this.currentTargetElement = this.currentTargetElement || this._targets[0];
9696 this.addTargetEvents();
9697 }
9698 };
9699
9700 _proto.toggle = function toggle(e) {
9701 if (this.props.disabled || !this._isMounted) {
9702 return e && e.preventDefault();
9703 }
9704
9705 return this.props.toggle(e);
9706 };
9707
9708 _proto.render = function render() {
9709 var _this2 = this;
9710
9711 if (!this.props.isOpen) {
9712 return null;
9713 }
9714
9715 this.updateTarget();
9716 var _this$props = this.props,
9717 className = _this$props.className,
9718 cssModule = _this$props.cssModule,
9719 innerClassName = _this$props.innerClassName,
9720 isOpen = _this$props.isOpen,
9721 hideArrow = _this$props.hideArrow,
9722 boundariesElement = _this$props.boundariesElement,
9723 placement = _this$props.placement,
9724 placementPrefix = _this$props.placementPrefix,
9725 arrowClassName = _this$props.arrowClassName,
9726 popperClassName = _this$props.popperClassName,
9727 container = _this$props.container,
9728 modifiers = _this$props.modifiers,
9729 offset = _this$props.offset,
9730 fade = _this$props.fade,
9731 flip = _this$props.flip,
9732 children = _this$props.children;
9733 var attributes = omit(this.props, Object.keys(propTypes$F));
9734 var popperClasses = mapToCssModules(popperClassName, cssModule);
9735 var classes = mapToCssModules(innerClassName, cssModule);
9736 return /*#__PURE__*/React__default.createElement(PopperContent, {
9737 className: className,
9738 target: this.currentTargetElement || this._targets[0],
9739 isOpen: isOpen,
9740 hideArrow: hideArrow,
9741 boundariesElement: boundariesElement,
9742 placement: placement,
9743 placementPrefix: placementPrefix,
9744 arrowClassName: arrowClassName,
9745 popperClassName: popperClasses,
9746 container: container,
9747 modifiers: modifiers,
9748 offset: offset,
9749 cssModule: cssModule,
9750 fade: fade,
9751 flip: flip
9752 }, function (_ref) {
9753 var scheduleUpdate = _ref.scheduleUpdate;
9754 return /*#__PURE__*/React__default.createElement("div", _extends({}, attributes, {
9755 ref: _this2.getRef,
9756 className: classes,
9757 role: "tooltip",
9758 onMouseOver: _this2.onMouseOverTooltipContent,
9759 onMouseLeave: _this2.onMouseLeaveTooltipContent,
9760 onKeyDown: _this2.onEscKeyDown
9761 }), typeof children === 'function' ? children({
9762 scheduleUpdate: scheduleUpdate
9763 }) : children);
9764 });
9765 };
9766
9767 return TooltipPopoverWrapper;
9768 }(React__default.Component);
9769
9770 TooltipPopoverWrapper.propTypes = propTypes$F;
9771 TooltipPopoverWrapper.defaultProps = defaultProps$A;
9772
9773 var defaultProps$B = {
9774 placement: 'right',
9775 placementPrefix: 'bs-popover',
9776 trigger: 'click'
9777 };
9778
9779 var Popover = function Popover(props) {
9780 var popperClasses = classnames('popover', 'show', props.popperClassName);
9781 var classes = classnames('popover-inner', props.innerClassName);
9782 return /*#__PURE__*/React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
9783 popperClassName: popperClasses,
9784 innerClassName: classes
9785 }));
9786 };
9787
9788 Popover.propTypes = propTypes$F;
9789 Popover.defaultProps = defaultProps$B;
9790
9791 var omitKeys = ['defaultOpen'];
9792
9793 var UncontrolledPopover = /*#__PURE__*/function (_Component) {
9794 _inheritsLoose(UncontrolledPopover, _Component);
9795
9796 function UncontrolledPopover(props) {
9797 var _this;
9798
9799 _this = _Component.call(this, props) || this;
9800 _this.state = {
9801 isOpen: props.defaultOpen || false
9802 };
9803 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
9804 return _this;
9805 }
9806
9807 var _proto = UncontrolledPopover.prototype;
9808
9809 _proto.toggle = function toggle() {
9810 this.setState({
9811 isOpen: !this.state.isOpen
9812 });
9813 };
9814
9815 _proto.render = function render() {
9816 return /*#__PURE__*/React__default.createElement(Popover, _extends({
9817 isOpen: this.state.isOpen,
9818 toggle: this.toggle
9819 }, omit(this.props, omitKeys)));
9820 };
9821
9822 return UncontrolledPopover;
9823 }(React.Component);
9824 UncontrolledPopover.propTypes = _extends({
9825 defaultOpen: propTypes.bool
9826 }, Popover.propTypes);
9827
9828 var propTypes$G = {
9829 tag: tagPropType,
9830 className: propTypes.string,
9831 cssModule: propTypes.object
9832 };
9833 var defaultProps$C = {
9834 tag: 'h3'
9835 };
9836
9837 var PopoverHeader = function PopoverHeader(props) {
9838 var className = props.className,
9839 cssModule = props.cssModule,
9840 Tag = props.tag,
9841 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9842
9843 var classes = mapToCssModules(classnames(className, 'popover-header'), cssModule);
9844 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
9845 className: classes
9846 }));
9847 };
9848
9849 PopoverHeader.propTypes = propTypes$G;
9850 PopoverHeader.defaultProps = defaultProps$C;
9851
9852 var propTypes$H = {
9853 tag: tagPropType,
9854 className: propTypes.string,
9855 cssModule: propTypes.object
9856 };
9857 var defaultProps$D = {
9858 tag: 'div'
9859 };
9860
9861 var PopoverBody = function PopoverBody(props) {
9862 var className = props.className,
9863 cssModule = props.cssModule,
9864 Tag = props.tag,
9865 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9866
9867 var classes = mapToCssModules(classnames(className, 'popover-body'), cssModule);
9868 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
9869 className: classes
9870 }));
9871 };
9872
9873 PopoverBody.propTypes = propTypes$H;
9874 PopoverBody.defaultProps = defaultProps$D;
9875
9876 var propTypes$I = {
9877 children: propTypes.node,
9878 bar: propTypes.bool,
9879 multi: propTypes.bool,
9880 tag: tagPropType,
9881 value: propTypes.oneOfType([propTypes.string, propTypes.number]),
9882 min: propTypes.oneOfType([propTypes.string, propTypes.number]),
9883 max: propTypes.oneOfType([propTypes.string, propTypes.number]),
9884 animated: propTypes.bool,
9885 striped: propTypes.bool,
9886 color: propTypes.string,
9887 className: propTypes.string,
9888 barClassName: propTypes.string,
9889 cssModule: propTypes.object,
9890 style: propTypes.object,
9891 barAriaValueText: propTypes.string,
9892 barAriaLabelledBy: propTypes.string
9893 };
9894 var defaultProps$E = {
9895 tag: 'div',
9896 value: 0,
9897 min: 0,
9898 max: 100,
9899 style: {}
9900 };
9901
9902 var Progress = function Progress(props) {
9903 var children = props.children,
9904 className = props.className,
9905 barClassName = props.barClassName,
9906 cssModule = props.cssModule,
9907 value = props.value,
9908 min = props.min,
9909 max = props.max,
9910 animated = props.animated,
9911 striped = props.striped,
9912 color = props.color,
9913 bar = props.bar,
9914 multi = props.multi,
9915 Tag = props.tag,
9916 style = props.style,
9917 barAriaValueText = props.barAriaValueText,
9918 barAriaLabelledBy = props.barAriaLabelledBy,
9919 attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "min", "max", "animated", "striped", "color", "bar", "multi", "tag", "style", "barAriaValueText", "barAriaLabelledBy"]);
9920
9921 var percent = toNumber(value) / toNumber(max) * 100;
9922 var progressClasses = mapToCssModules(classnames(className, 'progress'), cssModule);
9923 var progressBarClasses = mapToCssModules(classnames('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? "bg-" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);
9924 var ProgressBar = multi ? children : /*#__PURE__*/React__default.createElement("div", _extends({}, attributes, {
9925 className: progressBarClasses,
9926 style: _extends({}, style, {
9927 width: percent + "%"
9928 }),
9929 role: "progressbar",
9930 "aria-valuenow": value,
9931 "aria-valuemin": min,
9932 "aria-valuemax": max,
9933 "aria-valuetext": barAriaValueText,
9934 "aria-labelledby": barAriaLabelledBy,
9935 children: children
9936 }));
9937
9938 if (bar) {
9939 return ProgressBar;
9940 }
9941
9942 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
9943 className: progressClasses,
9944 children: ProgressBar
9945 }));
9946 };
9947
9948 Progress.propTypes = propTypes$I;
9949 Progress.defaultProps = defaultProps$E;
9950
9951 var propTypes$J = {
9952 children: propTypes.node.isRequired,
9953 node: propTypes.any
9954 };
9955
9956 var Portal$1 = /*#__PURE__*/function (_React$Component) {
9957 _inheritsLoose(Portal, _React$Component);
9958
9959 function Portal() {
9960 return _React$Component.apply(this, arguments) || this;
9961 }
9962
9963 var _proto = Portal.prototype;
9964
9965 _proto.componentWillUnmount = function componentWillUnmount() {
9966 if (this.defaultNode) {
9967 document.body.removeChild(this.defaultNode);
9968 }
9969
9970 this.defaultNode = null;
9971 };
9972
9973 _proto.render = function render() {
9974 if (!canUseDOM) {
9975 return null;
9976 }
9977
9978 if (!this.props.node && !this.defaultNode) {
9979 this.defaultNode = document.createElement('div');
9980 document.body.appendChild(this.defaultNode);
9981 }
9982
9983 return /*#__PURE__*/ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
9984 };
9985
9986 return Portal;
9987 }(React__default.Component);
9988
9989 Portal$1.propTypes = propTypes$J;
9990
9991 function noop$1() {}
9992
9993 var FadePropTypes = propTypes.shape(Fade.propTypes);
9994 var propTypes$K = {
9995 isOpen: propTypes.bool,
9996 autoFocus: propTypes.bool,
9997 centered: propTypes.bool,
9998 scrollable: propTypes.bool,
9999 size: propTypes.string,
10000 toggle: propTypes.func,
10001 keyboard: propTypes.bool,
10002 role: propTypes.string,
10003 labelledBy: propTypes.string,
10004 backdrop: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['static'])]),
10005 onEnter: propTypes.func,
10006 onExit: propTypes.func,
10007 onOpened: propTypes.func,
10008 onClosed: propTypes.func,
10009 children: propTypes.node,
10010 className: propTypes.string,
10011 wrapClassName: propTypes.string,
10012 modalClassName: propTypes.string,
10013 backdropClassName: propTypes.string,
10014 contentClassName: propTypes.string,
10015 external: propTypes.node,
10016 fade: propTypes.bool,
10017 cssModule: propTypes.object,
10018 zIndex: propTypes.oneOfType([propTypes.number, propTypes.string]),
10019 backdropTransition: FadePropTypes,
10020 modalTransition: FadePropTypes,
10021 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func]),
10022 unmountOnClose: propTypes.bool,
10023 returnFocusAfterClose: propTypes.bool,
10024 container: targetPropType
10025 };
10026 var propsToOmit = Object.keys(propTypes$K);
10027 var defaultProps$F = {
10028 isOpen: false,
10029 autoFocus: true,
10030 centered: false,
10031 scrollable: false,
10032 role: 'dialog',
10033 backdrop: true,
10034 keyboard: true,
10035 zIndex: 1050,
10036 fade: true,
10037 onOpened: noop$1,
10038 onClosed: noop$1,
10039 modalTransition: {
10040 timeout: TransitionTimeouts.Modal
10041 },
10042 backdropTransition: {
10043 mountOnEnter: true,
10044 timeout: TransitionTimeouts.Fade // uses standard fade transition
10045
10046 },
10047 unmountOnClose: true,
10048 returnFocusAfterClose: true,
10049 container: 'body'
10050 };
10051
10052 var Modal = /*#__PURE__*/function (_React$Component) {
10053 _inheritsLoose(Modal, _React$Component);
10054
10055 function Modal(props) {
10056 var _this;
10057
10058 _this = _React$Component.call(this, props) || this;
10059 _this._element = null;
10060 _this._originalBodyPadding = null;
10061 _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));
10062 _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));
10063 _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));
10064 _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));
10065 _this.handleStaticBackdropAnimation = _this.handleStaticBackdropAnimation.bind(_assertThisInitialized(_this));
10066 _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));
10067 _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));
10068 _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
10069 _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));
10070 _this.clearBackdropAnimationTimeout = _this.clearBackdropAnimationTimeout.bind(_assertThisInitialized(_this));
10071 _this.state = {
10072 isOpen: false,
10073 showStaticBackdropAnimation: false
10074 };
10075 return _this;
10076 }
10077
10078 var _proto = Modal.prototype;
10079
10080 _proto.componentDidMount = function componentDidMount() {
10081 var _this$props = this.props,
10082 isOpen = _this$props.isOpen,
10083 autoFocus = _this$props.autoFocus,
10084 onEnter = _this$props.onEnter;
10085
10086 if (isOpen) {
10087 this.init();
10088 this.setState({
10089 isOpen: true
10090 });
10091
10092 if (autoFocus) {
10093 this.setFocus();
10094 }
10095 }
10096
10097 if (onEnter) {
10098 onEnter();
10099 }
10100
10101 this._isMounted = true;
10102 };
10103
10104 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
10105 if (this.props.isOpen && !prevProps.isOpen) {
10106 this.init();
10107 this.setState({
10108 isOpen: true
10109 }); // let render() renders Modal Dialog first
10110
10111 return;
10112 } // now Modal Dialog is rendered and we can refer this._element and this._dialog
10113
10114
10115 if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
10116 this.setFocus();
10117 }
10118
10119 if (this._element && prevProps.zIndex !== this.props.zIndex) {
10120 this._element.style.zIndex = this.props.zIndex;
10121 }
10122 };
10123
10124 _proto.componentWillUnmount = function componentWillUnmount() {
10125 this.clearBackdropAnimationTimeout();
10126
10127 if (this.props.onExit) {
10128 this.props.onExit();
10129 }
10130
10131 if (this._element) {
10132 this.destroy();
10133
10134 if (this.props.isOpen || this.state.isOpen) {
10135 this.close();
10136 }
10137 }
10138
10139 this._isMounted = false;
10140 };
10141
10142 _proto.onOpened = function onOpened(node, isAppearing) {
10143 this.props.onOpened();
10144 (this.props.modalTransition.onEntered || noop$1)(node, isAppearing);
10145 };
10146
10147 _proto.onClosed = function onClosed(node) {
10148 var unmountOnClose = this.props.unmountOnClose; // so all methods get called before it is unmounted
10149
10150 this.props.onClosed();
10151 (this.props.modalTransition.onExited || noop$1)(node);
10152
10153 if (unmountOnClose) {
10154 this.destroy();
10155 }
10156
10157 this.close();
10158
10159 if (this._isMounted) {
10160 this.setState({
10161 isOpen: false
10162 });
10163 }
10164 };
10165
10166 _proto.setFocus = function setFocus() {
10167 if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
10168 this._dialog.parentNode.focus();
10169 }
10170 };
10171
10172 _proto.getFocusableChildren = function getFocusableChildren() {
10173 return this._element.querySelectorAll(focusableElements.join(', '));
10174 };
10175
10176 _proto.getFocusedChild = function getFocusedChild() {
10177 var currentFocus;
10178 var focusableChildren = this.getFocusableChildren();
10179
10180 try {
10181 currentFocus = document.activeElement;
10182 } catch (err) {
10183 currentFocus = focusableChildren[0];
10184 }
10185
10186 return currentFocus;
10187 } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls
10188 ;
10189
10190 _proto.handleBackdropClick = function handleBackdropClick(e) {
10191 if (e.target === this._mouseDownElement) {
10192 e.stopPropagation();
10193 var backdrop = this._dialog ? this._dialog.parentNode : null;
10194
10195 if (backdrop && e.target === backdrop && this.props.backdrop === 'static') {
10196 this.handleStaticBackdropAnimation();
10197 }
10198
10199 if (!this.props.isOpen || this.props.backdrop !== true) return;
10200
10201 if (backdrop && e.target === backdrop && this.props.toggle) {
10202 this.props.toggle(e);
10203 }
10204 }
10205 };
10206
10207 _proto.handleTab = function handleTab(e) {
10208 if (e.which !== 9) return;
10209 var focusableChildren = this.getFocusableChildren();
10210 var totalFocusable = focusableChildren.length;
10211 if (totalFocusable === 0) return;
10212 var currentFocus = this.getFocusedChild();
10213 var focusedIndex = 0;
10214
10215 for (var i = 0; i < totalFocusable; i += 1) {
10216 if (focusableChildren[i] === currentFocus) {
10217 focusedIndex = i;
10218 break;
10219 }
10220 }
10221
10222 if (e.shiftKey && focusedIndex === 0) {
10223 e.preventDefault();
10224 focusableChildren[totalFocusable - 1].focus();
10225 } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
10226 e.preventDefault();
10227 focusableChildren[0].focus();
10228 }
10229 };
10230
10231 _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
10232 this._mouseDownElement = e.target;
10233 };
10234
10235 _proto.handleEscape = function handleEscape(e) {
10236 if (this.props.isOpen && e.keyCode === keyCodes.esc && this.props.toggle) {
10237 if (this.props.keyboard) {
10238 e.preventDefault();
10239 e.stopPropagation();
10240 this.props.toggle(e);
10241 } else if (this.props.backdrop === 'static') {
10242 e.preventDefault();
10243 e.stopPropagation();
10244 this.handleStaticBackdropAnimation();
10245 }
10246 }
10247 };
10248
10249 _proto.handleStaticBackdropAnimation = function handleStaticBackdropAnimation() {
10250 var _this2 = this;
10251
10252 this.clearBackdropAnimationTimeout();
10253 this.setState({
10254 showStaticBackdropAnimation: true
10255 });
10256 this._backdropAnimationTimeout = setTimeout(function () {
10257 _this2.setState({
10258 showStaticBackdropAnimation: false
10259 });
10260 }, 100);
10261 };
10262
10263 _proto.init = function init() {
10264 try {
10265 this._triggeringElement = document.activeElement;
10266 } catch (err) {
10267 this._triggeringElement = null;
10268 }
10269
10270 if (!this._element) {
10271 this._element = document.createElement('div');
10272
10273 this._element.setAttribute('tabindex', '-1');
10274
10275 this._element.style.position = 'relative';
10276 this._element.style.zIndex = this.props.zIndex;
10277 this._mountContainer = getTarget(this.props.container);
10278
10279 this._mountContainer.appendChild(this._element);
10280 }
10281
10282 this._originalBodyPadding = getOriginalBodyPadding();
10283 conditionallyUpdateScrollbar();
10284
10285 if (Modal.openCount === 0) {
10286 document.body.className = classnames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
10287 }
10288
10289 Modal.openCount += 1;
10290 };
10291
10292 _proto.destroy = function destroy() {
10293 if (this._element) {
10294 this._mountContainer.removeChild(this._element);
10295
10296 this._element = null;
10297 }
10298
10299 this.manageFocusAfterClose();
10300 };
10301
10302 _proto.manageFocusAfterClose = function manageFocusAfterClose() {
10303 if (this._triggeringElement) {
10304 var returnFocusAfterClose = this.props.returnFocusAfterClose;
10305 if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();
10306 this._triggeringElement = null;
10307 }
10308 };
10309
10310 _proto.close = function close() {
10311 if (Modal.openCount <= 1) {
10312 var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened`
10313
10314 var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
10315 document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
10316 }
10317
10318 this.manageFocusAfterClose();
10319 Modal.openCount = Math.max(0, Modal.openCount - 1);
10320 setScrollbarWidth(this._originalBodyPadding);
10321 };
10322
10323 _proto.renderModalDialog = function renderModalDialog() {
10324 var _classNames,
10325 _this3 = this;
10326
10327 var attributes = omit(this.props, propsToOmit);
10328 var dialogBaseClass = 'modal-dialog';
10329 return /*#__PURE__*/React__default.createElement("div", _extends({}, attributes, {
10330 className: mapToCssModules(classnames(dialogBaseClass, this.props.className, (_classNames = {}, _classNames["modal-" + this.props.size] = this.props.size, _classNames[dialogBaseClass + "-centered"] = this.props.centered, _classNames[dialogBaseClass + "-scrollable"] = this.props.scrollable, _classNames)), this.props.cssModule),
10331 role: "document",
10332 ref: function ref(c) {
10333 _this3._dialog = c;
10334 }
10335 }), /*#__PURE__*/React__default.createElement("div", {
10336 className: mapToCssModules(classnames('modal-content', this.props.contentClassName), this.props.cssModule)
10337 }, this.props.children));
10338 };
10339
10340 _proto.render = function render() {
10341 var unmountOnClose = this.props.unmountOnClose;
10342
10343 if (!!this._element && (this.state.isOpen || !unmountOnClose)) {
10344 var isModalHidden = !!this._element && !this.state.isOpen && !unmountOnClose;
10345 this._element.style.display = isModalHidden ? 'none' : 'block';
10346 var _this$props2 = this.props,
10347 wrapClassName = _this$props2.wrapClassName,
10348 modalClassName = _this$props2.modalClassName,
10349 backdropClassName = _this$props2.backdropClassName,
10350 cssModule = _this$props2.cssModule,
10351 isOpen = _this$props2.isOpen,
10352 backdrop = _this$props2.backdrop,
10353 role = _this$props2.role,
10354 labelledBy = _this$props2.labelledBy,
10355 external = _this$props2.external,
10356 innerRef = _this$props2.innerRef;
10357 var modalAttributes = {
10358 onClick: this.handleBackdropClick,
10359 onMouseDown: this.handleBackdropMouseDown,
10360 onKeyUp: this.handleEscape,
10361 onKeyDown: this.handleTab,
10362 style: {
10363 display: 'block'
10364 },
10365 'aria-labelledby': labelledBy,
10366 role: role,
10367 tabIndex: '-1'
10368 };
10369 var hasTransition = this.props.fade;
10370
10371 var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
10372 baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
10373 timeout: hasTransition ? this.props.modalTransition.timeout : 0
10374 });
10375
10376 var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
10377 baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
10378 timeout: hasTransition ? this.props.backdropTransition.timeout : 0
10379 });
10380
10381 var Backdrop = backdrop && (hasTransition ? /*#__PURE__*/React__default.createElement(Fade, _extends({}, backdropTransition, {
10382 in: isOpen && !!backdrop,
10383 cssModule: cssModule,
10384 className: mapToCssModules(classnames('modal-backdrop', backdropClassName), cssModule)
10385 })) : /*#__PURE__*/React__default.createElement("div", {
10386 className: mapToCssModules(classnames('modal-backdrop', 'show', backdropClassName), cssModule)
10387 }));
10388 return /*#__PURE__*/React__default.createElement(Portal$1, {
10389 node: this._element
10390 }, /*#__PURE__*/React__default.createElement("div", {
10391 className: mapToCssModules(wrapClassName)
10392 }, /*#__PURE__*/React__default.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
10393 in: isOpen,
10394 onEntered: this.onOpened,
10395 onExited: this.onClosed,
10396 cssModule: cssModule,
10397 className: mapToCssModules(classnames('modal', modalClassName, this.state.showStaticBackdropAnimation && 'modal-static'), cssModule),
10398 innerRef: innerRef
10399 }), external, this.renderModalDialog()), Backdrop));
10400 }
10401
10402 return null;
10403 };
10404
10405 _proto.clearBackdropAnimationTimeout = function clearBackdropAnimationTimeout() {
10406 if (this._backdropAnimationTimeout) {
10407 clearTimeout(this._backdropAnimationTimeout);
10408 this._backdropAnimationTimeout = undefined;
10409 }
10410 };
10411
10412 return Modal;
10413 }(React__default.Component);
10414
10415 Modal.propTypes = propTypes$K;
10416 Modal.defaultProps = defaultProps$F;
10417 Modal.openCount = 0;
10418
10419 var propTypes$L = {
10420 tag: tagPropType,
10421 wrapTag: tagPropType,
10422 toggle: propTypes.func,
10423 className: propTypes.string,
10424 cssModule: propTypes.object,
10425 children: propTypes.node,
10426 closeAriaLabel: propTypes.string,
10427 charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
10428 close: propTypes.object
10429 };
10430 var defaultProps$G = {
10431 tag: 'h5',
10432 wrapTag: 'div',
10433 closeAriaLabel: 'Close',
10434 charCode: 215
10435 };
10436
10437 var ModalHeader = function ModalHeader(props) {
10438 var closeButton;
10439
10440 var className = props.className,
10441 cssModule = props.cssModule,
10442 children = props.children,
10443 toggle = props.toggle,
10444 Tag = props.tag,
10445 WrapTag = props.wrapTag,
10446 closeAriaLabel = props.closeAriaLabel,
10447 charCode = props.charCode,
10448 close = props.close,
10449 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
10450
10451 var classes = mapToCssModules(classnames(className, 'modal-header'), cssModule);
10452
10453 if (!close && toggle) {
10454 var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
10455 closeButton = /*#__PURE__*/React__default.createElement("button", {
10456 type: "button",
10457 onClick: toggle,
10458 className: mapToCssModules('close', cssModule),
10459 "aria-label": closeAriaLabel
10460 }, /*#__PURE__*/React__default.createElement("span", {
10461 "aria-hidden": "true"
10462 }, closeIcon));
10463 }
10464
10465 return /*#__PURE__*/React__default.createElement(WrapTag, _extends({}, attributes, {
10466 className: classes
10467 }), /*#__PURE__*/React__default.createElement(Tag, {
10468 className: mapToCssModules('modal-title', cssModule)
10469 }, children), close || closeButton);
10470 };
10471
10472 ModalHeader.propTypes = propTypes$L;
10473 ModalHeader.defaultProps = defaultProps$G;
10474
10475 var propTypes$M = {
10476 tag: tagPropType,
10477 className: propTypes.string,
10478 cssModule: propTypes.object
10479 };
10480 var defaultProps$H = {
10481 tag: 'div'
10482 };
10483
10484 var ModalBody = function ModalBody(props) {
10485 var className = props.className,
10486 cssModule = props.cssModule,
10487 Tag = props.tag,
10488 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
10489
10490 var classes = mapToCssModules(classnames(className, 'modal-body'), cssModule);
10491 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10492 className: classes
10493 }));
10494 };
10495
10496 ModalBody.propTypes = propTypes$M;
10497 ModalBody.defaultProps = defaultProps$H;
10498
10499 var propTypes$N = {
10500 tag: tagPropType,
10501 className: propTypes.string,
10502 cssModule: propTypes.object
10503 };
10504 var defaultProps$I = {
10505 tag: 'div'
10506 };
10507
10508 var ModalFooter = function ModalFooter(props) {
10509 var className = props.className,
10510 cssModule = props.cssModule,
10511 Tag = props.tag,
10512 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
10513
10514 var classes = mapToCssModules(classnames(className, 'modal-footer'), cssModule);
10515 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10516 className: classes
10517 }));
10518 };
10519
10520 ModalFooter.propTypes = propTypes$N;
10521 ModalFooter.defaultProps = defaultProps$I;
10522
10523 var defaultProps$J = {
10524 placement: 'top',
10525 autohide: true,
10526 placementPrefix: 'bs-tooltip',
10527 trigger: 'hover focus'
10528 };
10529
10530 var Tooltip = function Tooltip(props) {
10531 var popperClasses = classnames('tooltip', 'show', props.popperClassName);
10532 var classes = classnames('tooltip-inner', props.innerClassName);
10533 return /*#__PURE__*/React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
10534 popperClassName: popperClasses,
10535 innerClassName: classes
10536 }));
10537 };
10538
10539 Tooltip.propTypes = propTypes$F;
10540 Tooltip.defaultProps = defaultProps$J;
10541
10542 var propTypes$O = {
10543 className: propTypes.string,
10544 cssModule: propTypes.object,
10545 size: propTypes.string,
10546 bordered: propTypes.bool,
10547 borderless: propTypes.bool,
10548 striped: propTypes.bool,
10549 dark: propTypes.bool,
10550 hover: propTypes.bool,
10551 responsive: propTypes.oneOfType([propTypes.bool, propTypes.string]),
10552 tag: tagPropType,
10553 responsiveTag: tagPropType,
10554 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
10555 };
10556 var defaultProps$K = {
10557 tag: 'table',
10558 responsiveTag: 'div'
10559 };
10560
10561 var Table = function Table(props) {
10562 var className = props.className,
10563 cssModule = props.cssModule,
10564 size = props.size,
10565 bordered = props.bordered,
10566 borderless = props.borderless,
10567 striped = props.striped,
10568 dark = props.dark,
10569 hover = props.hover,
10570 responsive = props.responsive,
10571 Tag = props.tag,
10572 ResponsiveTag = props.responsiveTag,
10573 innerRef = props.innerRef,
10574 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
10575
10576 var classes = mapToCssModules(classnames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);
10577 var table = /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10578 ref: innerRef,
10579 className: classes
10580 }));
10581
10582 if (responsive) {
10583 var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : "table-responsive-" + responsive, cssModule);
10584 return /*#__PURE__*/React__default.createElement(ResponsiveTag, {
10585 className: responsiveClassName
10586 }, table);
10587 }
10588
10589 return table;
10590 };
10591
10592 Table.propTypes = propTypes$O;
10593 Table.defaultProps = defaultProps$K;
10594
10595 var propTypes$P = {
10596 tag: tagPropType,
10597 flush: propTypes.bool,
10598 className: propTypes.string,
10599 cssModule: propTypes.object,
10600 horizontal: propTypes.oneOfType([propTypes.bool, propTypes.string])
10601 };
10602 var defaultProps$L = {
10603 tag: 'ul',
10604 horizontal: false
10605 };
10606
10607 var getHorizontalClass = function getHorizontalClass(horizontal) {
10608 if (horizontal === false) {
10609 return false;
10610 } else if (horizontal === true || horizontal === "xs") {
10611 return "list-group-horizontal";
10612 }
10613
10614 return "list-group-horizontal-" + horizontal;
10615 };
10616
10617 var ListGroup = function ListGroup(props) {
10618 var className = props.className,
10619 cssModule = props.cssModule,
10620 Tag = props.tag,
10621 flush = props.flush,
10622 horizontal = props.horizontal,
10623 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush", "horizontal"]);
10624
10625 var classes = mapToCssModules(classnames(className, 'list-group', // list-group-horizontal cannot currently be mixed with list-group-flush
10626 // we only try to apply horizontal classes if flush is false
10627 flush ? 'list-group-flush' : getHorizontalClass(horizontal)), cssModule);
10628 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10629 className: classes
10630 }));
10631 };
10632
10633 ListGroup.propTypes = propTypes$P;
10634 ListGroup.defaultProps = defaultProps$L;
10635
10636 var propTypes$Q = {
10637 children: propTypes.node,
10638 inline: propTypes.bool,
10639 tag: tagPropType,
10640 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
10641 className: propTypes.string,
10642 cssModule: propTypes.object
10643 };
10644 var defaultProps$M = {
10645 tag: 'form'
10646 };
10647
10648 var Form = /*#__PURE__*/function (_Component) {
10649 _inheritsLoose(Form, _Component);
10650
10651 function Form(props) {
10652 var _this;
10653
10654 _this = _Component.call(this, props) || this;
10655 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
10656 _this.submit = _this.submit.bind(_assertThisInitialized(_this));
10657 return _this;
10658 }
10659
10660 var _proto = Form.prototype;
10661
10662 _proto.getRef = function getRef(ref) {
10663 if (this.props.innerRef) {
10664 this.props.innerRef(ref);
10665 }
10666
10667 this.ref = ref;
10668 };
10669
10670 _proto.submit = function submit() {
10671 if (this.ref) {
10672 this.ref.submit();
10673 }
10674 };
10675
10676 _proto.render = function render() {
10677 var _this$props = this.props,
10678 className = _this$props.className,
10679 cssModule = _this$props.cssModule,
10680 inline = _this$props.inline,
10681 Tag = _this$props.tag,
10682 innerRef = _this$props.innerRef,
10683 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
10684
10685 var classes = mapToCssModules(classnames(className, inline ? 'form-inline' : false), cssModule);
10686 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10687 ref: innerRef,
10688 className: classes
10689 }));
10690 };
10691
10692 return Form;
10693 }(React.Component);
10694
10695 Form.propTypes = propTypes$Q;
10696 Form.defaultProps = defaultProps$M;
10697
10698 var propTypes$R = {
10699 children: propTypes.node,
10700 tag: tagPropType,
10701 className: propTypes.string,
10702 cssModule: propTypes.object,
10703 valid: propTypes.bool,
10704 tooltip: propTypes.bool
10705 };
10706 var defaultProps$N = {
10707 tag: 'div',
10708 valid: undefined
10709 };
10710
10711 var FormFeedback = function FormFeedback(props) {
10712 var className = props.className,
10713 cssModule = props.cssModule,
10714 valid = props.valid,
10715 tooltip = props.tooltip,
10716 Tag = props.tag,
10717 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
10718
10719 var validMode = tooltip ? 'tooltip' : 'feedback';
10720 var classes = mapToCssModules(classnames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
10721 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10722 className: classes
10723 }));
10724 };
10725
10726 FormFeedback.propTypes = propTypes$R;
10727 FormFeedback.defaultProps = defaultProps$N;
10728
10729 var propTypes$S = {
10730 children: propTypes.node,
10731 row: propTypes.bool,
10732 check: propTypes.bool,
10733 inline: propTypes.bool,
10734 disabled: propTypes.bool,
10735 tag: tagPropType,
10736 className: propTypes.string,
10737 cssModule: propTypes.object
10738 };
10739 var defaultProps$O = {
10740 tag: 'div'
10741 };
10742
10743 var FormGroup = function FormGroup(props) {
10744 var className = props.className,
10745 cssModule = props.cssModule,
10746 row = props.row,
10747 disabled = props.disabled,
10748 check = props.check,
10749 inline = props.inline,
10750 Tag = props.tag,
10751 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
10752
10753 var classes = mapToCssModules(classnames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
10754
10755 if (Tag === 'fieldset') {
10756 attributes.disabled = disabled;
10757 }
10758
10759 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10760 className: classes
10761 }));
10762 };
10763
10764 FormGroup.propTypes = propTypes$S;
10765 FormGroup.defaultProps = defaultProps$O;
10766
10767 var propTypes$T = {
10768 children: propTypes.node,
10769 inline: propTypes.bool,
10770 tag: tagPropType,
10771 color: propTypes.string,
10772 className: propTypes.string,
10773 cssModule: propTypes.object
10774 };
10775 var defaultProps$P = {
10776 tag: 'small',
10777 color: 'muted'
10778 };
10779
10780 var FormText = function FormText(props) {
10781 var className = props.className,
10782 cssModule = props.cssModule,
10783 inline = props.inline,
10784 color = props.color,
10785 Tag = props.tag,
10786 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
10787
10788 var classes = mapToCssModules(classnames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
10789 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10790 className: classes
10791 }));
10792 };
10793
10794 FormText.propTypes = propTypes$T;
10795 FormText.defaultProps = defaultProps$P;
10796
10797 var propTypes$U = {
10798 children: propTypes.node,
10799 type: propTypes.string,
10800 size: propTypes.oneOfType([propTypes.number, propTypes.string]),
10801 bsSize: propTypes.string,
10802 valid: propTypes.bool,
10803 invalid: propTypes.bool,
10804 tag: tagPropType,
10805 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
10806 plaintext: propTypes.bool,
10807 addon: propTypes.bool,
10808 className: propTypes.string,
10809 cssModule: propTypes.object
10810 };
10811 var defaultProps$Q = {
10812 type: 'text'
10813 };
10814
10815 var Input = /*#__PURE__*/function (_React$Component) {
10816 _inheritsLoose(Input, _React$Component);
10817
10818 function Input(props) {
10819 var _this;
10820
10821 _this = _React$Component.call(this, props) || this;
10822 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
10823 _this.focus = _this.focus.bind(_assertThisInitialized(_this));
10824 return _this;
10825 }
10826
10827 var _proto = Input.prototype;
10828
10829 _proto.getRef = function getRef(ref) {
10830 if (this.props.innerRef) {
10831 this.props.innerRef(ref);
10832 }
10833
10834 this.ref = ref;
10835 };
10836
10837 _proto.focus = function focus() {
10838 if (this.ref) {
10839 this.ref.focus();
10840 }
10841 };
10842
10843 _proto.render = function render() {
10844 var _this$props = this.props,
10845 className = _this$props.className,
10846 cssModule = _this$props.cssModule,
10847 type = _this$props.type,
10848 bsSize = _this$props.bsSize,
10849 valid = _this$props.valid,
10850 invalid = _this$props.invalid,
10851 tag = _this$props.tag,
10852 addon = _this$props.addon,
10853 plaintext = _this$props.plaintext,
10854 innerRef = _this$props.innerRef,
10855 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "valid", "invalid", "tag", "addon", "plaintext", "innerRef"]);
10856
10857 var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
10858 var isNotaNumber = new RegExp('\\D', 'g');
10859 var fileInput = type === 'file';
10860 var textareaInput = type === 'textarea';
10861 var selectInput = type === 'select';
10862 var rangeInput = type === 'range';
10863 var Tag = tag || (selectInput || textareaInput ? type : 'input');
10864 var formControlClass = 'form-control';
10865
10866 if (plaintext) {
10867 formControlClass = formControlClass + "-plaintext";
10868 Tag = tag || 'input';
10869 } else if (fileInput) {
10870 formControlClass = formControlClass + "-file";
10871 } else if (rangeInput) {
10872 formControlClass = formControlClass + "-range";
10873 } else if (checkInput) {
10874 if (addon) {
10875 formControlClass = null;
10876 } else {
10877 formControlClass = 'form-check-input';
10878 }
10879 }
10880
10881 if (attributes.size && isNotaNumber.test(attributes.size)) {
10882 warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
10883 bsSize = attributes.size;
10884 delete attributes.size;
10885 }
10886
10887 var classes = mapToCssModules(classnames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
10888
10889 if (Tag === 'input' || tag && typeof tag === 'function') {
10890 attributes.type = type;
10891 }
10892
10893 if (attributes.children && !(plaintext || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
10894 warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
10895 delete attributes.children;
10896 }
10897
10898 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10899 ref: innerRef,
10900 className: classes,
10901 "aria-invalid": invalid
10902 }));
10903 };
10904
10905 return Input;
10906 }(React__default.Component);
10907
10908 Input.propTypes = propTypes$U;
10909 Input.defaultProps = defaultProps$Q;
10910
10911 var propTypes$V = {
10912 tag: tagPropType,
10913 size: propTypes.string,
10914 className: propTypes.string,
10915 cssModule: propTypes.object
10916 };
10917 var defaultProps$R = {
10918 tag: 'div'
10919 };
10920
10921 var InputGroup = function InputGroup(props) {
10922 var className = props.className,
10923 cssModule = props.cssModule,
10924 Tag = props.tag,
10925 size = props.size,
10926 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
10927
10928 var classes = mapToCssModules(classnames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
10929 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10930 className: classes
10931 }));
10932 };
10933
10934 InputGroup.propTypes = propTypes$V;
10935 InputGroup.defaultProps = defaultProps$R;
10936
10937 var propTypes$W = {
10938 tag: tagPropType,
10939 className: propTypes.string,
10940 cssModule: propTypes.object
10941 };
10942 var defaultProps$S = {
10943 tag: 'span'
10944 };
10945
10946 var InputGroupText = function InputGroupText(props) {
10947 var className = props.className,
10948 cssModule = props.cssModule,
10949 Tag = props.tag,
10950 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
10951
10952 var classes = mapToCssModules(classnames(className, 'input-group-text'), cssModule);
10953 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10954 className: classes
10955 }));
10956 };
10957
10958 InputGroupText.propTypes = propTypes$W;
10959 InputGroupText.defaultProps = defaultProps$S;
10960
10961 var propTypes$X = {
10962 tag: tagPropType,
10963 addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
10964 children: propTypes.node,
10965 className: propTypes.string,
10966 cssModule: propTypes.object
10967 };
10968 var defaultProps$T = {
10969 tag: 'div'
10970 };
10971
10972 var InputGroupAddon = function InputGroupAddon(props) {
10973 var className = props.className,
10974 cssModule = props.cssModule,
10975 Tag = props.tag,
10976 addonType = props.addonType,
10977 children = props.children,
10978 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
10979
10980 var classes = mapToCssModules(classnames(className, 'input-group-' + addonType), cssModule); // Convenience to assist with transition
10981
10982 if (typeof children === 'string') {
10983 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10984 className: classes
10985 }), /*#__PURE__*/React__default.createElement(InputGroupText, {
10986 children: children
10987 }));
10988 }
10989
10990 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
10991 className: classes,
10992 children: children
10993 }));
10994 };
10995
10996 InputGroupAddon.propTypes = propTypes$X;
10997 InputGroupAddon.defaultProps = defaultProps$T;
10998
10999 var propTypes$Y = {
11000 addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
11001 children: propTypes.node
11002 };
11003
11004 var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
11005 return /*#__PURE__*/React__default.createElement(Dropdown, props);
11006 };
11007
11008 InputGroupButtonDropdown.propTypes = propTypes$Y;
11009
11010 var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
11011 var stringOrNumberProp$1 = propTypes.oneOfType([propTypes.number, propTypes.string]);
11012 var columnProps$1 = propTypes.oneOfType([propTypes.bool, propTypes.string, propTypes.number, propTypes.shape({
11013 size: stringOrNumberProp$1,
11014 order: stringOrNumberProp$1,
11015 offset: stringOrNumberProp$1
11016 })]);
11017 var propTypes$Z = {
11018 children: propTypes.node,
11019 hidden: propTypes.bool,
11020 check: propTypes.bool,
11021 size: propTypes.string,
11022 for: propTypes.string,
11023 tag: tagPropType,
11024 className: propTypes.string,
11025 cssModule: propTypes.object,
11026 xs: columnProps$1,
11027 sm: columnProps$1,
11028 md: columnProps$1,
11029 lg: columnProps$1,
11030 xl: columnProps$1,
11031 widths: propTypes.array
11032 };
11033 var defaultProps$U = {
11034 tag: 'label',
11035 widths: colWidths$1
11036 };
11037
11038 var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
11039 if (colSize === true || colSize === '') {
11040 return isXs ? 'col' : "col-" + colWidth;
11041 } else if (colSize === 'auto') {
11042 return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
11043 }
11044
11045 return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
11046 };
11047
11048 var Label = function Label(props) {
11049 var className = props.className,
11050 cssModule = props.cssModule,
11051 hidden = props.hidden,
11052 widths = props.widths,
11053 Tag = props.tag,
11054 check = props.check,
11055 size = props.size,
11056 htmlFor = props.for,
11057 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
11058
11059 var colClasses = [];
11060 widths.forEach(function (colWidth, i) {
11061 var columnProp = props[colWidth];
11062 delete attributes[colWidth];
11063
11064 if (!columnProp && columnProp !== '') {
11065 return;
11066 }
11067
11068 var isXs = !i;
11069 var colClass;
11070
11071 if (isObject(columnProp)) {
11072 var _classNames;
11073
11074 var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
11075 colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
11076 colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames))), cssModule);
11077 } else {
11078 colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
11079 colClasses.push(colClass);
11080 }
11081 });
11082 var classes = mapToCssModules(classnames(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? "col-form-label-" + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule);
11083 return /*#__PURE__*/React__default.createElement(Tag, _extends({
11084 htmlFor: htmlFor
11085 }, attributes, {
11086 className: classes
11087 }));
11088 };
11089
11090 Label.propTypes = propTypes$Z;
11091 Label.defaultProps = defaultProps$U;
11092
11093 var propTypes$_ = {
11094 body: propTypes.bool,
11095 bottom: propTypes.bool,
11096 children: propTypes.node,
11097 className: propTypes.string,
11098 cssModule: propTypes.object,
11099 heading: propTypes.bool,
11100 left: propTypes.bool,
11101 list: propTypes.bool,
11102 middle: propTypes.bool,
11103 object: propTypes.bool,
11104 right: propTypes.bool,
11105 tag: tagPropType,
11106 top: propTypes.bool
11107 };
11108
11109 var Media = function Media(props) {
11110 var body = props.body,
11111 bottom = props.bottom,
11112 className = props.className,
11113 cssModule = props.cssModule,
11114 heading = props.heading,
11115 left = props.left,
11116 list = props.list,
11117 middle = props.middle,
11118 object = props.object,
11119 right = props.right,
11120 tag = props.tag,
11121 top = props.top,
11122 attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
11123
11124 var defaultTag;
11125
11126 if (heading) {
11127 defaultTag = 'h4';
11128 } else if (attributes.href) {
11129 defaultTag = 'a';
11130 } else if (attributes.src || object) {
11131 defaultTag = 'img';
11132 } else if (list) {
11133 defaultTag = 'ul';
11134 } else {
11135 defaultTag = 'div';
11136 }
11137
11138 var Tag = tag || defaultTag;
11139 var classes = mapToCssModules(classnames(className, {
11140 'media-body': body,
11141 'media-heading': heading,
11142 'media-left': left,
11143 'media-right': right,
11144 'media-top': top,
11145 'media-bottom': bottom,
11146 'media-middle': middle,
11147 'media-object': object,
11148 'media-list': list,
11149 media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
11150 }), cssModule);
11151 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11152 className: classes
11153 }));
11154 };
11155
11156 Media.propTypes = propTypes$_;
11157
11158 var propTypes$$ = {
11159 children: propTypes.node,
11160 className: propTypes.string,
11161 listClassName: propTypes.string,
11162 cssModule: propTypes.object,
11163 size: propTypes.string,
11164 tag: tagPropType,
11165 listTag: tagPropType,
11166 'aria-label': propTypes.string
11167 };
11168 var defaultProps$V = {
11169 tag: 'nav',
11170 listTag: 'ul',
11171 'aria-label': 'pagination'
11172 };
11173
11174 var Pagination = function Pagination(props) {
11175 var _classNames;
11176
11177 var className = props.className,
11178 listClassName = props.listClassName,
11179 cssModule = props.cssModule,
11180 size = props.size,
11181 Tag = props.tag,
11182 ListTag = props.listTag,
11183 label = props['aria-label'],
11184 attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
11185
11186 var classes = mapToCssModules(classnames(className), cssModule);
11187 var listClasses = mapToCssModules(classnames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
11188 return /*#__PURE__*/React__default.createElement(Tag, {
11189 className: classes,
11190 "aria-label": label
11191 }, /*#__PURE__*/React__default.createElement(ListTag, _extends({}, attributes, {
11192 className: listClasses
11193 })));
11194 };
11195
11196 Pagination.propTypes = propTypes$$;
11197 Pagination.defaultProps = defaultProps$V;
11198
11199 var propTypes$10 = {
11200 active: propTypes.bool,
11201 children: propTypes.node,
11202 className: propTypes.string,
11203 cssModule: propTypes.object,
11204 disabled: propTypes.bool,
11205 tag: tagPropType
11206 };
11207 var defaultProps$W = {
11208 tag: 'li'
11209 };
11210
11211 var PaginationItem = function PaginationItem(props) {
11212 var active = props.active,
11213 className = props.className,
11214 cssModule = props.cssModule,
11215 disabled = props.disabled,
11216 Tag = props.tag,
11217 attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
11218
11219 var classes = mapToCssModules(classnames(className, 'page-item', {
11220 active: active,
11221 disabled: disabled
11222 }), cssModule);
11223 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11224 className: classes
11225 }));
11226 };
11227
11228 PaginationItem.propTypes = propTypes$10;
11229 PaginationItem.defaultProps = defaultProps$W;
11230
11231 var propTypes$11 = {
11232 'aria-label': propTypes.string,
11233 children: propTypes.node,
11234 className: propTypes.string,
11235 cssModule: propTypes.object,
11236 next: propTypes.bool,
11237 previous: propTypes.bool,
11238 first: propTypes.bool,
11239 last: propTypes.bool,
11240 tag: tagPropType
11241 };
11242 var defaultProps$X = {
11243 tag: 'a'
11244 };
11245
11246 var PaginationLink = function PaginationLink(props) {
11247 var className = props.className,
11248 cssModule = props.cssModule,
11249 next = props.next,
11250 previous = props.previous,
11251 first = props.first,
11252 last = props.last,
11253 Tag = props.tag,
11254 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "first", "last", "tag"]);
11255
11256 var classes = mapToCssModules(classnames(className, 'page-link'), cssModule);
11257 var defaultAriaLabel;
11258
11259 if (previous) {
11260 defaultAriaLabel = 'Previous';
11261 } else if (next) {
11262 defaultAriaLabel = 'Next';
11263 } else if (first) {
11264 defaultAriaLabel = 'First';
11265 } else if (last) {
11266 defaultAriaLabel = 'Last';
11267 }
11268
11269 var ariaLabel = props['aria-label'] || defaultAriaLabel;
11270 var defaultCaret;
11271
11272 if (previous) {
11273 defaultCaret = "\u2039";
11274 } else if (next) {
11275 defaultCaret = "\u203A";
11276 } else if (first) {
11277 defaultCaret = "\xAB";
11278 } else if (last) {
11279 defaultCaret = "\xBB";
11280 }
11281
11282 var children = props.children;
11283
11284 if (children && Array.isArray(children) && children.length === 0) {
11285 children = null;
11286 }
11287
11288 if (!attributes.href && Tag === 'a') {
11289 Tag = 'button';
11290 }
11291
11292 if (previous || next || first || last) {
11293 children = [/*#__PURE__*/React__default.createElement("span", {
11294 "aria-hidden": "true",
11295 key: "caret"
11296 }, children || defaultCaret), /*#__PURE__*/React__default.createElement("span", {
11297 className: "sr-only",
11298 key: "sr"
11299 }, ariaLabel)];
11300 }
11301
11302 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11303 className: classes,
11304 "aria-label": ariaLabel
11305 }), children);
11306 };
11307
11308 PaginationLink.propTypes = propTypes$11;
11309 PaginationLink.defaultProps = defaultProps$X;
11310
11311 /**
11312 * TabContext
11313 * {
11314 * activeTabId: PropTypes.any
11315 * }
11316 */
11317
11318 var TabContext = /*#__PURE__*/React__default.createContext({});
11319
11320 var propTypes$12 = {
11321 tag: tagPropType,
11322 activeTab: propTypes.any,
11323 className: propTypes.string,
11324 cssModule: propTypes.object
11325 };
11326 var defaultProps$Y = {
11327 tag: 'div'
11328 };
11329
11330 var TabContent = /*#__PURE__*/function (_Component) {
11331 _inheritsLoose(TabContent, _Component);
11332
11333 TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
11334 if (prevState.activeTab !== nextProps.activeTab) {
11335 return {
11336 activeTab: nextProps.activeTab
11337 };
11338 }
11339
11340 return null;
11341 };
11342
11343 function TabContent(props) {
11344 var _this;
11345
11346 _this = _Component.call(this, props) || this;
11347 _this.state = {
11348 activeTab: _this.props.activeTab
11349 };
11350 return _this;
11351 }
11352
11353 var _proto = TabContent.prototype;
11354
11355 _proto.render = function render() {
11356 var _this$props = this.props,
11357 className = _this$props.className,
11358 cssModule = _this$props.cssModule,
11359 Tag = _this$props.tag;
11360 var attributes = omit(this.props, Object.keys(propTypes$12));
11361 var classes = mapToCssModules(classnames('tab-content', className), cssModule);
11362 return /*#__PURE__*/React__default.createElement(TabContext.Provider, {
11363 value: {
11364 activeTabId: this.state.activeTab
11365 }
11366 }, /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11367 className: classes
11368 })));
11369 };
11370
11371 return TabContent;
11372 }(React.Component);
11373 TabContent.propTypes = propTypes$12;
11374 TabContent.defaultProps = defaultProps$Y;
11375
11376 var propTypes$13 = {
11377 tag: tagPropType,
11378 className: propTypes.string,
11379 cssModule: propTypes.object,
11380 tabId: propTypes.any
11381 };
11382 var defaultProps$Z = {
11383 tag: 'div'
11384 };
11385 function TabPane(props) {
11386 var className = props.className,
11387 cssModule = props.cssModule,
11388 tabId = props.tabId,
11389 Tag = props.tag,
11390 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
11391
11392 var getClasses = function getClasses(activeTabId) {
11393 return mapToCssModules(classnames('tab-pane', className, {
11394 active: tabId === activeTabId
11395 }), cssModule);
11396 };
11397
11398 return /*#__PURE__*/React__default.createElement(TabContext.Consumer, null, function (_ref) {
11399 var activeTabId = _ref.activeTabId;
11400 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11401 className: getClasses(activeTabId)
11402 }));
11403 });
11404 }
11405 TabPane.propTypes = propTypes$13;
11406 TabPane.defaultProps = defaultProps$Z;
11407
11408 var propTypes$14 = {
11409 tag: tagPropType,
11410 fluid: propTypes.bool,
11411 className: propTypes.string,
11412 cssModule: propTypes.object
11413 };
11414 var defaultProps$_ = {
11415 tag: 'div'
11416 };
11417
11418 var Jumbotron = function Jumbotron(props) {
11419 var className = props.className,
11420 cssModule = props.cssModule,
11421 Tag = props.tag,
11422 fluid = props.fluid,
11423 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
11424
11425 var classes = mapToCssModules(classnames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
11426 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11427 className: classes
11428 }));
11429 };
11430
11431 Jumbotron.propTypes = propTypes$14;
11432 Jumbotron.defaultProps = defaultProps$_;
11433
11434 var propTypes$15 = {
11435 children: propTypes.node,
11436 className: propTypes.string,
11437 closeClassName: propTypes.string,
11438 closeAriaLabel: propTypes.string,
11439 cssModule: propTypes.object,
11440 color: propTypes.string,
11441 fade: propTypes.bool,
11442 isOpen: propTypes.bool,
11443 toggle: propTypes.func,
11444 tag: tagPropType,
11445 transition: propTypes.shape(Fade.propTypes),
11446 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
11447 };
11448 var defaultProps$$ = {
11449 color: 'success',
11450 isOpen: true,
11451 tag: 'div',
11452 closeAriaLabel: 'Close',
11453 fade: true,
11454 transition: _extends({}, Fade.defaultProps, {
11455 unmountOnExit: true
11456 })
11457 };
11458
11459 function Alert(props) {
11460 var className = props.className,
11461 closeClassName = props.closeClassName,
11462 closeAriaLabel = props.closeAriaLabel,
11463 cssModule = props.cssModule,
11464 Tag = props.tag,
11465 color = props.color,
11466 isOpen = props.isOpen,
11467 toggle = props.toggle,
11468 children = props.children,
11469 transition = props.transition,
11470 fade = props.fade,
11471 innerRef = props.innerRef,
11472 attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
11473
11474 var classes = mapToCssModules(classnames(className, 'alert', "alert-" + color, {
11475 'alert-dismissible': toggle
11476 }), cssModule);
11477 var closeClasses = mapToCssModules(classnames('close', closeClassName), cssModule);
11478
11479 var alertTransition = _extends({}, Fade.defaultProps, transition, {
11480 baseClass: fade ? transition.baseClass : '',
11481 timeout: fade ? transition.timeout : 0
11482 });
11483
11484 return /*#__PURE__*/React__default.createElement(Fade, _extends({}, attributes, alertTransition, {
11485 tag: Tag,
11486 className: classes,
11487 in: isOpen,
11488 role: "alert",
11489 innerRef: innerRef
11490 }), toggle ? /*#__PURE__*/React__default.createElement("button", {
11491 type: "button",
11492 className: closeClasses,
11493 "aria-label": closeAriaLabel,
11494 onClick: toggle
11495 }, /*#__PURE__*/React__default.createElement("span", {
11496 "aria-hidden": "true"
11497 }, "\xD7")) : null, children);
11498 }
11499
11500 Alert.propTypes = propTypes$15;
11501 Alert.defaultProps = defaultProps$$;
11502
11503 var propTypes$16 = {
11504 children: propTypes.node,
11505 className: propTypes.string,
11506 cssModule: propTypes.object,
11507 fade: propTypes.bool,
11508 isOpen: propTypes.bool,
11509 tag: tagPropType,
11510 transition: propTypes.shape(Fade.propTypes),
11511 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
11512 };
11513 var defaultProps$10 = {
11514 isOpen: true,
11515 tag: 'div',
11516 fade: true,
11517 transition: _extends({}, Fade.defaultProps, {
11518 unmountOnExit: true
11519 })
11520 };
11521
11522 function Toast(props) {
11523 var className = props.className,
11524 cssModule = props.cssModule,
11525 Tag = props.tag,
11526 isOpen = props.isOpen,
11527 children = props.children,
11528 transition = props.transition,
11529 fade = props.fade,
11530 innerRef = props.innerRef,
11531 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "isOpen", "children", "transition", "fade", "innerRef"]);
11532
11533 var classes = mapToCssModules(classnames(className, 'toast'), cssModule);
11534
11535 var toastTransition = _extends({}, Fade.defaultProps, transition, {
11536 baseClass: fade ? transition.baseClass : '',
11537 timeout: fade ? transition.timeout : 0
11538 });
11539
11540 return /*#__PURE__*/React__default.createElement(Fade, _extends({}, attributes, toastTransition, {
11541 tag: Tag,
11542 className: classes,
11543 in: isOpen,
11544 role: "alert",
11545 innerRef: innerRef
11546 }), children);
11547 }
11548
11549 Toast.propTypes = propTypes$16;
11550 Toast.defaultProps = defaultProps$10;
11551
11552 var propTypes$17 = {
11553 tag: tagPropType,
11554 className: propTypes.string,
11555 cssModule: propTypes.object,
11556 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
11557 };
11558 var defaultProps$11 = {
11559 tag: 'div'
11560 };
11561
11562 var ToastBody = function ToastBody(props) {
11563 var className = props.className,
11564 cssModule = props.cssModule,
11565 innerRef = props.innerRef,
11566 Tag = props.tag,
11567 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
11568
11569 var classes = mapToCssModules(classnames(className, 'toast-body'), cssModule);
11570 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11571 className: classes,
11572 ref: innerRef
11573 }));
11574 };
11575
11576 ToastBody.propTypes = propTypes$17;
11577 ToastBody.defaultProps = defaultProps$11;
11578
11579 var propTypes$18 = {
11580 tag: tagPropType,
11581 icon: propTypes.oneOfType([propTypes.string, propTypes.node]),
11582 wrapTag: tagPropType,
11583 toggle: propTypes.func,
11584 className: propTypes.string,
11585 cssModule: propTypes.object,
11586 children: propTypes.node,
11587 closeAriaLabel: propTypes.string,
11588 charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
11589 close: propTypes.object
11590 };
11591 var defaultProps$12 = {
11592 tag: 'strong',
11593 wrapTag: 'div',
11594 tagClassName: 'mr-auto',
11595 closeAriaLabel: 'Close',
11596 charCode: 215
11597 };
11598
11599 var ToastHeader = function ToastHeader(props) {
11600 var closeButton;
11601 var icon;
11602
11603 var className = props.className,
11604 cssModule = props.cssModule,
11605 children = props.children,
11606 toggle = props.toggle,
11607 Tag = props.tag,
11608 WrapTag = props.wrapTag,
11609 closeAriaLabel = props.closeAriaLabel,
11610 charCode = props.charCode,
11611 close = props.close,
11612 tagClassName = props.tagClassName,
11613 iconProp = props.icon,
11614 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close", "tagClassName", "icon"]);
11615
11616 var classes = mapToCssModules(classnames(className, 'toast-header'), cssModule);
11617
11618 if (!close && toggle) {
11619 var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
11620 closeButton = /*#__PURE__*/React__default.createElement("button", {
11621 type: "button",
11622 onClick: toggle,
11623 className: mapToCssModules('close', cssModule),
11624 "aria-label": closeAriaLabel
11625 }, /*#__PURE__*/React__default.createElement("span", {
11626 "aria-hidden": "true"
11627 }, closeIcon));
11628 }
11629
11630 if (typeof iconProp === "string") {
11631 icon = /*#__PURE__*/React__default.createElement("svg", {
11632 className: mapToCssModules("rounded text-" + iconProp),
11633 width: "20",
11634 height: "20",
11635 xmlns: "http://www.w3.org/2000/svg",
11636 preserveAspectRatio: "xMidYMid slice",
11637 focusable: "false",
11638 role: "img"
11639 }, /*#__PURE__*/React__default.createElement("rect", {
11640 fill: "currentColor",
11641 width: "100%",
11642 height: "100%"
11643 }));
11644 } else if (iconProp) {
11645 icon = iconProp;
11646 }
11647
11648 return /*#__PURE__*/React__default.createElement(WrapTag, _extends({}, attributes, {
11649 className: classes
11650 }), icon, /*#__PURE__*/React__default.createElement(Tag, {
11651 className: mapToCssModules(classnames(tagClassName, {
11652 "ml-2": icon != null
11653 }), cssModule)
11654 }, children), close || closeButton);
11655 };
11656
11657 ToastHeader.propTypes = propTypes$18;
11658 ToastHeader.defaultProps = defaultProps$12;
11659
11660 var _transitionStatusToCl;
11661
11662 var propTypes$19 = _extends({}, reactTransitionGroup_1.propTypes, {
11663 isOpen: propTypes.bool,
11664 children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
11665 tag: tagPropType,
11666 className: propTypes.node,
11667 navbar: propTypes.bool,
11668 cssModule: propTypes.object,
11669 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
11670 });
11671
11672 var defaultProps$13 = _extends({}, reactTransitionGroup_1.defaultProps, {
11673 isOpen: false,
11674 appear: false,
11675 enter: true,
11676 exit: true,
11677 tag: 'div',
11678 timeout: TransitionTimeouts.Collapse
11679 });
11680
11681 var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
11682
11683 function getTransitionClass(status) {
11684 return transitionStatusToClassHash[status] || 'collapse';
11685 }
11686
11687 function getHeight(node) {
11688 return node.scrollHeight;
11689 }
11690
11691 var Collapse = /*#__PURE__*/function (_Component) {
11692 _inheritsLoose(Collapse, _Component);
11693
11694 function Collapse(props) {
11695 var _this;
11696
11697 _this = _Component.call(this, props) || this;
11698 _this.state = {
11699 height: null
11700 };
11701 ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
11702 _this[name] = _this[name].bind(_assertThisInitialized(_this));
11703 });
11704 return _this;
11705 }
11706
11707 var _proto = Collapse.prototype;
11708
11709 _proto.onEntering = function onEntering(node, isAppearing) {
11710 this.setState({
11711 height: getHeight(node)
11712 });
11713 this.props.onEntering(node, isAppearing);
11714 };
11715
11716 _proto.onEntered = function onEntered(node, isAppearing) {
11717 this.setState({
11718 height: null
11719 });
11720 this.props.onEntered(node, isAppearing);
11721 };
11722
11723 _proto.onExit = function onExit(node) {
11724 this.setState({
11725 height: getHeight(node)
11726 });
11727 this.props.onExit(node);
11728 };
11729
11730 _proto.onExiting = function onExiting(node) {
11731 // getting this variable triggers a reflow
11732 var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars
11733
11734 this.setState({
11735 height: 0
11736 });
11737 this.props.onExiting(node);
11738 };
11739
11740 _proto.onExited = function onExited(node) {
11741 this.setState({
11742 height: null
11743 });
11744 this.props.onExited(node);
11745 };
11746
11747 _proto.render = function render() {
11748 var _this2 = this;
11749
11750 var _this$props = this.props,
11751 Tag = _this$props.tag,
11752 isOpen = _this$props.isOpen,
11753 className = _this$props.className,
11754 navbar = _this$props.navbar,
11755 cssModule = _this$props.cssModule,
11756 children = _this$props.children,
11757 innerRef = _this$props.innerRef,
11758 otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
11759
11760 var height = this.state.height;
11761 var transitionProps = pick(otherProps, TransitionPropTypeKeys);
11762 var childProps = omit(otherProps, TransitionPropTypeKeys);
11763 return /*#__PURE__*/React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
11764 in: isOpen,
11765 onEntering: this.onEntering,
11766 onEntered: this.onEntered,
11767 onExit: this.onExit,
11768 onExiting: this.onExiting,
11769 onExited: this.onExited
11770 }), function (status) {
11771 var collapseClass = getTransitionClass(status);
11772 var classes = mapToCssModules(classnames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
11773 var style = height === null ? null : {
11774 height: height
11775 };
11776 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, childProps, {
11777 style: _extends({}, childProps.style, style),
11778 className: classes,
11779 ref: _this2.props.innerRef
11780 }), children);
11781 });
11782 };
11783
11784 return Collapse;
11785 }(React.Component);
11786
11787 Collapse.propTypes = propTypes$19;
11788 Collapse.defaultProps = defaultProps$13;
11789
11790 var propTypes$1a = {
11791 tag: tagPropType,
11792 active: propTypes.bool,
11793 disabled: propTypes.bool,
11794 color: propTypes.string,
11795 action: propTypes.bool,
11796 className: propTypes.any,
11797 cssModule: propTypes.object
11798 };
11799 var defaultProps$14 = {
11800 tag: 'li'
11801 };
11802
11803 var handleDisabledOnClick = function handleDisabledOnClick(e) {
11804 e.preventDefault();
11805 };
11806
11807 var ListGroupItem = function ListGroupItem(props) {
11808 var className = props.className,
11809 cssModule = props.cssModule,
11810 Tag = props.tag,
11811 active = props.active,
11812 disabled = props.disabled,
11813 action = props.action,
11814 color = props.color,
11815 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
11816
11817 var classes = mapToCssModules(classnames(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? "list-group-item-" + color : false, 'list-group-item'), cssModule); // Prevent click event when disabled.
11818
11819 if (disabled) {
11820 attributes.onClick = handleDisabledOnClick;
11821 }
11822
11823 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11824 className: classes
11825 }));
11826 };
11827
11828 ListGroupItem.propTypes = propTypes$1a;
11829 ListGroupItem.defaultProps = defaultProps$14;
11830
11831 var propTypes$1b = {
11832 tag: tagPropType,
11833 className: propTypes.any,
11834 cssModule: propTypes.object
11835 };
11836 var defaultProps$15 = {
11837 tag: 'h5'
11838 };
11839
11840 var ListGroupItemHeading = function ListGroupItemHeading(props) {
11841 var className = props.className,
11842 cssModule = props.cssModule,
11843 Tag = props.tag,
11844 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
11845
11846 var classes = mapToCssModules(classnames(className, 'list-group-item-heading'), cssModule);
11847 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11848 className: classes
11849 }));
11850 };
11851
11852 ListGroupItemHeading.propTypes = propTypes$1b;
11853 ListGroupItemHeading.defaultProps = defaultProps$15;
11854
11855 var propTypes$1c = {
11856 tag: tagPropType,
11857 className: propTypes.any,
11858 cssModule: propTypes.object
11859 };
11860 var defaultProps$16 = {
11861 tag: 'p'
11862 };
11863
11864 var ListGroupItemText = function ListGroupItemText(props) {
11865 var className = props.className,
11866 cssModule = props.cssModule,
11867 Tag = props.tag,
11868 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
11869
11870 var classes = mapToCssModules(classnames(className, 'list-group-item-text'), cssModule);
11871 return /*#__PURE__*/React__default.createElement(Tag, _extends({}, attributes, {
11872 className: classes
11873 }));
11874 };
11875
11876 ListGroupItemText.propTypes = propTypes$1c;
11877 ListGroupItemText.defaultProps = defaultProps$16;
11878
11879 var UncontrolledAlert = /*#__PURE__*/function (_Component) {
11880 _inheritsLoose(UncontrolledAlert, _Component);
11881
11882 function UncontrolledAlert(props) {
11883 var _this;
11884
11885 _this = _Component.call(this, props) || this;
11886 _this.state = {
11887 isOpen: true
11888 };
11889 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
11890 return _this;
11891 }
11892
11893 var _proto = UncontrolledAlert.prototype;
11894
11895 _proto.toggle = function toggle() {
11896 this.setState({
11897 isOpen: !this.state.isOpen
11898 });
11899 };
11900
11901 _proto.render = function render() {
11902 return /*#__PURE__*/React__default.createElement(Alert, _extends({
11903 isOpen: this.state.isOpen,
11904 toggle: this.toggle
11905 }, this.props));
11906 };
11907
11908 return UncontrolledAlert;
11909 }(React.Component);
11910
11911 var omitKeys$1 = ['defaultOpen'];
11912
11913 var UncontrolledButtonDropdown = /*#__PURE__*/function (_Component) {
11914 _inheritsLoose(UncontrolledButtonDropdown, _Component);
11915
11916 function UncontrolledButtonDropdown(props) {
11917 var _this;
11918
11919 _this = _Component.call(this, props) || this;
11920 _this.state = {
11921 isOpen: props.defaultOpen || false
11922 };
11923 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
11924 return _this;
11925 }
11926
11927 var _proto = UncontrolledButtonDropdown.prototype;
11928
11929 _proto.toggle = function toggle() {
11930 this.setState({
11931 isOpen: !this.state.isOpen
11932 });
11933 };
11934
11935 _proto.render = function render() {
11936 return /*#__PURE__*/React__default.createElement(ButtonDropdown, _extends({
11937 isOpen: this.state.isOpen,
11938 toggle: this.toggle
11939 }, omit(this.props, omitKeys$1)));
11940 };
11941
11942 return UncontrolledButtonDropdown;
11943 }(React.Component);
11944 UncontrolledButtonDropdown.propTypes = _extends({
11945 defaultOpen: propTypes.bool
11946 }, ButtonDropdown.propTypes);
11947
11948 var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
11949 var propTypes$1d = {
11950 defaultOpen: propTypes.bool,
11951 toggler: propTypes.string.isRequired,
11952 toggleEvents: propTypes.arrayOf(propTypes.string)
11953 };
11954 var defaultProps$17 = {
11955 toggleEvents: defaultToggleEvents
11956 };
11957
11958 var UncontrolledCollapse = /*#__PURE__*/function (_Component) {
11959 _inheritsLoose(UncontrolledCollapse, _Component);
11960
11961 function UncontrolledCollapse(props) {
11962 var _this;
11963
11964 _this = _Component.call(this, props) || this;
11965 _this.togglers = null;
11966 _this.removeEventListeners = null;
11967 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
11968 _this.state = {
11969 isOpen: props.defaultOpen || false
11970 };
11971 return _this;
11972 }
11973
11974 var _proto = UncontrolledCollapse.prototype;
11975
11976 _proto.componentDidMount = function componentDidMount() {
11977 this.togglers = findDOMElements(this.props.toggler);
11978
11979 if (this.togglers.length) {
11980 this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
11981 }
11982 };
11983
11984 _proto.componentWillUnmount = function componentWillUnmount() {
11985 if (this.togglers.length && this.removeEventListeners) {
11986 this.removeEventListeners();
11987 }
11988 };
11989
11990 _proto.toggle = function toggle(e) {
11991 this.setState(function (_ref) {
11992 var isOpen = _ref.isOpen;
11993 return {
11994 isOpen: !isOpen
11995 };
11996 });
11997 e.preventDefault();
11998 };
11999
12000 _proto.render = function render() {
12001 return /*#__PURE__*/React__default.createElement(Collapse, _extends({
12002 isOpen: this.state.isOpen
12003 }, omit(this.props, omitKeys$2)));
12004 };
12005
12006 return UncontrolledCollapse;
12007 }(React.Component);
12008
12009 UncontrolledCollapse.propTypes = propTypes$1d;
12010 UncontrolledCollapse.defaultProps = defaultProps$17;
12011
12012 var omitKeys$3 = ['defaultOpen'];
12013
12014 var UncontrolledDropdown = /*#__PURE__*/function (_Component) {
12015 _inheritsLoose(UncontrolledDropdown, _Component);
12016
12017 function UncontrolledDropdown(props) {
12018 var _this;
12019
12020 _this = _Component.call(this, props) || this;
12021 _this.state = {
12022 isOpen: props.defaultOpen || false
12023 };
12024 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
12025 return _this;
12026 }
12027
12028 var _proto = UncontrolledDropdown.prototype;
12029
12030 _proto.toggle = function toggle(e) {
12031 this.setState({
12032 isOpen: !this.state.isOpen
12033 });
12034
12035 if (this.props.onToggle) {
12036 this.props.onToggle(e, !this.state.isOpen);
12037 }
12038 };
12039
12040 _proto.render = function render() {
12041 return /*#__PURE__*/React__default.createElement(Dropdown, _extends({
12042 isOpen: this.state.isOpen,
12043 toggle: this.toggle
12044 }, omit(this.props, omitKeys$3)));
12045 };
12046
12047 return UncontrolledDropdown;
12048 }(React.Component);
12049 UncontrolledDropdown.propTypes = _extends({
12050 defaultOpen: propTypes.bool,
12051 onToggle: propTypes.func
12052 }, Dropdown.propTypes);
12053
12054 var omitKeys$4 = ['defaultOpen'];
12055
12056 var UncontrolledTooltip = /*#__PURE__*/function (_Component) {
12057 _inheritsLoose(UncontrolledTooltip, _Component);
12058
12059 function UncontrolledTooltip(props) {
12060 var _this;
12061
12062 _this = _Component.call(this, props) || this;
12063 _this.state = {
12064 isOpen: props.defaultOpen || false
12065 };
12066 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
12067 return _this;
12068 }
12069
12070 var _proto = UncontrolledTooltip.prototype;
12071
12072 _proto.toggle = function toggle() {
12073 this.setState({
12074 isOpen: !this.state.isOpen
12075 });
12076 };
12077
12078 _proto.render = function render() {
12079 return /*#__PURE__*/React__default.createElement(Tooltip, _extends({
12080 isOpen: this.state.isOpen,
12081 toggle: this.toggle
12082 }, omit(this.props, omitKeys$4)));
12083 };
12084
12085 return UncontrolledTooltip;
12086 }(React.Component);
12087 UncontrolledTooltip.propTypes = _extends({
12088 defaultOpen: propTypes.bool
12089 }, Tooltip.propTypes);
12090
12091 var propTypes$1e = {
12092 tag: tagPropType,
12093 type: propTypes.string,
12094 size: propTypes.string,
12095 color: propTypes.string,
12096 className: propTypes.string,
12097 cssModule: propTypes.object,
12098 children: propTypes.string
12099 };
12100 var defaultProps$18 = {
12101 tag: 'div',
12102 type: 'border',
12103 children: 'Loading...'
12104 };
12105
12106 var Spinner = function Spinner(props) {
12107 var className = props.className,
12108 cssModule = props.cssModule,
12109 type = props.type,
12110 size = props.size,
12111 color = props.color,
12112 children = props.children,
12113 Tag = props.tag,
12114 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
12115
12116 var classes = mapToCssModules(classnames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
12117 return /*#__PURE__*/React__default.createElement(Tag, _extends({
12118 role: "status"
12119 }, attributes, {
12120 className: classes
12121 }), children && /*#__PURE__*/React__default.createElement("span", {
12122 className: mapToCssModules('sr-only', cssModule)
12123 }, children));
12124 };
12125
12126 Spinner.propTypes = propTypes$1e;
12127 Spinner.defaultProps = defaultProps$18;
12128
12129 (function () {
12130 if (typeof window !== 'object' || typeof window.CustomEvent === 'function') return;
12131
12132 var CustomEvent = function CustomEvent(event, params) {
12133 params = params || {
12134 bubbles: false,
12135 cancelable: false,
12136 detail: null
12137 };
12138 var evt = document.createEvent('CustomEvent');
12139 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
12140 return evt;
12141 };
12142
12143 window.CustomEvent = CustomEvent;
12144 })();
12145
12146 (function () {
12147 if (typeof Object.values === 'function') return;
12148
12149 var values = function values(O) {
12150 return Object.keys(O).map(function (key) {
12151 return O[key];
12152 });
12153 };
12154
12155 Object.values = values;
12156 })();
12157
12158 var polyfill$4 = /*#__PURE__*/Object.freeze({
12159 __proto__: null
12160 });
12161
12162 exports.Alert = Alert;
12163 exports.Badge = Badge;
12164 exports.Breadcrumb = Breadcrumb;
12165 exports.BreadcrumbItem = BreadcrumbItem;
12166 exports.Button = Button;
12167 exports.ButtonDropdown = ButtonDropdown;
12168 exports.ButtonGroup = ButtonGroup;
12169 exports.ButtonToggle = ButtonToggle;
12170 exports.ButtonToolbar = ButtonToolbar;
12171 exports.Card = Card;
12172 exports.CardBody = CardBody;
12173 exports.CardColumns = CardColumns;
12174 exports.CardDeck = CardDeck;
12175 exports.CardFooter = CardFooter;
12176 exports.CardGroup = CardGroup;
12177 exports.CardHeader = CardHeader;
12178 exports.CardImg = CardImg;
12179 exports.CardImgOverlay = CardImgOverlay;
12180 exports.CardLink = CardLink;
12181 exports.CardSubtitle = CardSubtitle;
12182 exports.CardText = CardText;
12183 exports.CardTitle = CardTitle;
12184 exports.Carousel = Carousel;
12185 exports.CarouselCaption = CarouselCaption;
12186 exports.CarouselControl = CarouselControl;
12187 exports.CarouselIndicators = CarouselIndicators;
12188 exports.CarouselItem = CarouselItem;
12189 exports.Col = Col;
12190 exports.Collapse = Collapse;
12191 exports.Container = Container;
12192 exports.CustomFileInput = CustomFileInput;
12193 exports.CustomInput = CustomInput;
12194 exports.Dropdown = Dropdown;
12195 exports.DropdownContext = DropdownContext;
12196 exports.DropdownItem = DropdownItem;
12197 exports.DropdownMenu = DropdownMenu;
12198 exports.DropdownToggle = DropdownToggle;
12199 exports.Fade = Fade;
12200 exports.Form = Form;
12201 exports.FormFeedback = FormFeedback;
12202 exports.FormGroup = FormGroup;
12203 exports.FormText = FormText;
12204 exports.Input = Input;
12205 exports.InputGroup = InputGroup;
12206 exports.InputGroupAddon = InputGroupAddon;
12207 exports.InputGroupButtonDropdown = InputGroupButtonDropdown;
12208 exports.InputGroupText = InputGroupText;
12209 exports.Jumbotron = Jumbotron;
12210 exports.Label = Label;
12211 exports.ListGroup = ListGroup;
12212 exports.ListGroupItem = ListGroupItem;
12213 exports.ListGroupItemHeading = ListGroupItemHeading;
12214 exports.ListGroupItemText = ListGroupItemText;
12215 exports.Media = Media;
12216 exports.Modal = Modal;
12217 exports.ModalBody = ModalBody;
12218 exports.ModalFooter = ModalFooter;
12219 exports.ModalHeader = ModalHeader;
12220 exports.Nav = Nav;
12221 exports.NavItem = NavItem;
12222 exports.NavLink = NavLink;
12223 exports.Navbar = Navbar;
12224 exports.NavbarBrand = NavbarBrand;
12225 exports.NavbarText = NavbarText;
12226 exports.NavbarToggler = NavbarToggler;
12227 exports.Pagination = Pagination;
12228 exports.PaginationItem = PaginationItem;
12229 exports.PaginationLink = PaginationLink;
12230 exports.Polyfill = polyfill$4;
12231 exports.Popover = Popover;
12232 exports.PopoverBody = PopoverBody;
12233 exports.PopoverHeader = PopoverHeader;
12234 exports.PopperContent = PopperContent;
12235 exports.PopperTargetHelper = PopperTargetHelper;
12236 exports.Progress = Progress;
12237 exports.Row = Row;
12238 exports.Spinner = Spinner;
12239 exports.TabContent = TabContent;
12240 exports.TabPane = TabPane;
12241 exports.Table = Table;
12242 exports.Toast = Toast;
12243 exports.ToastBody = ToastBody;
12244 exports.ToastHeader = ToastHeader;
12245 exports.Tooltip = Tooltip;
12246 exports.UncontrolledAlert = UncontrolledAlert;
12247 exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
12248 exports.UncontrolledCarousel = UncontrolledCarousel;
12249 exports.UncontrolledCollapse = UncontrolledCollapse;
12250 exports.UncontrolledDropdown = UncontrolledDropdown;
12251 exports.UncontrolledPopover = UncontrolledPopover;
12252 exports.UncontrolledTooltip = UncontrolledTooltip;
12253 exports.Util = utils;
12254
12255 Object.defineProperty(exports, '__esModule', { value: true });
12256
12257})));
12258//# sourceMappingURL=reactstrap.full.js.map