@opentiny/vue-hooks 2.20.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +636 -674
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -2,15 +2,12 @@ import { hooks } from '@opentiny/vue-common';
2
2
 
3
3
  var _excluded = ["mainAxis", "crossAxis", "fallbackPlacements", "fallbackStrategy", "fallbackAxisSideDirection", "flipAlignment"], _excluded2 = ["strategy"], _excluded3 = ["mainAxis", "crossAxis", "limiter"];
4
4
  function _objectWithoutPropertiesLoose(r, e) {
5
- if (null == r)
6
- return {};
5
+ if (null == r) return {};
7
6
  var t = {};
8
- for (var n in r)
9
- if ({}.hasOwnProperty.call(r, n)) {
10
- if (e.includes(n))
11
- continue;
12
- t[n] = r[n];
13
- }
7
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
8
+ if (e.includes(n)) continue;
9
+ t[n] = r[n];
10
+ }
14
11
  return t;
15
12
  }
16
13
  function _regeneratorRuntime() {
@@ -94,11 +91,9 @@ function _regeneratorRuntime() {
94
91
  function makeInvokeMethod(e2, r2, n2) {
95
92
  var o2 = h;
96
93
  return function(i2, a2) {
97
- if (o2 === f)
98
- throw Error("Generator is already running");
94
+ if (o2 === f) throw Error("Generator is already running");
99
95
  if (o2 === s) {
100
- if ("throw" === i2)
101
- throw a2;
96
+ if ("throw" === i2) throw a2;
102
97
  return { value: t, done: true };
103
98
  }
104
99
  for (n2.method = i2, n2.arg = a2; ; ) {
@@ -106,24 +101,19 @@ function _regeneratorRuntime() {
106
101
  if (c2) {
107
102
  var u2 = maybeInvokeDelegate(c2, n2);
108
103
  if (u2) {
109
- if (u2 === y)
110
- continue;
104
+ if (u2 === y) continue;
111
105
  return u2;
112
106
  }
113
107
  }
114
- if ("next" === n2.method)
115
- n2.sent = n2._sent = n2.arg;
108
+ if ("next" === n2.method) n2.sent = n2._sent = n2.arg;
116
109
  else if ("throw" === n2.method) {
117
- if (o2 === h)
118
- throw o2 = s, n2.arg;
110
+ if (o2 === h) throw o2 = s, n2.arg;
119
111
  n2.dispatchException(n2.arg);
120
- } else
121
- "return" === n2.method && n2.abrupt("return", n2.arg);
112
+ } else "return" === n2.method && n2.abrupt("return", n2.arg);
122
113
  o2 = f;
123
114
  var p2 = tryCatch(e2, r2, n2);
124
115
  if ("normal" === p2.type) {
125
- if (o2 = n2.done ? s : l, p2.arg === y)
126
- continue;
116
+ if (o2 = n2.done ? s : l, p2.arg === y) continue;
127
117
  return { value: p2.arg, done: n2.done };
128
118
  }
129
119
  "throw" === p2.type && (o2 = s, n2.method = "throw", n2.arg = p2.arg);
@@ -132,11 +122,9 @@ function _regeneratorRuntime() {
132
122
  }
133
123
  function maybeInvokeDelegate(e2, r2) {
134
124
  var n2 = r2.method, o2 = e2.iterator[n2];
135
- if (o2 === t)
136
- return r2.delegate = null, "throw" === n2 && e2.iterator.return && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y;
125
+ if (o2 === t) return r2.delegate = null, "throw" === n2 && e2.iterator.return && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y;
137
126
  var i2 = tryCatch(o2, e2.iterator, r2.arg);
138
- if ("throw" === i2.type)
139
- return r2.method = "throw", r2.arg = i2.arg, r2.delegate = null, y;
127
+ if ("throw" === i2.type) return r2.method = "throw", r2.arg = i2.arg, r2.delegate = null, y;
140
128
  var a2 = i2.arg;
141
129
  return a2 ? a2.done ? (r2[e2.resultName] = a2.value, r2.next = e2.nextLoc, "return" !== r2.method && (r2.method = "next", r2.arg = t), r2.delegate = null, y) : a2 : (r2.method = "throw", r2.arg = new TypeError("iterator result is not an object"), r2.delegate = null, y);
142
130
  }
@@ -154,15 +142,11 @@ function _regeneratorRuntime() {
154
142
  function values(e2) {
155
143
  if (e2 || "" === e2) {
156
144
  var r2 = e2[a];
157
- if (r2)
158
- return r2.call(e2);
159
- if ("function" == typeof e2.next)
160
- return e2;
145
+ if (r2) return r2.call(e2);
146
+ if ("function" == typeof e2.next) return e2;
161
147
  if (!isNaN(e2.length)) {
162
148
  var o2 = -1, i2 = function next() {
163
- for (; ++o2 < e2.length; )
164
- if (n.call(e2, o2))
165
- return next.value = e2[o2], next.done = false, next;
149
+ for (; ++o2 < e2.length; ) if (n.call(e2, o2)) return next.value = e2[o2], next.done = false, next;
166
150
  return next.value = t, next.done = true, next;
167
151
  };
168
152
  return i2.next = i2;
@@ -191,52 +175,40 @@ function _regeneratorRuntime() {
191
175
  return "[object Generator]";
192
176
  }), e.keys = function(t2) {
193
177
  var e2 = Object(t2), r2 = [];
194
- for (var n2 in e2)
195
- r2.push(n2);
178
+ for (var n2 in e2) r2.push(n2);
196
179
  return r2.reverse(), function next() {
197
180
  for (; r2.length; ) {
198
181
  var t3 = r2.pop();
199
- if (t3 in e2)
200
- return next.value = t3, next.done = false, next;
182
+ if (t3 in e2) return next.value = t3, next.done = false, next;
201
183
  }
202
184
  return next.done = true, next;
203
185
  };
204
186
  }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e2) {
205
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2)
206
- for (var r2 in this)
207
- "t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t);
187
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2) for (var r2 in this) "t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t);
208
188
  }, stop: function stop() {
209
189
  this.done = true;
210
190
  var t2 = this.tryEntries[0].completion;
211
- if ("throw" === t2.type)
212
- throw t2.arg;
191
+ if ("throw" === t2.type) throw t2.arg;
213
192
  return this.rval;
214
193
  }, dispatchException: function dispatchException(e2) {
215
- if (this.done)
216
- throw e2;
194
+ if (this.done) throw e2;
217
195
  var r2 = this;
218
196
  function handle(n2, o3) {
219
197
  return a2.type = "throw", a2.arg = e2, r2.next = n2, o3 && (r2.method = "next", r2.arg = t), !!o3;
220
198
  }
221
199
  for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) {
222
200
  var i2 = this.tryEntries[o2], a2 = i2.completion;
223
- if ("root" === i2.tryLoc)
224
- return handle("end");
201
+ if ("root" === i2.tryLoc) return handle("end");
225
202
  if (i2.tryLoc <= this.prev) {
226
203
  var c2 = n.call(i2, "catchLoc"), u2 = n.call(i2, "finallyLoc");
227
204
  if (c2 && u2) {
228
- if (this.prev < i2.catchLoc)
229
- return handle(i2.catchLoc, true);
230
- if (this.prev < i2.finallyLoc)
231
- return handle(i2.finallyLoc);
205
+ if (this.prev < i2.catchLoc) return handle(i2.catchLoc, true);
206
+ if (this.prev < i2.finallyLoc) return handle(i2.finallyLoc);
232
207
  } else if (c2) {
233
- if (this.prev < i2.catchLoc)
234
- return handle(i2.catchLoc, true);
208
+ if (this.prev < i2.catchLoc) return handle(i2.catchLoc, true);
235
209
  } else {
236
- if (!u2)
237
- throw Error("try statement without catch or finally");
238
- if (this.prev < i2.finallyLoc)
239
- return handle(i2.finallyLoc);
210
+ if (!u2) throw Error("try statement without catch or finally");
211
+ if (this.prev < i2.finallyLoc) return handle(i2.finallyLoc);
240
212
  }
241
213
  }
242
214
  }
@@ -252,14 +224,12 @@ function _regeneratorRuntime() {
252
224
  var a2 = i2 ? i2.completion : {};
253
225
  return a2.type = t2, a2.arg = e2, i2 ? (this.method = "next", this.next = i2.finallyLoc, y) : this.complete(a2);
254
226
  }, complete: function complete(t2, e2) {
255
- if ("throw" === t2.type)
256
- throw t2.arg;
227
+ if ("throw" === t2.type) throw t2.arg;
257
228
  return "break" === t2.type || "continue" === t2.type ? this.next = t2.arg : "return" === t2.type ? (this.rval = this.arg = t2.arg, this.method = "return", this.next = "end") : "normal" === t2.type && e2 && (this.next = e2), y;
258
229
  }, finish: function finish(t2) {
259
230
  for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
260
231
  var r2 = this.tryEntries[e2];
261
- if (r2.finallyLoc === t2)
262
- return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y;
232
+ if (r2.finallyLoc === t2) return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y;
263
233
  }
264
234
  }, catch: function _catch(t2) {
265
235
  for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
@@ -305,8 +275,7 @@ function _extends() {
305
275
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
306
276
  for (var e = 1; e < arguments.length; e++) {
307
277
  var t = arguments[e];
308
- for (var r in t)
309
- ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
278
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
310
279
  }
311
280
  return n;
312
281
  }, _extends.apply(null, arguments);
@@ -386,8 +355,7 @@ function getSideList(side, isStart, rtl) {
386
355
  switch (side) {
387
356
  case "top":
388
357
  case "bottom":
389
- if (rtl)
390
- return isStart ? rl : lr;
358
+ if (rtl) return isStart ? rl : lr;
391
359
  return isStart ? lr : rl;
392
360
  case "left":
393
361
  case "right":
@@ -499,114 +467,113 @@ var computePosition$1 = /* @__PURE__ */ function() {
499
467
  var _ref2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(reference, floating, config) {
500
468
  var _config$placement, placement, _config$strategy, strategy, _config$middleware, middleware, platform2, validMiddleware, rtl, rects, _computeCoordsFromPla, x, y, statefulPlacement, middlewareData, resetCount, i, _extends2, _validMiddleware$i, name, fn, _yield$fn, nextX, nextY, data, reset, _computeCoordsFromPla2;
501
469
  return _regeneratorRuntime().wrap(function _callee$(_context) {
502
- while (1)
503
- switch (_context.prev = _context.next) {
504
- case 0:
505
- _config$placement = config.placement, placement = _config$placement === void 0 ? "bottom" : _config$placement, _config$strategy = config.strategy, strategy = _config$strategy === void 0 ? "absolute" : _config$strategy, _config$middleware = config.middleware, middleware = _config$middleware === void 0 ? [] : _config$middleware, platform2 = config.platform;
506
- validMiddleware = middleware.filter(Boolean);
507
- _context.next = 4;
508
- return platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
509
- case 4:
510
- rtl = _context.sent;
511
- _context.next = 7;
512
- return platform2.getElementRects({
470
+ while (1) switch (_context.prev = _context.next) {
471
+ case 0:
472
+ _config$placement = config.placement, placement = _config$placement === void 0 ? "bottom" : _config$placement, _config$strategy = config.strategy, strategy = _config$strategy === void 0 ? "absolute" : _config$strategy, _config$middleware = config.middleware, middleware = _config$middleware === void 0 ? [] : _config$middleware, platform2 = config.platform;
473
+ validMiddleware = middleware.filter(Boolean);
474
+ _context.next = 4;
475
+ return platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
476
+ case 4:
477
+ rtl = _context.sent;
478
+ _context.next = 7;
479
+ return platform2.getElementRects({
480
+ reference,
481
+ floating,
482
+ strategy
483
+ });
484
+ case 7:
485
+ rects = _context.sent;
486
+ _computeCoordsFromPla = computeCoordsFromPlacement(rects, placement, rtl), x = _computeCoordsFromPla.x, y = _computeCoordsFromPla.y;
487
+ statefulPlacement = placement;
488
+ middlewareData = {};
489
+ resetCount = 0;
490
+ i = 0;
491
+ case 13:
492
+ if (!(i < validMiddleware.length)) {
493
+ _context.next = 45;
494
+ break;
495
+ }
496
+ _validMiddleware$i = validMiddleware[i], name = _validMiddleware$i.name, fn = _validMiddleware$i.fn;
497
+ _context.next = 17;
498
+ return fn({
499
+ x,
500
+ y,
501
+ initialPlacement: placement,
502
+ placement: statefulPlacement,
503
+ strategy,
504
+ middlewareData,
505
+ rects,
506
+ platform: platform2,
507
+ elements: {
513
508
  reference,
514
- floating,
515
- strategy
516
- });
517
- case 7:
518
- rects = _context.sent;
519
- _computeCoordsFromPla = computeCoordsFromPlacement(rects, placement, rtl), x = _computeCoordsFromPla.x, y = _computeCoordsFromPla.y;
520
- statefulPlacement = placement;
521
- middlewareData = {};
522
- resetCount = 0;
523
- i = 0;
524
- case 13:
525
- if (!(i < validMiddleware.length)) {
526
- _context.next = 45;
527
- break;
528
- }
529
- _validMiddleware$i = validMiddleware[i], name = _validMiddleware$i.name, fn = _validMiddleware$i.fn;
530
- _context.next = 17;
531
- return fn({
532
- x,
533
- y,
534
- initialPlacement: placement,
535
- placement: statefulPlacement,
536
- strategy,
537
- middlewareData,
538
- rects,
539
- platform: platform2,
540
- elements: {
541
- reference,
542
- floating
543
- }
544
- });
545
- case 17:
546
- _yield$fn = _context.sent;
547
- nextX = _yield$fn.x;
548
- nextY = _yield$fn.y;
549
- data = _yield$fn.data;
550
- reset = _yield$fn.reset;
551
- x = nextX != null ? nextX : x;
552
- y = nextY != null ? nextY : y;
553
- middlewareData = _extends({}, middlewareData, (_extends2 = {}, _extends2[name] = _extends({}, middlewareData[name], data), _extends2));
554
- if (!(reset && resetCount <= 50)) {
555
- _context.next = 42;
556
- break;
557
- }
558
- resetCount++;
559
- if (!(typeof reset === "object")) {
560
- _context.next = 41;
561
- break;
562
- }
563
- if (reset.placement) {
564
- statefulPlacement = reset.placement;
509
+ floating
565
510
  }
566
- if (!reset.rects) {
567
- _context.next = 38;
568
- break;
569
- }
570
- if (!(reset.rects === true)) {
571
- _context.next = 36;
572
- break;
573
- }
574
- _context.next = 33;
575
- return platform2.getElementRects({
576
- reference,
577
- floating,
578
- strategy
579
- });
580
- case 33:
581
- _context.t0 = _context.sent;
582
- _context.next = 37;
511
+ });
512
+ case 17:
513
+ _yield$fn = _context.sent;
514
+ nextX = _yield$fn.x;
515
+ nextY = _yield$fn.y;
516
+ data = _yield$fn.data;
517
+ reset = _yield$fn.reset;
518
+ x = nextX != null ? nextX : x;
519
+ y = nextY != null ? nextY : y;
520
+ middlewareData = _extends({}, middlewareData, (_extends2 = {}, _extends2[name] = _extends({}, middlewareData[name], data), _extends2));
521
+ if (!(reset && resetCount <= 50)) {
522
+ _context.next = 42;
583
523
  break;
584
- case 36:
585
- _context.t0 = reset.rects;
586
- case 37:
587
- rects = _context.t0;
588
- case 38:
589
- _computeCoordsFromPla2 = computeCoordsFromPlacement(rects, statefulPlacement, rtl);
590
- x = _computeCoordsFromPla2.x;
591
- y = _computeCoordsFromPla2.y;
592
- case 41:
593
- i = -1;
594
- case 42:
595
- i++;
596
- _context.next = 13;
524
+ }
525
+ resetCount++;
526
+ if (!(typeof reset === "object")) {
527
+ _context.next = 41;
597
528
  break;
598
- case 45:
599
- return _context.abrupt("return", {
600
- x,
601
- y,
602
- placement: statefulPlacement,
603
- strategy,
604
- middlewareData
605
- });
606
- case 46:
607
- case "end":
608
- return _context.stop();
609
- }
529
+ }
530
+ if (reset.placement) {
531
+ statefulPlacement = reset.placement;
532
+ }
533
+ if (!reset.rects) {
534
+ _context.next = 38;
535
+ break;
536
+ }
537
+ if (!(reset.rects === true)) {
538
+ _context.next = 36;
539
+ break;
540
+ }
541
+ _context.next = 33;
542
+ return platform2.getElementRects({
543
+ reference,
544
+ floating,
545
+ strategy
546
+ });
547
+ case 33:
548
+ _context.t0 = _context.sent;
549
+ _context.next = 37;
550
+ break;
551
+ case 36:
552
+ _context.t0 = reset.rects;
553
+ case 37:
554
+ rects = _context.t0;
555
+ case 38:
556
+ _computeCoordsFromPla2 = computeCoordsFromPlacement(rects, statefulPlacement, rtl);
557
+ x = _computeCoordsFromPla2.x;
558
+ y = _computeCoordsFromPla2.y;
559
+ case 41:
560
+ i = -1;
561
+ case 42:
562
+ i++;
563
+ _context.next = 13;
564
+ break;
565
+ case 45:
566
+ return _context.abrupt("return", {
567
+ x,
568
+ y,
569
+ placement: statefulPlacement,
570
+ strategy,
571
+ middlewareData
572
+ });
573
+ case 46:
574
+ case "end":
575
+ return _context.stop();
576
+ }
610
577
  }, _callee);
611
578
  }));
612
579
  return function computePosition$12(_x, _x2, _x3) {
@@ -620,139 +587,138 @@ function _detectOverflow() {
620
587
  _detectOverflow = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee8(state, options) {
621
588
  var _await$platform$isEle, x, y, platform2, rects, elements, strategy, _evaluate5, _evaluate5$boundary, boundary, _evaluate5$rootBounda, rootBoundary, _evaluate5$elementCon, elementContext, _evaluate5$altBoundar, altBoundary, _evaluate5$padding, padding, paddingObject, altContext, element, clippingClientRect, rect, offsetParent, offsetScale, elementClientRect;
622
589
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
623
- while (1)
624
- switch (_context8.prev = _context8.next) {
625
- case 0:
626
- if (options === void 0) {
627
- options = {};
628
- }
629
- x = state.x, y = state.y, platform2 = state.platform, rects = state.rects, elements = state.elements, strategy = state.strategy;
630
- _evaluate5 = evaluate(options, state), _evaluate5$boundary = _evaluate5.boundary, boundary = _evaluate5$boundary === void 0 ? "clippingAncestors" : _evaluate5$boundary, _evaluate5$rootBounda = _evaluate5.rootBoundary, rootBoundary = _evaluate5$rootBounda === void 0 ? "viewport" : _evaluate5$rootBounda, _evaluate5$elementCon = _evaluate5.elementContext, elementContext = _evaluate5$elementCon === void 0 ? "floating" : _evaluate5$elementCon, _evaluate5$altBoundar = _evaluate5.altBoundary, altBoundary = _evaluate5$altBoundar === void 0 ? false : _evaluate5$altBoundar, _evaluate5$padding = _evaluate5.padding, padding = _evaluate5$padding === void 0 ? 0 : _evaluate5$padding;
631
- paddingObject = getPaddingObject(padding);
632
- altContext = elementContext === "floating" ? "reference" : "floating";
633
- element = elements[altBoundary ? altContext : elementContext];
634
- _context8.t0 = rectToClientRect;
635
- _context8.t1 = platform2;
636
- _context8.next = 10;
637
- return platform2.isElement == null ? void 0 : platform2.isElement(element);
638
- case 10:
639
- _context8.t2 = _await$platform$isEle = _context8.sent;
640
- if (!(_context8.t2 != null)) {
641
- _context8.next = 15;
642
- break;
643
- }
644
- _context8.t3 = _await$platform$isEle;
645
- _context8.next = 16;
590
+ while (1) switch (_context8.prev = _context8.next) {
591
+ case 0:
592
+ if (options === void 0) {
593
+ options = {};
594
+ }
595
+ x = state.x, y = state.y, platform2 = state.platform, rects = state.rects, elements = state.elements, strategy = state.strategy;
596
+ _evaluate5 = evaluate(options, state), _evaluate5$boundary = _evaluate5.boundary, boundary = _evaluate5$boundary === void 0 ? "clippingAncestors" : _evaluate5$boundary, _evaluate5$rootBounda = _evaluate5.rootBoundary, rootBoundary = _evaluate5$rootBounda === void 0 ? "viewport" : _evaluate5$rootBounda, _evaluate5$elementCon = _evaluate5.elementContext, elementContext = _evaluate5$elementCon === void 0 ? "floating" : _evaluate5$elementCon, _evaluate5$altBoundar = _evaluate5.altBoundary, altBoundary = _evaluate5$altBoundar === void 0 ? false : _evaluate5$altBoundar, _evaluate5$padding = _evaluate5.padding, padding = _evaluate5$padding === void 0 ? 0 : _evaluate5$padding;
597
+ paddingObject = getPaddingObject(padding);
598
+ altContext = elementContext === "floating" ? "reference" : "floating";
599
+ element = elements[altBoundary ? altContext : elementContext];
600
+ _context8.t0 = rectToClientRect;
601
+ _context8.t1 = platform2;
602
+ _context8.next = 10;
603
+ return platform2.isElement == null ? void 0 : platform2.isElement(element);
604
+ case 10:
605
+ _context8.t2 = _await$platform$isEle = _context8.sent;
606
+ if (!(_context8.t2 != null)) {
607
+ _context8.next = 15;
646
608
  break;
647
- case 15:
648
- _context8.t3 = true;
649
- case 16:
650
- if (!_context8.t3) {
651
- _context8.next = 20;
652
- break;
653
- }
654
- _context8.t4 = element;
655
- _context8.next = 26;
609
+ }
610
+ _context8.t3 = _await$platform$isEle;
611
+ _context8.next = 16;
612
+ break;
613
+ case 15:
614
+ _context8.t3 = true;
615
+ case 16:
616
+ if (!_context8.t3) {
617
+ _context8.next = 20;
656
618
  break;
657
- case 20:
658
- _context8.t5 = element.contextElement;
659
- if (_context8.t5) {
660
- _context8.next = 25;
661
- break;
662
- }
663
- _context8.next = 24;
664
- return platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating);
665
- case 24:
666
- _context8.t5 = _context8.sent;
667
- case 25:
668
- _context8.t4 = _context8.t5;
669
- case 26:
670
- _context8.t6 = _context8.t4;
671
- _context8.t7 = boundary;
672
- _context8.t8 = rootBoundary;
673
- _context8.t9 = strategy;
674
- _context8.t10 = {
675
- element: _context8.t6,
676
- boundary: _context8.t7,
677
- rootBoundary: _context8.t8,
678
- strategy: _context8.t9
679
- };
680
- _context8.next = 33;
681
- return _context8.t1.getClippingRect.call(_context8.t1, _context8.t10);
682
- case 33:
683
- _context8.t11 = _context8.sent;
684
- clippingClientRect = (0, _context8.t0)(_context8.t11);
685
- rect = elementContext === "floating" ? {
686
- x,
687
- y,
688
- width: rects.floating.width,
689
- height: rects.floating.height
690
- } : rects.reference;
691
- _context8.next = 38;
692
- return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating);
693
- case 38:
694
- offsetParent = _context8.sent;
695
- _context8.next = 41;
696
- return platform2.isElement == null ? void 0 : platform2.isElement(offsetParent);
697
- case 41:
698
- if (!_context8.sent) {
699
- _context8.next = 50;
700
- break;
701
- }
702
- _context8.next = 44;
703
- return platform2.getScale == null ? void 0 : platform2.getScale(offsetParent);
704
- case 44:
705
- _context8.t13 = _context8.sent;
706
- if (_context8.t13) {
707
- _context8.next = 47;
708
- break;
709
- }
710
- _context8.t13 = {
711
- x: 1,
712
- y: 1
713
- };
714
- case 47:
715
- _context8.t12 = _context8.t13;
716
- _context8.next = 51;
619
+ }
620
+ _context8.t4 = element;
621
+ _context8.next = 26;
622
+ break;
623
+ case 20:
624
+ _context8.t5 = element.contextElement;
625
+ if (_context8.t5) {
626
+ _context8.next = 25;
717
627
  break;
718
- case 50:
719
- _context8.t12 = {
720
- x: 1,
721
- y: 1
722
- };
723
- case 51:
724
- offsetScale = _context8.t12;
725
- _context8.t14 = rectToClientRect;
726
- if (!platform2.convertOffsetParentRelativeRectToViewportRelativeRect) {
727
- _context8.next = 59;
728
- break;
729
- }
730
- _context8.next = 56;
731
- return platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
732
- elements,
733
- rect,
734
- offsetParent,
735
- strategy
736
- });
737
- case 56:
738
- _context8.t15 = _context8.sent;
739
- _context8.next = 60;
628
+ }
629
+ _context8.next = 24;
630
+ return platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating);
631
+ case 24:
632
+ _context8.t5 = _context8.sent;
633
+ case 25:
634
+ _context8.t4 = _context8.t5;
635
+ case 26:
636
+ _context8.t6 = _context8.t4;
637
+ _context8.t7 = boundary;
638
+ _context8.t8 = rootBoundary;
639
+ _context8.t9 = strategy;
640
+ _context8.t10 = {
641
+ element: _context8.t6,
642
+ boundary: _context8.t7,
643
+ rootBoundary: _context8.t8,
644
+ strategy: _context8.t9
645
+ };
646
+ _context8.next = 33;
647
+ return _context8.t1.getClippingRect.call(_context8.t1, _context8.t10);
648
+ case 33:
649
+ _context8.t11 = _context8.sent;
650
+ clippingClientRect = (0, _context8.t0)(_context8.t11);
651
+ rect = elementContext === "floating" ? {
652
+ x,
653
+ y,
654
+ width: rects.floating.width,
655
+ height: rects.floating.height
656
+ } : rects.reference;
657
+ _context8.next = 38;
658
+ return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating);
659
+ case 38:
660
+ offsetParent = _context8.sent;
661
+ _context8.next = 41;
662
+ return platform2.isElement == null ? void 0 : platform2.isElement(offsetParent);
663
+ case 41:
664
+ if (!_context8.sent) {
665
+ _context8.next = 50;
740
666
  break;
741
- case 59:
742
- _context8.t15 = rect;
743
- case 60:
744
- _context8.t16 = _context8.t15;
745
- elementClientRect = (0, _context8.t14)(_context8.t16);
746
- return _context8.abrupt("return", {
747
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
748
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
749
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
750
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
751
- });
752
- case 63:
753
- case "end":
754
- return _context8.stop();
755
- }
667
+ }
668
+ _context8.next = 44;
669
+ return platform2.getScale == null ? void 0 : platform2.getScale(offsetParent);
670
+ case 44:
671
+ _context8.t13 = _context8.sent;
672
+ if (_context8.t13) {
673
+ _context8.next = 47;
674
+ break;
675
+ }
676
+ _context8.t13 = {
677
+ x: 1,
678
+ y: 1
679
+ };
680
+ case 47:
681
+ _context8.t12 = _context8.t13;
682
+ _context8.next = 51;
683
+ break;
684
+ case 50:
685
+ _context8.t12 = {
686
+ x: 1,
687
+ y: 1
688
+ };
689
+ case 51:
690
+ offsetScale = _context8.t12;
691
+ _context8.t14 = rectToClientRect;
692
+ if (!platform2.convertOffsetParentRelativeRectToViewportRelativeRect) {
693
+ _context8.next = 59;
694
+ break;
695
+ }
696
+ _context8.next = 56;
697
+ return platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
698
+ elements,
699
+ rect,
700
+ offsetParent,
701
+ strategy
702
+ });
703
+ case 56:
704
+ _context8.t15 = _context8.sent;
705
+ _context8.next = 60;
706
+ break;
707
+ case 59:
708
+ _context8.t15 = rect;
709
+ case 60:
710
+ _context8.t16 = _context8.t15;
711
+ elementClientRect = (0, _context8.t14)(_context8.t16);
712
+ return _context8.abrupt("return", {
713
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
714
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
715
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
716
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
717
+ });
718
+ case 63:
719
+ case "end":
720
+ return _context8.stop();
721
+ }
756
722
  }, _callee8);
757
723
  }));
758
724
  return _detectOverflow.apply(this, arguments);
@@ -766,72 +732,71 @@ var arrow$1 = function arrow$12(options) {
766
732
  var _extends3, _ref4;
767
733
  var x, y, placement, rects, platform2, elements, middlewareData, _ref3, element, _ref3$padding, padding, paddingObject, coords, axis, length, arrowDimensions, isYAxis, minProp, maxProp, clientProp, endDiff, startDiff, arrowOffsetParent, clientSize, centerToReference, largestPossiblePadding, minPadding, maxPadding, min$1, max2, center, offset2, shouldAddOffset, alignmentOffset;
768
734
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
769
- while (1)
770
- switch (_context2.prev = _context2.next) {
771
- case 0:
772
- x = state.x, y = state.y, placement = state.placement, rects = state.rects, platform2 = state.platform, elements = state.elements, middlewareData = state.middlewareData;
773
- _ref3 = evaluate(options, state) || {}, element = _ref3.element, _ref3$padding = _ref3.padding, padding = _ref3$padding === void 0 ? 0 : _ref3$padding;
774
- if (!(element == null)) {
775
- _context2.next = 4;
776
- break;
777
- }
778
- return _context2.abrupt("return", {});
779
- case 4:
780
- paddingObject = getPaddingObject(padding);
781
- coords = {
782
- x,
783
- y
784
- };
785
- axis = getAlignmentAxis(placement);
786
- length = getAxisLength(axis);
787
- _context2.next = 10;
788
- return platform2.getDimensions(element);
789
- case 10:
790
- arrowDimensions = _context2.sent;
791
- isYAxis = axis === "y";
792
- minProp = isYAxis ? "top" : "left";
793
- maxProp = isYAxis ? "bottom" : "right";
794
- clientProp = isYAxis ? "clientHeight" : "clientWidth";
795
- endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
796
- startDiff = coords[axis] - rects.reference[axis];
797
- _context2.next = 19;
798
- return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element);
799
- case 19:
800
- arrowOffsetParent = _context2.sent;
801
- clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
802
- _context2.t0 = !clientSize;
803
- if (_context2.t0) {
804
- _context2.next = 26;
805
- break;
806
- }
807
- _context2.next = 25;
808
- return platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent);
809
- case 25:
810
- _context2.t0 = !_context2.sent;
811
- case 26:
812
- if (!_context2.t0) {
813
- _context2.next = 28;
814
- break;
815
- }
816
- clientSize = elements.floating[clientProp] || rects.floating[length];
817
- case 28:
818
- centerToReference = endDiff / 2 - startDiff / 2;
819
- largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
820
- minPadding = min(paddingObject[minProp], largestPossiblePadding);
821
- maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
822
- min$1 = minPadding;
823
- max2 = clientSize - arrowDimensions[length] - maxPadding;
824
- center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
825
- offset2 = clamp(min$1, center, max2);
826
- shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
827
- alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
828
- return _context2.abrupt("return", (_ref4 = {}, _ref4[axis] = coords[axis] + alignmentOffset, _ref4.data = _extends((_extends3 = {}, _extends3[axis] = offset2, _extends3.centerOffset = center - offset2 - alignmentOffset, _extends3), shouldAddOffset && {
829
- alignmentOffset
830
- }), _ref4.reset = shouldAddOffset, _ref4));
831
- case 39:
832
- case "end":
833
- return _context2.stop();
834
- }
735
+ while (1) switch (_context2.prev = _context2.next) {
736
+ case 0:
737
+ x = state.x, y = state.y, placement = state.placement, rects = state.rects, platform2 = state.platform, elements = state.elements, middlewareData = state.middlewareData;
738
+ _ref3 = evaluate(options, state) || {}, element = _ref3.element, _ref3$padding = _ref3.padding, padding = _ref3$padding === void 0 ? 0 : _ref3$padding;
739
+ if (!(element == null)) {
740
+ _context2.next = 4;
741
+ break;
742
+ }
743
+ return _context2.abrupt("return", {});
744
+ case 4:
745
+ paddingObject = getPaddingObject(padding);
746
+ coords = {
747
+ x,
748
+ y
749
+ };
750
+ axis = getAlignmentAxis(placement);
751
+ length = getAxisLength(axis);
752
+ _context2.next = 10;
753
+ return platform2.getDimensions(element);
754
+ case 10:
755
+ arrowDimensions = _context2.sent;
756
+ isYAxis = axis === "y";
757
+ minProp = isYAxis ? "top" : "left";
758
+ maxProp = isYAxis ? "bottom" : "right";
759
+ clientProp = isYAxis ? "clientHeight" : "clientWidth";
760
+ endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
761
+ startDiff = coords[axis] - rects.reference[axis];
762
+ _context2.next = 19;
763
+ return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element);
764
+ case 19:
765
+ arrowOffsetParent = _context2.sent;
766
+ clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
767
+ _context2.t0 = !clientSize;
768
+ if (_context2.t0) {
769
+ _context2.next = 26;
770
+ break;
771
+ }
772
+ _context2.next = 25;
773
+ return platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent);
774
+ case 25:
775
+ _context2.t0 = !_context2.sent;
776
+ case 26:
777
+ if (!_context2.t0) {
778
+ _context2.next = 28;
779
+ break;
780
+ }
781
+ clientSize = elements.floating[clientProp] || rects.floating[length];
782
+ case 28:
783
+ centerToReference = endDiff / 2 - startDiff / 2;
784
+ largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
785
+ minPadding = min(paddingObject[minProp], largestPossiblePadding);
786
+ maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
787
+ min$1 = minPadding;
788
+ max2 = clientSize - arrowDimensions[length] - maxPadding;
789
+ center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
790
+ offset2 = clamp(min$1, center, max2);
791
+ shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
792
+ alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
793
+ return _context2.abrupt("return", (_ref4 = {}, _ref4[axis] = coords[axis] + alignmentOffset, _ref4.data = _extends((_extends3 = {}, _extends3[axis] = offset2, _extends3.centerOffset = center - offset2 - alignmentOffset, _extends3), shouldAddOffset && {
794
+ alignmentOffset
795
+ }), _ref4.reset = shouldAddOffset, _ref4));
796
+ case 39:
797
+ case "end":
798
+ return _context2.stop();
799
+ }
835
800
  }, _callee2);
836
801
  }))();
837
802
  }
@@ -848,122 +813,121 @@ var flip$1 = function flip$12(options) {
848
813
  return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3() {
849
814
  var _middlewareData$arrow, _middlewareData$flip, placement, middlewareData, rects, initialPlacement, platform2, elements, _evaluate, _evaluate$mainAxis, checkMainAxis, _evaluate$crossAxis, checkCrossAxis, specifiedFallbackPlacements, _evaluate$fallbackStr, fallbackStrategy, _evaluate$fallbackAxi, fallbackAxisSideDirection, _evaluate$flipAlignme, flipAlignment, detectOverflowOptions, side, initialSideAxis, isBasePlacement, rtl, fallbackPlacements, hasFallbackAxisSideDirection, placements, overflow, overflows, overflowsData, _sides, _middlewareData$flip2, _overflowsData$filter, nextIndex, nextPlacement, resetPlacement, _overflowsData$filter2, _placement;
850
815
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
851
- while (1)
852
- switch (_context3.prev = _context3.next) {
853
- case 0:
854
- placement = state.placement, middlewareData = state.middlewareData, rects = state.rects, initialPlacement = state.initialPlacement, platform2 = state.platform, elements = state.elements;
855
- _evaluate = evaluate(options, state), _evaluate$mainAxis = _evaluate.mainAxis, checkMainAxis = _evaluate$mainAxis === void 0 ? true : _evaluate$mainAxis, _evaluate$crossAxis = _evaluate.crossAxis, checkCrossAxis = _evaluate$crossAxis === void 0 ? true : _evaluate$crossAxis, specifiedFallbackPlacements = _evaluate.fallbackPlacements, _evaluate$fallbackStr = _evaluate.fallbackStrategy, fallbackStrategy = _evaluate$fallbackStr === void 0 ? "bestFit" : _evaluate$fallbackStr, _evaluate$fallbackAxi = _evaluate.fallbackAxisSideDirection, fallbackAxisSideDirection = _evaluate$fallbackAxi === void 0 ? "none" : _evaluate$fallbackAxi, _evaluate$flipAlignme = _evaluate.flipAlignment, flipAlignment = _evaluate$flipAlignme === void 0 ? true : _evaluate$flipAlignme, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate, _excluded);
856
- if (!((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
857
- _context3.next = 4;
858
- break;
859
- }
860
- return _context3.abrupt("return", {});
861
- case 4:
862
- side = getSide(placement);
863
- initialSideAxis = getSideAxis(initialPlacement);
864
- isBasePlacement = getSide(initialPlacement) === initialPlacement;
865
- _context3.next = 9;
866
- return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
867
- case 9:
868
- rtl = _context3.sent;
869
- fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
870
- hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
871
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
872
- fallbackPlacements.push.apply(fallbackPlacements, getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
873
- }
874
- placements = [initialPlacement].concat(fallbackPlacements);
875
- _context3.next = 16;
876
- return detectOverflow(state, detectOverflowOptions);
877
- case 16:
878
- overflow = _context3.sent;
879
- overflows = [];
880
- overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
881
- if (checkMainAxis) {
882
- overflows.push(overflow[side]);
883
- }
884
- if (checkCrossAxis) {
885
- _sides = getAlignmentSides(placement, rects, rtl);
886
- overflows.push(overflow[_sides[0]], overflow[_sides[1]]);
887
- }
888
- overflowsData = [].concat(overflowsData, [{
889
- placement,
890
- overflows
891
- }]);
892
- if (overflows.every(function(side2) {
893
- return side2 <= 0;
894
- })) {
895
- _context3.next = 39;
896
- break;
897
- }
898
- nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
899
- nextPlacement = placements[nextIndex];
900
- if (!nextPlacement) {
901
- _context3.next = 27;
902
- break;
903
- }
904
- return _context3.abrupt("return", {
905
- data: {
906
- index: nextIndex,
907
- overflows: overflowsData
908
- },
909
- reset: {
910
- placement: nextPlacement
911
- }
912
- });
913
- case 27:
914
- resetPlacement = (_overflowsData$filter = overflowsData.filter(function(d) {
915
- return d.overflows[0] <= 0;
916
- }).sort(function(a, b) {
917
- return a.overflows[1] - b.overflows[1];
918
- })[0]) == null ? void 0 : _overflowsData$filter.placement;
919
- if (resetPlacement) {
920
- _context3.next = 37;
921
- break;
816
+ while (1) switch (_context3.prev = _context3.next) {
817
+ case 0:
818
+ placement = state.placement, middlewareData = state.middlewareData, rects = state.rects, initialPlacement = state.initialPlacement, platform2 = state.platform, elements = state.elements;
819
+ _evaluate = evaluate(options, state), _evaluate$mainAxis = _evaluate.mainAxis, checkMainAxis = _evaluate$mainAxis === void 0 ? true : _evaluate$mainAxis, _evaluate$crossAxis = _evaluate.crossAxis, checkCrossAxis = _evaluate$crossAxis === void 0 ? true : _evaluate$crossAxis, specifiedFallbackPlacements = _evaluate.fallbackPlacements, _evaluate$fallbackStr = _evaluate.fallbackStrategy, fallbackStrategy = _evaluate$fallbackStr === void 0 ? "bestFit" : _evaluate$fallbackStr, _evaluate$fallbackAxi = _evaluate.fallbackAxisSideDirection, fallbackAxisSideDirection = _evaluate$fallbackAxi === void 0 ? "none" : _evaluate$fallbackAxi, _evaluate$flipAlignme = _evaluate.flipAlignment, flipAlignment = _evaluate$flipAlignme === void 0 ? true : _evaluate$flipAlignme, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate, _excluded);
820
+ if (!((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
821
+ _context3.next = 4;
822
+ break;
823
+ }
824
+ return _context3.abrupt("return", {});
825
+ case 4:
826
+ side = getSide(placement);
827
+ initialSideAxis = getSideAxis(initialPlacement);
828
+ isBasePlacement = getSide(initialPlacement) === initialPlacement;
829
+ _context3.next = 9;
830
+ return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
831
+ case 9:
832
+ rtl = _context3.sent;
833
+ fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
834
+ hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
835
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
836
+ fallbackPlacements.push.apply(fallbackPlacements, getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
837
+ }
838
+ placements = [initialPlacement].concat(fallbackPlacements);
839
+ _context3.next = 16;
840
+ return detectOverflow(state, detectOverflowOptions);
841
+ case 16:
842
+ overflow = _context3.sent;
843
+ overflows = [];
844
+ overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
845
+ if (checkMainAxis) {
846
+ overflows.push(overflow[side]);
847
+ }
848
+ if (checkCrossAxis) {
849
+ _sides = getAlignmentSides(placement, rects, rtl);
850
+ overflows.push(overflow[_sides[0]], overflow[_sides[1]]);
851
+ }
852
+ overflowsData = [].concat(overflowsData, [{
853
+ placement,
854
+ overflows
855
+ }]);
856
+ if (overflows.every(function(side2) {
857
+ return side2 <= 0;
858
+ })) {
859
+ _context3.next = 39;
860
+ break;
861
+ }
862
+ nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
863
+ nextPlacement = placements[nextIndex];
864
+ if (!nextPlacement) {
865
+ _context3.next = 27;
866
+ break;
867
+ }
868
+ return _context3.abrupt("return", {
869
+ data: {
870
+ index: nextIndex,
871
+ overflows: overflowsData
872
+ },
873
+ reset: {
874
+ placement: nextPlacement
922
875
  }
923
- _context3.t0 = fallbackStrategy;
924
- _context3.next = _context3.t0 === "bestFit" ? 32 : _context3.t0 === "initialPlacement" ? 35 : 37;
876
+ });
877
+ case 27:
878
+ resetPlacement = (_overflowsData$filter = overflowsData.filter(function(d) {
879
+ return d.overflows[0] <= 0;
880
+ }).sort(function(a, b) {
881
+ return a.overflows[1] - b.overflows[1];
882
+ })[0]) == null ? void 0 : _overflowsData$filter.placement;
883
+ if (resetPlacement) {
884
+ _context3.next = 37;
925
885
  break;
926
- case 32:
927
- _placement = (_overflowsData$filter2 = overflowsData.filter(function(d) {
928
- if (hasFallbackAxisSideDirection) {
929
- var currentSideAxis = getSideAxis(d.placement);
930
- return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
931
- // reading directions favoring greater width.
932
- currentSideAxis === "y";
933
- }
934
- return true;
935
- }).map(function(d) {
936
- return [d.placement, d.overflows.filter(function(overflow2) {
937
- return overflow2 > 0;
938
- }).reduce(function(acc, overflow2) {
939
- return acc + overflow2;
940
- }, 0)];
941
- }).sort(function(a, b) {
942
- return a[1] - b[1];
943
- })[0]) == null ? void 0 : _overflowsData$filter2[0];
944
- if (_placement) {
945
- resetPlacement = _placement;
886
+ }
887
+ _context3.t0 = fallbackStrategy;
888
+ _context3.next = _context3.t0 === "bestFit" ? 32 : _context3.t0 === "initialPlacement" ? 35 : 37;
889
+ break;
890
+ case 32:
891
+ _placement = (_overflowsData$filter2 = overflowsData.filter(function(d) {
892
+ if (hasFallbackAxisSideDirection) {
893
+ var currentSideAxis = getSideAxis(d.placement);
894
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
895
+ // reading directions favoring greater width.
896
+ currentSideAxis === "y";
946
897
  }
947
- return _context3.abrupt("break", 37);
948
- case 35:
949
- resetPlacement = initialPlacement;
950
- return _context3.abrupt("break", 37);
951
- case 37:
952
- if (!(placement !== resetPlacement)) {
953
- _context3.next = 39;
954
- break;
898
+ return true;
899
+ }).map(function(d) {
900
+ return [d.placement, d.overflows.filter(function(overflow2) {
901
+ return overflow2 > 0;
902
+ }).reduce(function(acc, overflow2) {
903
+ return acc + overflow2;
904
+ }, 0)];
905
+ }).sort(function(a, b) {
906
+ return a[1] - b[1];
907
+ })[0]) == null ? void 0 : _overflowsData$filter2[0];
908
+ if (_placement) {
909
+ resetPlacement = _placement;
910
+ }
911
+ return _context3.abrupt("break", 37);
912
+ case 35:
913
+ resetPlacement = initialPlacement;
914
+ return _context3.abrupt("break", 37);
915
+ case 37:
916
+ if (!(placement !== resetPlacement)) {
917
+ _context3.next = 39;
918
+ break;
919
+ }
920
+ return _context3.abrupt("return", {
921
+ reset: {
922
+ placement: resetPlacement
955
923
  }
956
- return _context3.abrupt("return", {
957
- reset: {
958
- placement: resetPlacement
959
- }
960
- });
961
- case 39:
962
- return _context3.abrupt("return", {});
963
- case 40:
964
- case "end":
965
- return _context3.stop();
966
- }
924
+ });
925
+ case 39:
926
+ return _context3.abrupt("return", {});
927
+ case 40:
928
+ case "end":
929
+ return _context3.stop();
930
+ }
967
931
  }, _callee3);
968
932
  }))();
969
933
  }
@@ -993,48 +957,47 @@ var hide$1 = function hide$12(options) {
993
957
  return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4() {
994
958
  var rects, _evaluate2, _evaluate2$strategy, strategy, detectOverflowOptions, overflow, offsets, _overflow, _offsets;
995
959
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
996
- while (1)
997
- switch (_context4.prev = _context4.next) {
998
- case 0:
999
- rects = state.rects;
1000
- _evaluate2 = evaluate(options, state), _evaluate2$strategy = _evaluate2.strategy, strategy = _evaluate2$strategy === void 0 ? "referenceHidden" : _evaluate2$strategy, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate2, _excluded2);
1001
- _context4.t0 = strategy;
1002
- _context4.next = _context4.t0 === "referenceHidden" ? 5 : _context4.t0 === "escaped" ? 10 : 15;
1003
- break;
1004
- case 5:
1005
- _context4.next = 7;
1006
- return detectOverflow(state, _extends({}, detectOverflowOptions, {
1007
- elementContext: "reference"
1008
- }));
1009
- case 7:
1010
- overflow = _context4.sent;
1011
- offsets = getSideOffsets(overflow, rects.reference);
1012
- return _context4.abrupt("return", {
1013
- data: {
1014
- referenceHiddenOffsets: offsets,
1015
- referenceHidden: isAnySideFullyClipped(offsets)
1016
- }
1017
- });
1018
- case 10:
1019
- _context4.next = 12;
1020
- return detectOverflow(state, _extends({}, detectOverflowOptions, {
1021
- altBoundary: true
1022
- }));
1023
- case 12:
1024
- _overflow = _context4.sent;
1025
- _offsets = getSideOffsets(_overflow, rects.floating);
1026
- return _context4.abrupt("return", {
1027
- data: {
1028
- escapedOffsets: _offsets,
1029
- escaped: isAnySideFullyClipped(_offsets)
1030
- }
1031
- });
1032
- case 15:
1033
- return _context4.abrupt("return", {});
1034
- case 16:
1035
- case "end":
1036
- return _context4.stop();
1037
- }
960
+ while (1) switch (_context4.prev = _context4.next) {
961
+ case 0:
962
+ rects = state.rects;
963
+ _evaluate2 = evaluate(options, state), _evaluate2$strategy = _evaluate2.strategy, strategy = _evaluate2$strategy === void 0 ? "referenceHidden" : _evaluate2$strategy, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate2, _excluded2);
964
+ _context4.t0 = strategy;
965
+ _context4.next = _context4.t0 === "referenceHidden" ? 5 : _context4.t0 === "escaped" ? 10 : 15;
966
+ break;
967
+ case 5:
968
+ _context4.next = 7;
969
+ return detectOverflow(state, _extends({}, detectOverflowOptions, {
970
+ elementContext: "reference"
971
+ }));
972
+ case 7:
973
+ overflow = _context4.sent;
974
+ offsets = getSideOffsets(overflow, rects.reference);
975
+ return _context4.abrupt("return", {
976
+ data: {
977
+ referenceHiddenOffsets: offsets,
978
+ referenceHidden: isAnySideFullyClipped(offsets)
979
+ }
980
+ });
981
+ case 10:
982
+ _context4.next = 12;
983
+ return detectOverflow(state, _extends({}, detectOverflowOptions, {
984
+ altBoundary: true
985
+ }));
986
+ case 12:
987
+ _overflow = _context4.sent;
988
+ _offsets = getSideOffsets(_overflow, rects.floating);
989
+ return _context4.abrupt("return", {
990
+ data: {
991
+ escapedOffsets: _offsets,
992
+ escaped: isAnySideFullyClipped(_offsets)
993
+ }
994
+ });
995
+ case 15:
996
+ return _context4.abrupt("return", {});
997
+ case 16:
998
+ case "end":
999
+ return _context4.stop();
1000
+ }
1038
1001
  }, _callee4);
1039
1002
  }))();
1040
1003
  }
@@ -1047,43 +1010,42 @@ function _convertValueToCoords() {
1047
1010
  _convertValueToCoords = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9(state, options) {
1048
1011
  var placement, platform2, elements, rtl, side, alignment, isVertical, mainAxisMulti, crossAxisMulti, rawValue, _ref7, mainAxis, crossAxis, alignmentAxis;
1049
1012
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1050
- while (1)
1051
- switch (_context9.prev = _context9.next) {
1052
- case 0:
1053
- placement = state.placement, platform2 = state.platform, elements = state.elements;
1054
- _context9.next = 3;
1055
- return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
1056
- case 3:
1057
- rtl = _context9.sent;
1058
- side = getSide(placement);
1059
- alignment = getAlignment(placement);
1060
- isVertical = getSideAxis(placement) === "y";
1061
- mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
1062
- crossAxisMulti = rtl && isVertical ? -1 : 1;
1063
- rawValue = evaluate(options, state);
1064
- _ref7 = typeof rawValue === "number" ? {
1065
- mainAxis: rawValue,
1066
- crossAxis: 0,
1067
- alignmentAxis: null
1068
- } : {
1069
- mainAxis: rawValue.mainAxis || 0,
1070
- crossAxis: rawValue.crossAxis || 0,
1071
- alignmentAxis: rawValue.alignmentAxis
1072
- }, mainAxis = _ref7.mainAxis, crossAxis = _ref7.crossAxis, alignmentAxis = _ref7.alignmentAxis;
1073
- if (alignment && typeof alignmentAxis === "number") {
1074
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
1075
- }
1076
- return _context9.abrupt("return", isVertical ? {
1077
- x: crossAxis * crossAxisMulti,
1078
- y: mainAxis * mainAxisMulti
1079
- } : {
1080
- x: mainAxis * mainAxisMulti,
1081
- y: crossAxis * crossAxisMulti
1082
- });
1083
- case 13:
1084
- case "end":
1085
- return _context9.stop();
1086
- }
1013
+ while (1) switch (_context9.prev = _context9.next) {
1014
+ case 0:
1015
+ placement = state.placement, platform2 = state.platform, elements = state.elements;
1016
+ _context9.next = 3;
1017
+ return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
1018
+ case 3:
1019
+ rtl = _context9.sent;
1020
+ side = getSide(placement);
1021
+ alignment = getAlignment(placement);
1022
+ isVertical = getSideAxis(placement) === "y";
1023
+ mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
1024
+ crossAxisMulti = rtl && isVertical ? -1 : 1;
1025
+ rawValue = evaluate(options, state);
1026
+ _ref7 = typeof rawValue === "number" ? {
1027
+ mainAxis: rawValue,
1028
+ crossAxis: 0,
1029
+ alignmentAxis: null
1030
+ } : {
1031
+ mainAxis: rawValue.mainAxis || 0,
1032
+ crossAxis: rawValue.crossAxis || 0,
1033
+ alignmentAxis: rawValue.alignmentAxis
1034
+ }, mainAxis = _ref7.mainAxis, crossAxis = _ref7.crossAxis, alignmentAxis = _ref7.alignmentAxis;
1035
+ if (alignment && typeof alignmentAxis === "number") {
1036
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
1037
+ }
1038
+ return _context9.abrupt("return", isVertical ? {
1039
+ x: crossAxis * crossAxisMulti,
1040
+ y: mainAxis * mainAxisMulti
1041
+ } : {
1042
+ x: mainAxis * mainAxisMulti,
1043
+ y: crossAxis * crossAxisMulti
1044
+ });
1045
+ case 13:
1046
+ case "end":
1047
+ return _context9.stop();
1048
+ }
1087
1049
  }, _callee9);
1088
1050
  }));
1089
1051
  return _convertValueToCoords.apply(this, arguments);
@@ -1099,31 +1061,30 @@ var offset$1 = function offset$12(options) {
1099
1061
  return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee5() {
1100
1062
  var _middlewareData$offse, _middlewareData$arrow, x, y, placement, middlewareData, diffCoords;
1101
1063
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1102
- while (1)
1103
- switch (_context5.prev = _context5.next) {
1104
- case 0:
1105
- x = state.x, y = state.y, placement = state.placement, middlewareData = state.middlewareData;
1106
- _context5.next = 3;
1107
- return convertValueToCoords(state, options);
1108
- case 3:
1109
- diffCoords = _context5.sent;
1110
- if (!(placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
1111
- _context5.next = 6;
1112
- break;
1113
- }
1114
- return _context5.abrupt("return", {});
1115
- case 6:
1116
- return _context5.abrupt("return", {
1117
- x: x + diffCoords.x,
1118
- y: y + diffCoords.y,
1119
- data: _extends({}, diffCoords, {
1120
- placement
1121
- })
1122
- });
1123
- case 7:
1124
- case "end":
1125
- return _context5.stop();
1126
- }
1064
+ while (1) switch (_context5.prev = _context5.next) {
1065
+ case 0:
1066
+ x = state.x, y = state.y, placement = state.placement, middlewareData = state.middlewareData;
1067
+ _context5.next = 3;
1068
+ return convertValueToCoords(state, options);
1069
+ case 3:
1070
+ diffCoords = _context5.sent;
1071
+ if (!(placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
1072
+ _context5.next = 6;
1073
+ break;
1074
+ }
1075
+ return _context5.abrupt("return", {});
1076
+ case 6:
1077
+ return _context5.abrupt("return", {
1078
+ x: x + diffCoords.x,
1079
+ y: y + diffCoords.y,
1080
+ data: _extends({}, diffCoords, {
1081
+ placement
1082
+ })
1083
+ });
1084
+ case 7:
1085
+ case "end":
1086
+ return _context5.stop();
1087
+ }
1127
1088
  }, _callee5);
1128
1089
  }))();
1129
1090
  }
@@ -1141,57 +1102,56 @@ var shift$1 = function shift$12(options) {
1141
1102
  var _extends4, _enabled;
1142
1103
  var x, y, placement, _evaluate3, _evaluate3$mainAxis, checkMainAxis, _evaluate3$crossAxis, checkCrossAxis, _evaluate3$limiter, limiter, detectOverflowOptions, coords, overflow, crossAxis, mainAxis, mainAxisCoord, crossAxisCoord, minSide, maxSide, _min, _max, _minSide, _maxSide, _min2, _max2, limitedCoords;
1143
1104
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1144
- while (1)
1145
- switch (_context6.prev = _context6.next) {
1146
- case 0:
1147
- x = state.x, y = state.y, placement = state.placement;
1148
- _evaluate3 = evaluate(options, state), _evaluate3$mainAxis = _evaluate3.mainAxis, checkMainAxis = _evaluate3$mainAxis === void 0 ? true : _evaluate3$mainAxis, _evaluate3$crossAxis = _evaluate3.crossAxis, checkCrossAxis = _evaluate3$crossAxis === void 0 ? false : _evaluate3$crossAxis, _evaluate3$limiter = _evaluate3.limiter, limiter = _evaluate3$limiter === void 0 ? {
1149
- fn: function fn2(_ref) {
1150
- var x2 = _ref.x, y2 = _ref.y;
1151
- return {
1152
- x: x2,
1153
- y: y2
1154
- };
1155
- }
1156
- } : _evaluate3$limiter, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate3, _excluded3);
1157
- coords = {
1158
- x,
1159
- y
1160
- };
1161
- _context6.next = 5;
1162
- return detectOverflow(state, detectOverflowOptions);
1163
- case 5:
1164
- overflow = _context6.sent;
1165
- crossAxis = getSideAxis(getSide(placement));
1166
- mainAxis = getOppositeAxis(crossAxis);
1167
- mainAxisCoord = coords[mainAxis];
1168
- crossAxisCoord = coords[crossAxis];
1169
- if (checkMainAxis) {
1170
- minSide = mainAxis === "y" ? "top" : "left";
1171
- maxSide = mainAxis === "y" ? "bottom" : "right";
1172
- _min = mainAxisCoord + overflow[minSide];
1173
- _max = mainAxisCoord - overflow[maxSide];
1174
- mainAxisCoord = clamp(_min, mainAxisCoord, _max);
1105
+ while (1) switch (_context6.prev = _context6.next) {
1106
+ case 0:
1107
+ x = state.x, y = state.y, placement = state.placement;
1108
+ _evaluate3 = evaluate(options, state), _evaluate3$mainAxis = _evaluate3.mainAxis, checkMainAxis = _evaluate3$mainAxis === void 0 ? true : _evaluate3$mainAxis, _evaluate3$crossAxis = _evaluate3.crossAxis, checkCrossAxis = _evaluate3$crossAxis === void 0 ? false : _evaluate3$crossAxis, _evaluate3$limiter = _evaluate3.limiter, limiter = _evaluate3$limiter === void 0 ? {
1109
+ fn: function fn2(_ref) {
1110
+ var x2 = _ref.x, y2 = _ref.y;
1111
+ return {
1112
+ x: x2,
1113
+ y: y2
1114
+ };
1175
1115
  }
1176
- if (checkCrossAxis) {
1177
- _minSide = crossAxis === "y" ? "top" : "left";
1178
- _maxSide = crossAxis === "y" ? "bottom" : "right";
1179
- _min2 = crossAxisCoord + overflow[_minSide];
1180
- _max2 = crossAxisCoord - overflow[_maxSide];
1181
- crossAxisCoord = clamp(_min2, crossAxisCoord, _max2);
1116
+ } : _evaluate3$limiter, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate3, _excluded3);
1117
+ coords = {
1118
+ x,
1119
+ y
1120
+ };
1121
+ _context6.next = 5;
1122
+ return detectOverflow(state, detectOverflowOptions);
1123
+ case 5:
1124
+ overflow = _context6.sent;
1125
+ crossAxis = getSideAxis(getSide(placement));
1126
+ mainAxis = getOppositeAxis(crossAxis);
1127
+ mainAxisCoord = coords[mainAxis];
1128
+ crossAxisCoord = coords[crossAxis];
1129
+ if (checkMainAxis) {
1130
+ minSide = mainAxis === "y" ? "top" : "left";
1131
+ maxSide = mainAxis === "y" ? "bottom" : "right";
1132
+ _min = mainAxisCoord + overflow[minSide];
1133
+ _max = mainAxisCoord - overflow[maxSide];
1134
+ mainAxisCoord = clamp(_min, mainAxisCoord, _max);
1135
+ }
1136
+ if (checkCrossAxis) {
1137
+ _minSide = crossAxis === "y" ? "top" : "left";
1138
+ _maxSide = crossAxis === "y" ? "bottom" : "right";
1139
+ _min2 = crossAxisCoord + overflow[_minSide];
1140
+ _max2 = crossAxisCoord - overflow[_maxSide];
1141
+ crossAxisCoord = clamp(_min2, crossAxisCoord, _max2);
1142
+ }
1143
+ limitedCoords = limiter.fn(_extends({}, state, (_extends4 = {}, _extends4[mainAxis] = mainAxisCoord, _extends4[crossAxis] = crossAxisCoord, _extends4)));
1144
+ return _context6.abrupt("return", _extends({}, limitedCoords, {
1145
+ data: {
1146
+ x: limitedCoords.x - x,
1147
+ y: limitedCoords.y - y,
1148
+ enabled: (_enabled = {}, _enabled[mainAxis] = checkMainAxis, _enabled[crossAxis] = checkCrossAxis, _enabled)
1182
1149
  }
1183
- limitedCoords = limiter.fn(_extends({}, state, (_extends4 = {}, _extends4[mainAxis] = mainAxisCoord, _extends4[crossAxis] = crossAxisCoord, _extends4)));
1184
- return _context6.abrupt("return", _extends({}, limitedCoords, {
1185
- data: {
1186
- x: limitedCoords.x - x,
1187
- y: limitedCoords.y - y,
1188
- enabled: (_enabled = {}, _enabled[mainAxis] = checkMainAxis, _enabled[crossAxis] = checkCrossAxis, _enabled)
1189
- }
1190
- }));
1191
- case 14:
1192
- case "end":
1193
- return _context6.stop();
1194
- }
1150
+ }));
1151
+ case 14:
1152
+ case "end":
1153
+ return _context6.stop();
1154
+ }
1195
1155
  }, _callee6);
1196
1156
  }))();
1197
1157
  }
@@ -1309,7 +1269,9 @@ function isTopLayer(element) {
1309
1269
  function isContainingBlock(elementOrCss) {
1310
1270
  var webkit = isWebKit();
1311
1271
  var css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1312
- return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some(function(value) {
1272
+ return ["transform", "translate", "scale", "rotate", "perspective"].some(function(value) {
1273
+ return css[value] ? css[value] !== "none" : false;
1274
+ }) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some(function(value) {
1313
1275
  return (css.willChange || "").includes(value);
1314
1276
  }) || ["paint", "layout", "strict", "content"].some(function(value) {
1315
1277
  return (css.contain || "").includes(value);
@@ -1328,8 +1290,7 @@ function getContainingBlock(element) {
1328
1290
  return null;
1329
1291
  }
1330
1292
  function isWebKit() {
1331
- if (typeof CSS === "undefined" || !CSS.supports)
1332
- return false;
1293
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
1333
1294
  return CSS.supports("-webkit-backdrop-filter", "none");
1334
1295
  }
1335
1296
  function isLastTraversableNode(node) {
@@ -1782,37 +1743,36 @@ var getElementRects = /* @__PURE__ */ function() {
1782
1743
  var _ref6 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee7(data) {
1783
1744
  var getOffsetParentFn, getDimensionsFn, floatingDimensions;
1784
1745
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1785
- while (1)
1786
- switch (_context7.prev = _context7.next) {
1787
- case 0:
1788
- getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1789
- getDimensionsFn = this.getDimensions;
1790
- _context7.next = 4;
1791
- return getDimensionsFn(data.floating);
1792
- case 4:
1793
- floatingDimensions = _context7.sent;
1794
- _context7.t0 = getRectRelativeToOffsetParent;
1795
- _context7.t1 = data.reference;
1796
- _context7.next = 9;
1797
- return getOffsetParentFn(data.floating);
1798
- case 9:
1799
- _context7.t2 = _context7.sent;
1800
- _context7.t3 = data.strategy;
1801
- _context7.t4 = (0, _context7.t0)(_context7.t1, _context7.t2, _context7.t3);
1802
- _context7.t5 = {
1803
- x: 0,
1804
- y: 0,
1805
- width: floatingDimensions.width,
1806
- height: floatingDimensions.height
1807
- };
1808
- return _context7.abrupt("return", {
1809
- reference: _context7.t4,
1810
- floating: _context7.t5
1811
- });
1812
- case 14:
1813
- case "end":
1814
- return _context7.stop();
1815
- }
1746
+ while (1) switch (_context7.prev = _context7.next) {
1747
+ case 0:
1748
+ getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1749
+ getDimensionsFn = this.getDimensions;
1750
+ _context7.next = 4;
1751
+ return getDimensionsFn(data.floating);
1752
+ case 4:
1753
+ floatingDimensions = _context7.sent;
1754
+ _context7.t0 = getRectRelativeToOffsetParent;
1755
+ _context7.t1 = data.reference;
1756
+ _context7.next = 9;
1757
+ return getOffsetParentFn(data.floating);
1758
+ case 9:
1759
+ _context7.t2 = _context7.sent;
1760
+ _context7.t3 = data.strategy;
1761
+ _context7.t4 = (0, _context7.t0)(_context7.t1, _context7.t2, _context7.t3);
1762
+ _context7.t5 = {
1763
+ x: 0,
1764
+ y: 0,
1765
+ width: floatingDimensions.width,
1766
+ height: floatingDimensions.height
1767
+ };
1768
+ return _context7.abrupt("return", {
1769
+ reference: _context7.t4,
1770
+ floating: _context7.t5
1771
+ });
1772
+ case 14:
1773
+ case "end":
1774
+ return _context7.stop();
1775
+ }
1816
1776
  }, _callee7, this);
1817
1777
  }));
1818
1778
  return function getElementRects2(_x8) {
@@ -1834,6 +1794,9 @@ var platform = {
1834
1794
  isElement,
1835
1795
  isRTL
1836
1796
  };
1797
+ function rectsAreEqual(a, b) {
1798
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1799
+ }
1837
1800
  function observeMove(element, onMove) {
1838
1801
  var io = null;
1839
1802
  var timeoutId;
@@ -1852,7 +1815,8 @@ function observeMove(element, onMove) {
1852
1815
  threshold = 1;
1853
1816
  }
1854
1817
  cleanup();
1855
- var _element$getBoundingC = element.getBoundingClientRect(), left = _element$getBoundingC.left, top = _element$getBoundingC.top, width = _element$getBoundingC.width, height = _element$getBoundingC.height;
1818
+ var elementRectForRootMargin = element.getBoundingClientRect();
1819
+ var left = elementRectForRootMargin.left, top = elementRectForRootMargin.top, width = elementRectForRootMargin.width, height = elementRectForRootMargin.height;
1856
1820
  if (!skip) {
1857
1821
  onMove();
1858
1822
  }
@@ -1883,6 +1847,9 @@ function observeMove(element, onMove) {
1883
1847
  refresh(false, ratio);
1884
1848
  }
1885
1849
  }
1850
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1851
+ refresh();
1852
+ }
1886
1853
  isFirstUpdate = false;
1887
1854
  }
1888
1855
  try {
@@ -1939,7 +1906,7 @@ function autoUpdate(reference, floating, update, options) {
1939
1906
  }
1940
1907
  function frameLoop() {
1941
1908
  var nextRefRect = getBoundingClientRect(reference);
1942
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
1909
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1943
1910
  update();
1944
1911
  }
1945
1912
  prevRefRect = nextRefRect;
@@ -2009,18 +1976,15 @@ var oppositeSidesMap = {
2009
1976
  left: "right"
2010
1977
  };
2011
1978
  var toMs = function toMs2(s) {
2012
- if (s === "auto")
2013
- return 0;
1979
+ if (s === "auto") return 0;
2014
1980
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
2015
1981
  };
2016
1982
  var getTransitionInfo = function getTransitionInfo2(el) {
2017
1983
  var styles = window.getComputedStyle(el);
2018
1984
  var timeout = toMs(styles.transitionDelay) + toMs(styles.transitionDuration);
2019
- if (timeout)
2020
- return timeout;
1985
+ if (timeout) return timeout;
2021
1986
  timeout = toMs(styles.animationDelay) + toMs(styles.animationDuration);
2022
- if (timeout)
2023
- return timeout;
1987
+ if (timeout) return timeout;
2024
1988
  return 0;
2025
1989
  };
2026
1990
  var applyClass = function applyClass2(el, classes, force) {
@@ -2120,8 +2084,7 @@ var autoUpdatePopper = function autoUpdatePopper2(state) {
2120
2084
  });
2121
2085
  };
2122
2086
  var appendPopper = function appendPopper2(state) {
2123
- if (state._last.show && state._last.popper === state.popper)
2124
- return;
2087
+ if (state._last.show && state._last.popper === state.popper) return;
2125
2088
  if (state._last.popper && state._last.popper !== state.popper) {
2126
2089
  if (state._last.appendToBody) {
2127
2090
  state._last.popper.remove();
@@ -2160,8 +2123,7 @@ var appendPopper = function appendPopper2(state) {
2160
2123
  }
2161
2124
  };
2162
2125
  var closePopper = function closePopper2(state) {
2163
- if (!state._last.show)
2164
- return;
2126
+ if (!state._last.show) return;
2165
2127
  if (state.popper) {
2166
2128
  if (state.animate && state.animateName) {
2167
2129
  var leaveName = state.animateName + "-leave-to";