@redsift/table 12.4.0 → 12.5.0-muiv7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2453 @@
1
+ import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import * as React from 'react';
3
+ import React__default, { forwardRef } from 'react';
4
+ import { ButtonsColorPalette, IconButton, Button, Checkbox, Icon } from '@redsift/design-system';
5
+ import { mdiFilterVariant, mdiViewColumn, mdiArrowUp, mdiArrowDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronDown, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
6
+ import { e as generateUtilityClass, g as generateUtilityClasses, o as ownerDocument, k as Portal, l as chainPropTypes, P as PropTypes, H as HTMLElementType, j as refType, m as useForkRef, n as useEnhancedEffect, p as useSlotProps, h as composeClasses, f as styled, q as useRtl, u as useDefaultProps } from './Portal.js';
7
+ import { j as jsxRuntimeExports } from './jsx-runtime.js';
8
+
9
+ const _excluded$2 = ["children", "color", "onClick", "startIcon"];
10
+ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
11
+ var _props$className;
12
+ const {
13
+ children,
14
+ color: propsColor,
15
+ onClick,
16
+ startIcon
17
+ } = props,
18
+ forwardedProps = _objectWithoutProperties(props, _excluded$2);
19
+ const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
20
+ if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
21
+ return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
22
+ color: color,
23
+ onClick: onClick,
24
+ ref: ref,
25
+ variant: "unstyled",
26
+ isActive: props['aria-expanded'] === 'true',
27
+ icon: typeof startIcon !== 'string' ? /*#__PURE__*/React__default.cloneElement(startIcon, {
28
+ fontSize: 'medium'
29
+ }) : startIcon,
30
+ "aria-label": children,
31
+ size: "medium"
32
+ }));
33
+ }
34
+ return /*#__PURE__*/React__default.createElement(Button, _extends({}, forwardedProps, {
35
+ color: color,
36
+ onClick: onClick,
37
+ ref: ref,
38
+ variant: "unstyled",
39
+ isActive: props['aria-expanded'] === 'true',
40
+ leftIcon: startIcon
41
+ }), children);
42
+ });
43
+
44
+ const _excluded$1 = ["checked", "indeterminate", "disabled", "onChange", "touchRippleRef"];
45
+ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
46
+ const {
47
+ checked,
48
+ indeterminate,
49
+ disabled,
50
+ onChange,
51
+ touchRippleRef: _touchRippleRef
52
+ } = props,
53
+ forwardedProps = _objectWithoutProperties(props, _excluded$1);
54
+ return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, forwardedProps, forwardedProps.inputProps, {
55
+ isSelected: checked && !indeterminate,
56
+ isDisabled: disabled,
57
+ isIndeterminate: indeterminate,
58
+ ref: ref,
59
+ onChange: (isChecked, value, name, event) => onChange === null || onChange === void 0 ? void 0 : onChange(event)
60
+ }));
61
+ });
62
+
63
+ const _excluded = ["displayName"];
64
+ const muiIconToDSIcon = {
65
+ columnFilteredIcon: mdiFilterVariant,
66
+ columnSelectorIcon: mdiViewColumn,
67
+ columnSortedAscendingIcon: mdiArrowUp,
68
+ columnSortedDescendingIcon: mdiArrowDown,
69
+ densityCompactIcon: mdiViewHeadline,
70
+ densityStandardIcon: mdiViewSequential,
71
+ densityComfortableIcon: mdiViewStream,
72
+ detailPanelCollapseIcon: mdiChevronDown,
73
+ detailPanelExpandIcon: mdiChevronRight,
74
+ exportIcon: mdiTrayArrowDown,
75
+ openFilterButtonIcon: mdiFilterVariant
76
+ };
77
+ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
78
+ const {
79
+ displayName
80
+ } = props,
81
+ forwardedProps = _objectWithoutProperties(props, _excluded);
82
+ return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
83
+ ref: ref,
84
+ size: forwardedProps.fontSize,
85
+ icon: muiIconToDSIcon[displayName]
86
+ }));
87
+ });
88
+
89
+ var top = 'top';
90
+ var bottom = 'bottom';
91
+ var right = 'right';
92
+ var left = 'left';
93
+ var auto = 'auto';
94
+ var basePlacements = [top, bottom, right, left];
95
+ var start = 'start';
96
+ var end = 'end';
97
+ var clippingParents = 'clippingParents';
98
+ var viewport = 'viewport';
99
+ var popper = 'popper';
100
+ var reference = 'reference';
101
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
102
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
103
+ }, []);
104
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
105
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
106
+ }, []); // modifiers that need to read the DOM
107
+
108
+ var beforeRead = 'beforeRead';
109
+ var read = 'read';
110
+ var afterRead = 'afterRead'; // pure-logic modifiers
111
+
112
+ var beforeMain = 'beforeMain';
113
+ var main = 'main';
114
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
115
+
116
+ var beforeWrite = 'beforeWrite';
117
+ var write = 'write';
118
+ var afterWrite = 'afterWrite';
119
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
120
+
121
+ function getNodeName(element) {
122
+ return element ? (element.nodeName || '').toLowerCase() : null;
123
+ }
124
+
125
+ function getWindow(node) {
126
+ if (node == null) {
127
+ return window;
128
+ }
129
+
130
+ if (node.toString() !== '[object Window]') {
131
+ var ownerDocument = node.ownerDocument;
132
+ return ownerDocument ? ownerDocument.defaultView || window : window;
133
+ }
134
+
135
+ return node;
136
+ }
137
+
138
+ function isElement(node) {
139
+ var OwnElement = getWindow(node).Element;
140
+ return node instanceof OwnElement || node instanceof Element;
141
+ }
142
+
143
+ function isHTMLElement$1(node) {
144
+ var OwnElement = getWindow(node).HTMLElement;
145
+ return node instanceof OwnElement || node instanceof HTMLElement;
146
+ }
147
+
148
+ function isShadowRoot(node) {
149
+ // IE 11 has no ShadowRoot
150
+ if (typeof ShadowRoot === 'undefined') {
151
+ return false;
152
+ }
153
+
154
+ var OwnElement = getWindow(node).ShadowRoot;
155
+ return node instanceof OwnElement || node instanceof ShadowRoot;
156
+ }
157
+
158
+ // and applies them to the HTMLElements such as popper and arrow
159
+
160
+ function applyStyles(_ref) {
161
+ var state = _ref.state;
162
+ Object.keys(state.elements).forEach(function (name) {
163
+ var style = state.styles[name] || {};
164
+ var attributes = state.attributes[name] || {};
165
+ var element = state.elements[name]; // arrow is optional + virtual elements
166
+
167
+ if (!isHTMLElement$1(element) || !getNodeName(element)) {
168
+ return;
169
+ } // Flow doesn't support to extend this property, but it's the most
170
+ // effective way to apply styles to an HTMLElement
171
+ // $FlowFixMe[cannot-write]
172
+
173
+
174
+ Object.assign(element.style, style);
175
+ Object.keys(attributes).forEach(function (name) {
176
+ var value = attributes[name];
177
+
178
+ if (value === false) {
179
+ element.removeAttribute(name);
180
+ } else {
181
+ element.setAttribute(name, value === true ? '' : value);
182
+ }
183
+ });
184
+ });
185
+ }
186
+
187
+ function effect$2(_ref2) {
188
+ var state = _ref2.state;
189
+ var initialStyles = {
190
+ popper: {
191
+ position: state.options.strategy,
192
+ left: '0',
193
+ top: '0',
194
+ margin: '0'
195
+ },
196
+ arrow: {
197
+ position: 'absolute'
198
+ },
199
+ reference: {}
200
+ };
201
+ Object.assign(state.elements.popper.style, initialStyles.popper);
202
+ state.styles = initialStyles;
203
+
204
+ if (state.elements.arrow) {
205
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
206
+ }
207
+
208
+ return function () {
209
+ Object.keys(state.elements).forEach(function (name) {
210
+ var element = state.elements[name];
211
+ var attributes = state.attributes[name] || {};
212
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
213
+
214
+ var style = styleProperties.reduce(function (style, property) {
215
+ style[property] = '';
216
+ return style;
217
+ }, {}); // arrow is optional + virtual elements
218
+
219
+ if (!isHTMLElement$1(element) || !getNodeName(element)) {
220
+ return;
221
+ }
222
+
223
+ Object.assign(element.style, style);
224
+ Object.keys(attributes).forEach(function (attribute) {
225
+ element.removeAttribute(attribute);
226
+ });
227
+ });
228
+ };
229
+ } // eslint-disable-next-line import/no-unused-modules
230
+
231
+
232
+ var applyStyles$1 = {
233
+ name: 'applyStyles',
234
+ enabled: true,
235
+ phase: 'write',
236
+ fn: applyStyles,
237
+ effect: effect$2,
238
+ requires: ['computeStyles']
239
+ };
240
+
241
+ function getBasePlacement(placement) {
242
+ return placement.split('-')[0];
243
+ }
244
+
245
+ var max = Math.max;
246
+ var min = Math.min;
247
+ var round = Math.round;
248
+
249
+ function getUAString() {
250
+ var uaData = navigator.userAgentData;
251
+
252
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
253
+ return uaData.brands.map(function (item) {
254
+ return item.brand + "/" + item.version;
255
+ }).join(' ');
256
+ }
257
+
258
+ return navigator.userAgent;
259
+ }
260
+
261
+ function isLayoutViewport() {
262
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
263
+ }
264
+
265
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
266
+ if (includeScale === void 0) {
267
+ includeScale = false;
268
+ }
269
+
270
+ if (isFixedStrategy === void 0) {
271
+ isFixedStrategy = false;
272
+ }
273
+
274
+ var clientRect = element.getBoundingClientRect();
275
+ var scaleX = 1;
276
+ var scaleY = 1;
277
+
278
+ if (includeScale && isHTMLElement$1(element)) {
279
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
280
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
281
+ }
282
+
283
+ var _ref = isElement(element) ? getWindow(element) : window,
284
+ visualViewport = _ref.visualViewport;
285
+
286
+ var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
287
+ var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
288
+ var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
289
+ var width = clientRect.width / scaleX;
290
+ var height = clientRect.height / scaleY;
291
+ return {
292
+ width: width,
293
+ height: height,
294
+ top: y,
295
+ right: x + width,
296
+ bottom: y + height,
297
+ left: x,
298
+ x: x,
299
+ y: y
300
+ };
301
+ }
302
+
303
+ // means it doesn't take into account transforms.
304
+
305
+ function getLayoutRect(element) {
306
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
307
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
308
+
309
+ var width = element.offsetWidth;
310
+ var height = element.offsetHeight;
311
+
312
+ if (Math.abs(clientRect.width - width) <= 1) {
313
+ width = clientRect.width;
314
+ }
315
+
316
+ if (Math.abs(clientRect.height - height) <= 1) {
317
+ height = clientRect.height;
318
+ }
319
+
320
+ return {
321
+ x: element.offsetLeft,
322
+ y: element.offsetTop,
323
+ width: width,
324
+ height: height
325
+ };
326
+ }
327
+
328
+ function contains(parent, child) {
329
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
330
+
331
+ if (parent.contains(child)) {
332
+ return true;
333
+ } // then fallback to custom implementation with Shadow DOM support
334
+ else if (rootNode && isShadowRoot(rootNode)) {
335
+ var next = child;
336
+
337
+ do {
338
+ if (next && parent.isSameNode(next)) {
339
+ return true;
340
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
341
+
342
+
343
+ next = next.parentNode || next.host;
344
+ } while (next);
345
+ } // Give up, the result is false
346
+
347
+
348
+ return false;
349
+ }
350
+
351
+ function getComputedStyle(element) {
352
+ return getWindow(element).getComputedStyle(element);
353
+ }
354
+
355
+ function isTableElement(element) {
356
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
357
+ }
358
+
359
+ function getDocumentElement(element) {
360
+ // $FlowFixMe[incompatible-return]: assume body is always available
361
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
362
+ element.document) || window.document).documentElement;
363
+ }
364
+
365
+ function getParentNode(element) {
366
+ if (getNodeName(element) === 'html') {
367
+ return element;
368
+ }
369
+
370
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
371
+ // $FlowFixMe[incompatible-return]
372
+ // $FlowFixMe[prop-missing]
373
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
374
+ element.parentNode || ( // DOM Element detected
375
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
376
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
377
+ getDocumentElement(element) // fallback
378
+
379
+ );
380
+ }
381
+
382
+ function getTrueOffsetParent(element) {
383
+ if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
384
+ getComputedStyle(element).position === 'fixed') {
385
+ return null;
386
+ }
387
+
388
+ return element.offsetParent;
389
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
390
+ // return the containing block
391
+
392
+
393
+ function getContainingBlock(element) {
394
+ var isFirefox = /firefox/i.test(getUAString());
395
+ var isIE = /Trident/i.test(getUAString());
396
+
397
+ if (isIE && isHTMLElement$1(element)) {
398
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
399
+ var elementCss = getComputedStyle(element);
400
+
401
+ if (elementCss.position === 'fixed') {
402
+ return null;
403
+ }
404
+ }
405
+
406
+ var currentNode = getParentNode(element);
407
+
408
+ if (isShadowRoot(currentNode)) {
409
+ currentNode = currentNode.host;
410
+ }
411
+
412
+ while (isHTMLElement$1(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
413
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
414
+ // create a containing block.
415
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
416
+
417
+ 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') {
418
+ return currentNode;
419
+ } else {
420
+ currentNode = currentNode.parentNode;
421
+ }
422
+ }
423
+
424
+ return null;
425
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
426
+ // such as table ancestors and cross browser bugs.
427
+
428
+
429
+ function getOffsetParent(element) {
430
+ var window = getWindow(element);
431
+ var offsetParent = getTrueOffsetParent(element);
432
+
433
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
434
+ offsetParent = getTrueOffsetParent(offsetParent);
435
+ }
436
+
437
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
438
+ return window;
439
+ }
440
+
441
+ return offsetParent || getContainingBlock(element) || window;
442
+ }
443
+
444
+ function getMainAxisFromPlacement(placement) {
445
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
446
+ }
447
+
448
+ function within(min$1, value, max$1) {
449
+ return max(min$1, min(value, max$1));
450
+ }
451
+ function withinMaxClamp(min, value, max) {
452
+ var v = within(min, value, max);
453
+ return v > max ? max : v;
454
+ }
455
+
456
+ function getFreshSideObject() {
457
+ return {
458
+ top: 0,
459
+ right: 0,
460
+ bottom: 0,
461
+ left: 0
462
+ };
463
+ }
464
+
465
+ function mergePaddingObject(paddingObject) {
466
+ return Object.assign({}, getFreshSideObject(), paddingObject);
467
+ }
468
+
469
+ function expandToHashMap(value, keys) {
470
+ return keys.reduce(function (hashMap, key) {
471
+ hashMap[key] = value;
472
+ return hashMap;
473
+ }, {});
474
+ }
475
+
476
+ var toPaddingObject = function toPaddingObject(padding, state) {
477
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
478
+ placement: state.placement
479
+ })) : padding;
480
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
481
+ };
482
+
483
+ function arrow(_ref) {
484
+ var _state$modifiersData$;
485
+
486
+ var state = _ref.state,
487
+ name = _ref.name,
488
+ options = _ref.options;
489
+ var arrowElement = state.elements.arrow;
490
+ var popperOffsets = state.modifiersData.popperOffsets;
491
+ var basePlacement = getBasePlacement(state.placement);
492
+ var axis = getMainAxisFromPlacement(basePlacement);
493
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
494
+ var len = isVertical ? 'height' : 'width';
495
+
496
+ if (!arrowElement || !popperOffsets) {
497
+ return;
498
+ }
499
+
500
+ var paddingObject = toPaddingObject(options.padding, state);
501
+ var arrowRect = getLayoutRect(arrowElement);
502
+ var minProp = axis === 'y' ? top : left;
503
+ var maxProp = axis === 'y' ? bottom : right;
504
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
505
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
506
+ var arrowOffsetParent = getOffsetParent(arrowElement);
507
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
508
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
509
+ // outside of the popper bounds
510
+
511
+ var min = paddingObject[minProp];
512
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
513
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
514
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
515
+
516
+ var axisProp = axis;
517
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
518
+ }
519
+
520
+ function effect$1(_ref2) {
521
+ var state = _ref2.state,
522
+ options = _ref2.options;
523
+ var _options$element = options.element,
524
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
525
+
526
+ if (arrowElement == null) {
527
+ return;
528
+ } // CSS selector
529
+
530
+
531
+ if (typeof arrowElement === 'string') {
532
+ arrowElement = state.elements.popper.querySelector(arrowElement);
533
+
534
+ if (!arrowElement) {
535
+ return;
536
+ }
537
+ }
538
+
539
+ if (!contains(state.elements.popper, arrowElement)) {
540
+ return;
541
+ }
542
+
543
+ state.elements.arrow = arrowElement;
544
+ } // eslint-disable-next-line import/no-unused-modules
545
+
546
+
547
+ var arrow$1 = {
548
+ name: 'arrow',
549
+ enabled: true,
550
+ phase: 'main',
551
+ fn: arrow,
552
+ effect: effect$1,
553
+ requires: ['popperOffsets'],
554
+ requiresIfExists: ['preventOverflow']
555
+ };
556
+
557
+ function getVariation(placement) {
558
+ return placement.split('-')[1];
559
+ }
560
+
561
+ var unsetSides = {
562
+ top: 'auto',
563
+ right: 'auto',
564
+ bottom: 'auto',
565
+ left: 'auto'
566
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
567
+ // Zooming can change the DPR, but it seems to report a value that will
568
+ // cleanly divide the values into the appropriate subpixels.
569
+
570
+ function roundOffsetsByDPR(_ref, win) {
571
+ var x = _ref.x,
572
+ y = _ref.y;
573
+ var dpr = win.devicePixelRatio || 1;
574
+ return {
575
+ x: round(x * dpr) / dpr || 0,
576
+ y: round(y * dpr) / dpr || 0
577
+ };
578
+ }
579
+
580
+ function mapToStyles(_ref2) {
581
+ var _Object$assign2;
582
+
583
+ var popper = _ref2.popper,
584
+ popperRect = _ref2.popperRect,
585
+ placement = _ref2.placement,
586
+ variation = _ref2.variation,
587
+ offsets = _ref2.offsets,
588
+ position = _ref2.position,
589
+ gpuAcceleration = _ref2.gpuAcceleration,
590
+ adaptive = _ref2.adaptive,
591
+ roundOffsets = _ref2.roundOffsets,
592
+ isFixed = _ref2.isFixed;
593
+ var _offsets$x = offsets.x,
594
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
595
+ _offsets$y = offsets.y,
596
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
597
+
598
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
599
+ x: x,
600
+ y: y
601
+ }) : {
602
+ x: x,
603
+ y: y
604
+ };
605
+
606
+ x = _ref3.x;
607
+ y = _ref3.y;
608
+ var hasX = offsets.hasOwnProperty('x');
609
+ var hasY = offsets.hasOwnProperty('y');
610
+ var sideX = left;
611
+ var sideY = top;
612
+ var win = window;
613
+
614
+ if (adaptive) {
615
+ var offsetParent = getOffsetParent(popper);
616
+ var heightProp = 'clientHeight';
617
+ var widthProp = 'clientWidth';
618
+
619
+ if (offsetParent === getWindow(popper)) {
620
+ offsetParent = getDocumentElement(popper);
621
+
622
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
623
+ heightProp = 'scrollHeight';
624
+ widthProp = 'scrollWidth';
625
+ }
626
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
627
+
628
+
629
+ offsetParent = offsetParent;
630
+
631
+ if (placement === top || (placement === left || placement === right) && variation === end) {
632
+ sideY = bottom;
633
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
634
+ offsetParent[heightProp];
635
+ y -= offsetY - popperRect.height;
636
+ y *= gpuAcceleration ? 1 : -1;
637
+ }
638
+
639
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
640
+ sideX = right;
641
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
642
+ offsetParent[widthProp];
643
+ x -= offsetX - popperRect.width;
644
+ x *= gpuAcceleration ? 1 : -1;
645
+ }
646
+ }
647
+
648
+ var commonStyles = Object.assign({
649
+ position: position
650
+ }, adaptive && unsetSides);
651
+
652
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
653
+ x: x,
654
+ y: y
655
+ }, getWindow(popper)) : {
656
+ x: x,
657
+ y: y
658
+ };
659
+
660
+ x = _ref4.x;
661
+ y = _ref4.y;
662
+
663
+ if (gpuAcceleration) {
664
+ var _Object$assign;
665
+
666
+ 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));
667
+ }
668
+
669
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
670
+ }
671
+
672
+ function computeStyles(_ref5) {
673
+ var state = _ref5.state,
674
+ options = _ref5.options;
675
+ var _options$gpuAccelerat = options.gpuAcceleration,
676
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
677
+ _options$adaptive = options.adaptive,
678
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
679
+ _options$roundOffsets = options.roundOffsets,
680
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
681
+ var commonStyles = {
682
+ placement: getBasePlacement(state.placement),
683
+ variation: getVariation(state.placement),
684
+ popper: state.elements.popper,
685
+ popperRect: state.rects.popper,
686
+ gpuAcceleration: gpuAcceleration,
687
+ isFixed: state.options.strategy === 'fixed'
688
+ };
689
+
690
+ if (state.modifiersData.popperOffsets != null) {
691
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
692
+ offsets: state.modifiersData.popperOffsets,
693
+ position: state.options.strategy,
694
+ adaptive: adaptive,
695
+ roundOffsets: roundOffsets
696
+ })));
697
+ }
698
+
699
+ if (state.modifiersData.arrow != null) {
700
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
701
+ offsets: state.modifiersData.arrow,
702
+ position: 'absolute',
703
+ adaptive: false,
704
+ roundOffsets: roundOffsets
705
+ })));
706
+ }
707
+
708
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
709
+ 'data-popper-placement': state.placement
710
+ });
711
+ } // eslint-disable-next-line import/no-unused-modules
712
+
713
+
714
+ var computeStyles$1 = {
715
+ name: 'computeStyles',
716
+ enabled: true,
717
+ phase: 'beforeWrite',
718
+ fn: computeStyles,
719
+ data: {}
720
+ };
721
+
722
+ var passive = {
723
+ passive: true
724
+ };
725
+
726
+ function effect(_ref) {
727
+ var state = _ref.state,
728
+ instance = _ref.instance,
729
+ options = _ref.options;
730
+ var _options$scroll = options.scroll,
731
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
732
+ _options$resize = options.resize,
733
+ resize = _options$resize === void 0 ? true : _options$resize;
734
+ var window = getWindow(state.elements.popper);
735
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
736
+
737
+ if (scroll) {
738
+ scrollParents.forEach(function (scrollParent) {
739
+ scrollParent.addEventListener('scroll', instance.update, passive);
740
+ });
741
+ }
742
+
743
+ if (resize) {
744
+ window.addEventListener('resize', instance.update, passive);
745
+ }
746
+
747
+ return function () {
748
+ if (scroll) {
749
+ scrollParents.forEach(function (scrollParent) {
750
+ scrollParent.removeEventListener('scroll', instance.update, passive);
751
+ });
752
+ }
753
+
754
+ if (resize) {
755
+ window.removeEventListener('resize', instance.update, passive);
756
+ }
757
+ };
758
+ } // eslint-disable-next-line import/no-unused-modules
759
+
760
+
761
+ var eventListeners = {
762
+ name: 'eventListeners',
763
+ enabled: true,
764
+ phase: 'write',
765
+ fn: function fn() {},
766
+ effect: effect,
767
+ data: {}
768
+ };
769
+
770
+ var hash$1 = {
771
+ left: 'right',
772
+ right: 'left',
773
+ bottom: 'top',
774
+ top: 'bottom'
775
+ };
776
+ function getOppositePlacement(placement) {
777
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
778
+ return hash$1[matched];
779
+ });
780
+ }
781
+
782
+ var hash = {
783
+ start: 'end',
784
+ end: 'start'
785
+ };
786
+ function getOppositeVariationPlacement(placement) {
787
+ return placement.replace(/start|end/g, function (matched) {
788
+ return hash[matched];
789
+ });
790
+ }
791
+
792
+ function getWindowScroll(node) {
793
+ var win = getWindow(node);
794
+ var scrollLeft = win.pageXOffset;
795
+ var scrollTop = win.pageYOffset;
796
+ return {
797
+ scrollLeft: scrollLeft,
798
+ scrollTop: scrollTop
799
+ };
800
+ }
801
+
802
+ function getWindowScrollBarX(element) {
803
+ // If <html> has a CSS width greater than the viewport, then this will be
804
+ // incorrect for RTL.
805
+ // Popper 1 is broken in this case and never had a bug report so let's assume
806
+ // it's not an issue. I don't think anyone ever specifies width on <html>
807
+ // anyway.
808
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
809
+ // this (e.g. Edge 2019, IE11, Safari)
810
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
811
+ }
812
+
813
+ function getViewportRect(element, strategy) {
814
+ var win = getWindow(element);
815
+ var html = getDocumentElement(element);
816
+ var visualViewport = win.visualViewport;
817
+ var width = html.clientWidth;
818
+ var height = html.clientHeight;
819
+ var x = 0;
820
+ var y = 0;
821
+
822
+ if (visualViewport) {
823
+ width = visualViewport.width;
824
+ height = visualViewport.height;
825
+ var layoutViewport = isLayoutViewport();
826
+
827
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
828
+ x = visualViewport.offsetLeft;
829
+ y = visualViewport.offsetTop;
830
+ }
831
+ }
832
+
833
+ return {
834
+ width: width,
835
+ height: height,
836
+ x: x + getWindowScrollBarX(element),
837
+ y: y
838
+ };
839
+ }
840
+
841
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
842
+
843
+ function getDocumentRect(element) {
844
+ var _element$ownerDocumen;
845
+
846
+ var html = getDocumentElement(element);
847
+ var winScroll = getWindowScroll(element);
848
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
849
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
850
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
851
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
852
+ var y = -winScroll.scrollTop;
853
+
854
+ if (getComputedStyle(body || html).direction === 'rtl') {
855
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
856
+ }
857
+
858
+ return {
859
+ width: width,
860
+ height: height,
861
+ x: x,
862
+ y: y
863
+ };
864
+ }
865
+
866
+ function isScrollParent(element) {
867
+ // Firefox wants us to check `-x` and `-y` variations as well
868
+ var _getComputedStyle = getComputedStyle(element),
869
+ overflow = _getComputedStyle.overflow,
870
+ overflowX = _getComputedStyle.overflowX,
871
+ overflowY = _getComputedStyle.overflowY;
872
+
873
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
874
+ }
875
+
876
+ function getScrollParent(node) {
877
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
878
+ // $FlowFixMe[incompatible-return]: assume body is always available
879
+ return node.ownerDocument.body;
880
+ }
881
+
882
+ if (isHTMLElement$1(node) && isScrollParent(node)) {
883
+ return node;
884
+ }
885
+
886
+ return getScrollParent(getParentNode(node));
887
+ }
888
+
889
+ /*
890
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
891
+ until we get to the top window object. This list is what we attach scroll listeners
892
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
893
+ reference element's position.
894
+ */
895
+
896
+ function listScrollParents(element, list) {
897
+ var _element$ownerDocumen;
898
+
899
+ if (list === void 0) {
900
+ list = [];
901
+ }
902
+
903
+ var scrollParent = getScrollParent(element);
904
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
905
+ var win = getWindow(scrollParent);
906
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
907
+ var updatedList = list.concat(target);
908
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
909
+ updatedList.concat(listScrollParents(getParentNode(target)));
910
+ }
911
+
912
+ function rectToClientRect(rect) {
913
+ return Object.assign({}, rect, {
914
+ left: rect.x,
915
+ top: rect.y,
916
+ right: rect.x + rect.width,
917
+ bottom: rect.y + rect.height
918
+ });
919
+ }
920
+
921
+ function getInnerBoundingClientRect(element, strategy) {
922
+ var rect = getBoundingClientRect(element, false, strategy === 'fixed');
923
+ rect.top = rect.top + element.clientTop;
924
+ rect.left = rect.left + element.clientLeft;
925
+ rect.bottom = rect.top + element.clientHeight;
926
+ rect.right = rect.left + element.clientWidth;
927
+ rect.width = element.clientWidth;
928
+ rect.height = element.clientHeight;
929
+ rect.x = rect.left;
930
+ rect.y = rect.top;
931
+ return rect;
932
+ }
933
+
934
+ function getClientRectFromMixedType(element, clippingParent, strategy) {
935
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
936
+ } // A "clipping parent" is an overflowable container with the characteristic of
937
+ // clipping (or hiding) overflowing elements with a position different from
938
+ // `initial`
939
+
940
+
941
+ function getClippingParents(element) {
942
+ var clippingParents = listScrollParents(getParentNode(element));
943
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
944
+ var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent(element) : element;
945
+
946
+ if (!isElement(clipperElement)) {
947
+ return [];
948
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
949
+
950
+
951
+ return clippingParents.filter(function (clippingParent) {
952
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
953
+ });
954
+ } // Gets the maximum area that the element is visible in due to any number of
955
+ // clipping parents
956
+
957
+
958
+ function getClippingRect(element, boundary, rootBoundary, strategy) {
959
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
960
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
961
+ var firstClippingParent = clippingParents[0];
962
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
963
+ var rect = getClientRectFromMixedType(element, clippingParent, strategy);
964
+ accRect.top = max(rect.top, accRect.top);
965
+ accRect.right = min(rect.right, accRect.right);
966
+ accRect.bottom = min(rect.bottom, accRect.bottom);
967
+ accRect.left = max(rect.left, accRect.left);
968
+ return accRect;
969
+ }, getClientRectFromMixedType(element, firstClippingParent, strategy));
970
+ clippingRect.width = clippingRect.right - clippingRect.left;
971
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
972
+ clippingRect.x = clippingRect.left;
973
+ clippingRect.y = clippingRect.top;
974
+ return clippingRect;
975
+ }
976
+
977
+ function computeOffsets(_ref) {
978
+ var reference = _ref.reference,
979
+ element = _ref.element,
980
+ placement = _ref.placement;
981
+ var basePlacement = placement ? getBasePlacement(placement) : null;
982
+ var variation = placement ? getVariation(placement) : null;
983
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
984
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
985
+ var offsets;
986
+
987
+ switch (basePlacement) {
988
+ case top:
989
+ offsets = {
990
+ x: commonX,
991
+ y: reference.y - element.height
992
+ };
993
+ break;
994
+
995
+ case bottom:
996
+ offsets = {
997
+ x: commonX,
998
+ y: reference.y + reference.height
999
+ };
1000
+ break;
1001
+
1002
+ case right:
1003
+ offsets = {
1004
+ x: reference.x + reference.width,
1005
+ y: commonY
1006
+ };
1007
+ break;
1008
+
1009
+ case left:
1010
+ offsets = {
1011
+ x: reference.x - element.width,
1012
+ y: commonY
1013
+ };
1014
+ break;
1015
+
1016
+ default:
1017
+ offsets = {
1018
+ x: reference.x,
1019
+ y: reference.y
1020
+ };
1021
+ }
1022
+
1023
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
1024
+
1025
+ if (mainAxis != null) {
1026
+ var len = mainAxis === 'y' ? 'height' : 'width';
1027
+
1028
+ switch (variation) {
1029
+ case start:
1030
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
1031
+ break;
1032
+
1033
+ case end:
1034
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
1035
+ break;
1036
+ }
1037
+ }
1038
+
1039
+ return offsets;
1040
+ }
1041
+
1042
+ function detectOverflow(state, options) {
1043
+ if (options === void 0) {
1044
+ options = {};
1045
+ }
1046
+
1047
+ var _options = options,
1048
+ _options$placement = _options.placement,
1049
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
1050
+ _options$strategy = _options.strategy,
1051
+ strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
1052
+ _options$boundary = _options.boundary,
1053
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
1054
+ _options$rootBoundary = _options.rootBoundary,
1055
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
1056
+ _options$elementConte = _options.elementContext,
1057
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
1058
+ _options$altBoundary = _options.altBoundary,
1059
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
1060
+ _options$padding = _options.padding,
1061
+ padding = _options$padding === void 0 ? 0 : _options$padding;
1062
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
1063
+ var altContext = elementContext === popper ? reference : popper;
1064
+ var popperRect = state.rects.popper;
1065
+ var element = state.elements[altBoundary ? altContext : elementContext];
1066
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
1067
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
1068
+ var popperOffsets = computeOffsets({
1069
+ reference: referenceClientRect,
1070
+ element: popperRect,
1071
+ strategy: 'absolute',
1072
+ placement: placement
1073
+ });
1074
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
1075
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
1076
+ // 0 or negative = within the clipping rect
1077
+
1078
+ var overflowOffsets = {
1079
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
1080
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
1081
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
1082
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
1083
+ };
1084
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
1085
+
1086
+ if (elementContext === popper && offsetData) {
1087
+ var offset = offsetData[placement];
1088
+ Object.keys(overflowOffsets).forEach(function (key) {
1089
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
1090
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
1091
+ overflowOffsets[key] += offset[axis] * multiply;
1092
+ });
1093
+ }
1094
+
1095
+ return overflowOffsets;
1096
+ }
1097
+
1098
+ function computeAutoPlacement(state, options) {
1099
+ if (options === void 0) {
1100
+ options = {};
1101
+ }
1102
+
1103
+ var _options = options,
1104
+ placement = _options.placement,
1105
+ boundary = _options.boundary,
1106
+ rootBoundary = _options.rootBoundary,
1107
+ padding = _options.padding,
1108
+ flipVariations = _options.flipVariations,
1109
+ _options$allowedAutoP = _options.allowedAutoPlacements,
1110
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1111
+ var variation = getVariation(placement);
1112
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1113
+ return getVariation(placement) === variation;
1114
+ }) : basePlacements;
1115
+ var allowedPlacements = placements$1.filter(function (placement) {
1116
+ return allowedAutoPlacements.indexOf(placement) >= 0;
1117
+ });
1118
+
1119
+ if (allowedPlacements.length === 0) {
1120
+ allowedPlacements = placements$1;
1121
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1122
+
1123
+
1124
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
1125
+ acc[placement] = detectOverflow(state, {
1126
+ placement: placement,
1127
+ boundary: boundary,
1128
+ rootBoundary: rootBoundary,
1129
+ padding: padding
1130
+ })[getBasePlacement(placement)];
1131
+ return acc;
1132
+ }, {});
1133
+ return Object.keys(overflows).sort(function (a, b) {
1134
+ return overflows[a] - overflows[b];
1135
+ });
1136
+ }
1137
+
1138
+ function getExpandedFallbackPlacements(placement) {
1139
+ if (getBasePlacement(placement) === auto) {
1140
+ return [];
1141
+ }
1142
+
1143
+ var oppositePlacement = getOppositePlacement(placement);
1144
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1145
+ }
1146
+
1147
+ function flip(_ref) {
1148
+ var state = _ref.state,
1149
+ options = _ref.options,
1150
+ name = _ref.name;
1151
+
1152
+ if (state.modifiersData[name]._skip) {
1153
+ return;
1154
+ }
1155
+
1156
+ var _options$mainAxis = options.mainAxis,
1157
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1158
+ _options$altAxis = options.altAxis,
1159
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1160
+ specifiedFallbackPlacements = options.fallbackPlacements,
1161
+ padding = options.padding,
1162
+ boundary = options.boundary,
1163
+ rootBoundary = options.rootBoundary,
1164
+ altBoundary = options.altBoundary,
1165
+ _options$flipVariatio = options.flipVariations,
1166
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1167
+ allowedAutoPlacements = options.allowedAutoPlacements;
1168
+ var preferredPlacement = state.options.placement;
1169
+ var basePlacement = getBasePlacement(preferredPlacement);
1170
+ var isBasePlacement = basePlacement === preferredPlacement;
1171
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1172
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1173
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1174
+ placement: placement,
1175
+ boundary: boundary,
1176
+ rootBoundary: rootBoundary,
1177
+ padding: padding,
1178
+ flipVariations: flipVariations,
1179
+ allowedAutoPlacements: allowedAutoPlacements
1180
+ }) : placement);
1181
+ }, []);
1182
+ var referenceRect = state.rects.reference;
1183
+ var popperRect = state.rects.popper;
1184
+ var checksMap = new Map();
1185
+ var makeFallbackChecks = true;
1186
+ var firstFittingPlacement = placements[0];
1187
+
1188
+ for (var i = 0; i < placements.length; i++) {
1189
+ var placement = placements[i];
1190
+
1191
+ var _basePlacement = getBasePlacement(placement);
1192
+
1193
+ var isStartVariation = getVariation(placement) === start;
1194
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1195
+ var len = isVertical ? 'width' : 'height';
1196
+ var overflow = detectOverflow(state, {
1197
+ placement: placement,
1198
+ boundary: boundary,
1199
+ rootBoundary: rootBoundary,
1200
+ altBoundary: altBoundary,
1201
+ padding: padding
1202
+ });
1203
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1204
+
1205
+ if (referenceRect[len] > popperRect[len]) {
1206
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1207
+ }
1208
+
1209
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1210
+ var checks = [];
1211
+
1212
+ if (checkMainAxis) {
1213
+ checks.push(overflow[_basePlacement] <= 0);
1214
+ }
1215
+
1216
+ if (checkAltAxis) {
1217
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1218
+ }
1219
+
1220
+ if (checks.every(function (check) {
1221
+ return check;
1222
+ })) {
1223
+ firstFittingPlacement = placement;
1224
+ makeFallbackChecks = false;
1225
+ break;
1226
+ }
1227
+
1228
+ checksMap.set(placement, checks);
1229
+ }
1230
+
1231
+ if (makeFallbackChecks) {
1232
+ // `2` may be desired in some cases – research later
1233
+ var numberOfChecks = flipVariations ? 3 : 1;
1234
+
1235
+ var _loop = function _loop(_i) {
1236
+ var fittingPlacement = placements.find(function (placement) {
1237
+ var checks = checksMap.get(placement);
1238
+
1239
+ if (checks) {
1240
+ return checks.slice(0, _i).every(function (check) {
1241
+ return check;
1242
+ });
1243
+ }
1244
+ });
1245
+
1246
+ if (fittingPlacement) {
1247
+ firstFittingPlacement = fittingPlacement;
1248
+ return "break";
1249
+ }
1250
+ };
1251
+
1252
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1253
+ var _ret = _loop(_i);
1254
+
1255
+ if (_ret === "break") break;
1256
+ }
1257
+ }
1258
+
1259
+ if (state.placement !== firstFittingPlacement) {
1260
+ state.modifiersData[name]._skip = true;
1261
+ state.placement = firstFittingPlacement;
1262
+ state.reset = true;
1263
+ }
1264
+ } // eslint-disable-next-line import/no-unused-modules
1265
+
1266
+
1267
+ var flip$1 = {
1268
+ name: 'flip',
1269
+ enabled: true,
1270
+ phase: 'main',
1271
+ fn: flip,
1272
+ requiresIfExists: ['offset'],
1273
+ data: {
1274
+ _skip: false
1275
+ }
1276
+ };
1277
+
1278
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1279
+ if (preventedOffsets === void 0) {
1280
+ preventedOffsets = {
1281
+ x: 0,
1282
+ y: 0
1283
+ };
1284
+ }
1285
+
1286
+ return {
1287
+ top: overflow.top - rect.height - preventedOffsets.y,
1288
+ right: overflow.right - rect.width + preventedOffsets.x,
1289
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1290
+ left: overflow.left - rect.width - preventedOffsets.x
1291
+ };
1292
+ }
1293
+
1294
+ function isAnySideFullyClipped(overflow) {
1295
+ return [top, right, bottom, left].some(function (side) {
1296
+ return overflow[side] >= 0;
1297
+ });
1298
+ }
1299
+
1300
+ function hide(_ref) {
1301
+ var state = _ref.state,
1302
+ name = _ref.name;
1303
+ var referenceRect = state.rects.reference;
1304
+ var popperRect = state.rects.popper;
1305
+ var preventedOffsets = state.modifiersData.preventOverflow;
1306
+ var referenceOverflow = detectOverflow(state, {
1307
+ elementContext: 'reference'
1308
+ });
1309
+ var popperAltOverflow = detectOverflow(state, {
1310
+ altBoundary: true
1311
+ });
1312
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1313
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1314
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1315
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1316
+ state.modifiersData[name] = {
1317
+ referenceClippingOffsets: referenceClippingOffsets,
1318
+ popperEscapeOffsets: popperEscapeOffsets,
1319
+ isReferenceHidden: isReferenceHidden,
1320
+ hasPopperEscaped: hasPopperEscaped
1321
+ };
1322
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1323
+ 'data-popper-reference-hidden': isReferenceHidden,
1324
+ 'data-popper-escaped': hasPopperEscaped
1325
+ });
1326
+ } // eslint-disable-next-line import/no-unused-modules
1327
+
1328
+
1329
+ var hide$1 = {
1330
+ name: 'hide',
1331
+ enabled: true,
1332
+ phase: 'main',
1333
+ requiresIfExists: ['preventOverflow'],
1334
+ fn: hide
1335
+ };
1336
+
1337
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1338
+ var basePlacement = getBasePlacement(placement);
1339
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1340
+
1341
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1342
+ placement: placement
1343
+ })) : offset,
1344
+ skidding = _ref[0],
1345
+ distance = _ref[1];
1346
+
1347
+ skidding = skidding || 0;
1348
+ distance = (distance || 0) * invertDistance;
1349
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1350
+ x: distance,
1351
+ y: skidding
1352
+ } : {
1353
+ x: skidding,
1354
+ y: distance
1355
+ };
1356
+ }
1357
+
1358
+ function offset(_ref2) {
1359
+ var state = _ref2.state,
1360
+ options = _ref2.options,
1361
+ name = _ref2.name;
1362
+ var _options$offset = options.offset,
1363
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1364
+ var data = placements.reduce(function (acc, placement) {
1365
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1366
+ return acc;
1367
+ }, {});
1368
+ var _data$state$placement = data[state.placement],
1369
+ x = _data$state$placement.x,
1370
+ y = _data$state$placement.y;
1371
+
1372
+ if (state.modifiersData.popperOffsets != null) {
1373
+ state.modifiersData.popperOffsets.x += x;
1374
+ state.modifiersData.popperOffsets.y += y;
1375
+ }
1376
+
1377
+ state.modifiersData[name] = data;
1378
+ } // eslint-disable-next-line import/no-unused-modules
1379
+
1380
+
1381
+ var offset$1 = {
1382
+ name: 'offset',
1383
+ enabled: true,
1384
+ phase: 'main',
1385
+ requires: ['popperOffsets'],
1386
+ fn: offset
1387
+ };
1388
+
1389
+ function popperOffsets(_ref) {
1390
+ var state = _ref.state,
1391
+ name = _ref.name;
1392
+ // Offsets are the actual position the popper needs to have to be
1393
+ // properly positioned near its reference element
1394
+ // This is the most basic placement, and will be adjusted by
1395
+ // the modifiers in the next step
1396
+ state.modifiersData[name] = computeOffsets({
1397
+ reference: state.rects.reference,
1398
+ element: state.rects.popper,
1399
+ strategy: 'absolute',
1400
+ placement: state.placement
1401
+ });
1402
+ } // eslint-disable-next-line import/no-unused-modules
1403
+
1404
+
1405
+ var popperOffsets$1 = {
1406
+ name: 'popperOffsets',
1407
+ enabled: true,
1408
+ phase: 'read',
1409
+ fn: popperOffsets,
1410
+ data: {}
1411
+ };
1412
+
1413
+ function getAltAxis(axis) {
1414
+ return axis === 'x' ? 'y' : 'x';
1415
+ }
1416
+
1417
+ function preventOverflow(_ref) {
1418
+ var state = _ref.state,
1419
+ options = _ref.options,
1420
+ name = _ref.name;
1421
+ var _options$mainAxis = options.mainAxis,
1422
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1423
+ _options$altAxis = options.altAxis,
1424
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1425
+ boundary = options.boundary,
1426
+ rootBoundary = options.rootBoundary,
1427
+ altBoundary = options.altBoundary,
1428
+ padding = options.padding,
1429
+ _options$tether = options.tether,
1430
+ tether = _options$tether === void 0 ? true : _options$tether,
1431
+ _options$tetherOffset = options.tetherOffset,
1432
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1433
+ var overflow = detectOverflow(state, {
1434
+ boundary: boundary,
1435
+ rootBoundary: rootBoundary,
1436
+ padding: padding,
1437
+ altBoundary: altBoundary
1438
+ });
1439
+ var basePlacement = getBasePlacement(state.placement);
1440
+ var variation = getVariation(state.placement);
1441
+ var isBasePlacement = !variation;
1442
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1443
+ var altAxis = getAltAxis(mainAxis);
1444
+ var popperOffsets = state.modifiersData.popperOffsets;
1445
+ var referenceRect = state.rects.reference;
1446
+ var popperRect = state.rects.popper;
1447
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1448
+ placement: state.placement
1449
+ })) : tetherOffset;
1450
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1451
+ mainAxis: tetherOffsetValue,
1452
+ altAxis: tetherOffsetValue
1453
+ } : Object.assign({
1454
+ mainAxis: 0,
1455
+ altAxis: 0
1456
+ }, tetherOffsetValue);
1457
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1458
+ var data = {
1459
+ x: 0,
1460
+ y: 0
1461
+ };
1462
+
1463
+ if (!popperOffsets) {
1464
+ return;
1465
+ }
1466
+
1467
+ if (checkMainAxis) {
1468
+ var _offsetModifierState$;
1469
+
1470
+ var mainSide = mainAxis === 'y' ? top : left;
1471
+ var altSide = mainAxis === 'y' ? bottom : right;
1472
+ var len = mainAxis === 'y' ? 'height' : 'width';
1473
+ var offset = popperOffsets[mainAxis];
1474
+ var min$1 = offset + overflow[mainSide];
1475
+ var max$1 = offset - overflow[altSide];
1476
+ var additive = tether ? -popperRect[len] / 2 : 0;
1477
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1478
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1479
+ // outside the reference bounds
1480
+
1481
+ var arrowElement = state.elements.arrow;
1482
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1483
+ width: 0,
1484
+ height: 0
1485
+ };
1486
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1487
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1488
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1489
+ // to include its full size in the calculation. If the reference is small
1490
+ // and near the edge of a boundary, the popper can overflow even if the
1491
+ // reference is not overflowing as well (e.g. virtual elements with no
1492
+ // width or height)
1493
+
1494
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1495
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1496
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1497
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1498
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1499
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1500
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1501
+ var tetherMax = offset + maxOffset - offsetModifierValue;
1502
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1503
+ popperOffsets[mainAxis] = preventedOffset;
1504
+ data[mainAxis] = preventedOffset - offset;
1505
+ }
1506
+
1507
+ if (checkAltAxis) {
1508
+ var _offsetModifierState$2;
1509
+
1510
+ var _mainSide = mainAxis === 'x' ? top : left;
1511
+
1512
+ var _altSide = mainAxis === 'x' ? bottom : right;
1513
+
1514
+ var _offset = popperOffsets[altAxis];
1515
+
1516
+ var _len = altAxis === 'y' ? 'height' : 'width';
1517
+
1518
+ var _min = _offset + overflow[_mainSide];
1519
+
1520
+ var _max = _offset - overflow[_altSide];
1521
+
1522
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1523
+
1524
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1525
+
1526
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1527
+
1528
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1529
+
1530
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1531
+
1532
+ popperOffsets[altAxis] = _preventedOffset;
1533
+ data[altAxis] = _preventedOffset - _offset;
1534
+ }
1535
+
1536
+ state.modifiersData[name] = data;
1537
+ } // eslint-disable-next-line import/no-unused-modules
1538
+
1539
+
1540
+ var preventOverflow$1 = {
1541
+ name: 'preventOverflow',
1542
+ enabled: true,
1543
+ phase: 'main',
1544
+ fn: preventOverflow,
1545
+ requiresIfExists: ['offset']
1546
+ };
1547
+
1548
+ function getHTMLElementScroll(element) {
1549
+ return {
1550
+ scrollLeft: element.scrollLeft,
1551
+ scrollTop: element.scrollTop
1552
+ };
1553
+ }
1554
+
1555
+ function getNodeScroll(node) {
1556
+ if (node === getWindow(node) || !isHTMLElement$1(node)) {
1557
+ return getWindowScroll(node);
1558
+ } else {
1559
+ return getHTMLElementScroll(node);
1560
+ }
1561
+ }
1562
+
1563
+ function isElementScaled(element) {
1564
+ var rect = element.getBoundingClientRect();
1565
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
1566
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
1567
+ return scaleX !== 1 || scaleY !== 1;
1568
+ } // Returns the composite rect of an element relative to its offsetParent.
1569
+ // Composite means it takes into account transforms as well as layout.
1570
+
1571
+
1572
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1573
+ if (isFixed === void 0) {
1574
+ isFixed = false;
1575
+ }
1576
+
1577
+ var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
1578
+ var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
1579
+ var documentElement = getDocumentElement(offsetParent);
1580
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
1581
+ var scroll = {
1582
+ scrollLeft: 0,
1583
+ scrollTop: 0
1584
+ };
1585
+ var offsets = {
1586
+ x: 0,
1587
+ y: 0
1588
+ };
1589
+
1590
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1591
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1592
+ isScrollParent(documentElement)) {
1593
+ scroll = getNodeScroll(offsetParent);
1594
+ }
1595
+
1596
+ if (isHTMLElement$1(offsetParent)) {
1597
+ offsets = getBoundingClientRect(offsetParent, true);
1598
+ offsets.x += offsetParent.clientLeft;
1599
+ offsets.y += offsetParent.clientTop;
1600
+ } else if (documentElement) {
1601
+ offsets.x = getWindowScrollBarX(documentElement);
1602
+ }
1603
+ }
1604
+
1605
+ return {
1606
+ x: rect.left + scroll.scrollLeft - offsets.x,
1607
+ y: rect.top + scroll.scrollTop - offsets.y,
1608
+ width: rect.width,
1609
+ height: rect.height
1610
+ };
1611
+ }
1612
+
1613
+ function order(modifiers) {
1614
+ var map = new Map();
1615
+ var visited = new Set();
1616
+ var result = [];
1617
+ modifiers.forEach(function (modifier) {
1618
+ map.set(modifier.name, modifier);
1619
+ }); // On visiting object, check for its dependencies and visit them recursively
1620
+
1621
+ function sort(modifier) {
1622
+ visited.add(modifier.name);
1623
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1624
+ requires.forEach(function (dep) {
1625
+ if (!visited.has(dep)) {
1626
+ var depModifier = map.get(dep);
1627
+
1628
+ if (depModifier) {
1629
+ sort(depModifier);
1630
+ }
1631
+ }
1632
+ });
1633
+ result.push(modifier);
1634
+ }
1635
+
1636
+ modifiers.forEach(function (modifier) {
1637
+ if (!visited.has(modifier.name)) {
1638
+ // check for visited object
1639
+ sort(modifier);
1640
+ }
1641
+ });
1642
+ return result;
1643
+ }
1644
+
1645
+ function orderModifiers(modifiers) {
1646
+ // order based on dependencies
1647
+ var orderedModifiers = order(modifiers); // order based on phase
1648
+
1649
+ return modifierPhases.reduce(function (acc, phase) {
1650
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1651
+ return modifier.phase === phase;
1652
+ }));
1653
+ }, []);
1654
+ }
1655
+
1656
+ function debounce(fn) {
1657
+ var pending;
1658
+ return function () {
1659
+ if (!pending) {
1660
+ pending = new Promise(function (resolve) {
1661
+ Promise.resolve().then(function () {
1662
+ pending = undefined;
1663
+ resolve(fn());
1664
+ });
1665
+ });
1666
+ }
1667
+
1668
+ return pending;
1669
+ };
1670
+ }
1671
+
1672
+ function mergeByName(modifiers) {
1673
+ var merged = modifiers.reduce(function (merged, current) {
1674
+ var existing = merged[current.name];
1675
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1676
+ options: Object.assign({}, existing.options, current.options),
1677
+ data: Object.assign({}, existing.data, current.data)
1678
+ }) : current;
1679
+ return merged;
1680
+ }, {}); // IE11 does not support Object.values
1681
+
1682
+ return Object.keys(merged).map(function (key) {
1683
+ return merged[key];
1684
+ });
1685
+ }
1686
+
1687
+ var DEFAULT_OPTIONS = {
1688
+ placement: 'bottom',
1689
+ modifiers: [],
1690
+ strategy: 'absolute'
1691
+ };
1692
+
1693
+ function areValidElements() {
1694
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1695
+ args[_key] = arguments[_key];
1696
+ }
1697
+
1698
+ return !args.some(function (element) {
1699
+ return !(element && typeof element.getBoundingClientRect === 'function');
1700
+ });
1701
+ }
1702
+
1703
+ function popperGenerator(generatorOptions) {
1704
+ if (generatorOptions === void 0) {
1705
+ generatorOptions = {};
1706
+ }
1707
+
1708
+ var _generatorOptions = generatorOptions,
1709
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1710
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1711
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1712
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1713
+ return function createPopper(reference, popper, options) {
1714
+ if (options === void 0) {
1715
+ options = defaultOptions;
1716
+ }
1717
+
1718
+ var state = {
1719
+ placement: 'bottom',
1720
+ orderedModifiers: [],
1721
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1722
+ modifiersData: {},
1723
+ elements: {
1724
+ reference: reference,
1725
+ popper: popper
1726
+ },
1727
+ attributes: {},
1728
+ styles: {}
1729
+ };
1730
+ var effectCleanupFns = [];
1731
+ var isDestroyed = false;
1732
+ var instance = {
1733
+ state: state,
1734
+ setOptions: function setOptions(setOptionsAction) {
1735
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1736
+ cleanupModifierEffects();
1737
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1738
+ state.scrollParents = {
1739
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1740
+ popper: listScrollParents(popper)
1741
+ }; // Orders the modifiers based on their dependencies and `phase`
1742
+ // properties
1743
+
1744
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1745
+
1746
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1747
+ return m.enabled;
1748
+ });
1749
+ runModifierEffects();
1750
+ return instance.update();
1751
+ },
1752
+ // Sync update – it will always be executed, even if not necessary. This
1753
+ // is useful for low frequency updates where sync behavior simplifies the
1754
+ // logic.
1755
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1756
+ // prefer the async Popper#update method
1757
+ forceUpdate: function forceUpdate() {
1758
+ if (isDestroyed) {
1759
+ return;
1760
+ }
1761
+
1762
+ var _state$elements = state.elements,
1763
+ reference = _state$elements.reference,
1764
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1765
+ // anymore
1766
+
1767
+ if (!areValidElements(reference, popper)) {
1768
+ return;
1769
+ } // Store the reference and popper rects to be read by modifiers
1770
+
1771
+
1772
+ state.rects = {
1773
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1774
+ popper: getLayoutRect(popper)
1775
+ }; // Modifiers have the ability to reset the current update cycle. The
1776
+ // most common use case for this is the `flip` modifier changing the
1777
+ // placement, which then needs to re-run all the modifiers, because the
1778
+ // logic was previously ran for the previous placement and is therefore
1779
+ // stale/incorrect
1780
+
1781
+ state.reset = false;
1782
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1783
+ // is filled with the initial data specified by the modifier. This means
1784
+ // it doesn't persist and is fresh on each update.
1785
+ // To ensure persistent data, use `${name}#persistent`
1786
+
1787
+ state.orderedModifiers.forEach(function (modifier) {
1788
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1789
+ });
1790
+
1791
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1792
+ if (state.reset === true) {
1793
+ state.reset = false;
1794
+ index = -1;
1795
+ continue;
1796
+ }
1797
+
1798
+ var _state$orderedModifie = state.orderedModifiers[index],
1799
+ fn = _state$orderedModifie.fn,
1800
+ _state$orderedModifie2 = _state$orderedModifie.options,
1801
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1802
+ name = _state$orderedModifie.name;
1803
+
1804
+ if (typeof fn === 'function') {
1805
+ state = fn({
1806
+ state: state,
1807
+ options: _options,
1808
+ name: name,
1809
+ instance: instance
1810
+ }) || state;
1811
+ }
1812
+ }
1813
+ },
1814
+ // Async and optimistically optimized update – it will not be executed if
1815
+ // not necessary (debounced to run at most once-per-tick)
1816
+ update: debounce(function () {
1817
+ return new Promise(function (resolve) {
1818
+ instance.forceUpdate();
1819
+ resolve(state);
1820
+ });
1821
+ }),
1822
+ destroy: function destroy() {
1823
+ cleanupModifierEffects();
1824
+ isDestroyed = true;
1825
+ }
1826
+ };
1827
+
1828
+ if (!areValidElements(reference, popper)) {
1829
+ return instance;
1830
+ }
1831
+
1832
+ instance.setOptions(options).then(function (state) {
1833
+ if (!isDestroyed && options.onFirstUpdate) {
1834
+ options.onFirstUpdate(state);
1835
+ }
1836
+ }); // Modifiers have the ability to execute arbitrary code before the first
1837
+ // update cycle runs. They will be executed in the same order as the update
1838
+ // cycle. This is useful when a modifier adds some persistent data that
1839
+ // other modifiers need to use, but the modifier is run after the dependent
1840
+ // one.
1841
+
1842
+ function runModifierEffects() {
1843
+ state.orderedModifiers.forEach(function (_ref) {
1844
+ var name = _ref.name,
1845
+ _ref$options = _ref.options,
1846
+ options = _ref$options === void 0 ? {} : _ref$options,
1847
+ effect = _ref.effect;
1848
+
1849
+ if (typeof effect === 'function') {
1850
+ var cleanupFn = effect({
1851
+ state: state,
1852
+ name: name,
1853
+ instance: instance,
1854
+ options: options
1855
+ });
1856
+
1857
+ var noopFn = function noopFn() {};
1858
+
1859
+ effectCleanupFns.push(cleanupFn || noopFn);
1860
+ }
1861
+ });
1862
+ }
1863
+
1864
+ function cleanupModifierEffects() {
1865
+ effectCleanupFns.forEach(function (fn) {
1866
+ return fn();
1867
+ });
1868
+ effectCleanupFns = [];
1869
+ }
1870
+
1871
+ return instance;
1872
+ };
1873
+ }
1874
+
1875
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1876
+ var createPopper = /*#__PURE__*/popperGenerator({
1877
+ defaultModifiers: defaultModifiers
1878
+ }); // eslint-disable-next-line import/no-unused-modules
1879
+
1880
+ function getPopperUtilityClass(slot) {
1881
+ return generateUtilityClass('MuiPopper', slot);
1882
+ }
1883
+ generateUtilityClasses('MuiPopper', ['root']);
1884
+
1885
+ function flipPlacement(placement, direction) {
1886
+ if (direction === 'ltr') {
1887
+ return placement;
1888
+ }
1889
+ switch (placement) {
1890
+ case 'bottom-end':
1891
+ return 'bottom-start';
1892
+ case 'bottom-start':
1893
+ return 'bottom-end';
1894
+ case 'top-end':
1895
+ return 'top-start';
1896
+ case 'top-start':
1897
+ return 'top-end';
1898
+ default:
1899
+ return placement;
1900
+ }
1901
+ }
1902
+ function resolveAnchorEl(anchorEl) {
1903
+ return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
1904
+ }
1905
+ function isHTMLElement(element) {
1906
+ return element.nodeType !== undefined;
1907
+ }
1908
+ function isVirtualElement(element) {
1909
+ return !isHTMLElement(element);
1910
+ }
1911
+ const useUtilityClasses = ownerState => {
1912
+ const {
1913
+ classes
1914
+ } = ownerState;
1915
+ const slots = {
1916
+ root: ['root']
1917
+ };
1918
+ return composeClasses(slots, getPopperUtilityClass, classes);
1919
+ };
1920
+ const defaultPopperOptions = {};
1921
+ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, forwardedRef) {
1922
+ const {
1923
+ anchorEl,
1924
+ children,
1925
+ direction,
1926
+ disablePortal,
1927
+ modifiers,
1928
+ open,
1929
+ placement: initialPlacement,
1930
+ popperOptions,
1931
+ popperRef: popperRefProp,
1932
+ slotProps = {},
1933
+ slots = {},
1934
+ TransitionProps,
1935
+ // @ts-ignore internal logic
1936
+ ownerState: ownerStateProp,
1937
+ // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1938
+ ...other
1939
+ } = props;
1940
+ const tooltipRef = React.useRef(null);
1941
+ const ownRef = useForkRef(tooltipRef, forwardedRef);
1942
+ const popperRef = React.useRef(null);
1943
+ const handlePopperRef = useForkRef(popperRef, popperRefProp);
1944
+ const handlePopperRefRef = React.useRef(handlePopperRef);
1945
+ useEnhancedEffect(() => {
1946
+ handlePopperRefRef.current = handlePopperRef;
1947
+ }, [handlePopperRef]);
1948
+ React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1949
+ const rtlPlacement = flipPlacement(initialPlacement, direction);
1950
+ /**
1951
+ * placement initialized from prop but can change during lifetime if modifiers.flip.
1952
+ * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
1953
+ */
1954
+ const [placement, setPlacement] = React.useState(rtlPlacement);
1955
+ const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
1956
+ React.useEffect(() => {
1957
+ if (popperRef.current) {
1958
+ popperRef.current.forceUpdate();
1959
+ }
1960
+ });
1961
+ React.useEffect(() => {
1962
+ if (anchorEl) {
1963
+ setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1964
+ }
1965
+ }, [anchorEl]);
1966
+ useEnhancedEffect(() => {
1967
+ if (!resolvedAnchorElement || !open) {
1968
+ return undefined;
1969
+ }
1970
+ const handlePopperUpdate = data => {
1971
+ setPlacement(data.placement);
1972
+ };
1973
+ if (process.env.NODE_ENV !== 'production') {
1974
+ if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
1975
+ const box = resolvedAnchorElement.getBoundingClientRect();
1976
+ if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
1977
+ console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
1978
+ }
1979
+ }
1980
+ }
1981
+ let popperModifiers = [{
1982
+ name: 'preventOverflow',
1983
+ options: {
1984
+ altBoundary: disablePortal
1985
+ }
1986
+ }, {
1987
+ name: 'flip',
1988
+ options: {
1989
+ altBoundary: disablePortal
1990
+ }
1991
+ }, {
1992
+ name: 'onUpdate',
1993
+ enabled: true,
1994
+ phase: 'afterWrite',
1995
+ fn: ({
1996
+ state
1997
+ }) => {
1998
+ handlePopperUpdate(state);
1999
+ }
2000
+ }];
2001
+ if (modifiers != null) {
2002
+ popperModifiers = popperModifiers.concat(modifiers);
2003
+ }
2004
+ if (popperOptions && popperOptions.modifiers != null) {
2005
+ popperModifiers = popperModifiers.concat(popperOptions.modifiers);
2006
+ }
2007
+ const popper = createPopper(resolvedAnchorElement, tooltipRef.current, {
2008
+ placement: rtlPlacement,
2009
+ ...popperOptions,
2010
+ modifiers: popperModifiers
2011
+ });
2012
+ handlePopperRefRef.current(popper);
2013
+ return () => {
2014
+ popper.destroy();
2015
+ handlePopperRefRef.current(null);
2016
+ };
2017
+ }, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
2018
+ const childProps = {
2019
+ placement: placement
2020
+ };
2021
+ if (TransitionProps !== null) {
2022
+ childProps.TransitionProps = TransitionProps;
2023
+ }
2024
+ const classes = useUtilityClasses(props);
2025
+ const Root = slots.root ?? 'div';
2026
+ const rootProps = useSlotProps({
2027
+ elementType: Root,
2028
+ externalSlotProps: slotProps.root,
2029
+ externalForwardedProps: other,
2030
+ additionalProps: {
2031
+ role: 'tooltip',
2032
+ ref: ownRef
2033
+ },
2034
+ ownerState: props,
2035
+ className: classes.root
2036
+ });
2037
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Root, {
2038
+ ...rootProps,
2039
+ children: typeof children === 'function' ? children(childProps) : children
2040
+ });
2041
+ });
2042
+
2043
+ /**
2044
+ * @ignore - internal component.
2045
+ */
2046
+ const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedRef) {
2047
+ const {
2048
+ anchorEl,
2049
+ children,
2050
+ container: containerProp,
2051
+ direction = 'ltr',
2052
+ disablePortal = false,
2053
+ keepMounted = false,
2054
+ modifiers,
2055
+ open,
2056
+ placement = 'bottom',
2057
+ popperOptions = defaultPopperOptions,
2058
+ popperRef,
2059
+ style,
2060
+ transition = false,
2061
+ slotProps = {},
2062
+ slots = {},
2063
+ ...other
2064
+ } = props;
2065
+ const [exited, setExited] = React.useState(true);
2066
+ const handleEnter = () => {
2067
+ setExited(false);
2068
+ };
2069
+ const handleExited = () => {
2070
+ setExited(true);
2071
+ };
2072
+ if (!keepMounted && !open && (!transition || exited)) {
2073
+ return null;
2074
+ }
2075
+
2076
+ // If the container prop is provided, use that
2077
+ // If the anchorEl prop is provided, use its parent body element as the container
2078
+ // If neither are provided let the Modal take care of choosing the container
2079
+ let container;
2080
+ if (containerProp) {
2081
+ container = containerProp;
2082
+ } else if (anchorEl) {
2083
+ const resolvedAnchorEl = resolveAnchorEl(anchorEl);
2084
+ container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;
2085
+ }
2086
+ const display = !open && keepMounted && (!transition || exited) ? 'none' : undefined;
2087
+ const transitionProps = transition ? {
2088
+ in: open,
2089
+ onEnter: handleEnter,
2090
+ onExited: handleExited
2091
+ } : undefined;
2092
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Portal, {
2093
+ disablePortal: disablePortal,
2094
+ container: container,
2095
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, {
2096
+ anchorEl: anchorEl,
2097
+ direction: direction,
2098
+ disablePortal: disablePortal,
2099
+ modifiers: modifiers,
2100
+ ref: forwardedRef,
2101
+ open: transition ? !exited : open,
2102
+ placement: placement,
2103
+ popperOptions: popperOptions,
2104
+ popperRef: popperRef,
2105
+ slotProps: slotProps,
2106
+ slots: slots,
2107
+ ...other,
2108
+ style: {
2109
+ // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
2110
+ position: 'fixed',
2111
+ // Fix Popper.js display issue
2112
+ top: 0,
2113
+ left: 0,
2114
+ display,
2115
+ ...style
2116
+ },
2117
+ TransitionProps: transitionProps,
2118
+ children: children
2119
+ })
2120
+ });
2121
+ });
2122
+ process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes */ = {
2123
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
2124
+ // │ These PropTypes are generated from the TypeScript type definitions. │
2125
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2126
+ // └─────────────────────────────────────────────────────────────────────┘
2127
+ /**
2128
+ * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2129
+ * or a function that returns either.
2130
+ * It's used to set the position of the popper.
2131
+ * The return value will passed as the reference object of the Popper instance.
2132
+ */
2133
+ anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {
2134
+ if (props.open) {
2135
+ const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
2136
+ if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
2137
+ const box = resolvedAnchorEl.getBoundingClientRect();
2138
+ if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
2139
+ return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
2140
+ }
2141
+ } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
2142
+ return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\n'));
2143
+ }
2144
+ }
2145
+ return null;
2146
+ }),
2147
+ /**
2148
+ * Popper render function or node.
2149
+ */
2150
+ children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2151
+ /**
2152
+ * An HTML element or function that returns one.
2153
+ * The `container` will have the portal children appended to it.
2154
+ *
2155
+ * You can also provide a callback, which is called in a React layout effect.
2156
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
2157
+ *
2158
+ * By default, it uses the body of the top-level document object,
2159
+ * so it's simply `document.body` most of the time.
2160
+ */
2161
+ container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2162
+ /**
2163
+ * Direction of the text.
2164
+ * @default 'ltr'
2165
+ */
2166
+ direction: PropTypes.oneOf(['ltr', 'rtl']),
2167
+ /**
2168
+ * The `children` will be under the DOM hierarchy of the parent component.
2169
+ * @default false
2170
+ */
2171
+ disablePortal: PropTypes.bool,
2172
+ /**
2173
+ * Always keep the children in the DOM.
2174
+ * This prop can be useful in SEO situation or
2175
+ * when you want to maximize the responsiveness of the Popper.
2176
+ * @default false
2177
+ */
2178
+ keepMounted: PropTypes.bool,
2179
+ /**
2180
+ * Popper.js is based on a "plugin-like" architecture,
2181
+ * most of its features are fully encapsulated "modifiers".
2182
+ *
2183
+ * A modifier is a function that is called each time Popper.js needs to
2184
+ * compute the position of the popper.
2185
+ * For this reason, modifiers should be very performant to avoid bottlenecks.
2186
+ * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2187
+ */
2188
+ modifiers: PropTypes.arrayOf(PropTypes.shape({
2189
+ data: PropTypes.object,
2190
+ effect: PropTypes.func,
2191
+ enabled: PropTypes.bool,
2192
+ fn: PropTypes.func,
2193
+ name: PropTypes.any,
2194
+ options: PropTypes.object,
2195
+ phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2196
+ requires: PropTypes.arrayOf(PropTypes.string),
2197
+ requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2198
+ })),
2199
+ /**
2200
+ * If `true`, the component is shown.
2201
+ */
2202
+ open: PropTypes.bool.isRequired,
2203
+ /**
2204
+ * Popper placement.
2205
+ * @default 'bottom'
2206
+ */
2207
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2208
+ /**
2209
+ * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2210
+ * @default {}
2211
+ */
2212
+ popperOptions: PropTypes.shape({
2213
+ modifiers: PropTypes.array,
2214
+ onFirstUpdate: PropTypes.func,
2215
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2216
+ strategy: PropTypes.oneOf(['absolute', 'fixed'])
2217
+ }),
2218
+ /**
2219
+ * A ref that points to the used popper instance.
2220
+ */
2221
+ popperRef: refType,
2222
+ /**
2223
+ * The props used for each slot inside the Popper.
2224
+ * @default {}
2225
+ */
2226
+ slotProps: PropTypes.shape({
2227
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2228
+ }),
2229
+ /**
2230
+ * The components used for each slot inside the Popper.
2231
+ * Either a string to use a HTML element or a component.
2232
+ * @default {}
2233
+ */
2234
+ slots: PropTypes.shape({
2235
+ root: PropTypes.elementType
2236
+ }),
2237
+ /**
2238
+ * Help supporting a react-transition-group/Transition component.
2239
+ * @default false
2240
+ */
2241
+ transition: PropTypes.bool
2242
+ } : void 0;
2243
+ var BasePopper$1 = Popper$2;
2244
+
2245
+ const PopperRoot = styled(BasePopper$1, {
2246
+ name: 'MuiPopper',
2247
+ slot: 'Root',
2248
+ overridesResolver: (props, styles) => styles.root
2249
+ })({});
2250
+
2251
+ /**
2252
+ *
2253
+ * Demos:
2254
+ *
2255
+ * - [Autocomplete](https://v6.mui.com/material-ui/react-autocomplete/)
2256
+ * - [Menu](https://v6.mui.com/material-ui/react-menu/)
2257
+ * - [Popper](https://v6.mui.com/material-ui/react-popper/)
2258
+ *
2259
+ * API:
2260
+ *
2261
+ * - [Popper API](https://v6.mui.com/material-ui/api/popper/)
2262
+ */
2263
+ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
2264
+ const isRtl = useRtl();
2265
+ const props = useDefaultProps({
2266
+ props: inProps,
2267
+ name: 'MuiPopper'
2268
+ });
2269
+ const {
2270
+ anchorEl,
2271
+ component,
2272
+ components,
2273
+ componentsProps,
2274
+ container,
2275
+ disablePortal,
2276
+ keepMounted,
2277
+ modifiers,
2278
+ open,
2279
+ placement,
2280
+ popperOptions,
2281
+ popperRef,
2282
+ transition,
2283
+ slots,
2284
+ slotProps,
2285
+ ...other
2286
+ } = props;
2287
+ const RootComponent = slots?.root ?? components?.Root;
2288
+ const otherProps = {
2289
+ anchorEl,
2290
+ container,
2291
+ disablePortal,
2292
+ keepMounted,
2293
+ modifiers,
2294
+ open,
2295
+ placement,
2296
+ popperOptions,
2297
+ popperRef,
2298
+ transition,
2299
+ ...other
2300
+ };
2301
+ return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, {
2302
+ as: component,
2303
+ direction: isRtl ? 'rtl' : 'ltr',
2304
+ slots: {
2305
+ root: RootComponent
2306
+ },
2307
+ slotProps: slotProps ?? componentsProps,
2308
+ ...otherProps,
2309
+ ref: ref
2310
+ });
2311
+ });
2312
+ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
2313
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
2314
+ // │ These PropTypes are generated from the TypeScript type definitions. │
2315
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2316
+ // └─────────────────────────────────────────────────────────────────────┘
2317
+ /**
2318
+ * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2319
+ * or a function that returns either.
2320
+ * It's used to set the position of the popper.
2321
+ * The return value will passed as the reference object of the Popper instance.
2322
+ */
2323
+ anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
2324
+ /**
2325
+ * Popper render function or node.
2326
+ */
2327
+ children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2328
+ /**
2329
+ * The component used for the root node.
2330
+ * Either a string to use a HTML element or a component.
2331
+ */
2332
+ component: PropTypes.elementType,
2333
+ /**
2334
+ * The components used for each slot inside the Popper.
2335
+ * Either a string to use a HTML element or a component.
2336
+ *
2337
+ * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2338
+ * @default {}
2339
+ */
2340
+ components: PropTypes.shape({
2341
+ Root: PropTypes.elementType
2342
+ }),
2343
+ /**
2344
+ * The props used for each slot inside the Popper.
2345
+ *
2346
+ * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2347
+ * @default {}
2348
+ */
2349
+ componentsProps: PropTypes.shape({
2350
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2351
+ }),
2352
+ /**
2353
+ * An HTML element or function that returns one.
2354
+ * The `container` will have the portal children appended to it.
2355
+ *
2356
+ * You can also provide a callback, which is called in a React layout effect.
2357
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
2358
+ *
2359
+ * By default, it uses the body of the top-level document object,
2360
+ * so it's simply `document.body` most of the time.
2361
+ */
2362
+ container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2363
+ /**
2364
+ * The `children` will be under the DOM hierarchy of the parent component.
2365
+ * @default false
2366
+ */
2367
+ disablePortal: PropTypes.bool,
2368
+ /**
2369
+ * Always keep the children in the DOM.
2370
+ * This prop can be useful in SEO situation or
2371
+ * when you want to maximize the responsiveness of the Popper.
2372
+ * @default false
2373
+ */
2374
+ keepMounted: PropTypes.bool,
2375
+ /**
2376
+ * Popper.js is based on a "plugin-like" architecture,
2377
+ * most of its features are fully encapsulated "modifiers".
2378
+ *
2379
+ * A modifier is a function that is called each time Popper.js needs to
2380
+ * compute the position of the popper.
2381
+ * For this reason, modifiers should be very performant to avoid bottlenecks.
2382
+ * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2383
+ */
2384
+ modifiers: PropTypes.arrayOf(PropTypes.shape({
2385
+ data: PropTypes.object,
2386
+ effect: PropTypes.func,
2387
+ enabled: PropTypes.bool,
2388
+ fn: PropTypes.func,
2389
+ name: PropTypes.any,
2390
+ options: PropTypes.object,
2391
+ phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2392
+ requires: PropTypes.arrayOf(PropTypes.string),
2393
+ requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2394
+ })),
2395
+ /**
2396
+ * If `true`, the component is shown.
2397
+ */
2398
+ open: PropTypes.bool.isRequired,
2399
+ /**
2400
+ * Popper placement.
2401
+ * @default 'bottom'
2402
+ */
2403
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2404
+ /**
2405
+ * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2406
+ * @default {}
2407
+ */
2408
+ popperOptions: PropTypes.shape({
2409
+ modifiers: PropTypes.array,
2410
+ onFirstUpdate: PropTypes.func,
2411
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2412
+ strategy: PropTypes.oneOf(['absolute', 'fixed'])
2413
+ }),
2414
+ /**
2415
+ * A ref that points to the used popper instance.
2416
+ */
2417
+ popperRef: refType,
2418
+ /**
2419
+ * The props used for each slot inside the Popper.
2420
+ * @default {}
2421
+ */
2422
+ slotProps: PropTypes.shape({
2423
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2424
+ }),
2425
+ /**
2426
+ * The components used for each slot inside the Popper.
2427
+ * Either a string to use a HTML element or a component.
2428
+ * @default {}
2429
+ */
2430
+ slots: PropTypes.shape({
2431
+ root: PropTypes.elementType
2432
+ }),
2433
+ /**
2434
+ * The system prop that allows defining system overrides as well as additional CSS styles.
2435
+ */
2436
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
2437
+ /**
2438
+ * Help supporting a react-transition-group/Transition component.
2439
+ * @default false
2440
+ */
2441
+ transition: PropTypes.bool
2442
+ } : void 0;
2443
+ var Popper$1 = Popper;
2444
+
2445
+ const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
2446
+ return /*#__PURE__*/React__default.createElement(Popper$1, _extends({}, props, {
2447
+ ref: ref,
2448
+ container: () => document.getElementById('redsift-app-container')
2449
+ }));
2450
+ });
2451
+
2452
+ export { BaseButton as B, BaseCheckbox as a, BaseIcon as b, BasePopper as c, muiIconToDSIcon as m };
2453
+ //# sourceMappingURL=BasePopper.js.map