From f73f2356820468344757dbb9d7f3ec73ece7bf66 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 13 Feb 2023 20:43:51 +0100 Subject: Updating. Signed-off-by: Daniel Baumann --- web/_static/popperjs/popper-base.js | 1157 +++++++++++++++ web/_static/popperjs/popper-base.js.map | 65 + web/_static/popperjs/popper-base.min.js | 71 + web/_static/popperjs/popper-base.min.js.flow | 65 + web/_static/popperjs/popper-base.min.js.map | 65 + web/_static/popperjs/popper-lite.js | 1490 +++++++++++++++++++ web/_static/popperjs/popper-lite.js.map | 65 + web/_static/popperjs/popper-lite.min.js | 71 + web/_static/popperjs/popper-lite.min.js.flow | 65 + web/_static/popperjs/popper-lite.min.js.map | 65 + web/_static/popperjs/popper.js | 2062 ++++++++++++++++++++++++++ web/_static/popperjs/popper.js.map | 65 + web/_static/popperjs/popper.min.js | 71 + web/_static/popperjs/popper.min.js.flow | 65 + web/_static/popperjs/popper.min.js.map | 65 + 15 files changed, 5507 insertions(+) create mode 100644 web/_static/popperjs/popper-base.js create mode 100644 web/_static/popperjs/popper-base.js.map create mode 100644 web/_static/popperjs/popper-base.min.js create mode 100644 web/_static/popperjs/popper-base.min.js.flow create mode 100644 web/_static/popperjs/popper-base.min.js.map create mode 100644 web/_static/popperjs/popper-lite.js create mode 100644 web/_static/popperjs/popper-lite.js.map create mode 100644 web/_static/popperjs/popper-lite.min.js create mode 100644 web/_static/popperjs/popper-lite.min.js.flow create mode 100644 web/_static/popperjs/popper-lite.min.js.map create mode 100644 web/_static/popperjs/popper.js create mode 100644 web/_static/popperjs/popper.js.map create mode 100644 web/_static/popperjs/popper.min.js create mode 100644 web/_static/popperjs/popper.min.js.flow create mode 100644 web/_static/popperjs/popper.min.js.map (limited to 'web/_static/popperjs') diff --git a/web/_static/popperjs/popper-base.js b/web/_static/popperjs/popper-base.js new file mode 100644 index 0000000..ef2c8de --- /dev/null +++ b/web/_static/popperjs/popper-base.js @@ -0,0 +1,1157 @@ +UNPKG - @popperjs/core

UNPKG

38.6 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5(function (global, factory) { +
6 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +
7 typeof define === 'function' && define.amd ? define(['exports'], factory) : +
8 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {})); +
9}(this, (function (exports) { 'use strict'; +
10 +
11 function getWindow(node) { +
12 if (node == null) { +
13 return window; +
14 } +
15 +
16 if (node.toString() !== '[object Window]') { +
17 var ownerDocument = node.ownerDocument; +
18 return ownerDocument ? ownerDocument.defaultView || window : window; +
19 } +
20 +
21 return node; +
22 } +
23 +
24 function isElement(node) { +
25 var OwnElement = getWindow(node).Element; +
26 return node instanceof OwnElement || node instanceof Element; +
27 } +
28 +
29 function isHTMLElement(node) { +
30 var OwnElement = getWindow(node).HTMLElement; +
31 return node instanceof OwnElement || node instanceof HTMLElement; +
32 } +
33 +
34 function isShadowRoot(node) { +
35 // IE 11 has no ShadowRoot +
36 if (typeof ShadowRoot === 'undefined') { +
37 return false; +
38 } +
39 +
40 var OwnElement = getWindow(node).ShadowRoot; +
41 return node instanceof OwnElement || node instanceof ShadowRoot; +
42 } +
43 +
44 var max = Math.max; +
45 var min = Math.min; +
46 var round = Math.round; +
47 +
48 function getBoundingClientRect(element, includeScale) { +
49 if (includeScale === void 0) { +
50 includeScale = false; +
51 } +
52 +
53 var rect = element.getBoundingClientRect(); +
54 var scaleX = 1; +
55 var scaleY = 1; +
56 +
57 if (isHTMLElement(element) && includeScale) { +
58 var offsetHeight = element.offsetHeight; +
59 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale +
60 // Fallback to 1 in case both values are `0` +
61 +
62 if (offsetWidth > 0) { +
63 scaleX = round(rect.width) / offsetWidth || 1; +
64 } +
65 +
66 if (offsetHeight > 0) { +
67 scaleY = round(rect.height) / offsetHeight || 1; +
68 } +
69 } +
70 +
71 return { +
72 width: rect.width / scaleX, +
73 height: rect.height / scaleY, +
74 top: rect.top / scaleY, +
75 right: rect.right / scaleX, +
76 bottom: rect.bottom / scaleY, +
77 left: rect.left / scaleX, +
78 x: rect.left / scaleX, +
79 y: rect.top / scaleY +
80 }; +
81 } +
82 +
83 function getWindowScroll(node) { +
84 var win = getWindow(node); +
85 var scrollLeft = win.pageXOffset; +
86 var scrollTop = win.pageYOffset; +
87 return { +
88 scrollLeft: scrollLeft, +
89 scrollTop: scrollTop +
90 }; +
91 } +
92 +
93 function getHTMLElementScroll(element) { +
94 return { +
95 scrollLeft: element.scrollLeft, +
96 scrollTop: element.scrollTop +
97 }; +
98 } +
99 +
100 function getNodeScroll(node) { +
101 if (node === getWindow(node) || !isHTMLElement(node)) { +
102 return getWindowScroll(node); +
103 } else { +
104 return getHTMLElementScroll(node); +
105 } +
106 } +
107 +
108 function getNodeName(element) { +
109 return element ? (element.nodeName || '').toLowerCase() : null; +
110 } +
111 +
112 function getDocumentElement(element) { +
113 // $FlowFixMe[incompatible-return]: assume body is always available +
114 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] +
115 element.document) || window.document).documentElement; +
116 } +
117 +
118 function getWindowScrollBarX(element) { +
119 // If <html> has a CSS width greater than the viewport, then this will be +
120 // incorrect for RTL. +
121 // Popper 1 is broken in this case and never had a bug report so let's assume +
122 // it's not an issue. I don't think anyone ever specifies width on <html> +
123 // anyway. +
124 // Browsers where the left scrollbar doesn't cause an issue report `0` for +
125 // this (e.g. Edge 2019, IE11, Safari) +
126 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +
127 } +
128 +
129 function getComputedStyle(element) { +
130 return getWindow(element).getComputedStyle(element); +
131 } +
132 +
133 function isScrollParent(element) { +
134 // Firefox wants us to check `-x` and `-y` variations as well +
135 var _getComputedStyle = getComputedStyle(element), +
136 overflow = _getComputedStyle.overflow, +
137 overflowX = _getComputedStyle.overflowX, +
138 overflowY = _getComputedStyle.overflowY; +
139 +
140 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +
141 } +
142 +
143 function isElementScaled(element) { +
144 var rect = element.getBoundingClientRect(); +
145 var scaleX = round(rect.width) / element.offsetWidth || 1; +
146 var scaleY = round(rect.height) / element.offsetHeight || 1; +
147 return scaleX !== 1 || scaleY !== 1; +
148 } // Returns the composite rect of an element relative to its offsetParent. +
149 // Composite means it takes into account transforms as well as layout. +
150 +
151 +
152 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { +
153 if (isFixed === void 0) { +
154 isFixed = false; +
155 } +
156 +
157 var isOffsetParentAnElement = isHTMLElement(offsetParent); +
158 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); +
159 var documentElement = getDocumentElement(offsetParent); +
160 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); +
161 var scroll = { +
162 scrollLeft: 0, +
163 scrollTop: 0 +
164 }; +
165 var offsets = { +
166 x: 0, +
167 y: 0 +
168 }; +
169 +
170 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { +
171 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 +
172 isScrollParent(documentElement)) { +
173 scroll = getNodeScroll(offsetParent); +
174 } +
175 +
176 if (isHTMLElement(offsetParent)) { +
177 offsets = getBoundingClientRect(offsetParent, true); +
178 offsets.x += offsetParent.clientLeft; +
179 offsets.y += offsetParent.clientTop; +
180 } else if (documentElement) { +
181 offsets.x = getWindowScrollBarX(documentElement); +
182 } +
183 } +
184 +
185 return { +
186 x: rect.left + scroll.scrollLeft - offsets.x, +
187 y: rect.top + scroll.scrollTop - offsets.y, +
188 width: rect.width, +
189 height: rect.height +
190 }; +
191 } +
192 +
193 // means it doesn't take into account transforms. +
194 +
195 function getLayoutRect(element) { +
196 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. +
197 // Fixes https://github.com/popperjs/popper-core/issues/1223 +
198 +
199 var width = element.offsetWidth; +
200 var height = element.offsetHeight; +
201 +
202 if (Math.abs(clientRect.width - width) <= 1) { +
203 width = clientRect.width; +
204 } +
205 +
206 if (Math.abs(clientRect.height - height) <= 1) { +
207 height = clientRect.height; +
208 } +
209 +
210 return { +
211 x: element.offsetLeft, +
212 y: element.offsetTop, +
213 width: width, +
214 height: height +
215 }; +
216 } +
217 +
218 function getParentNode(element) { +
219 if (getNodeName(element) === 'html') { +
220 return element; +
221 } +
222 +
223 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle +
224 // $FlowFixMe[incompatible-return] +
225 // $FlowFixMe[prop-missing] +
226 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node +
227 element.parentNode || ( // DOM Element detected +
228 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected +
229 // $FlowFixMe[incompatible-call]: HTMLElement is a Node +
230 getDocumentElement(element) // fallback +
231 +
232 ); +
233 } +
234 +
235 function getScrollParent(node) { +
236 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { +
237 // $FlowFixMe[incompatible-return]: assume body is always available +
238 return node.ownerDocument.body; +
239 } +
240 +
241 if (isHTMLElement(node) && isScrollParent(node)) { +
242 return node; +
243 } +
244 +
245 return getScrollParent(getParentNode(node)); +
246 } +
247 +
248 /* +
249 given a DOM element, return the list of all scroll parents, up the list of ancesors +
250 until we get to the top window object. This list is what we attach scroll listeners +
251 to, because if any of these parent elements scroll, we'll need to re-calculate the +
252 reference element's position. +
253 */ +
254 +
255 function listScrollParents(element, list) { +
256 var _element$ownerDocumen; +
257 +
258 if (list === void 0) { +
259 list = []; +
260 } +
261 +
262 var scrollParent = getScrollParent(element); +
263 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); +
264 var win = getWindow(scrollParent); +
265 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; +
266 var updatedList = list.concat(target); +
267 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here +
268 updatedList.concat(listScrollParents(getParentNode(target))); +
269 } +
270 +
271 function isTableElement(element) { +
272 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +
273 } +
274 +
275 function getTrueOffsetParent(element) { +
276 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 +
277 getComputedStyle(element).position === 'fixed') { +
278 return null; +
279 } +
280 +
281 return element.offsetParent; +
282 } // `.offsetParent` reports `null` for fixed elements, while absolute elements +
283 // return the containing block +
284 +
285 +
286 function getContainingBlock(element) { +
287 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; +
288 var isIE = navigator.userAgent.indexOf('Trident') !== -1; +
289 +
290 if (isIE && isHTMLElement(element)) { +
291 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport +
292 var elementCss = getComputedStyle(element); +
293 +
294 if (elementCss.position === 'fixed') { +
295 return null; +
296 } +
297 } +
298 +
299 var currentNode = getParentNode(element); +
300 +
301 if (isShadowRoot(currentNode)) { +
302 currentNode = currentNode.host; +
303 } +
304 +
305 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { +
306 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that +
307 // create a containing block. +
308 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block +
309 +
310 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { +
311 return currentNode; +
312 } else { +
313 currentNode = currentNode.parentNode; +
314 } +
315 } +
316 +
317 return null; +
318 } // Gets the closest ancestor positioned element. Handles some edge cases, +
319 // such as table ancestors and cross browser bugs. +
320 +
321 +
322 function getOffsetParent(element) { +
323 var window = getWindow(element); +
324 var offsetParent = getTrueOffsetParent(element); +
325 +
326 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { +
327 offsetParent = getTrueOffsetParent(offsetParent); +
328 } +
329 +
330 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { +
331 return window; +
332 } +
333 +
334 return offsetParent || getContainingBlock(element) || window; +
335 } +
336 +
337 var top = 'top'; +
338 var bottom = 'bottom'; +
339 var right = 'right'; +
340 var left = 'left'; +
341 var auto = 'auto'; +
342 var basePlacements = [top, bottom, right, left]; +
343 var start = 'start'; +
344 var end = 'end'; +
345 var clippingParents = 'clippingParents'; +
346 var viewport = 'viewport'; +
347 var popper = 'popper'; +
348 var reference = 'reference'; +
349 +
350 var beforeRead = 'beforeRead'; +
351 var read = 'read'; +
352 var afterRead = 'afterRead'; // pure-logic modifiers +
353 +
354 var beforeMain = 'beforeMain'; +
355 var main = 'main'; +
356 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) +
357 +
358 var beforeWrite = 'beforeWrite'; +
359 var write = 'write'; +
360 var afterWrite = 'afterWrite'; +
361 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +
362 +
363 function order(modifiers) { +
364 var map = new Map(); +
365 var visited = new Set(); +
366 var result = []; +
367 modifiers.forEach(function (modifier) { +
368 map.set(modifier.name, modifier); +
369 }); // On visiting object, check for its dependencies and visit them recursively +
370 +
371 function sort(modifier) { +
372 visited.add(modifier.name); +
373 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); +
374 requires.forEach(function (dep) { +
375 if (!visited.has(dep)) { +
376 var depModifier = map.get(dep); +
377 +
378 if (depModifier) { +
379 sort(depModifier); +
380 } +
381 } +
382 }); +
383 result.push(modifier); +
384 } +
385 +
386 modifiers.forEach(function (modifier) { +
387 if (!visited.has(modifier.name)) { +
388 // check for visited object +
389 sort(modifier); +
390 } +
391 }); +
392 return result; +
393 } +
394 +
395 function orderModifiers(modifiers) { +
396 // order based on dependencies +
397 var orderedModifiers = order(modifiers); // order based on phase +
398 +
399 return modifierPhases.reduce(function (acc, phase) { +
400 return acc.concat(orderedModifiers.filter(function (modifier) { +
401 return modifier.phase === phase; +
402 })); +
403 }, []); +
404 } +
405 +
406 function debounce(fn) { +
407 var pending; +
408 return function () { +
409 if (!pending) { +
410 pending = new Promise(function (resolve) { +
411 Promise.resolve().then(function () { +
412 pending = undefined; +
413 resolve(fn()); +
414 }); +
415 }); +
416 } +
417 +
418 return pending; +
419 }; +
420 } +
421 +
422 function format(str) { +
423 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { +
424 args[_key - 1] = arguments[_key]; +
425 } +
426 +
427 return [].concat(args).reduce(function (p, c) { +
428 return p.replace(/%s/, c); +
429 }, str); +
430 } +
431 +
432 var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; +
433 var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; +
434 var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; +
435 function validateModifiers(modifiers) { +
436 modifiers.forEach(function (modifier) { +
437 [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)` +
438 .filter(function (value, index, self) { +
439 return self.indexOf(value) === index; +
440 }).forEach(function (key) { +
441 switch (key) { +
442 case 'name': +
443 if (typeof modifier.name !== 'string') { +
444 console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); +
445 } +
446 +
447 break; +
448 +
449 case 'enabled': +
450 if (typeof modifier.enabled !== 'boolean') { +
451 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); +
452 } +
453 +
454 break; +
455 +
456 case 'phase': +
457 if (modifierPhases.indexOf(modifier.phase) < 0) { +
458 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); +
459 } +
460 +
461 break; +
462 +
463 case 'fn': +
464 if (typeof modifier.fn !== 'function') { +
465 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); +
466 } +
467 +
468 break; +
469 +
470 case 'effect': +
471 if (modifier.effect != null && typeof modifier.effect !== 'function') { +
472 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); +
473 } +
474 +
475 break; +
476 +
477 case 'requires': +
478 if (modifier.requires != null && !Array.isArray(modifier.requires)) { +
479 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); +
480 } +
481 +
482 break; +
483 +
484 case 'requiresIfExists': +
485 if (!Array.isArray(modifier.requiresIfExists)) { +
486 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); +
487 } +
488 +
489 break; +
490 +
491 case 'options': +
492 case 'data': +
493 break; +
494 +
495 default: +
496 console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { +
497 return "\"" + s + "\""; +
498 }).join(', ') + "; but \"" + key + "\" was provided."); +
499 } +
500 +
501 modifier.requires && modifier.requires.forEach(function (requirement) { +
502 if (modifiers.find(function (mod) { +
503 return mod.name === requirement; +
504 }) == null) { +
505 console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); +
506 } +
507 }); +
508 }); +
509 }); +
510 } +
511 +
512 function uniqueBy(arr, fn) { +
513 var identifiers = new Set(); +
514 return arr.filter(function (item) { +
515 var identifier = fn(item); +
516 +
517 if (!identifiers.has(identifier)) { +
518 identifiers.add(identifier); +
519 return true; +
520 } +
521 }); +
522 } +
523 +
524 function getBasePlacement(placement) { +
525 return placement.split('-')[0]; +
526 } +
527 +
528 function mergeByName(modifiers) { +
529 var merged = modifiers.reduce(function (merged, current) { +
530 var existing = merged[current.name]; +
531 merged[current.name] = existing ? Object.assign({}, existing, current, { +
532 options: Object.assign({}, existing.options, current.options), +
533 data: Object.assign({}, existing.data, current.data) +
534 }) : current; +
535 return merged; +
536 }, {}); // IE11 does not support Object.values +
537 +
538 return Object.keys(merged).map(function (key) { +
539 return merged[key]; +
540 }); +
541 } +
542 +
543 function getViewportRect(element) { +
544 var win = getWindow(element); +
545 var html = getDocumentElement(element); +
546 var visualViewport = win.visualViewport; +
547 var width = html.clientWidth; +
548 var height = html.clientHeight; +
549 var x = 0; +
550 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper +
551 // can be obscured underneath it. +
552 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even +
553 // if it isn't open, so if this isn't available, the popper will be detected +
554 // to overflow the bottom of the screen too early. +
555 +
556 if (visualViewport) { +
557 width = visualViewport.width; +
558 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) +
559 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding +
560 // errors due to floating point numbers, so we need to check precision. +
561 // Safari returns a number <= 0, usually < -1 when pinch-zoomed +
562 // Feature detection fails in mobile emulation mode in Chrome. +
563 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < +
564 // 0.001 +
565 // Fallback here: "Not Safari" userAgent +
566 +
567 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { +
568 x = visualViewport.offsetLeft; +
569 y = visualViewport.offsetTop; +
570 } +
571 } +
572 +
573 return { +
574 width: width, +
575 height: height, +
576 x: x + getWindowScrollBarX(element), +
577 y: y +
578 }; +
579 } +
580 +
581 // of the `<html>` and `<body>` rect bounds if horizontally scrollable +
582 +
583 function getDocumentRect(element) { +
584 var _element$ownerDocumen; +
585 +
586 var html = getDocumentElement(element); +
587 var winScroll = getWindowScroll(element); +
588 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; +
589 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); +
590 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); +
591 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); +
592 var y = -winScroll.scrollTop; +
593 +
594 if (getComputedStyle(body || html).direction === 'rtl') { +
595 x += max(html.clientWidth, body ? body.clientWidth : 0) - width; +
596 } +
597 +
598 return { +
599 width: width, +
600 height: height, +
601 x: x, +
602 y: y +
603 }; +
604 } +
605 +
606 function contains(parent, child) { +
607 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method +
608 +
609 if (parent.contains(child)) { +
610 return true; +
611 } // then fallback to custom implementation with Shadow DOM support +
612 else if (rootNode && isShadowRoot(rootNode)) { +
613 var next = child; +
614 +
615 do { +
616 if (next && parent.isSameNode(next)) { +
617 return true; +
618 } // $FlowFixMe[prop-missing]: need a better way to handle this... +
619 +
620 +
621 next = next.parentNode || next.host; +
622 } while (next); +
623 } // Give up, the result is false +
624 +
625 +
626 return false; +
627 } +
628 +
629 function rectToClientRect(rect) { +
630 return Object.assign({}, rect, { +
631 left: rect.x, +
632 top: rect.y, +
633 right: rect.x + rect.width, +
634 bottom: rect.y + rect.height +
635 }); +
636 } +
637 +
638 function getInnerBoundingClientRect(element) { +
639 var rect = getBoundingClientRect(element); +
640 rect.top = rect.top + element.clientTop; +
641 rect.left = rect.left + element.clientLeft; +
642 rect.bottom = rect.top + element.clientHeight; +
643 rect.right = rect.left + element.clientWidth; +
644 rect.width = element.clientWidth; +
645 rect.height = element.clientHeight; +
646 rect.x = rect.left; +
647 rect.y = rect.top; +
648 return rect; +
649 } +
650 +
651 function getClientRectFromMixedType(element, clippingParent) { +
652 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +
653 } // A "clipping parent" is an overflowable container with the characteristic of +
654 // clipping (or hiding) overflowing elements with a position different from +
655 // `initial` +
656 +
657 +
658 function getClippingParents(element) { +
659 var clippingParents = listScrollParents(getParentNode(element)); +
660 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; +
661 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; +
662 +
663 if (!isElement(clipperElement)) { +
664 return []; +
665 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 +
666 +
667 +
668 return clippingParents.filter(function (clippingParent) { +
669 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; +
670 }); +
671 } // Gets the maximum area that the element is visible in due to any number of +
672 // clipping parents +
673 +
674 +
675 function getClippingRect(element, boundary, rootBoundary) { +
676 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); +
677 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); +
678 var firstClippingParent = clippingParents[0]; +
679 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { +
680 var rect = getClientRectFromMixedType(element, clippingParent); +
681 accRect.top = max(rect.top, accRect.top); +
682 accRect.right = min(rect.right, accRect.right); +
683 accRect.bottom = min(rect.bottom, accRect.bottom); +
684 accRect.left = max(rect.left, accRect.left); +
685 return accRect; +
686 }, getClientRectFromMixedType(element, firstClippingParent)); +
687 clippingRect.width = clippingRect.right - clippingRect.left; +
688 clippingRect.height = clippingRect.bottom - clippingRect.top; +
689 clippingRect.x = clippingRect.left; +
690 clippingRect.y = clippingRect.top; +
691 return clippingRect; +
692 } +
693 +
694 function getVariation(placement) { +
695 return placement.split('-')[1]; +
696 } +
697 +
698 function getMainAxisFromPlacement(placement) { +
699 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +
700 } +
701 +
702 function computeOffsets(_ref) { +
703 var reference = _ref.reference, +
704 element = _ref.element, +
705 placement = _ref.placement; +
706 var basePlacement = placement ? getBasePlacement(placement) : null; +
707 var variation = placement ? getVariation(placement) : null; +
708 var commonX = reference.x + reference.width / 2 - element.width / 2; +
709 var commonY = reference.y + reference.height / 2 - element.height / 2; +
710 var offsets; +
711 +
712 switch (basePlacement) { +
713 case top: +
714 offsets = { +
715 x: commonX, +
716 y: reference.y - element.height +
717 }; +
718 break; +
719 +
720 case bottom: +
721 offsets = { +
722 x: commonX, +
723 y: reference.y + reference.height +
724 }; +
725 break; +
726 +
727 case right: +
728 offsets = { +
729 x: reference.x + reference.width, +
730 y: commonY +
731 }; +
732 break; +
733 +
734 case left: +
735 offsets = { +
736 x: reference.x - element.width, +
737 y: commonY +
738 }; +
739 break; +
740 +
741 default: +
742 offsets = { +
743 x: reference.x, +
744 y: reference.y +
745 }; +
746 } +
747 +
748 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; +
749 +
750 if (mainAxis != null) { +
751 var len = mainAxis === 'y' ? 'height' : 'width'; +
752 +
753 switch (variation) { +
754 case start: +
755 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); +
756 break; +
757 +
758 case end: +
759 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); +
760 break; +
761 } +
762 } +
763 +
764 return offsets; +
765 } +
766 +
767 function getFreshSideObject() { +
768 return { +
769 top: 0, +
770 right: 0, +
771 bottom: 0, +
772 left: 0 +
773 }; +
774 } +
775 +
776 function mergePaddingObject(paddingObject) { +
777 return Object.assign({}, getFreshSideObject(), paddingObject); +
778 } +
779 +
780 function expandToHashMap(value, keys) { +
781 return keys.reduce(function (hashMap, key) { +
782 hashMap[key] = value; +
783 return hashMap; +
784 }, {}); +
785 } +
786 +
787 function detectOverflow(state, options) { +
788 if (options === void 0) { +
789 options = {}; +
790 } +
791 +
792 var _options = options, +
793 _options$placement = _options.placement, +
794 placement = _options$placement === void 0 ? state.placement : _options$placement, +
795 _options$boundary = _options.boundary, +
796 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, +
797 _options$rootBoundary = _options.rootBoundary, +
798 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, +
799 _options$elementConte = _options.elementContext, +
800 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, +
801 _options$altBoundary = _options.altBoundary, +
802 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, +
803 _options$padding = _options.padding, +
804 padding = _options$padding === void 0 ? 0 : _options$padding; +
805 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +
806 var altContext = elementContext === popper ? reference : popper; +
807 var popperRect = state.rects.popper; +
808 var element = state.elements[altBoundary ? altContext : elementContext]; +
809 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); +
810 var referenceClientRect = getBoundingClientRect(state.elements.reference); +
811 var popperOffsets = computeOffsets({ +
812 reference: referenceClientRect, +
813 element: popperRect, +
814 strategy: 'absolute', +
815 placement: placement +
816 }); +
817 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); +
818 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect +
819 // 0 or negative = within the clipping rect +
820 +
821 var overflowOffsets = { +
822 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, +
823 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, +
824 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, +
825 right: elementClientRect.right - clippingClientRect.right + paddingObject.right +
826 }; +
827 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element +
828 +
829 if (elementContext === popper && offsetData) { +
830 var offset = offsetData[placement]; +
831 Object.keys(overflowOffsets).forEach(function (key) { +
832 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; +
833 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; +
834 overflowOffsets[key] += offset[axis] * multiply; +
835 }); +
836 } +
837 +
838 return overflowOffsets; +
839 } +
840 +
841 var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +
842 var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +
843 var DEFAULT_OPTIONS = { +
844 placement: 'bottom', +
845 modifiers: [], +
846 strategy: 'absolute' +
847 }; +
848 +
849 function areValidElements() { +
850 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { +
851 args[_key] = arguments[_key]; +
852 } +
853 +
854 return !args.some(function (element) { +
855 return !(element && typeof element.getBoundingClientRect === 'function'); +
856 }); +
857 } +
858 +
859 function popperGenerator(generatorOptions) { +
860 if (generatorOptions === void 0) { +
861 generatorOptions = {}; +
862 } +
863 +
864 var _generatorOptions = generatorOptions, +
865 _generatorOptions$def = _generatorOptions.defaultModifiers, +
866 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, +
867 _generatorOptions$def2 = _generatorOptions.defaultOptions, +
868 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; +
869 return function createPopper(reference, popper, options) { +
870 if (options === void 0) { +
871 options = defaultOptions; +
872 } +
873 +
874 var state = { +
875 placement: 'bottom', +
876 orderedModifiers: [], +
877 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), +
878 modifiersData: {}, +
879 elements: { +
880 reference: reference, +
881 popper: popper +
882 }, +
883 attributes: {}, +
884 styles: {} +
885 }; +
886 var effectCleanupFns = []; +
887 var isDestroyed = false; +
888 var instance = { +
889 state: state, +
890 setOptions: function setOptions(setOptionsAction) { +
891 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; +
892 cleanupModifierEffects(); +
893 state.options = Object.assign({}, defaultOptions, state.options, options); +
894 state.scrollParents = { +
895 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], +
896 popper: listScrollParents(popper) +
897 }; // Orders the modifiers based on their dependencies and `phase` +
898 // properties +
899 +
900 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers +
901 +
902 state.orderedModifiers = orderedModifiers.filter(function (m) { +
903 return m.enabled; +
904 }); // Validate the provided modifiers so that the consumer will get warned +
905 // if one of the modifiers is invalid for any reason +
906 +
907 { +
908 var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { +
909 var name = _ref.name; +
910 return name; +
911 }); +
912 validateModifiers(modifiers); +
913 +
914 if (getBasePlacement(state.options.placement) === auto) { +
915 var flipModifier = state.orderedModifiers.find(function (_ref2) { +
916 var name = _ref2.name; +
917 return name === 'flip'; +
918 }); +
919 +
920 if (!flipModifier) { +
921 console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); +
922 } +
923 } +
924 +
925 var _getComputedStyle = getComputedStyle(popper), +
926 marginTop = _getComputedStyle.marginTop, +
927 marginRight = _getComputedStyle.marginRight, +
928 marginBottom = _getComputedStyle.marginBottom, +
929 marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can +
930 // cause bugs with positioning, so we'll warn the consumer +
931 +
932 +
933 if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { +
934 return parseFloat(margin); +
935 })) { +
936 console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); +
937 } +
938 } +
939 +
940 runModifierEffects(); +
941 return instance.update(); +
942 }, +
943 // Sync update – it will always be executed, even if not necessary. This +
944 // is useful for low frequency updates where sync behavior simplifies the +
945 // logic. +
946 // For high frequency updates (e.g. `resize` and `scroll` events), always +
947 // prefer the async Popper#update method +
948 forceUpdate: function forceUpdate() { +
949 if (isDestroyed) { +
950 return; +
951 } +
952 +
953 var _state$elements = state.elements, +
954 reference = _state$elements.reference, +
955 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements +
956 // anymore +
957 +
958 if (!areValidElements(reference, popper)) { +
959 { +
960 console.error(INVALID_ELEMENT_ERROR); +
961 } +
962 +
963 return; +
964 } // Store the reference and popper rects to be read by modifiers +
965 +
966 +
967 state.rects = { +
968 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), +
969 popper: getLayoutRect(popper) +
970 }; // Modifiers have the ability to reset the current update cycle. The +
971 // most common use case for this is the `flip` modifier changing the +
972 // placement, which then needs to re-run all the modifiers, because the +
973 // logic was previously ran for the previous placement and is therefore +
974 // stale/incorrect +
975 +
976 state.reset = false; +
977 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier +
978 // is filled with the initial data specified by the modifier. This means +
979 // it doesn't persist and is fresh on each update. +
980 // To ensure persistent data, use `${name}#persistent` +
981 +
982 state.orderedModifiers.forEach(function (modifier) { +
983 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); +
984 }); +
985 var __debug_loops__ = 0; +
986 +
987 for (var index = 0; index < state.orderedModifiers.length; index++) { +
988 { +
989 __debug_loops__ += 1; +
990 +
991 if (__debug_loops__ > 100) { +
992 console.error(INFINITE_LOOP_ERROR); +
993 break; +
994 } +
995 } +
996 +
997 if (state.reset === true) { +
998 state.reset = false; +
999 index = -1; +
1000 continue; +
1001 } +
1002 +
1003 var _state$orderedModifie = state.orderedModifiers[index], +
1004 fn = _state$orderedModifie.fn, +
1005 _state$orderedModifie2 = _state$orderedModifie.options, +
1006 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, +
1007 name = _state$orderedModifie.name; +
1008 +
1009 if (typeof fn === 'function') { +
1010 state = fn({ +
1011 state: state, +
1012 options: _options, +
1013 name: name, +
1014 instance: instance +
1015 }) || state; +
1016 } +
1017 } +
1018 }, +
1019 // Async and optimistically optimized update – it will not be executed if +
1020 // not necessary (debounced to run at most once-per-tick) +
1021 update: debounce(function () { +
1022 return new Promise(function (resolve) { +
1023 instance.forceUpdate(); +
1024 resolve(state); +
1025 }); +
1026 }), +
1027 destroy: function destroy() { +
1028 cleanupModifierEffects(); +
1029 isDestroyed = true; +
1030 } +
1031 }; +
1032 +
1033 if (!areValidElements(reference, popper)) { +
1034 { +
1035 console.error(INVALID_ELEMENT_ERROR); +
1036 } +
1037 +
1038 return instance; +
1039 } +
1040 +
1041 instance.setOptions(options).then(function (state) { +
1042 if (!isDestroyed && options.onFirstUpdate) { +
1043 options.onFirstUpdate(state); +
1044 } +
1045 }); // Modifiers have the ability to execute arbitrary code before the first +
1046 // update cycle runs. They will be executed in the same order as the update +
1047 // cycle. This is useful when a modifier adds some persistent data that +
1048 // other modifiers need to use, but the modifier is run after the dependent +
1049 // one. +
1050 +
1051 function runModifierEffects() { +
1052 state.orderedModifiers.forEach(function (_ref3) { +
1053 var name = _ref3.name, +
1054 _ref3$options = _ref3.options, +
1055 options = _ref3$options === void 0 ? {} : _ref3$options, +
1056 effect = _ref3.effect; +
1057 +
1058 if (typeof effect === 'function') { +
1059 var cleanupFn = effect({ +
1060 state: state, +
1061 name: name, +
1062 instance: instance, +
1063 options: options +
1064 }); +
1065 +
1066 var noopFn = function noopFn() {}; +
1067 +
1068 effectCleanupFns.push(cleanupFn || noopFn); +
1069 } +
1070 }); +
1071 } +
1072 +
1073 function cleanupModifierEffects() { +
1074 effectCleanupFns.forEach(function (fn) { +
1075 return fn(); +
1076 }); +
1077 effectCleanupFns = []; +
1078 } +
1079 +
1080 return instance; +
1081 }; +
1082 } +
1083 var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules +
1084 +
1085 exports.createPopper = createPopper; +
1086 exports.detectOverflow = detectOverflow; +
1087 exports.popperGenerator = popperGenerator; +
1088 +
1089 Object.defineProperty(exports, '__esModule', { value: true }); +
1090 +
1091}))); +
1092//# sourceMappingURL=popper-base.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-base.js.map b/web/_static/popperjs/popper-base.js.map new file mode 100644 index 0000000..8b16a9e --- /dev/null +++ b/web/_static/popperjs/popper-base.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

85.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper-base.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getNodeScroll.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/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/format.js","../../src/utils/validateModifiers.js","../../src/utils/uniqueBy.js","../../src/utils/getBasePlacement.js","../../src/utils/mergeByName.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/getFreshSideObject.js","../../src/utils/mergePaddingObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\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\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 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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\n\nexport default function format(str: string, ...args: Array<string>) {\n return [...args].reduce((p, c) => p.replace(/%s/, c), str);\n}\n","// @flow\nimport format from './format';\nimport { modifierPhases } from '../enums';\n\nconst INVALID_MODIFIER_ERROR =\n 'Popper: modifier \"%s\" provided an invalid %s property, expected %s but got %s';\nconst MISSING_DEPENDENCY_ERROR =\n 'Popper: modifier \"%s\" requires \"%s\", but \"%s\" modifier is not available';\nconst VALID_PROPERTIES = [\n 'name',\n 'enabled',\n 'phase',\n 'fn',\n 'effect',\n 'requires',\n 'options',\n];\n\nexport default function validateModifiers(modifiers: Array<any>): void {\n modifiers.forEach((modifier) => {\n [...Object.keys(modifier), ...VALID_PROPERTIES]\n // IE11-compatible replacement for `new Set(iterable)`\n .filter((value, index, self) => self.indexOf(value) === index)\n .forEach((key) => {\n switch (key) {\n case 'name':\n if (typeof modifier.name !== 'string') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n String(modifier.name),\n '\"name\"',\n '\"string\"',\n `\"${String(modifier.name)}\"`\n )\n );\n }\n break;\n case 'enabled':\n if (typeof modifier.enabled !== 'boolean') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"enabled\"',\n '\"boolean\"',\n `\"${String(modifier.enabled)}\"`\n )\n );\n }\n break;\n case 'phase':\n if (modifierPhases.indexOf(modifier.phase) < 0) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"phase\"',\n `either ${modifierPhases.join(', ')}`,\n `\"${String(modifier.phase)}\"`\n )\n );\n }\n break;\n case 'fn':\n if (typeof modifier.fn !== 'function') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"fn\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'effect':\n if (\n modifier.effect != null &&\n typeof modifier.effect !== 'function'\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"effect\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'requires':\n if (\n modifier.requires != null &&\n !Array.isArray(modifier.requires)\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requires\"',\n '\"array\"',\n `\"${String(modifier.requires)}\"`\n )\n );\n }\n break;\n case 'requiresIfExists':\n if (!Array.isArray(modifier.requiresIfExists)) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requiresIfExists\"',\n '\"array\"',\n `\"${String(modifier.requiresIfExists)}\"`\n )\n );\n }\n break;\n case 'options':\n case 'data':\n break;\n default:\n console.error(\n `PopperJS: an invalid property has been provided to the \"${\n modifier.name\n }\" modifier, valid properties are ${VALID_PROPERTIES.map(\n (s) => `\"${s}\"`\n ).join(', ')}; but \"${key}\" was provided.`\n );\n }\n\n modifier.requires &&\n modifier.requires.forEach((requirement) => {\n if (modifiers.find((mod) => mod.name === requirement) == null) {\n console.error(\n format(\n MISSING_DEPENDENCY_ERROR,\n String(modifier.name),\n requirement,\n requirement\n )\n );\n }\n });\n });\n });\n}\n","// @flow\n\nexport default function uniqueBy<T>(arr: Array<T>, fn: T => any): Array<T> {\n const identifiers = new Set();\n\n return arr.filter(item => {\n const identifier = fn(item);\n\n if (!identifiers.has(identifier)) {\n identifiers.add(identifier);\n return true;\n }\n });\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 { 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\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 { 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 );\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\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","// @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 { 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\nimport type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\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 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 {\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"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","OwnElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getHTMLElementScroll","getNodeScroll","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","isElementScaled","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","clientRect","abs","offsetLeft","offsetTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getContainingBlock","isFirefox","navigator","userAgent","isIE","elementCss","currentNode","css","transform","perspective","contain","willChange","filter","getOffsetParent","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","order","modifiers","map","Map","visited","Set","result","forEach","modifier","set","name","sort","add","requires","requiresIfExists","dep","has","depModifier","get","push","orderModifiers","orderedModifiers","reduce","acc","phase","debounce","fn","pending","Promise","resolve","then","undefined","format","str","args","p","c","replace","INVALID_MODIFIER_ERROR","MISSING_DEPENDENCY_ERROR","VALID_PROPERTIES","validateModifiers","Object","keys","value","index","self","key","console","error","String","enabled","join","effect","Array","isArray","s","requirement","find","mod","uniqueBy","arr","identifiers","item","identifier","getBasePlacement","placement","split","mergeByName","merged","current","existing","options","data","getViewportRect","html","clientWidth","clientHeight","getDocumentRect","winScroll","scrollWidth","scrollHeight","direction","contains","parent","child","rootNode","getRootNode","next","isSameNode","rectToClientRect","getInnerBoundingClientRect","getClientRectFromMixedType","clippingParent","getClippingParents","canEscapeClipping","clipperElement","getClippingRect","boundary","rootBoundary","mainClippingParents","firstClippingParent","clippingRect","accRect","getVariation","getMainAxisFromPlacement","computeOffsets","basePlacement","variation","commonX","commonY","mainAxis","len","getFreshSideObject","mergePaddingObject","paddingObject","expandToHashMap","hashMap","detectOverflow","state","elementContext","altBoundary","padding","altContext","popperRect","rects","elements","clippingClientRect","contextElement","referenceClientRect","popperOffsets","strategy","popperClientRect","elementClientRect","overflowOffsets","offsetData","modifiersData","offset","multiply","axis","INVALID_ELEMENT_ERROR","INFINITE_LOOP_ERROR","DEFAULT_OPTIONS","areValidElements","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","createPopper","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","m","flipModifier","marginTop","marginRight","marginBottom","marginLeft","margin","parseFloat","warn","runModifierEffects","update","forceUpdate","reset","__debug_loops__","length","destroy","onFirstUpdate","cleanupFn","noopFn"],"mappings":";;;;;;;;;;EAIe,SAASA,SAAT,CAAmBC,IAAnB,EAAyB;EACtC,MAAIA,IAAI,IAAI,IAAZ,EAAkB;EAChB,WAAOC,MAAP;EACD;;EAED,MAAID,IAAI,CAACE,QAAL,OAAoB,iBAAxB,EAA2C;EACzC,QAAMC,aAAa,GAAGH,IAAI,CAACG,aAA3B;EACA,WAAOA,aAAa,GAAGA,aAAa,CAACC,WAAd,IAA6BH,MAAhC,GAAyCA,MAA7D;EACD;;EAED,SAAOD,IAAP;EACD;;ECVD,SAASK,SAAT,CAAmBL,IAAnB,EAAyB;EACvB,MAAMM,UAAU,GAAGP,SAAS,CAACC,IAAD,CAAT,CAAgBO,OAAnC;EACA,SAAOP,IAAI,YAAYM,UAAhB,IAA8BN,IAAI,YAAYO,OAArD;EACD;;EAID,SAASC,aAAT,CAAuBR,IAAvB,EAA6B;EAC3B,MAAMM,UAAU,GAAGP,SAAS,CAACC,IAAD,CAAT,CAAgBS,WAAnC;EACA,SAAOT,IAAI,YAAYM,UAAhB,IAA8BN,IAAI,YAAYS,WAArD;EACD;;EAID,SAASC,YAAT,CAAsBV,IAAtB,EAA4B;EAC1B;EACA,MAAI,OAAOW,UAAP,KAAsB,WAA1B,EAAuC;EACrC,WAAO,KAAP;EACD;;EACD,MAAML,UAAU,GAAGP,SAAS,CAACC,IAAD,CAAT,CAAgBW,UAAnC;EACA,SAAOX,IAAI,YAAYM,UAAhB,IAA8BN,IAAI,YAAYW,UAArD;EACD;;ECzBM,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAjB;EACA,IAAME,GAAG,GAAGD,IAAI,CAACC,GAAjB;EACA,IAAMC,KAAK,GAAGF,IAAI,CAACE,KAAnB;;ECEQ,SAASC,qBAAT,CACbC,OADa,EAEbC,YAFa,EAGK;EAAA,MADlBA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OA,MAAP,KAAkB,UAAtB,EAAkC;EAChC,cAAM2H,SAAS,GAAG3H,MAAM,CAAC;EAAEkE,YAAAA,KAAK,EAALA,KAAF;EAAS7G,YAAAA,IAAI,EAAJA,IAAT;EAAegJ,YAAAA,QAAQ,EAARA,QAAf;EAAyBlF,YAAAA,OAAO,EAAPA;EAAzB,WAAD,CAAxB;;EACA,cAAMyG,MAAM,GAAG,SAATA,MAAS,GAAM,EAArB;;EACAzB,UAAAA,gBAAgB,CAACrI,IAAjB,CAAsB6J,SAAS,IAAIC,MAAnC;EACD;EACF,OAND;EAOD;;EAED,aAASpB,sBAAT,GAAkC;EAChCL,MAAAA,gBAAgB,CAACjJ,OAAjB,CAAyB,UAACmB,EAAD;EAAA,eAAQA,EAAE,EAAV;EAAA,OAAzB;EACA8H,MAAAA,gBAAgB,GAAG,EAAnB;EACD;;EAED,WAAOE,QAAP;EACD,GA7OD;EA8OD;MAEYL,YAAY,gBAAGJ,eAAe;;;;;;;;"}
\No newline at end of file

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-base.min.js b/web/_static/popperjs/popper-base.min.js new file mode 100644 index 0000000..6fd42cd --- /dev/null +++ b/web/_static/popperjs/popper-base.min.js @@ -0,0 +1,71 @@ +UNPKG - @popperjs/core

UNPKG

9.43 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5!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){"use strict";function e(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function n(t){return t instanceof e(t).Element||t instanceof Element}function o(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function r(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}var i=Math.max,f=Math.min,a=Math.round;function c(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(o(t)&&e){var f=t.offsetHeight,c=t.offsetWidth;c>0&&(r=a(n.width)/c||1),f>0&&(i=a(n.height)/f||1)}return{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 u(t){var n=e(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function s(t){return t?(t.nodeName||"").toLowerCase():null}function l(t){return((n(t)?t.ownerDocument:t.document)||window.document).documentElement}function d(t){return c(l(t)).left+u(t).scrollLeft}function h(t){return e(t).getComputedStyle(t)}function p(t){var e=h(t),n=e.overflow,o=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function m(t,n,r){void 0===r&&(r=!1);var i,f,h=o(n),m=o(n)&&function(t){var e=t.getBoundingClientRect(),n=a(e.width)/t.offsetWidth||1,o=a(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(n),g=l(n),v=c(t,m),b={scrollLeft:0,scrollTop:0},w={x:0,y:0};return(h||!h&&!r)&&(("body"!==s(n)||p(g))&&(b=(i=n)!==e(i)&&o(i)?{scrollLeft:(f=i).scrollLeft,scrollTop:f.scrollTop}:u(i)),o(n)?((w=c(n,!0)).x+=n.clientLeft,w.y+=n.clientTop):g&&(w.x=d(g))),{x:v.left+b.scrollLeft-w.x,y:v.top+b.scrollTop-w.y,width:v.width,height:v.height}}function g(t){return"html"===s(t)?t:t.assignedSlot||t.parentNode||(r(t)?t.host:null)||l(t)}function v(t){return["html","body","#document"].indexOf(s(t))>=0?t.ownerDocument.body:o(t)&&p(t)?t:v(g(t))}function b(t,n){var o;void 0===n&&(n=[]);var r=v(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),f=e(r),a=i?[f].concat(f.visualViewport||[],p(r)?r:[]):r,c=n.concat(a);return i?c:c.concat(b(g(a)))}function w(t){return["table","td","th"].indexOf(s(t))>=0}function y(t){return o(t)&&"fixed"!==h(t).position?t.offsetParent:null}function x(t){for(var n=e(t),i=y(t);i&&w(i)&&"static"===h(i).position;)i=y(i);return i&&("html"===s(i)||"body"===s(i)&&"static"===h(i).position)?n:i||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&o(t)&&"fixed"===h(t).position)return null;var n=g(t);for(r(n)&&(n=n.host);o(n)&&["html","body"].indexOf(s(n))<0;){var i=h(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||n}var O="top",M="bottom",E="right",L="left",T=[O,M,E,L],W="viewport",j="popper",H=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(t){var e=new Map,n=new Set,o=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&r(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),o}function R(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function C(t,o){return o===W?R(function(t){var n=e(t),o=l(t),r=n.visualViewport,i=o.clientWidth,f=o.clientHeight,a=0,c=0;return r&&(i=r.width,f=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,c=r.offsetTop)),{width:i,height:f,x:a+d(t),y:c}}(t)):n(o)?function(t){var e=c(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(o):R(function(t){var e,n=l(t),o=u(t),r=null==(e=t.ownerDocument)?void 0:e.body,f=i(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=i(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+d(t),s=-o.scrollTop;return"rtl"===h(r||n).direction&&(c+=i(n.clientWidth,r?r.clientWidth:0)-f),{width:f,height:a,x:c,y:s}}(l(t)))}function D(t){var e=b(g(t)),i=["absolute","fixed"].indexOf(h(t).position)>=0&&o(t)?x(t):t;return n(i)?e.filter((function(t){return n(t)&&function(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&r(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}(t,i)&&"body"!==s(t)})):[]}var S={placement:"bottom",modifiers:[],strategy:"absolute"};function k(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function N(t){void 0===t&&(t={});var e=t,o=e.defaultModifiers,r=void 0===o?[]:o,i=e.defaultOptions,f=void 0===i?S:i;return function(t,e,o){void 0===o&&(o=f);var i,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},S,f),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],l=!1,d={state:u,setOptions:function(o){var i="function"==typeof o?o(u.options):o;h(),u.options=Object.assign({},f,u.options,i),u.scrollParents={reference:n(t)?b(t):t.contextElement?b(t.contextElement):[],popper:b(e)};var a,c,l=function(t){var e=P(t);return H.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((a=[].concat(r,u.options.modifiers),c=a.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}),{}),Object.keys(c).map((function(t){return c[t]}))));return u.orderedModifiers=l.filter((function(t){return t.enabled})),u.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,o=void 0===n?{}:n,r=t.effect;if("function"==typeof r){var i=r({state:u,name:e,instance:d,options:o}),f=function(){};s.push(i||f)}})),d.update()},forceUpdate:function(){if(!l){var t=u.elements,e=t.reference,n=t.popper;if(k(e,n)){var o,r,i,f;u.rects={reference:m(e,x(n),"fixed"===u.options.strategy),popper:(o=n,r=c(o),i=o.offsetWidth,f=o.offsetHeight,Math.abs(r.width-i)<=1&&(i=r.width),Math.abs(r.height-f)<=1&&(f=r.height),{x:o.offsetLeft,y:o.offsetTop,width:i,height:f})},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(t){return u.modifiersData[t.name]=Object.assign({},t.data)}));for(var a=0;a<u.orderedModifiers.length;a++)if(!0!==u.reset){var s=u.orderedModifiers[a],h=s.fn,p=s.options,g=void 0===p?{}:p,v=s.name;"function"==typeof h&&(u=h({state:u,options:g,name:v,instance:d})||u)}else u.reset=!1,a=-1}}},update:(i=function(){return new Promise((function(t){d.forceUpdate(),t(u)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(i())}))}))),a}),destroy:function(){h(),l=!0}};if(!k(t,e))return d;function h(){s.forEach((function(t){return t()})),s=[]}return d.setOptions(o).then((function(t){!l&&o.onFirstUpdate&&o.onFirstUpdate(t)})),d}}var B=N();t.createPopper=B,t.detectOverflow=function(t,e){void 0===e&&(e={});var o,r=e,a=r.placement,u=void 0===a?t.placement:a,s=r.boundary,d=void 0===s?"clippingParents":s,h=r.rootBoundary,p=void 0===h?W:h,m=r.elementContext,g=void 0===m?j:m,v=r.altBoundary,b=void 0!==v&&v,w=r.padding,y=void 0===w?0:w,x=function(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}("number"!=typeof y?y:(o=y,T.reduce((function(t,e){return t[e]=o,t}),{}))),H=g===j?"reference":j,P=t.rects.popper,S=t.elements[b?H:g],k=function(t,e,n){var o="clippingParents"===e?D(t):[].concat(e),r=[].concat(o,[n]),a=r[0],c=r.reduce((function(e,n){var o=C(t,n);return e.top=i(o.top,e.top),e.right=f(o.right,e.right),e.bottom=f(o.bottom,e.bottom),e.left=i(o.left,e.left),e}),C(t,a));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}(n(S)?S:S.contextElement||l(t.elements.popper),d,p),N=c(t.elements.reference),B=function(t){var e,n=t.reference,o=t.element,r=t.placement,i=r?function(t){return t.split("-")[0]}(r):null,f=r?function(t){return t.split("-")[1]}(r):null,a=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case O:e={x:a,y:n.y-o.height};break;case M:e={x:a,y:n.y+n.height};break;case E:e={x:n.x+n.width,y:c};break;case L:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var u=i?function(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}(i):null;if(null!=u){var s="y"===u?"height":"width";switch(f){case"start":e[u]=e[u]-(n[s]/2-o[s]/2);break;case"end":e[u]=e[u]+(n[s]/2-o[s]/2)}}return e}({reference:N,element:P,strategy:"absolute",placement:u}),A=R(Object.assign({},P,B)),U=g===j?A:N,V={top:k.top-U.top+x.top,bottom:U.bottom-k.bottom+x.bottom,left:k.left-U.left+x.left,right:U.right-k.right+x.right},q=t.modifiersData.offset;if(g===j&&q){var F=q[u];Object.keys(V).forEach((function(t){var e=[E,M].indexOf(t)>=0?1:-1,n=[O,M].indexOf(t)>=0?"y":"x";V[t]+=F[n]*e}))}return V},t.popperGenerator=N,Object.defineProperty(t,"__esModule",{value:!0})})); +
6//# sourceMappingURL=popper-base.min.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-base.min.js.flow b/web/_static/popperjs/popper-base.min.js.flow new file mode 100644 index 0000000..f795bd9 --- /dev/null +++ b/web/_static/popperjs/popper-base.min.js.flow @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

51 BFlowView Raw

No preview available.

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-base.min.js.map b/web/_static/popperjs/popper-base.min.js.map new file mode 100644 index 0000000..f3343a4 --- /dev/null +++ b/web/_static/popperjs/popper-base.min.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

59.4 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper-base.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.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/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/createPopper.js","../../src/utils/debounce.js","../../src/utils/mergeByName.js","../../src/dom-utils/getLayoutRect.js","../../src/utils/detectOverflow.js","../../src/utils/expandToHashMap.js","../../src/utils/mergePaddingObject.js","../../src/utils/getFreshSideObject.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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 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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\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 );\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\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\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 { 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\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 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\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 type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\n };\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\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","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","scroll","offsets","clientLeft","clientTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","_element$ownerDocumen","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getOffsetParent","isFirefox","navigator","userAgent","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","basePlacements","viewport","popper","modifierPhases","order","modifiers","map","Map","visited","Set","result","sort","modifier","add","name","requires","requiresIfExists","forEach","dep","has","depModifier","get","push","set","rectToClientRect","getClientRectFromMixedType","clippingParent","html","clientWidth","clientHeight","offsetLeft","offsetTop","getViewportRect","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingParents","clippingParents","clipperElement","parent","child","rootNode","getRootNode","contains","next","isSameNode","DEFAULT_OPTIONS","placement","strategy","areValidElements","args","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","reference","options","fn","pending","state","orderedModifiers","modifiersData","elements","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","contextElement","merged","reduce","acc","phase","orderModifiers","current","existing","data","Object","keys","key","m","enabled","effect","cleanupFn","noopFn","update","forceUpdate","clientRect","rects","abs","reset","index","length","Promise","resolve","then","undefined","destroy","onFirstUpdate","createPopper","value","boundary","rootBoundary","elementContext","altBoundary","padding","paddingObject","mergePaddingObject","hashMap","altContext","popperRect","clippingClientRect","mainClippingParents","firstClippingParent","clippingRect","accRect","getClippingRect","referenceClientRect","popperOffsets","basePlacement","split","getBasePlacement","variation","getVariation","commonX","commonY","mainAxis","getMainAxisFromPlacement","len","computeOffsets","popperClientRect","elementClientRect","overflowOffsets","offsetData","offset","multiply","axis"],"mappings":";;;;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1K,EJde2K,CAAe,CACnC9E,UAAWkE,EACXzM,QAASkM,EACTnE,SAAU,WACVD,UAAAA,IAGIwF,EAAmBlH,mBACpB8F,EACAQ,IAGCa,EACJ5B,IAAmB7G,EAASwI,EAAmBb,EAI3Ce,EAAkB,CACtB/M,IAAK0L,EAAmB1L,IAAM8M,EAAkB9M,IAAMqL,EAAcrL,IACpEE,OACE4M,EAAkB5M,OAClBwL,EAAmBxL,OACnBmL,EAAcnL,OAChBC,KAAMuL,EAAmBvL,KAAO2M,EAAkB3M,KAAOkL,EAAclL,KACvEF,MACE6M,EAAkB7M,MAAQyL,EAAmBzL,MAAQoL,EAAcpL,OAGjE+M,EAAa9E,EAAME,cAAc6E,UAGnC/B,IAAmB7G,GAAU2I,EAAY,KACrCC,EAASD,EAAW3F,GAE1BmC,OAAOC,KAAKsD,GAAiB3H,SAAQ,SAACsE,OAC9BwD,EAAW,CAACjN,EAAOC,GAAQuC,QAAQiH,IAAQ,EAAI,GAAK,EACpDyD,EAAO,CAACnN,EAAKE,GAAQuC,QAAQiH,IAAQ,EAAI,IAAM,IACrDqD,EAAgBrD,IAAQuD,EAAOE,GAAQD,YAIpCH"}
\No newline at end of file

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-lite.js b/web/_static/popperjs/popper-lite.js new file mode 100644 index 0000000..274743e --- /dev/null +++ b/web/_static/popperjs/popper-lite.js @@ -0,0 +1,1490 @@ +UNPKG - @popperjs/core

UNPKG

49.6 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5(function (global, factory) { +
6 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +
7 typeof define === 'function' && define.amd ? define(['exports'], factory) : +
8 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {})); +
9}(this, (function (exports) { 'use strict'; +
10 +
11 function getWindow(node) { +
12 if (node == null) { +
13 return window; +
14 } +
15 +
16 if (node.toString() !== '[object Window]') { +
17 var ownerDocument = node.ownerDocument; +
18 return ownerDocument ? ownerDocument.defaultView || window : window; +
19 } +
20 +
21 return node; +
22 } +
23 +
24 function isElement(node) { +
25 var OwnElement = getWindow(node).Element; +
26 return node instanceof OwnElement || node instanceof Element; +
27 } +
28 +
29 function isHTMLElement(node) { +
30 var OwnElement = getWindow(node).HTMLElement; +
31 return node instanceof OwnElement || node instanceof HTMLElement; +
32 } +
33 +
34 function isShadowRoot(node) { +
35 // IE 11 has no ShadowRoot +
36 if (typeof ShadowRoot === 'undefined') { +
37 return false; +
38 } +
39 +
40 var OwnElement = getWindow(node).ShadowRoot; +
41 return node instanceof OwnElement || node instanceof ShadowRoot; +
42 } +
43 +
44 var max = Math.max; +
45 var min = Math.min; +
46 var round = Math.round; +
47 +
48 function getBoundingClientRect(element, includeScale) { +
49 if (includeScale === void 0) { +
50 includeScale = false; +
51 } +
52 +
53 var rect = element.getBoundingClientRect(); +
54 var scaleX = 1; +
55 var scaleY = 1; +
56 +
57 if (isHTMLElement(element) && includeScale) { +
58 var offsetHeight = element.offsetHeight; +
59 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale +
60 // Fallback to 1 in case both values are `0` +
61 +
62 if (offsetWidth > 0) { +
63 scaleX = round(rect.width) / offsetWidth || 1; +
64 } +
65 +
66 if (offsetHeight > 0) { +
67 scaleY = round(rect.height) / offsetHeight || 1; +
68 } +
69 } +
70 +
71 return { +
72 width: rect.width / scaleX, +
73 height: rect.height / scaleY, +
74 top: rect.top / scaleY, +
75 right: rect.right / scaleX, +
76 bottom: rect.bottom / scaleY, +
77 left: rect.left / scaleX, +
78 x: rect.left / scaleX, +
79 y: rect.top / scaleY +
80 }; +
81 } +
82 +
83 function getWindowScroll(node) { +
84 var win = getWindow(node); +
85 var scrollLeft = win.pageXOffset; +
86 var scrollTop = win.pageYOffset; +
87 return { +
88 scrollLeft: scrollLeft, +
89 scrollTop: scrollTop +
90 }; +
91 } +
92 +
93 function getHTMLElementScroll(element) { +
94 return { +
95 scrollLeft: element.scrollLeft, +
96 scrollTop: element.scrollTop +
97 }; +
98 } +
99 +
100 function getNodeScroll(node) { +
101 if (node === getWindow(node) || !isHTMLElement(node)) { +
102 return getWindowScroll(node); +
103 } else { +
104 return getHTMLElementScroll(node); +
105 } +
106 } +
107 +
108 function getNodeName(element) { +
109 return element ? (element.nodeName || '').toLowerCase() : null; +
110 } +
111 +
112 function getDocumentElement(element) { +
113 // $FlowFixMe[incompatible-return]: assume body is always available +
114 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] +
115 element.document) || window.document).documentElement; +
116 } +
117 +
118 function getWindowScrollBarX(element) { +
119 // If <html> has a CSS width greater than the viewport, then this will be +
120 // incorrect for RTL. +
121 // Popper 1 is broken in this case and never had a bug report so let's assume +
122 // it's not an issue. I don't think anyone ever specifies width on <html> +
123 // anyway. +
124 // Browsers where the left scrollbar doesn't cause an issue report `0` for +
125 // this (e.g. Edge 2019, IE11, Safari) +
126 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +
127 } +
128 +
129 function getComputedStyle(element) { +
130 return getWindow(element).getComputedStyle(element); +
131 } +
132 +
133 function isScrollParent(element) { +
134 // Firefox wants us to check `-x` and `-y` variations as well +
135 var _getComputedStyle = getComputedStyle(element), +
136 overflow = _getComputedStyle.overflow, +
137 overflowX = _getComputedStyle.overflowX, +
138 overflowY = _getComputedStyle.overflowY; +
139 +
140 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +
141 } +
142 +
143 function isElementScaled(element) { +
144 var rect = element.getBoundingClientRect(); +
145 var scaleX = round(rect.width) / element.offsetWidth || 1; +
146 var scaleY = round(rect.height) / element.offsetHeight || 1; +
147 return scaleX !== 1 || scaleY !== 1; +
148 } // Returns the composite rect of an element relative to its offsetParent. +
149 // Composite means it takes into account transforms as well as layout. +
150 +
151 +
152 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { +
153 if (isFixed === void 0) { +
154 isFixed = false; +
155 } +
156 +
157 var isOffsetParentAnElement = isHTMLElement(offsetParent); +
158 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); +
159 var documentElement = getDocumentElement(offsetParent); +
160 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); +
161 var scroll = { +
162 scrollLeft: 0, +
163 scrollTop: 0 +
164 }; +
165 var offsets = { +
166 x: 0, +
167 y: 0 +
168 }; +
169 +
170 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { +
171 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 +
172 isScrollParent(documentElement)) { +
173 scroll = getNodeScroll(offsetParent); +
174 } +
175 +
176 if (isHTMLElement(offsetParent)) { +
177 offsets = getBoundingClientRect(offsetParent, true); +
178 offsets.x += offsetParent.clientLeft; +
179 offsets.y += offsetParent.clientTop; +
180 } else if (documentElement) { +
181 offsets.x = getWindowScrollBarX(documentElement); +
182 } +
183 } +
184 +
185 return { +
186 x: rect.left + scroll.scrollLeft - offsets.x, +
187 y: rect.top + scroll.scrollTop - offsets.y, +
188 width: rect.width, +
189 height: rect.height +
190 }; +
191 } +
192 +
193 // means it doesn't take into account transforms. +
194 +
195 function getLayoutRect(element) { +
196 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. +
197 // Fixes https://github.com/popperjs/popper-core/issues/1223 +
198 +
199 var width = element.offsetWidth; +
200 var height = element.offsetHeight; +
201 +
202 if (Math.abs(clientRect.width - width) <= 1) { +
203 width = clientRect.width; +
204 } +
205 +
206 if (Math.abs(clientRect.height - height) <= 1) { +
207 height = clientRect.height; +
208 } +
209 +
210 return { +
211 x: element.offsetLeft, +
212 y: element.offsetTop, +
213 width: width, +
214 height: height +
215 }; +
216 } +
217 +
218 function getParentNode(element) { +
219 if (getNodeName(element) === 'html') { +
220 return element; +
221 } +
222 +
223 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle +
224 // $FlowFixMe[incompatible-return] +
225 // $FlowFixMe[prop-missing] +
226 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node +
227 element.parentNode || ( // DOM Element detected +
228 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected +
229 // $FlowFixMe[incompatible-call]: HTMLElement is a Node +
230 getDocumentElement(element) // fallback +
231 +
232 ); +
233 } +
234 +
235 function getScrollParent(node) { +
236 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { +
237 // $FlowFixMe[incompatible-return]: assume body is always available +
238 return node.ownerDocument.body; +
239 } +
240 +
241 if (isHTMLElement(node) && isScrollParent(node)) { +
242 return node; +
243 } +
244 +
245 return getScrollParent(getParentNode(node)); +
246 } +
247 +
248 /* +
249 given a DOM element, return the list of all scroll parents, up the list of ancesors +
250 until we get to the top window object. This list is what we attach scroll listeners +
251 to, because if any of these parent elements scroll, we'll need to re-calculate the +
252 reference element's position. +
253 */ +
254 +
255 function listScrollParents(element, list) { +
256 var _element$ownerDocumen; +
257 +
258 if (list === void 0) { +
259 list = []; +
260 } +
261 +
262 var scrollParent = getScrollParent(element); +
263 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); +
264 var win = getWindow(scrollParent); +
265 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; +
266 var updatedList = list.concat(target); +
267 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here +
268 updatedList.concat(listScrollParents(getParentNode(target))); +
269 } +
270 +
271 function isTableElement(element) { +
272 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +
273 } +
274 +
275 function getTrueOffsetParent(element) { +
276 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 +
277 getComputedStyle(element).position === 'fixed') { +
278 return null; +
279 } +
280 +
281 return element.offsetParent; +
282 } // `.offsetParent` reports `null` for fixed elements, while absolute elements +
283 // return the containing block +
284 +
285 +
286 function getContainingBlock(element) { +
287 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; +
288 var isIE = navigator.userAgent.indexOf('Trident') !== -1; +
289 +
290 if (isIE && isHTMLElement(element)) { +
291 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport +
292 var elementCss = getComputedStyle(element); +
293 +
294 if (elementCss.position === 'fixed') { +
295 return null; +
296 } +
297 } +
298 +
299 var currentNode = getParentNode(element); +
300 +
301 if (isShadowRoot(currentNode)) { +
302 currentNode = currentNode.host; +
303 } +
304 +
305 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { +
306 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that +
307 // create a containing block. +
308 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block +
309 +
310 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { +
311 return currentNode; +
312 } else { +
313 currentNode = currentNode.parentNode; +
314 } +
315 } +
316 +
317 return null; +
318 } // Gets the closest ancestor positioned element. Handles some edge cases, +
319 // such as table ancestors and cross browser bugs. +
320 +
321 +
322 function getOffsetParent(element) { +
323 var window = getWindow(element); +
324 var offsetParent = getTrueOffsetParent(element); +
325 +
326 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { +
327 offsetParent = getTrueOffsetParent(offsetParent); +
328 } +
329 +
330 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { +
331 return window; +
332 } +
333 +
334 return offsetParent || getContainingBlock(element) || window; +
335 } +
336 +
337 var top = 'top'; +
338 var bottom = 'bottom'; +
339 var right = 'right'; +
340 var left = 'left'; +
341 var auto = 'auto'; +
342 var basePlacements = [top, bottom, right, left]; +
343 var start = 'start'; +
344 var end = 'end'; +
345 var clippingParents = 'clippingParents'; +
346 var viewport = 'viewport'; +
347 var popper = 'popper'; +
348 var reference = 'reference'; +
349 +
350 var beforeRead = 'beforeRead'; +
351 var read = 'read'; +
352 var afterRead = 'afterRead'; // pure-logic modifiers +
353 +
354 var beforeMain = 'beforeMain'; +
355 var main = 'main'; +
356 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) +
357 +
358 var beforeWrite = 'beforeWrite'; +
359 var write = 'write'; +
360 var afterWrite = 'afterWrite'; +
361 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +
362 +
363 function order(modifiers) { +
364 var map = new Map(); +
365 var visited = new Set(); +
366 var result = []; +
367 modifiers.forEach(function (modifier) { +
368 map.set(modifier.name, modifier); +
369 }); // On visiting object, check for its dependencies and visit them recursively +
370 +
371 function sort(modifier) { +
372 visited.add(modifier.name); +
373 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); +
374 requires.forEach(function (dep) { +
375 if (!visited.has(dep)) { +
376 var depModifier = map.get(dep); +
377 +
378 if (depModifier) { +
379 sort(depModifier); +
380 } +
381 } +
382 }); +
383 result.push(modifier); +
384 } +
385 +
386 modifiers.forEach(function (modifier) { +
387 if (!visited.has(modifier.name)) { +
388 // check for visited object +
389 sort(modifier); +
390 } +
391 }); +
392 return result; +
393 } +
394 +
395 function orderModifiers(modifiers) { +
396 // order based on dependencies +
397 var orderedModifiers = order(modifiers); // order based on phase +
398 +
399 return modifierPhases.reduce(function (acc, phase) { +
400 return acc.concat(orderedModifiers.filter(function (modifier) { +
401 return modifier.phase === phase; +
402 })); +
403 }, []); +
404 } +
405 +
406 function debounce(fn) { +
407 var pending; +
408 return function () { +
409 if (!pending) { +
410 pending = new Promise(function (resolve) { +
411 Promise.resolve().then(function () { +
412 pending = undefined; +
413 resolve(fn()); +
414 }); +
415 }); +
416 } +
417 +
418 return pending; +
419 }; +
420 } +
421 +
422 function format(str) { +
423 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { +
424 args[_key - 1] = arguments[_key]; +
425 } +
426 +
427 return [].concat(args).reduce(function (p, c) { +
428 return p.replace(/%s/, c); +
429 }, str); +
430 } +
431 +
432 var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; +
433 var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; +
434 var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; +
435 function validateModifiers(modifiers) { +
436 modifiers.forEach(function (modifier) { +
437 [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)` +
438 .filter(function (value, index, self) { +
439 return self.indexOf(value) === index; +
440 }).forEach(function (key) { +
441 switch (key) { +
442 case 'name': +
443 if (typeof modifier.name !== 'string') { +
444 console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); +
445 } +
446 +
447 break; +
448 +
449 case 'enabled': +
450 if (typeof modifier.enabled !== 'boolean') { +
451 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); +
452 } +
453 +
454 break; +
455 +
456 case 'phase': +
457 if (modifierPhases.indexOf(modifier.phase) < 0) { +
458 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); +
459 } +
460 +
461 break; +
462 +
463 case 'fn': +
464 if (typeof modifier.fn !== 'function') { +
465 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); +
466 } +
467 +
468 break; +
469 +
470 case 'effect': +
471 if (modifier.effect != null && typeof modifier.effect !== 'function') { +
472 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); +
473 } +
474 +
475 break; +
476 +
477 case 'requires': +
478 if (modifier.requires != null && !Array.isArray(modifier.requires)) { +
479 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); +
480 } +
481 +
482 break; +
483 +
484 case 'requiresIfExists': +
485 if (!Array.isArray(modifier.requiresIfExists)) { +
486 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); +
487 } +
488 +
489 break; +
490 +
491 case 'options': +
492 case 'data': +
493 break; +
494 +
495 default: +
496 console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { +
497 return "\"" + s + "\""; +
498 }).join(', ') + "; but \"" + key + "\" was provided."); +
499 } +
500 +
501 modifier.requires && modifier.requires.forEach(function (requirement) { +
502 if (modifiers.find(function (mod) { +
503 return mod.name === requirement; +
504 }) == null) { +
505 console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); +
506 } +
507 }); +
508 }); +
509 }); +
510 } +
511 +
512 function uniqueBy(arr, fn) { +
513 var identifiers = new Set(); +
514 return arr.filter(function (item) { +
515 var identifier = fn(item); +
516 +
517 if (!identifiers.has(identifier)) { +
518 identifiers.add(identifier); +
519 return true; +
520 } +
521 }); +
522 } +
523 +
524 function getBasePlacement(placement) { +
525 return placement.split('-')[0]; +
526 } +
527 +
528 function mergeByName(modifiers) { +
529 var merged = modifiers.reduce(function (merged, current) { +
530 var existing = merged[current.name]; +
531 merged[current.name] = existing ? Object.assign({}, existing, current, { +
532 options: Object.assign({}, existing.options, current.options), +
533 data: Object.assign({}, existing.data, current.data) +
534 }) : current; +
535 return merged; +
536 }, {}); // IE11 does not support Object.values +
537 +
538 return Object.keys(merged).map(function (key) { +
539 return merged[key]; +
540 }); +
541 } +
542 +
543 function getViewportRect(element) { +
544 var win = getWindow(element); +
545 var html = getDocumentElement(element); +
546 var visualViewport = win.visualViewport; +
547 var width = html.clientWidth; +
548 var height = html.clientHeight; +
549 var x = 0; +
550 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper +
551 // can be obscured underneath it. +
552 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even +
553 // if it isn't open, so if this isn't available, the popper will be detected +
554 // to overflow the bottom of the screen too early. +
555 +
556 if (visualViewport) { +
557 width = visualViewport.width; +
558 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) +
559 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding +
560 // errors due to floating point numbers, so we need to check precision. +
561 // Safari returns a number <= 0, usually < -1 when pinch-zoomed +
562 // Feature detection fails in mobile emulation mode in Chrome. +
563 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < +
564 // 0.001 +
565 // Fallback here: "Not Safari" userAgent +
566 +
567 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { +
568 x = visualViewport.offsetLeft; +
569 y = visualViewport.offsetTop; +
570 } +
571 } +
572 +
573 return { +
574 width: width, +
575 height: height, +
576 x: x + getWindowScrollBarX(element), +
577 y: y +
578 }; +
579 } +
580 +
581 // of the `<html>` and `<body>` rect bounds if horizontally scrollable +
582 +
583 function getDocumentRect(element) { +
584 var _element$ownerDocumen; +
585 +
586 var html = getDocumentElement(element); +
587 var winScroll = getWindowScroll(element); +
588 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; +
589 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); +
590 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); +
591 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); +
592 var y = -winScroll.scrollTop; +
593 +
594 if (getComputedStyle(body || html).direction === 'rtl') { +
595 x += max(html.clientWidth, body ? body.clientWidth : 0) - width; +
596 } +
597 +
598 return { +
599 width: width, +
600 height: height, +
601 x: x, +
602 y: y +
603 }; +
604 } +
605 +
606 function contains(parent, child) { +
607 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method +
608 +
609 if (parent.contains(child)) { +
610 return true; +
611 } // then fallback to custom implementation with Shadow DOM support +
612 else if (rootNode && isShadowRoot(rootNode)) { +
613 var next = child; +
614 +
615 do { +
616 if (next && parent.isSameNode(next)) { +
617 return true; +
618 } // $FlowFixMe[prop-missing]: need a better way to handle this... +
619 +
620 +
621 next = next.parentNode || next.host; +
622 } while (next); +
623 } // Give up, the result is false +
624 +
625 +
626 return false; +
627 } +
628 +
629 function rectToClientRect(rect) { +
630 return Object.assign({}, rect, { +
631 left: rect.x, +
632 top: rect.y, +
633 right: rect.x + rect.width, +
634 bottom: rect.y + rect.height +
635 }); +
636 } +
637 +
638 function getInnerBoundingClientRect(element) { +
639 var rect = getBoundingClientRect(element); +
640 rect.top = rect.top + element.clientTop; +
641 rect.left = rect.left + element.clientLeft; +
642 rect.bottom = rect.top + element.clientHeight; +
643 rect.right = rect.left + element.clientWidth; +
644 rect.width = element.clientWidth; +
645 rect.height = element.clientHeight; +
646 rect.x = rect.left; +
647 rect.y = rect.top; +
648 return rect; +
649 } +
650 +
651 function getClientRectFromMixedType(element, clippingParent) { +
652 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +
653 } // A "clipping parent" is an overflowable container with the characteristic of +
654 // clipping (or hiding) overflowing elements with a position different from +
655 // `initial` +
656 +
657 +
658 function getClippingParents(element) { +
659 var clippingParents = listScrollParents(getParentNode(element)); +
660 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; +
661 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; +
662 +
663 if (!isElement(clipperElement)) { +
664 return []; +
665 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 +
666 +
667 +
668 return clippingParents.filter(function (clippingParent) { +
669 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; +
670 }); +
671 } // Gets the maximum area that the element is visible in due to any number of +
672 // clipping parents +
673 +
674 +
675 function getClippingRect(element, boundary, rootBoundary) { +
676 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); +
677 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); +
678 var firstClippingParent = clippingParents[0]; +
679 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { +
680 var rect = getClientRectFromMixedType(element, clippingParent); +
681 accRect.top = max(rect.top, accRect.top); +
682 accRect.right = min(rect.right, accRect.right); +
683 accRect.bottom = min(rect.bottom, accRect.bottom); +
684 accRect.left = max(rect.left, accRect.left); +
685 return accRect; +
686 }, getClientRectFromMixedType(element, firstClippingParent)); +
687 clippingRect.width = clippingRect.right - clippingRect.left; +
688 clippingRect.height = clippingRect.bottom - clippingRect.top; +
689 clippingRect.x = clippingRect.left; +
690 clippingRect.y = clippingRect.top; +
691 return clippingRect; +
692 } +
693 +
694 function getVariation(placement) { +
695 return placement.split('-')[1]; +
696 } +
697 +
698 function getMainAxisFromPlacement(placement) { +
699 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +
700 } +
701 +
702 function computeOffsets(_ref) { +
703 var reference = _ref.reference, +
704 element = _ref.element, +
705 placement = _ref.placement; +
706 var basePlacement = placement ? getBasePlacement(placement) : null; +
707 var variation = placement ? getVariation(placement) : null; +
708 var commonX = reference.x + reference.width / 2 - element.width / 2; +
709 var commonY = reference.y + reference.height / 2 - element.height / 2; +
710 var offsets; +
711 +
712 switch (basePlacement) { +
713 case top: +
714 offsets = { +
715 x: commonX, +
716 y: reference.y - element.height +
717 }; +
718 break; +
719 +
720 case bottom: +
721 offsets = { +
722 x: commonX, +
723 y: reference.y + reference.height +
724 }; +
725 break; +
726 +
727 case right: +
728 offsets = { +
729 x: reference.x + reference.width, +
730 y: commonY +
731 }; +
732 break; +
733 +
734 case left: +
735 offsets = { +
736 x: reference.x - element.width, +
737 y: commonY +
738 }; +
739 break; +
740 +
741 default: +
742 offsets = { +
743 x: reference.x, +
744 y: reference.y +
745 }; +
746 } +
747 +
748 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; +
749 +
750 if (mainAxis != null) { +
751 var len = mainAxis === 'y' ? 'height' : 'width'; +
752 +
753 switch (variation) { +
754 case start: +
755 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); +
756 break; +
757 +
758 case end: +
759 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); +
760 break; +
761 } +
762 } +
763 +
764 return offsets; +
765 } +
766 +
767 function getFreshSideObject() { +
768 return { +
769 top: 0, +
770 right: 0, +
771 bottom: 0, +
772 left: 0 +
773 }; +
774 } +
775 +
776 function mergePaddingObject(paddingObject) { +
777 return Object.assign({}, getFreshSideObject(), paddingObject); +
778 } +
779 +
780 function expandToHashMap(value, keys) { +
781 return keys.reduce(function (hashMap, key) { +
782 hashMap[key] = value; +
783 return hashMap; +
784 }, {}); +
785 } +
786 +
787 function detectOverflow(state, options) { +
788 if (options === void 0) { +
789 options = {}; +
790 } +
791 +
792 var _options = options, +
793 _options$placement = _options.placement, +
794 placement = _options$placement === void 0 ? state.placement : _options$placement, +
795 _options$boundary = _options.boundary, +
796 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, +
797 _options$rootBoundary = _options.rootBoundary, +
798 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, +
799 _options$elementConte = _options.elementContext, +
800 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, +
801 _options$altBoundary = _options.altBoundary, +
802 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, +
803 _options$padding = _options.padding, +
804 padding = _options$padding === void 0 ? 0 : _options$padding; +
805 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +
806 var altContext = elementContext === popper ? reference : popper; +
807 var popperRect = state.rects.popper; +
808 var element = state.elements[altBoundary ? altContext : elementContext]; +
809 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); +
810 var referenceClientRect = getBoundingClientRect(state.elements.reference); +
811 var popperOffsets = computeOffsets({ +
812 reference: referenceClientRect, +
813 element: popperRect, +
814 strategy: 'absolute', +
815 placement: placement +
816 }); +
817 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); +
818 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect +
819 // 0 or negative = within the clipping rect +
820 +
821 var overflowOffsets = { +
822 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, +
823 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, +
824 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, +
825 right: elementClientRect.right - clippingClientRect.right + paddingObject.right +
826 }; +
827 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element +
828 +
829 if (elementContext === popper && offsetData) { +
830 var offset = offsetData[placement]; +
831 Object.keys(overflowOffsets).forEach(function (key) { +
832 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; +
833 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; +
834 overflowOffsets[key] += offset[axis] * multiply; +
835 }); +
836 } +
837 +
838 return overflowOffsets; +
839 } +
840 +
841 var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +
842 var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +
843 var DEFAULT_OPTIONS = { +
844 placement: 'bottom', +
845 modifiers: [], +
846 strategy: 'absolute' +
847 }; +
848 +
849 function areValidElements() { +
850 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { +
851 args[_key] = arguments[_key]; +
852 } +
853 +
854 return !args.some(function (element) { +
855 return !(element && typeof element.getBoundingClientRect === 'function'); +
856 }); +
857 } +
858 +
859 function popperGenerator(generatorOptions) { +
860 if (generatorOptions === void 0) { +
861 generatorOptions = {}; +
862 } +
863 +
864 var _generatorOptions = generatorOptions, +
865 _generatorOptions$def = _generatorOptions.defaultModifiers, +
866 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, +
867 _generatorOptions$def2 = _generatorOptions.defaultOptions, +
868 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; +
869 return function createPopper(reference, popper, options) { +
870 if (options === void 0) { +
871 options = defaultOptions; +
872 } +
873 +
874 var state = { +
875 placement: 'bottom', +
876 orderedModifiers: [], +
877 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), +
878 modifiersData: {}, +
879 elements: { +
880 reference: reference, +
881 popper: popper +
882 }, +
883 attributes: {}, +
884 styles: {} +
885 }; +
886 var effectCleanupFns = []; +
887 var isDestroyed = false; +
888 var instance = { +
889 state: state, +
890 setOptions: function setOptions(setOptionsAction) { +
891 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; +
892 cleanupModifierEffects(); +
893 state.options = Object.assign({}, defaultOptions, state.options, options); +
894 state.scrollParents = { +
895 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], +
896 popper: listScrollParents(popper) +
897 }; // Orders the modifiers based on their dependencies and `phase` +
898 // properties +
899 +
900 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers +
901 +
902 state.orderedModifiers = orderedModifiers.filter(function (m) { +
903 return m.enabled; +
904 }); // Validate the provided modifiers so that the consumer will get warned +
905 // if one of the modifiers is invalid for any reason +
906 +
907 { +
908 var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { +
909 var name = _ref.name; +
910 return name; +
911 }); +
912 validateModifiers(modifiers); +
913 +
914 if (getBasePlacement(state.options.placement) === auto) { +
915 var flipModifier = state.orderedModifiers.find(function (_ref2) { +
916 var name = _ref2.name; +
917 return name === 'flip'; +
918 }); +
919 +
920 if (!flipModifier) { +
921 console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); +
922 } +
923 } +
924 +
925 var _getComputedStyle = getComputedStyle(popper), +
926 marginTop = _getComputedStyle.marginTop, +
927 marginRight = _getComputedStyle.marginRight, +
928 marginBottom = _getComputedStyle.marginBottom, +
929 marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can +
930 // cause bugs with positioning, so we'll warn the consumer +
931 +
932 +
933 if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { +
934 return parseFloat(margin); +
935 })) { +
936 console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); +
937 } +
938 } +
939 +
940 runModifierEffects(); +
941 return instance.update(); +
942 }, +
943 // Sync update – it will always be executed, even if not necessary. This +
944 // is useful for low frequency updates where sync behavior simplifies the +
945 // logic. +
946 // For high frequency updates (e.g. `resize` and `scroll` events), always +
947 // prefer the async Popper#update method +
948 forceUpdate: function forceUpdate() { +
949 if (isDestroyed) { +
950 return; +
951 } +
952 +
953 var _state$elements = state.elements, +
954 reference = _state$elements.reference, +
955 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements +
956 // anymore +
957 +
958 if (!areValidElements(reference, popper)) { +
959 { +
960 console.error(INVALID_ELEMENT_ERROR); +
961 } +
962 +
963 return; +
964 } // Store the reference and popper rects to be read by modifiers +
965 +
966 +
967 state.rects = { +
968 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), +
969 popper: getLayoutRect(popper) +
970 }; // Modifiers have the ability to reset the current update cycle. The +
971 // most common use case for this is the `flip` modifier changing the +
972 // placement, which then needs to re-run all the modifiers, because the +
973 // logic was previously ran for the previous placement and is therefore +
974 // stale/incorrect +
975 +
976 state.reset = false; +
977 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier +
978 // is filled with the initial data specified by the modifier. This means +
979 // it doesn't persist and is fresh on each update. +
980 // To ensure persistent data, use `${name}#persistent` +
981 +
982 state.orderedModifiers.forEach(function (modifier) { +
983 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); +
984 }); +
985 var __debug_loops__ = 0; +
986 +
987 for (var index = 0; index < state.orderedModifiers.length; index++) { +
988 { +
989 __debug_loops__ += 1; +
990 +
991 if (__debug_loops__ > 100) { +
992 console.error(INFINITE_LOOP_ERROR); +
993 break; +
994 } +
995 } +
996 +
997 if (state.reset === true) { +
998 state.reset = false; +
999 index = -1; +
1000 continue; +
1001 } +
1002 +
1003 var _state$orderedModifie = state.orderedModifiers[index], +
1004 fn = _state$orderedModifie.fn, +
1005 _state$orderedModifie2 = _state$orderedModifie.options, +
1006 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, +
1007 name = _state$orderedModifie.name; +
1008 +
1009 if (typeof fn === 'function') { +
1010 state = fn({ +
1011 state: state, +
1012 options: _options, +
1013 name: name, +
1014 instance: instance +
1015 }) || state; +
1016 } +
1017 } +
1018 }, +
1019 // Async and optimistically optimized update – it will not be executed if +
1020 // not necessary (debounced to run at most once-per-tick) +
1021 update: debounce(function () { +
1022 return new Promise(function (resolve) { +
1023 instance.forceUpdate(); +
1024 resolve(state); +
1025 }); +
1026 }), +
1027 destroy: function destroy() { +
1028 cleanupModifierEffects(); +
1029 isDestroyed = true; +
1030 } +
1031 }; +
1032 +
1033 if (!areValidElements(reference, popper)) { +
1034 { +
1035 console.error(INVALID_ELEMENT_ERROR); +
1036 } +
1037 +
1038 return instance; +
1039 } +
1040 +
1041 instance.setOptions(options).then(function (state) { +
1042 if (!isDestroyed && options.onFirstUpdate) { +
1043 options.onFirstUpdate(state); +
1044 } +
1045 }); // Modifiers have the ability to execute arbitrary code before the first +
1046 // update cycle runs. They will be executed in the same order as the update +
1047 // cycle. This is useful when a modifier adds some persistent data that +
1048 // other modifiers need to use, but the modifier is run after the dependent +
1049 // one. +
1050 +
1051 function runModifierEffects() { +
1052 state.orderedModifiers.forEach(function (_ref3) { +
1053 var name = _ref3.name, +
1054 _ref3$options = _ref3.options, +
1055 options = _ref3$options === void 0 ? {} : _ref3$options, +
1056 effect = _ref3.effect; +
1057 +
1058 if (typeof effect === 'function') { +
1059 var cleanupFn = effect({ +
1060 state: state, +
1061 name: name, +
1062 instance: instance, +
1063 options: options +
1064 }); +
1065 +
1066 var noopFn = function noopFn() {}; +
1067 +
1068 effectCleanupFns.push(cleanupFn || noopFn); +
1069 } +
1070 }); +
1071 } +
1072 +
1073 function cleanupModifierEffects() { +
1074 effectCleanupFns.forEach(function (fn) { +
1075 return fn(); +
1076 }); +
1077 effectCleanupFns = []; +
1078 } +
1079 +
1080 return instance; +
1081 }; +
1082 } +
1083 +
1084 var passive = { +
1085 passive: true +
1086 }; +
1087 +
1088 function effect$1(_ref) { +
1089 var state = _ref.state, +
1090 instance = _ref.instance, +
1091 options = _ref.options; +
1092 var _options$scroll = options.scroll, +
1093 scroll = _options$scroll === void 0 ? true : _options$scroll, +
1094 _options$resize = options.resize, +
1095 resize = _options$resize === void 0 ? true : _options$resize; +
1096 var window = getWindow(state.elements.popper); +
1097 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); +
1098 +
1099 if (scroll) { +
1100 scrollParents.forEach(function (scrollParent) { +
1101 scrollParent.addEventListener('scroll', instance.update, passive); +
1102 }); +
1103 } +
1104 +
1105 if (resize) { +
1106 window.addEventListener('resize', instance.update, passive); +
1107 } +
1108 +
1109 return function () { +
1110 if (scroll) { +
1111 scrollParents.forEach(function (scrollParent) { +
1112 scrollParent.removeEventListener('scroll', instance.update, passive); +
1113 }); +
1114 } +
1115 +
1116 if (resize) { +
1117 window.removeEventListener('resize', instance.update, passive); +
1118 } +
1119 }; +
1120 } // eslint-disable-next-line import/no-unused-modules +
1121 +
1122 +
1123 var eventListeners = { +
1124 name: 'eventListeners', +
1125 enabled: true, +
1126 phase: 'write', +
1127 fn: function fn() {}, +
1128 effect: effect$1, +
1129 data: {} +
1130 }; +
1131 +
1132 function popperOffsets(_ref) { +
1133 var state = _ref.state, +
1134 name = _ref.name; +
1135 // Offsets are the actual position the popper needs to have to be +
1136 // properly positioned near its reference element +
1137 // This is the most basic placement, and will be adjusted by +
1138 // the modifiers in the next step +
1139 state.modifiersData[name] = computeOffsets({ +
1140 reference: state.rects.reference, +
1141 element: state.rects.popper, +
1142 strategy: 'absolute', +
1143 placement: state.placement +
1144 }); +
1145 } // eslint-disable-next-line import/no-unused-modules +
1146 +
1147 +
1148 var popperOffsets$1 = { +
1149 name: 'popperOffsets', +
1150 enabled: true, +
1151 phase: 'read', +
1152 fn: popperOffsets, +
1153 data: {} +
1154 }; +
1155 +
1156 var unsetSides = { +
1157 top: 'auto', +
1158 right: 'auto', +
1159 bottom: 'auto', +
1160 left: 'auto' +
1161 }; // Round the offsets to the nearest suitable subpixel based on the DPR. +
1162 // Zooming can change the DPR, but it seems to report a value that will +
1163 // cleanly divide the values into the appropriate subpixels. +
1164 +
1165 function roundOffsetsByDPR(_ref) { +
1166 var x = _ref.x, +
1167 y = _ref.y; +
1168 var win = window; +
1169 var dpr = win.devicePixelRatio || 1; +
1170 return { +
1171 x: round(x * dpr) / dpr || 0, +
1172 y: round(y * dpr) / dpr || 0 +
1173 }; +
1174 } +
1175 +
1176 function mapToStyles(_ref2) { +
1177 var _Object$assign2; +
1178 +
1179 var popper = _ref2.popper, +
1180 popperRect = _ref2.popperRect, +
1181 placement = _ref2.placement, +
1182 variation = _ref2.variation, +
1183 offsets = _ref2.offsets, +
1184 position = _ref2.position, +
1185 gpuAcceleration = _ref2.gpuAcceleration, +
1186 adaptive = _ref2.adaptive, +
1187 roundOffsets = _ref2.roundOffsets, +
1188 isFixed = _ref2.isFixed; +
1189 var _offsets$x = offsets.x, +
1190 x = _offsets$x === void 0 ? 0 : _offsets$x, +
1191 _offsets$y = offsets.y, +
1192 y = _offsets$y === void 0 ? 0 : _offsets$y; +
1193 +
1194 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ +
1195 x: x, +
1196 y: y +
1197 }) : { +
1198 x: x, +
1199 y: y +
1200 }; +
1201 +
1202 x = _ref3.x; +
1203 y = _ref3.y; +
1204 var hasX = offsets.hasOwnProperty('x'); +
1205 var hasY = offsets.hasOwnProperty('y'); +
1206 var sideX = left; +
1207 var sideY = top; +
1208 var win = window; +
1209 +
1210 if (adaptive) { +
1211 var offsetParent = getOffsetParent(popper); +
1212 var heightProp = 'clientHeight'; +
1213 var widthProp = 'clientWidth'; +
1214 +
1215 if (offsetParent === getWindow(popper)) { +
1216 offsetParent = getDocumentElement(popper); +
1217 +
1218 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { +
1219 heightProp = 'scrollHeight'; +
1220 widthProp = 'scrollWidth'; +
1221 } +
1222 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it +
1223 +
1224 +
1225 offsetParent = offsetParent; +
1226 +
1227 if (placement === top || (placement === left || placement === right) && variation === end) { +
1228 sideY = bottom; +
1229 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] +
1230 offsetParent[heightProp]; +
1231 y -= offsetY - popperRect.height; +
1232 y *= gpuAcceleration ? 1 : -1; +
1233 } +
1234 +
1235 if (placement === left || (placement === top || placement === bottom) && variation === end) { +
1236 sideX = right; +
1237 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] +
1238 offsetParent[widthProp]; +
1239 x -= offsetX - popperRect.width; +
1240 x *= gpuAcceleration ? 1 : -1; +
1241 } +
1242 } +
1243 +
1244 var commonStyles = Object.assign({ +
1245 position: position +
1246 }, adaptive && unsetSides); +
1247 +
1248 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ +
1249 x: x, +
1250 y: y +
1251 }) : { +
1252 x: x, +
1253 y: y +
1254 }; +
1255 +
1256 x = _ref4.x; +
1257 y = _ref4.y; +
1258 +
1259 if (gpuAcceleration) { +
1260 var _Object$assign; +
1261 +
1262 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); +
1263 } +
1264 +
1265 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +
1266 } +
1267 +
1268 function computeStyles(_ref5) { +
1269 var state = _ref5.state, +
1270 options = _ref5.options; +
1271 var _options$gpuAccelerat = options.gpuAcceleration, +
1272 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, +
1273 _options$adaptive = options.adaptive, +
1274 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, +
1275 _options$roundOffsets = options.roundOffsets, +
1276 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; +
1277 +
1278 { +
1279 var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ''; +
1280 +
1281 if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) { +
1282 return transitionProperty.indexOf(property) >= 0; +
1283 })) { +
1284 console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' ')); +
1285 } +
1286 } +
1287 +
1288 var commonStyles = { +
1289 placement: getBasePlacement(state.placement), +
1290 variation: getVariation(state.placement), +
1291 popper: state.elements.popper, +
1292 popperRect: state.rects.popper, +
1293 gpuAcceleration: gpuAcceleration, +
1294 isFixed: state.options.strategy === 'fixed' +
1295 }; +
1296 +
1297 if (state.modifiersData.popperOffsets != null) { +
1298 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { +
1299 offsets: state.modifiersData.popperOffsets, +
1300 position: state.options.strategy, +
1301 adaptive: adaptive, +
1302 roundOffsets: roundOffsets +
1303 }))); +
1304 } +
1305 +
1306 if (state.modifiersData.arrow != null) { +
1307 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { +
1308 offsets: state.modifiersData.arrow, +
1309 position: 'absolute', +
1310 adaptive: false, +
1311 roundOffsets: roundOffsets +
1312 }))); +
1313 } +
1314 +
1315 state.attributes.popper = Object.assign({}, state.attributes.popper, { +
1316 'data-popper-placement': state.placement +
1317 }); +
1318 } // eslint-disable-next-line import/no-unused-modules +
1319 +
1320 +
1321 var computeStyles$1 = { +
1322 name: 'computeStyles', +
1323 enabled: true, +
1324 phase: 'beforeWrite', +
1325 fn: computeStyles, +
1326 data: {} +
1327 }; +
1328 +
1329 // and applies them to the HTMLElements such as popper and arrow +
1330 +
1331 function applyStyles(_ref) { +
1332 var state = _ref.state; +
1333 Object.keys(state.elements).forEach(function (name) { +
1334 var style = state.styles[name] || {}; +
1335 var attributes = state.attributes[name] || {}; +
1336 var element = state.elements[name]; // arrow is optional + virtual elements +
1337 +
1338 if (!isHTMLElement(element) || !getNodeName(element)) { +
1339 return; +
1340 } // Flow doesn't support to extend this property, but it's the most +
1341 // effective way to apply styles to an HTMLElement +
1342 // $FlowFixMe[cannot-write] +
1343 +
1344 +
1345 Object.assign(element.style, style); +
1346 Object.keys(attributes).forEach(function (name) { +
1347 var value = attributes[name]; +
1348 +
1349 if (value === false) { +
1350 element.removeAttribute(name); +
1351 } else { +
1352 element.setAttribute(name, value === true ? '' : value); +
1353 } +
1354 }); +
1355 }); +
1356 } +
1357 +
1358 function effect(_ref2) { +
1359 var state = _ref2.state; +
1360 var initialStyles = { +
1361 popper: { +
1362 position: state.options.strategy, +
1363 left: '0', +
1364 top: '0', +
1365 margin: '0' +
1366 }, +
1367 arrow: { +
1368 position: 'absolute' +
1369 }, +
1370 reference: {} +
1371 }; +
1372 Object.assign(state.elements.popper.style, initialStyles.popper); +
1373 state.styles = initialStyles; +
1374 +
1375 if (state.elements.arrow) { +
1376 Object.assign(state.elements.arrow.style, initialStyles.arrow); +
1377 } +
1378 +
1379 return function () { +
1380 Object.keys(state.elements).forEach(function (name) { +
1381 var element = state.elements[name]; +
1382 var attributes = state.attributes[name] || {}; +
1383 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them +
1384 +
1385 var style = styleProperties.reduce(function (style, property) { +
1386 style[property] = ''; +
1387 return style; +
1388 }, {}); // arrow is optional + virtual elements +
1389 +
1390 if (!isHTMLElement(element) || !getNodeName(element)) { +
1391 return; +
1392 } +
1393 +
1394 Object.assign(element.style, style); +
1395 Object.keys(attributes).forEach(function (attribute) { +
1396 element.removeAttribute(attribute); +
1397 }); +
1398 }); +
1399 }; +
1400 } // eslint-disable-next-line import/no-unused-modules +
1401 +
1402 +
1403 var applyStyles$1 = { +
1404 name: 'applyStyles', +
1405 enabled: true, +
1406 phase: 'write', +
1407 fn: applyStyles, +
1408 effect: effect, +
1409 requires: ['computeStyles'] +
1410 }; +
1411 +
1412 var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; +
1413 var createPopper = /*#__PURE__*/popperGenerator({ +
1414 defaultModifiers: defaultModifiers +
1415 }); // eslint-disable-next-line import/no-unused-modules +
1416 +
1417 exports.createPopper = createPopper; +
1418 exports.defaultModifiers = defaultModifiers; +
1419 exports.detectOverflow = detectOverflow; +
1420 exports.popperGenerator = popperGenerator; +
1421 +
1422 Object.defineProperty(exports, '__esModule', { value: true }); +
1423 +
1424}))); +
1425//# sourceMappingURL=popper-lite.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-lite.js.map b/web/_static/popperjs/popper-lite.js.map new file mode 100644 index 0000000..ddead81 --- /dev/null +++ b/web/_static/popperjs/popper-lite.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

109 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper-lite.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getNodeScroll.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/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/format.js","../../src/utils/validateModifiers.js","../../src/utils/uniqueBy.js","../../src/utils/getBasePlacement.js","../../src/utils/mergeByName.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/getFreshSideObject.js","../../src/utils/mergePaddingObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.js","../../src/modifiers/eventListeners.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/computeStyles.js","../../src/modifiers/applyStyles.js","../../src/popper-lite.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\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\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 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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\n\nexport default function format(str: string, ...args: Array<string>) {\n return [...args].reduce((p, c) => p.replace(/%s/, c), str);\n}\n","// @flow\nimport format from './format';\nimport { modifierPhases } from '../enums';\n\nconst INVALID_MODIFIER_ERROR =\n 'Popper: modifier \"%s\" provided an invalid %s property, expected %s but got %s';\nconst MISSING_DEPENDENCY_ERROR =\n 'Popper: modifier \"%s\" requires \"%s\", but \"%s\" modifier is not available';\nconst VALID_PROPERTIES = [\n 'name',\n 'enabled',\n 'phase',\n 'fn',\n 'effect',\n 'requires',\n 'options',\n];\n\nexport default function validateModifiers(modifiers: Array<any>): void {\n modifiers.forEach((modifier) => {\n [...Object.keys(modifier), ...VALID_PROPERTIES]\n // IE11-compatible replacement for `new Set(iterable)`\n .filter((value, index, self) => self.indexOf(value) === index)\n .forEach((key) => {\n switch (key) {\n case 'name':\n if (typeof modifier.name !== 'string') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n String(modifier.name),\n '\"name\"',\n '\"string\"',\n `\"${String(modifier.name)}\"`\n )\n );\n }\n break;\n case 'enabled':\n if (typeof modifier.enabled !== 'boolean') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"enabled\"',\n '\"boolean\"',\n `\"${String(modifier.enabled)}\"`\n )\n );\n }\n break;\n case 'phase':\n if (modifierPhases.indexOf(modifier.phase) < 0) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"phase\"',\n `either ${modifierPhases.join(', ')}`,\n `\"${String(modifier.phase)}\"`\n )\n );\n }\n break;\n case 'fn':\n if (typeof modifier.fn !== 'function') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"fn\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'effect':\n if (\n modifier.effect != null &&\n typeof modifier.effect !== 'function'\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"effect\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'requires':\n if (\n modifier.requires != null &&\n !Array.isArray(modifier.requires)\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requires\"',\n '\"array\"',\n `\"${String(modifier.requires)}\"`\n )\n );\n }\n break;\n case 'requiresIfExists':\n if (!Array.isArray(modifier.requiresIfExists)) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requiresIfExists\"',\n '\"array\"',\n `\"${String(modifier.requiresIfExists)}\"`\n )\n );\n }\n break;\n case 'options':\n case 'data':\n break;\n default:\n console.error(\n `PopperJS: an invalid property has been provided to the \"${\n modifier.name\n }\" modifier, valid properties are ${VALID_PROPERTIES.map(\n (s) => `\"${s}\"`\n ).join(', ')}; but \"${key}\" was provided.`\n );\n }\n\n modifier.requires &&\n modifier.requires.forEach((requirement) => {\n if (modifiers.find((mod) => mod.name === requirement) == null) {\n console.error(\n format(\n MISSING_DEPENDENCY_ERROR,\n String(modifier.name),\n requirement,\n requirement\n )\n );\n }\n });\n });\n });\n}\n","// @flow\n\nexport default function uniqueBy<T>(arr: Array<T>, fn: T => any): Array<T> {\n const identifiers = new Set();\n\n return arr.filter(item => {\n const identifier = fn(item);\n\n if (!identifiers.has(identifier)) {\n identifiers.add(identifier);\n return true;\n }\n });\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 { 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\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 { 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 );\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\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","// @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 { 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\nimport type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\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 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 {\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 { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments<Options>) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n isFixed,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n isFixed: boolean,\n}) {\n let { x = 0, y = 0 } = offsets;\n\n ({ x, y } =\n typeof roundOffsets === 'function'\n ? roundOffsets({ x, y })\n : { x, y });\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n const offsetY =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.height\n : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n const offsetX =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.width\n : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n ({ x, y } =\n roundOffsets === true\n ? roundOffsetsByDPR({ x, y })\n : { x, y });\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments<Options>) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n if (__DEV__) {\n const transitionProperty =\n getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(\n (property) => transitionProperty.indexOf(property) >= 0\n )\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.',\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === 'fixed',\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","OwnElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getHTMLElementScroll","getNodeScroll","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","isElementScaled","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","clientRect","abs","offsetLeft","offsetTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getContainingBlock","isFirefox","navigator","userAgent","isIE","elementCss","currentNode","css","transform","perspective","contain","willChange","filter","getOffsetParent","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","order","modifiers","map","Map","visited","Set","result","forEach","modifier","set","name","sort","add","requires","requiresIfExists","dep","has","depModifier","get","push","orderModifiers","orderedModifiers","reduce","acc","phase","debounce","fn","pending","Promise","resolve","then","undefined","format","str","args","p","c","replace","INVALID_MODIFIER_ERROR","MISSING_DEPENDENCY_ERROR","VALID_PROPERTIES","validateModifiers","Object","keys","value","index","self","key","console","error","String","enabled","join","effect","Array","isArray","s","requirement","find","mod","uniqueBy","arr","identifiers","item","identifier","getBasePlacement","placement","split","mergeByName","merged","current","existing","options","data","getViewportRect","html","clientWidth","clientHeight","getDocumentRect","winScroll","scrollWidth","scrollHeight","direction","contains","parent","child","rootNode","getRootNode","next","isSameNode","rectToClientRect","getInnerBoundingClientRect","getClientRectFromMixedType","clippingParent","getClippingParents","canEscapeClipping","clipperElement","getClippingRect","boundary","rootBoundary","mainClippingParents","firstClippingParent","clippingRect","accRect","getVariation","getMainAxisFromPlacement","computeOffsets","basePlacement","variation","commonX","commonY","mainAxis","len","getFreshSideObject","mergePaddingObject","paddingObject","expandToHashMap","hashMap","detectOverflow","state","elementContext","altBoundary","padding","altContext","popperRect","rects","elements","clippingClientRect","contextElement","referenceClientRect","popperOffsets","strategy","popperClientRect","elementClientRect","overflowOffsets","offsetData","modifiersData","offset","multiply","axis","INVALID_ELEMENT_ERROR","INFINITE_LOOP_ERROR","DEFAULT_OPTIONS","areValidElements","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","createPopper","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","m","flipModifier","marginTop","marginRight","marginBottom","marginLeft","margin","parseFloat","warn","runModifierEffects","update","forceUpdate","reset","__debug_loops__","length","destroy","onFirstUpdate","cleanupFn","noopFn","passive","resize","addEventListener","removeEventListener","unsetSides","roundOffsetsByDPR","dpr","devicePixelRatio","mapToStyles","gpuAcceleration","adaptive","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","heightProp","widthProp","offsetY","offsetX","commonStyles","computeStyles","transitionProperty","property","arrow","applyStyles","style","assign","removeAttribute","setAttribute","initialStyles","styleProperties","attribute","eventListeners"],"mappings":";;;;;;;;;;EAIe,SAASA,SAAT,CAAmBC,IAAnB,EAAyB;EACtC,MAAIA,IAAI,IAAI,IAAZ,EAAkB;EAChB,WAAOC,MAAP;EACD;;EAED,MAAID,IAAI,CAACE,QAAL,OAAoB,iBAAxB,EAA2C;EACzC,QAAMC,aAAa,GAAGH,IAAI,CAACG,aAA3B;EACA,WAAOA,aAAa,GAAGA,aAAa,CAACC,WAAd,IAA6BH,MAAhC,GAAyCA,MAA7D;EACD;;EAED,SAAOD,IAAP;EACD;;ECVD,SAASK,SAA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,EAAsD;EACpD;EACD;;EAEDgJ,MAAAA,MAAM,CAACoK,MAAP,CAAcpT,OAAO,CAACmT,KAAtB,EAA6BA,KAA7B;EAEAnK,MAAAA,MAAM,CAACC,IAAP,CAAY2G,UAAZ,EAAwB/I,OAAxB,CAAgC,UAAC4M,SAAD,EAAe;EAC7CzT,QAAAA,OAAO,CAACqT,eAAR,CAAwBI,SAAxB;EACD,OAFD;EAGD,KA1BD;EA2BD,GA5BD;EA6BD;;;AAID,sBAAgB;EACdzM,EAAAA,IAAI,EAAE,aADQ;EAEdyC,EAAAA,OAAO,EAAE,IAFK;EAGd3B,EAAAA,KAAK,EAAE,OAHO;EAIdE,EAAAA,EAAE,EAAEkL,WAJU;EAKdvJ,EAAAA,MAAM,EAANA,MALc;EAMdxC,EAAAA,QAAQ,EAAE,CAAC,eAAD;EANI,CAAhB;;MChFMsI,gBAAgB,GAAG,CACvBiE,cADuB,EAEvBlF,eAFuB,EAGvBsE,eAHuB,EAIvBI,aAJuB;MAOnBvD,YAAY,gBAAGJ,eAAe,CAAC;EAAEE,EAAAA,gBAAgB,EAAhBA;EAAF,CAAD;;;;;;;;;"}
\No newline at end of file

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-lite.min.js b/web/_static/popperjs/popper-lite.min.js new file mode 100644 index 0000000..31876d7 --- /dev/null +++ b/web/_static/popperjs/popper-lite.min.js @@ -0,0 +1,71 @@ +UNPKG - @popperjs/core

UNPKG

13.2 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5!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){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return 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)}var i=Math.max,a=Math.min,s=Math.round;function f(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(o(e)&&t){var a=e.offsetHeight,f=e.offsetWidth;f>0&&(r=s(n.width)/f||1),a>0&&(i=s(n.height)/a||1)}return{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 c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function u(e){return e?(e.nodeName||"").toLowerCase():null}function l(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return f(l(e)).left+c(e).scrollLeft}function d(e){return t(e).getComputedStyle(e)}function h(e){var t=d(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function m(e,n,r){void 0===r&&(r=!1);var i,a,d=o(n),m=o(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,o=s(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(n),v=l(n),g=f(e,m),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(d||!d&&!r)&&(("body"!==u(n)||h(v))&&(y=(i=n)!==t(i)&&o(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:c(i)),o(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=p(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function v(e){return"html"===u(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||l(e)}function g(e){return["html","body","#document"].indexOf(u(e))>=0?e.ownerDocument.body:o(e)&&h(e)?e:g(v(e))}function y(e,n){var o;void 0===n&&(n=[]);var r=g(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=t(r),s=i?[a].concat(a.visualViewport||[],h(r)?r:[]):r,f=n.concat(s);return i?f:f.concat(y(v(s)))}function b(e){return["table","td","th"].indexOf(u(e))>=0}function w(e){return o(e)&&"fixed"!==d(e).position?e.offsetParent:null}function x(e){for(var n=t(e),i=w(e);i&&b(i)&&"static"===d(i).position;)i=w(i);return i&&("html"===u(i)||"body"===u(i)&&"static"===d(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&o(e)&&"fixed"===d(e).position)return null;var n=v(e);for(r(n)&&(n=n.host);o(n)&&["html","body"].indexOf(u(n))<0;){var i=d(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var O="top",j="bottom",E="right",L="left",M=[O,j,E,L],W="end",P="viewport",T="popper",H=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function R(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}function D(e){return e.split("-")[0]}function k(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function S(e,o){return o===P?k(function(e){var n=t(e),o=l(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,f=0;return r&&(i=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,f=r.offsetTop)),{width:i,height:a,x:s+p(e),y:f}}(e)):n(o)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(o):k(function(e){var t,n=l(e),o=c(e),r=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),f=-o.scrollLeft+p(e),u=-o.scrollTop;return"rtl"===d(r||n).direction&&(f+=i(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:s,x:f,y:u}}(l(e)))}function A(e){var t=y(v(e)),i=["absolute","fixed"].indexOf(d(e).position)>=0&&o(e)?x(e):e;return n(i)?t.filter((function(e){return n(e)&&function(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}(e,i)&&"body"!==u(e)})):[]}function C(e){return e.split("-")[1]}function N(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?D(r):null,a=r?C(r):null,s=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2;switch(i){case O:t={x:s,y:n.y-o.height};break;case j:t={x:s,y:n.y+n.height};break;case E:t={x:n.x+n.width,y:f};break;case L:t={x:n.x-o.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?function(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case"start":t[c]=t[c]-(n[u]/2-o[u]/2);break;case W:t[c]=t[c]+(n[u]/2-o[u]/2)}}return t}var V={placement:"bottom",modifiers:[],strategy:"absolute"};function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function F(e){void 0===e&&(e={});var t=e,o=t.defaultModifiers,r=void 0===o?[]:o,i=t.defaultOptions,a=void 0===i?V:i;return function(e,t,o){void 0===o&&(o=a);var i,s,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},V,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],l=!1,p={state:c,setOptions:function(o){var i="function"==typeof o?o(c.options):o;d(),c.options=Object.assign({},a,c.options,i),c.scrollParents={reference:n(e)?y(e):e.contextElement?y(e.contextElement):[],popper:y(t)};var s,f,l=function(e){var t=R(e);return H.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(r,c.options.modifiers),f=s.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}),{}),Object.keys(f).map((function(e){return f[e]}))));return c.orderedModifiers=l.filter((function(e){return e.enabled})),c.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,r=e.effect;if("function"==typeof r){var i=r({state:c,name:t,instance:p,options:o}),a=function(){};u.push(i||a)}})),p.update()},forceUpdate:function(){if(!l){var e=c.elements,t=e.reference,n=e.popper;if(B(t,n)){var o,r,i,a;c.rects={reference:m(t,x(n),"fixed"===c.options.strategy),popper:(o=n,r=f(o),i=o.offsetWidth,a=o.offsetHeight,Math.abs(r.width-i)<=1&&(i=r.width),Math.abs(r.height-a)<=1&&(a=r.height),{x:o.offsetLeft,y:o.offsetTop,width:i,height:a})},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach((function(e){return c.modifiersData[e.name]=Object.assign({},e.data)}));for(var s=0;s<c.orderedModifiers.length;s++)if(!0!==c.reset){var u=c.orderedModifiers[s],d=u.fn,h=u.options,v=void 0===h?{}:h,g=u.name;"function"==typeof d&&(c=d({state:c,options:v,name:g,instance:p})||c)}else c.reset=!1,s=-1}}},update:(i=function(){return new Promise((function(e){p.forceUpdate(),e(c)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),l=!0}};if(!B(e,t))return p;function d(){u.forEach((function(e){return e()})),u=[]}return p.setOptions(o).then((function(e){!l&&o.onFirstUpdate&&o.onFirstUpdate(e)})),p}}var U={passive:!0};var q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function z(e){var n,o=e.popper,r=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,c=e.position,u=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=f.x,g=void 0===v?0:v,y=f.y,b=void 0===y?0:y,w="function"==typeof h?h({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var M=f.hasOwnProperty("x"),P=f.hasOwnProperty("y"),T=L,H=O,R=window;if(p){var D=x(o),k="clientHeight",S="clientWidth";if(D===t(o)&&"static"!==d(D=l(o)).position&&"absolute"===c&&(k="scrollHeight",S="scrollWidth"),D=D,i===O||(i===L||i===E)&&a===W)H=j,b-=(m&&D===R&&R.visualViewport?R.visualViewport.height:D[k])-r.height,b*=u?1:-1;if(i===L||(i===O||i===j)&&a===W)T=E,g-=(m&&D===R&&R.visualViewport?R.visualViewport.width:D[S])-r.width,g*=u?1:-1}var A,C=Object.assign({position:c},p&&q),N=!0===h?function(e){var t=e.x,n=e.y,o=window.devicePixelRatio||1;return{x:s(t*o)/o||0,y:s(n*o)/o||0}}({x:g,y:b}):{x:g,y:b};return g=N.x,b=N.y,u?Object.assign({},C,((A={})[H]=P?"0":"",A[T]=M?"0":"",A.transform=(R.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",A)):Object.assign({},C,((n={})[H]=P?b+"px":"",n[T]=M?g+"px":"",n.transform="",n))}var X=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,o=e.instance,r=e.options,i=r.scroll,a=void 0===i||i,s=r.resize,f=void 0===s||s,c=t(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",o.update,U)})),f&&c.addEventListener("resize",o.update,U),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",o.update,U)})),f&&c.removeEventListener("resize",o.update,U)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=N({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,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:D(t.placement),variation:C(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,z(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,z(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),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 n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];o(i)&&u(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]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});o(r)&&u(r)&&(Object.assign(r.style,a),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]}],Y=F({defaultModifiers:X});e.createPopper=Y,e.defaultModifiers=X,e.detectOverflow=function(e,t){void 0===t&&(t={});var o,r=t,s=r.placement,c=void 0===s?e.placement:s,u=r.boundary,p=void 0===u?"clippingParents":u,d=r.rootBoundary,h=void 0===d?P:d,m=r.elementContext,v=void 0===m?T:m,g=r.altBoundary,y=void 0!==g&&g,b=r.padding,w=void 0===b?0:b,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof w?w:(o=w,M.reduce((function(e,t){return e[t]=o,e}),{}))),L=v===T?"reference":T,W=e.rects.popper,H=e.elements[y?L:v],R=function(e,t,n){var o="clippingParents"===t?A(e):[].concat(t),r=[].concat(o,[n]),s=r[0],f=r.reduce((function(t,n){var o=S(e,n);return t.top=i(o.top,t.top),t.right=a(o.right,t.right),t.bottom=a(o.bottom,t.bottom),t.left=i(o.left,t.left),t}),S(e,s));return f.width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f}(n(H)?H:H.contextElement||l(e.elements.popper),p,h),D=f(e.elements.reference),C=N({reference:D,element:W,strategy:"absolute",placement:c}),V=k(Object.assign({},W,C)),B=v===T?V:D,F={top:R.top-B.top+x.top,bottom:B.bottom-R.bottom+x.bottom,left:R.left-B.left+x.left,right:B.right-R.right+x.right},U=e.modifiersData.offset;if(v===T&&U){var q=U[c];Object.keys(F).forEach((function(e){var t=[E,j].indexOf(e)>=0?1:-1,n=[O,j].indexOf(e)>=0?"y":"x";F[e]+=q[n]*t}))}return F},e.popperGenerator=F,Object.defineProperty(e,"__esModule",{value:!0})})); +
6//# sourceMappingURL=popper-lite.min.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-lite.min.js.flow b/web/_static/popperjs/popper-lite.min.js.flow new file mode 100644 index 0000000..d1b0261 --- /dev/null +++ b/web/_static/popperjs/popper-lite.min.js.flow @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

51 BFlowView Raw

No preview available.

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper-lite.min.js.map b/web/_static/popperjs/popper-lite.min.js.map new file mode 100644 index 0000000..d4ba1d3 --- /dev/null +++ b/web/_static/popperjs/popper-lite.min.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

77 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper-lite.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.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/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/getBasePlacement.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/utils/getVariation.js","../../src/utils/computeOffsets.js","../../src/utils/getMainAxisFromPlacement.js","../../src/createPopper.js","../../src/utils/debounce.js","../../src/utils/mergeByName.js","../../src/dom-utils/getLayoutRect.js","../../src/modifiers/eventListeners.js","../../src/modifiers/computeStyles.js","../../src/popper-lite.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/applyStyles.js","../../src/utils/detectOverflow.js","../../src/utils/expandToHashMap.js","../../src/utils/mergePaddingObject.js","../../src/utils/getFreshSideObject.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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 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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\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 { 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 );\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\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 Variation, type Placement } from '../enums';\n\nexport default function getVariation(placement: Placement): ?Variation {\n return (placement.split('-')[1]: any);\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 { 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","// @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\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 { 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\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 type { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments<Options>) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n isFixed,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n isFixed: boolean,\n}) {\n let { x = 0, y = 0 } = offsets;\n\n ({ x, y } =\n typeof roundOffsets === 'function'\n ? roundOffsets({ x, y })\n : { x, y });\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n const offsetY =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.height\n : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n const offsetX =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.width\n : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n ({ x, y } =\n roundOffsets === true\n ? roundOffsetsByDPR({ x, y })\n : { x, y });\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments<Options>) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n if (__DEV__) {\n const transitionProperty =\n getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(\n (property) => transitionProperty.indexOf(property) >= 0\n )\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.',\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === 'fixed',\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\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\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 type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\n };\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"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","scroll","offsets","clientLeft","clientTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","_element$ownerDocumen","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getOffsetParent","isFirefox","navigator","userAgent","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","basePlacements","end","viewport","popper","modifierPhases","order","modifiers","map","Map","visited","Set","result","sort","modifier","add","name","requires","requiresIfExists","forEach","dep","has","depModifier","get","push","set","getBasePlacement","placement","split","rectToClientRect","getClientRectFromMixedType","clippingParent","html","clientWidth","clientHeight","offsetLeft","offsetTop","getViewportRect","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingParents","clippingParents","clipperElement","parent","child","rootNode","getRootNode","contains","next","isSameNode","getVariation","computeOffsets","reference","basePlacement","variation","commonX","commonY","mainAxis","getMainAxisFromPlacement","len","DEFAULT_OPTIONS","strategy","areValidElements","args","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","options","fn","pending","state","orderedModifiers","modifiersData","elements","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","contextElement","merged","reduce","acc","phase","orderModifiers","current","existing","data","Object","keys","key","m","enabled","effect","cleanupFn","noopFn","update","forceUpdate","clientRect","rects","abs","reset","index","length","Promise","resolve","then","undefined","destroy","onFirstUpdate","passive","unsetSides","mapToStyles","popperRect","gpuAcceleration","adaptive","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","heightProp","widthProp","commonStyles","dpr","devicePixelRatio","roundOffsetsByDPR","resize","addEventListener","removeEventListener","popperOffsets","arrow","style","assign","value","removeAttribute","setAttribute","initialStyles","margin","property","attribute","createPopper","boundary","rootBoundary","elementContext","altBoundary","padding","paddingObject","mergePaddingObject","hashMap","altContext","clippingClientRect","mainClippingParents","firstClippingParent","clippingRect","accRect","getClippingRect","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","offset","multiply","axis"],"mappings":";;;;8OAIe,SAASA,EAAUC,MACpB,MAARA,SACKC,UAGe,oBAApBD,EAAKE,WAAkC,KACnCC,EAAgBH,EAAKG,qBACpBA,GAAgBA,EAAcC,aAAwBH,cAGxDD,ECTT,SAASK,EAAUL,UAEVA,aADYD,EAAUC,GAAMM,SACEN,aAAgBM,QAKvD,SAASC,EAAcP,UAEdA,aADYD,EAAUC,GAAMQ,aACER,aAAgBQ,YAKvD,SAASC,EAAaT,SAEM,oBAAfU,aAIJV,aADYD,EAAUC,GAAMU,YACEV,aAAgBU,YCxBhD,IAAMC,EAAMC,KAAKD,IACXE,EAAMD,KAAKC,IACXC,EAAQF,KAAKE,MCEX,SAASC,EACtBC,EACAC,YAAAA,IAAAA,GAAwB,OAElBC,EAAOF,EAAQD,wBACjBI,EAAS,EACTC,EAAS,KAETb,EAAcS,IAAYC,EAAc,KACpCI,EAAeL,EAAQK,aACvBC,EAA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QyE,EAAOE,GAAQD,YAIpCH"}
\No newline at end of file

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper.js b/web/_static/popperjs/popper.js new file mode 100644 index 0000000..b9ca1e8 --- /dev/null +++ b/web/_static/popperjs/popper.js @@ -0,0 +1,2062 @@ +UNPKG - @popperjs/core

UNPKG

70.8 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5(function (global, factory) { +
6 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +
7 typeof define === 'function' && define.amd ? define(['exports'], factory) : +
8 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {})); +
9}(this, (function (exports) { 'use strict'; +
10 +
11 function getWindow(node) { +
12 if (node == null) { +
13 return window; +
14 } +
15 +
16 if (node.toString() !== '[object Window]') { +
17 var ownerDocument = node.ownerDocument; +
18 return ownerDocument ? ownerDocument.defaultView || window : window; +
19 } +
20 +
21 return node; +
22 } +
23 +
24 function isElement(node) { +
25 var OwnElement = getWindow(node).Element; +
26 return node instanceof OwnElement || node instanceof Element; +
27 } +
28 +
29 function isHTMLElement(node) { +
30 var OwnElement = getWindow(node).HTMLElement; +
31 return node instanceof OwnElement || node instanceof HTMLElement; +
32 } +
33 +
34 function isShadowRoot(node) { +
35 // IE 11 has no ShadowRoot +
36 if (typeof ShadowRoot === 'undefined') { +
37 return false; +
38 } +
39 +
40 var OwnElement = getWindow(node).ShadowRoot; +
41 return node instanceof OwnElement || node instanceof ShadowRoot; +
42 } +
43 +
44 var max = Math.max; +
45 var min = Math.min; +
46 var round = Math.round; +
47 +
48 function getBoundingClientRect(element, includeScale) { +
49 if (includeScale === void 0) { +
50 includeScale = false; +
51 } +
52 +
53 var rect = element.getBoundingClientRect(); +
54 var scaleX = 1; +
55 var scaleY = 1; +
56 +
57 if (isHTMLElement(element) && includeScale) { +
58 var offsetHeight = element.offsetHeight; +
59 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale +
60 // Fallback to 1 in case both values are `0` +
61 +
62 if (offsetWidth > 0) { +
63 scaleX = round(rect.width) / offsetWidth || 1; +
64 } +
65 +
66 if (offsetHeight > 0) { +
67 scaleY = round(rect.height) / offsetHeight || 1; +
68 } +
69 } +
70 +
71 return { +
72 width: rect.width / scaleX, +
73 height: rect.height / scaleY, +
74 top: rect.top / scaleY, +
75 right: rect.right / scaleX, +
76 bottom: rect.bottom / scaleY, +
77 left: rect.left / scaleX, +
78 x: rect.left / scaleX, +
79 y: rect.top / scaleY +
80 }; +
81 } +
82 +
83 function getWindowScroll(node) { +
84 var win = getWindow(node); +
85 var scrollLeft = win.pageXOffset; +
86 var scrollTop = win.pageYOffset; +
87 return { +
88 scrollLeft: scrollLeft, +
89 scrollTop: scrollTop +
90 }; +
91 } +
92 +
93 function getHTMLElementScroll(element) { +
94 return { +
95 scrollLeft: element.scrollLeft, +
96 scrollTop: element.scrollTop +
97 }; +
98 } +
99 +
100 function getNodeScroll(node) { +
101 if (node === getWindow(node) || !isHTMLElement(node)) { +
102 return getWindowScroll(node); +
103 } else { +
104 return getHTMLElementScroll(node); +
105 } +
106 } +
107 +
108 function getNodeName(element) { +
109 return element ? (element.nodeName || '').toLowerCase() : null; +
110 } +
111 +
112 function getDocumentElement(element) { +
113 // $FlowFixMe[incompatible-return]: assume body is always available +
114 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] +
115 element.document) || window.document).documentElement; +
116 } +
117 +
118 function getWindowScrollBarX(element) { +
119 // If <html> has a CSS width greater than the viewport, then this will be +
120 // incorrect for RTL. +
121 // Popper 1 is broken in this case and never had a bug report so let's assume +
122 // it's not an issue. I don't think anyone ever specifies width on <html> +
123 // anyway. +
124 // Browsers where the left scrollbar doesn't cause an issue report `0` for +
125 // this (e.g. Edge 2019, IE11, Safari) +
126 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +
127 } +
128 +
129 function getComputedStyle(element) { +
130 return getWindow(element).getComputedStyle(element); +
131 } +
132 +
133 function isScrollParent(element) { +
134 // Firefox wants us to check `-x` and `-y` variations as well +
135 var _getComputedStyle = getComputedStyle(element), +
136 overflow = _getComputedStyle.overflow, +
137 overflowX = _getComputedStyle.overflowX, +
138 overflowY = _getComputedStyle.overflowY; +
139 +
140 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +
141 } +
142 +
143 function isElementScaled(element) { +
144 var rect = element.getBoundingClientRect(); +
145 var scaleX = round(rect.width) / element.offsetWidth || 1; +
146 var scaleY = round(rect.height) / element.offsetHeight || 1; +
147 return scaleX !== 1 || scaleY !== 1; +
148 } // Returns the composite rect of an element relative to its offsetParent. +
149 // Composite means it takes into account transforms as well as layout. +
150 +
151 +
152 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { +
153 if (isFixed === void 0) { +
154 isFixed = false; +
155 } +
156 +
157 var isOffsetParentAnElement = isHTMLElement(offsetParent); +
158 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); +
159 var documentElement = getDocumentElement(offsetParent); +
160 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); +
161 var scroll = { +
162 scrollLeft: 0, +
163 scrollTop: 0 +
164 }; +
165 var offsets = { +
166 x: 0, +
167 y: 0 +
168 }; +
169 +
170 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { +
171 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 +
172 isScrollParent(documentElement)) { +
173 scroll = getNodeScroll(offsetParent); +
174 } +
175 +
176 if (isHTMLElement(offsetParent)) { +
177 offsets = getBoundingClientRect(offsetParent, true); +
178 offsets.x += offsetParent.clientLeft; +
179 offsets.y += offsetParent.clientTop; +
180 } else if (documentElement) { +
181 offsets.x = getWindowScrollBarX(documentElement); +
182 } +
183 } +
184 +
185 return { +
186 x: rect.left + scroll.scrollLeft - offsets.x, +
187 y: rect.top + scroll.scrollTop - offsets.y, +
188 width: rect.width, +
189 height: rect.height +
190 }; +
191 } +
192 +
193 // means it doesn't take into account transforms. +
194 +
195 function getLayoutRect(element) { +
196 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. +
197 // Fixes https://github.com/popperjs/popper-core/issues/1223 +
198 +
199 var width = element.offsetWidth; +
200 var height = element.offsetHeight; +
201 +
202 if (Math.abs(clientRect.width - width) <= 1) { +
203 width = clientRect.width; +
204 } +
205 +
206 if (Math.abs(clientRect.height - height) <= 1) { +
207 height = clientRect.height; +
208 } +
209 +
210 return { +
211 x: element.offsetLeft, +
212 y: element.offsetTop, +
213 width: width, +
214 height: height +
215 }; +
216 } +
217 +
218 function getParentNode(element) { +
219 if (getNodeName(element) === 'html') { +
220 return element; +
221 } +
222 +
223 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle +
224 // $FlowFixMe[incompatible-return] +
225 // $FlowFixMe[prop-missing] +
226 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node +
227 element.parentNode || ( // DOM Element detected +
228 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected +
229 // $FlowFixMe[incompatible-call]: HTMLElement is a Node +
230 getDocumentElement(element) // fallback +
231 +
232 ); +
233 } +
234 +
235 function getScrollParent(node) { +
236 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { +
237 // $FlowFixMe[incompatible-return]: assume body is always available +
238 return node.ownerDocument.body; +
239 } +
240 +
241 if (isHTMLElement(node) && isScrollParent(node)) { +
242 return node; +
243 } +
244 +
245 return getScrollParent(getParentNode(node)); +
246 } +
247 +
248 /* +
249 given a DOM element, return the list of all scroll parents, up the list of ancesors +
250 until we get to the top window object. This list is what we attach scroll listeners +
251 to, because if any of these parent elements scroll, we'll need to re-calculate the +
252 reference element's position. +
253 */ +
254 +
255 function listScrollParents(element, list) { +
256 var _element$ownerDocumen; +
257 +
258 if (list === void 0) { +
259 list = []; +
260 } +
261 +
262 var scrollParent = getScrollParent(element); +
263 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); +
264 var win = getWindow(scrollParent); +
265 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; +
266 var updatedList = list.concat(target); +
267 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here +
268 updatedList.concat(listScrollParents(getParentNode(target))); +
269 } +
270 +
271 function isTableElement(element) { +
272 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +
273 } +
274 +
275 function getTrueOffsetParent(element) { +
276 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 +
277 getComputedStyle(element).position === 'fixed') { +
278 return null; +
279 } +
280 +
281 return element.offsetParent; +
282 } // `.offsetParent` reports `null` for fixed elements, while absolute elements +
283 // return the containing block +
284 +
285 +
286 function getContainingBlock(element) { +
287 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; +
288 var isIE = navigator.userAgent.indexOf('Trident') !== -1; +
289 +
290 if (isIE && isHTMLElement(element)) { +
291 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport +
292 var elementCss = getComputedStyle(element); +
293 +
294 if (elementCss.position === 'fixed') { +
295 return null; +
296 } +
297 } +
298 +
299 var currentNode = getParentNode(element); +
300 +
301 if (isShadowRoot(currentNode)) { +
302 currentNode = currentNode.host; +
303 } +
304 +
305 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { +
306 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that +
307 // create a containing block. +
308 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block +
309 +
310 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { +
311 return currentNode; +
312 } else { +
313 currentNode = currentNode.parentNode; +
314 } +
315 } +
316 +
317 return null; +
318 } // Gets the closest ancestor positioned element. Handles some edge cases, +
319 // such as table ancestors and cross browser bugs. +
320 +
321 +
322 function getOffsetParent(element) { +
323 var window = getWindow(element); +
324 var offsetParent = getTrueOffsetParent(element); +
325 +
326 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { +
327 offsetParent = getTrueOffsetParent(offsetParent); +
328 } +
329 +
330 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { +
331 return window; +
332 } +
333 +
334 return offsetParent || getContainingBlock(element) || window; +
335 } +
336 +
337 var top = 'top'; +
338 var bottom = 'bottom'; +
339 var right = 'right'; +
340 var left = 'left'; +
341 var auto = 'auto'; +
342 var basePlacements = [top, bottom, right, left]; +
343 var start = 'start'; +
344 var end = 'end'; +
345 var clippingParents = 'clippingParents'; +
346 var viewport = 'viewport'; +
347 var popper = 'popper'; +
348 var reference = 'reference'; +
349 var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { +
350 return acc.concat([placement + "-" + start, placement + "-" + end]); +
351 }, []); +
352 var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { +
353 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +
354 }, []); // modifiers that need to read the DOM +
355 +
356 var beforeRead = 'beforeRead'; +
357 var read = 'read'; +
358 var afterRead = 'afterRead'; // pure-logic modifiers +
359 +
360 var beforeMain = 'beforeMain'; +
361 var main = 'main'; +
362 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) +
363 +
364 var beforeWrite = 'beforeWrite'; +
365 var write = 'write'; +
366 var afterWrite = 'afterWrite'; +
367 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +
368 +
369 function order(modifiers) { +
370 var map = new Map(); +
371 var visited = new Set(); +
372 var result = []; +
373 modifiers.forEach(function (modifier) { +
374 map.set(modifier.name, modifier); +
375 }); // On visiting object, check for its dependencies and visit them recursively +
376 +
377 function sort(modifier) { +
378 visited.add(modifier.name); +
379 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); +
380 requires.forEach(function (dep) { +
381 if (!visited.has(dep)) { +
382 var depModifier = map.get(dep); +
383 +
384 if (depModifier) { +
385 sort(depModifier); +
386 } +
387 } +
388 }); +
389 result.push(modifier); +
390 } +
391 +
392 modifiers.forEach(function (modifier) { +
393 if (!visited.has(modifier.name)) { +
394 // check for visited object +
395 sort(modifier); +
396 } +
397 }); +
398 return result; +
399 } +
400 +
401 function orderModifiers(modifiers) { +
402 // order based on dependencies +
403 var orderedModifiers = order(modifiers); // order based on phase +
404 +
405 return modifierPhases.reduce(function (acc, phase) { +
406 return acc.concat(orderedModifiers.filter(function (modifier) { +
407 return modifier.phase === phase; +
408 })); +
409 }, []); +
410 } +
411 +
412 function debounce(fn) { +
413 var pending; +
414 return function () { +
415 if (!pending) { +
416 pending = new Promise(function (resolve) { +
417 Promise.resolve().then(function () { +
418 pending = undefined; +
419 resolve(fn()); +
420 }); +
421 }); +
422 } +
423 +
424 return pending; +
425 }; +
426 } +
427 +
428 function format(str) { +
429 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { +
430 args[_key - 1] = arguments[_key]; +
431 } +
432 +
433 return [].concat(args).reduce(function (p, c) { +
434 return p.replace(/%s/, c); +
435 }, str); +
436 } +
437 +
438 var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; +
439 var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; +
440 var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; +
441 function validateModifiers(modifiers) { +
442 modifiers.forEach(function (modifier) { +
443 [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)` +
444 .filter(function (value, index, self) { +
445 return self.indexOf(value) === index; +
446 }).forEach(function (key) { +
447 switch (key) { +
448 case 'name': +
449 if (typeof modifier.name !== 'string') { +
450 console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); +
451 } +
452 +
453 break; +
454 +
455 case 'enabled': +
456 if (typeof modifier.enabled !== 'boolean') { +
457 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); +
458 } +
459 +
460 break; +
461 +
462 case 'phase': +
463 if (modifierPhases.indexOf(modifier.phase) < 0) { +
464 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); +
465 } +
466 +
467 break; +
468 +
469 case 'fn': +
470 if (typeof modifier.fn !== 'function') { +
471 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); +
472 } +
473 +
474 break; +
475 +
476 case 'effect': +
477 if (modifier.effect != null && typeof modifier.effect !== 'function') { +
478 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); +
479 } +
480 +
481 break; +
482 +
483 case 'requires': +
484 if (modifier.requires != null && !Array.isArray(modifier.requires)) { +
485 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); +
486 } +
487 +
488 break; +
489 +
490 case 'requiresIfExists': +
491 if (!Array.isArray(modifier.requiresIfExists)) { +
492 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); +
493 } +
494 +
495 break; +
496 +
497 case 'options': +
498 case 'data': +
499 break; +
500 +
501 default: +
502 console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { +
503 return "\"" + s + "\""; +
504 }).join(', ') + "; but \"" + key + "\" was provided."); +
505 } +
506 +
507 modifier.requires && modifier.requires.forEach(function (requirement) { +
508 if (modifiers.find(function (mod) { +
509 return mod.name === requirement; +
510 }) == null) { +
511 console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); +
512 } +
513 }); +
514 }); +
515 }); +
516 } +
517 +
518 function uniqueBy(arr, fn) { +
519 var identifiers = new Set(); +
520 return arr.filter(function (item) { +
521 var identifier = fn(item); +
522 +
523 if (!identifiers.has(identifier)) { +
524 identifiers.add(identifier); +
525 return true; +
526 } +
527 }); +
528 } +
529 +
530 function getBasePlacement(placement) { +
531 return placement.split('-')[0]; +
532 } +
533 +
534 function mergeByName(modifiers) { +
535 var merged = modifiers.reduce(function (merged, current) { +
536 var existing = merged[current.name]; +
537 merged[current.name] = existing ? Object.assign({}, existing, current, { +
538 options: Object.assign({}, existing.options, current.options), +
539 data: Object.assign({}, existing.data, current.data) +
540 }) : current; +
541 return merged; +
542 }, {}); // IE11 does not support Object.values +
543 +
544 return Object.keys(merged).map(function (key) { +
545 return merged[key]; +
546 }); +
547 } +
548 +
549 function getViewportRect(element) { +
550 var win = getWindow(element); +
551 var html = getDocumentElement(element); +
552 var visualViewport = win.visualViewport; +
553 var width = html.clientWidth; +
554 var height = html.clientHeight; +
555 var x = 0; +
556 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper +
557 // can be obscured underneath it. +
558 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even +
559 // if it isn't open, so if this isn't available, the popper will be detected +
560 // to overflow the bottom of the screen too early. +
561 +
562 if (visualViewport) { +
563 width = visualViewport.width; +
564 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) +
565 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding +
566 // errors due to floating point numbers, so we need to check precision. +
567 // Safari returns a number <= 0, usually < -1 when pinch-zoomed +
568 // Feature detection fails in mobile emulation mode in Chrome. +
569 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < +
570 // 0.001 +
571 // Fallback here: "Not Safari" userAgent +
572 +
573 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { +
574 x = visualViewport.offsetLeft; +
575 y = visualViewport.offsetTop; +
576 } +
577 } +
578 +
579 return { +
580 width: width, +
581 height: height, +
582 x: x + getWindowScrollBarX(element), +
583 y: y +
584 }; +
585 } +
586 +
587 // of the `<html>` and `<body>` rect bounds if horizontally scrollable +
588 +
589 function getDocumentRect(element) { +
590 var _element$ownerDocumen; +
591 +
592 var html = getDocumentElement(element); +
593 var winScroll = getWindowScroll(element); +
594 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; +
595 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); +
596 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); +
597 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); +
598 var y = -winScroll.scrollTop; +
599 +
600 if (getComputedStyle(body || html).direction === 'rtl') { +
601 x += max(html.clientWidth, body ? body.clientWidth : 0) - width; +
602 } +
603 +
604 return { +
605 width: width, +
606 height: height, +
607 x: x, +
608 y: y +
609 }; +
610 } +
611 +
612 function contains(parent, child) { +
613 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method +
614 +
615 if (parent.contains(child)) { +
616 return true; +
617 } // then fallback to custom implementation with Shadow DOM support +
618 else if (rootNode && isShadowRoot(rootNode)) { +
619 var next = child; +
620 +
621 do { +
622 if (next && parent.isSameNode(next)) { +
623 return true; +
624 } // $FlowFixMe[prop-missing]: need a better way to handle this... +
625 +
626 +
627 next = next.parentNode || next.host; +
628 } while (next); +
629 } // Give up, the result is false +
630 +
631 +
632 return false; +
633 } +
634 +
635 function rectToClientRect(rect) { +
636 return Object.assign({}, rect, { +
637 left: rect.x, +
638 top: rect.y, +
639 right: rect.x + rect.width, +
640 bottom: rect.y + rect.height +
641 }); +
642 } +
643 +
644 function getInnerBoundingClientRect(element) { +
645 var rect = getBoundingClientRect(element); +
646 rect.top = rect.top + element.clientTop; +
647 rect.left = rect.left + element.clientLeft; +
648 rect.bottom = rect.top + element.clientHeight; +
649 rect.right = rect.left + element.clientWidth; +
650 rect.width = element.clientWidth; +
651 rect.height = element.clientHeight; +
652 rect.x = rect.left; +
653 rect.y = rect.top; +
654 return rect; +
655 } +
656 +
657 function getClientRectFromMixedType(element, clippingParent) { +
658 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +
659 } // A "clipping parent" is an overflowable container with the characteristic of +
660 // clipping (or hiding) overflowing elements with a position different from +
661 // `initial` +
662 +
663 +
664 function getClippingParents(element) { +
665 var clippingParents = listScrollParents(getParentNode(element)); +
666 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; +
667 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; +
668 +
669 if (!isElement(clipperElement)) { +
670 return []; +
671 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 +
672 +
673 +
674 return clippingParents.filter(function (clippingParent) { +
675 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; +
676 }); +
677 } // Gets the maximum area that the element is visible in due to any number of +
678 // clipping parents +
679 +
680 +
681 function getClippingRect(element, boundary, rootBoundary) { +
682 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); +
683 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); +
684 var firstClippingParent = clippingParents[0]; +
685 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { +
686 var rect = getClientRectFromMixedType(element, clippingParent); +
687 accRect.top = max(rect.top, accRect.top); +
688 accRect.right = min(rect.right, accRect.right); +
689 accRect.bottom = min(rect.bottom, accRect.bottom); +
690 accRect.left = max(rect.left, accRect.left); +
691 return accRect; +
692 }, getClientRectFromMixedType(element, firstClippingParent)); +
693 clippingRect.width = clippingRect.right - clippingRect.left; +
694 clippingRect.height = clippingRect.bottom - clippingRect.top; +
695 clippingRect.x = clippingRect.left; +
696 clippingRect.y = clippingRect.top; +
697 return clippingRect; +
698 } +
699 +
700 function getVariation(placement) { +
701 return placement.split('-')[1]; +
702 } +
703 +
704 function getMainAxisFromPlacement(placement) { +
705 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +
706 } +
707 +
708 function computeOffsets(_ref) { +
709 var reference = _ref.reference, +
710 element = _ref.element, +
711 placement = _ref.placement; +
712 var basePlacement = placement ? getBasePlacement(placement) : null; +
713 var variation = placement ? getVariation(placement) : null; +
714 var commonX = reference.x + reference.width / 2 - element.width / 2; +
715 var commonY = reference.y + reference.height / 2 - element.height / 2; +
716 var offsets; +
717 +
718 switch (basePlacement) { +
719 case top: +
720 offsets = { +
721 x: commonX, +
722 y: reference.y - element.height +
723 }; +
724 break; +
725 +
726 case bottom: +
727 offsets = { +
728 x: commonX, +
729 y: reference.y + reference.height +
730 }; +
731 break; +
732 +
733 case right: +
734 offsets = { +
735 x: reference.x + reference.width, +
736 y: commonY +
737 }; +
738 break; +
739 +
740 case left: +
741 offsets = { +
742 x: reference.x - element.width, +
743 y: commonY +
744 }; +
745 break; +
746 +
747 default: +
748 offsets = { +
749 x: reference.x, +
750 y: reference.y +
751 }; +
752 } +
753 +
754 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; +
755 +
756 if (mainAxis != null) { +
757 var len = mainAxis === 'y' ? 'height' : 'width'; +
758 +
759 switch (variation) { +
760 case start: +
761 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); +
762 break; +
763 +
764 case end: +
765 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); +
766 break; +
767 } +
768 } +
769 +
770 return offsets; +
771 } +
772 +
773 function getFreshSideObject() { +
774 return { +
775 top: 0, +
776 right: 0, +
777 bottom: 0, +
778 left: 0 +
779 }; +
780 } +
781 +
782 function mergePaddingObject(paddingObject) { +
783 return Object.assign({}, getFreshSideObject(), paddingObject); +
784 } +
785 +
786 function expandToHashMap(value, keys) { +
787 return keys.reduce(function (hashMap, key) { +
788 hashMap[key] = value; +
789 return hashMap; +
790 }, {}); +
791 } +
792 +
793 function detectOverflow(state, options) { +
794 if (options === void 0) { +
795 options = {}; +
796 } +
797 +
798 var _options = options, +
799 _options$placement = _options.placement, +
800 placement = _options$placement === void 0 ? state.placement : _options$placement, +
801 _options$boundary = _options.boundary, +
802 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, +
803 _options$rootBoundary = _options.rootBoundary, +
804 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, +
805 _options$elementConte = _options.elementContext, +
806 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, +
807 _options$altBoundary = _options.altBoundary, +
808 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, +
809 _options$padding = _options.padding, +
810 padding = _options$padding === void 0 ? 0 : _options$padding; +
811 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +
812 var altContext = elementContext === popper ? reference : popper; +
813 var popperRect = state.rects.popper; +
814 var element = state.elements[altBoundary ? altContext : elementContext]; +
815 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); +
816 var referenceClientRect = getBoundingClientRect(state.elements.reference); +
817 var popperOffsets = computeOffsets({ +
818 reference: referenceClientRect, +
819 element: popperRect, +
820 strategy: 'absolute', +
821 placement: placement +
822 }); +
823 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); +
824 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect +
825 // 0 or negative = within the clipping rect +
826 +
827 var overflowOffsets = { +
828 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, +
829 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, +
830 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, +
831 right: elementClientRect.right - clippingClientRect.right + paddingObject.right +
832 }; +
833 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element +
834 +
835 if (elementContext === popper && offsetData) { +
836 var offset = offsetData[placement]; +
837 Object.keys(overflowOffsets).forEach(function (key) { +
838 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; +
839 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; +
840 overflowOffsets[key] += offset[axis] * multiply; +
841 }); +
842 } +
843 +
844 return overflowOffsets; +
845 } +
846 +
847 var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +
848 var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +
849 var DEFAULT_OPTIONS = { +
850 placement: 'bottom', +
851 modifiers: [], +
852 strategy: 'absolute' +
853 }; +
854 +
855 function areValidElements() { +
856 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { +
857 args[_key] = arguments[_key]; +
858 } +
859 +
860 return !args.some(function (element) { +
861 return !(element && typeof element.getBoundingClientRect === 'function'); +
862 }); +
863 } +
864 +
865 function popperGenerator(generatorOptions) { +
866 if (generatorOptions === void 0) { +
867 generatorOptions = {}; +
868 } +
869 +
870 var _generatorOptions = generatorOptions, +
871 _generatorOptions$def = _generatorOptions.defaultModifiers, +
872 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, +
873 _generatorOptions$def2 = _generatorOptions.defaultOptions, +
874 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; +
875 return function createPopper(reference, popper, options) { +
876 if (options === void 0) { +
877 options = defaultOptions; +
878 } +
879 +
880 var state = { +
881 placement: 'bottom', +
882 orderedModifiers: [], +
883 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), +
884 modifiersData: {}, +
885 elements: { +
886 reference: reference, +
887 popper: popper +
888 }, +
889 attributes: {}, +
890 styles: {} +
891 }; +
892 var effectCleanupFns = []; +
893 var isDestroyed = false; +
894 var instance = { +
895 state: state, +
896 setOptions: function setOptions(setOptionsAction) { +
897 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; +
898 cleanupModifierEffects(); +
899 state.options = Object.assign({}, defaultOptions, state.options, options); +
900 state.scrollParents = { +
901 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], +
902 popper: listScrollParents(popper) +
903 }; // Orders the modifiers based on their dependencies and `phase` +
904 // properties +
905 +
906 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers +
907 +
908 state.orderedModifiers = orderedModifiers.filter(function (m) { +
909 return m.enabled; +
910 }); // Validate the provided modifiers so that the consumer will get warned +
911 // if one of the modifiers is invalid for any reason +
912 +
913 { +
914 var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { +
915 var name = _ref.name; +
916 return name; +
917 }); +
918 validateModifiers(modifiers); +
919 +
920 if (getBasePlacement(state.options.placement) === auto) { +
921 var flipModifier = state.orderedModifiers.find(function (_ref2) { +
922 var name = _ref2.name; +
923 return name === 'flip'; +
924 }); +
925 +
926 if (!flipModifier) { +
927 console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); +
928 } +
929 } +
930 +
931 var _getComputedStyle = getComputedStyle(popper), +
932 marginTop = _getComputedStyle.marginTop, +
933 marginRight = _getComputedStyle.marginRight, +
934 marginBottom = _getComputedStyle.marginBottom, +
935 marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can +
936 // cause bugs with positioning, so we'll warn the consumer +
937 +
938 +
939 if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { +
940 return parseFloat(margin); +
941 })) { +
942 console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); +
943 } +
944 } +
945 +
946 runModifierEffects(); +
947 return instance.update(); +
948 }, +
949 // Sync update – it will always be executed, even if not necessary. This +
950 // is useful for low frequency updates where sync behavior simplifies the +
951 // logic. +
952 // For high frequency updates (e.g. `resize` and `scroll` events), always +
953 // prefer the async Popper#update method +
954 forceUpdate: function forceUpdate() { +
955 if (isDestroyed) { +
956 return; +
957 } +
958 +
959 var _state$elements = state.elements, +
960 reference = _state$elements.reference, +
961 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements +
962 // anymore +
963 +
964 if (!areValidElements(reference, popper)) { +
965 { +
966 console.error(INVALID_ELEMENT_ERROR); +
967 } +
968 +
969 return; +
970 } // Store the reference and popper rects to be read by modifiers +
971 +
972 +
973 state.rects = { +
974 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), +
975 popper: getLayoutRect(popper) +
976 }; // Modifiers have the ability to reset the current update cycle. The +
977 // most common use case for this is the `flip` modifier changing the +
978 // placement, which then needs to re-run all the modifiers, because the +
979 // logic was previously ran for the previous placement and is therefore +
980 // stale/incorrect +
981 +
982 state.reset = false; +
983 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier +
984 // is filled with the initial data specified by the modifier. This means +
985 // it doesn't persist and is fresh on each update. +
986 // To ensure persistent data, use `${name}#persistent` +
987 +
988 state.orderedModifiers.forEach(function (modifier) { +
989 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); +
990 }); +
991 var __debug_loops__ = 0; +
992 +
993 for (var index = 0; index < state.orderedModifiers.length; index++) { +
994 { +
995 __debug_loops__ += 1; +
996 +
997 if (__debug_loops__ > 100) { +
998 console.error(INFINITE_LOOP_ERROR); +
999 break; +
1000 } +
1001 } +
1002 +
1003 if (state.reset === true) { +
1004 state.reset = false; +
1005 index = -1; +
1006 continue; +
1007 } +
1008 +
1009 var _state$orderedModifie = state.orderedModifiers[index], +
1010 fn = _state$orderedModifie.fn, +
1011 _state$orderedModifie2 = _state$orderedModifie.options, +
1012 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, +
1013 name = _state$orderedModifie.name; +
1014 +
1015 if (typeof fn === 'function') { +
1016 state = fn({ +
1017 state: state, +
1018 options: _options, +
1019 name: name, +
1020 instance: instance +
1021 }) || state; +
1022 } +
1023 } +
1024 }, +
1025 // Async and optimistically optimized update – it will not be executed if +
1026 // not necessary (debounced to run at most once-per-tick) +
1027 update: debounce(function () { +
1028 return new Promise(function (resolve) { +
1029 instance.forceUpdate(); +
1030 resolve(state); +
1031 }); +
1032 }), +
1033 destroy: function destroy() { +
1034 cleanupModifierEffects(); +
1035 isDestroyed = true; +
1036 } +
1037 }; +
1038 +
1039 if (!areValidElements(reference, popper)) { +
1040 { +
1041 console.error(INVALID_ELEMENT_ERROR); +
1042 } +
1043 +
1044 return instance; +
1045 } +
1046 +
1047 instance.setOptions(options).then(function (state) { +
1048 if (!isDestroyed && options.onFirstUpdate) { +
1049 options.onFirstUpdate(state); +
1050 } +
1051 }); // Modifiers have the ability to execute arbitrary code before the first +
1052 // update cycle runs. They will be executed in the same order as the update +
1053 // cycle. This is useful when a modifier adds some persistent data that +
1054 // other modifiers need to use, but the modifier is run after the dependent +
1055 // one. +
1056 +
1057 function runModifierEffects() { +
1058 state.orderedModifiers.forEach(function (_ref3) { +
1059 var name = _ref3.name, +
1060 _ref3$options = _ref3.options, +
1061 options = _ref3$options === void 0 ? {} : _ref3$options, +
1062 effect = _ref3.effect; +
1063 +
1064 if (typeof effect === 'function') { +
1065 var cleanupFn = effect({ +
1066 state: state, +
1067 name: name, +
1068 instance: instance, +
1069 options: options +
1070 }); +
1071 +
1072 var noopFn = function noopFn() {}; +
1073 +
1074 effectCleanupFns.push(cleanupFn || noopFn); +
1075 } +
1076 }); +
1077 } +
1078 +
1079 function cleanupModifierEffects() { +
1080 effectCleanupFns.forEach(function (fn) { +
1081 return fn(); +
1082 }); +
1083 effectCleanupFns = []; +
1084 } +
1085 +
1086 return instance; +
1087 }; +
1088 } +
1089 +
1090 var passive = { +
1091 passive: true +
1092 }; +
1093 +
1094 function effect$2(_ref) { +
1095 var state = _ref.state, +
1096 instance = _ref.instance, +
1097 options = _ref.options; +
1098 var _options$scroll = options.scroll, +
1099 scroll = _options$scroll === void 0 ? true : _options$scroll, +
1100 _options$resize = options.resize, +
1101 resize = _options$resize === void 0 ? true : _options$resize; +
1102 var window = getWindow(state.elements.popper); +
1103 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); +
1104 +
1105 if (scroll) { +
1106 scrollParents.forEach(function (scrollParent) { +
1107 scrollParent.addEventListener('scroll', instance.update, passive); +
1108 }); +
1109 } +
1110 +
1111 if (resize) { +
1112 window.addEventListener('resize', instance.update, passive); +
1113 } +
1114 +
1115 return function () { +
1116 if (scroll) { +
1117 scrollParents.forEach(function (scrollParent) { +
1118 scrollParent.removeEventListener('scroll', instance.update, passive); +
1119 }); +
1120 } +
1121 +
1122 if (resize) { +
1123 window.removeEventListener('resize', instance.update, passive); +
1124 } +
1125 }; +
1126 } // eslint-disable-next-line import/no-unused-modules +
1127 +
1128 +
1129 var eventListeners = { +
1130 name: 'eventListeners', +
1131 enabled: true, +
1132 phase: 'write', +
1133 fn: function fn() {}, +
1134 effect: effect$2, +
1135 data: {} +
1136 }; +
1137 +
1138 function popperOffsets(_ref) { +
1139 var state = _ref.state, +
1140 name = _ref.name; +
1141 // Offsets are the actual position the popper needs to have to be +
1142 // properly positioned near its reference element +
1143 // This is the most basic placement, and will be adjusted by +
1144 // the modifiers in the next step +
1145 state.modifiersData[name] = computeOffsets({ +
1146 reference: state.rects.reference, +
1147 element: state.rects.popper, +
1148 strategy: 'absolute', +
1149 placement: state.placement +
1150 }); +
1151 } // eslint-disable-next-line import/no-unused-modules +
1152 +
1153 +
1154 var popperOffsets$1 = { +
1155 name: 'popperOffsets', +
1156 enabled: true, +
1157 phase: 'read', +
1158 fn: popperOffsets, +
1159 data: {} +
1160 }; +
1161 +
1162 var unsetSides = { +
1163 top: 'auto', +
1164 right: 'auto', +
1165 bottom: 'auto', +
1166 left: 'auto' +
1167 }; // Round the offsets to the nearest suitable subpixel based on the DPR. +
1168 // Zooming can change the DPR, but it seems to report a value that will +
1169 // cleanly divide the values into the appropriate subpixels. +
1170 +
1171 function roundOffsetsByDPR(_ref) { +
1172 var x = _ref.x, +
1173 y = _ref.y; +
1174 var win = window; +
1175 var dpr = win.devicePixelRatio || 1; +
1176 return { +
1177 x: round(x * dpr) / dpr || 0, +
1178 y: round(y * dpr) / dpr || 0 +
1179 }; +
1180 } +
1181 +
1182 function mapToStyles(_ref2) { +
1183 var _Object$assign2; +
1184 +
1185 var popper = _ref2.popper, +
1186 popperRect = _ref2.popperRect, +
1187 placement = _ref2.placement, +
1188 variation = _ref2.variation, +
1189 offsets = _ref2.offsets, +
1190 position = _ref2.position, +
1191 gpuAcceleration = _ref2.gpuAcceleration, +
1192 adaptive = _ref2.adaptive, +
1193 roundOffsets = _ref2.roundOffsets, +
1194 isFixed = _ref2.isFixed; +
1195 var _offsets$x = offsets.x, +
1196 x = _offsets$x === void 0 ? 0 : _offsets$x, +
1197 _offsets$y = offsets.y, +
1198 y = _offsets$y === void 0 ? 0 : _offsets$y; +
1199 +
1200 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ +
1201 x: x, +
1202 y: y +
1203 }) : { +
1204 x: x, +
1205 y: y +
1206 }; +
1207 +
1208 x = _ref3.x; +
1209 y = _ref3.y; +
1210 var hasX = offsets.hasOwnProperty('x'); +
1211 var hasY = offsets.hasOwnProperty('y'); +
1212 var sideX = left; +
1213 var sideY = top; +
1214 var win = window; +
1215 +
1216 if (adaptive) { +
1217 var offsetParent = getOffsetParent(popper); +
1218 var heightProp = 'clientHeight'; +
1219 var widthProp = 'clientWidth'; +
1220 +
1221 if (offsetParent === getWindow(popper)) { +
1222 offsetParent = getDocumentElement(popper); +
1223 +
1224 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { +
1225 heightProp = 'scrollHeight'; +
1226 widthProp = 'scrollWidth'; +
1227 } +
1228 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it +
1229 +
1230 +
1231 offsetParent = offsetParent; +
1232 +
1233 if (placement === top || (placement === left || placement === right) && variation === end) { +
1234 sideY = bottom; +
1235 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] +
1236 offsetParent[heightProp]; +
1237 y -= offsetY - popperRect.height; +
1238 y *= gpuAcceleration ? 1 : -1; +
1239 } +
1240 +
1241 if (placement === left || (placement === top || placement === bottom) && variation === end) { +
1242 sideX = right; +
1243 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] +
1244 offsetParent[widthProp]; +
1245 x -= offsetX - popperRect.width; +
1246 x *= gpuAcceleration ? 1 : -1; +
1247 } +
1248 } +
1249 +
1250 var commonStyles = Object.assign({ +
1251 position: position +
1252 }, adaptive && unsetSides); +
1253 +
1254 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ +
1255 x: x, +
1256 y: y +
1257 }) : { +
1258 x: x, +
1259 y: y +
1260 }; +
1261 +
1262 x = _ref4.x; +
1263 y = _ref4.y; +
1264 +
1265 if (gpuAcceleration) { +
1266 var _Object$assign; +
1267 +
1268 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); +
1269 } +
1270 +
1271 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +
1272 } +
1273 +
1274 function computeStyles(_ref5) { +
1275 var state = _ref5.state, +
1276 options = _ref5.options; +
1277 var _options$gpuAccelerat = options.gpuAcceleration, +
1278 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, +
1279 _options$adaptive = options.adaptive, +
1280 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, +
1281 _options$roundOffsets = options.roundOffsets, +
1282 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; +
1283 +
1284 { +
1285 var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ''; +
1286 +
1287 if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) { +
1288 return transitionProperty.indexOf(property) >= 0; +
1289 })) { +
1290 console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' ')); +
1291 } +
1292 } +
1293 +
1294 var commonStyles = { +
1295 placement: getBasePlacement(state.placement), +
1296 variation: getVariation(state.placement), +
1297 popper: state.elements.popper, +
1298 popperRect: state.rects.popper, +
1299 gpuAcceleration: gpuAcceleration, +
1300 isFixed: state.options.strategy === 'fixed' +
1301 }; +
1302 +
1303 if (state.modifiersData.popperOffsets != null) { +
1304 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { +
1305 offsets: state.modifiersData.popperOffsets, +
1306 position: state.options.strategy, +
1307 adaptive: adaptive, +
1308 roundOffsets: roundOffsets +
1309 }))); +
1310 } +
1311 +
1312 if (state.modifiersData.arrow != null) { +
1313 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { +
1314 offsets: state.modifiersData.arrow, +
1315 position: 'absolute', +
1316 adaptive: false, +
1317 roundOffsets: roundOffsets +
1318 }))); +
1319 } +
1320 +
1321 state.attributes.popper = Object.assign({}, state.attributes.popper, { +
1322 'data-popper-placement': state.placement +
1323 }); +
1324 } // eslint-disable-next-line import/no-unused-modules +
1325 +
1326 +
1327 var computeStyles$1 = { +
1328 name: 'computeStyles', +
1329 enabled: true, +
1330 phase: 'beforeWrite', +
1331 fn: computeStyles, +
1332 data: {} +
1333 }; +
1334 +
1335 // and applies them to the HTMLElements such as popper and arrow +
1336 +
1337 function applyStyles(_ref) { +
1338 var state = _ref.state; +
1339 Object.keys(state.elements).forEach(function (name) { +
1340 var style = state.styles[name] || {}; +
1341 var attributes = state.attributes[name] || {}; +
1342 var element = state.elements[name]; // arrow is optional + virtual elements +
1343 +
1344 if (!isHTMLElement(element) || !getNodeName(element)) { +
1345 return; +
1346 } // Flow doesn't support to extend this property, but it's the most +
1347 // effective way to apply styles to an HTMLElement +
1348 // $FlowFixMe[cannot-write] +
1349 +
1350 +
1351 Object.assign(element.style, style); +
1352 Object.keys(attributes).forEach(function (name) { +
1353 var value = attributes[name]; +
1354 +
1355 if (value === false) { +
1356 element.removeAttribute(name); +
1357 } else { +
1358 element.setAttribute(name, value === true ? '' : value); +
1359 } +
1360 }); +
1361 }); +
1362 } +
1363 +
1364 function effect$1(_ref2) { +
1365 var state = _ref2.state; +
1366 var initialStyles = { +
1367 popper: { +
1368 position: state.options.strategy, +
1369 left: '0', +
1370 top: '0', +
1371 margin: '0' +
1372 }, +
1373 arrow: { +
1374 position: 'absolute' +
1375 }, +
1376 reference: {} +
1377 }; +
1378 Object.assign(state.elements.popper.style, initialStyles.popper); +
1379 state.styles = initialStyles; +
1380 +
1381 if (state.elements.arrow) { +
1382 Object.assign(state.elements.arrow.style, initialStyles.arrow); +
1383 } +
1384 +
1385 return function () { +
1386 Object.keys(state.elements).forEach(function (name) { +
1387 var element = state.elements[name]; +
1388 var attributes = state.attributes[name] || {}; +
1389 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them +
1390 +
1391 var style = styleProperties.reduce(function (style, property) { +
1392 style[property] = ''; +
1393 return style; +
1394 }, {}); // arrow is optional + virtual elements +
1395 +
1396 if (!isHTMLElement(element) || !getNodeName(element)) { +
1397 return; +
1398 } +
1399 +
1400 Object.assign(element.style, style); +
1401 Object.keys(attributes).forEach(function (attribute) { +
1402 element.removeAttribute(attribute); +
1403 }); +
1404 }); +
1405 }; +
1406 } // eslint-disable-next-line import/no-unused-modules +
1407 +
1408 +
1409 var applyStyles$1 = { +
1410 name: 'applyStyles', +
1411 enabled: true, +
1412 phase: 'write', +
1413 fn: applyStyles, +
1414 effect: effect$1, +
1415 requires: ['computeStyles'] +
1416 }; +
1417 +
1418 function distanceAndSkiddingToXY(placement, rects, offset) { +
1419 var basePlacement = getBasePlacement(placement); +
1420 var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; +
1421 +
1422 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { +
1423 placement: placement +
1424 })) : offset, +
1425 skidding = _ref[0], +
1426 distance = _ref[1]; +
1427 +
1428 skidding = skidding || 0; +
1429 distance = (distance || 0) * invertDistance; +
1430 return [left, right].indexOf(basePlacement) >= 0 ? { +
1431 x: distance, +
1432 y: skidding +
1433 } : { +
1434 x: skidding, +
1435 y: distance +
1436 }; +
1437 } +
1438 +
1439 function offset(_ref2) { +
1440 var state = _ref2.state, +
1441 options = _ref2.options, +
1442 name = _ref2.name; +
1443 var _options$offset = options.offset, +
1444 offset = _options$offset === void 0 ? [0, 0] : _options$offset; +
1445 var data = placements.reduce(function (acc, placement) { +
1446 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); +
1447 return acc; +
1448 }, {}); +
1449 var _data$state$placement = data[state.placement], +
1450 x = _data$state$placement.x, +
1451 y = _data$state$placement.y; +
1452 +
1453 if (state.modifiersData.popperOffsets != null) { +
1454 state.modifiersData.popperOffsets.x += x; +
1455 state.modifiersData.popperOffsets.y += y; +
1456 } +
1457 +
1458 state.modifiersData[name] = data; +
1459 } // eslint-disable-next-line import/no-unused-modules +
1460 +
1461 +
1462 var offset$1 = { +
1463 name: 'offset', +
1464 enabled: true, +
1465 phase: 'main', +
1466 requires: ['popperOffsets'], +
1467 fn: offset +
1468 }; +
1469 +
1470 var hash$1 = { +
1471 left: 'right', +
1472 right: 'left', +
1473 bottom: 'top', +
1474 top: 'bottom' +
1475 }; +
1476 function getOppositePlacement(placement) { +
1477 return placement.replace(/left|right|bottom|top/g, function (matched) { +
1478 return hash$1[matched]; +
1479 }); +
1480 } +
1481 +
1482 var hash = { +
1483 start: 'end', +
1484 end: 'start' +
1485 }; +
1486 function getOppositeVariationPlacement(placement) { +
1487 return placement.replace(/start|end/g, function (matched) { +
1488 return hash[matched]; +
1489 }); +
1490 } +
1491 +
1492 function computeAutoPlacement(state, options) { +
1493 if (options === void 0) { +
1494 options = {}; +
1495 } +
1496 +
1497 var _options = options, +
1498 placement = _options.placement, +
1499 boundary = _options.boundary, +
1500 rootBoundary = _options.rootBoundary, +
1501 padding = _options.padding, +
1502 flipVariations = _options.flipVariations, +
1503 _options$allowedAutoP = _options.allowedAutoPlacements, +
1504 allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; +
1505 var variation = getVariation(placement); +
1506 var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { +
1507 return getVariation(placement) === variation; +
1508 }) : basePlacements; +
1509 var allowedPlacements = placements$1.filter(function (placement) { +
1510 return allowedAutoPlacements.indexOf(placement) >= 0; +
1511 }); +
1512 +
1513 if (allowedPlacements.length === 0) { +
1514 allowedPlacements = placements$1; +
1515 +
1516 { +
1517 console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' ')); +
1518 } +
1519 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... +
1520 +
1521 +
1522 var overflows = allowedPlacements.reduce(function (acc, placement) { +
1523 acc[placement] = detectOverflow(state, { +
1524 placement: placement, +
1525 boundary: boundary, +
1526 rootBoundary: rootBoundary, +
1527 padding: padding +
1528 })[getBasePlacement(placement)]; +
1529 return acc; +
1530 }, {}); +
1531 return Object.keys(overflows).sort(function (a, b) { +
1532 return overflows[a] - overflows[b]; +
1533 }); +
1534 } +
1535 +
1536 function getExpandedFallbackPlacements(placement) { +
1537 if (getBasePlacement(placement) === auto) { +
1538 return []; +
1539 } +
1540 +
1541 var oppositePlacement = getOppositePlacement(placement); +
1542 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +
1543 } +
1544 +
1545 function flip(_ref) { +
1546 var state = _ref.state, +
1547 options = _ref.options, +
1548 name = _ref.name; +
1549 +
1550 if (state.modifiersData[name]._skip) { +
1551 return; +
1552 } +
1553 +
1554 var _options$mainAxis = options.mainAxis, +
1555 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, +
1556 _options$altAxis = options.altAxis, +
1557 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, +
1558 specifiedFallbackPlacements = options.fallbackPlacements, +
1559 padding = options.padding, +
1560 boundary = options.boundary, +
1561 rootBoundary = options.rootBoundary, +
1562 altBoundary = options.altBoundary, +
1563 _options$flipVariatio = options.flipVariations, +
1564 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, +
1565 allowedAutoPlacements = options.allowedAutoPlacements; +
1566 var preferredPlacement = state.options.placement; +
1567 var basePlacement = getBasePlacement(preferredPlacement); +
1568 var isBasePlacement = basePlacement === preferredPlacement; +
1569 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); +
1570 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { +
1571 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { +
1572 placement: placement, +
1573 boundary: boundary, +
1574 rootBoundary: rootBoundary, +
1575 padding: padding, +
1576 flipVariations: flipVariations, +
1577 allowedAutoPlacements: allowedAutoPlacements +
1578 }) : placement); +
1579 }, []); +
1580 var referenceRect = state.rects.reference; +
1581 var popperRect = state.rects.popper; +
1582 var checksMap = new Map(); +
1583 var makeFallbackChecks = true; +
1584 var firstFittingPlacement = placements[0]; +
1585 +
1586 for (var i = 0; i < placements.length; i++) { +
1587 var placement = placements[i]; +
1588 +
1589 var _basePlacement = getBasePlacement(placement); +
1590 +
1591 var isStartVariation = getVariation(placement) === start; +
1592 var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; +
1593 var len = isVertical ? 'width' : 'height'; +
1594 var overflow = detectOverflow(state, { +
1595 placement: placement, +
1596 boundary: boundary, +
1597 rootBoundary: rootBoundary, +
1598 altBoundary: altBoundary, +
1599 padding: padding +
1600 }); +
1601 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; +
1602 +
1603 if (referenceRect[len] > popperRect[len]) { +
1604 mainVariationSide = getOppositePlacement(mainVariationSide); +
1605 } +
1606 +
1607 var altVariationSide = getOppositePlacement(mainVariationSide); +
1608 var checks = []; +
1609 +
1610 if (checkMainAxis) { +
1611 checks.push(overflow[_basePlacement] <= 0); +
1612 } +
1613 +
1614 if (checkAltAxis) { +
1615 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); +
1616 } +
1617 +
1618 if (checks.every(function (check) { +
1619 return check; +
1620 })) { +
1621 firstFittingPlacement = placement; +
1622 makeFallbackChecks = false; +
1623 break; +
1624 } +
1625 +
1626 checksMap.set(placement, checks); +
1627 } +
1628 +
1629 if (makeFallbackChecks) { +
1630 // `2` may be desired in some cases – research later +
1631 var numberOfChecks = flipVariations ? 3 : 1; +
1632 +
1633 var _loop = function _loop(_i) { +
1634 var fittingPlacement = placements.find(function (placement) { +
1635 var checks = checksMap.get(placement); +
1636 +
1637 if (checks) { +
1638 return checks.slice(0, _i).every(function (check) { +
1639 return check; +
1640 }); +
1641 } +
1642 }); +
1643 +
1644 if (fittingPlacement) { +
1645 firstFittingPlacement = fittingPlacement; +
1646 return "break"; +
1647 } +
1648 }; +
1649 +
1650 for (var _i = numberOfChecks; _i > 0; _i--) { +
1651 var _ret = _loop(_i); +
1652 +
1653 if (_ret === "break") break; +
1654 } +
1655 } +
1656 +
1657 if (state.placement !== firstFittingPlacement) { +
1658 state.modifiersData[name]._skip = true; +
1659 state.placement = firstFittingPlacement; +
1660 state.reset = true; +
1661 } +
1662 } // eslint-disable-next-line import/no-unused-modules +
1663 +
1664 +
1665 var flip$1 = { +
1666 name: 'flip', +
1667 enabled: true, +
1668 phase: 'main', +
1669 fn: flip, +
1670 requiresIfExists: ['offset'], +
1671 data: { +
1672 _skip: false +
1673 } +
1674 }; +
1675 +
1676 function getAltAxis(axis) { +
1677 return axis === 'x' ? 'y' : 'x'; +
1678 } +
1679 +
1680 function within(min$1, value, max$1) { +
1681 return max(min$1, min(value, max$1)); +
1682 } +
1683 function withinMaxClamp(min, value, max) { +
1684 var v = within(min, value, max); +
1685 return v > max ? max : v; +
1686 } +
1687 +
1688 function preventOverflow(_ref) { +
1689 var state = _ref.state, +
1690 options = _ref.options, +
1691 name = _ref.name; +
1692 var _options$mainAxis = options.mainAxis, +
1693 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, +
1694 _options$altAxis = options.altAxis, +
1695 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, +
1696 boundary = options.boundary, +
1697 rootBoundary = options.rootBoundary, +
1698 altBoundary = options.altBoundary, +
1699 padding = options.padding, +
1700 _options$tether = options.tether, +
1701 tether = _options$tether === void 0 ? true : _options$tether, +
1702 _options$tetherOffset = options.tetherOffset, +
1703 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; +
1704 var overflow = detectOverflow(state, { +
1705 boundary: boundary, +
1706 rootBoundary: rootBoundary, +
1707 padding: padding, +
1708 altBoundary: altBoundary +
1709 }); +
1710 var basePlacement = getBasePlacement(state.placement); +
1711 var variation = getVariation(state.placement); +
1712 var isBasePlacement = !variation; +
1713 var mainAxis = getMainAxisFromPlacement(basePlacement); +
1714 var altAxis = getAltAxis(mainAxis); +
1715 var popperOffsets = state.modifiersData.popperOffsets; +
1716 var referenceRect = state.rects.reference; +
1717 var popperRect = state.rects.popper; +
1718 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { +
1719 placement: state.placement +
1720 })) : tetherOffset; +
1721 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { +
1722 mainAxis: tetherOffsetValue, +
1723 altAxis: tetherOffsetValue +
1724 } : Object.assign({ +
1725 mainAxis: 0, +
1726 altAxis: 0 +
1727 }, tetherOffsetValue); +
1728 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; +
1729 var data = { +
1730 x: 0, +
1731 y: 0 +
1732 }; +
1733 +
1734 if (!popperOffsets) { +
1735 return; +
1736 } +
1737 +
1738 if (checkMainAxis) { +
1739 var _offsetModifierState$; +
1740 +
1741 var mainSide = mainAxis === 'y' ? top : left; +
1742 var altSide = mainAxis === 'y' ? bottom : right; +
1743 var len = mainAxis === 'y' ? 'height' : 'width'; +
1744 var offset = popperOffsets[mainAxis]; +
1745 var min$1 = offset + overflow[mainSide]; +
1746 var max$1 = offset - overflow[altSide]; +
1747 var additive = tether ? -popperRect[len] / 2 : 0; +
1748 var minLen = variation === start ? referenceRect[len] : popperRect[len]; +
1749 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go +
1750 // outside the reference bounds +
1751 +
1752 var arrowElement = state.elements.arrow; +
1753 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { +
1754 width: 0, +
1755 height: 0 +
1756 }; +
1757 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); +
1758 var arrowPaddingMin = arrowPaddingObject[mainSide]; +
1759 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want +
1760 // to include its full size in the calculation. If the reference is small +
1761 // and near the edge of a boundary, the popper can overflow even if the +
1762 // reference is not overflowing as well (e.g. virtual elements with no +
1763 // width or height) +
1764 +
1765 var arrowLen = within(0, referenceRect[len], arrowRect[len]); +
1766 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; +
1767 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; +
1768 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); +
1769 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; +
1770 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; +
1771 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; +
1772 var tetherMax = offset + maxOffset - offsetModifierValue; +
1773 var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); +
1774 popperOffsets[mainAxis] = preventedOffset; +
1775 data[mainAxis] = preventedOffset - offset; +
1776 } +
1777 +
1778 if (checkAltAxis) { +
1779 var _offsetModifierState$2; +
1780 +
1781 var _mainSide = mainAxis === 'x' ? top : left; +
1782 +
1783 var _altSide = mainAxis === 'x' ? bottom : right; +
1784 +
1785 var _offset = popperOffsets[altAxis]; +
1786 +
1787 var _len = altAxis === 'y' ? 'height' : 'width'; +
1788 +
1789 var _min = _offset + overflow[_mainSide]; +
1790 +
1791 var _max = _offset - overflow[_altSide]; +
1792 +
1793 var isOriginSide = [top, left].indexOf(basePlacement) !== -1; +
1794 +
1795 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; +
1796 +
1797 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; +
1798 +
1799 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; +
1800 +
1801 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); +
1802 +
1803 popperOffsets[altAxis] = _preventedOffset; +
1804 data[altAxis] = _preventedOffset - _offset; +
1805 } +
1806 +
1807 state.modifiersData[name] = data; +
1808 } // eslint-disable-next-line import/no-unused-modules +
1809 +
1810 +
1811 var preventOverflow$1 = { +
1812 name: 'preventOverflow', +
1813 enabled: true, +
1814 phase: 'main', +
1815 fn: preventOverflow, +
1816 requiresIfExists: ['offset'] +
1817 }; +
1818 +
1819 var toPaddingObject = function toPaddingObject(padding, state) { +
1820 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { +
1821 placement: state.placement +
1822 })) : padding; +
1823 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +
1824 }; +
1825 +
1826 function arrow(_ref) { +
1827 var _state$modifiersData$; +
1828 +
1829 var state = _ref.state, +
1830 name = _ref.name, +
1831 options = _ref.options; +
1832 var arrowElement = state.elements.arrow; +
1833 var popperOffsets = state.modifiersData.popperOffsets; +
1834 var basePlacement = getBasePlacement(state.placement); +
1835 var axis = getMainAxisFromPlacement(basePlacement); +
1836 var isVertical = [left, right].indexOf(basePlacement) >= 0; +
1837 var len = isVertical ? 'height' : 'width'; +
1838 +
1839 if (!arrowElement || !popperOffsets) { +
1840 return; +
1841 } +
1842 +
1843 var paddingObject = toPaddingObject(options.padding, state); +
1844 var arrowRect = getLayoutRect(arrowElement); +
1845 var minProp = axis === 'y' ? top : left; +
1846 var maxProp = axis === 'y' ? bottom : right; +
1847 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; +
1848 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; +
1849 var arrowOffsetParent = getOffsetParent(arrowElement); +
1850 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; +
1851 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is +
1852 // outside of the popper bounds +
1853 +
1854 var min = paddingObject[minProp]; +
1855 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; +
1856 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; +
1857 var offset = within(min, center, max); // Prevents breaking syntax highlighting... +
1858 +
1859 var axisProp = axis; +
1860 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +
1861 } +
1862 +
1863 function effect(_ref2) { +
1864 var state = _ref2.state, +
1865 options = _ref2.options; +
1866 var _options$element = options.element, +
1867 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; +
1868 +
1869 if (arrowElement == null) { +
1870 return; +
1871 } // CSS selector +
1872 +
1873 +
1874 if (typeof arrowElement === 'string') { +
1875 arrowElement = state.elements.popper.querySelector(arrowElement); +
1876 +
1877 if (!arrowElement) { +
1878 return; +
1879 } +
1880 } +
1881 +
1882 { +
1883 if (!isHTMLElement(arrowElement)) { +
1884 console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' ')); +
1885 } +
1886 } +
1887 +
1888 if (!contains(state.elements.popper, arrowElement)) { +
1889 { +
1890 console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' ')); +
1891 } +
1892 +
1893 return; +
1894 } +
1895 +
1896 state.elements.arrow = arrowElement; +
1897 } // eslint-disable-next-line import/no-unused-modules +
1898 +
1899 +
1900 var arrow$1 = { +
1901 name: 'arrow', +
1902 enabled: true, +
1903 phase: 'main', +
1904 fn: arrow, +
1905 effect: effect, +
1906 requires: ['popperOffsets'], +
1907 requiresIfExists: ['preventOverflow'] +
1908 }; +
1909 +
1910 function getSideOffsets(overflow, rect, preventedOffsets) { +
1911 if (preventedOffsets === void 0) { +
1912 preventedOffsets = { +
1913 x: 0, +
1914 y: 0 +
1915 }; +
1916 } +
1917 +
1918 return { +
1919 top: overflow.top - rect.height - preventedOffsets.y, +
1920 right: overflow.right - rect.width + preventedOffsets.x, +
1921 bottom: overflow.bottom - rect.height + preventedOffsets.y, +
1922 left: overflow.left - rect.width - preventedOffsets.x +
1923 }; +
1924 } +
1925 +
1926 function isAnySideFullyClipped(overflow) { +
1927 return [top, right, bottom, left].some(function (side) { +
1928 return overflow[side] >= 0; +
1929 }); +
1930 } +
1931 +
1932 function hide(_ref) { +
1933 var state = _ref.state, +
1934 name = _ref.name; +
1935 var referenceRect = state.rects.reference; +
1936 var popperRect = state.rects.popper; +
1937 var preventedOffsets = state.modifiersData.preventOverflow; +
1938 var referenceOverflow = detectOverflow(state, { +
1939 elementContext: 'reference' +
1940 }); +
1941 var popperAltOverflow = detectOverflow(state, { +
1942 altBoundary: true +
1943 }); +
1944 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); +
1945 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); +
1946 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); +
1947 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); +
1948 state.modifiersData[name] = { +
1949 referenceClippingOffsets: referenceClippingOffsets, +
1950 popperEscapeOffsets: popperEscapeOffsets, +
1951 isReferenceHidden: isReferenceHidden, +
1952 hasPopperEscaped: hasPopperEscaped +
1953 }; +
1954 state.attributes.popper = Object.assign({}, state.attributes.popper, { +
1955 'data-popper-reference-hidden': isReferenceHidden, +
1956 'data-popper-escaped': hasPopperEscaped +
1957 }); +
1958 } // eslint-disable-next-line import/no-unused-modules +
1959 +
1960 +
1961 var hide$1 = { +
1962 name: 'hide', +
1963 enabled: true, +
1964 phase: 'main', +
1965 requiresIfExists: ['preventOverflow'], +
1966 fn: hide +
1967 }; +
1968 +
1969 var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; +
1970 var createPopper$1 = /*#__PURE__*/popperGenerator({ +
1971 defaultModifiers: defaultModifiers$1 +
1972 }); // eslint-disable-next-line import/no-unused-modules +
1973 +
1974 var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; +
1975 var createPopper = /*#__PURE__*/popperGenerator({ +
1976 defaultModifiers: defaultModifiers +
1977 }); // eslint-disable-next-line import/no-unused-modules +
1978 +
1979 exports.applyStyles = applyStyles$1; +
1980 exports.arrow = arrow$1; +
1981 exports.computeStyles = computeStyles$1; +
1982 exports.createPopper = createPopper; +
1983 exports.createPopperLite = createPopper$1; +
1984 exports.defaultModifiers = defaultModifiers; +
1985 exports.detectOverflow = detectOverflow; +
1986 exports.eventListeners = eventListeners; +
1987 exports.flip = flip$1; +
1988 exports.hide = hide$1; +
1989 exports.offset = offset$1; +
1990 exports.popperGenerator = popperGenerator; +
1991 exports.popperOffsets = popperOffsets$1; +
1992 exports.preventOverflow = preventOverflow$1; +
1993 +
1994 Object.defineProperty(exports, '__esModule', { value: true }); +
1995 +
1996}))); +
1997//# sourceMappingURL=popper.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper.js.map b/web/_static/popperjs/popper.js.map new file mode 100644 index 0000000..824d0e2 --- /dev/null +++ b/web/_static/popperjs/popper.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

156 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getNodeScroll.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/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/format.js","../../src/utils/validateModifiers.js","../../src/utils/uniqueBy.js","../../src/utils/getBasePlacement.js","../../src/utils/mergeByName.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/getFreshSideObject.js","../../src/utils/mergePaddingObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.js","../../src/modifiers/eventListeners.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/computeStyles.js","../../src/modifiers/applyStyles.js","../../src/modifiers/offset.js","../../src/utils/getOppositePlacement.js","../../src/utils/getOppositeVariationPlacement.js","../../src/utils/computeAutoPlacement.js","../../src/modifiers/flip.js","../../src/utils/getAltAxis.js","../../src/utils/within.js","../../src/modifiers/preventOverflow.js","../../src/modifiers/arrow.js","../../src/modifiers/hide.js","../../src/popper-lite.js","../../src/popper.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\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\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 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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\n\nexport default function format(str: string, ...args: Array<string>) {\n return [...args].reduce((p, c) => p.replace(/%s/, c), str);\n}\n","// @flow\nimport format from './format';\nimport { modifierPhases } from '../enums';\n\nconst INVALID_MODIFIER_ERROR =\n 'Popper: modifier \"%s\" provided an invalid %s property, expected %s but got %s';\nconst MISSING_DEPENDENCY_ERROR =\n 'Popper: modifier \"%s\" requires \"%s\", but \"%s\" modifier is not available';\nconst VALID_PROPERTIES = [\n 'name',\n 'enabled',\n 'phase',\n 'fn',\n 'effect',\n 'requires',\n 'options',\n];\n\nexport default function validateModifiers(modifiers: Array<any>): void {\n modifiers.forEach((modifier) => {\n [...Object.keys(modifier), ...VALID_PROPERTIES]\n // IE11-compatible replacement for `new Set(iterable)`\n .filter((value, index, self) => self.indexOf(value) === index)\n .forEach((key) => {\n switch (key) {\n case 'name':\n if (typeof modifier.name !== 'string') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n String(modifier.name),\n '\"name\"',\n '\"string\"',\n `\"${String(modifier.name)}\"`\n )\n );\n }\n break;\n case 'enabled':\n if (typeof modifier.enabled !== 'boolean') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"enabled\"',\n '\"boolean\"',\n `\"${String(modifier.enabled)}\"`\n )\n );\n }\n break;\n case 'phase':\n if (modifierPhases.indexOf(modifier.phase) < 0) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"phase\"',\n `either ${modifierPhases.join(', ')}`,\n `\"${String(modifier.phase)}\"`\n )\n );\n }\n break;\n case 'fn':\n if (typeof modifier.fn !== 'function') {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"fn\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'effect':\n if (\n modifier.effect != null &&\n typeof modifier.effect !== 'function'\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"effect\"',\n '\"function\"',\n `\"${String(modifier.fn)}\"`\n )\n );\n }\n break;\n case 'requires':\n if (\n modifier.requires != null &&\n !Array.isArray(modifier.requires)\n ) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requires\"',\n '\"array\"',\n `\"${String(modifier.requires)}\"`\n )\n );\n }\n break;\n case 'requiresIfExists':\n if (!Array.isArray(modifier.requiresIfExists)) {\n console.error(\n format(\n INVALID_MODIFIER_ERROR,\n modifier.name,\n '\"requiresIfExists\"',\n '\"array\"',\n `\"${String(modifier.requiresIfExists)}\"`\n )\n );\n }\n break;\n case 'options':\n case 'data':\n break;\n default:\n console.error(\n `PopperJS: an invalid property has been provided to the \"${\n modifier.name\n }\" modifier, valid properties are ${VALID_PROPERTIES.map(\n (s) => `\"${s}\"`\n ).join(', ')}; but \"${key}\" was provided.`\n );\n }\n\n modifier.requires &&\n modifier.requires.forEach((requirement) => {\n if (modifiers.find((mod) => mod.name === requirement) == null) {\n console.error(\n format(\n MISSING_DEPENDENCY_ERROR,\n String(modifier.name),\n requirement,\n requirement\n )\n );\n }\n });\n });\n });\n}\n","// @flow\n\nexport default function uniqueBy<T>(arr: Array<T>, fn: T => any): Array<T> {\n const identifiers = new Set();\n\n return arr.filter(item => {\n const identifier = fn(item);\n\n if (!identifiers.has(identifier)) {\n identifiers.add(identifier);\n return true;\n }\n });\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 { 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\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 { 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 );\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\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","// @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 { 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\nimport type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\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 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 {\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 { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments<Options>) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n isFixed,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n isFixed: boolean,\n}) {\n let { x = 0, y = 0 } = offsets;\n\n ({ x, y } =\n typeof roundOffsets === 'function'\n ? roundOffsets({ x, y })\n : { x, y });\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n const offsetY =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.height\n : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n const offsetX =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.width\n : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n ({ x, y } =\n roundOffsets === true\n ? roundOffsetsByDPR({ x, y })\n : { x, y });\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments<Options>) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n if (__DEV__) {\n const transitionProperty =\n getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(\n (property) => transitionProperty.indexOf(property) >= 0\n )\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.',\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === 'fixed',\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\n","// @flow\nimport type { Placement } from '../enums';\nimport type { ModifierArguments, Modifier, Rect, Offsets } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport { top, left, right, placements } from '../enums';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetsFunction = ({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n}) => [?number, ?number];\n\ntype Offset = OffsetsFunction | [?number, ?number];\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n offset: Offset,\n};\n\nexport function distanceAndSkiddingToXY(\n placement: Placement,\n rects: { popper: Rect, reference: Rect },\n offset: Offset\n): Offsets {\n const basePlacement = getBasePlacement(placement);\n const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n let [skidding, distance] =\n typeof offset === 'function'\n ? offset({\n ...rects,\n placement,\n })\n : offset;\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n\n return [left, right].indexOf(basePlacement) >= 0\n ? { x: distance, y: skidding }\n : { x: skidding, y: distance };\n}\n\nfunction offset({ state, options, name }: ModifierArguments<Options>) {\n const { offset = [0, 0] } = options;\n\n const data = placements.reduce((acc, placement) => {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n\n const { x, y } = data[state.placement];\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetModifier = Modifier<'offset', Options>;\nexport default ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset,\n}: OffsetModifier);\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\nexport default function getOppositePlacement(placement: Placement): Placement {\n return (placement.replace(\n /left|right|bottom|top/g,\n matched => hash[matched]\n ): any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { start: 'end', end: 'start' };\n\nexport default function getOppositeVariationPlacement(\n placement: Placement\n): Placement {\n return (placement.replace(/start|end/g, matched => hash[matched]): any);\n}\n","// @flow\nimport type { State, Padding } from '../types';\nimport type {\n Placement,\n ComputedPlacement,\n Boundary,\n RootBoundary,\n} from '../enums';\nimport getVariation from './getVariation';\nimport {\n variationPlacements,\n basePlacements,\n placements as allPlacements,\n} from '../enums';\nimport detectOverflow from './detectOverflow';\nimport getBasePlacement from './getBasePlacement';\n\ntype Options = {\n placement: Placement,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n flipVariations: boolean,\n allowedAutoPlacements?: Array<Placement>,\n};\n\ntype OverflowsMap = { [ComputedPlacement]: number };\n\nexport default function computeAutoPlacement(\n state: $Shape<State>,\n options: Options = {}\n): Array<ComputedPlacement> {\n const {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements = allPlacements,\n } = options;\n\n const variation = getVariation(placement);\n\n const placements = variation\n ? flipVariations\n ? variationPlacements\n : variationPlacements.filter(\n (placement) => getVariation(placement) === variation\n )\n : basePlacements;\n\n let allowedPlacements = placements.filter(\n (placement) => allowedAutoPlacements.indexOf(placement) >= 0\n );\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (__DEV__) {\n console.error(\n [\n 'Popper: The `allowedAutoPlacements` option did not allow any',\n 'placements. Ensure the `placement` option matches the variation',\n 'of the allowed placements.',\n 'For example, \"auto\" cannot be used to allow \"bottom-start\".',\n 'Use \"auto-start\" instead.',\n ].join(' ')\n );\n }\n }\n\n // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {\n acc[placement] = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n })[getBasePlacement(placement)];\n\n return acc;\n }, {});\n\n return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);\n}\n","// @flow\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { ModifierArguments, Modifier, Padding } from '../types';\nimport getOppositePlacement from '../utils/getOppositePlacement';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getOppositeVariationPlacement from '../utils/getOppositeVariationPlacement';\nimport detectOverflow from '../utils/detectOverflow';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\nimport { bottom, top, start, right, left, auto } from '../enums';\nimport getVariation from '../utils/getVariation';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n mainAxis: boolean,\n altAxis: boolean,\n fallbackPlacements: Array<Placement>,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n altBoundary: boolean,\n flipVariations: boolean,\n allowedAutoPlacements: Array<Placement>,\n};\n\nfunction getExpandedFallbackPlacements(placement: Placement): Array<Placement> {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n const oppositePlacement = getOppositePlacement(placement);\n\n return [\n getOppositeVariationPlacement(placement),\n oppositePlacement,\n getOppositeVariationPlacement(oppositePlacement),\n ];\n}\n\nfunction flip({ state, options, name }: ModifierArguments<Options>) {\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n padding,\n boundary,\n rootBoundary,\n altBoundary,\n flipVariations = true,\n allowedAutoPlacements,\n } = options;\n\n const preferredPlacement = state.options.placement;\n const basePlacement = getBasePlacement(preferredPlacement);\n const isBasePlacement = basePlacement === preferredPlacement;\n\n const fallbackPlacements =\n specifiedFallbackPlacements ||\n (isBasePlacement || !flipVariations\n ? [getOppositePlacement(preferredPlacement)]\n : getExpandedFallbackPlacements(preferredPlacement));\n\n const placements = [preferredPlacement, ...fallbackPlacements].reduce(\n (acc, placement) => {\n return acc.concat(\n getBasePlacement(placement) === auto\n ? computeAutoPlacement(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements,\n })\n : placement\n );\n },\n []\n );\n\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n\n const checksMap = new Map();\n let makeFallbackChecks = true;\n let firstFittingPlacement = placements[0];\n\n for (let i = 0; i < placements.length; i++) {\n const placement = placements[i];\n const basePlacement = getBasePlacement(placement);\n const isStartVariation = getVariation(placement) === start;\n const isVertical = [top, bottom].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'width' : 'height';\n\n const overflow = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n });\n\n let mainVariationSide: any = isVertical\n ? isStartVariation\n ? right\n : left\n : isStartVariation\n ? bottom\n : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n const altVariationSide: any = getOppositePlacement(mainVariationSide);\n\n const checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(\n overflow[mainVariationSide] <= 0,\n overflow[altVariationSide] <= 0\n );\n }\n\n if (checks.every((check) => check)) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n const numberOfChecks = flipVariations ? 3 : 1;\n\n for (let i = numberOfChecks; i > 0; i--) {\n const fittingPlacement = placements.find((placement) => {\n const checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, i).every((check) => check);\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n break;\n }\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type FlipModifier = Modifier<'flip', Options>;\nexport default ({\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: { _skip: false },\n}: FlipModifier);\n","// @flow\n\nexport default function getAltAxis(axis: 'x' | 'y'): 'x' | 'y' {\n return axis === 'x' ? 'y' : 'x';\n}\n","// @flow\nimport { max as mathMax, min as mathMin } from './math';\n\nexport function within(min: number, value: number, max: number): number {\n return mathMax(min, mathMin(value, max));\n}\n\nexport function withinMaxClamp(min: number, value: number, max: number) {\n const v = within(min, value, max);\n return v > max ? max : v;\n}\n","// @flow\nimport { top, left, right, bottom, start } from '../enums';\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { Rect, ModifierArguments, Modifier, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport getAltAxis from '../utils/getAltAxis';\nimport { within, withinMaxClamp } from '../utils/within';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport detectOverflow from '../utils/detectOverflow';\nimport getVariation from '../utils/getVariation';\nimport getFreshSideObject from '../utils/getFreshSideObject';\nimport { min as mathMin, max as mathMax } from '../utils/math';\n\ntype TetherOffset =\n | (({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n }) => number | { mainAxis: number, altAxis: number })\n | number\n | { mainAxis: number, altAxis: number };\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n /* Prevents boundaries overflow on the main axis */\n mainAxis: boolean,\n /* Prevents boundaries overflow on the alternate axis */\n altAxis: boolean,\n /* The area to check the popper is overflowing in */\n boundary: Boundary,\n /* If the popper is not overflowing the main area, fallback to this one */\n rootBoundary: RootBoundary,\n /* Use the reference's \"clippingParents\" boundary context */\n altBoundary: boolean,\n /**\n * Allows the popper to overflow from its boundaries to keep it near its\n * reference element\n */\n tether: boolean,\n /* Offsets when the `tether` option should activate */\n tetherOffset: TetherOffset,\n /* Sets a padding to the provided boundary */\n padding: Padding,\n};\n\nfunction preventOverflow({ state, options, name }: ModifierArguments<Options>) {\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = false,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n tether = true,\n tetherOffset = 0,\n } = options;\n\n const overflow = detectOverflow(state, {\n boundary,\n rootBoundary,\n padding,\n altBoundary,\n });\n const basePlacement = getBasePlacement(state.placement);\n const variation = getVariation(state.placement);\n const isBasePlacement = !variation;\n const mainAxis = getMainAxisFromPlacement(basePlacement);\n const altAxis = getAltAxis(mainAxis);\n const popperOffsets = state.modifiersData.popperOffsets;\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const tetherOffsetValue =\n typeof tetherOffset === 'function'\n ? tetherOffset({\n ...state.rects,\n placement: state.placement,\n })\n : tetherOffset;\n const normalizedTetherOffsetValue =\n typeof tetherOffsetValue === 'number'\n ? { mainAxis: tetherOffsetValue, altAxis: tetherOffsetValue }\n : { mainAxis: 0, altAxis: 0, ...tetherOffsetValue };\n const offsetModifierState = state.modifiersData.offset\n ? state.modifiersData.offset[state.placement]\n : null;\n\n const data = { x: 0, y: 0 };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n const mainSide = mainAxis === 'y' ? top : left;\n const altSide = mainAxis === 'y' ? bottom : right;\n const len = mainAxis === 'y' ? 'height' : 'width';\n const offset = popperOffsets[mainAxis];\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const additive = tether ? -popperRect[len] / 2 : 0;\n\n const minLen = variation === start ? referenceRect[len] : popperRect[len];\n const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];\n\n // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n const arrowElement = state.elements.arrow;\n const arrowRect =\n tether && arrowElement\n ? getLayoutRect(arrowElement)\n : { width: 0, height: 0 };\n const arrowPaddingObject = state.modifiersData['arrow#persistent']\n ? state.modifiersData['arrow#persistent'].padding\n : getFreshSideObject();\n const arrowPaddingMin = arrowPaddingObject[mainSide];\n const arrowPaddingMax = arrowPaddingObject[altSide];\n\n // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n const arrowLen = within(0, referenceRect[len], arrowRect[len]);\n\n const minOffset = isBasePlacement\n ? referenceRect[len] / 2 -\n additive -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis\n : minLen -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis;\n const maxOffset = isBasePlacement\n ? -referenceRect[len] / 2 +\n additive +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis\n : maxLen +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis;\n\n const arrowOffsetParent =\n state.elements.arrow && getOffsetParent(state.elements.arrow);\n const clientOffset = arrowOffsetParent\n ? mainAxis === 'y'\n ? arrowOffsetParent.clientTop || 0\n : arrowOffsetParent.clientLeft || 0\n : 0;\n\n const offsetModifierValue = offsetModifierState?.[mainAxis] ?? 0;\n const tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n const tetherMax = offset + maxOffset - offsetModifierValue;\n\n const preventedOffset = within(\n tether ? mathMin(min, tetherMin) : min,\n offset,\n tether ? mathMax(max, tetherMax) : max\n );\n\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n const mainSide = mainAxis === 'x' ? top : left;\n const altSide = mainAxis === 'x' ? bottom : right;\n const offset = popperOffsets[altAxis];\n\n const len = altAxis === 'y' ? 'height' : 'width';\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n const offsetModifierValue = offsetModifierState?.[altAxis] ?? 0;\n const tetherMin = isOriginSide\n ? min\n : offset -\n referenceRect[len] -\n popperRect[len] -\n offsetModifierValue +\n normalizedTetherOffsetValue.altAxis;\n const tetherMax = isOriginSide\n ? offset +\n referenceRect[len] +\n popperRect[len] -\n offsetModifierValue -\n normalizedTetherOffsetValue.altAxis\n : max;\n\n const preventedOffset =\n tether && isOriginSide\n ? withinMaxClamp(tetherMin, offset, tetherMax)\n : within(tether ? tetherMin : min, offset, tether ? tetherMax : max);\n\n popperOffsets[altAxis] = preventedOffset;\n data[altAxis] = preventedOffset - offset;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PreventOverflowModifier = Modifier<'preventOverflow', Options>;\nexport default ({\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset'],\n}: PreventOverflowModifier);\n","// @flow\nimport type { Modifier, ModifierArguments, Padding, Rect } from '../types';\nimport type { Placement } from '../enums';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport contains from '../dom-utils/contains';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport { within } from '../utils/within';\nimport mergePaddingObject from '../utils/mergePaddingObject';\nimport expandToHashMap from '../utils/expandToHashMap';\nimport { left, right, basePlacements, top, bottom } from '../enums';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n element: HTMLElement | string | null,\n padding:\n | Padding\n | (({|\n popper: Rect,\n reference: Rect,\n placement: Placement,\n |}) => Padding),\n};\n\nconst toPaddingObject = (padding, state) => {\n padding =\n typeof padding === 'function'\n ? padding({ ...state.rects, placement: state.placement })\n : padding;\n\n return mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n};\n\nfunction arrow({ state, name, options }: ModifierArguments<Options>) {\n const arrowElement = state.elements.arrow;\n const popperOffsets = state.modifiersData.popperOffsets;\n const basePlacement = getBasePlacement(state.placement);\n const axis = getMainAxisFromPlacement(basePlacement);\n const isVertical = [left, right].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n const paddingObject = toPaddingObject(options.padding, state);\n const arrowRect = getLayoutRect(arrowElement);\n const minProp = axis === 'y' ? top : left;\n const maxProp = axis === 'y' ? bottom : right;\n\n const endDiff =\n state.rects.reference[len] +\n state.rects.reference[axis] -\n popperOffsets[axis] -\n state.rects.popper[len];\n const startDiff = popperOffsets[axis] - state.rects.reference[axis];\n\n const arrowOffsetParent = getOffsetParent(arrowElement);\n const clientSize = arrowOffsetParent\n ? axis === 'y'\n ? arrowOffsetParent.clientHeight || 0\n : arrowOffsetParent.clientWidth || 0\n : 0;\n\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n const min = paddingObject[minProp];\n const max = clientSize - arrowRect[len] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // Prevents breaking syntax highlighting...\n const axisProp: string = axis;\n state.modifiersData[name] = {\n [axisProp]: offset,\n centerOffset: offset - center,\n };\n}\n\nfunction effect({ state, options }: ModifierArguments<Options>) {\n let { element: arrowElement = '[data-popper-arrow]' } = options;\n\n if (arrowElement == null) {\n return;\n }\n\n // CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (__DEV__) {\n if (!isHTMLElement(arrowElement)) {\n console.error(\n [\n 'Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).',\n 'To use an SVG arrow, wrap it in an HTMLElement that will be used as',\n 'the arrow.',\n ].join(' ')\n );\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (__DEV__) {\n console.error(\n [\n 'Popper: \"arrow\" modifier\\'s `element` must be a child of the popper',\n 'element.',\n ].join(' ')\n );\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ArrowModifier = Modifier<'arrow', Options>;\nexport default ({\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow'],\n}: ArrowModifier);\n","// @flow\nimport type {\n ModifierArguments,\n Modifier,\n Rect,\n SideObject,\n Offsets,\n} from '../types';\nimport { top, bottom, left, right } from '../enums';\nimport detectOverflow from '../utils/detectOverflow';\n\nfunction getSideOffsets(\n overflow: SideObject,\n rect: Rect,\n preventedOffsets: Offsets = { x: 0, y: 0 }\n): SideObject {\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x,\n };\n}\n\nfunction isAnySideFullyClipped(overflow: SideObject): boolean {\n return [top, right, bottom, left].some((side) => overflow[side] >= 0);\n}\n\nfunction hide({ state, name }: ModifierArguments<{||}>) {\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const preventedOffsets = state.modifiersData.preventOverflow;\n\n const referenceOverflow = detectOverflow(state, {\n elementContext: 'reference',\n });\n const popperAltOverflow = detectOverflow(state, {\n altBoundary: true,\n });\n\n const referenceClippingOffsets = getSideOffsets(\n referenceOverflow,\n referenceRect\n );\n const popperEscapeOffsets = getSideOffsets(\n popperAltOverflow,\n popperRect,\n preventedOffsets\n );\n\n const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n\n state.modifiersData[name] = {\n referenceClippingOffsets,\n popperEscapeOffsets,\n isReferenceHidden,\n hasPopperEscaped,\n };\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type HideModifier = Modifier<'hide', {||}>;\nexport default ({\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide,\n}: HideModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\nimport offset from './modifiers/offset';\nimport flip from './modifiers/flip';\nimport preventOverflow from './modifiers/preventOverflow';\nimport arrow from './modifiers/arrow';\nimport hide from './modifiers/hide';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n offset,\n flip,\n preventOverflow,\n arrow,\n hide,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper as createPopperLite } from './popper-lite';\n// eslint-disable-next-line import/no-unused-modules\nexport * from './modifiers';\n"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","OwnElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getHTMLElementScroll","getNodeScroll","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","isElementScaled","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","clientRect","abs","offsetLeft","offsetTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getContainingBlock","isFirefox","navigator","userAgent","isIE","elementCss","currentNode","css","transform","perspective","contain","willChange","filter","getOffsetParent","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","order","modifiers","map","Map","visited","Set","result","forEach","modifier","set","name","sort","add","requires","requiresIfExists","dep","has","depModifier","get","push","orderModifiers","orderedModifiers","phase","debounce","fn","pending","Promise","resolve","then","undefined","format","str","args","p","c","replace","INVALID_MODIFIER_ERROR","MISSING_DEPENDENCY_ERROR","VALID_PROPERTIES","validateModifiers","Object","keys","value","index","self","key","console","error","String","enabled","join","effect","Array","isArray","s","requirement","find","mod","uniqueBy","arr","identifiers","item","identifier","getBasePlacement","split","mergeByName","merged","current","existing","options","data","getViewportRect","html","clientWidth","clientHeight","getDocumentRect","winScroll","scrollWidth","scrollHeight","direction","contains","parent","child","rootNode","getRootNode","next","isSameNode","rectToClientRect","getInnerBoundingClientRect","getClientRectFromMixedType","clippingParent","getClippingParents","canEscapeClipping","clipperElement","getClippingRect","boundary","rootBoundary","mainClippingParents","firstClippingParent","clippingRect","accRect","getVariation","getMainAxisFromPlacement","computeOffsets","basePlacement","variation","commonX","commonY","mainAxis","len","getFreshSideObject","mergePaddingObject","paddingObject","expandToHashMap","hashMap","detectOverflow","state","elementContext","altBoundary","padding","altContext","popperRect","rects","elements","clippingClientRect","contextElement","referenceClientRect","popperOffsets","strategy","popperClientRect","elementClientRect","overflowOffsets","offsetData","modifiersData","offset","multiply","axis","INVALID_ELEMENT_ERROR","INFINITE_LOOP_ERROR","DEFAULT_OPTIONS","areValidElements","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","createPopper","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","m","flipModifier","marginTop","marginRight","marginBottom","marginLeft","margin","parseFloat","warn","runModifierEffects","update","forceUpdate","reset","__debug_loops__","length","destroy","onFirstUpdate","cleanupFn","noopFn","passive","resize","addEventListener","removeEventListener","unsetSides","roundOffsetsByDPR","dpr","devicePixelRatio","mapToStyles","gpuAcceleration","adaptive","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","heightProp","widthProp","offsetY","offsetX","commonStyles","computeStyles","transitionProperty","property","arrow","applyStyles","style","assign","removeAttribute","setAttribute","initialStyles","styleProperties","attribute","distanceAndSkiddingToXY","invertDistance","skidding","distance","hash","getOppositePlacement","matched","getOppositeVariationPlacement","computeAutoPlacement","flipVariations","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","a","b","getExpandedFallbackPlacements","oppositePlacement","flip","_skip","checkMainAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","preferredPlacement","isBasePlacement","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","i","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","every","check","numberOfChecks","fittingPlacement","slice","getAltAxis","within","mathMax","mathMin","withinMaxClamp","v","preventOverflow","tether","tetherOffset","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","mainSide","altSide","additive","minLen","maxLen","arrowElement","arrowRect","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","arrowOffsetParent","clientOffset","offsetModifierValue","tetherMin","tetherMax","preventedOffset","isOriginSide","toPaddingObject","minProp","maxProp","endDiff","startDiff","clientSize","centerToReference","center","axisProp","centerOffset","querySelector","getSideOffsets","preventedOffsets","isAnySideFullyClipped","side","hide","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","eventListeners"],"mappings":";;;;;;;;;;EAIe,SAASA,SAAT,CAAmBC,IAAnB,EAAyB;EACtC,MAAIA,IAAI,IAAI,IAAZ,EAAkB;EAChB,WAAOC,MAAP;EACD;;EAED,MAAID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,CAJJ;EAKdU,EAAAA,EAAE,EAAEkR;EALU,CAAhB;;EC3DA,IAAM1J,kBAAgB,GAAG,CACvBiK,cADuB,EAEvBlL,eAFuB,EAGvBsE,eAHuB,EAIvBI,aAJuB,CAAzB;MAOMvD,cAAY,gBAAGJ,eAAe,CAAC;EAAEE,EAAAA,gBAAgB,EAAhBA;EAAF,CAAD;;MCF9BA,gBAAgB,GAAG,CACvBiK,cADuB,EAEvBlL,eAFuB,EAGvBsE,eAHuB,EAIvBI,aAJuB,EAKvBnE,QALuB,EAMvB6F,MANuB,EAOvB8B,iBAPuB,EAQvBzD,OARuB,EASvBkG,MATuB;MAYnBxJ,YAAY,gBAAGJ,eAAe,CAAC;EAAEE,EAAAA,gBAAgB,EAAhBA;EAAF,CAAD;;;;;;;;;;;;;;;;;;;"}
\No newline at end of file

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper.min.js b/web/_static/popperjs/popper.min.js new file mode 100644 index 0000000..76b62ca --- /dev/null +++ b/web/_static/popperjs/popper.min.js @@ -0,0 +1,71 @@ +UNPKG - @popperjs/core

UNPKG

19.8 kBJavaScriptView Raw
1/** +
2 * @popperjs/core v2.11.5 - MIT License +
3 */ +
4 +
5!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){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),o=1,i=1;if(r(e)&&t){var a=e.offsetHeight,f=e.offsetWidth;f>0&&(o=s(n.width)/f||1),a>0&&(i=s(n.height)/a||1)}return{width:n.width/o,height:n.height/i,top:n.top/i,right:n.right/o,bottom:n.bottom/i,left:n.left/o,x:n.left/o,y:n.top/i}}function c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function p(e){return e?(e.nodeName||"").toLowerCase():null}function u(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function l(e){return f(u(e)).left+c(e).scrollLeft}function d(e){return t(e).getComputedStyle(e)}function h(e){var t=d(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function m(e,n,o){void 0===o&&(o=!1);var i,a,d=r(n),m=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),v=u(n),g=f(e,m),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(d||!d&&!o)&&(("body"!==p(n)||h(v))&&(y=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:c(i)),r(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=l(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function v(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function g(e){return"html"===p(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||u(e)}function y(e){return["html","body","#document"].indexOf(p(e))>=0?e.ownerDocument.body:r(e)&&h(e)?e:y(g(e))}function b(e,n){var r;void 0===n&&(n=[]);var o=y(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],h(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(b(g(s)))}function x(e){return["table","td","th"].indexOf(p(e))>=0}function w(e){return r(e)&&"fixed"!==d(e).position?e.offsetParent:null}function O(e){for(var n=t(e),i=w(e);i&&x(i)&&"static"===d(i).position;)i=w(i);return i&&("html"===p(i)||"body"===p(i)&&"static"===d(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===d(e).position)return null;var n=g(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(p(n))<0;){var i=d(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var j="top",E="bottom",D="right",A="left",L="auto",P=[j,E,D,A],M="start",k="end",W="viewport",B="popper",H=P.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+k])}),[]),T=[].concat(P,[L]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+k])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function S(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function V(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function N(e,r){return r===W?V(function(e){var n=t(e),r=u(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,f=0;return o&&(i=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,f=o.offsetTop)),{width:i,height:a,x:s+l(e),y:f}}(e)):n(r)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(r):V(function(e){var t,n=u(e),r=c(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+l(e),p=-r.scrollTop;return"rtl"===d(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:p}}(u(e)))}function I(e,t,o){var s="clippingParents"===t?function(e){var t=b(g(e)),o=["absolute","fixed"].indexOf(d(e).position)>=0&&r(e)?O(e):e;return n(o)?t.filter((function(e){return n(e)&&q(e,o)&&"body"!==p(e)})):[]}(e):[].concat(t),f=[].concat(s,[o]),c=f[0],u=f.reduce((function(t,n){var r=N(e,n);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),N(e,c));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _(e){return e.split("-")[1]}function F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function U(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?_(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case j:t={x:s,y:n.y-r.height};break;case E:t={x:s,y:n.y+n.height};break;case D:t={x:n.x+n.width,y:f};break;case A:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?F(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case M:t[c]=t[c]-(n[p]/2-r[p]/2);break;case k:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Y(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.boundary,s=void 0===a?"clippingParents":a,c=r.rootBoundary,p=void 0===c?W:c,l=r.elementContext,d=void 0===l?B:l,h=r.altBoundary,m=void 0!==h&&h,v=r.padding,g=void 0===v?0:v,y=z("number"!=typeof g?g:X(g,P)),b=d===B?"reference":B,x=e.rects.popper,w=e.elements[m?b:d],O=I(n(w)?w:w.contextElement||u(e.elements.popper),s,p),A=f(e.elements.reference),L=U({reference:A,element:x,strategy:"absolute",placement:i}),M=V(Object.assign({},x,L)),k=d===B?M:A,H={top:O.top-k.top+y.top,bottom:k.bottom-O.bottom+y.bottom,left:O.left-k.left+y.left,right:k.right-O.right+y.right},T=e.modifiersData.offset;if(d===B&&T){var R=T[i];Object.keys(H).forEach((function(e){var t=[D,E].indexOf(e)>=0?1:-1,n=[j,E].indexOf(e)>=0?"y":"x";H[e]+=R[n]*t}))}return H}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function K(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,o=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?G:i;return function(e,t,r){void 0===r&&(r=a);var i,s,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},G,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],p=!1,u={state:f,setOptions:function(r){var i="function"==typeof r?r(f.options):r;l(),f.options=Object.assign({},a,f.options,i),f.scrollParents={reference:n(e)?b(e):e.contextElement?b(e.contextElement):[],popper:b(t)};var s,p,d=function(e){var t=S(e);return R.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,f.options.modifiers),p=s.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}),{}),Object.keys(p).map((function(e){return p[e]}))));return f.orderedModifiers=d.filter((function(e){return e.enabled})),f.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:f,name:t,instance:u,options:r}),a=function(){};c.push(i||a)}})),u.update()},forceUpdate:function(){if(!p){var e=f.elements,t=e.reference,n=e.popper;if(J(t,n)){f.rects={reference:m(t,O(n),"fixed"===f.options.strategy),popper:v(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach((function(e){return f.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<f.orderedModifiers.length;r++)if(!0!==f.reset){var o=f.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,c=o.name;"function"==typeof i&&(f=i({state:f,options:s,name:c,instance:u})||f)}else f.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(f)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){l(),p=!0}};if(!J(e,t))return u;function l(){c.forEach((function(e){return e()})),c=[]}return u.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),u}}var Q={passive:!0};var Z={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,f=void 0===s||s,c=t(n.elements.popper),p=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&p.forEach((function(e){e.addEventListener("scroll",r.update,Q)})),f&&c.addEventListener("resize",r.update,Q),function(){a&&p.forEach((function(e){e.removeEventListener("scroll",r.update,Q)})),f&&c.removeEventListener("resize",r.update,Q)}},data:{}};var $={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=U({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var n,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,c=e.position,p=e.gpuAcceleration,l=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=f.x,g=void 0===v?0:v,y=f.y,b=void 0===y?0:y,x="function"==typeof h?h({x:g,y:b}):{x:g,y:b};g=x.x,b=x.y;var w=f.hasOwnProperty("x"),L=f.hasOwnProperty("y"),P=A,M=j,W=window;if(l){var B=O(r),H="clientHeight",T="clientWidth";if(B===t(r)&&"static"!==d(B=u(r)).position&&"absolute"===c&&(H="scrollHeight",T="scrollWidth"),B=B,i===j||(i===A||i===D)&&a===k)M=E,b-=(m&&B===W&&W.visualViewport?W.visualViewport.height:B[H])-o.height,b*=p?1:-1;if(i===A||(i===j||i===E)&&a===k)P=D,g-=(m&&B===W&&W.visualViewport?W.visualViewport.width:B[T])-o.width,g*=p?1:-1}var R,S=Object.assign({position:c},l&&ee),C=!0===h?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:s(t*r)/r||0,y:s(n*r)/r||0}}({x:g,y:b}):{x:g,y:b};return g=C.x,b=C.y,p?Object.assign({},S,((R={})[M]=L?"0":"",R[P]=w?"0":"",R.transform=(W.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",R)):Object.assign({},S,((n={})[M]=L?b+"px":"",n[P]=w?g+"px":"",n.transform="",n))}var ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:C(t.placement),variation:_(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var re={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]||{},i=t.elements[e];r(i)&&p(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[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 o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&p(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};var oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=T.reduce((function(e,n){return e[n]=function(e,t,n){var r=C(e),o=[A,j].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[A,D].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?T:f,p=_(r),u=p?s?H:H.filter((function(e){return _(e)===p})):P,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=Y(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=C(v),y=f||(g===v||!h?[ae(v)]:function(e){if(C(e)===L)return[];var t=ae(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(C(n)===L?ce(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,P=!0,k=b[0],W=0;W<b.length;W++){var B=b[W],H=C(B),T=_(B)===M,R=[j,E].indexOf(H)>=0,S=R?"width":"height",q=Y(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),V=R?T?D:A:T?E:j;x[S]>w[S]&&(V=ae(V));var N=ae(V),I=[];if(i&&I.push(q[H]<=0),s&&I.push(q[V]<=0,q[N]<=0),I.every((function(e){return e}))){k=B,P=!1;break}O.set(B,I)}if(P)for(var F=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},U=h?3:1;U>0;U--){if("break"===F(U))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ue(e,t,n){return i(e,a(t,n))}var le={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,g=n.tetherOffset,y=void 0===g?0:g,b=Y(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=_(t.placement),L=!w,P=F(x),k="x"===P?"y":"x",W=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(W){if(s){var V,N="y"===P?j:A,I="y"===P?E:D,U="y"===P?"height":"width",z=W[P],X=z+b[N],G=z-b[I],J=m?-H[U]/2:0,K=w===M?B[U]:H[U],Q=w===M?-H[U]:-B[U],Z=t.elements.arrow,$=m&&Z?v(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=ue(0,B[U],$[U]),oe=L?B[U]/2-J-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=L?-B[U]/2+J+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&O(t.elements.arrow),se=ae?"y"===P?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(V=null==S?void 0:S[P])?V:0,ce=z+ie-fe,pe=ue(m?a(X,z+oe-fe-se):X,z,m?i(G,ce):G);W[P]=pe,q[P]=pe-z}if(c){var le,de="x"===P?j:A,he="x"===P?E:D,me=W[k],ve="y"===k?"height":"width",ge=me+b[de],ye=me-b[he],be=-1!==[j,A].indexOf(x),xe=null!=(le=null==S?void 0:S[k])?le:0,we=be?ge:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ye,je=m&&be?function(e,t,n){var r=ue(e,t,n);return r>n?n:r}(we,me,Oe):ue(m?we:ge,me,m?Oe:ye);W[k]=je,q[k]=je-me}t.modifiersData[r]=q}},requiresIfExists:["offset"]};var de={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=F(s),c=[A,D].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(o.padding,n),u=v(i),l="y"===f?j:A,d="y"===f?E:D,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],g=O(i),y=g?"y"===f?g.clientHeight||0:g.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],L=y/2-u[c]/2+b,M=ue(x,L,w),k=f;n.modifiersData[r]=((t={})[k]=M,t.centerOffset=M-L,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(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 me(e){return[j,D,E,A].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Y(t,{elementContext:"reference"}),s=Y(t,{altBoundary:!0}),f=he(a,r),c=he(s,o,i),p=me(f),u=me(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},ge=K({defaultModifiers:[Z,$,ne,re]}),ye=[Z,$,ne,re,oe,pe,le,de,ve],be=K({defaultModifiers:ye});e.applyStyles=re,e.arrow=de,e.computeStyles=ne,e.createPopper=be,e.createPopperLite=ge,e.defaultModifiers=ye,e.detectOverflow=Y,e.eventListeners=Z,e.flip=pe,e.hide=ve,e.offset=oe,e.popperGenerator=K,e.popperOffsets=$,e.preventOverflow=le,Object.defineProperty(e,"__esModule",{value:!0})})); +
6//# sourceMappingURL=popper.min.js.map +

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper.min.js.flow b/web/_static/popperjs/popper.min.js.flow new file mode 100644 index 0000000..b1dd78f --- /dev/null +++ b/web/_static/popperjs/popper.min.js.flow @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

46 BFlowView Raw

No preview available.

Build: a7ebffa

© 2022 UNPKG

\ No newline at end of file diff --git a/web/_static/popperjs/popper.min.js.map b/web/_static/popperjs/popper.min.js.map new file mode 100644 index 0000000..bc0da3d --- /dev/null +++ b/web/_static/popperjs/popper.min.js.map @@ -0,0 +1,65 @@ +UNPKG - @popperjs/core

UNPKG

113 kBSource Map (JSON)View Raw
1{"version":3,"file":"popper.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.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/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/utils/getBasePlacement.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/mergePaddingObject.js","../../src/utils/getFreshSideObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.js","../../src/utils/debounce.js","../../src/utils/mergeByName.js","../../src/modifiers/eventListeners.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/computeStyles.js","../../src/modifiers/applyStyles.js","../../src/modifiers/offset.js","../../src/utils/getOppositePlacement.js","../../src/utils/getOppositeVariationPlacement.js","../../src/utils/computeAutoPlacement.js","../../src/modifiers/flip.js","../../src/utils/within.js","../../src/modifiers/preventOverflow.js","../../src/utils/getAltAxis.js","../../src/modifiers/arrow.js","../../src/modifiers/hide.js","../../src/popper-lite.js","../../src/popper.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\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\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 getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } 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 if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\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\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 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\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 { 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 { 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 );\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\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 { 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","// @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 { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape<SideObject>\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\n };\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 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 {\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\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 { 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\nimport type { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments<Options>) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n isFixed,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n isFixed: boolean,\n}) {\n let { x = 0, y = 0 } = offsets;\n\n ({ x, y } =\n typeof roundOffsets === 'function'\n ? roundOffsets({ x, y })\n : { x, y });\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n const offsetY =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.height\n : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n const offsetX =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.width\n : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n ({ x, y } =\n roundOffsets === true\n ? roundOffsetsByDPR({ x, y })\n : { x, y });\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments<Options>) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n if (__DEV__) {\n const transitionProperty =\n getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(\n (property) => transitionProperty.indexOf(property) >= 0\n )\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.',\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === 'fixed',\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\n","// @flow\nimport type { Placement } from '../enums';\nimport type { ModifierArguments, Modifier, Rect, Offsets } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport { top, left, right, placements } from '../enums';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetsFunction = ({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n}) => [?number, ?number];\n\ntype Offset = OffsetsFunction | [?number, ?number];\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n offset: Offset,\n};\n\nexport function distanceAndSkiddingToXY(\n placement: Placement,\n rects: { popper: Rect, reference: Rect },\n offset: Offset\n): Offsets {\n const basePlacement = getBasePlacement(placement);\n const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n let [skidding, distance] =\n typeof offset === 'function'\n ? offset({\n ...rects,\n placement,\n })\n : offset;\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n\n return [left, right].indexOf(basePlacement) >= 0\n ? { x: distance, y: skidding }\n : { x: skidding, y: distance };\n}\n\nfunction offset({ state, options, name }: ModifierArguments<Options>) {\n const { offset = [0, 0] } = options;\n\n const data = placements.reduce((acc, placement) => {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n\n const { x, y } = data[state.placement];\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetModifier = Modifier<'offset', Options>;\nexport default ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset,\n}: OffsetModifier);\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\nexport default function getOppositePlacement(placement: Placement): Placement {\n return (placement.replace(\n /left|right|bottom|top/g,\n matched => hash[matched]\n ): any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { start: 'end', end: 'start' };\n\nexport default function getOppositeVariationPlacement(\n placement: Placement\n): Placement {\n return (placement.replace(/start|end/g, matched => hash[matched]): any);\n}\n","// @flow\nimport type { State, Padding } from '../types';\nimport type {\n Placement,\n ComputedPlacement,\n Boundary,\n RootBoundary,\n} from '../enums';\nimport getVariation from './getVariation';\nimport {\n variationPlacements,\n basePlacements,\n placements as allPlacements,\n} from '../enums';\nimport detectOverflow from './detectOverflow';\nimport getBasePlacement from './getBasePlacement';\n\ntype Options = {\n placement: Placement,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n flipVariations: boolean,\n allowedAutoPlacements?: Array<Placement>,\n};\n\ntype OverflowsMap = { [ComputedPlacement]: number };\n\nexport default function computeAutoPlacement(\n state: $Shape<State>,\n options: Options = {}\n): Array<ComputedPlacement> {\n const {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements = allPlacements,\n } = options;\n\n const variation = getVariation(placement);\n\n const placements = variation\n ? flipVariations\n ? variationPlacements\n : variationPlacements.filter(\n (placement) => getVariation(placement) === variation\n )\n : basePlacements;\n\n let allowedPlacements = placements.filter(\n (placement) => allowedAutoPlacements.indexOf(placement) >= 0\n );\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (__DEV__) {\n console.error(\n [\n 'Popper: The `allowedAutoPlacements` option did not allow any',\n 'placements. Ensure the `placement` option matches the variation',\n 'of the allowed placements.',\n 'For example, \"auto\" cannot be used to allow \"bottom-start\".',\n 'Use \"auto-start\" instead.',\n ].join(' ')\n );\n }\n }\n\n // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {\n acc[placement] = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n })[getBasePlacement(placement)];\n\n return acc;\n }, {});\n\n return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);\n}\n","// @flow\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { ModifierArguments, Modifier, Padding } from '../types';\nimport getOppositePlacement from '../utils/getOppositePlacement';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getOppositeVariationPlacement from '../utils/getOppositeVariationPlacement';\nimport detectOverflow from '../utils/detectOverflow';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\nimport { bottom, top, start, right, left, auto } from '../enums';\nimport getVariation from '../utils/getVariation';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n mainAxis: boolean,\n altAxis: boolean,\n fallbackPlacements: Array<Placement>,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n altBoundary: boolean,\n flipVariations: boolean,\n allowedAutoPlacements: Array<Placement>,\n};\n\nfunction getExpandedFallbackPlacements(placement: Placement): Array<Placement> {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n const oppositePlacement = getOppositePlacement(placement);\n\n return [\n getOppositeVariationPlacement(placement),\n oppositePlacement,\n getOppositeVariationPlacement(oppositePlacement),\n ];\n}\n\nfunction flip({ state, options, name }: ModifierArguments<Options>) {\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n padding,\n boundary,\n rootBoundary,\n altBoundary,\n flipVariations = true,\n allowedAutoPlacements,\n } = options;\n\n const preferredPlacement = state.options.placement;\n const basePlacement = getBasePlacement(preferredPlacement);\n const isBasePlacement = basePlacement === preferredPlacement;\n\n const fallbackPlacements =\n specifiedFallbackPlacements ||\n (isBasePlacement || !flipVariations\n ? [getOppositePlacement(preferredPlacement)]\n : getExpandedFallbackPlacements(preferredPlacement));\n\n const placements = [preferredPlacement, ...fallbackPlacements].reduce(\n (acc, placement) => {\n return acc.concat(\n getBasePlacement(placement) === auto\n ? computeAutoPlacement(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements,\n })\n : placement\n );\n },\n []\n );\n\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n\n const checksMap = new Map();\n let makeFallbackChecks = true;\n let firstFittingPlacement = placements[0];\n\n for (let i = 0; i < placements.length; i++) {\n const placement = placements[i];\n const basePlacement = getBasePlacement(placement);\n const isStartVariation = getVariation(placement) === start;\n const isVertical = [top, bottom].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'width' : 'height';\n\n const overflow = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n });\n\n let mainVariationSide: any = isVertical\n ? isStartVariation\n ? right\n : left\n : isStartVariation\n ? bottom\n : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n const altVariationSide: any = getOppositePlacement(mainVariationSide);\n\n const checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(\n overflow[mainVariationSide] <= 0,\n overflow[altVariationSide] <= 0\n );\n }\n\n if (checks.every((check) => check)) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n const numberOfChecks = flipVariations ? 3 : 1;\n\n for (let i = numberOfChecks; i > 0; i--) {\n const fittingPlacement = placements.find((placement) => {\n const checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, i).every((check) => check);\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n break;\n }\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type FlipModifier = Modifier<'flip', Options>;\nexport default ({\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: { _skip: false },\n}: FlipModifier);\n","// @flow\nimport { max as mathMax, min as mathMin } from './math';\n\nexport function within(min: number, value: number, max: number): number {\n return mathMax(min, mathMin(value, max));\n}\n\nexport function withinMaxClamp(min: number, value: number, max: number) {\n const v = within(min, value, max);\n return v > max ? max : v;\n}\n","// @flow\nimport { top, left, right, bottom, start } from '../enums';\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { Rect, ModifierArguments, Modifier, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport getAltAxis from '../utils/getAltAxis';\nimport { within, withinMaxClamp } from '../utils/within';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport detectOverflow from '../utils/detectOverflow';\nimport getVariation from '../utils/getVariation';\nimport getFreshSideObject from '../utils/getFreshSideObject';\nimport { min as mathMin, max as mathMax } from '../utils/math';\n\ntype TetherOffset =\n | (({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n }) => number | { mainAxis: number, altAxis: number })\n | number\n | { mainAxis: number, altAxis: number };\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n /* Prevents boundaries overflow on the main axis */\n mainAxis: boolean,\n /* Prevents boundaries overflow on the alternate axis */\n altAxis: boolean,\n /* The area to check the popper is overflowing in */\n boundary: Boundary,\n /* If the popper is not overflowing the main area, fallback to this one */\n rootBoundary: RootBoundary,\n /* Use the reference's \"clippingParents\" boundary context */\n altBoundary: boolean,\n /**\n * Allows the popper to overflow from its boundaries to keep it near its\n * reference element\n */\n tether: boolean,\n /* Offsets when the `tether` option should activate */\n tetherOffset: TetherOffset,\n /* Sets a padding to the provided boundary */\n padding: Padding,\n};\n\nfunction preventOverflow({ state, options, name }: ModifierArguments<Options>) {\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = false,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n tether = true,\n tetherOffset = 0,\n } = options;\n\n const overflow = detectOverflow(state, {\n boundary,\n rootBoundary,\n padding,\n altBoundary,\n });\n const basePlacement = getBasePlacement(state.placement);\n const variation = getVariation(state.placement);\n const isBasePlacement = !variation;\n const mainAxis = getMainAxisFromPlacement(basePlacement);\n const altAxis = getAltAxis(mainAxis);\n const popperOffsets = state.modifiersData.popperOffsets;\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const tetherOffsetValue =\n typeof tetherOffset === 'function'\n ? tetherOffset({\n ...state.rects,\n placement: state.placement,\n })\n : tetherOffset;\n const normalizedTetherOffsetValue =\n typeof tetherOffsetValue === 'number'\n ? { mainAxis: tetherOffsetValue, altAxis: tetherOffsetValue }\n : { mainAxis: 0, altAxis: 0, ...tetherOffsetValue };\n const offsetModifierState = state.modifiersData.offset\n ? state.modifiersData.offset[state.placement]\n : null;\n\n const data = { x: 0, y: 0 };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n const mainSide = mainAxis === 'y' ? top : left;\n const altSide = mainAxis === 'y' ? bottom : right;\n const len = mainAxis === 'y' ? 'height' : 'width';\n const offset = popperOffsets[mainAxis];\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const additive = tether ? -popperRect[len] / 2 : 0;\n\n const minLen = variation === start ? referenceRect[len] : popperRect[len];\n const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];\n\n // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n const arrowElement = state.elements.arrow;\n const arrowRect =\n tether && arrowElement\n ? getLayoutRect(arrowElement)\n : { width: 0, height: 0 };\n const arrowPaddingObject = state.modifiersData['arrow#persistent']\n ? state.modifiersData['arrow#persistent'].padding\n : getFreshSideObject();\n const arrowPaddingMin = arrowPaddingObject[mainSide];\n const arrowPaddingMax = arrowPaddingObject[altSide];\n\n // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n const arrowLen = within(0, referenceRect[len], arrowRect[len]);\n\n const minOffset = isBasePlacement\n ? referenceRect[len] / 2 -\n additive -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis\n : minLen -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis;\n const maxOffset = isBasePlacement\n ? -referenceRect[len] / 2 +\n additive +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis\n : maxLen +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis;\n\n const arrowOffsetParent =\n state.elements.arrow && getOffsetParent(state.elements.arrow);\n const clientOffset = arrowOffsetParent\n ? mainAxis === 'y'\n ? arrowOffsetParent.clientTop || 0\n : arrowOffsetParent.clientLeft || 0\n : 0;\n\n const offsetModifierValue = offsetModifierState?.[mainAxis] ?? 0;\n const tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n const tetherMax = offset + maxOffset - offsetModifierValue;\n\n const preventedOffset = within(\n tether ? mathMin(min, tetherMin) : min,\n offset,\n tether ? mathMax(max, tetherMax) : max\n );\n\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n const mainSide = mainAxis === 'x' ? top : left;\n const altSide = mainAxis === 'x' ? bottom : right;\n const offset = popperOffsets[altAxis];\n\n const len = altAxis === 'y' ? 'height' : 'width';\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n const offsetModifierValue = offsetModifierState?.[altAxis] ?? 0;\n const tetherMin = isOriginSide\n ? min\n : offset -\n referenceRect[len] -\n popperRect[len] -\n offsetModifierValue +\n normalizedTetherOffsetValue.altAxis;\n const tetherMax = isOriginSide\n ? offset +\n referenceRect[len] +\n popperRect[len] -\n offsetModifierValue -\n normalizedTetherOffsetValue.altAxis\n : max;\n\n const preventedOffset =\n tether && isOriginSide\n ? withinMaxClamp(tetherMin, offset, tetherMax)\n : within(tether ? tetherMin : min, offset, tether ? tetherMax : max);\n\n popperOffsets[altAxis] = preventedOffset;\n data[altAxis] = preventedOffset - offset;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PreventOverflowModifier = Modifier<'preventOverflow', Options>;\nexport default ({\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset'],\n}: PreventOverflowModifier);\n","// @flow\n\nexport default function getAltAxis(axis: 'x' | 'y'): 'x' | 'y' {\n return axis === 'x' ? 'y' : 'x';\n}\n","// @flow\nimport type { Modifier, ModifierArguments, Padding, Rect } from '../types';\nimport type { Placement } from '../enums';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport contains from '../dom-utils/contains';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport { within } from '../utils/within';\nimport mergePaddingObject from '../utils/mergePaddingObject';\nimport expandToHashMap from '../utils/expandToHashMap';\nimport { left, right, basePlacements, top, bottom } from '../enums';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n element: HTMLElement | string | null,\n padding:\n | Padding\n | (({|\n popper: Rect,\n reference: Rect,\n placement: Placement,\n |}) => Padding),\n};\n\nconst toPaddingObject = (padding, state) => {\n padding =\n typeof padding === 'function'\n ? padding({ ...state.rects, placement: state.placement })\n : padding;\n\n return mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n};\n\nfunction arrow({ state, name, options }: ModifierArguments<Options>) {\n const arrowElement = state.elements.arrow;\n const popperOffsets = state.modifiersData.popperOffsets;\n const basePlacement = getBasePlacement(state.placement);\n const axis = getMainAxisFromPlacement(basePlacement);\n const isVertical = [left, right].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n const paddingObject = toPaddingObject(options.padding, state);\n const arrowRect = getLayoutRect(arrowElement);\n const minProp = axis === 'y' ? top : left;\n const maxProp = axis === 'y' ? bottom : right;\n\n const endDiff =\n state.rects.reference[len] +\n state.rects.reference[axis] -\n popperOffsets[axis] -\n state.rects.popper[len];\n const startDiff = popperOffsets[axis] - state.rects.reference[axis];\n\n const arrowOffsetParent = getOffsetParent(arrowElement);\n const clientSize = arrowOffsetParent\n ? axis === 'y'\n ? arrowOffsetParent.clientHeight || 0\n : arrowOffsetParent.clientWidth || 0\n : 0;\n\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n const min = paddingObject[minProp];\n const max = clientSize - arrowRect[len] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // Prevents breaking syntax highlighting...\n const axisProp: string = axis;\n state.modifiersData[name] = {\n [axisProp]: offset,\n centerOffset: offset - center,\n };\n}\n\nfunction effect({ state, options }: ModifierArguments<Options>) {\n let { element: arrowElement = '[data-popper-arrow]' } = options;\n\n if (arrowElement == null) {\n return;\n }\n\n // CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (__DEV__) {\n if (!isHTMLElement(arrowElement)) {\n console.error(\n [\n 'Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).',\n 'To use an SVG arrow, wrap it in an HTMLElement that will be used as',\n 'the arrow.',\n ].join(' ')\n );\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (__DEV__) {\n console.error(\n [\n 'Popper: \"arrow\" modifier\\'s `element` must be a child of the popper',\n 'element.',\n ].join(' ')\n );\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ArrowModifier = Modifier<'arrow', Options>;\nexport default ({\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow'],\n}: ArrowModifier);\n","// @flow\nimport type {\n ModifierArguments,\n Modifier,\n Rect,\n SideObject,\n Offsets,\n} from '../types';\nimport { top, bottom, left, right } from '../enums';\nimport detectOverflow from '../utils/detectOverflow';\n\nfunction getSideOffsets(\n overflow: SideObject,\n rect: Rect,\n preventedOffsets: Offsets = { x: 0, y: 0 }\n): SideObject {\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x,\n };\n}\n\nfunction isAnySideFullyClipped(overflow: SideObject): boolean {\n return [top, right, bottom, left].some((side) => overflow[side] >= 0);\n}\n\nfunction hide({ state, name }: ModifierArguments<{||}>) {\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const preventedOffsets = state.modifiersData.preventOverflow;\n\n const referenceOverflow = detectOverflow(state, {\n elementContext: 'reference',\n });\n const popperAltOverflow = detectOverflow(state, {\n altBoundary: true,\n });\n\n const referenceClippingOffsets = getSideOffsets(\n referenceOverflow,\n referenceRect\n );\n const popperEscapeOffsets = getSideOffsets(\n popperAltOverflow,\n popperRect,\n preventedOffsets\n );\n\n const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n\n state.modifiersData[name] = {\n referenceClippingOffsets,\n popperEscapeOffsets,\n isReferenceHidden,\n hasPopperEscaped,\n };\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type HideModifier = Modifier<'hide', {||}>;\nexport default ({\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide,\n}: HideModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\nimport offset from './modifiers/offset';\nimport flip from './modifiers/flip';\nimport preventOverflow from './modifiers/preventOverflow';\nimport arrow from './modifiers/arrow';\nimport hide from './modifiers/hide';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n offset,\n flip,\n preventOverflow,\n arrow,\n hide,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper as createPopperLite } from './popper-lite';\n// eslint-disable-next-line import/no-unused-modules\nexport * from './modifiers';\n"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","height","top","right","bottom","left","x","y","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","test","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","clientRect","abs","offsetLeft","offsetTop","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","_element$ownerDocumen","target","concat","visualViewport","updatedList","isTableElement","getTrueOffsetParent","position","getOffsetParent","isFirefox","navigator","userAgent","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","auto","basePlacements","start","end","viewport","popper","variationPlacements","reduce","acc","placement","placements","modifierPhases","order","modifiers","map","Map","visited","Set","result","sort","modifier","add","name","requires","requiresIfExists","forEach","dep","has","depModifier","get","push","set","getBasePlacement","split","contains","parent","child","rootNode","getRootNode","next","isSameNode","rectToClientRect","getClientRectFromMixedType","clippingParent","html","clientWidth","clientHeight","getViewportRect","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","getVariation","getMainAxisFromPlacement","computeOffsets","reference","basePlacement","variation","commonX","commonY","mainAxis","len","mergePaddingObject","paddingObject","expandToHashMap","value","keys","hashMap","key","detectOverflow","state","options","elementContext","altBoundary","padding","altContext","popperRect","rects","elements","clippingClientRect","contextElement","referenceClientRect","popperOffsets","strategy","popperClientRect","elementClientRect","overflowOffsets","offsetData","modifiersData","offset","Object","multiply","axis","DEFAULT_OPTIONS","areValidElements","args","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","fn","pending","orderedModifiers","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","merged","phase","orderModifiers","current","existing","data","m","enabled","effect","cleanupFn","noopFn","update","forceUpdate","reset","index","length","Promise","resolve","then","undefined","destroy","onFirstUpdate","passive","resize","addEventListener","removeEventListener","unsetSides","mapToStyles","gpuAcceleration","adaptive","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","heightProp","widthProp","commonStyles","dpr","devicePixelRatio","roundOffsetsByDPR","arrow","style","assign","removeAttribute","setAttribute","initialStyles","margin","property","attribute","invertDistance","skidding","distance","distanceAndSkiddingToXY","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","computeAutoPlacement","flipVariations","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","a","b","_skip","checkMainAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","i","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","every","check","fittingPlacement","find","slice","within","mathMax","mathMin","tether","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","mainSide","altSide","additive","minLen","maxLen","arrowElement","arrowRect","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","arrowOffsetParent","clientOffset","offsetModifierValue","tetherMax","preventedOffset","isOriginSide","tetherMin","v","withinMaxClamp","toPaddingObject","minProp","maxProp","endDiff","startDiff","clientSize","centerToReference","center","axisProp","centerOffset","querySelector","getSideOffsets","preventedOffsets","isAnySideFullyClipped","side","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","createPopper","eventListeners","computeStyles","applyStyles","flip","hide"],"mappings":";;;;8OAIe,SAASA,EAAUC,MACpB,MAARA,SACKC,UAGe,oBAApBD,EAAKE,WAAkC,KACnCC,EAAgBH,EAAKG,qBACpBA,GAAgBA,EAAcC,aAAwBH,cAGxDD,ECTT,SAASK,EAAUL,UAEVA,aADYD,EAAUC,GAAMM,SACEN,aAAgBM,QAKvD,SAASC,EAAcP,UAEdA,aADYD,EAAUC,GAAMQ,aACER,aAAgBQ,YAKvD,SAASC,EAAaT,SAEM,oBAAfU,aAIJV,aADYD,EAAUC,GAAMU,YACEV,aAAgBU,YCxBhD,IAAMC,EAAMC,KAAKD,IACXE,EAAMD,KAAKC,IACXC,EAAQF,KAAKE,MCEX,SAASC,EACtBC,EACAC,YAAAA,IAAAA,GAAwB,OAElBC,EAAOF,EAAQD,wBACjBI,EAAS,EACTC,EAAS,KAETb,EAAcS,IAAYC,EAAc,KACpCI,EAAeL,EAAQK,aACvBC,EAAcN,EAAQM,YAIxB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