@popperjs/core
Advanced tools
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -4,0 +4,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary =\n | HTMLElement\n | Array<HTMLElement>\n | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;IACaA,GAAU,GAAG;IACbC,MAAgB,GAAG;IACnBC,KAAc,GAAG;IACjBC,IAAY,GAAG;IACfC,IAAY,GAAG;IAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;IAEvCG,KAAc,GAAG;IACjBC,GAAU,GAAG;IAGbC,eAAkC,GAAG;IACrCC,QAAoB,GAAG;IAOvBC,MAAgB,GAAG;IACnBC,SAAsB,GAAG;IAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;AAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;AAAA,CAD4D,EAG5D,EAH4D;IAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;AAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;AAAA,CAD0C,EAU1C,EAV0C;;IAc/BW,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,WAA0B,GAAG;IAC7BC,KAAc,GAAG;IACjBC,UAAwB,GAAG;IAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;IACaA,GAAU,GAAG;IACbC,MAAgB,GAAG;IACnBC,KAAc,GAAG;IACjBC,IAAY,GAAG;IACfC,IAAY,GAAG;IAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;IAEvCG,KAAc,GAAG;IACjBC,GAAU,GAAG;IAGbC,eAAkC,GAAG;IACrCC,QAAoB,GAAG;IAIvBC,MAAgB,GAAG;IACnBC,SAAsB,GAAG;IAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;AAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;AAAA,CAD4D,EAG5D,EAH4D;IAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;AAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;AAAA,CAD0C,EAU1C,EAV0C;;IAc/BW,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,WAA0B,GAAG;IAC7BC,KAAc,GAAG;IACjBC,UAAwB,GAAG;IAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;"} |
+57
-57
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -9,38 +9,2 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindow(node) { | ||
@@ -59,12 +23,2 @@ if (node == null) { | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function isElement(node) { | ||
@@ -90,2 +44,51 @@ var OwnElement = getWindow(node).Element; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
| includeScale = false; | ||
| } | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function getHTMLElementScroll(element) { | ||
@@ -143,4 +146,4 @@ return { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -157,5 +160,5 @@ } // Returns the composite rect of an element relative to its offsetParent. | ||
| var isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var documentElement = getDocumentElement(offsetParent); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); | ||
| var scroll = { | ||
@@ -177,3 +180,3 @@ scrollLeft: 0, | ||
| if (isHTMLElement(offsetParent)) { | ||
| offsets = getBoundingClientRect(offsetParent); | ||
| offsets = getBoundingClientRect(offsetParent, true); | ||
| offsets.x += offsetParent.clientLeft; | ||
@@ -578,5 +581,2 @@ offsets.y += offsetParent.clientTop; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable | ||
@@ -653,3 +653,3 @@ | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -671,3 +671,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -674,0 +674,0 @@ } // Gets the maximum area that the element is visible in due to any number of |
+71
-68
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -9,38 +9,2 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindow(node) { | ||
@@ -59,12 +23,2 @@ if (node == null) { | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function isElement(node) { | ||
@@ -90,2 +44,51 @@ var OwnElement = getWindow(node).Element; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
| includeScale = false; | ||
| } | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function getHTMLElementScroll(element) { | ||
@@ -143,4 +146,4 @@ return { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -157,5 +160,5 @@ } // Returns the composite rect of an element relative to its offsetParent. | ||
| var isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var documentElement = getDocumentElement(offsetParent); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); | ||
| var scroll = { | ||
@@ -177,3 +180,3 @@ scrollLeft: 0, | ||
| if (isHTMLElement(offsetParent)) { | ||
| offsets = getBoundingClientRect(offsetParent); | ||
| offsets = getBoundingClientRect(offsetParent, true); | ||
| offsets.x += offsetParent.clientLeft; | ||
@@ -578,6 +581,2 @@ offsets.y += offsetParent.clientTop; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable | ||
@@ -654,3 +653,3 @@ | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -672,3 +671,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -1175,4 +1174,4 @@ } // Gets the maximum area that the element is visible in due to any number of | ||
| return { | ||
| x: round(round(x * dpr) / dpr) || 0, | ||
| y: round(round(y * dpr) / dpr) || 0 | ||
| x: round(x * dpr) / dpr || 0, | ||
| y: round(y * dpr) / dpr || 0 | ||
| }; | ||
@@ -1192,3 +1191,4 @@ } | ||
| adaptive = _ref2.adaptive, | ||
| roundOffsets = _ref2.roundOffsets; | ||
| roundOffsets = _ref2.roundOffsets, | ||
| isFixed = _ref2.isFixed; | ||
@@ -1225,5 +1225,6 @@ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, | ||
| if (placement === top || (placement === left || placement === right) && variation === end) { | ||
| sideY = bottom; // $FlowFixMe[prop-missing] | ||
| y -= offsetParent[heightProp] - popperRect.height; | ||
| sideY = bottom; | ||
| var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] | ||
| offsetParent[heightProp]; | ||
| y -= offsetY - popperRect.height; | ||
| y *= gpuAcceleration ? 1 : -1; | ||
@@ -1233,5 +1234,6 @@ } | ||
| if (placement === left || (placement === top || placement === bottom) && variation === end) { | ||
| sideX = right; // $FlowFixMe[prop-missing] | ||
| x -= offsetParent[widthProp] - popperRect.width; | ||
| sideX = right; | ||
| var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] | ||
| offsetParent[widthProp]; | ||
| x -= offsetX - popperRect.width; | ||
| x *= gpuAcceleration ? 1 : -1; | ||
@@ -1279,3 +1281,4 @@ } | ||
| popperRect: state.rects.popper, | ||
| gpuAcceleration: gpuAcceleration | ||
| gpuAcceleration: gpuAcceleration, | ||
| isFixed: state.options.strategy === 'fixed' | ||
| }; | ||
@@ -1282,0 +1285,0 @@ |
@@ -1,4 +0,4 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| export default function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| import { isHTMLElement } from "./instanceOf.js"; | ||
| import { round } from "../utils/math.js"; | ||
| export default function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
@@ -10,20 +10,18 @@ includeScale = false; | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
@@ -30,0 +28,0 @@ width: rect.width / scaleX, |
@@ -30,3 +30,3 @@ import { viewport } from "../enums.js"; | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -48,3 +48,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -51,0 +51,0 @@ } // Gets the maximum area that the element is visible in due to any number of |
@@ -8,7 +8,8 @@ import getBoundingClientRect from "./getBoundingClientRect.js"; | ||
| import isScrollParent from "./isScrollParent.js"; | ||
| import { round } from "../utils/math.js"; | ||
| function isElementScaled(element) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -15,0 +16,0 @@ } // Returns the composite rect of an element relative to its offsetParent. |
@@ -6,3 +6,3 @@ import getBasePlacement from "../utils/getBasePlacement.js"; | ||
| import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js"; | ||
| import within from "../utils/within.js"; | ||
| import { within } from "../utils/within.js"; | ||
| import mergePaddingObject from "../utils/mergePaddingObject.js"; | ||
@@ -9,0 +9,0 @@ import expandToHashMap from "../utils/expandToHashMap.js"; |
@@ -25,4 +25,4 @@ import { top, left, right, bottom, end } from "../enums.js"; | ||
| return { | ||
| x: round(round(x * dpr) / dpr) || 0, | ||
| y: round(round(y * dpr) / dpr) || 0 | ||
| x: round(x * dpr) / dpr || 0, | ||
| y: round(y * dpr) / dpr || 0 | ||
| }; | ||
@@ -42,3 +42,4 @@ } | ||
| adaptive = _ref2.adaptive, | ||
| roundOffsets = _ref2.roundOffsets; | ||
| roundOffsets = _ref2.roundOffsets, | ||
| isFixed = _ref2.isFixed; | ||
@@ -75,5 +76,6 @@ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, | ||
| if (placement === top || (placement === left || placement === right) && variation === end) { | ||
| sideY = bottom; // $FlowFixMe[prop-missing] | ||
| y -= offsetParent[heightProp] - popperRect.height; | ||
| sideY = bottom; | ||
| var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] | ||
| offsetParent[heightProp]; | ||
| y -= offsetY - popperRect.height; | ||
| y *= gpuAcceleration ? 1 : -1; | ||
@@ -83,5 +85,6 @@ } | ||
| if (placement === left || (placement === top || placement === bottom) && variation === end) { | ||
| sideX = right; // $FlowFixMe[prop-missing] | ||
| x -= offsetParent[widthProp] - popperRect.width; | ||
| sideX = right; | ||
| var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] | ||
| offsetParent[widthProp]; | ||
| x -= offsetX - popperRect.width; | ||
| x *= gpuAcceleration ? 1 : -1; | ||
@@ -129,3 +132,4 @@ } | ||
| popperRect: state.rects.popper, | ||
| gpuAcceleration: gpuAcceleration | ||
| gpuAcceleration: gpuAcceleration, | ||
| isFixed: state.options.strategy === 'fixed' | ||
| }; | ||
@@ -132,0 +136,0 @@ |
| import getBasePlacement from "../utils/getBasePlacement.js"; | ||
| import { top, left, right, placements } from "../enums.js"; | ||
| import { top, left, right, placements } from "../enums.js"; // eslint-disable-next-line import/no-unused-modules | ||
| export function distanceAndSkiddingToXY(placement, rects, offset) { | ||
@@ -4,0 +5,0 @@ var basePlacement = getBasePlacement(placement); |
@@ -5,3 +5,3 @@ import { top, left, right, bottom, start } from "../enums.js"; | ||
| import getAltAxis from "../utils/getAltAxis.js"; | ||
| import within from "../utils/within.js"; | ||
| import { within, withinMaxClamp } from "../utils/within.js"; | ||
| import getLayoutRect from "../dom-utils/getLayoutRect.js"; | ||
@@ -12,3 +12,3 @@ import getOffsetParent from "../dom-utils/getOffsetParent.js"; | ||
| import getFreshSideObject from "../utils/getFreshSideObject.js"; | ||
| import { max as mathMax, min as mathMin } from "../utils/math.js"; | ||
| import { min as mathMin, max as mathMax } from "../utils/math.js"; | ||
@@ -48,2 +48,10 @@ function preventOverflow(_ref) { | ||
| })) : tetherOffset; | ||
| var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { | ||
| mainAxis: tetherOffsetValue, | ||
| altAxis: tetherOffsetValue | ||
| } : Object.assign({ | ||
| mainAxis: 0, | ||
| altAxis: 0 | ||
| }, tetherOffsetValue); | ||
| var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; | ||
| var data = { | ||
@@ -58,3 +66,5 @@ x: 0, | ||
| if (checkMainAxis || checkAltAxis) { | ||
| if (checkMainAxis) { | ||
| var _offsetModifierState$; | ||
| var mainSide = mainAxis === 'y' ? top : left; | ||
@@ -64,4 +74,4 @@ var altSide = mainAxis === 'y' ? bottom : right; | ||
| var offset = popperOffsets[mainAxis]; | ||
| var min = popperOffsets[mainAxis] + overflow[mainSide]; | ||
| var max = popperOffsets[mainAxis] - overflow[altSide]; | ||
| var min = offset + overflow[mainSide]; | ||
| var max = offset - overflow[altSide]; | ||
| var additive = tether ? -popperRect[len] / 2 : 0; | ||
@@ -86,32 +96,41 @@ var minLen = variation === start ? referenceRect[len] : popperRect[len]; | ||
| var arrowLen = within(0, referenceRect[len], arrowRect[len]); | ||
| var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; | ||
| var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; | ||
| var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; | ||
| var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; | ||
| var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); | ||
| var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; | ||
| var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; | ||
| var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; | ||
| var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; | ||
| var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; | ||
| var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; | ||
| var tetherMax = offset + maxOffset - offsetModifierValue; | ||
| var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max); | ||
| popperOffsets[mainAxis] = preventedOffset; | ||
| data[mainAxis] = preventedOffset - offset; | ||
| } | ||
| if (checkMainAxis) { | ||
| var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max); | ||
| popperOffsets[mainAxis] = preventedOffset; | ||
| data[mainAxis] = preventedOffset - offset; | ||
| } | ||
| if (checkAltAxis) { | ||
| var _offsetModifierState$2; | ||
| if (checkAltAxis) { | ||
| var _mainSide = mainAxis === 'x' ? top : left; | ||
| var _mainSide = mainAxis === 'x' ? top : left; | ||
| var _altSide = mainAxis === 'x' ? bottom : right; | ||
| var _altSide = mainAxis === 'x' ? bottom : right; | ||
| var _offset = popperOffsets[altAxis]; | ||
| var _offset = popperOffsets[altAxis]; | ||
| var _min = _offset + overflow[_mainSide]; | ||
| var _len = altAxis === 'y' ? 'height' : 'width'; | ||
| var _max = _offset - overflow[_altSide]; | ||
| var _min = _offset + overflow[_mainSide]; | ||
| var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max); | ||
| var _max = _offset - overflow[_altSide]; | ||
| popperOffsets[altAxis] = _preventedOffset; | ||
| data[altAxis] = _preventedOffset - _offset; | ||
| } | ||
| var isOriginSide = [top, left].indexOf(basePlacement) !== -1; | ||
| var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; | ||
| var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; | ||
| var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; | ||
| var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); | ||
| popperOffsets[altAxis] = _preventedOffset; | ||
| data[altAxis] = _preventedOffset - _offset; | ||
| } | ||
@@ -118,0 +137,0 @@ |
| import { max as mathMax, min as mathMin } from "./math.js"; | ||
| export default function within(min, value, max) { | ||
| export function within(min, value, max) { | ||
| return mathMax(min, mathMin(value, max)); | ||
| } | ||
| export function withinMaxClamp(min, value, max) { | ||
| var v = within(min, value, max); | ||
| return v > max ? max : v; | ||
| } |
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -4,0 +4,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary =\n | HTMLElement\n | Array<HTMLElement>\n | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;;;MACaA,GAAU,GAAG;MACbC,MAAgB,GAAG;MACnBC,KAAc,GAAG;MACjBC,IAAY,GAAG;MACfC,IAAY,GAAG;MAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;MAEvCG,KAAc,GAAG;MACjBC,GAAU,GAAG;MAGbC,eAAkC,GAAG;MACrCC,QAAoB,GAAG;MAOvBC,MAAgB,GAAG;MACnBC,SAAsB,GAAG;MAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;EAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;EAAA,CAD4D,EAG5D,EAH4D;MAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;EAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;EAAA,CAD0C,EAU1C,EAV0C;;MAc/BW,UAAwB,GAAG;MAC3BC,IAAY,GAAG;MACfC,SAAsB,GAAG;;MAEzBC,UAAwB,GAAG;MAC3BC,IAAY,GAAG;MACfC,SAAsB,GAAG;;MAEzBC,WAA0B,GAAG;MAC7BC,KAAc,GAAG;MACjBC,UAAwB,GAAG;MAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;;;MACaA,GAAU,GAAG;MACbC,MAAgB,GAAG;MACnBC,KAAc,GAAG;MACjBC,IAAY,GAAG;MACfC,IAAY,GAAG;MAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;MAEvCG,KAAc,GAAG;MACjBC,GAAU,GAAG;MAGbC,eAAkC,GAAG;MACrCC,QAAoB,GAAG;MAIvBC,MAAgB,GAAG;MACnBC,SAAsB,GAAG;MAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;EAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;EAAA,CAD4D,EAG5D,EAH4D;MAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;EAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;EAAA,CAD0C,EAU1C,EAV0C;;MAc/BW,UAAwB,GAAG;MAC3BC,IAAY,GAAG;MACfC,SAAsB,GAAG;;MAEzBC,UAAwB,GAAG;MAC3BC,IAAY,GAAG;MACfC,SAAsB,GAAG;;MAEzBC,WAA0B,GAAG;MAC7BC,KAAc,GAAG;MACjBC,UAAwB,GAAG;MAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} |
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -4,0 +4,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"enums.min.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary =\n | HTMLElement\n | Array<HTMLElement>\n | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["basePlacements","top","bottom","right","left","variationPlacements","acc","placement","placements","auto","afterMain","afterRead","afterWrite","beforeMain","beforeRead","beforeWrite","clippingParents","end","main","modifierPhases","popper","read","reference","start","viewport","write"],"mappings":";;;;kPAWaA,EAAuC,CAV1BC,MACMC,SACFC,QACFC,QAsCfC,EAAiDL,UAC5D,SAACM,EAAgCC,mBACpB,CAAKA,WAAgCA,aAClD,IAEWC,EAA+B,UAAIR,GA1CpBS,iBA2C1B,SACEH,EACAC,mBAEW,CACTA,EACIA,WACAA,aAER,gBAUoCG,wBAJAC,yBAQEC,oBAlEZH,uCA4DYI,0BAJAC,2BAQEC,uBAnEVb,2BAekBc,wBAHxBC,aAVEb,cA8DAc,wBAMyBC,yFAAAA,6BA/CrBC,gBAqCJC,mBApCUC,oBAvBRnB,gBAUAoB,cAZJtB,yCAiBUuB,mBAoDNC"} | ||
| {"version":3,"file":"enums.min.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["basePlacements","top","bottom","right","left","variationPlacements","acc","placement","placements","auto","afterMain","afterRead","afterWrite","beforeMain","beforeRead","beforeWrite","clippingParents","end","main","modifierPhases","popper","read","reference","start","viewport","write"],"mappings":";;;;kPAWaA,EAAuC,CAV1BC,MACMC,SACFC,QACFC,QAmCfC,EAAiDL,UAC5D,SAACM,EAAgCC,mBACpB,CAAKA,WAAgCA,aAClD,IAEWC,EAA+B,UAAIR,GAvCpBS,iBAwC1B,SACEH,EACAC,mBAEW,CACTA,EACIA,WACAA,aAER,gBAUoCG,wBAJAC,yBAQEC,oBA/DZH,uCAyDYI,0BAJAC,2BAQEC,uBAhEVb,2BAekBc,wBAHxBC,aAVEb,cA2DAc,wBAMyBC,yFAAAA,6BA/CrBC,gBAqCJC,mBApCUC,oBApBRnB,gBAUAoB,cAZJtB,yCAiBUuB,mBAiDNC"} |
+57
-57
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -11,38 +11,2 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindow(node) { | ||
@@ -61,12 +25,2 @@ if (node == null) { | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function isElement(node) { | ||
@@ -92,2 +46,51 @@ var OwnElement = getWindow(node).Element; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
| includeScale = false; | ||
| } | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function getHTMLElementScroll(element) { | ||
@@ -145,4 +148,4 @@ return { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -159,5 +162,5 @@ } // Returns the composite rect of an element relative to its offsetParent. | ||
| var isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var documentElement = getDocumentElement(offsetParent); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); | ||
| var scroll = { | ||
@@ -179,3 +182,3 @@ scrollLeft: 0, | ||
| if (isHTMLElement(offsetParent)) { | ||
| offsets = getBoundingClientRect(offsetParent); | ||
| offsets = getBoundingClientRect(offsetParent, true); | ||
| offsets.x += offsetParent.clientLeft; | ||
@@ -580,5 +583,2 @@ offsets.y += offsetParent.clientTop; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable | ||
@@ -655,3 +655,3 @@ | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -673,3 +673,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -676,0 +676,0 @@ } // Gets the maximum area that the element is visible in due to any number of |
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
| "use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Popper={})}(this,(function(t){function e(t,e){return{width:(t=t.getBoundingClientRect()).width/1,height:t.height/1,top:t.top/1,right:t.right/1,bottom:t.bottom/1,left:t.left/1,x:t.left/1,y:t.top/1}}function n(t){return null==t?window:"[object Window]"!==t.toString()?(t=t.ownerDocument)&&t.defaultView||window:t}function o(t){return{scrollLeft:(t=n(t)).pageXOffset,scrollTop:t.pageYOffset}}function i(t){return t instanceof n(t).Element||t instanceof Element}function r(t){return t instanceof n(t).HTMLElement||t instanceof HTMLElement}function f(t){return"undefined"!=typeof ShadowRoot&&(t instanceof n(t).ShadowRoot||t instanceof ShadowRoot)}function c(t){return t?(t.nodeName||"").toLowerCase():null}function a(t){return((i(t)?t.ownerDocument:t.document)||window.document).documentElement}function s(t){return e(a(t)).left+o(t).scrollLeft}function l(t){return n(t).getComputedStyle(t)}function u(t){return t=l(t),/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function d(t,i,f){void 0===f&&(f=!1);var l=r(i);r(i)&&i.getBoundingClientRect();var d=a(i);t=e(t);var p={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(l||!l&&!f)&&(("body"!==c(i)||u(d))&&(p=i!==n(i)&&r(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:o(i)),r(i)?((h=e(i)).x+=i.clientLeft,h.y+=i.clientTop):d&&(h.x=s(d))),{x:t.left+p.scrollLeft-h.x,y:t.top+p.scrollTop-h.y,width:t.width,height:t.height}}function p(t){var n=e(t),o=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-o)&&(o=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:o,height:i}}function h(t){return"html"===c(t)?t:t.assignedSlot||t.parentNode||(f(t)?t.host:null)||a(t)}function m(t){return 0<=["html","body","#document"].indexOf(c(t))?t.ownerDocument.body:r(t)&&u(t)?t:m(h(t))}function g(t,e){var o;void 0===e&&(e=[]);var i=m(t);return t=i===(null==(o=t.ownerDocument)?void 0:o.body),o=n(i),i=t?[o].concat(o.visualViewport||[],u(i)?i:[]):i,e=e.concat(i),t?e:e.concat(g(h(i)))}function v(t){return r(t)&&"fixed"!==l(t).position?t.offsetParent:null}function b(t){for(var e=n(t),o=v(t);o&&0<=["table","td","th"].indexOf(c(o))&&"static"===l(o).position;)o=v(o);if(o&&("html"===c(o)||"body"===c(o)&&"static"===l(o).position))return e;if(!o)t:{if(o=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!r(t)||"fixed"!==l(t).position)for(t=h(t);r(t)&&0>["html","body"].indexOf(c(t));){var i=l(t);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||o&&"filter"===i.willChange||o&&i.filter&&"none"!==i.filter){o=t;break t}t=t.parentNode}o=null}return o||e}function y(t){function e(t){o.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){o.has(t)||(t=n.get(t))&&e(t)})),i.push(t)}var n=new Map,o=new Set,i=[];return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){o.has(t.name)||e(t)})),i}function w(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}function x(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function O(t,i){if("viewport"===i){i=n(t);var f=a(t);i=i.visualViewport;var c=f.clientWidth;f=f.clientHeight;var u=0,d=0;i&&(c=i.width,f=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(u=i.offsetLeft,d=i.offsetTop)),t=x(t={width:c,height:f,x:u+s(t),y:d})}else r(i)?((t=e(i)).top+=i.clientTop,t.left+=i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top):(d=a(t),t=a(d),c=o(d),i=null==(f=d.ownerDocument)?void 0:f.body,f=W(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),u=W(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),d=-c.scrollLeft+s(d),c=-c.scrollTop,"rtl"===l(i||t).direction&&(d+=W(t.clientWidth,i?i.clientWidth:0)-f),t=x({width:f,height:u,x:d,y:c}));return t}function M(t,e,n){return e="clippingParents"===e?function(t){var e=g(h(t)),n=0<=["absolute","fixed"].indexOf(l(t).position)&&r(t)?b(t):t;return i(n)?e.filter((function(t){var e;if(e=i(t))t:if(e=n.getRootNode&&n.getRootNode(),t.contains(n))e=!0;else{if(e&&f(e)){e=n;do{if(e&&t.isSameNode(e)){e=!0;break t}e=e.parentNode||e.host}while(e)}e=!1}return e&&"body"!==c(t)})):[]}(t):[].concat(e),(n=(n=[].concat(e,[n])).reduce((function(e,n){return n=O(t,n),e.top=W(n.top,e.top),e.right=H(n.right,e.right),e.bottom=H(n.bottom,e.bottom),e.left=W(n.left,e.left),e}),O(t,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function E(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function L(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,o=void 0===(t=t.defaultOptions)?P:t;return function(t,e,r){function f(){a.forEach((function(t){return t()})),a=[]}void 0===r&&(r=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},P,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},a=[],s=!1,l={state:c,setOptions:function(r){return r="function"==typeof r?r(c.options):r,f(),c.options=Object.assign({},o,c.options,r),c.scrollParents={reference:i(t)?g(t):t.contextElement?g(t.contextElement):[],popper:g(e)},r=function(t){var e=y(t);return j.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}(function(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(n,c.options.modifiers))),c.orderedModifiers=r.filter((function(t){return t.enabled})),c.orderedModifiers.forEach((function(t){var e=t.name,n=t.options;n=void 0===n?{}:n,"function"==typeof(t=t.effect)&&(e=t({state:c,name:e,instance:l,options:n}),a.push(e||function(){}))})),l.update()},forceUpdate:function(){if(!s){var t=c.elements,e=t.reference;if(E(e,t=t.popper))for(c.rects={reference:d(e,b(t),"fixed"===c.options.strategy),popper:p(t)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach((function(t){return c.modifiersData[t.name]=Object.assign({},t.data)})),e=0;e<c.orderedModifiers.length;e++)if(!0===c.reset)c.reset=!1,e=-1;else{var n=c.orderedModifiers[e];t=n.fn;var o=n.options;o=void 0===o?{}:o,n=n.name,"function"==typeof t&&(c=t({state:c,options:o,name:n,instance:l})||c)}}},update:w((function(){return new Promise((function(t){l.forceUpdate(),t(c)}))})),destroy:function(){f(),s=!0}};return E(t,e)?(l.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),l):l}}var T=["top","bottom","right","left"],j="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),W=Math.max,H=Math.min,P={placement:"bottom",modifiers:[],strategy:"absolute"},R=L();t.createPopper=R,t.detectOverflow=function(t,n){void 0===n&&(n={});var o=n;n=void 0===(n=o.placement)?t.placement:n;var r=o.boundary,f=void 0===r?"clippingParents":r,c=void 0===(r=o.rootBoundary)?"viewport":r;r=void 0===(r=o.elementContext)?"popper":r;var s=o.altBoundary,l=void 0!==s&&s;o=void 0===(o=o.padding)?0:o,o=Object.assign({},{top:0,right:0,bottom:0,left:0},"number"!=typeof o?o:function(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}(o,T)),s=t.rects.popper,f=M(i(l=t.elements[l?"popper"===r?"reference":"popper":r])?l:l.contextElement||a(t.elements.popper),f,c),l=function(t){var e=t.reference,n=t.element,o=(t=t.placement)?t.split("-")[0]:null;t=t?t.split("-")[1]:null;var i=e.x+e.width/2-n.width/2,r=e.y+e.height/2-n.height/2;switch(o){case"top":i={x:i,y:e.y-n.height};break;case"bottom":i={x:i,y:e.y+e.height};break;case"right":i={x:e.x+e.width,y:r};break;case"left":i={x:e.x-n.width,y:r};break;default:i={x:e.x,y:e.y}}if(null!=(o=o?0<=["top","bottom"].indexOf(o)?"x":"y":null))switch(r="y"===o?"height":"width",t){case"start":i[o]-=e[r]/2-n[r]/2;break;case"end":i[o]+=e[r]/2-n[r]/2}return i}({reference:c=e(t.elements.reference),element:s,strategy:"absolute",placement:n}),s=x(Object.assign({},s,l)),c="popper"===r?s:c;var u={top:f.top-c.top+o.top,bottom:c.bottom-f.bottom+o.bottom,left:f.left-c.left+o.left,right:c.right-f.right+o.right};if(t=t.modifiersData.offset,"popper"===r&&t){var d=t[n];Object.keys(u).forEach((function(t){var e=0<=["right","bottom"].indexOf(t)?1:-1,n=0<=["top","bottom"].indexOf(t)?"y":"x";u[t]+=d[n]*e}))}return u},t.popperGenerator=L,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
| "use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Popper={})}(this,(function(t){function e(t){return null==t?window:"[object Window]"!==t.toString()?(t=t.ownerDocument)&&t.defaultView||window:t}function o(t){return t instanceof e(t).Element||t instanceof Element}function n(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function i(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}function r(t,e){void 0===e&&(e=!1);var o=t.getBoundingClientRect(),i=1,r=1;return n(t)&&e&&(e=t.offsetHeight,0<(t=t.offsetWidth)&&(i=j(o.width)/t||1),0<e&&(r=j(o.height)/e||1)),{width:o.width/i,height:o.height/r,top:o.top/r,right:o.right/i,bottom:o.bottom/r,left:o.left/i,x:o.left/i,y:o.top/r}}function f(t){return{scrollLeft:(t=e(t)).pageXOffset,scrollTop:t.pageYOffset}}function a(t){return t?(t.nodeName||"").toLowerCase():null}function c(t){return((o(t)?t.ownerDocument:t.document)||window.document).documentElement}function s(t){return r(c(t)).left+f(t).scrollLeft}function l(t){return e(t).getComputedStyle(t)}function d(t){return t=l(t),/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function u(t,o,i){void 0===i&&(i=!1);var l,u=n(o);if(l=n(o)){var p=o.getBoundingClientRect();l=j(p.width)/o.offsetWidth||1,p=j(p.height)/o.offsetHeight||1,l=1!==l||1!==p}p=l,l=c(o),t=r(t,p),p={scrollLeft:0,scrollTop:0};var h={x:0,y:0};return(u||!u&&!i)&&(("body"!==a(o)||d(l))&&(p=o!==e(o)&&n(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:f(o)),n(o)?((h=r(o,!0)).x+=o.clientLeft,h.y+=o.clientTop):l&&(h.x=s(l))),{x:t.left+p.scrollLeft-h.x,y:t.top+p.scrollTop-h.y,width:t.width,height:t.height}}function p(t){var e=r(t),o=t.offsetWidth,n=t.offsetHeight;return 1>=Math.abs(e.width-o)&&(o=e.width),1>=Math.abs(e.height-n)&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:o,height:n}}function h(t){return"html"===a(t)?t:t.assignedSlot||t.parentNode||(i(t)?t.host:null)||c(t)}function m(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:n(t)&&d(t)?t:m(h(t))}function g(t,o){var n;void 0===o&&(o=[]);var i=m(t);return t=i===(null==(n=t.ownerDocument)?void 0:n.body),n=e(i),i=t?[n].concat(n.visualViewport||[],d(i)?i:[]):i,o=o.concat(i),t?o:o.concat(g(h(i)))}function v(t){return n(t)&&"fixed"!==l(t).position?t.offsetParent:null}function b(t){for(var o=e(t),i=v(t);i&&0<=["table","td","th"].indexOf(a(i))&&"static"===l(i).position;)i=v(i);if(i&&("html"===a(i)||"body"===a(i)&&"static"===l(i).position))return o;if(!i)t:{if(i=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!n(t)||"fixed"!==l(t).position)for(t=h(t);n(t)&&0>["html","body"].indexOf(a(t));){var r=l(t);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||i&&"filter"===r.willChange||i&&r.filter&&"none"!==r.filter){i=t;break t}t=t.parentNode}i=null}return i||o}function w(t){function e(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){n.has(t)||(t=o.get(t))&&e(t)})),i.push(t)}var o=new Map,n=new Set,i=[];return t.forEach((function(t){o.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||e(t)})),i}function y(t){var e;return function(){return e||(e=new Promise((function(o){Promise.resolve().then((function(){e=void 0,o(t())}))}))),e}}function x(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function O(t,n){if("viewport"===n){n=e(t);var i=c(t);n=n.visualViewport;var a=i.clientWidth;i=i.clientHeight;var d=0,u=0;n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(d=n.offsetLeft,u=n.offsetTop)),t=x(t={width:a,height:i,x:d+s(t),y:u})}else o(n)?((t=r(n)).top+=n.clientTop,t.left+=n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top):(u=c(t),t=c(u),a=f(u),n=null==(i=u.ownerDocument)?void 0:i.body,i=T(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),d=T(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-a.scrollLeft+s(u),a=-a.scrollTop,"rtl"===l(n||t).direction&&(u+=T(t.clientWidth,n?n.clientWidth:0)-i),t=x({width:i,height:d,x:u,y:a}));return t}function M(t,e,r){return e="clippingParents"===e?function(t){var e=g(h(t)),r=0<=["absolute","fixed"].indexOf(l(t).position),f=r&&n(t)?b(t):t;return o(f)?e.filter((function(t){var e;if(e=o(t))t:if(e=f.getRootNode&&f.getRootNode(),t.contains(f))e=!0;else{if(e&&i(e)){e=f;do{if(e&&t.isSameNode(e)){e=!0;break t}e=e.parentNode||e.host}while(e)}e=!1}return e&&"body"!==a(t)&&(!r||"static"!==l(t).position)})):[]}(t):[].concat(e),(r=(r=[].concat(e,[r])).reduce((function(e,o){return o=O(t,o),e.top=T(o.top,e.top),e.right=W(o.right,e.right),e.bottom=W(o.bottom,e.bottom),e.left=T(o.left,e.left),e}),O(t,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function E(){for(var t=arguments.length,e=Array(t),o=0;o<t;o++)e[o]=arguments[o];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function L(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,i=void 0===(t=t.defaultOptions)?R:t;return function(t,e,r){function f(){c.forEach((function(t){return t()})),c=[]}void 0===r&&(r=i);var a={placement:"bottom",orderedModifiers:[],options:Object.assign({},R,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],s=!1,l={state:a,setOptions:function(r){return r="function"==typeof r?r(a.options):r,f(),a.options=Object.assign({},i,a.options,r),a.scrollParents={reference:o(t)?g(t):t.contextElement?g(t.contextElement):[],popper:g(e)},r=function(t){var e=w(t);return P.reduce((function(t,o){return t.concat(e.filter((function(t){return t.phase===o})))}),[])}(function(t){var e=t.reduce((function(t,e){var o=t[e.name];return t[e.name]=o?Object.assign({},o,e,{options:Object.assign({},o.options,e.options),data:Object.assign({},o.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(n,a.options.modifiers))),a.orderedModifiers=r.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,o=t.options;o=void 0===o?{}:o,"function"==typeof(t=t.effect)&&(e=t({state:a,name:e,instance:l,options:o}),c.push(e||function(){}))})),l.update()},forceUpdate:function(){if(!s){var t=a.elements,e=t.reference;if(E(e,t=t.popper))for(a.rects={reference:u(e,b(t),"fixed"===a.options.strategy),popper:p(t)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)})),e=0;e<a.orderedModifiers.length;e++)if(!0===a.reset)a.reset=!1,e=-1;else{var o=a.orderedModifiers[e];t=o.fn;var n=o.options;n=void 0===n?{}:n,o=o.name,"function"==typeof t&&(a=t({state:a,options:n,name:o,instance:l})||a)}}},update:y((function(){return new Promise((function(t){l.forceUpdate(),t(a)}))})),destroy:function(){f(),s=!0}};return E(t,e)?(l.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),l):l}}var T=Math.max,W=Math.min,j=Math.round,H=["top","bottom","right","left"],P="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),R={placement:"bottom",modifiers:[],strategy:"absolute"},k=L();t.createPopper=k,t.detectOverflow=function(t,e){void 0===e&&(e={});var n=e;e=void 0===(e=n.placement)?t.placement:e;var i=n.boundary,f=void 0===i?"clippingParents":i,a=void 0===(i=n.rootBoundary)?"viewport":i;i=void 0===(i=n.elementContext)?"popper":i;var s=n.altBoundary,l=void 0!==s&&s;n=void 0===(n=n.padding)?0:n,n=Object.assign({},{top:0,right:0,bottom:0,left:0},"number"!=typeof n?n:function(t,e){return e.reduce((function(e,o){return e[o]=t,e}),{})}(n,H)),s=t.rects.popper,f=M(o(l=t.elements[l?"popper"===i?"reference":"popper":i])?l:l.contextElement||c(t.elements.popper),f,a),l=function(t){var e=t.reference,o=t.element,n=(t=t.placement)?t.split("-")[0]:null;t=t?t.split("-")[1]:null;var i=e.x+e.width/2-o.width/2,r=e.y+e.height/2-o.height/2;switch(n){case"top":i={x:i,y:e.y-o.height};break;case"bottom":i={x:i,y:e.y+e.height};break;case"right":i={x:e.x+e.width,y:r};break;case"left":i={x:e.x-o.width,y:r};break;default:i={x:e.x,y:e.y}}if(null!=(n=n?0<=["top","bottom"].indexOf(n)?"x":"y":null))switch(r="y"===n?"height":"width",t){case"start":i[n]-=e[r]/2-o[r]/2;break;case"end":i[n]+=e[r]/2-o[r]/2}return i}({reference:a=r(t.elements.reference),element:s,strategy:"absolute",placement:e}),s=x(Object.assign({},s,l)),a="popper"===i?s:a;var d={top:f.top-a.top+n.top,bottom:a.bottom-f.bottom+n.bottom,left:f.left-a.left+n.left,right:a.right-f.right+n.right};if(t=t.modifiersData.offset,"popper"===i&&t){var u=t[e];Object.keys(d).forEach((function(t){var e=0<=["right","bottom"].indexOf(t)?1:-1,o=0<=["top","bottom"].indexOf(t)?"y":"x";d[t]+=u[o]*e}))}return d},t.popperGenerator=L,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
| //# sourceMappingURL=popper-base.min.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"popper-base.min.js","sources":["../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindow.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/instanceOf.js","../../src/dom-utils/getNodeName.js","../../src/dom-utils/getDocumentElement.js","../../src/dom-utils/getWindowScrollBarX.js","../../src/dom-utils/getComputedStyle.js","../../src/dom-utils/isScrollParent.js","../../src/dom-utils/getCompositeRect.js","../../src/dom-utils/getNodeScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/getOffsetParent.js","../../src/dom-utils/isTableElement.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/enums.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/createPopper.js","../../src/utils/mergeByName.js","../../src/utils/math.js","../../src/utils/detectOverflow.js","../../src/utils/getFreshSideObject.js","../../src/utils/expandToHashMap.js","../../src/utils/computeOffsets.js","../../src/utils/getBasePlacement.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js"],"sourcesContent":["// @flow\nimport type { ClientRectObject, VirtualElement } from '../types';\n// import { isHTMLElement } from './instanceOf';\n\nexport default function getBoundingClientRect(\n element: Element | VirtualElement,\n // eslint-disable-next-line unused-imports/no-unused-vars\n includeScale: boolean = false\n): ClientRectObject {\n const rect = element.getBoundingClientRect();\n let scaleX = 1;\n let scaleY = 1;\n\n // FIXME:\n // `offsetWidth` returns an integer while `getBoundingClientRect`\n // returns a float. This results in `scaleX` or `scaleY` being\n // non-1 when it should be for elements that aren't a full pixel in\n // width or height.\n // if (isHTMLElement(element) && includeScale) {\n // const offsetHeight = element.offsetHeight;\n // const offsetWidth = element.offsetWidth;\n\n // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // // Fallback to 1 in case both values are `0`\n // if (offsetWidth > 0) {\n // scaleX = rect.width / offsetWidth || 1;\n // }\n // if (offsetHeight > 0) {\n // scaleY = rect.height / offsetHeight || 1;\n // }\n // }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY,\n };\n}\n","// @flow\nimport type { Window } from '../types';\ndeclare function getWindow(node: Node | Window): Window;\n\nexport default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport type { Window } from '../types';\n\nexport default function getWindowScroll(node: Node | Window) {\n const win = getWindow(node);\n const scrollLeft = win.pageXOffset;\n const scrollTop = win.pageYOffset;\n\n return {\n scrollLeft,\n scrollTop,\n };\n}\n","// @flow\nimport getWindow from './getWindow';\n\ndeclare function isElement(node: mixed): boolean %checks(node instanceof\n Element);\nfunction isElement(node) {\n const OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\ndeclare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement);\nfunction isHTMLElement(node) {\n const OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\ndeclare function isShadowRoot(node: mixed): boolean %checks(node instanceof\n ShadowRoot);\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };\n","// @flow\nimport type { Window } from '../types';\n\nexport default function getNodeName(element: ?Node | Window): ?string {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n","// @flow\nimport { isElement } from './instanceOf';\nimport type { Window } from '../types';\n\nexport default function getDocumentElement(\n element: Element | Window\n): HTMLElement {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return (\n (isElement(element)\n ? element.ownerDocument\n : // $FlowFixMe[prop-missing]\n element.document) || window.document\n ).documentElement;\n}\n","// @flow\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScroll from './getWindowScroll';\n\nexport default function getWindowScrollBarX(element: Element): number {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return (\n getBoundingClientRect(getDocumentElement(element)).left +\n getWindowScroll(element).scrollLeft\n );\n}\n","// @flow\nimport getWindow from './getWindow';\n\nexport default function getComputedStyle(\n element: Element\n): CSSStyleDeclaration {\n return getWindow(element).getComputedStyle(element);\n}\n","// @flow\nimport getComputedStyle from './getComputedStyle';\n\nexport default function isScrollParent(element: HTMLElement): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n","// @flow\nimport type { Rect, VirtualElement, Window } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getNodeScroll from './getNodeScroll';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getDocumentElement from './getDocumentElement';\nimport isScrollParent from './isScrollParent';\n\nfunction isElementScaled(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const scaleX = rect.width / element.offsetWidth || 1;\n const scaleY = rect.height / element.offsetHeight || 1;\n\n return scaleX !== 1 || scaleY !== 1;\n}\n\n// Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\nexport default function getCompositeRect(\n elementOrVirtualElement: Element | VirtualElement,\n offsetParent: Element | Window,\n isFixed: boolean = false\n): Rect {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const offsetParentIsScaled =\n isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(\n elementOrVirtualElement,\n offsetParentIsScaled\n );\n\n let scroll = { scrollLeft: 0, scrollTop: 0 };\n let offsets = { x: 0, y: 0 };\n\n if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {\n if (\n getNodeName(offsetParent) !== 'body' ||\n // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)\n ) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height,\n };\n}\n","// @flow\nimport getWindowScroll from './getWindowScroll';\nimport getWindow from './getWindow';\nimport { isHTMLElement } from './instanceOf';\nimport getHTMLElementScroll from './getHTMLElementScroll';\nimport type { Window } from '../types';\n\nexport default function getNodeScroll(node: Node | Window) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n","// @flow\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\nexport default function getLayoutRect(element: HTMLElement): Rect {\n const clientRect = getBoundingClientRect(element);\n\n // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width,\n height,\n };\n}\n","// @flow\nimport getNodeName from './getNodeName';\nimport getDocumentElement from './getDocumentElement';\nimport { isShadowRoot } from './instanceOf';\n\nexport default function getParentNode(element: Node | ShadowRoot): Node {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (\n // this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}\n","// @flow\nimport getParentNode from './getParentNode';\nimport isScrollParent from './isScrollParent';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\n\nexport default function getScrollParent(node: Node): HTMLElement {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n","// @flow\nimport getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getWindow from './getWindow';\nimport type { Window, VisualViewport } from '../types';\nimport isScrollParent from './isScrollParent';\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\nexport default function listScrollParents(\n element: Node,\n list: Array<Element | Window> = []\n): Array<Element | Window | VisualViewport> {\n const scrollParent = getScrollParent(element);\n const isBody = scrollParent === element.ownerDocument?.body;\n const win = getWindow(scrollParent);\n const target = isBody\n ? [win].concat(\n win.visualViewport || [],\n isScrollParent(scrollParent) ? scrollParent : []\n )\n : scrollParent;\n const updatedList = list.concat(target);\n\n return isBody\n ? updatedList\n : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement } from './instanceOf';\nimport isTableElement from './isTableElement';\nimport getParentNode from './getParentNode';\n\nfunction getTrueOffsetParent(element: Element): ?Element {\n if (\n !isHTMLElement(element) ||\n // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed'\n ) {\n return null;\n }\n\n return element.offsetParent;\n}\n\n// `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\nfunction getContainingBlock(element: Element) {\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n const isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n const elementCss = getComputedStyle(element);\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n let currentNode = getParentNode(element);\n\n while (\n isHTMLElement(currentNode) &&\n ['html', 'body'].indexOf(getNodeName(currentNode)) < 0\n ) {\n const css = getComputedStyle(currentNode);\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n if (\n css.transform !== 'none' ||\n css.perspective !== 'none' ||\n css.contain === 'paint' ||\n ['transform', 'perspective'].indexOf(css.willChange) !== -1 ||\n (isFirefox && css.willChange === 'filter') ||\n (isFirefox && css.filter && css.filter !== 'none')\n ) {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nexport default function getOffsetParent(element: Element) {\n const window = getWindow(element);\n\n let offsetParent = getTrueOffsetParent(element);\n\n while (\n offsetParent &&\n isTableElement(offsetParent) &&\n getComputedStyle(offsetParent).position === 'static'\n ) {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (\n offsetParent &&\n (getNodeName(offsetParent) === 'html' ||\n (getNodeName(offsetParent) === 'body' &&\n getComputedStyle(offsetParent).position === 'static'))\n ) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n","// @flow\nimport getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport type { Modifier } from '../types';\nimport { modifierPhases } from '../enums';\n\n// source: https://stackoverflow.com/questions/49875255\nfunction order(modifiers) {\n const map = new Map();\n const visited = new Set();\n const result = [];\n\n modifiers.forEach(modifier => {\n map.set(modifier.name, modifier);\n });\n\n // On visiting object, check for its dependencies and visit them recursively\n function sort(modifier: Modifier<any, any>) {\n visited.add(modifier.name);\n\n const requires = [\n ...(modifier.requires || []),\n ...(modifier.requiresIfExists || []),\n ];\n\n requires.forEach(dep => {\n if (!visited.has(dep)) {\n const depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n\n result.push(modifier);\n }\n\n modifiers.forEach(modifier => {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n\n return result;\n}\n\nexport default function orderModifiers(\n modifiers: Array<Modifier<any, any>>\n): Array<Modifier<any, any>> {\n // order based on dependencies\n const orderedModifiers = order(modifiers);\n\n // order based on phase\n return modifierPhases.reduce((acc, phase) => {\n return acc.concat(\n orderedModifiers.filter(modifier => modifier.phase === phase)\n );\n }, []);\n}\n","// @flow\n\nexport default function debounce<T>(fn: Function): () => Promise<T> {\n let pending;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n","// @flow\nimport type { Rect, ClientRectObject } from '../types';\n\nexport default function rectToClientRect(rect: Rect): ClientRectObject {\n return {\n ...rect,\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height,\n };\n}\n","// @flow\nimport type { ClientRectObject } from '../types';\nimport type { Boundary, RootBoundary } from '../enums';\nimport { viewport } from '../enums';\nimport getViewportRect from './getViewportRect';\nimport getDocumentRect from './getDocumentRect';\nimport listScrollParents from './listScrollParents';\nimport getOffsetParent from './getOffsetParent';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getParentNode from './getParentNode';\nimport contains from './contains';\nimport getNodeName from './getNodeName';\nimport rectToClientRect from '../utils/rectToClientRect';\nimport { max, min } from '../utils/math';\n\nfunction getInnerBoundingClientRect(element: Element) {\n const rect = getBoundingClientRect(element);\n\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n\n return rect;\n}\n\nfunction getClientRectFromMixedType(\n element: Element,\n clippingParent: Element | RootBoundary\n): ClientRectObject {\n return clippingParent === viewport\n ? rectToClientRect(getViewportRect(element))\n : isHTMLElement(clippingParent)\n ? getInnerBoundingClientRect(clippingParent)\n : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\nfunction getClippingParents(element: Element): Array<Element> {\n const clippingParents = listScrollParents(getParentNode(element));\n const canEscapeClipping =\n ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n const clipperElement =\n canEscapeClipping && isHTMLElement(element)\n ? getOffsetParent(element)\n : element;\n\n if (!isElement(clipperElement)) {\n return [];\n }\n\n // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n return clippingParents.filter(\n (clippingParent) =>\n isElement(clippingParent) &&\n contains(clippingParent, clipperElement) &&\n getNodeName(clippingParent) !== 'body'\n );\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping parents\nexport default function getClippingRect(\n element: Element,\n boundary: Boundary,\n rootBoundary: RootBoundary\n): ClientRectObject {\n const mainClippingParents =\n boundary === 'clippingParents'\n ? getClippingParents(element)\n : [].concat(boundary);\n const clippingParents = [...mainClippingParents, rootBoundary];\n const firstClippingParent = clippingParents[0];\n\n const clippingRect = clippingParents.reduce((accRect, clippingParent) => {\n const rect = getClientRectFromMixedType(element, clippingParent);\n\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n\n return clippingRect;\n}\n","// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary =\n | HTMLElement\n | Array<HTMLElement>\n | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n","// @flow\nimport getWindow from './getWindow';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScrollBarX from './getWindowScrollBarX';\n\nexport default function getViewportRect(element: Element) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n\n // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n\n // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width,\n height,\n x: x + getWindowScrollBarX(element),\n y,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getWindowScroll from './getWindowScroll';\nimport { max } from '../utils/math';\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\nexport default function getDocumentRect(element: HTMLElement): Rect {\n const html = getDocumentElement(element);\n const winScroll = getWindowScroll(element);\n const body = element.ownerDocument?.body;\n\n const width = max(\n html.scrollWidth,\n html.clientWidth,\n body ? body.scrollWidth : 0,\n body ? body.clientWidth : 0\n );\n const height = max(\n html.scrollHeight,\n html.clientHeight,\n body ? body.scrollHeight : 0,\n body ? body.clientHeight : 0\n );\n\n let x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n const y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return { width, height, x, y };\n}\n","// @flow\nimport { isShadowRoot } from './instanceOf';\n\nexport default function contains(parent: Element, child: Element) {\n const rootNode = child.getRootNode && child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n }\n // $FlowFixMe[prop-missing]: need a better way to handle this...\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n","// @flow\nimport type {\n State,\n OptionsGeneric,\n Modifier,\n Instance,\n VirtualElement,\n} from './types';\nimport getCompositeRect from './dom-utils/getCompositeRect';\nimport getLayoutRect from './dom-utils/getLayoutRect';\nimport listScrollParents from './dom-utils/listScrollParents';\nimport getOffsetParent from './dom-utils/getOffsetParent';\nimport getComputedStyle from './dom-utils/getComputedStyle';\nimport orderModifiers from './utils/orderModifiers';\nimport debounce from './utils/debounce';\nimport validateModifiers from './utils/validateModifiers';\nimport uniqueBy from './utils/uniqueBy';\nimport getBasePlacement from './utils/getBasePlacement';\nimport mergeByName from './utils/mergeByName';\nimport detectOverflow from './utils/detectOverflow';\nimport { isElement } from './dom-utils/instanceOf';\nimport { auto } from './enums';\n\nconst INVALID_ELEMENT_ERROR =\n 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nconst INFINITE_LOOP_ERROR =\n 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\n\nconst DEFAULT_OPTIONS: OptionsGeneric<any> = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute',\n};\n\ntype PopperGeneratorArgs = {\n defaultModifiers?: Array<Modifier<any, any>>,\n defaultOptions?: $Shape<OptionsGeneric<any>>,\n};\n\nfunction areValidElements(...args: Array<any>): boolean {\n return !args.some(\n (element) =>\n !(element && typeof element.getBoundingClientRect === 'function')\n );\n}\n\nexport function popperGenerator(generatorOptions: PopperGeneratorArgs = {}) {\n const {\n defaultModifiers = [],\n defaultOptions = DEFAULT_OPTIONS,\n } = generatorOptions;\n\n return function createPopper<TModifier: $Shape<Modifier<any, any>>>(\n reference: Element | VirtualElement,\n popper: HTMLElement,\n options: $Shape<OptionsGeneric<TModifier>> = defaultOptions\n ): Instance {\n let state: $Shape<State> = {\n placement: 'bottom',\n orderedModifiers: [],\n options: { ...DEFAULT_OPTIONS, ...defaultOptions },\n modifiersData: {},\n elements: {\n reference,\n popper,\n },\n attributes: {},\n styles: {},\n };\n\n let effectCleanupFns: Array<() => void> = [];\n let isDestroyed = false;\n\n const instance = {\n state,\n setOptions(setOptionsAction) {\n const options =\n typeof setOptionsAction === 'function'\n ? setOptionsAction(state.options)\n : setOptionsAction;\n\n cleanupModifierEffects();\n\n state.options = {\n // $FlowFixMe[exponential-spread]\n ...defaultOptions,\n ...state.options,\n ...options,\n };\n\n state.scrollParents = {\n reference: isElement(reference)\n ? listScrollParents(reference)\n : reference.contextElement\n ? listScrollParents(reference.contextElement)\n : [],\n popper: listScrollParents(popper),\n };\n\n // Orders the modifiers based on their dependencies and `phase`\n // properties\n const orderedModifiers = orderModifiers(\n mergeByName([...defaultModifiers, ...state.options.modifiers])\n );\n\n // Strip out disabled modifiers\n state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);\n\n // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n if (__DEV__) {\n const modifiers = uniqueBy(\n [...orderedModifiers, ...state.options.modifiers],\n ({ name }) => name\n );\n\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n const flipModifier = state.orderedModifiers.find(\n ({ name }) => name === 'flip'\n );\n\n if (!flipModifier) {\n console.error(\n [\n 'Popper: \"auto\" placements require the \"flip\" modifier be',\n 'present and enabled to work.',\n ].join(' ')\n );\n }\n }\n\n const {\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n } = getComputedStyle(popper);\n\n // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n if (\n [marginTop, marginRight, marginBottom, marginLeft].some((margin) =>\n parseFloat(margin)\n )\n ) {\n console.warn(\n [\n 'Popper: CSS \"margin\" styles cannot be used to apply padding',\n 'between the popper and its reference element or boundary.',\n 'To replicate margin, use the `offset` modifier, as well as',\n 'the `padding` option in the `preventOverflow` and `flip`',\n 'modifiers.',\n ].join(' ')\n );\n }\n }\n\n runModifierEffects();\n\n return instance.update();\n },\n\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n const { reference, popper } = state.elements;\n\n // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n }\n\n // Store the reference and popper rects to be read by modifiers\n state.rects = {\n reference: getCompositeRect(\n reference,\n getOffsetParent(popper),\n state.options.strategy === 'fixed'\n ),\n popper: getLayoutRect(popper),\n };\n\n // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n state.reset = false;\n\n state.placement = state.options.placement;\n\n // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n state.orderedModifiers.forEach(\n (modifier) =>\n (state.modifiersData[modifier.name] = {\n ...modifier.data,\n })\n );\n\n let __debug_loops__ = 0;\n for (let index = 0; index < state.orderedModifiers.length; index++) {\n if (__DEV__) {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n const { fn, options = {}, name } = state.orderedModifiers[index];\n\n if (typeof fn === 'function') {\n state = fn({ state, options, name, instance }) || state;\n }\n }\n },\n\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce<$Shape<State>>(\n () =>\n new Promise<$Shape<State>>((resolve) => {\n instance.forceUpdate();\n resolve(state);\n })\n ),\n\n destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n },\n };\n\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n\n instance.setOptions(options).then((state) => {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n });\n\n // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n function runModifierEffects() {\n state.orderedModifiers.forEach(({ name, options = {}, effect }) => {\n if (typeof effect === 'function') {\n const cleanupFn = effect({ state, name, instance, options });\n const noopFn = () => {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach((fn) => fn());\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nexport const createPopper = popperGenerator();\n\n// eslint-disable-next-line import/no-unused-modules\nexport { detectOverflow };\n","// @flow\nimport type { Modifier } from '../types';\n\nexport default function mergeByName(\n modifiers: Array<$Shape<Modifier<any, any>>>\n): Array<$Shape<Modifier<any, any>>> {\n const merged = modifiers.reduce((merged, current) => {\n const existing = merged[current.name];\n merged[current.name] = existing\n ? {\n ...existing,\n ...current,\n options: { ...existing.options, ...current.options },\n data: { ...existing.data, ...current.data },\n }\n : current;\n return merged;\n }, {});\n\n // IE11 does not support Object.values\n return Object.keys(merged).map(key => merged[key]);\n}\n","// @flow\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\n","// @flow\nimport type { State, SideObject, Padding } from '../types';\nimport type { Placement, Boundary, RootBoundary, Context } from '../enums';\nimport getClippingRect from '../dom-utils/getClippingRect';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getBoundingClientRect from '../dom-utils/getBoundingClientRect';\nimport computeOffsets from './computeOffsets';\nimport rectToClientRect from './rectToClientRect';\nimport {\n clippingParents,\n reference,\n popper,\n bottom,\n top,\n right,\n basePlacements,\n viewport,\n} from '../enums';\nimport { isElement } from '../dom-utils/instanceOf';\nimport mergePaddingObject from './mergePaddingObject';\nimport expandToHashMap from './expandToHashMap';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n placement: Placement,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n elementContext: Context,\n altBoundary: boolean,\n padding: Padding,\n};\n\nexport default function detectOverflow(\n state: State,\n options: $Shape<Options> = {}\n): SideObject {\n const {\n placement = state.placement,\n boundary = clippingParents,\n rootBoundary = viewport,\n elementContext = popper,\n altBoundary = false,\n padding = 0,\n } = options;\n\n const paddingObject = mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n\n const altContext = elementContext === popper ? reference : popper;\n\n const popperRect = state.rects.popper;\n const element = state.elements[altBoundary ? altContext : elementContext];\n\n const clippingClientRect = getClippingRect(\n isElement(element)\n ? element\n : element.contextElement || getDocumentElement(state.elements.popper),\n boundary,\n rootBoundary\n );\n\n const referenceClientRect = getBoundingClientRect(state.elements.reference);\n\n const popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement,\n });\n\n const popperClientRect = rectToClientRect({\n ...popperRect,\n ...popperOffsets,\n });\n\n const elementClientRect =\n elementContext === popper ? popperClientRect : referenceClientRect;\n\n // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n const overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom:\n elementClientRect.bottom -\n clippingClientRect.bottom +\n paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right:\n elementClientRect.right - clippingClientRect.right + paddingObject.right,\n };\n\n const offsetData = state.modifiersData.offset;\n\n // Offsets can be applied only to the popper element\n if (elementContext === popper && offsetData) {\n const offset = offsetData[placement];\n\n Object.keys(overflowOffsets).forEach((key) => {\n const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n const axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n","// @flow\nimport type { SideObject } from '../types';\n\nexport default function getFreshSideObject(): SideObject {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n };\n}\n","// @flow\n\nexport default function expandToHashMap<\n T: number | string | boolean,\n K: string\n>(value: T, keys: Array<K>): { [key: string]: T } {\n return keys.reduce((hashMap, key) => {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n","// @flow\nimport getBasePlacement from './getBasePlacement';\nimport getVariation from './getVariation';\nimport getMainAxisFromPlacement from './getMainAxisFromPlacement';\nimport type {\n Rect,\n PositioningStrategy,\n Offsets,\n ClientRectObject,\n} from '../types';\nimport { top, right, bottom, left, start, end, type Placement } from '../enums';\n\nexport default function computeOffsets({\n reference,\n element,\n placement,\n}: {\n reference: Rect | ClientRectObject,\n element: Rect | ClientRectObject,\n strategy: PositioningStrategy,\n placement?: Placement,\n}): Offsets {\n const basePlacement = placement ? getBasePlacement(placement) : null;\n const variation = placement ? getVariation(placement) : null;\n const commonX = reference.x + reference.width / 2 - element.width / 2;\n const commonY = reference.y + reference.height / 2 - element.height / 2;\n\n let offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height,\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height,\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY,\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY,\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y,\n };\n }\n\n const mainAxis = basePlacement\n ? getMainAxisFromPlacement(basePlacement)\n : null;\n\n if (mainAxis != null) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] =\n offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] =\n offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n\n return offsets;\n}\n","// @flow\nimport { type BasePlacement, type Placement, auto } from '../enums';\n\nexport default function getBasePlacement(\n placement: Placement | typeof auto\n): BasePlacement {\n return (placement.split('-')[0]: any);\n}\n","// @flow\nimport { type Variation, type Placement } from '../enums';\n\nexport default function getVariation(placement: Placement): ?Variation {\n return (placement.split('-')[1]: any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nexport default function getMainAxisFromPlacement(\n placement: Placement\n): 'x' | 'y' {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n"],"names":["getBoundingClientRect","element","includeScale","width","rect","scaleX","height","scaleY","top","right","bottom","left","x","y","getWindow","node","window","ownerDocument","getWindowScroll","scrollLeft","win","scrollTop","isElement","isHTMLElement","isShadowRoot","getNodeName","getDocumentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","documentElement","scroll","offsets","getLayoutRect","clientRect","Math","getParentNode","getScrollParent","listScrollParents","list","scrollParent","_element$ownerDocumen","isBody","target","updatedList","getTrueOffsetParent","getOffsetParent","a","isFirefox","navigator","getContainingBlock","currentNode","css","order","modifiers","modifier","visited","dep","depModifier","map","sort","Map","Set","result","debounce","fn","pending","Promise","resolve","undefined","rectToClientRect","getClientRectFromMixedType","clippingParent","viewport","html","visualViewport","winScroll","body","max","getClippingRect","boundary","rootBoundary","mainClippingParents","getClippingParents","clippingParents","clipperElement","rootNode","contains","next","accRect","min","clippingRect","areValidElements","args","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","DEFAULT_OPTIONS","reference","popper","options","effectCleanupFns","state","placement","orderedModifiers","modifiersData","elements","attributes","styles","isDestroyed","instance","setOptions","setOptionsAction","orderModifiers","acc","phase","mergeByName","merged","current","existing","data","key","m","name","cleanupFn","effect","noopFn","forceUpdate","index","update","destroy","cleanupModifierEffects","basePlacements","modifierPhases","strategy","createPopper","detectOverflow","altBoundary","padding","expandToHashMap","value","keys","hashMap","elementContext","computeOffsets","basePlacement","commonX","commonY","mainAxis","len","variation","start","end","popperRect","popperOffsets","popperClientRect","referenceClientRect","overflowOffsets","clippingClientRect","elementClientRect","paddingObject","offsetData","offset","multiply","axis"],"mappings":"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"} | ||
| {"version":3,"file":"popper-base.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getNodeName.js","../../src/dom-utils/getDocumentElement.js","../../src/dom-utils/getWindowScrollBarX.js","../../src/dom-utils/getComputedStyle.js","../../src/dom-utils/isScrollParent.js","../../src/dom-utils/getCompositeRect.js","../../src/dom-utils/getNodeScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/getOffsetParent.js","../../src/dom-utils/isTableElement.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/enums.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/createPopper.js","../../src/utils/mergeByName.js","../../src/utils/math.js","../../src/utils/detectOverflow.js","../../src/utils/getFreshSideObject.js","../../src/utils/expandToHashMap.js","../../src/utils/computeOffsets.js","../../src/utils/getBasePlacement.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js"],"sourcesContent":["// @flow\nimport type { Window } from '../types';\ndeclare function getWindow(node: Node | Window): Window;\n\nexport default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n","// @flow\nimport getWindow from './getWindow';\n\ndeclare function isElement(node: mixed): boolean %checks(node instanceof\n Element);\nfunction isElement(node) {\n const OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\ndeclare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement);\nfunction isHTMLElement(node) {\n const OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\ndeclare function isShadowRoot(node: mixed): boolean %checks(node instanceof\n ShadowRoot);\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };\n","// @flow\nimport type { ClientRectObject, VirtualElement } from '../types';\nimport { isHTMLElement } from './instanceOf';\nimport { round } from '../utils/math';\n\nexport default function getBoundingClientRect(\n element: Element | VirtualElement,\n includeScale: boolean = false\n): ClientRectObject {\n const rect = element.getBoundingClientRect();\n let scaleX = 1;\n let scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n const offsetHeight = element.offsetHeight;\n const offsetWidth = element.offsetWidth;\n\n // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n if (offsetWidth > 0) {\n scaleX = round(rect.width) / offsetWidth || 1;\n }\n if (offsetHeight > 0) {\n scaleY = round(rect.height) / offsetHeight || 1;\n }\n }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY,\n };\n}\n","// @flow\nimport getWindow from './getWindow';\nimport type { Window } from '../types';\n\nexport default function getWindowScroll(node: Node | Window) {\n const win = getWindow(node);\n const scrollLeft = win.pageXOffset;\n const scrollTop = win.pageYOffset;\n\n return {\n scrollLeft,\n scrollTop,\n };\n}\n","// @flow\nimport type { Window } from '../types';\n\nexport default function getNodeName(element: ?Node | Window): ?string {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n","// @flow\nimport { isElement } from './instanceOf';\nimport type { Window } from '../types';\n\nexport default function getDocumentElement(\n element: Element | Window\n): HTMLElement {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return (\n (isElement(element)\n ? element.ownerDocument\n : // $FlowFixMe[prop-missing]\n element.document) || window.document\n ).documentElement;\n}\n","// @flow\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScroll from './getWindowScroll';\n\nexport default function getWindowScrollBarX(element: Element): number {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return (\n getBoundingClientRect(getDocumentElement(element)).left +\n getWindowScroll(element).scrollLeft\n );\n}\n","// @flow\nimport getWindow from './getWindow';\n\nexport default function getComputedStyle(\n element: Element\n): CSSStyleDeclaration {\n return getWindow(element).getComputedStyle(element);\n}\n","// @flow\nimport getComputedStyle from './getComputedStyle';\n\nexport default function isScrollParent(element: HTMLElement): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n","// @flow\nimport type { Rect, VirtualElement, Window } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getNodeScroll from './getNodeScroll';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getDocumentElement from './getDocumentElement';\nimport isScrollParent from './isScrollParent';\nimport { round } from '../utils/math';\n\nfunction isElementScaled(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const scaleX = round(rect.width) / element.offsetWidth || 1;\n const scaleY = round(rect.height) / element.offsetHeight || 1;\n\n return scaleX !== 1 || scaleY !== 1;\n}\n\n// Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\nexport default function getCompositeRect(\n elementOrVirtualElement: Element | VirtualElement,\n offsetParent: Element | Window,\n isFixed: boolean = false\n): Rect {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const offsetParentIsScaled =\n isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(\n elementOrVirtualElement,\n offsetParentIsScaled\n );\n\n let scroll = { scrollLeft: 0, scrollTop: 0 };\n let offsets = { x: 0, y: 0 };\n\n if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {\n if (\n getNodeName(offsetParent) !== 'body' ||\n // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)\n ) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height,\n };\n}\n","// @flow\nimport getWindowScroll from './getWindowScroll';\nimport getWindow from './getWindow';\nimport { isHTMLElement } from './instanceOf';\nimport getHTMLElementScroll from './getHTMLElementScroll';\nimport type { Window } from '../types';\n\nexport default function getNodeScroll(node: Node | Window) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n","// @flow\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\nexport default function getLayoutRect(element: HTMLElement): Rect {\n const clientRect = getBoundingClientRect(element);\n\n // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width,\n height,\n };\n}\n","// @flow\nimport getNodeName from './getNodeName';\nimport getDocumentElement from './getDocumentElement';\nimport { isShadowRoot } from './instanceOf';\n\nexport default function getParentNode(element: Node | ShadowRoot): Node {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (\n // this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}\n","// @flow\nimport getParentNode from './getParentNode';\nimport isScrollParent from './isScrollParent';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\n\nexport default function getScrollParent(node: Node): HTMLElement {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n","// @flow\nimport getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getWindow from './getWindow';\nimport type { Window, VisualViewport } from '../types';\nimport isScrollParent from './isScrollParent';\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\nexport default function listScrollParents(\n element: Node,\n list: Array<Element | Window> = []\n): Array<Element | Window | VisualViewport> {\n const scrollParent = getScrollParent(element);\n const isBody = scrollParent === element.ownerDocument?.body;\n const win = getWindow(scrollParent);\n const target = isBody\n ? [win].concat(\n win.visualViewport || [],\n isScrollParent(scrollParent) ? scrollParent : []\n )\n : scrollParent;\n const updatedList = list.concat(target);\n\n return isBody\n ? updatedList\n : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement } from './instanceOf';\nimport isTableElement from './isTableElement';\nimport getParentNode from './getParentNode';\n\nfunction getTrueOffsetParent(element: Element): ?Element {\n if (\n !isHTMLElement(element) ||\n // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed'\n ) {\n return null;\n }\n\n return element.offsetParent;\n}\n\n// `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\nfunction getContainingBlock(element: Element) {\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n const isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n const elementCss = getComputedStyle(element);\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n let currentNode = getParentNode(element);\n\n while (\n isHTMLElement(currentNode) &&\n ['html', 'body'].indexOf(getNodeName(currentNode)) < 0\n ) {\n const css = getComputedStyle(currentNode);\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n if (\n css.transform !== 'none' ||\n css.perspective !== 'none' ||\n css.contain === 'paint' ||\n ['transform', 'perspective'].indexOf(css.willChange) !== -1 ||\n (isFirefox && css.willChange === 'filter') ||\n (isFirefox && css.filter && css.filter !== 'none')\n ) {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nexport default function getOffsetParent(element: Element) {\n const window = getWindow(element);\n\n let offsetParent = getTrueOffsetParent(element);\n\n while (\n offsetParent &&\n isTableElement(offsetParent) &&\n getComputedStyle(offsetParent).position === 'static'\n ) {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (\n offsetParent &&\n (getNodeName(offsetParent) === 'html' ||\n (getNodeName(offsetParent) === 'body' &&\n getComputedStyle(offsetParent).position === 'static'))\n ) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n","// @flow\nimport getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport type { Modifier } from '../types';\nimport { modifierPhases } from '../enums';\n\n// source: https://stackoverflow.com/questions/49875255\nfunction order(modifiers) {\n const map = new Map();\n const visited = new Set();\n const result = [];\n\n modifiers.forEach(modifier => {\n map.set(modifier.name, modifier);\n });\n\n // On visiting object, check for its dependencies and visit them recursively\n function sort(modifier: Modifier<any, any>) {\n visited.add(modifier.name);\n\n const requires = [\n ...(modifier.requires || []),\n ...(modifier.requiresIfExists || []),\n ];\n\n requires.forEach(dep => {\n if (!visited.has(dep)) {\n const depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n\n result.push(modifier);\n }\n\n modifiers.forEach(modifier => {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n\n return result;\n}\n\nexport default function orderModifiers(\n modifiers: Array<Modifier<any, any>>\n): Array<Modifier<any, any>> {\n // order based on dependencies\n const orderedModifiers = order(modifiers);\n\n // order based on phase\n return modifierPhases.reduce((acc, phase) => {\n return acc.concat(\n orderedModifiers.filter(modifier => modifier.phase === phase)\n );\n }, []);\n}\n","// @flow\n\nexport default function debounce<T>(fn: Function): () => Promise<T> {\n let pending;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n","// @flow\nimport type { Rect, ClientRectObject } from '../types';\n\nexport default function rectToClientRect(rect: Rect): ClientRectObject {\n return {\n ...rect,\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height,\n };\n}\n","// @flow\nimport type { ClientRectObject } from '../types';\nimport type { Boundary, RootBoundary } from '../enums';\nimport { viewport } from '../enums';\nimport getViewportRect from './getViewportRect';\nimport getDocumentRect from './getDocumentRect';\nimport listScrollParents from './listScrollParents';\nimport getOffsetParent from './getOffsetParent';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getParentNode from './getParentNode';\nimport contains from './contains';\nimport getNodeName from './getNodeName';\nimport rectToClientRect from '../utils/rectToClientRect';\nimport { max, min } from '../utils/math';\n\nfunction getInnerBoundingClientRect(element: Element) {\n const rect = getBoundingClientRect(element);\n\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n\n return rect;\n}\n\nfunction getClientRectFromMixedType(\n element: Element,\n clippingParent: Element | RootBoundary\n): ClientRectObject {\n return clippingParent === viewport\n ? rectToClientRect(getViewportRect(element))\n : isElement(clippingParent)\n ? getInnerBoundingClientRect(clippingParent)\n : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\nfunction getClippingParents(element: Element): Array<Element> {\n const clippingParents = listScrollParents(getParentNode(element));\n const canEscapeClipping =\n ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n const clipperElement =\n canEscapeClipping && isHTMLElement(element)\n ? getOffsetParent(element)\n : element;\n\n if (!isElement(clipperElement)) {\n return [];\n }\n\n // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n return clippingParents.filter(\n (clippingParent) =>\n isElement(clippingParent) &&\n contains(clippingParent, clipperElement) &&\n getNodeName(clippingParent) !== 'body' &&\n (canEscapeClipping\n ? getComputedStyle(clippingParent).position !== 'static'\n : true)\n );\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping parents\nexport default function getClippingRect(\n element: Element,\n boundary: Boundary,\n rootBoundary: RootBoundary\n): ClientRectObject {\n const mainClippingParents =\n boundary === 'clippingParents'\n ? getClippingParents(element)\n : [].concat(boundary);\n const clippingParents = [...mainClippingParents, rootBoundary];\n const firstClippingParent = clippingParents[0];\n\n const clippingRect = clippingParents.reduce((accRect, clippingParent) => {\n const rect = getClientRectFromMixedType(element, clippingParent);\n\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n\n return clippingRect;\n}\n","// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n","// @flow\nimport getWindow from './getWindow';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScrollBarX from './getWindowScrollBarX';\n\nexport default function getViewportRect(element: Element) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n\n // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n\n // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width,\n height,\n x: x + getWindowScrollBarX(element),\n y,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getWindowScroll from './getWindowScroll';\nimport { max } from '../utils/math';\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\nexport default function getDocumentRect(element: HTMLElement): Rect {\n const html = getDocumentElement(element);\n const winScroll = getWindowScroll(element);\n const body = element.ownerDocument?.body;\n\n const width = max(\n html.scrollWidth,\n html.clientWidth,\n body ? body.scrollWidth : 0,\n body ? body.clientWidth : 0\n );\n const height = max(\n html.scrollHeight,\n html.clientHeight,\n body ? body.scrollHeight : 0,\n body ? body.clientHeight : 0\n );\n\n let x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n const y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return { width, height, x, y };\n}\n","// @flow\nimport { isShadowRoot } from './instanceOf';\n\nexport default function contains(parent: Element, child: Element) {\n const rootNode = child.getRootNode && child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n }\n // $FlowFixMe[prop-missing]: need a better way to handle this...\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n","// @flow\nimport type {\n State,\n OptionsGeneric,\n Modifier,\n Instance,\n VirtualElement,\n} from './types';\nimport getCompositeRect from './dom-utils/getCompositeRect';\nimport getLayoutRect from './dom-utils/getLayoutRect';\nimport listScrollParents from './dom-utils/listScrollParents';\nimport getOffsetParent from './dom-utils/getOffsetParent';\nimport getComputedStyle from './dom-utils/getComputedStyle';\nimport orderModifiers from './utils/orderModifiers';\nimport debounce from './utils/debounce';\nimport validateModifiers from './utils/validateModifiers';\nimport uniqueBy from './utils/uniqueBy';\nimport getBasePlacement from './utils/getBasePlacement';\nimport mergeByName from './utils/mergeByName';\nimport detectOverflow from './utils/detectOverflow';\nimport { isElement } from './dom-utils/instanceOf';\nimport { auto } from './enums';\n\nconst INVALID_ELEMENT_ERROR =\n 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nconst INFINITE_LOOP_ERROR =\n 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\n\nconst DEFAULT_OPTIONS: OptionsGeneric<any> = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute',\n};\n\ntype PopperGeneratorArgs = {\n defaultModifiers?: Array<Modifier<any, any>>,\n defaultOptions?: $Shape<OptionsGeneric<any>>,\n};\n\nfunction areValidElements(...args: Array<any>): boolean {\n return !args.some(\n (element) =>\n !(element && typeof element.getBoundingClientRect === 'function')\n );\n}\n\nexport function popperGenerator(generatorOptions: PopperGeneratorArgs = {}) {\n const {\n defaultModifiers = [],\n defaultOptions = DEFAULT_OPTIONS,\n } = generatorOptions;\n\n return function createPopper<TModifier: $Shape<Modifier<any, any>>>(\n reference: Element | VirtualElement,\n popper: HTMLElement,\n options: $Shape<OptionsGeneric<TModifier>> = defaultOptions\n ): Instance {\n let state: $Shape<State> = {\n placement: 'bottom',\n orderedModifiers: [],\n options: { ...DEFAULT_OPTIONS, ...defaultOptions },\n modifiersData: {},\n elements: {\n reference,\n popper,\n },\n attributes: {},\n styles: {},\n };\n\n let effectCleanupFns: Array<() => void> = [];\n let isDestroyed = false;\n\n const instance = {\n state,\n setOptions(setOptionsAction) {\n const options =\n typeof setOptionsAction === 'function'\n ? setOptionsAction(state.options)\n : setOptionsAction;\n\n cleanupModifierEffects();\n\n state.options = {\n // $FlowFixMe[exponential-spread]\n ...defaultOptions,\n ...state.options,\n ...options,\n };\n\n state.scrollParents = {\n reference: isElement(reference)\n ? listScrollParents(reference)\n : reference.contextElement\n ? listScrollParents(reference.contextElement)\n : [],\n popper: listScrollParents(popper),\n };\n\n // Orders the modifiers based on their dependencies and `phase`\n // properties\n const orderedModifiers = orderModifiers(\n mergeByName([...defaultModifiers, ...state.options.modifiers])\n );\n\n // Strip out disabled modifiers\n state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);\n\n // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n if (__DEV__) {\n const modifiers = uniqueBy(\n [...orderedModifiers, ...state.options.modifiers],\n ({ name }) => name\n );\n\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n const flipModifier = state.orderedModifiers.find(\n ({ name }) => name === 'flip'\n );\n\n if (!flipModifier) {\n console.error(\n [\n 'Popper: \"auto\" placements require the \"flip\" modifier be',\n 'present and enabled to work.',\n ].join(' ')\n );\n }\n }\n\n const {\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n } = getComputedStyle(popper);\n\n // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n if (\n [marginTop, marginRight, marginBottom, marginLeft].some((margin) =>\n parseFloat(margin)\n )\n ) {\n console.warn(\n [\n 'Popper: CSS \"margin\" styles cannot be used to apply padding',\n 'between the popper and its reference element or boundary.',\n 'To replicate margin, use the `offset` modifier, as well as',\n 'the `padding` option in the `preventOverflow` and `flip`',\n 'modifiers.',\n ].join(' ')\n );\n }\n }\n\n runModifierEffects();\n\n return instance.update();\n },\n\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n const { reference, popper } = state.elements;\n\n // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n }\n\n // Store the reference and popper rects to be read by modifiers\n state.rects = {\n reference: getCompositeRect(\n reference,\n getOffsetParent(popper),\n state.options.strategy === 'fixed'\n ),\n popper: getLayoutRect(popper),\n };\n\n // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n state.reset = false;\n\n state.placement = state.options.placement;\n\n // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n state.orderedModifiers.forEach(\n (modifier) =>\n (state.modifiersData[modifier.name] = {\n ...modifier.data,\n })\n );\n\n let __debug_loops__ = 0;\n for (let index = 0; index < state.orderedModifiers.length; index++) {\n if (__DEV__) {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n const { fn, options = {}, name } = state.orderedModifiers[index];\n\n if (typeof fn === 'function') {\n state = fn({ state, options, name, instance }) || state;\n }\n }\n },\n\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce<$Shape<State>>(\n () =>\n new Promise<$Shape<State>>((resolve) => {\n instance.forceUpdate();\n resolve(state);\n })\n ),\n\n destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n },\n };\n\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n\n instance.setOptions(options).then((state) => {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n });\n\n // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n function runModifierEffects() {\n state.orderedModifiers.forEach(({ name, options = {}, effect }) => {\n if (typeof effect === 'function') {\n const cleanupFn = effect({ state, name, instance, options });\n const noopFn = () => {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach((fn) => fn());\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nexport const createPopper = popperGenerator();\n\n// eslint-disable-next-line import/no-unused-modules\nexport { detectOverflow };\n","// @flow\nimport type { Modifier } from '../types';\n\nexport default function mergeByName(\n modifiers: Array<$Shape<Modifier<any, any>>>\n): Array<$Shape<Modifier<any, any>>> {\n const merged = modifiers.reduce((merged, current) => {\n const existing = merged[current.name];\n merged[current.name] = existing\n ? {\n ...existing,\n ...current,\n options: { ...existing.options, ...current.options },\n data: { ...existing.data, ...current.data },\n }\n : current;\n return merged;\n }, {});\n\n // IE11 does not support Object.values\n return Object.keys(merged).map(key => merged[key]);\n}\n","// @flow\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\n","// @flow\nimport type { State, SideObject, Padding } from '../types';\nimport type { Placement, Boundary, RootBoundary, Context } from '../enums';\nimport getClippingRect from '../dom-utils/getClippingRect';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getBoundingClientRect from '../dom-utils/getBoundingClientRect';\nimport computeOffsets from './computeOffsets';\nimport rectToClientRect from './rectToClientRect';\nimport {\n clippingParents,\n reference,\n popper,\n bottom,\n top,\n right,\n basePlacements,\n viewport,\n} from '../enums';\nimport { isElement } from '../dom-utils/instanceOf';\nimport mergePaddingObject from './mergePaddingObject';\nimport expandToHashMap from './expandToHashMap';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n placement: Placement,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n elementContext: Context,\n altBoundary: boolean,\n padding: Padding,\n};\n\nexport default function detectOverflow(\n state: State,\n options: $Shape<Options> = {}\n): SideObject {\n const {\n placement = state.placement,\n boundary = clippingParents,\n rootBoundary = viewport,\n elementContext = popper,\n altBoundary = false,\n padding = 0,\n } = options;\n\n const paddingObject = mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n\n const altContext = elementContext === popper ? reference : popper;\n\n const popperRect = state.rects.popper;\n const element = state.elements[altBoundary ? altContext : elementContext];\n\n const clippingClientRect = getClippingRect(\n isElement(element)\n ? element\n : element.contextElement || getDocumentElement(state.elements.popper),\n boundary,\n rootBoundary\n );\n\n const referenceClientRect = getBoundingClientRect(state.elements.reference);\n\n const popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement,\n });\n\n const popperClientRect = rectToClientRect({\n ...popperRect,\n ...popperOffsets,\n });\n\n const elementClientRect =\n elementContext === popper ? popperClientRect : referenceClientRect;\n\n // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n const overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom:\n elementClientRect.bottom -\n clippingClientRect.bottom +\n paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right:\n elementClientRect.right - clippingClientRect.right + paddingObject.right,\n };\n\n const offsetData = state.modifiersData.offset;\n\n // Offsets can be applied only to the popper element\n if (elementContext === popper && offsetData) {\n const offset = offsetData[placement];\n\n Object.keys(overflowOffsets).forEach((key) => {\n const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n const axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n","// @flow\nimport type { SideObject } from '../types';\n\nexport default function getFreshSideObject(): SideObject {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n };\n}\n","// @flow\n\nexport default function expandToHashMap<\n T: number | string | boolean,\n K: string\n>(value: T, keys: Array<K>): { [key: string]: T } {\n return keys.reduce((hashMap, key) => {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n","// @flow\nimport getBasePlacement from './getBasePlacement';\nimport getVariation from './getVariation';\nimport getMainAxisFromPlacement from './getMainAxisFromPlacement';\nimport type {\n Rect,\n PositioningStrategy,\n Offsets,\n ClientRectObject,\n} from '../types';\nimport { top, right, bottom, left, start, end, type Placement } from '../enums';\n\nexport default function computeOffsets({\n reference,\n element,\n placement,\n}: {\n reference: Rect | ClientRectObject,\n element: Rect | ClientRectObject,\n strategy: PositioningStrategy,\n placement?: Placement,\n}): Offsets {\n const basePlacement = placement ? getBasePlacement(placement) : null;\n const variation = placement ? getVariation(placement) : null;\n const commonX = reference.x + reference.width / 2 - element.width / 2;\n const commonY = reference.y + reference.height / 2 - element.height / 2;\n\n let offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height,\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height,\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY,\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY,\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y,\n };\n }\n\n const mainAxis = basePlacement\n ? getMainAxisFromPlacement(basePlacement)\n : null;\n\n if (mainAxis != null) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] =\n offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] =\n offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n\n return offsets;\n}\n","// @flow\nimport { type BasePlacement, type Placement, auto } from '../enums';\n\nexport default function getBasePlacement(\n placement: Placement | typeof auto\n): BasePlacement {\n return (placement.split('-')[0]: any);\n}\n","// @flow\nimport { type Variation, type Placement } from '../enums';\n\nexport default function getVariation(placement: Placement): ?Variation {\n return (placement.split('-')[1]: any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nexport default function getMainAxisFromPlacement(\n placement: Placement\n): 'x' | 'y' {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n"],"names":["getWindow","node","window","ownerDocument","isElement","isHTMLElement","isShadowRoot","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","round","width","height","top","right","bottom","left","x","y","getWindowScroll","scrollLeft","win","scrollTop","getNodeName","getDocumentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","isElementScaled","offsetParentIsScaled","offsets","documentElement","scroll","getLayoutRect","clientRect","Math","getParentNode","getScrollParent","listScrollParents","list","scrollParent","_element$ownerDocumen","isBody","target","updatedList","getTrueOffsetParent","getOffsetParent","a","isFirefox","navigator","getContainingBlock","currentNode","css","order","modifiers","modifier","visited","dep","depModifier","map","sort","Map","Set","result","debounce","fn","pending","Promise","resolve","undefined","rectToClientRect","getClientRectFromMixedType","clippingParent","viewport","html","visualViewport","winScroll","body","max","getClippingRect","boundary","rootBoundary","mainClippingParents","getClippingParents","clippingParents","canEscapeClipping","clipperElement","rootNode","contains","next","accRect","min","clippingRect","areValidElements","args","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","DEFAULT_OPTIONS","reference","popper","options","effectCleanupFns","state","placement","orderedModifiers","modifiersData","elements","attributes","styles","isDestroyed","instance","setOptions","setOptionsAction","orderModifiers","acc","phase","mergeByName","merged","current","existing","data","key","m","name","cleanupFn","effect","noopFn","forceUpdate","index","update","destroy","cleanupModifierEffects","basePlacements","modifierPhases","strategy","createPopper","detectOverflow","altBoundary","padding","expandToHashMap","value","keys","hashMap","elementContext","computeOffsets","basePlacement","commonX","commonY","mainAxis","len","variation","start","end","popperRect","popperOffsets","popperClientRect","referenceClientRect","overflowOffsets","clippingClientRect","elementClientRect","paddingObject","offsetData","offset","multiply","axis"],"mappings":"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"} |
+71
-68
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
@@ -11,38 +11,2 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindow(node) { | ||
@@ -61,12 +25,2 @@ if (node == null) { | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function isElement(node) { | ||
@@ -92,2 +46,51 @@ var OwnElement = getWindow(node).Element; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
| includeScale = false; | ||
| } | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = 1; | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
| width: rect.width / scaleX, | ||
| height: rect.height / scaleY, | ||
| top: rect.top / scaleY, | ||
| right: rect.right / scaleX, | ||
| bottom: rect.bottom / scaleY, | ||
| left: rect.left / scaleX, | ||
| x: rect.left / scaleX, | ||
| y: rect.top / scaleY | ||
| }; | ||
| } | ||
| function getWindowScroll(node) { | ||
| var win = getWindow(node); | ||
| var scrollLeft = win.pageXOffset; | ||
| var scrollTop = win.pageYOffset; | ||
| return { | ||
| scrollLeft: scrollLeft, | ||
| scrollTop: scrollTop | ||
| }; | ||
| } | ||
| function getHTMLElementScroll(element) { | ||
@@ -145,4 +148,4 @@ return { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -159,5 +162,5 @@ } // Returns the composite rect of an element relative to its offsetParent. | ||
| var isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); | ||
| var documentElement = getDocumentElement(offsetParent); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement); | ||
| var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); | ||
| var scroll = { | ||
@@ -179,3 +182,3 @@ scrollLeft: 0, | ||
| if (isHTMLElement(offsetParent)) { | ||
| offsets = getBoundingClientRect(offsetParent); | ||
| offsets = getBoundingClientRect(offsetParent, true); | ||
| offsets.x += offsetParent.clientLeft; | ||
@@ -580,6 +583,2 @@ offsets.y += offsetParent.clientTop; | ||
| var max = Math.max; | ||
| var min = Math.min; | ||
| var round = Math.round; | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable | ||
@@ -656,3 +655,3 @@ | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -674,3 +673,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -1177,4 +1176,4 @@ } // Gets the maximum area that the element is visible in due to any number of | ||
| return { | ||
| x: round(round(x * dpr) / dpr) || 0, | ||
| y: round(round(y * dpr) / dpr) || 0 | ||
| x: round(x * dpr) / dpr || 0, | ||
| y: round(y * dpr) / dpr || 0 | ||
| }; | ||
@@ -1194,3 +1193,4 @@ } | ||
| adaptive = _ref2.adaptive, | ||
| roundOffsets = _ref2.roundOffsets; | ||
| roundOffsets = _ref2.roundOffsets, | ||
| isFixed = _ref2.isFixed; | ||
@@ -1227,5 +1227,6 @@ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, | ||
| if (placement === top || (placement === left || placement === right) && variation === end) { | ||
| sideY = bottom; // $FlowFixMe[prop-missing] | ||
| y -= offsetParent[heightProp] - popperRect.height; | ||
| sideY = bottom; | ||
| var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] | ||
| offsetParent[heightProp]; | ||
| y -= offsetY - popperRect.height; | ||
| y *= gpuAcceleration ? 1 : -1; | ||
@@ -1235,5 +1236,6 @@ } | ||
| if (placement === left || (placement === top || placement === bottom) && variation === end) { | ||
| sideX = right; // $FlowFixMe[prop-missing] | ||
| x -= offsetParent[widthProp] - popperRect.width; | ||
| sideX = right; | ||
| var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] | ||
| offsetParent[widthProp]; | ||
| x -= offsetX - popperRect.width; | ||
| x *= gpuAcceleration ? 1 : -1; | ||
@@ -1281,3 +1283,4 @@ } | ||
| popperRect: state.rects.popper, | ||
| gpuAcceleration: gpuAcceleration | ||
| gpuAcceleration: gpuAcceleration, | ||
| isFixed: state.options.strategy === 'fixed' | ||
| }; | ||
@@ -1284,0 +1287,0 @@ |
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
| "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e,t){return{width:(e=e.getBoundingClientRect()).width/1,height:e.height/1,top:e.top/1,right:e.right/1,bottom:e.bottom/1,left:e.left/1,x:e.left/1,y:e.top/1}}function o(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function n(e){return{scrollLeft:(e=o(e)).pageXOffset,scrollTop:e.pageYOffset}}function r(e){return e instanceof o(e).Element||e instanceof Element}function i(e){return e instanceof o(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof o(e).ShadowRoot||e instanceof ShadowRoot)}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function c(e){return t(f(e)).left+n(e).scrollLeft}function p(e){return o(e).getComputedStyle(e)}function l(e){return e=p(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,r,a){void 0===a&&(a=!1);var p=i(r);i(r)&&r.getBoundingClientRect();var u=f(r);e=t(e);var d={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(p||!p&&!a)&&(("body"!==s(r)||l(u))&&(d=r!==o(r)&&i(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:n(r)),i(r)?((h=t(r)).x+=r.clientLeft,h.y+=r.clientTop):u&&(h.x=c(u))),{x:e.left+d.scrollLeft-h.x,y:e.top+d.scrollTop-h.y,width:e.width,height:e.height}}function d(e){var o=t(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(o.width-n)&&(n=o.width),1>=Math.abs(o.height-r)&&(r=o.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function h(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||f(e)}function m(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:i(e)&&l(e)?e:m(h(e))}function g(e,t){var n;void 0===t&&(t=[]);var r=m(e);return e=r===(null==(n=e.ownerDocument)?void 0:n.body),n=o(r),r=e?[n].concat(n.visualViewport||[],l(r)?r:[]):r,t=t.concat(r),e?t:t.concat(g(h(r)))}function v(e){return i(e)&&"fixed"!==p(e).position?e.offsetParent:null}function b(e){for(var t=o(e),n=v(e);n&&0<=["table","td","th"].indexOf(s(n))&&"static"===p(n).position;)n=v(n);if(n&&("html"===s(n)||"body"===s(n)&&"static"===p(n).position))return t;if(!n)e:{if(n=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!i(e)||"fixed"!==p(e).position)for(e=h(e);i(e)&&0>["html","body"].indexOf(s(e));){var r=p(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||n&&"filter"===r.willChange||n&&r.filter&&"none"!==r.filter){n=e;break e}e=e.parentNode}n=null}return n||t}function y(e){function t(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){n.has(e)||(e=o.get(e))&&t(e)})),r.push(e)}var o=new Map,n=new Set,r=[];return e.forEach((function(e){o.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(o){Promise.resolve().then((function(){t=void 0,o(e())}))}))),t}}function x(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function O(e,r){if("viewport"===r){r=o(e);var a=f(e);r=r.visualViewport;var s=a.clientWidth;a=a.clientHeight;var l=0,u=0;r&&(s=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=r.offsetLeft,u=r.offsetTop)),e=x(e={width:s,height:a,x:l+c(e),y:u})}else i(r)?((e=t(r)).top+=r.clientTop,e.left+=r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=n(u),r=null==(a=u.ownerDocument)?void 0:a.body,a=k(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=k(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-s.scrollLeft+c(u),s=-s.scrollTop,"rtl"===p(r||e).direction&&(u+=k(e.clientWidth,r?r.clientWidth:0)-a),e=x({width:a,height:l,x:u,y:s}));return e}function j(e,t,o){return t="clippingParents"===t?function(e){var t=g(h(e)),o=0<=["absolute","fixed"].indexOf(p(e).position)&&i(e)?b(e):e;return r(o)?t.filter((function(e){var t;if(t=r(e))e:if(t=o.getRootNode&&o.getRootNode(),e.contains(o))t=!0;else{if(t&&a(t)){t=o;do{if(t&&e.isSameNode(t)){t=!0;break e}t=t.parentNode||t.host}while(t)}t=!1}return t&&"body"!==s(e)})):[]}(e):[].concat(t),(o=(o=[].concat(t,[o])).reduce((function(t,o){return o=O(e,o),t.top=k(o.top,t.top),t.right=R(o.right,t.right),t.bottom=R(o.bottom,t.bottom),t.left=k(o.left,t.left),t}),O(e,o[0]))).width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function E(e){var t=e.reference,o=e.element,n=(e=e.placement)?e.split("-")[0]:null;e=e?e.split("-")[1]:null;var r=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2;switch(n){case"top":r={x:r,y:t.y-o.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-o.width,y:i};break;default:r={x:t.x,y:t.y}}if(null!=(n=n?0<=["top","bottom"].indexOf(n)?"x":"y":null))switch(i="y"===n?"height":"width",e){case"start":r[n]-=t[i]/2-o[i]/2;break;case"end":r[n]+=t[i]/2-o[i]/2}return r}function L(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function M(e){void 0===e&&(e={});var t=e.defaultModifiers,o=void 0===t?[]:t,n=void 0===(e=e.defaultOptions)?H:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=n);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},H,n),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],c=!1,p={state:s,setOptions:function(i){return i="function"==typeof i?i(s.options):i,a(),s.options=Object.assign({},n,s.options,i),s.scrollParents={reference:r(e)?g(e):e.contextElement?g(e.contextElement):[],popper:g(t)},i=function(e){var t=y(e);return T.reduce((function(e,o){return e.concat(t.filter((function(e){return e.phase===o})))}),[])}(function(e){var t=e.reduce((function(e,t){var o=e[t.name];return e[t.name]=o?Object.assign({},o,t,{options:Object.assign({},o.options,t.options),data:Object.assign({},o.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,o=e.options;o=void 0===o?{}:o,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:p,options:o}),f.push(t||function(){}))})),p.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference;if(L(t,e=e.popper))for(s.rects={reference:u(t,b(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var o=s.orderedModifiers[t];e=o.fn;var n=o.options;n=void 0===n?{}:n,o=o.name,"function"==typeof e&&(s=e({state:s,options:n,name:o,instance:p})||s)}}},update:w((function(){return new Promise((function(e){p.forceUpdate(),e(s)}))})),destroy:function(){a(),c=!0}};return L(e,t)?(p.setOptions(i).then((function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)})),p):p}}function P(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,c=e.position,l=e.gpuAcceleration,u=e.adaptive;if(!0===(e=e.roundOffsets)){e=s.y;var d=window.devicePixelRatio||1;e={x:D(D(s.x*d)/d)||0,y:D(D(e*d)/d)||0}}else e="function"==typeof e?e(s):s;e=void 0===(e=(d=e).x)?0:e,d=void 0===(d=d.y)?0:d;var h=s.hasOwnProperty("x");s=s.hasOwnProperty("y");var m,g="left",v="top",y=window;if(u){var w=b(n),x="clientHeight",O="clientWidth";w===o(n)&&("static"!==p(w=f(n)).position&&"absolute"===c&&(x="scrollHeight",O="scrollWidth")),"top"!==i&&("left"!==i&&"right"!==i||"end"!==a)||(v="bottom",d-=w[x]-r.height,d*=l?1:-1),"left"!==i&&("top"!==i&&"bottom"!==i||"end"!==a)||(g="right",e-=w[O]-r.width,e*=l?1:-1)}return n=Object.assign({position:c},u&&A),l?Object.assign({},n,((m={})[v]=s?"0":"",m[g]=h?"0":"",m.transform=1>=(y.devicePixelRatio||1)?"translate("+e+"px, "+d+"px)":"translate3d("+e+"px, "+d+"px, 0)",m)):Object.assign({},n,((t={})[v]=s?d+"px":"",t[g]=h?e+"px":"",t.transform="",t))}var W=["top","bottom","right","left"],T="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),k=Math.max,R=Math.min,D=Math.round,H={placement:"bottom",modifiers:[],strategy:"absolute"},S={passive:!0},A={top:"auto",right:"auto",bottom:"auto",left:"auto"},C=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=o(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",n.update,S)})),a&&s.addEventListener("resize",n.update,S),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",n.update,S)})),a&&s.removeEventListener("resize",n.update,S)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,o=e.options;e=void 0===(e=o.gpuAcceleration)||e;var n=o.adaptive;n=void 0===n||n,o=void 0===(o=o.roundOffsets)||o,e={placement:t.placement.split("-")[0],variation:t.placement.split("-")[1],popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,P(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:o})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,P(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var o=t.styles[e]||{},n=t.attributes[e]||{},r=t.elements[e];i(r)&&s(r)&&(Object.assign(r.style,o),Object.keys(n).forEach((function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,o={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,o.popper),t.styles=o,t.elements.arrow&&Object.assign(t.elements.arrow.style,o.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],r=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:o[e]).reduce((function(e,t){return e[t]="",e}),{}),i(n)&&s(n)&&(Object.assign(n.style,e),Object.keys(r).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]}],N=M({defaultModifiers:C});e.createPopper=N,e.defaultModifiers=C,e.detectOverflow=function(e,o){void 0===o&&(o={});var n=o;o=void 0===(o=n.placement)?e.placement:o;var i=n.boundary,a=void 0===i?"clippingParents":i,s=void 0===(i=n.rootBoundary)?"viewport":i;i=void 0===(i=n.elementContext)?"popper":i;var c=n.altBoundary,p=void 0!==c&&c;n=void 0===(n=n.padding)?0:n,n=Object.assign({},{top:0,right:0,bottom:0,left:0},"number"!=typeof n?n:function(e,t){return t.reduce((function(t,o){return t[o]=e,t}),{})}(n,W)),c=e.rects.popper,a=j(r(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||f(e.elements.popper),a,s),p=E({reference:s=t(e.elements.reference),element:c,strategy:"absolute",placement:o}),c=x(Object.assign({},c,p)),s="popper"===i?c:s;var l={top:a.top-s.top+n.top,bottom:s.bottom-a.bottom+n.bottom,left:a.left-s.left+n.left,right:s.right-a.right+n.right};if(e=e.modifiersData.offset,"popper"===i&&e){var u=e[o];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,o=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[o]*t}))}return l},e.popperGenerator=M,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
| "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function o(e){return e instanceof t(e).Element||e instanceof Element}function n(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function i(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}function r(e,t){void 0===t&&(t=!1);var o=e.getBoundingClientRect(),i=1,r=1;return n(e)&&t&&(t=e.offsetHeight,0<(e=e.offsetWidth)&&(i=k(o.width)/e||1),0<t&&(r=k(o.height)/t||1)),{width:o.width/i,height:o.height/r,top:o.top/r,right:o.right/i,bottom:o.bottom/r,left:o.left/i,x:o.left/i,y:o.top/r}}function a(e){return{scrollLeft:(e=t(e)).pageXOffset,scrollTop:e.pageYOffset}}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((o(e)?e.ownerDocument:e.document)||window.document).documentElement}function c(e){return r(f(e)).left+a(e).scrollLeft}function p(e){return t(e).getComputedStyle(e)}function l(e){return e=p(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,o,i){void 0===i&&(i=!1);var p,u=n(o);if(p=n(o)){var d=o.getBoundingClientRect();p=k(d.width)/o.offsetWidth||1,d=k(d.height)/o.offsetHeight||1,p=1!==p||1!==d}d=p,p=f(o),e=r(e,d),d={scrollLeft:0,scrollTop:0};var h={x:0,y:0};return(u||!u&&!i)&&(("body"!==s(o)||l(p))&&(d=o!==t(o)&&n(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:a(o)),n(o)?((h=r(o,!0)).x+=o.clientLeft,h.y+=o.clientTop):p&&(h.x=c(p))),{x:e.left+d.scrollLeft-h.x,y:e.top+d.scrollTop-h.y,width:e.width,height:e.height}}function d(e){var t=r(e),o=e.offsetWidth,n=e.offsetHeight;return 1>=Math.abs(t.width-o)&&(o=t.width),1>=Math.abs(t.height-n)&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:o,height:n}}function h(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(i(e)?e.host:null)||f(e)}function m(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:n(e)&&l(e)?e:m(h(e))}function g(e,o){var n;void 0===o&&(o=[]);var i=m(e);return e=i===(null==(n=e.ownerDocument)?void 0:n.body),n=t(i),i=e?[n].concat(n.visualViewport||[],l(i)?i:[]):i,o=o.concat(i),e?o:o.concat(g(h(i)))}function v(e){return n(e)&&"fixed"!==p(e).position?e.offsetParent:null}function b(e){for(var o=t(e),i=v(e);i&&0<=["table","td","th"].indexOf(s(i))&&"static"===p(i).position;)i=v(i);if(i&&("html"===s(i)||"body"===s(i)&&"static"===p(i).position))return o;if(!i)e:{if(i=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!n(e)||"fixed"!==p(e).position)for(e=h(e);n(e)&&0>["html","body"].indexOf(s(e));){var r=p(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||i&&"filter"===r.willChange||i&&r.filter&&"none"!==r.filter){i=e;break e}e=e.parentNode}i=null}return i||o}function y(e){function t(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){n.has(e)||(e=o.get(e))&&t(e)})),i.push(e)}var o=new Map,n=new Set,i=[];return e.forEach((function(e){o.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||t(e)})),i}function w(e){var t;return function(){return t||(t=new Promise((function(o){Promise.resolve().then((function(){t=void 0,o(e())}))}))),t}}function x(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function O(e,n){if("viewport"===n){n=t(e);var i=f(e);n=n.visualViewport;var s=i.clientWidth;i=i.clientHeight;var l=0,u=0;n&&(s=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=n.offsetLeft,u=n.offsetTop)),e=x(e={width:s,height:i,x:l+c(e),y:u})}else o(n)?((e=r(n)).top+=n.clientTop,e.left+=n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=a(u),n=null==(i=u.ownerDocument)?void 0:i.body,i=P(e.scrollWidth,e.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=P(e.scrollHeight,e.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-s.scrollLeft+c(u),s=-s.scrollTop,"rtl"===p(n||e).direction&&(u+=P(e.clientWidth,n?n.clientWidth:0)-i),e=x({width:i,height:l,x:u,y:s}));return e}function j(e,t,r){return t="clippingParents"===t?function(e){var t=g(h(e)),r=0<=["absolute","fixed"].indexOf(p(e).position),a=r&&n(e)?b(e):e;return o(a)?t.filter((function(e){var t;if(t=o(e))e:if(t=a.getRootNode&&a.getRootNode(),e.contains(a))t=!0;else{if(t&&i(t)){t=a;do{if(t&&e.isSameNode(t)){t=!0;break e}t=t.parentNode||t.host}while(t)}t=!1}return t&&"body"!==s(e)&&(!r||"static"!==p(e).position)})):[]}(e):[].concat(t),(r=(r=[].concat(t,[r])).reduce((function(t,o){return o=O(e,o),t.top=P(o.top,t.top),t.right=T(o.right,t.right),t.bottom=T(o.bottom,t.bottom),t.left=P(o.left,t.left),t}),O(e,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function E(e){var t=e.reference,o=e.element,n=(e=e.placement)?e.split("-")[0]:null;e=e?e.split("-")[1]:null;var i=t.x+t.width/2-o.width/2,r=t.y+t.height/2-o.height/2;switch(n){case"top":i={x:i,y:t.y-o.height};break;case"bottom":i={x:i,y:t.y+t.height};break;case"right":i={x:t.x+t.width,y:r};break;case"left":i={x:t.x-o.width,y:r};break;default:i={x:t.x,y:t.y}}if(null!=(n=n?0<=["top","bottom"].indexOf(n)?"x":"y":null))switch(r="y"===n?"height":"width",e){case"start":i[n]-=t[r]/2-o[r]/2;break;case"end":i[n]+=t[r]/2-o[r]/2}return i}function L(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function M(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,i=void 0===(e=e.defaultOptions)?D:e;return function(e,t,r){function a(){f.forEach((function(e){return e()})),f=[]}void 0===r&&(r=i);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},D,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],c=!1,p={state:s,setOptions:function(r){return r="function"==typeof r?r(s.options):r,a(),s.options=Object.assign({},i,s.options,r),s.scrollParents={reference:o(e)?g(e):e.contextElement?g(e.contextElement):[],popper:g(t)},r=function(e){var t=y(e);return R.reduce((function(e,o){return e.concat(t.filter((function(e){return e.phase===o})))}),[])}(function(e){var t=e.reduce((function(e,t){var o=e[t.name];return e[t.name]=o?Object.assign({},o,t,{options:Object.assign({},o.options,t.options),data:Object.assign({},o.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,o=e.options;o=void 0===o?{}:o,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:p,options:o}),f.push(t||function(){}))})),p.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference;if(L(t,e=e.popper))for(s.rects={reference:u(t,b(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var o=s.orderedModifiers[t];e=o.fn;var n=o.options;n=void 0===n?{}:n,o=o.name,"function"==typeof e&&(s=e({state:s,options:n,name:o,instance:p})||s)}}},update:w((function(){return new Promise((function(e){p.forceUpdate(),e(s)}))})),destroy:function(){a(),c=!0}};return L(e,t)?(p.setOptions(r).then((function(e){!c&&r.onFirstUpdate&&r.onFirstUpdate(e)})),p):p}}function W(e){var o,n=e.popper,i=e.popperRect,r=e.placement,a=e.variation,s=e.offsets,c=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets;if(e=e.isFixed,!0===d){d=s.y;var h=window.devicePixelRatio||1;d={x:k(s.x*h)/h||0,y:k(d*h)/h||0}}else d="function"==typeof d?d(s):s;d=void 0===(d=(h=d).x)?0:d,h=void 0===(h=h.y)?0:h;var m=s.hasOwnProperty("x");s=s.hasOwnProperty("y");var g,v="left",y="top",w=window;if(u){var x=b(n),O="clientHeight",j="clientWidth";x===t(n)&&("static"!==p(x=f(n)).position&&"absolute"===c&&(O="scrollHeight",j="scrollWidth")),"top"!==r&&("left"!==r&&"right"!==r||"end"!==a)||(y="bottom",h-=(e&&w.visualViewport?w.visualViewport.height:x[O])-i.height,h*=l?1:-1),"left"!==r&&("top"!==r&&"bottom"!==r||"end"!==a)||(v="right",d-=(e&&w.visualViewport?w.visualViewport.width:x[j])-i.width,d*=l?1:-1)}return n=Object.assign({position:c},u&&A),l?Object.assign({},n,((g={})[y]=s?"0":"",g[v]=m?"0":"",g.transform=1>=(w.devicePixelRatio||1)?"translate("+d+"px, "+h+"px)":"translate3d("+d+"px, "+h+"px, 0)",g)):Object.assign({},n,((o={})[y]=s?h+"px":"",o[v]=m?d+"px":"",o.transform="",o))}var P=Math.max,T=Math.min,k=Math.round,H=["top","bottom","right","left"],R="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),D={placement:"bottom",modifiers:[],strategy:"absolute"},S={passive:!0},A={top:"auto",right:"auto",bottom:"auto",left:"auto"},C=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var o=e.state,n=e.instance,i=(e=e.options).scroll,r=void 0===i||i,a=void 0===(e=e.resize)||e,s=t(o.elements.popper),f=[].concat(o.scrollParents.reference,o.scrollParents.popper);return r&&f.forEach((function(e){e.addEventListener("scroll",n.update,S)})),a&&s.addEventListener("resize",n.update,S),function(){r&&f.forEach((function(e){e.removeEventListener("scroll",n.update,S)})),a&&s.removeEventListener("resize",n.update,S)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,o=e.options;e=void 0===(e=o.gpuAcceleration)||e;var n=o.adaptive;n=void 0===n||n,o=void 0===(o=o.roundOffsets)||o,e={placement:t.placement.split("-")[0],variation:t.placement.split("-")[1],popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e,isFixed:"fixed"===t.options.strategy},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,W(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:o})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,W(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var o=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];n(r)&&s(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,o={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,o.popper),t.styles=o,t.elements.arrow&&Object.assign(t.elements.arrow.style,o.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:o[e]).reduce((function(e,t){return e[t]="",e}),{}),n(i)&&s(i)&&(Object.assign(i.style,e),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]}],N=M({defaultModifiers:C});e.createPopper=N,e.defaultModifiers=C,e.detectOverflow=function(e,t){void 0===t&&(t={});var n=t;t=void 0===(t=n.placement)?e.placement:t;var i=n.boundary,a=void 0===i?"clippingParents":i,s=void 0===(i=n.rootBoundary)?"viewport":i;i=void 0===(i=n.elementContext)?"popper":i;var c=n.altBoundary,p=void 0!==c&&c;n=void 0===(n=n.padding)?0:n,n=Object.assign({},{top:0,right:0,bottom:0,left:0},"number"!=typeof n?n:function(e,t){return t.reduce((function(t,o){return t[o]=e,t}),{})}(n,H)),c=e.rects.popper,a=j(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||f(e.elements.popper),a,s),p=E({reference:s=r(e.elements.reference),element:c,strategy:"absolute",placement:t}),c=x(Object.assign({},c,p)),s="popper"===i?c:s;var l={top:a.top-s.top+n.top,bottom:s.bottom-a.bottom+n.bottom,left:a.left-s.left+n.left,right:s.right-a.right+n.right};if(e=e.modifiersData.offset,"popper"===i&&e){var u=e[t];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,o=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[o]*t}))}return l},e.popperGenerator=M,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
| //# sourceMappingURL=popper-lite.min.js.map |
| /** | ||
| * @popperjs/core v2.10.2 - MIT License | ||
| * @popperjs/core v2.11.0 - MIT License | ||
| */ | ||
| "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e,t){return{width:(e=e.getBoundingClientRect()).width/1,height:e.height/1,top:e.top/1,right:e.right/1,bottom:e.bottom/1,left:e.left/1,x:e.left/1,y:e.top/1}}function n(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function o(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return t(f(e)).left+o(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function l(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,r,a){void 0===a&&(a=!1);var c=i(r);i(r)&&r.getBoundingClientRect();var u=f(r);e=t(e);var d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(c||!c&&!a)&&(("body"!==s(r)||l(u))&&(d=r!==n(r)&&i(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:o(r)),i(r)?((m=t(r)).x+=r.clientLeft,m.y+=r.clientTop):u&&(m.x=p(u))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function d(e){var n=t(e),o=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(n.width-o)&&(o=n.width),1>=Math.abs(n.height-r)&&(r=n.height),{x:e.offsetLeft,y:e.offsetTop,width:o,height:r}}function m(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||f(e)}function h(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:i(e)&&l(e)?e:h(m(e))}function v(e,t){var o;void 0===t&&(t=[]);var r=h(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=n(r),r=e?[o].concat(o.visualViewport||[],l(r)?r:[]):r,t=t.concat(r),e?t:t.concat(v(m(r)))}function g(e){return i(e)&&"fixed"!==c(e).position?e.offsetParent:null}function b(e){for(var t=n(e),o=g(e);o&&0<=["table","td","th"].indexOf(s(o))&&"static"===c(o).position;)o=g(o);if(o&&("html"===s(o)||"body"===s(o)&&"static"===c(o).position))return t;if(!o)e:{if(o=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!i(e)||"fixed"!==c(e).position)for(e=m(e);i(e)&&0>["html","body"].indexOf(s(e));){var r=c(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||o&&"filter"===r.willChange||o&&r.filter&&"none"!==r.filter){o=e;break e}e=e.parentNode}o=null}return o||t}function y(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e)})),r.push(e)}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e)})),e.forEach((function(e){o.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&a(n))do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,r){if("viewport"===r){r=n(e);var a=f(e);r=r.visualViewport;var s=a.clientWidth;a=a.clientHeight;var l=0,u=0;r&&(s=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=r.offsetLeft,u=r.offsetTop)),e=j(e={width:s,height:a,x:l+p(e),y:u})}else i(r)?((e=t(r)).top+=r.clientTop,e.left+=r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=o(u),r=null==(a=u.ownerDocument)?void 0:a.body,a=U(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=U(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(r||e).direction&&(u+=U(e.clientWidth,r?r.clientWidth:0)-a),e=j({width:a,height:l,x:u,y:s}));return e}function D(e,t,n){return t="clippingParents"===t?function(e){var t=v(m(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?b(e):e;return r(n)?t.filter((function(e){return r(e)&&O(e,n)&&"body"!==s(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=E(e,n),t.top=U(n.top,t.top),t.right=z(n.right,t.right),t.bottom=z(n.bottom,t.bottom),t.left=U(n.left,t.left),t}),E(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function L(e){return e.split("-")[1]}function P(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function M(e){var t=e.reference,n=e.element,o=(e=e.placement)?x(e):null;e=e?L(e):null;var r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(o){case"top":r={x:r,y:t.y-n.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-n.width,y:i};break;default:r={x:t.x,y:t.y}}if(null!=(o=o?P(o):null))switch(i="y"===o?"height":"width",e){case"start":r[o]-=t[i]/2-n[i]/2;break;case"end":r[o]+=t[i]/2-n[i]/2}return r}function k(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function A(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function B(e,n){void 0===n&&(n={});var o=n;n=void 0===(n=o.placement)?e.placement:n;var i=o.boundary,a=void 0===i?"clippingParents":i,s=void 0===(i=o.rootBoundary)?"viewport":i;i=void 0===(i=o.elementContext)?"popper":i;var p=o.altBoundary,c=void 0!==p&&p;o=k("number"!=typeof(o=void 0===(o=o.padding)?0:o)?o:A(o,N)),p=e.rects.popper,a=D(r(c=e.elements[c?"popper"===i?"reference":"popper":i])?c:c.contextElement||f(e.elements.popper),a,s),c=M({reference:s=t(e.elements.reference),element:p,strategy:"absolute",placement:n}),p=j(Object.assign({},p,c)),s="popper"===i?p:s;var l={top:a.top-s.top+o.top,bottom:s.bottom-a.bottom+o.bottom,left:a.left-s.left+o.left,right:s.right-a.right+o.right};if(e=e.modifiersData.offset,"popper"===i&&e){var u=e[n];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[n]*t}))}return l}function W(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function T(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,o=void 0===(e=e.defaultOptions)?X:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=o);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},X,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],p=!1,c={state:s,setOptions:function(i){return i="function"==typeof i?i(s.options):i,a(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:r(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)},i=function(e){var t=y(e);return _.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:c,options:n}),f.push(t||function(){}))})),c.update()},forceUpdate:function(){if(!p){var e=s.elements,t=e.reference;if(W(t,e=e.popper))for(s.rects={reference:u(t,b(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var o=n.options;o=void 0===o?{}:o,n=n.name,"function"==typeof e&&(s=e({state:s,options:o,name:n,instance:c})||s)}}},update:w((function(){return new Promise((function(e){c.forceUpdate(),e(s)}))})),destroy:function(){a(),p=!0}};return W(e,t)?(c.setOptions(i).then((function(e){!p&&i.onFirstUpdate&&i.onFirstUpdate(e)})),c):c}}function R(e){var t,o=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,p=e.position,l=e.gpuAcceleration,u=e.adaptive;if(!0===(e=e.roundOffsets)){e=s.y;var d=window.devicePixelRatio||1;e={x:F(F(s.x*d)/d)||0,y:F(F(e*d)/d)||0}}else e="function"==typeof e?e(s):s;e=void 0===(e=(d=e).x)?0:e,d=void 0===(d=d.y)?0:d;var m=s.hasOwnProperty("x");s=s.hasOwnProperty("y");var h,v="left",g="top",y=window;if(u){var w=b(o),x="clientHeight",O="clientWidth";w===n(o)&&("static"!==c(w=f(o)).position&&"absolute"===p&&(x="scrollHeight",O="scrollWidth")),"top"!==i&&("left"!==i&&"right"!==i||"end"!==a)||(g="bottom",d-=w[x]-r.height,d*=l?1:-1),"left"!==i&&("top"!==i&&"bottom"!==i||"end"!==a)||(v="right",e-=w[O]-r.width,e*=l?1:-1)}return o=Object.assign({position:p},u&&K),l?Object.assign({},o,((h={})[g]=s?"0":"",h[v]=m?"0":"",h.transform=1>=(y.devicePixelRatio||1)?"translate("+e+"px, "+d+"px)":"translate3d("+e+"px, "+d+"px, 0)",h)):Object.assign({},o,((t={})[g]=s?d+"px":"",t[v]=m?e+"px":"",t.transform="",t))}function H(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}function S(e){return e.replace(/start|end/g,(function(e){return te[e]}))}function C(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var N=["top","bottom","right","left"],V=N.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),I=[].concat(N,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),_="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),U=Math.max,z=Math.min,F=Math.round,X={placement:"bottom",modifiers:[],strategy:"absolute"},Y={passive:!0},G={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,o=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",o.update,Y)})),a&&s.addEventListener("resize",o.update,Y),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",o.update,Y)})),a&&s.removeEventListener("resize",o.update,Y)}},data:{}},J={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=M({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},K={top:"auto",right:"auto",bottom:"auto",left:"auto"},Q={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var o=n.adaptive;o=void 0===o||o,n=void 0===(n=n.roundOffsets)||n,e={placement:x(t.placement),variation:L(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,R(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,R(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Z={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];i(r)&&s(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(o)&&s(o)&&(Object.assign(o.style,e),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},$={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=void 0===(e=e.options.offset)?[0,0]:e,r=(e=I.reduce((function(e,n){var r=t.rects,i=x(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof o?o(Object.assign({},r,{placement:n})):o;return r=(r=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:r}:{x:r,y:s},e[n]=i,e}),{}))[t.placement],i=r.x;r=r.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=r),t.modifiersData[n]=e}},ee={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"},ne={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var o=n.mainAxis;o=void 0===o||o;var r=n.altAxis;r=void 0===r||r;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,l=void 0===c||c,u=n.allowedAutoPlacements;c=x(n=t.options.placement),i=i||(c!==n&&l?function(e){if("auto"===x(e))return[];var t=H(e);return[S(e),t,S(t)]}(n):[H(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===x(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,o=t.rootBoundary,r=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?I:a,f=L(t.placement);0===(i=(t=f?i?V:V.filter((function(e){return L(e)===f})):N).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var p=i.reduce((function(t,i){return t[i]=B(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[x(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;c=!0;for(var h=d[0],v=0;v<d.length;v++){var g=d[v],b=x(g),y="start"===L(g),w=0<=["top","bottom"].indexOf(b),O=w?"width":"height",j=B(t,{placement:g,boundary:s,rootBoundary:f,altBoundary:p,padding:a});if(y=w?y?"right":"left":y?"bottom":"top",n[O]>i[O]&&(y=H(y)),O=H(y),w=[],o&&w.push(0>=j[b]),r&&w.push(0>=j[y],0>=j[O]),w.every((function(e){return e}))){h=g,c=!1;break}m.set(g,w)}if(c)for(o=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},r=l?3:1;0<r&&"break"!==o(r);r--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},oe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var o=n.mainAxis,r=void 0===o||o,i=void 0!==(o=n.altAxis)&&o;o=void 0===(o=n.tether)||o;var a=n.tetherOffset,s=void 0===a?0:a,f=B(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary});n=x(t.placement);var p=L(t.placement),c=!p,l=P(n);n="x"===l?"y":"x",a=t.modifiersData.popperOffsets;var u=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s;if(s={x:0,y:0},a){if(r||i){var v="y"===l?"top":"left",g="y"===l?"bottom":"right",y="y"===l?"height":"width",w=a[l],O=a[l]+f[v],j=a[l]-f[g],E=o?-m[y]/2:0,D="start"===p?u[y]:m[y];p="start"===p?-m[y]:-u[y],m=t.elements.arrow,m=o&&m?d(m):{width:0,height:0};var M=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};v=M[v],g=M[g],m=U(0,z(u[y],m[y])),D=c?u[y]/2-E-m-v-h:D-m-v-h,u=c?-u[y]/2+E+m+g+h:p+m+g+h,c=t.elements.arrow&&b(t.elements.arrow),h=t.modifiersData.offset?t.modifiersData.offset[t.placement][l]:0,c=a[l]+D-h-(c?"y"===l?c.clientTop||0:c.clientLeft||0:0),u=a[l]+u-h,r&&(r=o?z(O,c):O,j=o?U(j,u):j,r=U(r,z(w,j)),a[l]=r,s[l]=r-w),i&&(r=(i=a[n])+f["x"===l?"top":"left"],f=i-f["x"===l?"bottom":"right"],r=o?z(r,c):r,o=o?U(f,u):f,o=U(r,z(i,o)),a[n]=o,s[n]=o-i)}t.modifiersData[e]=s}},requiresIfExists:["offset"]},re={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=x(n.placement);if(e=P(s),s=0<=["left","right"].indexOf(s)?"height":"width",i&&a){r=k("number"!=typeof(r="function"==typeof(r=r.padding)?r(Object.assign({},n.rects,{placement:n.placement})):r)?r:A(r,N));var f=d(i),p="y"===e?"top":"left",c="y"===e?"bottom":"right",l=n.rects.reference[s]+n.rects.reference[e]-a[e]-n.rects.popper[s];a=a[e]-n.rects.reference[e],a=(i=(i=b(i))?"y"===e?i.clientHeight||0:i.clientWidth||0:0)/2-f[s]/2+(l/2-a/2),s=U(r[p],z(a,i-f[s]-r[c])),n.modifiersData[o]=((t={})[e]=s,t.centerOffset=s-a,t)}},effect:function(e){var t=e.state;if(null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)){if("string"==typeof e&&!(e=t.elements.popper.querySelector(e)))return;O(t.elements.popper,e)&&(t.elements.arrow=e)}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},ie={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,i=B(t,{elementContext:"reference"}),a=B(t,{altBoundary:!0});n=C(i,n),o=C(a,o,r),r=q(n),a=q(o),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:o,isReferenceHidden:r,hasPopperEscaped:a},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":r,"data-popper-escaped":a})}},ae=T({defaultModifiers:[G,J,Q,Z]}),se=[G,J,Q,Z,$,ne,oe,re,ie],fe=T({defaultModifiers:se});e.applyStyles=Z,e.arrow=re,e.computeStyles=Q,e.createPopper=fe,e.createPopperLite=ae,e.defaultModifiers=se,e.detectOverflow=B,e.eventListeners=G,e.flip=ne,e.hide=ie,e.offset=$,e.popperGenerator=T,e.popperOffsets=J,e.preventOverflow=oe,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
| "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function n(e){return e instanceof t(e).Element||e instanceof Element}function o(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function r(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}function i(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;return o(e)&&t&&(t=e.offsetHeight,0<(e=e.offsetWidth)&&(r=I(n.width)/e||1),0<t&&(i=I(n.height)/t||1)),{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function a(e){return{scrollLeft:(e=t(e)).pageXOffset,scrollTop:e.pageYOffset}}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return i(f(e)).left+a(e).scrollLeft}function c(e){return t(e).getComputedStyle(e)}function l(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,n,r){void 0===r&&(r=!1);var c,u=o(n);if(c=o(n)){var d=n.getBoundingClientRect();c=I(d.width)/n.offsetWidth||1,d=I(d.height)/n.offsetHeight||1,c=1!==c||1!==d}d=c,c=f(n),e=i(e,d),d={scrollLeft:0,scrollTop:0};var h={x:0,y:0};return(u||!u&&!r)&&(("body"!==s(n)||l(c))&&(d=n!==t(n)&&o(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:a(n)),o(n)?((h=i(n,!0)).x+=n.clientLeft,h.y+=n.clientTop):c&&(h.x=p(c))),{x:e.left+d.scrollLeft-h.x,y:e.top+d.scrollTop-h.y,width:e.width,height:e.height}}function d(e){var t=i(e),n=e.offsetWidth,o=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-o)&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function h(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||f(e)}function m(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:o(e)&&l(e)?e:m(h(e))}function v(e,n){var o;void 0===n&&(n=[]);var r=m(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=t(r),r=e?[o].concat(o.visualViewport||[],l(r)?r:[]):r,n=n.concat(r),e?n:n.concat(v(h(r)))}function g(e){return o(e)&&"fixed"!==c(e).position?e.offsetParent:null}function y(e){for(var n=t(e),r=g(e);r&&0<=["table","td","th"].indexOf(s(r))&&"static"===c(r).position;)r=g(r);if(r&&("html"===s(r)||"body"===s(r)&&"static"===c(r).position))return n;if(!r)e:{if(r=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!o(e)||"fixed"!==c(e).position)for(e=h(e);o(e)&&0>["html","body"].indexOf(s(e));){var i=c(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||r&&"filter"===i.willChange||r&&i.filter&&"none"!==i.filter){r=e;break e}e=e.parentNode}r=null}return r||n}function b(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e)})),r.push(e)}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e)})),e.forEach((function(e){o.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n))do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,o){if("viewport"===o){o=t(e);var r=f(e);o=o.visualViewport;var s=r.clientWidth;r=r.clientHeight;var l=0,u=0;o&&(s=o.width,r=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=o.offsetLeft,u=o.offsetTop)),e=j(e={width:s,height:r,x:l+p(e),y:u})}else n(o)?((e=i(o)).top+=o.clientTop,e.left+=o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=a(u),o=null==(r=u.ownerDocument)?void 0:r.body,r=V(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=V(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(o||e).direction&&(u+=V(e.clientWidth,o?o.clientWidth:0)-r),e=j({width:r,height:l,x:u,y:s}));return e}function D(e,t,r){return t="clippingParents"===t?function(e){var t=v(h(e)),r=0<=["absolute","fixed"].indexOf(c(e).position),i=r&&o(e)?y(e):e;return n(i)?t.filter((function(e){return n(e)&&O(e,i)&&"body"!==s(e)&&(!r||"static"!==c(e).position)})):[]}(e):[].concat(t),(r=(r=[].concat(t,[r])).reduce((function(t,n){return n=E(e,n),t.top=V(n.top,t.top),t.right=N(n.right,t.right),t.bottom=N(n.bottom,t.bottom),t.left=V(n.left,t.left),t}),E(e,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function A(e){return e.split("-")[1]}function L(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function P(e){var t=e.reference,n=e.element,o=(e=e.placement)?x(e):null;e=e?A(e):null;var r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(o){case"top":r={x:r,y:t.y-n.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-n.width,y:i};break;default:r={x:t.x,y:t.y}}if(null!=(o=o?L(o):null))switch(i="y"===o?"height":"width",e){case"start":r[o]-=t[i]/2-n[i]/2;break;case"end":r[o]+=t[i]/2-n[i]/2}return r}function M(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function k(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function W(e,t){void 0===t&&(t={});var o=t;t=void 0===(t=o.placement)?e.placement:t;var r=o.boundary,a=void 0===r?"clippingParents":r,s=void 0===(r=o.rootBoundary)?"viewport":r;r=void 0===(r=o.elementContext)?"popper":r;var p=o.altBoundary,c=void 0!==p&&p;o=M("number"!=typeof(o=void 0===(o=o.padding)?0:o)?o:k(o,_)),p=e.rects.popper,a=D(n(c=e.elements[c?"popper"===r?"reference":"popper":r])?c:c.contextElement||f(e.elements.popper),a,s),c=P({reference:s=i(e.elements.reference),element:p,strategy:"absolute",placement:t}),p=j(Object.assign({},p,c)),s="popper"===r?p:s;var l={top:a.top-s.top+o.top,bottom:s.bottom-a.bottom+o.bottom,left:a.left-s.left+o.left,right:s.right-a.right+o.right};if(e=e.modifiersData.offset,"popper"===r&&e){var u=e[t];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[n]*t}))}return l}function B(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function H(e){void 0===e&&(e={});var t=e.defaultModifiers,o=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?X:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},X,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],p=!1,c={state:s,setOptions:function(i){return i="function"==typeof i?i(s.options):i,a(),s.options=Object.assign({},r,s.options,i),s.scrollParents={reference:n(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)},i=function(e){var t=b(e);return z.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:c,options:n}),f.push(t||function(){}))})),c.update()},forceUpdate:function(){if(!p){var e=s.elements,t=e.reference;if(B(t,e=e.popper))for(s.rects={reference:u(t,y(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var o=n.options;o=void 0===o?{}:o,n=n.name,"function"==typeof e&&(s=e({state:s,options:o,name:n,instance:c})||s)}}},update:w((function(){return new Promise((function(e){c.forceUpdate(),e(s)}))})),destroy:function(){a(),p=!0}};return B(e,t)?(c.setOptions(i).then((function(e){!p&&i.onFirstUpdate&&i.onFirstUpdate(e)})),c):c}}function T(e){var n,o=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,p=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets;if(e=e.isFixed,!0===d){d=s.y;var h=window.devicePixelRatio||1;d={x:I(s.x*h)/h||0,y:I(d*h)/h||0}}else d="function"==typeof d?d(s):s;d=void 0===(d=(h=d).x)?0:d,h=void 0===(h=h.y)?0:h;var m=s.hasOwnProperty("x");s=s.hasOwnProperty("y");var v,g="left",b="top",w=window;if(u){var x=y(o),O="clientHeight",j="clientWidth";x===t(o)&&("static"!==c(x=f(o)).position&&"absolute"===p&&(O="scrollHeight",j="scrollWidth")),"top"!==i&&("left"!==i&&"right"!==i||"end"!==a)||(b="bottom",h-=(e&&w.visualViewport?w.visualViewport.height:x[O])-r.height,h*=l?1:-1),"left"!==i&&("top"!==i&&"bottom"!==i||"end"!==a)||(g="right",d-=(e&&w.visualViewport?w.visualViewport.width:x[j])-r.width,d*=l?1:-1)}return o=Object.assign({position:p},u&&K),l?Object.assign({},o,((v={})[b]=s?"0":"",v[g]=m?"0":"",v.transform=1>=(w.devicePixelRatio||1)?"translate("+d+"px, "+h+"px)":"translate3d("+d+"px, "+h+"px, 0)",v)):Object.assign({},o,((n={})[b]=s?h+"px":"",n[g]=m?d+"px":"",n.transform="",n))}function R(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}function S(e){return e.replace(/start|end/g,(function(e){return te[e]}))}function C(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var V=Math.max,N=Math.min,I=Math.round,_=["top","bottom","right","left"],F=_.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),U=[].concat(_,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),z="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),X={placement:"bottom",modifiers:[],strategy:"absolute"},Y={passive:!0},G={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,o=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=t(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",o.update,Y)})),a&&s.addEventListener("resize",o.update,Y),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",o.update,Y)})),a&&s.removeEventListener("resize",o.update,Y)}},data:{}},J={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=P({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},K={top:"auto",right:"auto",bottom:"auto",left:"auto"},Q={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var o=n.adaptive;o=void 0===o||o,n=void 0===(n=n.roundOffsets)||n,e={placement:x(t.placement),variation:A(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e,isFixed:"fixed"===t.options.strategy},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,T(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,T(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Z={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];o(i)&&s(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),o(r)&&s(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},$={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=void 0===(e=e.options.offset)?[0,0]:e,r=(e=U.reduce((function(e,n){var r=t.rects,i=x(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof o?o(Object.assign({},r,{placement:n})):o;return r=(r=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:r}:{x:r,y:s},e[n]=i,e}),{}))[t.placement],i=r.x;r=r.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=r),t.modifiersData[n]=e}},ee={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"},ne={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var o=n.mainAxis;o=void 0===o||o;var r=n.altAxis;r=void 0===r||r;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,l=void 0===c||c,u=n.allowedAutoPlacements;c=x(n=t.options.placement),i=i||(c!==n&&l?function(e){if("auto"===x(e))return[];var t=R(e);return[S(e),t,S(t)]}(n):[R(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===x(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,o=t.rootBoundary,r=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?U:a,f=A(t.placement);0===(i=(t=f?i?F:F.filter((function(e){return A(e)===f})):_).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var p=i.reduce((function(t,i){return t[i]=W(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[x(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var h=new Map;c=!0;for(var m=d[0],v=0;v<d.length;v++){var g=d[v],y=x(g),b="start"===A(g),w=0<=["top","bottom"].indexOf(y),O=w?"width":"height",j=W(t,{placement:g,boundary:s,rootBoundary:f,altBoundary:p,padding:a});if(b=w?b?"right":"left":b?"bottom":"top",n[O]>i[O]&&(b=R(b)),O=R(b),w=[],o&&w.push(0>=j[y]),r&&w.push(0>=j[b],0>=j[O]),w.every((function(e){return e}))){m=g,c=!1;break}h.set(g,w)}if(c)for(o=function(e){var t=d.find((function(t){if(t=h.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return m=t,"break"},r=l?3:1;0<r&&"break"!==o(r);r--);t.placement!==m&&(t.modifiersData[e]._skip=!0,t.placement=m,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},oe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var o=n.mainAxis,r=void 0===o||o,i=void 0!==(o=n.altAxis)&&o,a=void 0===(o=n.tether)||o,s=void 0===(o=n.tetherOffset)?0:o,f=W(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),p=x(t.placement),c=A(t.placement),l=!c,u=L(p);n="x"===u?"y":"x",o=t.modifiersData.popperOffsets;var h=t.rects.reference,m=t.rects.popper,v="number"==typeof(s="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s)?{mainAxis:s,altAxis:s}:Object.assign({mainAxis:0,altAxis:0},s),g=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null;if(s={x:0,y:0},o){if(r){var b,w="y"===u?"top":"left",O="y"===u?"bottom":"right",j="y"===u?"height":"width",E=(r=o[u])+f[w],D=r-f[O],P=a?-m[j]/2:0,M="start"===c?h[j]:m[j];c="start"===c?-m[j]:-h[j];var k=t.elements.arrow;k=a&&k?d(k):{width:0,height:0};var B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};w=B[w],O=B[O],k=V(0,N(h[j],k[j])),M=l?h[j]/2-P-k-w-v.mainAxis:M-k-w-v.mainAxis,l=l?-h[j]/2+P+k+O+v.mainAxis:c+k+O+v.mainAxis,j=(j=t.elements.arrow&&y(t.elements.arrow))?"y"===u?j.clientTop||0:j.clientLeft||0:0,P=null!=(b=null==g?void 0:g[u])?b:0,b=r+l-P,E=a?N(E,r+M-P-j):E,b=a?V(D,b):D,b=V(E,N(r,b)),o[u]=b,s[u]=b-r}var H;if(i)r="y"===n?"height":"width",b=(i=o[n])+f["x"===u?"top":"left"],f=i-f["x"===u?"bottom":"right"],p=-1!==["top","left"].indexOf(p),u=null!=(H=null==g?void 0:g[n])?H:0,H=p?b:i-h[r]-m[r]-u+v.altAxis,h=p?i+h[r]+m[r]-u-v.altAxis:f,a&&p?H=(H=V(H,N(i,h)))>h?h:H:H=V(a?H:b,N(i,a?h:f)),o[n]=H,s[n]=H-i;t.modifiersData[e]=s}},requiresIfExists:["offset"]},re={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=x(n.placement);if(e=L(s),s=0<=["left","right"].indexOf(s)?"height":"width",i&&a){r=M("number"!=typeof(r="function"==typeof(r=r.padding)?r(Object.assign({},n.rects,{placement:n.placement})):r)?r:k(r,_));var f=d(i),p="y"===e?"top":"left",c="y"===e?"bottom":"right",l=n.rects.reference[s]+n.rects.reference[e]-a[e]-n.rects.popper[s];a=a[e]-n.rects.reference[e],a=(i=(i=y(i))?"y"===e?i.clientHeight||0:i.clientWidth||0:0)/2-f[s]/2+(l/2-a/2),s=V(r[p],N(a,i-f[s]-r[c])),n.modifiersData[o]=((t={})[e]=s,t.centerOffset=s-a,t)}},effect:function(e){var t=e.state;if(null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)){if("string"==typeof e&&!(e=t.elements.popper.querySelector(e)))return;O(t.elements.popper,e)&&(t.elements.arrow=e)}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},ie={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,i=W(t,{elementContext:"reference"}),a=W(t,{altBoundary:!0});n=C(i,n),o=C(a,o,r),r=q(n),a=q(o),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:o,isReferenceHidden:r,hasPopperEscaped:a},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":r,"data-popper-escaped":a})}},ae=H({defaultModifiers:[G,J,Q,Z]}),se=[G,J,Q,Z,$,ne,oe,re,ie],fe=H({defaultModifiers:se});e.applyStyles=Z,e.arrow=re,e.computeStyles=Q,e.createPopper=fe,e.createPopperLite=ae,e.defaultModifiers=se,e.detectOverflow=W,e.eventListeners=G,e.flip=ne,e.hide=ie,e.offset=$,e.popperGenerator=H,e.popperOffsets=J,e.preventOverflow=oe,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
| //# sourceMappingURL=popper.min.js.map |
| import type { ClientRectObject, VirtualElement } from "../types"; | ||
| export default function getBoundingClientRect(element: Element | VirtualElement, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale?: boolean): ClientRectObject; | ||
| export default function getBoundingClientRect(element: Element | VirtualElement, includeScale?: boolean): ClientRectObject; |
@@ -1,4 +0,4 @@ | ||
| // import { isHTMLElement } from './instanceOf'; | ||
| export default function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars | ||
| includeScale) { | ||
| import { isHTMLElement } from "./instanceOf.js"; | ||
| import { round } from "../utils/math.js"; | ||
| export default function getBoundingClientRect(element, includeScale) { | ||
| if (includeScale === void 0) { | ||
@@ -10,20 +10,18 @@ includeScale = false; | ||
| var scaleX = 1; | ||
| var scaleY = 1; // FIXME: | ||
| // `offsetWidth` returns an integer while `getBoundingClientRect` | ||
| // returns a float. This results in `scaleX` or `scaleY` being | ||
| // non-1 when it should be for elements that aren't a full pixel in | ||
| // width or height. | ||
| // if (isHTMLElement(element) && includeScale) { | ||
| // const offsetHeight = element.offsetHeight; | ||
| // const offsetWidth = element.offsetWidth; | ||
| // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // // Fallback to 1 in case both values are `0` | ||
| // if (offsetWidth > 0) { | ||
| // scaleX = rect.width / offsetWidth || 1; | ||
| // } | ||
| // if (offsetHeight > 0) { | ||
| // scaleY = rect.height / offsetHeight || 1; | ||
| // } | ||
| // } | ||
| var scaleY = 1; | ||
| if (isHTMLElement(element) && includeScale) { | ||
| var offsetHeight = element.offsetHeight; | ||
| var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale | ||
| // Fallback to 1 in case both values are `0` | ||
| if (offsetWidth > 0) { | ||
| scaleX = round(rect.width) / offsetWidth || 1; | ||
| } | ||
| if (offsetHeight > 0) { | ||
| scaleY = round(rect.height) / offsetHeight || 1; | ||
| } | ||
| } | ||
| return { | ||
@@ -30,0 +28,0 @@ width: rect.width / scaleX, |
@@ -30,3 +30,3 @@ import { viewport } from "../enums.js"; | ||
| function getClientRectFromMixedType(element, clippingParent) { | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); | ||
| } // A "clipping parent" is an overflowable container with the characteristic of | ||
@@ -48,3 +48,3 @@ // clipping (or hiding) overflowing elements with a position different from | ||
| return clippingParents.filter(function (clippingParent) { | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; | ||
| return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true); | ||
| }); | ||
@@ -51,0 +51,0 @@ } // Gets the maximum area that the element is visible in due to any number of |
@@ -8,7 +8,8 @@ import getBoundingClientRect from "./getBoundingClientRect.js"; | ||
| import isScrollParent from "./isScrollParent.js"; | ||
| import { round } from "../utils/math.js"; | ||
| function isElementScaled(element) { | ||
| var rect = element.getBoundingClientRect(); | ||
| var scaleX = rect.width / element.offsetWidth || 1; | ||
| var scaleY = rect.height / element.offsetHeight || 1; | ||
| var scaleX = round(rect.width) / element.offsetWidth || 1; | ||
| var scaleY = round(rect.height) / element.offsetHeight || 1; | ||
| return scaleX !== 1 || scaleY !== 1; | ||
@@ -15,0 +16,0 @@ } // Returns the composite rect of an element relative to its offsetParent. |
+1
-1
@@ -13,3 +13,3 @@ export declare const top: "top"; | ||
| export declare const viewport: "viewport"; | ||
| export declare type Boundary = HTMLElement | Array<HTMLElement> | typeof clippingParents; | ||
| export declare type Boundary = Element | Array<Element> | typeof clippingParents; | ||
| export declare type RootBoundary = typeof viewport | "document"; | ||
@@ -16,0 +16,0 @@ export declare const popper: "popper"; |
@@ -6,3 +6,3 @@ import getBasePlacement from "../utils/getBasePlacement.js"; | ||
| import getMainAxisFromPlacement from "../utils/getMainAxisFromPlacement.js"; | ||
| import within from "../utils/within.js"; | ||
| import { within } from "../utils/within.js"; | ||
| import mergePaddingObject from "../utils/mergePaddingObject.js"; | ||
@@ -9,0 +9,0 @@ import expandToHashMap from "../utils/expandToHashMap.js"; |
@@ -13,3 +13,3 @@ import type { PositioningStrategy, Offsets, Modifier, Rect } from "../types"; | ||
| }; | ||
| export declare function mapToStyles({ popper, popperRect, placement, variation, offsets, position, gpuAcceleration, adaptive, roundOffsets }: { | ||
| export declare function mapToStyles({ popper, popperRect, placement, variation, offsets, position, gpuAcceleration, adaptive, roundOffsets, isFixed }: { | ||
| popper: HTMLElement; | ||
@@ -28,2 +28,3 @@ popperRect: Rect; | ||
| roundOffsets: boolean | RoundOffsets; | ||
| isFixed: boolean; | ||
| }): { | ||
@@ -30,0 +31,0 @@ transform: string; |
@@ -25,4 +25,4 @@ import { top, left, right, bottom, end } from "../enums.js"; | ||
| return { | ||
| x: round(round(x * dpr) / dpr) || 0, | ||
| y: round(round(y * dpr) / dpr) || 0 | ||
| x: round(x * dpr) / dpr || 0, | ||
| y: round(y * dpr) / dpr || 0 | ||
| }; | ||
@@ -42,3 +42,4 @@ } | ||
| adaptive = _ref2.adaptive, | ||
| roundOffsets = _ref2.roundOffsets; | ||
| roundOffsets = _ref2.roundOffsets, | ||
| isFixed = _ref2.isFixed; | ||
@@ -75,5 +76,6 @@ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, | ||
| if (placement === top || (placement === left || placement === right) && variation === end) { | ||
| sideY = bottom; // $FlowFixMe[prop-missing] | ||
| y -= offsetParent[heightProp] - popperRect.height; | ||
| sideY = bottom; | ||
| var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] | ||
| offsetParent[heightProp]; | ||
| y -= offsetY - popperRect.height; | ||
| y *= gpuAcceleration ? 1 : -1; | ||
@@ -83,5 +85,6 @@ } | ||
| if (placement === left || (placement === top || placement === bottom) && variation === end) { | ||
| sideX = right; // $FlowFixMe[prop-missing] | ||
| x -= offsetParent[widthProp] - popperRect.width; | ||
| sideX = right; | ||
| var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] | ||
| offsetParent[widthProp]; | ||
| x -= offsetX - popperRect.width; | ||
| x *= gpuAcceleration ? 1 : -1; | ||
@@ -129,3 +132,4 @@ } | ||
| popperRect: state.rects.popper, | ||
| gpuAcceleration: gpuAcceleration | ||
| gpuAcceleration: gpuAcceleration, | ||
| isFixed: state.options.strategy === 'fixed' | ||
| }; | ||
@@ -132,0 +136,0 @@ |
| import type { Placement } from "../enums"; | ||
| import type { Modifier, Rect, Offsets } from "../types"; | ||
| declare type OffsetsFunction = (arg0: { | ||
| export declare type OffsetsFunction = (arg0: { | ||
| popper: Rect; | ||
@@ -5,0 +5,0 @@ reference: Rect; |
| import getBasePlacement from "../utils/getBasePlacement.js"; | ||
| import { top, left, right, placements } from "../enums.js"; | ||
| import { top, left, right, placements } from "../enums.js"; // eslint-disable-next-line import/no-unused-modules | ||
| export function distanceAndSkiddingToXY(placement, rects, offset) { | ||
@@ -4,0 +5,0 @@ var basePlacement = getBasePlacement(placement); |
@@ -7,3 +7,9 @@ import type { Placement, Boundary, RootBoundary } from "../enums"; | ||
| placement: Placement; | ||
| }) => number) | number; | ||
| }) => number | { | ||
| mainAxis: number; | ||
| altAxis: number; | ||
| }) | number | { | ||
| mainAxis: number; | ||
| altAxis: number; | ||
| }; | ||
| export declare type Options = { | ||
@@ -10,0 +16,0 @@ mainAxis: boolean; |
@@ -5,3 +5,3 @@ import { top, left, right, bottom, start } from "../enums.js"; | ||
| import getAltAxis from "../utils/getAltAxis.js"; | ||
| import within from "../utils/within.js"; | ||
| import { within, withinMaxClamp } from "../utils/within.js"; | ||
| import getLayoutRect from "../dom-utils/getLayoutRect.js"; | ||
@@ -12,3 +12,3 @@ import getOffsetParent from "../dom-utils/getOffsetParent.js"; | ||
| import getFreshSideObject from "../utils/getFreshSideObject.js"; | ||
| import { max as mathMax, min as mathMin } from "../utils/math.js"; | ||
| import { min as mathMin, max as mathMax } from "../utils/math.js"; | ||
@@ -48,2 +48,10 @@ function preventOverflow(_ref) { | ||
| })) : tetherOffset; | ||
| var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { | ||
| mainAxis: tetherOffsetValue, | ||
| altAxis: tetherOffsetValue | ||
| } : Object.assign({ | ||
| mainAxis: 0, | ||
| altAxis: 0 | ||
| }, tetherOffsetValue); | ||
| var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; | ||
| var data = { | ||
@@ -58,3 +66,5 @@ x: 0, | ||
| if (checkMainAxis || checkAltAxis) { | ||
| if (checkMainAxis) { | ||
| var _offsetModifierState$; | ||
| var mainSide = mainAxis === 'y' ? top : left; | ||
@@ -64,4 +74,4 @@ var altSide = mainAxis === 'y' ? bottom : right; | ||
| var offset = popperOffsets[mainAxis]; | ||
| var min = popperOffsets[mainAxis] + overflow[mainSide]; | ||
| var max = popperOffsets[mainAxis] - overflow[altSide]; | ||
| var min = offset + overflow[mainSide]; | ||
| var max = offset - overflow[altSide]; | ||
| var additive = tether ? -popperRect[len] / 2 : 0; | ||
@@ -86,32 +96,41 @@ var minLen = variation === start ? referenceRect[len] : popperRect[len]; | ||
| var arrowLen = within(0, referenceRect[len], arrowRect[len]); | ||
| var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; | ||
| var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; | ||
| var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; | ||
| var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; | ||
| var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); | ||
| var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; | ||
| var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; | ||
| var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; | ||
| var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; | ||
| var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; | ||
| var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; | ||
| var tetherMax = offset + maxOffset - offsetModifierValue; | ||
| var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max); | ||
| popperOffsets[mainAxis] = preventedOffset; | ||
| data[mainAxis] = preventedOffset - offset; | ||
| } | ||
| if (checkMainAxis) { | ||
| var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max); | ||
| popperOffsets[mainAxis] = preventedOffset; | ||
| data[mainAxis] = preventedOffset - offset; | ||
| } | ||
| if (checkAltAxis) { | ||
| var _offsetModifierState$2; | ||
| if (checkAltAxis) { | ||
| var _mainSide = mainAxis === 'x' ? top : left; | ||
| var _mainSide = mainAxis === 'x' ? top : left; | ||
| var _altSide = mainAxis === 'x' ? bottom : right; | ||
| var _altSide = mainAxis === 'x' ? bottom : right; | ||
| var _offset = popperOffsets[altAxis]; | ||
| var _offset = popperOffsets[altAxis]; | ||
| var _min = _offset + overflow[_mainSide]; | ||
| var _len = altAxis === 'y' ? 'height' : 'width'; | ||
| var _max = _offset - overflow[_altSide]; | ||
| var _min = _offset + overflow[_mainSide]; | ||
| var _preventedOffset = within(tether ? mathMin(_min, tetherMin) : _min, _offset, tether ? mathMax(_max, tetherMax) : _max); | ||
| var _max = _offset - overflow[_altSide]; | ||
| popperOffsets[altAxis] = _preventedOffset; | ||
| data[altAxis] = _preventedOffset - _offset; | ||
| } | ||
| var isOriginSide = [top, left].indexOf(basePlacement) !== -1; | ||
| var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; | ||
| var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; | ||
| var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; | ||
| var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); | ||
| popperOffsets[altAxis] = _preventedOffset; | ||
| data[altAxis] = _preventedOffset - _offset; | ||
| } | ||
@@ -118,0 +137,0 @@ |
@@ -1,1 +0,2 @@ | ||
| export default function within(min: number, value: number, max: number): number; | ||
| export declare function within(min: number, value: number, max: number): number; | ||
| export declare function withinMaxClamp(min: number, value: number, max: number): number; |
| import { max as mathMax, min as mathMin } from "./math.js"; | ||
| export default function within(min, value, max) { | ||
| export function within(min, value, max) { | ||
| return mathMax(min, mathMin(value, max)); | ||
| } | ||
| export function withinMaxClamp(min, value, max) { | ||
| var v = within(min, value, max); | ||
| return v > max ? max : v; | ||
| } |
+2
-2
| { | ||
| "name": "@popperjs/core", | ||
| "version": "2.10.2", | ||
| "version": "2.11.0", | ||
| "description": "Tooltip and Popover Positioning Engine", | ||
@@ -109,3 +109,3 @@ "main": "dist/cjs/popper.js", | ||
| "pretty-quick": "^3.1.0", | ||
| "puppeteer": "^7.1.0", | ||
| "puppeteer": "^10.4.0", | ||
| "replace-in-files-cli": "^1.0.0", | ||
@@ -112,0 +112,0 @@ "rollup": "^2.39.0", |
+32
-18
@@ -48,23 +48,29 @@ <!-- <HEADER> // IGNORE IT --> | ||
| To contribute to the Popper website and documentation, please visit the [dedicated repository](https://github.com/popperjs/website). | ||
| To contribute to the Popper website and documentation, please visit the | ||
| [dedicated repository](https://github.com/popperjs/website). | ||
| ## Why not use pure CSS? | ||
| CSS tooltips have accessibility and usability problems: | ||
| - **Clipping and overflow issues**: CSS tooltips will not be prevented from | ||
| overflowing clipping boundaries, such as the viewport. The tooltip gets | ||
| partially cut off or overflows if it's near the edge since there is no dynamic | ||
| positioning logic. When using Popper, your tooltip will always be positioned | ||
| in the right place. | ||
| - **No flipping**: CSS tooltips will not flip to a different placement to fit | ||
| better in view if necessary. Popper automatically flips the tooltip to make it | ||
| fit in view as best as possible for the user. | ||
| - **Using HTML**: Popovers containing interactive HTML are difficult or not | ||
| possible to create without UX issues using pure CSS. Popper positions any HTML | ||
| element – no pseudo-elements are used. | ||
| - **No virtual positioning**: CSS tooltips cannot follow the mouse cursor or be | ||
| - **Clipping and overflow issues**: Pure CSS poppers will not be prevented from | ||
| overflowing clipping boundaries, such as the viewport. It will get partially | ||
| cut off or overflows if it's near the edge since there is no dynamic | ||
| positioning logic. When using Popper, your popper will always be positioned in | ||
| the right place without needing manual adjustments. | ||
| - **No flipping**: CSS poppers will not flip to a different placement to fit | ||
| better in view if necessary. While you can manually adjust for the main axis | ||
| overflow, this feature cannot be achieved via CSS alone. Popper automatically | ||
| flips the tooltip to make it fit in view as best as possible for the user. | ||
| - **No virtual positioning**: CSS poppers cannot follow the mouse cursor or be | ||
| used as a context menu. Popper allows you to position your tooltip relative to | ||
| any coordinates you desire. | ||
| - **Lack of extensibility**: CSS tooltips cannot be easily extended to fit any | ||
| - **Slower development cycle**: When pure CSS is used to position popper | ||
| elements, the lack of dynamic positioning means they must be carefully placed | ||
| to consider overflow on all screen sizes. In reusable component libraries, | ||
| this means a developer can't just add the component anywhere on the page, | ||
| because these issues need to be considered and adjusted for every time. With | ||
| Popper, you can place your elements anywhere and they will be positioned | ||
| correctly, without needing to consider different screen sizes, layouts, etc. | ||
| This massively speeds up development time because this work is automatically | ||
| offloaded to Popper. | ||
| - **Lack of extensibility**: CSS poppers cannot be easily extended to fit any | ||
| arbitrary use case you may need to adjust for. Popper is built with | ||
@@ -85,2 +91,6 @@ extensibility in mind. | ||
| DOM context because they don't handle `offsetParent` contexts. | ||
| - **Compatibility**: Popper handles an incredible number of edge cases regarding | ||
| different browsers and environments (mobile viewports, RTL, scrollbars enabled | ||
| or disabled, etc.). Popper is a popular and well-maintained library, so you | ||
| can be confident positioning will work for your users on any device. | ||
| - **Configurability**: They often lack advanced configurability to suit any | ||
@@ -212,3 +222,3 @@ possible use case. | ||
| ```js | ||
| import { createPopperLite as createPopper } from "@popperjs/core"; | ||
| import { createPopperLite as createPopper } from '@popperjs/core'; | ||
| ``` | ||
@@ -227,3 +237,7 @@ | ||
| ```js | ||
| import { createPopperLite as createPopper, preventOverflow, flip } from "@popperjs/core"; | ||
| import { | ||
| createPopperLite as createPopper, | ||
| preventOverflow, | ||
| flip, | ||
| } from '@popperjs/core'; | ||
@@ -230,0 +244,0 @@ const button = document.querySelector('#button'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1588080
1.34%11725
0.73%377
3.86%67
13.56%