jekyll-nagymaros 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,13 @@
1
1
  /*!
2
- * Bootstrap v5.3.2 (https://getbootstrap.com/)
3
- * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap v5.3.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) :
8
- typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper));
10
- })(this, (function (Popper) { 'use strict';
11
-
12
- function _interopNamespaceDefault(e) {
13
- const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
14
- if (e) {
15
- for (const k in e) {
16
- if (k !== 'default') {
17
- const d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: () => e[k]
21
- });
22
- }
23
- }
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper);
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
+ typeof define === 'function' && define.amd ? define(factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
10
+ })(this, (function () { 'use strict';
30
11
 
31
12
  /**
32
13
  * --------------------------------------------------------------------------
@@ -144,7 +125,7 @@
144
125
  const triggerTransitionEnd = element => {
145
126
  element.dispatchEvent(new Event(TRANSITION_END));
146
127
  };
147
- const isElement = object => {
128
+ const isElement$1 = object => {
148
129
  if (!object || typeof object !== 'object') {
149
130
  return false;
150
131
  }
@@ -155,7 +136,7 @@
155
136
  };
156
137
  const getElement = object => {
157
138
  // it's a jQuery object or a node element
158
- if (isElement(object)) {
139
+ if (isElement$1(object)) {
159
140
  return object.jquery ? object[0] : object;
160
141
  }
161
142
  if (typeof object === 'string' && object.length > 0) {
@@ -164,7 +145,7 @@
164
145
  return null;
165
146
  };
166
147
  const isVisible = element => {
167
- if (!isElement(element) || element.getClientRects().length === 0) {
148
+ if (!isElement$1(element) || element.getClientRects().length === 0) {
168
149
  return false;
169
150
  }
170
151
  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
@@ -229,7 +210,6 @@
229
210
  const reflow = element => {
230
211
  element.offsetHeight; // eslint-disable-line no-unused-expressions
231
212
  };
232
-
233
213
  const getjQuery = () => {
234
214
  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
235
215
  return window.jQuery;
@@ -635,19 +615,19 @@
635
615
  return config;
636
616
  }
637
617
  _mergeConfigObj(config, element) {
638
- const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse
618
+ const jsonConfig = isElement$1(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse
639
619
 
640
620
  return {
641
621
  ...this.constructor.Default,
642
622
  ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
643
- ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),
623
+ ...(isElement$1(element) ? Manipulator.getDataAttributes(element) : {}),
644
624
  ...(typeof config === 'object' ? config : {})
645
625
  };
646
626
  }
647
627
  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
648
628
  for (const [property, expectedTypes] of Object.entries(configTypes)) {
649
629
  const value = config[property];
650
- const valueType = isElement(value) ? 'element' : toType(value);
630
+ const valueType = isElement$1(value) ? 'element' : toType(value);
651
631
  if (!new RegExp(expectedTypes).test(valueType)) {
652
632
  throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
653
633
  }
@@ -667,7 +647,7 @@
667
647
  * Constants
668
648
  */
669
649
 
670
- const VERSION = '5.3.2';
650
+ const VERSION = '5.3.3';
671
651
 
672
652
  /**
673
653
  * Class definition
@@ -748,9 +728,9 @@
748
728
  if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
749
729
  hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
750
730
  }
751
- selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null;
731
+ selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
752
732
  }
753
- return selector;
733
+ return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;
754
734
  };
755
735
  const SelectorEngine = {
756
736
  find(selector, element = document.documentElement) {
@@ -1704,6 +1684,1845 @@
1704
1684
 
1705
1685
  defineJQueryPlugin(Collapse);
1706
1686
 
1687
+ var top = 'top';
1688
+ var bottom = 'bottom';
1689
+ var right = 'right';
1690
+ var left = 'left';
1691
+ var auto = 'auto';
1692
+ var basePlacements = [top, bottom, right, left];
1693
+ var start = 'start';
1694
+ var end = 'end';
1695
+ var clippingParents = 'clippingParents';
1696
+ var viewport = 'viewport';
1697
+ var popper = 'popper';
1698
+ var reference = 'reference';
1699
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
1700
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
1701
+ }, []);
1702
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
1703
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
1704
+ }, []); // modifiers that need to read the DOM
1705
+
1706
+ var beforeRead = 'beforeRead';
1707
+ var read = 'read';
1708
+ var afterRead = 'afterRead'; // pure-logic modifiers
1709
+
1710
+ var beforeMain = 'beforeMain';
1711
+ var main = 'main';
1712
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
1713
+
1714
+ var beforeWrite = 'beforeWrite';
1715
+ var write = 'write';
1716
+ var afterWrite = 'afterWrite';
1717
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
1718
+
1719
+ function getNodeName(element) {
1720
+ return element ? (element.nodeName || '').toLowerCase() : null;
1721
+ }
1722
+
1723
+ function getWindow(node) {
1724
+ if (node == null) {
1725
+ return window;
1726
+ }
1727
+
1728
+ if (node.toString() !== '[object Window]') {
1729
+ var ownerDocument = node.ownerDocument;
1730
+ return ownerDocument ? ownerDocument.defaultView || window : window;
1731
+ }
1732
+
1733
+ return node;
1734
+ }
1735
+
1736
+ function isElement(node) {
1737
+ var OwnElement = getWindow(node).Element;
1738
+ return node instanceof OwnElement || node instanceof Element;
1739
+ }
1740
+
1741
+ function isHTMLElement(node) {
1742
+ var OwnElement = getWindow(node).HTMLElement;
1743
+ return node instanceof OwnElement || node instanceof HTMLElement;
1744
+ }
1745
+
1746
+ function isShadowRoot(node) {
1747
+ // IE 11 has no ShadowRoot
1748
+ if (typeof ShadowRoot === 'undefined') {
1749
+ return false;
1750
+ }
1751
+
1752
+ var OwnElement = getWindow(node).ShadowRoot;
1753
+ return node instanceof OwnElement || node instanceof ShadowRoot;
1754
+ }
1755
+
1756
+ // and applies them to the HTMLElements such as popper and arrow
1757
+
1758
+ function applyStyles(_ref) {
1759
+ var state = _ref.state;
1760
+ Object.keys(state.elements).forEach(function (name) {
1761
+ var style = state.styles[name] || {};
1762
+ var attributes = state.attributes[name] || {};
1763
+ var element = state.elements[name]; // arrow is optional + virtual elements
1764
+
1765
+ if (!isHTMLElement(element) || !getNodeName(element)) {
1766
+ return;
1767
+ } // Flow doesn't support to extend this property, but it's the most
1768
+ // effective way to apply styles to an HTMLElement
1769
+ // $FlowFixMe[cannot-write]
1770
+
1771
+
1772
+ Object.assign(element.style, style);
1773
+ Object.keys(attributes).forEach(function (name) {
1774
+ var value = attributes[name];
1775
+
1776
+ if (value === false) {
1777
+ element.removeAttribute(name);
1778
+ } else {
1779
+ element.setAttribute(name, value === true ? '' : value);
1780
+ }
1781
+ });
1782
+ });
1783
+ }
1784
+
1785
+ function effect$2(_ref2) {
1786
+ var state = _ref2.state;
1787
+ var initialStyles = {
1788
+ popper: {
1789
+ position: state.options.strategy,
1790
+ left: '0',
1791
+ top: '0',
1792
+ margin: '0'
1793
+ },
1794
+ arrow: {
1795
+ position: 'absolute'
1796
+ },
1797
+ reference: {}
1798
+ };
1799
+ Object.assign(state.elements.popper.style, initialStyles.popper);
1800
+ state.styles = initialStyles;
1801
+
1802
+ if (state.elements.arrow) {
1803
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
1804
+ }
1805
+
1806
+ return function () {
1807
+ Object.keys(state.elements).forEach(function (name) {
1808
+ var element = state.elements[name];
1809
+ var attributes = state.attributes[name] || {};
1810
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
1811
+
1812
+ var style = styleProperties.reduce(function (style, property) {
1813
+ style[property] = '';
1814
+ return style;
1815
+ }, {}); // arrow is optional + virtual elements
1816
+
1817
+ if (!isHTMLElement(element) || !getNodeName(element)) {
1818
+ return;
1819
+ }
1820
+
1821
+ Object.assign(element.style, style);
1822
+ Object.keys(attributes).forEach(function (attribute) {
1823
+ element.removeAttribute(attribute);
1824
+ });
1825
+ });
1826
+ };
1827
+ } // eslint-disable-next-line import/no-unused-modules
1828
+
1829
+
1830
+ const applyStyles$1 = {
1831
+ name: 'applyStyles',
1832
+ enabled: true,
1833
+ phase: 'write',
1834
+ fn: applyStyles,
1835
+ effect: effect$2,
1836
+ requires: ['computeStyles']
1837
+ };
1838
+
1839
+ function getBasePlacement(placement) {
1840
+ return placement.split('-')[0];
1841
+ }
1842
+
1843
+ var max = Math.max;
1844
+ var min = Math.min;
1845
+ var round = Math.round;
1846
+
1847
+ function getUAString() {
1848
+ var uaData = navigator.userAgentData;
1849
+
1850
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
1851
+ return uaData.brands.map(function (item) {
1852
+ return item.brand + "/" + item.version;
1853
+ }).join(' ');
1854
+ }
1855
+
1856
+ return navigator.userAgent;
1857
+ }
1858
+
1859
+ function isLayoutViewport() {
1860
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
1861
+ }
1862
+
1863
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
1864
+ if (includeScale === void 0) {
1865
+ includeScale = false;
1866
+ }
1867
+
1868
+ if (isFixedStrategy === void 0) {
1869
+ isFixedStrategy = false;
1870
+ }
1871
+
1872
+ var clientRect = element.getBoundingClientRect();
1873
+ var scaleX = 1;
1874
+ var scaleY = 1;
1875
+
1876
+ if (includeScale && isHTMLElement(element)) {
1877
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
1878
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
1879
+ }
1880
+
1881
+ var _ref = isElement(element) ? getWindow(element) : window,
1882
+ visualViewport = _ref.visualViewport;
1883
+
1884
+ var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
1885
+ var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
1886
+ var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
1887
+ var width = clientRect.width / scaleX;
1888
+ var height = clientRect.height / scaleY;
1889
+ return {
1890
+ width: width,
1891
+ height: height,
1892
+ top: y,
1893
+ right: x + width,
1894
+ bottom: y + height,
1895
+ left: x,
1896
+ x: x,
1897
+ y: y
1898
+ };
1899
+ }
1900
+
1901
+ // means it doesn't take into account transforms.
1902
+
1903
+ function getLayoutRect(element) {
1904
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
1905
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
1906
+
1907
+ var width = element.offsetWidth;
1908
+ var height = element.offsetHeight;
1909
+
1910
+ if (Math.abs(clientRect.width - width) <= 1) {
1911
+ width = clientRect.width;
1912
+ }
1913
+
1914
+ if (Math.abs(clientRect.height - height) <= 1) {
1915
+ height = clientRect.height;
1916
+ }
1917
+
1918
+ return {
1919
+ x: element.offsetLeft,
1920
+ y: element.offsetTop,
1921
+ width: width,
1922
+ height: height
1923
+ };
1924
+ }
1925
+
1926
+ function contains(parent, child) {
1927
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
1928
+
1929
+ if (parent.contains(child)) {
1930
+ return true;
1931
+ } // then fallback to custom implementation with Shadow DOM support
1932
+ else if (rootNode && isShadowRoot(rootNode)) {
1933
+ var next = child;
1934
+
1935
+ do {
1936
+ if (next && parent.isSameNode(next)) {
1937
+ return true;
1938
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
1939
+
1940
+
1941
+ next = next.parentNode || next.host;
1942
+ } while (next);
1943
+ } // Give up, the result is false
1944
+
1945
+
1946
+ return false;
1947
+ }
1948
+
1949
+ function getComputedStyle$1(element) {
1950
+ return getWindow(element).getComputedStyle(element);
1951
+ }
1952
+
1953
+ function isTableElement(element) {
1954
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
1955
+ }
1956
+
1957
+ function getDocumentElement(element) {
1958
+ // $FlowFixMe[incompatible-return]: assume body is always available
1959
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
1960
+ element.document) || window.document).documentElement;
1961
+ }
1962
+
1963
+ function getParentNode(element) {
1964
+ if (getNodeName(element) === 'html') {
1965
+ return element;
1966
+ }
1967
+
1968
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
1969
+ // $FlowFixMe[incompatible-return]
1970
+ // $FlowFixMe[prop-missing]
1971
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1972
+ element.parentNode || ( // DOM Element detected
1973
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
1974
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
1975
+ getDocumentElement(element) // fallback
1976
+
1977
+ );
1978
+ }
1979
+
1980
+ function getTrueOffsetParent(element) {
1981
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
1982
+ getComputedStyle$1(element).position === 'fixed') {
1983
+ return null;
1984
+ }
1985
+
1986
+ return element.offsetParent;
1987
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
1988
+ // return the containing block
1989
+
1990
+
1991
+ function getContainingBlock(element) {
1992
+ var isFirefox = /firefox/i.test(getUAString());
1993
+ var isIE = /Trident/i.test(getUAString());
1994
+
1995
+ if (isIE && isHTMLElement(element)) {
1996
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
1997
+ var elementCss = getComputedStyle$1(element);
1998
+
1999
+ if (elementCss.position === 'fixed') {
2000
+ return null;
2001
+ }
2002
+ }
2003
+
2004
+ var currentNode = getParentNode(element);
2005
+
2006
+ if (isShadowRoot(currentNode)) {
2007
+ currentNode = currentNode.host;
2008
+ }
2009
+
2010
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
2011
+ var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
2012
+ // create a containing block.
2013
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2014
+
2015
+ if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
2016
+ return currentNode;
2017
+ } else {
2018
+ currentNode = currentNode.parentNode;
2019
+ }
2020
+ }
2021
+
2022
+ return null;
2023
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
2024
+ // such as table ancestors and cross browser bugs.
2025
+
2026
+
2027
+ function getOffsetParent(element) {
2028
+ var window = getWindow(element);
2029
+ var offsetParent = getTrueOffsetParent(element);
2030
+
2031
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
2032
+ offsetParent = getTrueOffsetParent(offsetParent);
2033
+ }
2034
+
2035
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) {
2036
+ return window;
2037
+ }
2038
+
2039
+ return offsetParent || getContainingBlock(element) || window;
2040
+ }
2041
+
2042
+ function getMainAxisFromPlacement(placement) {
2043
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
2044
+ }
2045
+
2046
+ function within(min$1, value, max$1) {
2047
+ return max(min$1, min(value, max$1));
2048
+ }
2049
+ function withinMaxClamp(min, value, max) {
2050
+ var v = within(min, value, max);
2051
+ return v > max ? max : v;
2052
+ }
2053
+
2054
+ function getFreshSideObject() {
2055
+ return {
2056
+ top: 0,
2057
+ right: 0,
2058
+ bottom: 0,
2059
+ left: 0
2060
+ };
2061
+ }
2062
+
2063
+ function mergePaddingObject(paddingObject) {
2064
+ return Object.assign({}, getFreshSideObject(), paddingObject);
2065
+ }
2066
+
2067
+ function expandToHashMap(value, keys) {
2068
+ return keys.reduce(function (hashMap, key) {
2069
+ hashMap[key] = value;
2070
+ return hashMap;
2071
+ }, {});
2072
+ }
2073
+
2074
+ var toPaddingObject = function toPaddingObject(padding, state) {
2075
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
2076
+ placement: state.placement
2077
+ })) : padding;
2078
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
2079
+ };
2080
+
2081
+ function arrow(_ref) {
2082
+ var _state$modifiersData$;
2083
+
2084
+ var state = _ref.state,
2085
+ name = _ref.name,
2086
+ options = _ref.options;
2087
+ var arrowElement = state.elements.arrow;
2088
+ var popperOffsets = state.modifiersData.popperOffsets;
2089
+ var basePlacement = getBasePlacement(state.placement);
2090
+ var axis = getMainAxisFromPlacement(basePlacement);
2091
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
2092
+ var len = isVertical ? 'height' : 'width';
2093
+
2094
+ if (!arrowElement || !popperOffsets) {
2095
+ return;
2096
+ }
2097
+
2098
+ var paddingObject = toPaddingObject(options.padding, state);
2099
+ var arrowRect = getLayoutRect(arrowElement);
2100
+ var minProp = axis === 'y' ? top : left;
2101
+ var maxProp = axis === 'y' ? bottom : right;
2102
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
2103
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
2104
+ var arrowOffsetParent = getOffsetParent(arrowElement);
2105
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
2106
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
2107
+ // outside of the popper bounds
2108
+
2109
+ var min = paddingObject[minProp];
2110
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
2111
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
2112
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
2113
+
2114
+ var axisProp = axis;
2115
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
2116
+ }
2117
+
2118
+ function effect$1(_ref2) {
2119
+ var state = _ref2.state,
2120
+ options = _ref2.options;
2121
+ var _options$element = options.element,
2122
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
2123
+
2124
+ if (arrowElement == null) {
2125
+ return;
2126
+ } // CSS selector
2127
+
2128
+
2129
+ if (typeof arrowElement === 'string') {
2130
+ arrowElement = state.elements.popper.querySelector(arrowElement);
2131
+
2132
+ if (!arrowElement) {
2133
+ return;
2134
+ }
2135
+ }
2136
+
2137
+ if (!contains(state.elements.popper, arrowElement)) {
2138
+ return;
2139
+ }
2140
+
2141
+ state.elements.arrow = arrowElement;
2142
+ } // eslint-disable-next-line import/no-unused-modules
2143
+
2144
+
2145
+ const arrow$1 = {
2146
+ name: 'arrow',
2147
+ enabled: true,
2148
+ phase: 'main',
2149
+ fn: arrow,
2150
+ effect: effect$1,
2151
+ requires: ['popperOffsets'],
2152
+ requiresIfExists: ['preventOverflow']
2153
+ };
2154
+
2155
+ function getVariation(placement) {
2156
+ return placement.split('-')[1];
2157
+ }
2158
+
2159
+ var unsetSides = {
2160
+ top: 'auto',
2161
+ right: 'auto',
2162
+ bottom: 'auto',
2163
+ left: 'auto'
2164
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
2165
+ // Zooming can change the DPR, but it seems to report a value that will
2166
+ // cleanly divide the values into the appropriate subpixels.
2167
+
2168
+ function roundOffsetsByDPR(_ref, win) {
2169
+ var x = _ref.x,
2170
+ y = _ref.y;
2171
+ var dpr = win.devicePixelRatio || 1;
2172
+ return {
2173
+ x: round(x * dpr) / dpr || 0,
2174
+ y: round(y * dpr) / dpr || 0
2175
+ };
2176
+ }
2177
+
2178
+ function mapToStyles(_ref2) {
2179
+ var _Object$assign2;
2180
+
2181
+ var popper = _ref2.popper,
2182
+ popperRect = _ref2.popperRect,
2183
+ placement = _ref2.placement,
2184
+ variation = _ref2.variation,
2185
+ offsets = _ref2.offsets,
2186
+ position = _ref2.position,
2187
+ gpuAcceleration = _ref2.gpuAcceleration,
2188
+ adaptive = _ref2.adaptive,
2189
+ roundOffsets = _ref2.roundOffsets,
2190
+ isFixed = _ref2.isFixed;
2191
+ var _offsets$x = offsets.x,
2192
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
2193
+ _offsets$y = offsets.y,
2194
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
2195
+
2196
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
2197
+ x: x,
2198
+ y: y
2199
+ }) : {
2200
+ x: x,
2201
+ y: y
2202
+ };
2203
+
2204
+ x = _ref3.x;
2205
+ y = _ref3.y;
2206
+ var hasX = offsets.hasOwnProperty('x');
2207
+ var hasY = offsets.hasOwnProperty('y');
2208
+ var sideX = left;
2209
+ var sideY = top;
2210
+ var win = window;
2211
+
2212
+ if (adaptive) {
2213
+ var offsetParent = getOffsetParent(popper);
2214
+ var heightProp = 'clientHeight';
2215
+ var widthProp = 'clientWidth';
2216
+
2217
+ if (offsetParent === getWindow(popper)) {
2218
+ offsetParent = getDocumentElement(popper);
2219
+
2220
+ if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') {
2221
+ heightProp = 'scrollHeight';
2222
+ widthProp = 'scrollWidth';
2223
+ }
2224
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
2225
+
2226
+
2227
+ offsetParent = offsetParent;
2228
+
2229
+ if (placement === top || (placement === left || placement === right) && variation === end) {
2230
+ sideY = bottom;
2231
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
2232
+ offsetParent[heightProp];
2233
+ y -= offsetY - popperRect.height;
2234
+ y *= gpuAcceleration ? 1 : -1;
2235
+ }
2236
+
2237
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
2238
+ sideX = right;
2239
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
2240
+ offsetParent[widthProp];
2241
+ x -= offsetX - popperRect.width;
2242
+ x *= gpuAcceleration ? 1 : -1;
2243
+ }
2244
+ }
2245
+
2246
+ var commonStyles = Object.assign({
2247
+ position: position
2248
+ }, adaptive && unsetSides);
2249
+
2250
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
2251
+ x: x,
2252
+ y: y
2253
+ }, getWindow(popper)) : {
2254
+ x: x,
2255
+ y: y
2256
+ };
2257
+
2258
+ x = _ref4.x;
2259
+ y = _ref4.y;
2260
+
2261
+ if (gpuAcceleration) {
2262
+ var _Object$assign;
2263
+
2264
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
2265
+ }
2266
+
2267
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
2268
+ }
2269
+
2270
+ function computeStyles(_ref5) {
2271
+ var state = _ref5.state,
2272
+ options = _ref5.options;
2273
+ var _options$gpuAccelerat = options.gpuAcceleration,
2274
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
2275
+ _options$adaptive = options.adaptive,
2276
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
2277
+ _options$roundOffsets = options.roundOffsets,
2278
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
2279
+ var commonStyles = {
2280
+ placement: getBasePlacement(state.placement),
2281
+ variation: getVariation(state.placement),
2282
+ popper: state.elements.popper,
2283
+ popperRect: state.rects.popper,
2284
+ gpuAcceleration: gpuAcceleration,
2285
+ isFixed: state.options.strategy === 'fixed'
2286
+ };
2287
+
2288
+ if (state.modifiersData.popperOffsets != null) {
2289
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
2290
+ offsets: state.modifiersData.popperOffsets,
2291
+ position: state.options.strategy,
2292
+ adaptive: adaptive,
2293
+ roundOffsets: roundOffsets
2294
+ })));
2295
+ }
2296
+
2297
+ if (state.modifiersData.arrow != null) {
2298
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
2299
+ offsets: state.modifiersData.arrow,
2300
+ position: 'absolute',
2301
+ adaptive: false,
2302
+ roundOffsets: roundOffsets
2303
+ })));
2304
+ }
2305
+
2306
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
2307
+ 'data-popper-placement': state.placement
2308
+ });
2309
+ } // eslint-disable-next-line import/no-unused-modules
2310
+
2311
+
2312
+ const computeStyles$1 = {
2313
+ name: 'computeStyles',
2314
+ enabled: true,
2315
+ phase: 'beforeWrite',
2316
+ fn: computeStyles,
2317
+ data: {}
2318
+ };
2319
+
2320
+ var passive = {
2321
+ passive: true
2322
+ };
2323
+
2324
+ function effect(_ref) {
2325
+ var state = _ref.state,
2326
+ instance = _ref.instance,
2327
+ options = _ref.options;
2328
+ var _options$scroll = options.scroll,
2329
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
2330
+ _options$resize = options.resize,
2331
+ resize = _options$resize === void 0 ? true : _options$resize;
2332
+ var window = getWindow(state.elements.popper);
2333
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
2334
+
2335
+ if (scroll) {
2336
+ scrollParents.forEach(function (scrollParent) {
2337
+ scrollParent.addEventListener('scroll', instance.update, passive);
2338
+ });
2339
+ }
2340
+
2341
+ if (resize) {
2342
+ window.addEventListener('resize', instance.update, passive);
2343
+ }
2344
+
2345
+ return function () {
2346
+ if (scroll) {
2347
+ scrollParents.forEach(function (scrollParent) {
2348
+ scrollParent.removeEventListener('scroll', instance.update, passive);
2349
+ });
2350
+ }
2351
+
2352
+ if (resize) {
2353
+ window.removeEventListener('resize', instance.update, passive);
2354
+ }
2355
+ };
2356
+ } // eslint-disable-next-line import/no-unused-modules
2357
+
2358
+
2359
+ const eventListeners = {
2360
+ name: 'eventListeners',
2361
+ enabled: true,
2362
+ phase: 'write',
2363
+ fn: function fn() {},
2364
+ effect: effect,
2365
+ data: {}
2366
+ };
2367
+
2368
+ var hash$1 = {
2369
+ left: 'right',
2370
+ right: 'left',
2371
+ bottom: 'top',
2372
+ top: 'bottom'
2373
+ };
2374
+ function getOppositePlacement(placement) {
2375
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
2376
+ return hash$1[matched];
2377
+ });
2378
+ }
2379
+
2380
+ var hash = {
2381
+ start: 'end',
2382
+ end: 'start'
2383
+ };
2384
+ function getOppositeVariationPlacement(placement) {
2385
+ return placement.replace(/start|end/g, function (matched) {
2386
+ return hash[matched];
2387
+ });
2388
+ }
2389
+
2390
+ function getWindowScroll(node) {
2391
+ var win = getWindow(node);
2392
+ var scrollLeft = win.pageXOffset;
2393
+ var scrollTop = win.pageYOffset;
2394
+ return {
2395
+ scrollLeft: scrollLeft,
2396
+ scrollTop: scrollTop
2397
+ };
2398
+ }
2399
+
2400
+ function getWindowScrollBarX(element) {
2401
+ // If <html> has a CSS width greater than the viewport, then this will be
2402
+ // incorrect for RTL.
2403
+ // Popper 1 is broken in this case and never had a bug report so let's assume
2404
+ // it's not an issue. I don't think anyone ever specifies width on <html>
2405
+ // anyway.
2406
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
2407
+ // this (e.g. Edge 2019, IE11, Safari)
2408
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
2409
+ }
2410
+
2411
+ function getViewportRect(element, strategy) {
2412
+ var win = getWindow(element);
2413
+ var html = getDocumentElement(element);
2414
+ var visualViewport = win.visualViewport;
2415
+ var width = html.clientWidth;
2416
+ var height = html.clientHeight;
2417
+ var x = 0;
2418
+ var y = 0;
2419
+
2420
+ if (visualViewport) {
2421
+ width = visualViewport.width;
2422
+ height = visualViewport.height;
2423
+ var layoutViewport = isLayoutViewport();
2424
+
2425
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
2426
+ x = visualViewport.offsetLeft;
2427
+ y = visualViewport.offsetTop;
2428
+ }
2429
+ }
2430
+
2431
+ return {
2432
+ width: width,
2433
+ height: height,
2434
+ x: x + getWindowScrollBarX(element),
2435
+ y: y
2436
+ };
2437
+ }
2438
+
2439
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
2440
+
2441
+ function getDocumentRect(element) {
2442
+ var _element$ownerDocumen;
2443
+
2444
+ var html = getDocumentElement(element);
2445
+ var winScroll = getWindowScroll(element);
2446
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
2447
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
2448
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
2449
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
2450
+ var y = -winScroll.scrollTop;
2451
+
2452
+ if (getComputedStyle$1(body || html).direction === 'rtl') {
2453
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
2454
+ }
2455
+
2456
+ return {
2457
+ width: width,
2458
+ height: height,
2459
+ x: x,
2460
+ y: y
2461
+ };
2462
+ }
2463
+
2464
+ function isScrollParent(element) {
2465
+ // Firefox wants us to check `-x` and `-y` variations as well
2466
+ var _getComputedStyle = getComputedStyle$1(element),
2467
+ overflow = _getComputedStyle.overflow,
2468
+ overflowX = _getComputedStyle.overflowX,
2469
+ overflowY = _getComputedStyle.overflowY;
2470
+
2471
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
2472
+ }
2473
+
2474
+ function getScrollParent(node) {
2475
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
2476
+ // $FlowFixMe[incompatible-return]: assume body is always available
2477
+ return node.ownerDocument.body;
2478
+ }
2479
+
2480
+ if (isHTMLElement(node) && isScrollParent(node)) {
2481
+ return node;
2482
+ }
2483
+
2484
+ return getScrollParent(getParentNode(node));
2485
+ }
2486
+
2487
+ /*
2488
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
2489
+ until we get to the top window object. This list is what we attach scroll listeners
2490
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
2491
+ reference element's position.
2492
+ */
2493
+
2494
+ function listScrollParents(element, list) {
2495
+ var _element$ownerDocumen;
2496
+
2497
+ if (list === void 0) {
2498
+ list = [];
2499
+ }
2500
+
2501
+ var scrollParent = getScrollParent(element);
2502
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
2503
+ var win = getWindow(scrollParent);
2504
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
2505
+ var updatedList = list.concat(target);
2506
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
2507
+ updatedList.concat(listScrollParents(getParentNode(target)));
2508
+ }
2509
+
2510
+ function rectToClientRect(rect) {
2511
+ return Object.assign({}, rect, {
2512
+ left: rect.x,
2513
+ top: rect.y,
2514
+ right: rect.x + rect.width,
2515
+ bottom: rect.y + rect.height
2516
+ });
2517
+ }
2518
+
2519
+ function getInnerBoundingClientRect(element, strategy) {
2520
+ var rect = getBoundingClientRect(element, false, strategy === 'fixed');
2521
+ rect.top = rect.top + element.clientTop;
2522
+ rect.left = rect.left + element.clientLeft;
2523
+ rect.bottom = rect.top + element.clientHeight;
2524
+ rect.right = rect.left + element.clientWidth;
2525
+ rect.width = element.clientWidth;
2526
+ rect.height = element.clientHeight;
2527
+ rect.x = rect.left;
2528
+ rect.y = rect.top;
2529
+ return rect;
2530
+ }
2531
+
2532
+ function getClientRectFromMixedType(element, clippingParent, strategy) {
2533
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2534
+ } // A "clipping parent" is an overflowable container with the characteristic of
2535
+ // clipping (or hiding) overflowing elements with a position different from
2536
+ // `initial`
2537
+
2538
+
2539
+ function getClippingParents(element) {
2540
+ var clippingParents = listScrollParents(getParentNode(element));
2541
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;
2542
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
2543
+
2544
+ if (!isElement(clipperElement)) {
2545
+ return [];
2546
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
2547
+
2548
+
2549
+ return clippingParents.filter(function (clippingParent) {
2550
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
2551
+ });
2552
+ } // Gets the maximum area that the element is visible in due to any number of
2553
+ // clipping parents
2554
+
2555
+
2556
+ function getClippingRect(element, boundary, rootBoundary, strategy) {
2557
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
2558
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
2559
+ var firstClippingParent = clippingParents[0];
2560
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
2561
+ var rect = getClientRectFromMixedType(element, clippingParent, strategy);
2562
+ accRect.top = max(rect.top, accRect.top);
2563
+ accRect.right = min(rect.right, accRect.right);
2564
+ accRect.bottom = min(rect.bottom, accRect.bottom);
2565
+ accRect.left = max(rect.left, accRect.left);
2566
+ return accRect;
2567
+ }, getClientRectFromMixedType(element, firstClippingParent, strategy));
2568
+ clippingRect.width = clippingRect.right - clippingRect.left;
2569
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
2570
+ clippingRect.x = clippingRect.left;
2571
+ clippingRect.y = clippingRect.top;
2572
+ return clippingRect;
2573
+ }
2574
+
2575
+ function computeOffsets(_ref) {
2576
+ var reference = _ref.reference,
2577
+ element = _ref.element,
2578
+ placement = _ref.placement;
2579
+ var basePlacement = placement ? getBasePlacement(placement) : null;
2580
+ var variation = placement ? getVariation(placement) : null;
2581
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
2582
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
2583
+ var offsets;
2584
+
2585
+ switch (basePlacement) {
2586
+ case top:
2587
+ offsets = {
2588
+ x: commonX,
2589
+ y: reference.y - element.height
2590
+ };
2591
+ break;
2592
+
2593
+ case bottom:
2594
+ offsets = {
2595
+ x: commonX,
2596
+ y: reference.y + reference.height
2597
+ };
2598
+ break;
2599
+
2600
+ case right:
2601
+ offsets = {
2602
+ x: reference.x + reference.width,
2603
+ y: commonY
2604
+ };
2605
+ break;
2606
+
2607
+ case left:
2608
+ offsets = {
2609
+ x: reference.x - element.width,
2610
+ y: commonY
2611
+ };
2612
+ break;
2613
+
2614
+ default:
2615
+ offsets = {
2616
+ x: reference.x,
2617
+ y: reference.y
2618
+ };
2619
+ }
2620
+
2621
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
2622
+
2623
+ if (mainAxis != null) {
2624
+ var len = mainAxis === 'y' ? 'height' : 'width';
2625
+
2626
+ switch (variation) {
2627
+ case start:
2628
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
2629
+ break;
2630
+
2631
+ case end:
2632
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
2633
+ break;
2634
+ }
2635
+ }
2636
+
2637
+ return offsets;
2638
+ }
2639
+
2640
+ function detectOverflow(state, options) {
2641
+ if (options === void 0) {
2642
+ options = {};
2643
+ }
2644
+
2645
+ var _options = options,
2646
+ _options$placement = _options.placement,
2647
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
2648
+ _options$strategy = _options.strategy,
2649
+ strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
2650
+ _options$boundary = _options.boundary,
2651
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
2652
+ _options$rootBoundary = _options.rootBoundary,
2653
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
2654
+ _options$elementConte = _options.elementContext,
2655
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
2656
+ _options$altBoundary = _options.altBoundary,
2657
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
2658
+ _options$padding = _options.padding,
2659
+ padding = _options$padding === void 0 ? 0 : _options$padding;
2660
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
2661
+ var altContext = elementContext === popper ? reference : popper;
2662
+ var popperRect = state.rects.popper;
2663
+ var element = state.elements[altBoundary ? altContext : elementContext];
2664
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
2665
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
2666
+ var popperOffsets = computeOffsets({
2667
+ reference: referenceClientRect,
2668
+ element: popperRect,
2669
+ strategy: 'absolute',
2670
+ placement: placement
2671
+ });
2672
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
2673
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
2674
+ // 0 or negative = within the clipping rect
2675
+
2676
+ var overflowOffsets = {
2677
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
2678
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
2679
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
2680
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
2681
+ };
2682
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
2683
+
2684
+ if (elementContext === popper && offsetData) {
2685
+ var offset = offsetData[placement];
2686
+ Object.keys(overflowOffsets).forEach(function (key) {
2687
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
2688
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
2689
+ overflowOffsets[key] += offset[axis] * multiply;
2690
+ });
2691
+ }
2692
+
2693
+ return overflowOffsets;
2694
+ }
2695
+
2696
+ function computeAutoPlacement(state, options) {
2697
+ if (options === void 0) {
2698
+ options = {};
2699
+ }
2700
+
2701
+ var _options = options,
2702
+ placement = _options.placement,
2703
+ boundary = _options.boundary,
2704
+ rootBoundary = _options.rootBoundary,
2705
+ padding = _options.padding,
2706
+ flipVariations = _options.flipVariations,
2707
+ _options$allowedAutoP = _options.allowedAutoPlacements,
2708
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
2709
+ var variation = getVariation(placement);
2710
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
2711
+ return getVariation(placement) === variation;
2712
+ }) : basePlacements;
2713
+ var allowedPlacements = placements$1.filter(function (placement) {
2714
+ return allowedAutoPlacements.indexOf(placement) >= 0;
2715
+ });
2716
+
2717
+ if (allowedPlacements.length === 0) {
2718
+ allowedPlacements = placements$1;
2719
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
2720
+
2721
+
2722
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
2723
+ acc[placement] = detectOverflow(state, {
2724
+ placement: placement,
2725
+ boundary: boundary,
2726
+ rootBoundary: rootBoundary,
2727
+ padding: padding
2728
+ })[getBasePlacement(placement)];
2729
+ return acc;
2730
+ }, {});
2731
+ return Object.keys(overflows).sort(function (a, b) {
2732
+ return overflows[a] - overflows[b];
2733
+ });
2734
+ }
2735
+
2736
+ function getExpandedFallbackPlacements(placement) {
2737
+ if (getBasePlacement(placement) === auto) {
2738
+ return [];
2739
+ }
2740
+
2741
+ var oppositePlacement = getOppositePlacement(placement);
2742
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
2743
+ }
2744
+
2745
+ function flip(_ref) {
2746
+ var state = _ref.state,
2747
+ options = _ref.options,
2748
+ name = _ref.name;
2749
+
2750
+ if (state.modifiersData[name]._skip) {
2751
+ return;
2752
+ }
2753
+
2754
+ var _options$mainAxis = options.mainAxis,
2755
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
2756
+ _options$altAxis = options.altAxis,
2757
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
2758
+ specifiedFallbackPlacements = options.fallbackPlacements,
2759
+ padding = options.padding,
2760
+ boundary = options.boundary,
2761
+ rootBoundary = options.rootBoundary,
2762
+ altBoundary = options.altBoundary,
2763
+ _options$flipVariatio = options.flipVariations,
2764
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
2765
+ allowedAutoPlacements = options.allowedAutoPlacements;
2766
+ var preferredPlacement = state.options.placement;
2767
+ var basePlacement = getBasePlacement(preferredPlacement);
2768
+ var isBasePlacement = basePlacement === preferredPlacement;
2769
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
2770
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
2771
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
2772
+ placement: placement,
2773
+ boundary: boundary,
2774
+ rootBoundary: rootBoundary,
2775
+ padding: padding,
2776
+ flipVariations: flipVariations,
2777
+ allowedAutoPlacements: allowedAutoPlacements
2778
+ }) : placement);
2779
+ }, []);
2780
+ var referenceRect = state.rects.reference;
2781
+ var popperRect = state.rects.popper;
2782
+ var checksMap = new Map();
2783
+ var makeFallbackChecks = true;
2784
+ var firstFittingPlacement = placements[0];
2785
+
2786
+ for (var i = 0; i < placements.length; i++) {
2787
+ var placement = placements[i];
2788
+
2789
+ var _basePlacement = getBasePlacement(placement);
2790
+
2791
+ var isStartVariation = getVariation(placement) === start;
2792
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
2793
+ var len = isVertical ? 'width' : 'height';
2794
+ var overflow = detectOverflow(state, {
2795
+ placement: placement,
2796
+ boundary: boundary,
2797
+ rootBoundary: rootBoundary,
2798
+ altBoundary: altBoundary,
2799
+ padding: padding
2800
+ });
2801
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
2802
+
2803
+ if (referenceRect[len] > popperRect[len]) {
2804
+ mainVariationSide = getOppositePlacement(mainVariationSide);
2805
+ }
2806
+
2807
+ var altVariationSide = getOppositePlacement(mainVariationSide);
2808
+ var checks = [];
2809
+
2810
+ if (checkMainAxis) {
2811
+ checks.push(overflow[_basePlacement] <= 0);
2812
+ }
2813
+
2814
+ if (checkAltAxis) {
2815
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
2816
+ }
2817
+
2818
+ if (checks.every(function (check) {
2819
+ return check;
2820
+ })) {
2821
+ firstFittingPlacement = placement;
2822
+ makeFallbackChecks = false;
2823
+ break;
2824
+ }
2825
+
2826
+ checksMap.set(placement, checks);
2827
+ }
2828
+
2829
+ if (makeFallbackChecks) {
2830
+ // `2` may be desired in some cases – research later
2831
+ var numberOfChecks = flipVariations ? 3 : 1;
2832
+
2833
+ var _loop = function _loop(_i) {
2834
+ var fittingPlacement = placements.find(function (placement) {
2835
+ var checks = checksMap.get(placement);
2836
+
2837
+ if (checks) {
2838
+ return checks.slice(0, _i).every(function (check) {
2839
+ return check;
2840
+ });
2841
+ }
2842
+ });
2843
+
2844
+ if (fittingPlacement) {
2845
+ firstFittingPlacement = fittingPlacement;
2846
+ return "break";
2847
+ }
2848
+ };
2849
+
2850
+ for (var _i = numberOfChecks; _i > 0; _i--) {
2851
+ var _ret = _loop(_i);
2852
+
2853
+ if (_ret === "break") break;
2854
+ }
2855
+ }
2856
+
2857
+ if (state.placement !== firstFittingPlacement) {
2858
+ state.modifiersData[name]._skip = true;
2859
+ state.placement = firstFittingPlacement;
2860
+ state.reset = true;
2861
+ }
2862
+ } // eslint-disable-next-line import/no-unused-modules
2863
+
2864
+
2865
+ const flip$1 = {
2866
+ name: 'flip',
2867
+ enabled: true,
2868
+ phase: 'main',
2869
+ fn: flip,
2870
+ requiresIfExists: ['offset'],
2871
+ data: {
2872
+ _skip: false
2873
+ }
2874
+ };
2875
+
2876
+ function getSideOffsets(overflow, rect, preventedOffsets) {
2877
+ if (preventedOffsets === void 0) {
2878
+ preventedOffsets = {
2879
+ x: 0,
2880
+ y: 0
2881
+ };
2882
+ }
2883
+
2884
+ return {
2885
+ top: overflow.top - rect.height - preventedOffsets.y,
2886
+ right: overflow.right - rect.width + preventedOffsets.x,
2887
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
2888
+ left: overflow.left - rect.width - preventedOffsets.x
2889
+ };
2890
+ }
2891
+
2892
+ function isAnySideFullyClipped(overflow) {
2893
+ return [top, right, bottom, left].some(function (side) {
2894
+ return overflow[side] >= 0;
2895
+ });
2896
+ }
2897
+
2898
+ function hide(_ref) {
2899
+ var state = _ref.state,
2900
+ name = _ref.name;
2901
+ var referenceRect = state.rects.reference;
2902
+ var popperRect = state.rects.popper;
2903
+ var preventedOffsets = state.modifiersData.preventOverflow;
2904
+ var referenceOverflow = detectOverflow(state, {
2905
+ elementContext: 'reference'
2906
+ });
2907
+ var popperAltOverflow = detectOverflow(state, {
2908
+ altBoundary: true
2909
+ });
2910
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
2911
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
2912
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
2913
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
2914
+ state.modifiersData[name] = {
2915
+ referenceClippingOffsets: referenceClippingOffsets,
2916
+ popperEscapeOffsets: popperEscapeOffsets,
2917
+ isReferenceHidden: isReferenceHidden,
2918
+ hasPopperEscaped: hasPopperEscaped
2919
+ };
2920
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
2921
+ 'data-popper-reference-hidden': isReferenceHidden,
2922
+ 'data-popper-escaped': hasPopperEscaped
2923
+ });
2924
+ } // eslint-disable-next-line import/no-unused-modules
2925
+
2926
+
2927
+ const hide$1 = {
2928
+ name: 'hide',
2929
+ enabled: true,
2930
+ phase: 'main',
2931
+ requiresIfExists: ['preventOverflow'],
2932
+ fn: hide
2933
+ };
2934
+
2935
+ function distanceAndSkiddingToXY(placement, rects, offset) {
2936
+ var basePlacement = getBasePlacement(placement);
2937
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
2938
+
2939
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
2940
+ placement: placement
2941
+ })) : offset,
2942
+ skidding = _ref[0],
2943
+ distance = _ref[1];
2944
+
2945
+ skidding = skidding || 0;
2946
+ distance = (distance || 0) * invertDistance;
2947
+ return [left, right].indexOf(basePlacement) >= 0 ? {
2948
+ x: distance,
2949
+ y: skidding
2950
+ } : {
2951
+ x: skidding,
2952
+ y: distance
2953
+ };
2954
+ }
2955
+
2956
+ function offset(_ref2) {
2957
+ var state = _ref2.state,
2958
+ options = _ref2.options,
2959
+ name = _ref2.name;
2960
+ var _options$offset = options.offset,
2961
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
2962
+ var data = placements.reduce(function (acc, placement) {
2963
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
2964
+ return acc;
2965
+ }, {});
2966
+ var _data$state$placement = data[state.placement],
2967
+ x = _data$state$placement.x,
2968
+ y = _data$state$placement.y;
2969
+
2970
+ if (state.modifiersData.popperOffsets != null) {
2971
+ state.modifiersData.popperOffsets.x += x;
2972
+ state.modifiersData.popperOffsets.y += y;
2973
+ }
2974
+
2975
+ state.modifiersData[name] = data;
2976
+ } // eslint-disable-next-line import/no-unused-modules
2977
+
2978
+
2979
+ const offset$1 = {
2980
+ name: 'offset',
2981
+ enabled: true,
2982
+ phase: 'main',
2983
+ requires: ['popperOffsets'],
2984
+ fn: offset
2985
+ };
2986
+
2987
+ function popperOffsets(_ref) {
2988
+ var state = _ref.state,
2989
+ name = _ref.name;
2990
+ // Offsets are the actual position the popper needs to have to be
2991
+ // properly positioned near its reference element
2992
+ // This is the most basic placement, and will be adjusted by
2993
+ // the modifiers in the next step
2994
+ state.modifiersData[name] = computeOffsets({
2995
+ reference: state.rects.reference,
2996
+ element: state.rects.popper,
2997
+ strategy: 'absolute',
2998
+ placement: state.placement
2999
+ });
3000
+ } // eslint-disable-next-line import/no-unused-modules
3001
+
3002
+
3003
+ const popperOffsets$1 = {
3004
+ name: 'popperOffsets',
3005
+ enabled: true,
3006
+ phase: 'read',
3007
+ fn: popperOffsets,
3008
+ data: {}
3009
+ };
3010
+
3011
+ function getAltAxis(axis) {
3012
+ return axis === 'x' ? 'y' : 'x';
3013
+ }
3014
+
3015
+ function preventOverflow(_ref) {
3016
+ var state = _ref.state,
3017
+ options = _ref.options,
3018
+ name = _ref.name;
3019
+ var _options$mainAxis = options.mainAxis,
3020
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
3021
+ _options$altAxis = options.altAxis,
3022
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
3023
+ boundary = options.boundary,
3024
+ rootBoundary = options.rootBoundary,
3025
+ altBoundary = options.altBoundary,
3026
+ padding = options.padding,
3027
+ _options$tether = options.tether,
3028
+ tether = _options$tether === void 0 ? true : _options$tether,
3029
+ _options$tetherOffset = options.tetherOffset,
3030
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
3031
+ var overflow = detectOverflow(state, {
3032
+ boundary: boundary,
3033
+ rootBoundary: rootBoundary,
3034
+ padding: padding,
3035
+ altBoundary: altBoundary
3036
+ });
3037
+ var basePlacement = getBasePlacement(state.placement);
3038
+ var variation = getVariation(state.placement);
3039
+ var isBasePlacement = !variation;
3040
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
3041
+ var altAxis = getAltAxis(mainAxis);
3042
+ var popperOffsets = state.modifiersData.popperOffsets;
3043
+ var referenceRect = state.rects.reference;
3044
+ var popperRect = state.rects.popper;
3045
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
3046
+ placement: state.placement
3047
+ })) : tetherOffset;
3048
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
3049
+ mainAxis: tetherOffsetValue,
3050
+ altAxis: tetherOffsetValue
3051
+ } : Object.assign({
3052
+ mainAxis: 0,
3053
+ altAxis: 0
3054
+ }, tetherOffsetValue);
3055
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
3056
+ var data = {
3057
+ x: 0,
3058
+ y: 0
3059
+ };
3060
+
3061
+ if (!popperOffsets) {
3062
+ return;
3063
+ }
3064
+
3065
+ if (checkMainAxis) {
3066
+ var _offsetModifierState$;
3067
+
3068
+ var mainSide = mainAxis === 'y' ? top : left;
3069
+ var altSide = mainAxis === 'y' ? bottom : right;
3070
+ var len = mainAxis === 'y' ? 'height' : 'width';
3071
+ var offset = popperOffsets[mainAxis];
3072
+ var min$1 = offset + overflow[mainSide];
3073
+ var max$1 = offset - overflow[altSide];
3074
+ var additive = tether ? -popperRect[len] / 2 : 0;
3075
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
3076
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
3077
+ // outside the reference bounds
3078
+
3079
+ var arrowElement = state.elements.arrow;
3080
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
3081
+ width: 0,
3082
+ height: 0
3083
+ };
3084
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
3085
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
3086
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
3087
+ // to include its full size in the calculation. If the reference is small
3088
+ // and near the edge of a boundary, the popper can overflow even if the
3089
+ // reference is not overflowing as well (e.g. virtual elements with no
3090
+ // width or height)
3091
+
3092
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
3093
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
3094
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
3095
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
3096
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
3097
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
3098
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
3099
+ var tetherMax = offset + maxOffset - offsetModifierValue;
3100
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
3101
+ popperOffsets[mainAxis] = preventedOffset;
3102
+ data[mainAxis] = preventedOffset - offset;
3103
+ }
3104
+
3105
+ if (checkAltAxis) {
3106
+ var _offsetModifierState$2;
3107
+
3108
+ var _mainSide = mainAxis === 'x' ? top : left;
3109
+
3110
+ var _altSide = mainAxis === 'x' ? bottom : right;
3111
+
3112
+ var _offset = popperOffsets[altAxis];
3113
+
3114
+ var _len = altAxis === 'y' ? 'height' : 'width';
3115
+
3116
+ var _min = _offset + overflow[_mainSide];
3117
+
3118
+ var _max = _offset - overflow[_altSide];
3119
+
3120
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
3121
+
3122
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
3123
+
3124
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
3125
+
3126
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
3127
+
3128
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
3129
+
3130
+ popperOffsets[altAxis] = _preventedOffset;
3131
+ data[altAxis] = _preventedOffset - _offset;
3132
+ }
3133
+
3134
+ state.modifiersData[name] = data;
3135
+ } // eslint-disable-next-line import/no-unused-modules
3136
+
3137
+
3138
+ const preventOverflow$1 = {
3139
+ name: 'preventOverflow',
3140
+ enabled: true,
3141
+ phase: 'main',
3142
+ fn: preventOverflow,
3143
+ requiresIfExists: ['offset']
3144
+ };
3145
+
3146
+ function getHTMLElementScroll(element) {
3147
+ return {
3148
+ scrollLeft: element.scrollLeft,
3149
+ scrollTop: element.scrollTop
3150
+ };
3151
+ }
3152
+
3153
+ function getNodeScroll(node) {
3154
+ if (node === getWindow(node) || !isHTMLElement(node)) {
3155
+ return getWindowScroll(node);
3156
+ } else {
3157
+ return getHTMLElementScroll(node);
3158
+ }
3159
+ }
3160
+
3161
+ function isElementScaled(element) {
3162
+ var rect = element.getBoundingClientRect();
3163
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
3164
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
3165
+ return scaleX !== 1 || scaleY !== 1;
3166
+ } // Returns the composite rect of an element relative to its offsetParent.
3167
+ // Composite means it takes into account transforms as well as layout.
3168
+
3169
+
3170
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
3171
+ if (isFixed === void 0) {
3172
+ isFixed = false;
3173
+ }
3174
+
3175
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
3176
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
3177
+ var documentElement = getDocumentElement(offsetParent);
3178
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
3179
+ var scroll = {
3180
+ scrollLeft: 0,
3181
+ scrollTop: 0
3182
+ };
3183
+ var offsets = {
3184
+ x: 0,
3185
+ y: 0
3186
+ };
3187
+
3188
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
3189
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
3190
+ isScrollParent(documentElement)) {
3191
+ scroll = getNodeScroll(offsetParent);
3192
+ }
3193
+
3194
+ if (isHTMLElement(offsetParent)) {
3195
+ offsets = getBoundingClientRect(offsetParent, true);
3196
+ offsets.x += offsetParent.clientLeft;
3197
+ offsets.y += offsetParent.clientTop;
3198
+ } else if (documentElement) {
3199
+ offsets.x = getWindowScrollBarX(documentElement);
3200
+ }
3201
+ }
3202
+
3203
+ return {
3204
+ x: rect.left + scroll.scrollLeft - offsets.x,
3205
+ y: rect.top + scroll.scrollTop - offsets.y,
3206
+ width: rect.width,
3207
+ height: rect.height
3208
+ };
3209
+ }
3210
+
3211
+ function order(modifiers) {
3212
+ var map = new Map();
3213
+ var visited = new Set();
3214
+ var result = [];
3215
+ modifiers.forEach(function (modifier) {
3216
+ map.set(modifier.name, modifier);
3217
+ }); // On visiting object, check for its dependencies and visit them recursively
3218
+
3219
+ function sort(modifier) {
3220
+ visited.add(modifier.name);
3221
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
3222
+ requires.forEach(function (dep) {
3223
+ if (!visited.has(dep)) {
3224
+ var depModifier = map.get(dep);
3225
+
3226
+ if (depModifier) {
3227
+ sort(depModifier);
3228
+ }
3229
+ }
3230
+ });
3231
+ result.push(modifier);
3232
+ }
3233
+
3234
+ modifiers.forEach(function (modifier) {
3235
+ if (!visited.has(modifier.name)) {
3236
+ // check for visited object
3237
+ sort(modifier);
3238
+ }
3239
+ });
3240
+ return result;
3241
+ }
3242
+
3243
+ function orderModifiers(modifiers) {
3244
+ // order based on dependencies
3245
+ var orderedModifiers = order(modifiers); // order based on phase
3246
+
3247
+ return modifierPhases.reduce(function (acc, phase) {
3248
+ return acc.concat(orderedModifiers.filter(function (modifier) {
3249
+ return modifier.phase === phase;
3250
+ }));
3251
+ }, []);
3252
+ }
3253
+
3254
+ function debounce(fn) {
3255
+ var pending;
3256
+ return function () {
3257
+ if (!pending) {
3258
+ pending = new Promise(function (resolve) {
3259
+ Promise.resolve().then(function () {
3260
+ pending = undefined;
3261
+ resolve(fn());
3262
+ });
3263
+ });
3264
+ }
3265
+
3266
+ return pending;
3267
+ };
3268
+ }
3269
+
3270
+ function mergeByName(modifiers) {
3271
+ var merged = modifiers.reduce(function (merged, current) {
3272
+ var existing = merged[current.name];
3273
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
3274
+ options: Object.assign({}, existing.options, current.options),
3275
+ data: Object.assign({}, existing.data, current.data)
3276
+ }) : current;
3277
+ return merged;
3278
+ }, {}); // IE11 does not support Object.values
3279
+
3280
+ return Object.keys(merged).map(function (key) {
3281
+ return merged[key];
3282
+ });
3283
+ }
3284
+
3285
+ var DEFAULT_OPTIONS = {
3286
+ placement: 'bottom',
3287
+ modifiers: [],
3288
+ strategy: 'absolute'
3289
+ };
3290
+
3291
+ function areValidElements() {
3292
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3293
+ args[_key] = arguments[_key];
3294
+ }
3295
+
3296
+ return !args.some(function (element) {
3297
+ return !(element && typeof element.getBoundingClientRect === 'function');
3298
+ });
3299
+ }
3300
+
3301
+ function popperGenerator(generatorOptions) {
3302
+ if (generatorOptions === void 0) {
3303
+ generatorOptions = {};
3304
+ }
3305
+
3306
+ var _generatorOptions = generatorOptions,
3307
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
3308
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
3309
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
3310
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
3311
+ return function createPopper(reference, popper, options) {
3312
+ if (options === void 0) {
3313
+ options = defaultOptions;
3314
+ }
3315
+
3316
+ var state = {
3317
+ placement: 'bottom',
3318
+ orderedModifiers: [],
3319
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
3320
+ modifiersData: {},
3321
+ elements: {
3322
+ reference: reference,
3323
+ popper: popper
3324
+ },
3325
+ attributes: {},
3326
+ styles: {}
3327
+ };
3328
+ var effectCleanupFns = [];
3329
+ var isDestroyed = false;
3330
+ var instance = {
3331
+ state: state,
3332
+ setOptions: function setOptions(setOptionsAction) {
3333
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
3334
+ cleanupModifierEffects();
3335
+ state.options = Object.assign({}, defaultOptions, state.options, options);
3336
+ state.scrollParents = {
3337
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
3338
+ popper: listScrollParents(popper)
3339
+ }; // Orders the modifiers based on their dependencies and `phase`
3340
+ // properties
3341
+
3342
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
3343
+
3344
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
3345
+ return m.enabled;
3346
+ });
3347
+ runModifierEffects();
3348
+ return instance.update();
3349
+ },
3350
+ // Sync update – it will always be executed, even if not necessary. This
3351
+ // is useful for low frequency updates where sync behavior simplifies the
3352
+ // logic.
3353
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
3354
+ // prefer the async Popper#update method
3355
+ forceUpdate: function forceUpdate() {
3356
+ if (isDestroyed) {
3357
+ return;
3358
+ }
3359
+
3360
+ var _state$elements = state.elements,
3361
+ reference = _state$elements.reference,
3362
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
3363
+ // anymore
3364
+
3365
+ if (!areValidElements(reference, popper)) {
3366
+ return;
3367
+ } // Store the reference and popper rects to be read by modifiers
3368
+
3369
+
3370
+ state.rects = {
3371
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
3372
+ popper: getLayoutRect(popper)
3373
+ }; // Modifiers have the ability to reset the current update cycle. The
3374
+ // most common use case for this is the `flip` modifier changing the
3375
+ // placement, which then needs to re-run all the modifiers, because the
3376
+ // logic was previously ran for the previous placement and is therefore
3377
+ // stale/incorrect
3378
+
3379
+ state.reset = false;
3380
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
3381
+ // is filled with the initial data specified by the modifier. This means
3382
+ // it doesn't persist and is fresh on each update.
3383
+ // To ensure persistent data, use `${name}#persistent`
3384
+
3385
+ state.orderedModifiers.forEach(function (modifier) {
3386
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
3387
+ });
3388
+
3389
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
3390
+ if (state.reset === true) {
3391
+ state.reset = false;
3392
+ index = -1;
3393
+ continue;
3394
+ }
3395
+
3396
+ var _state$orderedModifie = state.orderedModifiers[index],
3397
+ fn = _state$orderedModifie.fn,
3398
+ _state$orderedModifie2 = _state$orderedModifie.options,
3399
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
3400
+ name = _state$orderedModifie.name;
3401
+
3402
+ if (typeof fn === 'function') {
3403
+ state = fn({
3404
+ state: state,
3405
+ options: _options,
3406
+ name: name,
3407
+ instance: instance
3408
+ }) || state;
3409
+ }
3410
+ }
3411
+ },
3412
+ // Async and optimistically optimized update – it will not be executed if
3413
+ // not necessary (debounced to run at most once-per-tick)
3414
+ update: debounce(function () {
3415
+ return new Promise(function (resolve) {
3416
+ instance.forceUpdate();
3417
+ resolve(state);
3418
+ });
3419
+ }),
3420
+ destroy: function destroy() {
3421
+ cleanupModifierEffects();
3422
+ isDestroyed = true;
3423
+ }
3424
+ };
3425
+
3426
+ if (!areValidElements(reference, popper)) {
3427
+ return instance;
3428
+ }
3429
+
3430
+ instance.setOptions(options).then(function (state) {
3431
+ if (!isDestroyed && options.onFirstUpdate) {
3432
+ options.onFirstUpdate(state);
3433
+ }
3434
+ }); // Modifiers have the ability to execute arbitrary code before the first
3435
+ // update cycle runs. They will be executed in the same order as the update
3436
+ // cycle. This is useful when a modifier adds some persistent data that
3437
+ // other modifiers need to use, but the modifier is run after the dependent
3438
+ // one.
3439
+
3440
+ function runModifierEffects() {
3441
+ state.orderedModifiers.forEach(function (_ref) {
3442
+ var name = _ref.name,
3443
+ _ref$options = _ref.options,
3444
+ options = _ref$options === void 0 ? {} : _ref$options,
3445
+ effect = _ref.effect;
3446
+
3447
+ if (typeof effect === 'function') {
3448
+ var cleanupFn = effect({
3449
+ state: state,
3450
+ name: name,
3451
+ instance: instance,
3452
+ options: options
3453
+ });
3454
+
3455
+ var noopFn = function noopFn() {};
3456
+
3457
+ effectCleanupFns.push(cleanupFn || noopFn);
3458
+ }
3459
+ });
3460
+ }
3461
+
3462
+ function cleanupModifierEffects() {
3463
+ effectCleanupFns.forEach(function (fn) {
3464
+ return fn();
3465
+ });
3466
+ effectCleanupFns = [];
3467
+ }
3468
+
3469
+ return instance;
3470
+ };
3471
+ }
3472
+ var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
3473
+
3474
+ var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
3475
+ var createPopper$1 = /*#__PURE__*/popperGenerator({
3476
+ defaultModifiers: defaultModifiers$1
3477
+ }); // eslint-disable-next-line import/no-unused-modules
3478
+
3479
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
3480
+ var createPopper = /*#__PURE__*/popperGenerator({
3481
+ defaultModifiers: defaultModifiers
3482
+ }); // eslint-disable-next-line import/no-unused-modules
3483
+
3484
+ const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
3485
+ __proto__: null,
3486
+ afterMain,
3487
+ afterRead,
3488
+ afterWrite,
3489
+ applyStyles: applyStyles$1,
3490
+ arrow: arrow$1,
3491
+ auto,
3492
+ basePlacements,
3493
+ beforeMain,
3494
+ beforeRead,
3495
+ beforeWrite,
3496
+ bottom,
3497
+ clippingParents,
3498
+ computeStyles: computeStyles$1,
3499
+ createPopper,
3500
+ createPopperBase: createPopper$2,
3501
+ createPopperLite: createPopper$1,
3502
+ detectOverflow,
3503
+ end,
3504
+ eventListeners,
3505
+ flip: flip$1,
3506
+ hide: hide$1,
3507
+ left,
3508
+ main,
3509
+ modifierPhases,
3510
+ offset: offset$1,
3511
+ placements,
3512
+ popper,
3513
+ popperGenerator,
3514
+ popperOffsets: popperOffsets$1,
3515
+ preventOverflow: preventOverflow$1,
3516
+ read,
3517
+ reference,
3518
+ right,
3519
+ start,
3520
+ top,
3521
+ variationPlacements,
3522
+ viewport,
3523
+ write
3524
+ }, Symbol.toStringTag, { value: 'Module' }));
3525
+
1707
3526
  /**
1708
3527
  * --------------------------------------------------------------------------
1709
3528
  * Bootstrap dropdown.js
@@ -1874,26 +3693,26 @@
1874
3693
  }
1875
3694
  _getConfig(config) {
1876
3695
  config = super._getConfig(config);
1877
- if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
3696
+ if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
1878
3697
  // Popper virtual elements require a getBoundingClientRect method
1879
3698
  throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
1880
3699
  }
1881
3700
  return config;
1882
3701
  }
1883
3702
  _createPopper() {
1884
- if (typeof Popper__namespace === 'undefined') {
3703
+ if (typeof Popper === 'undefined') {
1885
3704
  throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
1886
3705
  }
1887
3706
  let referenceElement = this._element;
1888
3707
  if (this._config.reference === 'parent') {
1889
3708
  referenceElement = this._parent;
1890
- } else if (isElement(this._config.reference)) {
3709
+ } else if (isElement$1(this._config.reference)) {
1891
3710
  referenceElement = getElement(this._config.reference);
1892
3711
  } else if (typeof this._config.reference === 'object') {
1893
3712
  referenceElement = this._config.reference;
1894
3713
  }
1895
3714
  const popperConfig = this._getPopperConfig();
1896
- this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
3715
+ this._popper = createPopper(referenceElement, this._menu, popperConfig);
1897
3716
  }
1898
3717
  _isShown() {
1899
3718
  return this._menu.classList.contains(CLASS_NAME_SHOW$6);
@@ -2096,7 +3915,6 @@
2096
3915
  // if false, we use the backdrop helper without adding any element to the dom
2097
3916
  rootElement: 'body' // give the choice to place backdrop under different elements
2098
3917
  };
2099
-
2100
3918
  const DefaultType$8 = {
2101
3919
  className: 'string',
2102
3920
  clickCallback: '(function|null)',
@@ -2221,7 +4039,6 @@
2221
4039
  autofocus: true,
2222
4040
  trapElement: null // The element to trap focus inside of
2223
4041
  };
2224
-
2225
4042
  const DefaultType$7 = {
2226
4043
  autofocus: 'boolean',
2227
4044
  trapElement: 'element'
@@ -2384,7 +4201,7 @@
2384
4201
  this._applyManipulationCallback(selector, manipulationCallBack);
2385
4202
  }
2386
4203
  _applyManipulationCallback(selector, callBack) {
2387
- if (isElement(selector)) {
4204
+ if (isElement$1(selector)) {
2388
4205
  callBack(selector);
2389
4206
  return;
2390
4207
  }
@@ -2948,7 +4765,10 @@
2948
4765
  br: [],
2949
4766
  col: [],
2950
4767
  code: [],
4768
+ dd: [],
2951
4769
  div: [],
4770
+ dl: [],
4771
+ dt: [],
2952
4772
  em: [],
2953
4773
  hr: [],
2954
4774
  h1: [],
@@ -3133,7 +4953,7 @@
3133
4953
  templateElement.remove();
3134
4954
  return;
3135
4955
  }
3136
- if (isElement(content)) {
4956
+ if (isElement$1(content)) {
3137
4957
  this._putElementInTemplate(getElement(content), templateElement);
3138
4958
  return;
3139
4959
  }
@@ -3245,7 +5065,7 @@
3245
5065
 
3246
5066
  class Tooltip extends BaseComponent {
3247
5067
  constructor(element, config) {
3248
- if (typeof Popper__namespace === 'undefined') {
5068
+ if (typeof Popper === 'undefined') {
3249
5069
  throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
3250
5070
  }
3251
5071
  super(element, config);
@@ -3465,7 +5285,7 @@
3465
5285
  _createPopper(tip) {
3466
5286
  const placement = execute(this._config.placement, [this, tip, this._element]);
3467
5287
  const attachment = AttachmentMap[placement.toUpperCase()];
3468
- return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
5288
+ return createPopper(this._element, tip, this._getPopperConfig(attachment));
3469
5289
  }
3470
5290
  _getOffset() {
3471
5291
  const {
@@ -4491,4 +6311,4 @@
4491
6311
  return index_umd;
4492
6312
 
4493
6313
  }));
4494
- //# sourceMappingURL=bootstrap.js.map
6314
+ //# sourceMappingURL=bootstrap.bundle.js.map