@warp-ds/elements 1.3.4-next.1 → 1.4.0-next.1

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.
package/dist/index.js CHANGED
@@ -9,18 +9,18 @@ var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
10
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
11
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a3, b3) => {
13
- for (var prop in b3 || (b3 = {}))
14
- if (__hasOwnProp.call(b3, prop))
15
- __defNormalProp(a3, prop, b3[prop]);
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
16
  if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b3)) {
18
- if (__propIsEnum.call(b3, prop))
19
- __defNormalProp(a3, prop, b3[prop]);
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
20
  }
21
- return a3;
21
+ return a;
22
22
  };
23
- var __spreadProps = (a3, b3) => __defProps(a3, __getOwnPropDescs(b3));
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
24
  var __objRest = (source, exclude) => {
25
25
  var target = {};
26
26
  for (var prop in source)
@@ -224,27 +224,27 @@ var require_moo = __commonJS({
224
224
  var hasOwnProperty = Object.prototype.hasOwnProperty;
225
225
  var toString = Object.prototype.toString;
226
226
  var hasSticky = typeof new RegExp().sticky === "boolean";
227
- function isRegExp(o3) {
228
- return o3 && toString.call(o3) === "[object RegExp]";
227
+ function isRegExp(o) {
228
+ return o && toString.call(o) === "[object RegExp]";
229
229
  }
230
- function isObject(o3) {
231
- return o3 && typeof o3 === "object" && !isRegExp(o3) && !Array.isArray(o3);
230
+ function isObject(o) {
231
+ return o && typeof o === "object" && !isRegExp(o) && !Array.isArray(o);
232
232
  }
233
- function reEscape(s3) {
234
- return s3.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
233
+ function reEscape(s) {
234
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
235
235
  }
236
- function reGroups(s3) {
237
- var re = new RegExp("|" + s3);
236
+ function reGroups(s) {
237
+ var re = new RegExp("|" + s);
238
238
  return re.exec("").length - 1;
239
239
  }
240
- function reCapture(s3) {
241
- return "(" + s3 + ")";
240
+ function reCapture(s) {
241
+ return "(" + s + ")";
242
242
  }
243
243
  function reUnion(regexps) {
244
244
  if (!regexps.length)
245
245
  return "(?!)";
246
- var source = regexps.map(function(s3) {
247
- return "(?:" + s3 + ")";
246
+ var source = regexps.map(function(s) {
247
+ return "(?:" + s + ")";
248
248
  }).join("|");
249
249
  return "(?:" + source + ")";
250
250
  }
@@ -265,11 +265,11 @@ var require_moo = __commonJS({
265
265
  throw new Error("Not a pattern: " + obj);
266
266
  }
267
267
  }
268
- function pad(s3, length) {
269
- if (s3.length > length) {
270
- return s3;
268
+ function pad(s, length) {
269
+ if (s.length > length) {
270
+ return s;
271
271
  }
272
- return Array(length - s3.length + 1).join(" ") + s3;
272
+ return Array(length - s.length + 1).join(" ") + s;
273
273
  }
274
274
  function lastNLines(string, numLines) {
275
275
  var position = string.length;
@@ -295,8 +295,8 @@ var require_moo = __commonJS({
295
295
  function objectToRules(object) {
296
296
  var keys2 = Object.getOwnPropertyNames(object);
297
297
  var result = [];
298
- for (var i3 = 0; i3 < keys2.length; i3++) {
299
- var key = keys2[i3];
298
+ for (var i = 0; i < keys2.length; i++) {
299
+ var key = keys2[i];
300
300
  var thing = object[key];
301
301
  var rules = [].concat(thing);
302
302
  if (key === "include") {
@@ -323,8 +323,8 @@ var require_moo = __commonJS({
323
323
  }
324
324
  function arrayToRules(array) {
325
325
  var result = [];
326
- for (var i3 = 0; i3 < array.length; i3++) {
327
- var obj = array[i3];
326
+ for (var i = 0; i < array.length; i++) {
327
+ var obj = array[i];
328
328
  if (obj.include) {
329
329
  var include = [].concat(obj.include);
330
330
  for (var j = 0; j < include.length; j++) {
@@ -368,8 +368,8 @@ var require_moo = __commonJS({
368
368
  }
369
369
  var match = options.match;
370
370
  options.match = Array.isArray(match) ? match : match ? [match] : [];
371
- options.match.sort(function(a3, b3) {
372
- return isRegExp(a3) && isRegExp(b3) ? 0 : isRegExp(b3) ? -1 : isRegExp(a3) ? 1 : b3.length - a3.length;
371
+ options.match.sort(function(a, b) {
372
+ return isRegExp(a) && isRegExp(b) ? 0 : isRegExp(b) ? -1 : isRegExp(a) ? 1 : b.length - a.length;
373
373
  });
374
374
  return options;
375
375
  }
@@ -384,13 +384,13 @@ var require_moo = __commonJS({
384
384
  var unicodeFlag = null;
385
385
  var groups = [];
386
386
  var parts = [];
387
- for (var i3 = 0; i3 < rules.length; i3++) {
388
- if (rules[i3].fallback) {
387
+ for (var i = 0; i < rules.length; i++) {
388
+ if (rules[i].fallback) {
389
389
  fastAllowed = false;
390
390
  }
391
391
  }
392
- for (var i3 = 0; i3 < rules.length; i3++) {
393
- var options = rules[i3];
392
+ for (var i = 0; i < rules.length; i++) {
393
+ var options = rules[i];
394
394
  if (options.include) {
395
395
  throw new Error("Inheritance is not allowed in stateless lexers");
396
396
  }
@@ -461,13 +461,13 @@ var require_moo = __commonJS({
461
461
  var result = compileRules(toRules(rules));
462
462
  return new Lexer({ start: result }, "start");
463
463
  }
464
- function checkStateGroup(g3, name, map) {
465
- var state = g3 && (g3.push || g3.next);
464
+ function checkStateGroup(g, name, map) {
465
+ var state = g && (g.push || g.next);
466
466
  if (state && !map[state]) {
467
- throw new Error("Missing state '" + state + "' (in token '" + g3.defaultType + "' of state '" + name + "')");
467
+ throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')");
468
468
  }
469
- if (g3 && g3.pop && +g3.pop !== 1) {
470
- throw new Error("pop must be 1 (in token '" + g3.defaultType + "' of state '" + name + "')");
469
+ if (g && g.pop && +g.pop !== 1) {
470
+ throw new Error("pop must be 1 (in token '" + g.defaultType + "' of state '" + name + "')");
471
471
  }
472
472
  }
473
473
  function compileStates(states, start) {
@@ -477,12 +477,12 @@ var require_moo = __commonJS({
477
477
  if (!start)
478
478
  start = keys2[0];
479
479
  var ruleMap = /* @__PURE__ */ Object.create(null);
480
- for (var i3 = 0; i3 < keys2.length; i3++) {
481
- var key = keys2[i3];
480
+ for (var i = 0; i < keys2.length; i++) {
481
+ var key = keys2[i];
482
482
  ruleMap[key] = toRules(states[key]).concat(all);
483
483
  }
484
- for (var i3 = 0; i3 < keys2.length; i3++) {
485
- var key = keys2[i3];
484
+ for (var i = 0; i < keys2.length; i++) {
485
+ var key = keys2[i];
486
486
  var rules = ruleMap[key];
487
487
  var included = /* @__PURE__ */ Object.create(null);
488
488
  for (var j = 0; j < rules.length; j++) {
@@ -496,8 +496,8 @@ var require_moo = __commonJS({
496
496
  if (!newRules) {
497
497
  throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')");
498
498
  }
499
- for (var k2 = 0; k2 < newRules.length; k2++) {
500
- var newRule = newRules[k2];
499
+ for (var k = 0; k < newRules.length; k++) {
500
+ var newRule = newRules[k];
501
501
  if (rules.indexOf(newRule) !== -1)
502
502
  continue;
503
503
  splice.push(newRule);
@@ -508,12 +508,12 @@ var require_moo = __commonJS({
508
508
  }
509
509
  }
510
510
  var map = /* @__PURE__ */ Object.create(null);
511
- for (var i3 = 0; i3 < keys2.length; i3++) {
512
- var key = keys2[i3];
511
+ for (var i = 0; i < keys2.length; i++) {
512
+ var key = keys2[i];
513
513
  map[key] = compileRules(ruleMap[key], true);
514
514
  }
515
- for (var i3 = 0; i3 < keys2.length; i3++) {
516
- var name = keys2[i3];
515
+ for (var i = 0; i < keys2.length; i++) {
516
+ var name = keys2[i];
517
517
  var state = map[name];
518
518
  var groups = state.groups;
519
519
  for (var j = 0; j < groups.length; j++) {
@@ -530,8 +530,8 @@ var require_moo = __commonJS({
530
530
  var isMap = typeof Map !== "undefined";
531
531
  var reverseMap = isMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
532
532
  var types = Object.getOwnPropertyNames(map);
533
- for (var i3 = 0; i3 < types.length; i3++) {
534
- var tokenType = types[i3];
533
+ for (var i = 0; i < types.length; i++) {
534
+ var tokenType = types[i];
535
535
  var item = map[tokenType];
536
536
  var keywordList = Array.isArray(item) ? item : [item];
537
537
  keywordList.forEach(function(keyword) {
@@ -545,8 +545,8 @@ var require_moo = __commonJS({
545
545
  }
546
546
  });
547
547
  }
548
- return function(k2) {
549
- return isMap ? reverseMap.get(k2) : reverseMap[k2];
548
+ return function(k) {
549
+ return isMap ? reverseMap.get(k) : reverseMap[k];
550
550
  };
551
551
  }
552
552
  var Lexer = function(states, state) {
@@ -607,9 +607,9 @@ var require_moo = __commonJS({
607
607
  };
608
608
  Lexer.prototype._getGroup = function(match) {
609
609
  var groupCount = this.groups.length;
610
- for (var i3 = 0; i3 < groupCount; i3++) {
611
- if (match[i3 + 1] !== void 0) {
612
- return this.groups[i3];
610
+ for (var i = 0; i < groupCount; i++) {
611
+ if (match[i + 1] !== void 0) {
612
+ return this.groups[i];
613
613
  }
614
614
  }
615
615
  throw new Error("Cannot find token type for matched text");
@@ -649,7 +649,7 @@ var require_moo = __commonJS({
649
649
  }
650
650
  return this._token(group, text, index);
651
651
  };
652
- Lexer.prototype._token = function(group, text, offset) {
652
+ Lexer.prototype._token = function(group, text, offset2) {
653
653
  var lineBreaks = 0;
654
654
  if (group.lineBreaks) {
655
655
  var matchNL = /\n/g;
@@ -668,18 +668,18 @@ var require_moo = __commonJS({
668
668
  value: typeof group.value === "function" ? group.value(text) : text,
669
669
  text,
670
670
  toString: tokenToString,
671
- offset,
671
+ offset: offset2,
672
672
  lineBreaks,
673
673
  line: this.line,
674
674
  col: this.col
675
675
  };
676
- var size = text.length;
677
- this.index += size;
676
+ var size2 = text.length;
677
+ this.index += size2;
678
678
  this.line += lineBreaks;
679
679
  if (lineBreaks !== 0) {
680
- this.col = size - nl + 1;
680
+ this.col = size2 - nl + 1;
681
681
  } else {
682
- this.col += size;
682
+ this.col += size2;
683
683
  }
684
684
  if (group.shouldThrow) {
685
685
  var err = new Error(this.formatError(token, "invalid syntax"));
@@ -730,9 +730,9 @@ var require_moo = __commonJS({
730
730
  var errorLines = [];
731
731
  errorLines.push(message + " at line " + token.line + " col " + token.col + ":");
732
732
  errorLines.push("");
733
- for (var i3 = 0; i3 < displayedLines.length; i3++) {
734
- var line = displayedLines[i3];
735
- var lineNo = firstDisplayedLine + i3;
733
+ for (var i = 0; i < displayedLines.length; i++) {
734
+ var line = displayedLines[i];
735
+ var lineNo = firstDisplayedLine + i;
736
736
  errorLines.push(pad(String(lineNo), lastLineDigits) + " " + line);
737
737
  if (lineNo === token.line) {
738
738
  errorLines.push(pad("", lastLineDigits + token.col + 1) + "^");
@@ -842,12 +842,12 @@ var require_parser = __commonJS({
842
842
  function strictArgStyleParam(lt, param) {
843
843
  let value = "";
844
844
  let text = "";
845
- for (const p3 of param) {
846
- const pText = p3.ctx.text;
845
+ for (const p of param) {
846
+ const pText = p.ctx.text;
847
847
  text += pText;
848
- switch (p3.type) {
848
+ switch (p.type) {
849
849
  case "content":
850
- value += p3.value;
850
+ value += p.value;
851
851
  break;
852
852
  case "argument":
853
853
  case "function":
@@ -858,12 +858,12 @@ var require_parser = __commonJS({
858
858
  throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);
859
859
  }
860
860
  }
861
- const c3 = {
861
+ const c = {
862
862
  type: "content",
863
863
  value: value.trim(),
864
864
  ctx: Object.assign({}, param[0].ctx, { text })
865
865
  };
866
- return [c3];
866
+ return [c];
867
867
  }
868
868
  var strictArgTypes = [
869
869
  "number",
@@ -1470,7 +1470,7 @@ function processTokens(tokens, mapText) {
1470
1470
  return [token.arg, token.key];
1471
1471
  }
1472
1472
  }
1473
- const offset = token.pluralOffset;
1473
+ const offset2 = token.pluralOffset;
1474
1474
  const formatProps = {};
1475
1475
  token.cases.forEach((item) => {
1476
1476
  formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
@@ -1482,16 +1482,16 @@ function processTokens(tokens, mapText) {
1482
1482
  token.arg,
1483
1483
  token.type,
1484
1484
  __spreadValues({
1485
- offset
1485
+ offset: offset2
1486
1486
  }, formatProps)
1487
1487
  ];
1488
1488
  });
1489
1489
  }
1490
- function compileMessage(message, mapText = (v3) => v3) {
1490
+ function compileMessage(message, mapText = (v) => v) {
1491
1491
  try {
1492
1492
  return processTokens((0, import_parser.parse)(message), mapText);
1493
- } catch (e2) {
1494
- console.error(`${e2.message}
1493
+ } catch (e) {
1494
+ console.error(`${e.message}
1495
1495
 
1496
1496
  Message: ${message}`);
1497
1497
  return message;
@@ -1499,8 +1499,8 @@ Message: ${message}`);
1499
1499
  }
1500
1500
 
1501
1501
  // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1502
- var isString = (s3) => typeof s3 === "string";
1503
- var isFunction = (f3) => typeof f3 === "function";
1502
+ var isString = (s) => typeof s === "string";
1503
+ var isFunction = (f) => typeof f === "function";
1504
1504
  var cache = /* @__PURE__ */ new Map();
1505
1505
  var defaultLocale = "en";
1506
1506
  function normalizeLocales(locales) {
@@ -1524,7 +1524,7 @@ function number(locales, value, format) {
1524
1524
  return formatter.format(value);
1525
1525
  }
1526
1526
  function plural(locales, ordinal, value, _a) {
1527
- var _b = _a, { offset = 0 } = _b, rules = __objRest(_b, ["offset"]);
1527
+ var _b = _a, { offset: offset2 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1528
1528
  var _a2, _b2;
1529
1529
  const _locales = normalizeLocales(locales);
1530
1530
  const plurals = ordinal ? getMemoized(
@@ -1534,7 +1534,7 @@ function plural(locales, ordinal, value, _a) {
1534
1534
  () => cacheKey("plural-cardinal", _locales),
1535
1535
  () => new Intl.PluralRules(_locales, { type: "cardinal" })
1536
1536
  );
1537
- return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset)]) != null ? _b2 : rules.other;
1537
+ return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset2)]) != null ? _b2 : rules.other;
1538
1538
  }
1539
1539
  function getMemoized(getKey, construct) {
1540
1540
  const key = getKey();
@@ -1563,14 +1563,14 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1563
1563
  };
1564
1564
  return {
1565
1565
  plural: (value, cases) => {
1566
- const { offset = 0 } = cases;
1566
+ const { offset: offset2 = 0 } = cases;
1567
1567
  const message = plural(locales, false, value, cases);
1568
- return replaceOctothorpe(value - offset, message);
1568
+ return replaceOctothorpe(value - offset2, message);
1569
1569
  },
1570
1570
  selectordinal: (value, cases) => {
1571
- const { offset = 0 } = cases;
1571
+ const { offset: offset2 = 0 } = cases;
1572
1572
  const message = plural(locales, true, value, cases);
1573
- return replaceOctothorpe(value - offset, message);
1573
+ return replaceOctothorpe(value - offset2, message);
1574
1574
  },
1575
1575
  select: selectFormatter,
1576
1576
  number: (value, format) => number(locales, value, style(format)),
@@ -1867,8 +1867,8 @@ function detectLocale() {
1867
1867
  return getSupportedLocale(hostLocale);
1868
1868
  }
1869
1869
  return getSupportedLocale(htmlLocale != null ? htmlLocale : hostLocale);
1870
- } catch (e2) {
1871
- console.warn("could not detect locale, falling back to source locale", e2);
1870
+ } catch (e) {
1871
+ console.warn("could not detect locale, falling back to source locale", e);
1872
1872
  return defaultLocale2;
1873
1873
  }
1874
1874
  }
@@ -1958,8 +1958,8 @@ function detectLocale2() {
1958
1958
  return getSupportedLocale2(hostLocale);
1959
1959
  }
1960
1960
  return getSupportedLocale2(htmlLocale != null ? htmlLocale : hostLocale);
1961
- } catch (e2) {
1962
- console.warn("could not detect locale, falling back to source locale", e2);
1961
+ } catch (e) {
1962
+ console.warn("could not detect locale, falling back to source locale", e);
1963
1963
  return defaultLocale3;
1964
1964
  }
1965
1965
  }
@@ -2087,11 +2087,11 @@ import { css, html as html8 } from "lit";
2087
2087
 
2088
2088
  // node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
2089
2089
  var r = function() {
2090
- for (var t2 = [], n3 = arguments.length; n3--; )
2091
- t2[n3] = arguments[n3];
2092
- return t2.reduce(function(t3, n4) {
2093
- return t3.concat("string" == typeof n4 ? n4 : Array.isArray(n4) ? r.apply(void 0, n4) : "object" == typeof n4 && n4 ? Object.keys(n4).map(function(r4) {
2094
- return n4[r4] ? r4 : "";
2090
+ for (var t = [], n = arguments.length; n--; )
2091
+ t[n] = arguments[n];
2092
+ return t.reduce(function(t2, n2) {
2093
+ return t2.concat("string" == typeof n2 ? n2 : Array.isArray(n2) ? r.apply(void 0, n2) : "object" == typeof n2 && n2 ? Object.keys(n2).map(function(r2) {
2094
+ return n2[r2] ? r2 : "";
2095
2095
  }) : "");
2096
2096
  }, []).join(" ");
2097
2097
  };
@@ -2158,8 +2158,8 @@ function detectLocale3() {
2158
2158
  return getSupportedLocale3(hostLocale);
2159
2159
  }
2160
2160
  return getSupportedLocale3(htmlLocale != null ? htmlLocale : hostLocale);
2161
- } catch (e2) {
2162
- console.warn("could not detect locale, falling back to source locale", e2);
2161
+ } catch (e) {
2162
+ console.warn("could not detect locale, falling back to source locale", e);
2163
2163
  return defaultLocale4;
2164
2164
  }
2165
2165
  }
@@ -2249,8 +2249,8 @@ function detectLocale4() {
2249
2249
  return getSupportedLocale4(hostLocale);
2250
2250
  }
2251
2251
  return getSupportedLocale4(htmlLocale != null ? htmlLocale : hostLocale);
2252
- } catch (e2) {
2253
- console.warn("could not detect locale, falling back to source locale", e2);
2252
+ } catch (e) {
2253
+ console.warn("could not detect locale, falling back to source locale", e);
2254
2254
  return defaultLocale5;
2255
2255
  }
2256
2256
  }
@@ -2340,8 +2340,8 @@ function detectLocale5() {
2340
2340
  return getSupportedLocale5(hostLocale);
2341
2341
  }
2342
2342
  return getSupportedLocale5(htmlLocale != null ? htmlLocale : hostLocale);
2343
- } catch (e2) {
2344
- console.warn("could not detect locale, falling back to source locale", e2);
2343
+ } catch (e) {
2344
+ console.warn("could not detect locale, falling back to source locale", e);
2345
2345
  return defaultLocale6;
2346
2346
  }
2347
2347
  }
@@ -2431,8 +2431,8 @@ function detectLocale6() {
2431
2431
  return getSupportedLocale6(hostLocale);
2432
2432
  }
2433
2433
  return getSupportedLocale6(htmlLocale != null ? htmlLocale : hostLocale);
2434
- } catch (e2) {
2435
- console.warn("could not detect locale, falling back to source locale", e2);
2434
+ } catch (e) {
2435
+ console.warn("could not detect locale, falling back to source locale", e);
2436
2436
  return defaultLocale7;
2437
2437
  }
2438
2438
  }
@@ -2552,417 +2552,1401 @@ import { css as css2, html as html9, nothing } from "lit";
2552
2552
  import WarpElement3 from "@warp-ds/elements-core";
2553
2553
  import { ifDefined as ifDefined2 } from "lit/directives/if-defined.js";
2554
2554
 
2555
- // node_modules/.pnpm/@floating-ui+core@0.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
2556
- function t(t2) {
2557
- return t2.split("-")[0];
2555
+ // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2556
+ var sides = ["top", "right", "bottom", "left"];
2557
+ var alignments = ["start", "end"];
2558
+ var placements = /* @__PURE__ */ sides.reduce((acc, side2) => acc.concat(side2, side2 + "-" + alignments[0], side2 + "-" + alignments[1]), []);
2559
+ var min = Math.min;
2560
+ var max = Math.max;
2561
+ var round = Math.round;
2562
+ var createCoords = (v) => ({
2563
+ x: v,
2564
+ y: v
2565
+ });
2566
+ var oppositeSideMap = {
2567
+ left: "right",
2568
+ right: "left",
2569
+ bottom: "top",
2570
+ top: "bottom"
2571
+ };
2572
+ var oppositeAlignmentMap = {
2573
+ start: "end",
2574
+ end: "start"
2575
+ };
2576
+ function clamp(start, value, end) {
2577
+ return max(start, min(value, end));
2578
+ }
2579
+ function evaluate(value, param) {
2580
+ return typeof value === "function" ? value(param) : value;
2581
+ }
2582
+ function getSide(placement) {
2583
+ return placement.split("-")[0];
2584
+ }
2585
+ function getAlignment(placement) {
2586
+ return placement.split("-")[1];
2587
+ }
2588
+ function getOppositeAxis(axis) {
2589
+ return axis === "x" ? "y" : "x";
2590
+ }
2591
+ function getAxisLength(axis) {
2592
+ return axis === "y" ? "height" : "width";
2558
2593
  }
2559
- function e(t2) {
2560
- return t2.split("-")[1];
2594
+ function getSideAxis(placement) {
2595
+ return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
2561
2596
  }
2562
- function n(e2) {
2563
- return ["top", "bottom"].includes(t(e2)) ? "x" : "y";
2597
+ function getAlignmentAxis(placement) {
2598
+ return getOppositeAxis(getSideAxis(placement));
2564
2599
  }
2565
- function r2(t2) {
2566
- return "y" === t2 ? "height" : "width";
2600
+ function getAlignmentSides(placement, rects, rtl) {
2601
+ if (rtl === void 0) {
2602
+ rtl = false;
2603
+ }
2604
+ const alignment = getAlignment(placement);
2605
+ const alignmentAxis = getAlignmentAxis(placement);
2606
+ const length = getAxisLength(alignmentAxis);
2607
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
2608
+ if (rects.reference[length] > rects.floating[length]) {
2609
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
2610
+ }
2611
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
2567
2612
  }
2568
- function i(i3, o3, a3) {
2569
- let { reference: l3, floating: s3 } = i3;
2570
- const c3 = l3.x + l3.width / 2 - s3.width / 2, f3 = l3.y + l3.height / 2 - s3.height / 2, u3 = n(o3), m3 = r2(u3), g3 = l3[m3] / 2 - s3[m3] / 2, d3 = "x" === u3;
2571
- let p3;
2572
- switch (t(o3)) {
2613
+ function getExpandedPlacements(placement) {
2614
+ const oppositePlacement = getOppositePlacement(placement);
2615
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
2616
+ }
2617
+ function getOppositeAlignmentPlacement(placement) {
2618
+ return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
2619
+ }
2620
+ function getSideList(side2, isStart, rtl) {
2621
+ const lr = ["left", "right"];
2622
+ const rl = ["right", "left"];
2623
+ const tb = ["top", "bottom"];
2624
+ const bt = ["bottom", "top"];
2625
+ switch (side2) {
2573
2626
  case "top":
2574
- p3 = { x: c3, y: l3.y - s3.height };
2627
+ case "bottom":
2628
+ if (rtl)
2629
+ return isStart ? rl : lr;
2630
+ return isStart ? lr : rl;
2631
+ case "left":
2632
+ case "right":
2633
+ return isStart ? tb : bt;
2634
+ default:
2635
+ return [];
2636
+ }
2637
+ }
2638
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
2639
+ const alignment = getAlignment(placement);
2640
+ let list = getSideList(getSide(placement), direction === "start", rtl);
2641
+ if (alignment) {
2642
+ list = list.map((side2) => side2 + "-" + alignment);
2643
+ if (flipAlignment) {
2644
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
2645
+ }
2646
+ }
2647
+ return list;
2648
+ }
2649
+ function getOppositePlacement(placement) {
2650
+ return placement.replace(/left|right|bottom|top/g, (side2) => oppositeSideMap[side2]);
2651
+ }
2652
+ function expandPaddingObject(padding) {
2653
+ return __spreadValues({
2654
+ top: 0,
2655
+ right: 0,
2656
+ bottom: 0,
2657
+ left: 0
2658
+ }, padding);
2659
+ }
2660
+ function getPaddingObject(padding) {
2661
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
2662
+ top: padding,
2663
+ right: padding,
2664
+ bottom: padding,
2665
+ left: padding
2666
+ };
2667
+ }
2668
+ function rectToClientRect(rect) {
2669
+ return __spreadProps(__spreadValues({}, rect), {
2670
+ top: rect.y,
2671
+ left: rect.x,
2672
+ right: rect.x + rect.width,
2673
+ bottom: rect.y + rect.height
2674
+ });
2675
+ }
2676
+
2677
+ // node_modules/.pnpm/@floating-ui+core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
2678
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
2679
+ let {
2680
+ reference,
2681
+ floating
2682
+ } = _ref;
2683
+ const sideAxis = getSideAxis(placement);
2684
+ const alignmentAxis = getAlignmentAxis(placement);
2685
+ const alignLength = getAxisLength(alignmentAxis);
2686
+ const side2 = getSide(placement);
2687
+ const isVertical = sideAxis === "y";
2688
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
2689
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
2690
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
2691
+ let coords;
2692
+ switch (side2) {
2693
+ case "top":
2694
+ coords = {
2695
+ x: commonX,
2696
+ y: reference.y - floating.height
2697
+ };
2575
2698
  break;
2576
2699
  case "bottom":
2577
- p3 = { x: c3, y: l3.y + l3.height };
2700
+ coords = {
2701
+ x: commonX,
2702
+ y: reference.y + reference.height
2703
+ };
2578
2704
  break;
2579
2705
  case "right":
2580
- p3 = { x: l3.x + l3.width, y: f3 };
2706
+ coords = {
2707
+ x: reference.x + reference.width,
2708
+ y: commonY
2709
+ };
2581
2710
  break;
2582
2711
  case "left":
2583
- p3 = { x: l3.x - s3.width, y: f3 };
2712
+ coords = {
2713
+ x: reference.x - floating.width,
2714
+ y: commonY
2715
+ };
2584
2716
  break;
2585
2717
  default:
2586
- p3 = { x: l3.x, y: l3.y };
2718
+ coords = {
2719
+ x: reference.x,
2720
+ y: reference.y
2721
+ };
2587
2722
  }
2588
- switch (e(o3)) {
2723
+ switch (getAlignment(placement)) {
2589
2724
  case "start":
2590
- p3[u3] -= g3 * (a3 && d3 ? -1 : 1);
2725
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
2591
2726
  break;
2592
2727
  case "end":
2593
- p3[u3] += g3 * (a3 && d3 ? -1 : 1);
2728
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
2729
+ break;
2594
2730
  }
2595
- return p3;
2596
- }
2597
- var o = async (t2, e2, n3) => {
2598
- const { placement: r4 = "bottom", strategy: o3 = "absolute", middleware: a3 = [], platform: l3 } = n3, s3 = await (null == l3.isRTL ? void 0 : l3.isRTL(e2));
2599
- let c3 = await l3.getElementRects({ reference: t2, floating: e2, strategy: o3 }), { x: f3, y: u3 } = i(c3, r4, s3), m3 = r4, g3 = {}, d3 = 0;
2600
- for (let n4 = 0; n4 < a3.length; n4++) {
2601
- const { name: p3, fn: h3 } = a3[n4], { x: y3, y: x3, data: w3, reset: v3 } = await h3({ x: f3, y: u3, initialPlacement: r4, placement: m3, strategy: o3, middlewareData: g3, rects: c3, platform: l3, elements: { reference: t2, floating: e2 } });
2602
- f3 = null != y3 ? y3 : f3, u3 = null != x3 ? x3 : u3, g3 = __spreadProps(__spreadValues({}, g3), { [p3]: __spreadValues(__spreadValues({}, g3[p3]), w3) }), v3 && d3 <= 50 && (d3++, "object" == typeof v3 && (v3.placement && (m3 = v3.placement), v3.rects && (c3 = true === v3.rects ? await l3.getElementRects({ reference: t2, floating: e2, strategy: o3 }) : v3.rects), { x: f3, y: u3 } = i(c3, m3, s3)), n4 = -1);
2603
- }
2604
- return { x: f3, y: u3, placement: m3, strategy: o3, middlewareData: g3 };
2605
- };
2606
- function a(t2) {
2607
- return "number" != typeof t2 ? function(t3) {
2608
- return __spreadValues({ top: 0, right: 0, bottom: 0, left: 0 }, t3);
2609
- }(t2) : { top: t2, right: t2, bottom: t2, left: t2 };
2610
- }
2611
- function l(t2) {
2612
- return __spreadProps(__spreadValues({}, t2), { top: t2.y, left: t2.x, right: t2.x + t2.width, bottom: t2.y + t2.height });
2731
+ return coords;
2613
2732
  }
2614
- async function s(t2, e2) {
2615
- var n3;
2616
- void 0 === e2 && (e2 = {});
2617
- const { x: r4, y: i3, platform: o3, rects: s3, elements: c3, strategy: f3 } = t2, { boundary: u3 = "clippingAncestors", rootBoundary: m3 = "viewport", elementContext: g3 = "floating", altBoundary: d3 = false, padding: p3 = 0 } = e2, h3 = a(p3), y3 = c3[d3 ? "floating" === g3 ? "reference" : "floating" : g3], x3 = l(await o3.getClippingRect({ element: null == (n3 = await (null == o3.isElement ? void 0 : o3.isElement(y3))) || n3 ? y3 : y3.contextElement || await (null == o3.getDocumentElement ? void 0 : o3.getDocumentElement(c3.floating)), boundary: u3, rootBoundary: m3, strategy: f3 })), w3 = l(o3.convertOffsetParentRelativeRectToViewportRelativeRect ? await o3.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: "floating" === g3 ? __spreadProps(__spreadValues({}, s3.floating), { x: r4, y: i3 }) : s3.reference, offsetParent: await (null == o3.getOffsetParent ? void 0 : o3.getOffsetParent(c3.floating)), strategy: f3 }) : s3[g3]);
2618
- return { top: x3.top - w3.top + h3.top, bottom: w3.bottom - x3.bottom + h3.bottom, left: x3.left - w3.left + h3.left, right: w3.right - x3.right + h3.right };
2619
- }
2620
- var c = Math.min;
2621
- var f = Math.max;
2622
- function u(t2, e2, n3) {
2623
- return f(t2, c(e2, n3));
2624
- }
2625
- var m = (t2) => ({ name: "arrow", options: t2, async fn(i3) {
2626
- const { element: o3, padding: l3 = 0 } = null != t2 ? t2 : {}, { x: s3, y: c3, placement: f3, rects: m3, platform: g3 } = i3;
2627
- if (null == o3)
2628
- return {};
2629
- const d3 = a(l3), p3 = { x: s3, y: c3 }, h3 = n(f3), y3 = e(f3), x3 = r2(h3), w3 = await g3.getDimensions(o3), v3 = "y" === h3 ? "top" : "left", b3 = "y" === h3 ? "bottom" : "right", R2 = m3.reference[x3] + m3.reference[h3] - p3[h3] - m3.floating[x3], A = p3[h3] - m3.reference[h3], P2 = await (null == g3.getOffsetParent ? void 0 : g3.getOffsetParent(o3));
2630
- let T3 = P2 ? "y" === h3 ? P2.clientHeight || 0 : P2.clientWidth || 0 : 0;
2631
- 0 === T3 && (T3 = m3.floating[x3]);
2632
- const O2 = R2 / 2 - A / 2, D3 = d3[v3], L3 = T3 - w3[x3] - d3[b3], k2 = T3 / 2 - w3[x3] / 2 + O2, E3 = u(D3, k2, L3), C2 = ("start" === y3 ? d3[v3] : d3[b3]) > 0 && k2 !== E3 && m3.reference[x3] <= m3.floating[x3];
2633
- return { [h3]: p3[h3] - (C2 ? k2 < D3 ? D3 - k2 : L3 - k2 : 0), data: { [h3]: E3, centerOffset: k2 - E3 } };
2634
- } });
2635
- var g = { left: "right", right: "left", bottom: "top", top: "bottom" };
2636
- function d(t2) {
2637
- return t2.replace(/left|right|bottom|top/g, (t3) => g[t3]);
2638
- }
2639
- function p(t2, i3, o3) {
2640
- void 0 === o3 && (o3 = false);
2641
- const a3 = e(t2), l3 = n(t2), s3 = r2(l3);
2642
- let c3 = "x" === l3 ? a3 === (o3 ? "end" : "start") ? "right" : "left" : "start" === a3 ? "bottom" : "top";
2643
- return i3.reference[s3] > i3.floating[s3] && (c3 = d(c3)), { main: c3, cross: d(c3) };
2733
+ var computePosition = async (reference, floating, config) => {
2734
+ const {
2735
+ placement = "bottom",
2736
+ strategy = "absolute",
2737
+ middleware = [],
2738
+ platform: platform2
2739
+ } = config;
2740
+ const validMiddleware = middleware.filter(Boolean);
2741
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
2742
+ let rects = await platform2.getElementRects({
2743
+ reference,
2744
+ floating,
2745
+ strategy
2746
+ });
2747
+ let {
2748
+ x,
2749
+ y
2750
+ } = computeCoordsFromPlacement(rects, placement, rtl);
2751
+ let statefulPlacement = placement;
2752
+ let middlewareData = {};
2753
+ let resetCount = 0;
2754
+ for (let i = 0; i < validMiddleware.length; i++) {
2755
+ const {
2756
+ name,
2757
+ fn
2758
+ } = validMiddleware[i];
2759
+ const {
2760
+ x: nextX,
2761
+ y: nextY,
2762
+ data,
2763
+ reset
2764
+ } = await fn({
2765
+ x,
2766
+ y,
2767
+ initialPlacement: placement,
2768
+ placement: statefulPlacement,
2769
+ strategy,
2770
+ middlewareData,
2771
+ rects,
2772
+ platform: platform2,
2773
+ elements: {
2774
+ reference,
2775
+ floating
2776
+ }
2777
+ });
2778
+ x = nextX != null ? nextX : x;
2779
+ y = nextY != null ? nextY : y;
2780
+ middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
2781
+ [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
2782
+ });
2783
+ if (reset && resetCount <= 50) {
2784
+ resetCount++;
2785
+ if (typeof reset === "object") {
2786
+ if (reset.placement) {
2787
+ statefulPlacement = reset.placement;
2788
+ }
2789
+ if (reset.rects) {
2790
+ rects = reset.rects === true ? await platform2.getElementRects({
2791
+ reference,
2792
+ floating,
2793
+ strategy
2794
+ }) : reset.rects;
2795
+ }
2796
+ ({
2797
+ x,
2798
+ y
2799
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
2800
+ }
2801
+ i = -1;
2802
+ }
2803
+ }
2804
+ return {
2805
+ x,
2806
+ y,
2807
+ placement: statefulPlacement,
2808
+ strategy,
2809
+ middlewareData
2810
+ };
2811
+ };
2812
+ async function detectOverflow(state, options) {
2813
+ var _await$platform$isEle;
2814
+ if (options === void 0) {
2815
+ options = {};
2816
+ }
2817
+ const {
2818
+ x,
2819
+ y,
2820
+ platform: platform2,
2821
+ rects,
2822
+ elements,
2823
+ strategy
2824
+ } = state;
2825
+ const {
2826
+ boundary = "clippingAncestors",
2827
+ rootBoundary = "viewport",
2828
+ elementContext = "floating",
2829
+ altBoundary = false,
2830
+ padding = 0
2831
+ } = evaluate(options, state);
2832
+ const paddingObject = getPaddingObject(padding);
2833
+ const altContext = elementContext === "floating" ? "reference" : "floating";
2834
+ const element = elements[altBoundary ? altContext : elementContext];
2835
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
2836
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
2837
+ boundary,
2838
+ rootBoundary,
2839
+ strategy
2840
+ }));
2841
+ const rect = elementContext === "floating" ? __spreadProps(__spreadValues({}, rects.floating), {
2842
+ x,
2843
+ y
2844
+ }) : rects.reference;
2845
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
2846
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
2847
+ x: 1,
2848
+ y: 1
2849
+ } : {
2850
+ x: 1,
2851
+ y: 1
2852
+ };
2853
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
2854
+ elements,
2855
+ rect,
2856
+ offsetParent,
2857
+ strategy
2858
+ }) : rect);
2859
+ return {
2860
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
2861
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
2862
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
2863
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
2864
+ };
2644
2865
  }
2645
- var h = { start: "end", end: "start" };
2646
- function y(t2) {
2647
- return t2.replace(/start|end/g, (t3) => h[t3]);
2866
+ var arrow = (options) => ({
2867
+ name: "arrow",
2868
+ options,
2869
+ async fn(state) {
2870
+ const {
2871
+ x,
2872
+ y,
2873
+ placement,
2874
+ rects,
2875
+ platform: platform2,
2876
+ elements,
2877
+ middlewareData
2878
+ } = state;
2879
+ const {
2880
+ element,
2881
+ padding = 0
2882
+ } = evaluate(options, state) || {};
2883
+ if (element == null) {
2884
+ return {};
2885
+ }
2886
+ const paddingObject = getPaddingObject(padding);
2887
+ const coords = {
2888
+ x,
2889
+ y
2890
+ };
2891
+ const axis = getAlignmentAxis(placement);
2892
+ const length = getAxisLength(axis);
2893
+ const arrowDimensions = await platform2.getDimensions(element);
2894
+ const isYAxis = axis === "y";
2895
+ const minProp = isYAxis ? "top" : "left";
2896
+ const maxProp = isYAxis ? "bottom" : "right";
2897
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
2898
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
2899
+ const startDiff = coords[axis] - rects.reference[axis];
2900
+ const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
2901
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
2902
+ if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
2903
+ clientSize = elements.floating[clientProp] || rects.floating[length];
2904
+ }
2905
+ const centerToReference = endDiff / 2 - startDiff / 2;
2906
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
2907
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
2908
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
2909
+ const min$1 = minPadding;
2910
+ const max2 = clientSize - arrowDimensions[length] - maxPadding;
2911
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
2912
+ const offset2 = clamp(min$1, center, max2);
2913
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
2914
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
2915
+ return {
2916
+ [axis]: coords[axis] + alignmentOffset,
2917
+ data: __spreadValues({
2918
+ [axis]: offset2,
2919
+ centerOffset: center - offset2 - alignmentOffset
2920
+ }, shouldAddOffset && {
2921
+ alignmentOffset
2922
+ }),
2923
+ reset: shouldAddOffset
2924
+ };
2925
+ }
2926
+ });
2927
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
2928
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement);
2929
+ return allowedPlacementsSortedByAlignment.filter((placement) => {
2930
+ if (alignment) {
2931
+ return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
2932
+ }
2933
+ return true;
2934
+ });
2648
2935
  }
2649
- var x = ["top", "right", "bottom", "left"];
2650
- var w = x.reduce((t2, e2) => t2.concat(e2, e2 + "-start", e2 + "-end"), []);
2651
- var b = function(e2) {
2652
- return void 0 === e2 && (e2 = {}), { name: "flip", options: e2, async fn(n3) {
2653
- var r4;
2654
- const { placement: i3, middlewareData: o3, rects: a3, initialPlacement: l3, platform: c3, elements: f3 } = n3, _a = e2, { mainAxis: u3 = true, crossAxis: m3 = true, fallbackPlacements: g3, fallbackStrategy: h3 = "bestFit", flipAlignment: x3 = true } = _a, w3 = __objRest(_a, ["mainAxis", "crossAxis", "fallbackPlacements", "fallbackStrategy", "flipAlignment"]), v3 = t(i3), b3 = g3 || (v3 === l3 || !x3 ? [d(l3)] : function(t2) {
2655
- const e3 = d(t2);
2656
- return [y(t2), e3, y(e3)];
2657
- }(l3)), R2 = [l3, ...b3], A = await s(n3, w3), P2 = [];
2658
- let T3 = (null == (r4 = o3.flip) ? void 0 : r4.overflows) || [];
2659
- if (u3 && P2.push(A[v3]), m3) {
2660
- const { main: t2, cross: e3 } = p(i3, a3, await (null == c3.isRTL ? void 0 : c3.isRTL(f3.floating)));
2661
- P2.push(A[t2], A[e3]);
2936
+ var autoPlacement = function(options) {
2937
+ if (options === void 0) {
2938
+ options = {};
2939
+ }
2940
+ return {
2941
+ name: "autoPlacement",
2942
+ options,
2943
+ async fn(state) {
2944
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
2945
+ const {
2946
+ rects,
2947
+ middlewareData,
2948
+ placement,
2949
+ platform: platform2,
2950
+ elements
2951
+ } = state;
2952
+ const _a = evaluate(options, state), {
2953
+ crossAxis = false,
2954
+ alignment,
2955
+ allowedPlacements = placements,
2956
+ autoAlignment = true
2957
+ } = _a, detectOverflowOptions = __objRest(_a, [
2958
+ "crossAxis",
2959
+ "alignment",
2960
+ "allowedPlacements",
2961
+ "autoAlignment"
2962
+ ]);
2963
+ const placements$1 = alignment !== void 0 || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
2964
+ const overflow = await detectOverflow(state, detectOverflowOptions);
2965
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
2966
+ const currentPlacement = placements$1[currentIndex];
2967
+ if (currentPlacement == null) {
2968
+ return {};
2969
+ }
2970
+ const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)));
2971
+ if (placement !== currentPlacement) {
2972
+ return {
2973
+ reset: {
2974
+ placement: placements$1[0]
2975
+ }
2976
+ };
2977
+ }
2978
+ const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
2979
+ const allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
2980
+ placement: currentPlacement,
2981
+ overflows: currentOverflows
2982
+ }];
2983
+ const nextPlacement = placements$1[currentIndex + 1];
2984
+ if (nextPlacement) {
2985
+ return {
2986
+ data: {
2987
+ index: currentIndex + 1,
2988
+ overflows: allOverflows
2989
+ },
2990
+ reset: {
2991
+ placement: nextPlacement
2992
+ }
2993
+ };
2994
+ }
2995
+ const placementsSortedByMostSpace = allOverflows.map((d) => {
2996
+ const alignment2 = getAlignment(d.placement);
2997
+ return [d.placement, alignment2 && crossAxis ? (
2998
+ // Check along the mainAxis and main crossAxis side.
2999
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
3000
+ ) : (
3001
+ // Check only the mainAxis.
3002
+ d.overflows[0]
3003
+ ), d.overflows];
3004
+ }).sort((a, b) => a[1] - b[1]);
3005
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter((d) => d[2].slice(
3006
+ 0,
3007
+ // Aligned placements should not check their opposite crossAxis
3008
+ // side.
3009
+ getAlignment(d[0]) ? 2 : 3
3010
+ ).every((v) => v <= 0));
3011
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
3012
+ if (resetPlacement !== placement) {
3013
+ return {
3014
+ data: {
3015
+ index: currentIndex + 1,
3016
+ overflows: allOverflows
3017
+ },
3018
+ reset: {
3019
+ placement: resetPlacement
3020
+ }
3021
+ };
3022
+ }
3023
+ return {};
2662
3024
  }
2663
- if (T3 = [...T3, { placement: i3, overflows: P2 }], !P2.every((t2) => t2 <= 0)) {
2664
- var O2, D3;
2665
- const t2 = (null != (O2 = null == (D3 = o3.flip) ? void 0 : D3.index) ? O2 : 0) + 1, e3 = R2[t2];
2666
- if (e3)
2667
- return { data: { index: t2, overflows: T3 }, reset: { placement: e3 } };
2668
- let n4 = "bottom";
2669
- switch (h3) {
2670
- case "bestFit": {
2671
- var L3;
2672
- const t3 = null == (L3 = T3.map((t4) => [t4, t4.overflows.filter((t5) => t5 > 0).reduce((t5, e4) => t5 + e4, 0)]).sort((t4, e4) => t4[1] - e4[1])[0]) ? void 0 : L3[0].placement;
2673
- t3 && (n4 = t3);
2674
- break;
3025
+ };
3026
+ };
3027
+ var flip = function(options) {
3028
+ if (options === void 0) {
3029
+ options = {};
3030
+ }
3031
+ return {
3032
+ name: "flip",
3033
+ options,
3034
+ async fn(state) {
3035
+ var _middlewareData$arrow, _middlewareData$flip;
3036
+ const {
3037
+ placement,
3038
+ middlewareData,
3039
+ rects,
3040
+ initialPlacement,
3041
+ platform: platform2,
3042
+ elements
3043
+ } = state;
3044
+ const _a = evaluate(options, state), {
3045
+ mainAxis: checkMainAxis = true,
3046
+ crossAxis: checkCrossAxis = true,
3047
+ fallbackPlacements: specifiedFallbackPlacements,
3048
+ fallbackStrategy = "bestFit",
3049
+ fallbackAxisSideDirection = "none",
3050
+ flipAlignment = true
3051
+ } = _a, detectOverflowOptions = __objRest(_a, [
3052
+ "mainAxis",
3053
+ "crossAxis",
3054
+ "fallbackPlacements",
3055
+ "fallbackStrategy",
3056
+ "fallbackAxisSideDirection",
3057
+ "flipAlignment"
3058
+ ]);
3059
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3060
+ return {};
3061
+ }
3062
+ const side2 = getSide(placement);
3063
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
3064
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3065
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
3066
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
3067
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
3068
+ }
3069
+ const placements2 = [initialPlacement, ...fallbackPlacements];
3070
+ const overflow = await detectOverflow(state, detectOverflowOptions);
3071
+ const overflows = [];
3072
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
3073
+ if (checkMainAxis) {
3074
+ overflows.push(overflow[side2]);
3075
+ }
3076
+ if (checkCrossAxis) {
3077
+ const sides2 = getAlignmentSides(placement, rects, rtl);
3078
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
3079
+ }
3080
+ overflowsData = [...overflowsData, {
3081
+ placement,
3082
+ overflows
3083
+ }];
3084
+ if (!overflows.every((side3) => side3 <= 0)) {
3085
+ var _middlewareData$flip2, _overflowsData$filter;
3086
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
3087
+ const nextPlacement = placements2[nextIndex];
3088
+ if (nextPlacement) {
3089
+ return {
3090
+ data: {
3091
+ index: nextIndex,
3092
+ overflows: overflowsData
3093
+ },
3094
+ reset: {
3095
+ placement: nextPlacement
3096
+ }
3097
+ };
3098
+ }
3099
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
3100
+ if (!resetPlacement) {
3101
+ switch (fallbackStrategy) {
3102
+ case "bestFit": {
3103
+ var _overflowsData$map$so;
3104
+ const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
3105
+ if (placement2) {
3106
+ resetPlacement = placement2;
3107
+ }
3108
+ break;
3109
+ }
3110
+ case "initialPlacement":
3111
+ resetPlacement = initialPlacement;
3112
+ break;
3113
+ }
3114
+ }
3115
+ if (placement !== resetPlacement) {
3116
+ return {
3117
+ reset: {
3118
+ placement: resetPlacement
3119
+ }
3120
+ };
2675
3121
  }
2676
- case "initialPlacement":
2677
- n4 = l3;
2678
3122
  }
2679
- if (i3 !== n4)
2680
- return { reset: { placement: n4 } };
3123
+ return {};
2681
3124
  }
2682
- return {};
2683
- } };
2684
- };
2685
- var T = function(r4) {
2686
- return void 0 === r4 && (r4 = 0), { name: "offset", options: r4, async fn(i3) {
2687
- const { x: o3, y: a3 } = i3, l3 = await async function(r5, i4) {
2688
- const { placement: o4, platform: a4, elements: l4 } = r5, s3 = await (null == a4.isRTL ? void 0 : a4.isRTL(l4.floating)), c3 = t(o4), f3 = e(o4), u3 = "x" === n(o4), m3 = ["left", "top"].includes(c3) ? -1 : 1, g3 = s3 && u3 ? -1 : 1, d3 = "function" == typeof i4 ? i4(r5) : i4;
2689
- let { mainAxis: p3, crossAxis: h3, alignmentAxis: y3 } = "number" == typeof d3 ? { mainAxis: d3, crossAxis: 0, alignmentAxis: null } : __spreadValues({ mainAxis: 0, crossAxis: 0, alignmentAxis: null }, d3);
2690
- return f3 && "number" == typeof y3 && (h3 = "end" === f3 ? -1 * y3 : y3), u3 ? { x: h3 * g3, y: p3 * m3 } : { x: p3 * m3, y: h3 * g3 };
2691
- }(i3, r4);
2692
- return { x: o3 + l3.x, y: a3 + l3.y, data: l3 };
2693
- } };
2694
- };
2695
- function O(t2) {
2696
- return "x" === t2 ? "y" : "x";
3125
+ };
3126
+ };
3127
+ async function convertValueToCoords(state, options) {
3128
+ const {
3129
+ placement,
3130
+ platform: platform2,
3131
+ elements
3132
+ } = state;
3133
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3134
+ const side2 = getSide(placement);
3135
+ const alignment = getAlignment(placement);
3136
+ const isVertical = getSideAxis(placement) === "y";
3137
+ const mainAxisMulti = ["left", "top"].includes(side2) ? -1 : 1;
3138
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
3139
+ const rawValue = evaluate(options, state);
3140
+ let {
3141
+ mainAxis,
3142
+ crossAxis,
3143
+ alignmentAxis
3144
+ } = typeof rawValue === "number" ? {
3145
+ mainAxis: rawValue,
3146
+ crossAxis: 0,
3147
+ alignmentAxis: null
3148
+ } : __spreadValues({
3149
+ mainAxis: 0,
3150
+ crossAxis: 0,
3151
+ alignmentAxis: null
3152
+ }, rawValue);
3153
+ if (alignment && typeof alignmentAxis === "number") {
3154
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
3155
+ }
3156
+ return isVertical ? {
3157
+ x: crossAxis * crossAxisMulti,
3158
+ y: mainAxis * mainAxisMulti
3159
+ } : {
3160
+ x: mainAxis * mainAxisMulti,
3161
+ y: crossAxis * crossAxisMulti
3162
+ };
2697
3163
  }
2698
- var D = function(e2) {
2699
- return void 0 === e2 && (e2 = {}), { name: "shift", options: e2, async fn(r4) {
2700
- const { x: i3, y: o3, placement: a3 } = r4, _a = e2, { mainAxis: l3 = true, crossAxis: c3 = false, limiter: f3 = { fn: (t2) => {
2701
- let { x: e3, y: n3 } = t2;
2702
- return { x: e3, y: n3 };
2703
- } } } = _a, m3 = __objRest(_a, ["mainAxis", "crossAxis", "limiter"]), g3 = { x: i3, y: o3 }, d3 = await s(r4, m3), p3 = n(t(a3)), h3 = O(p3);
2704
- let y3 = g3[p3], x3 = g3[h3];
2705
- if (l3) {
2706
- const t2 = "y" === p3 ? "bottom" : "right";
2707
- y3 = u(y3 + d3["y" === p3 ? "top" : "left"], y3, y3 - d3[t2]);
3164
+ var offset = function(options) {
3165
+ if (options === void 0) {
3166
+ options = 0;
3167
+ }
3168
+ return {
3169
+ name: "offset",
3170
+ options,
3171
+ async fn(state) {
3172
+ var _middlewareData$offse, _middlewareData$arrow;
3173
+ const {
3174
+ x,
3175
+ y,
3176
+ placement,
3177
+ middlewareData
3178
+ } = state;
3179
+ const diffCoords = await convertValueToCoords(state, options);
3180
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3181
+ return {};
3182
+ }
3183
+ return {
3184
+ x: x + diffCoords.x,
3185
+ y: y + diffCoords.y,
3186
+ data: __spreadProps(__spreadValues({}, diffCoords), {
3187
+ placement
3188
+ })
3189
+ };
2708
3190
  }
2709
- if (c3) {
2710
- const t2 = "y" === h3 ? "bottom" : "right";
2711
- x3 = u(x3 + d3["y" === h3 ? "top" : "left"], x3, x3 - d3[t2]);
3191
+ };
3192
+ };
3193
+ var shift = function(options) {
3194
+ if (options === void 0) {
3195
+ options = {};
3196
+ }
3197
+ return {
3198
+ name: "shift",
3199
+ options,
3200
+ async fn(state) {
3201
+ const {
3202
+ x,
3203
+ y,
3204
+ placement
3205
+ } = state;
3206
+ const _a = evaluate(options, state), {
3207
+ mainAxis: checkMainAxis = true,
3208
+ crossAxis: checkCrossAxis = false,
3209
+ limiter = {
3210
+ fn: (_ref) => {
3211
+ let {
3212
+ x: x2,
3213
+ y: y2
3214
+ } = _ref;
3215
+ return {
3216
+ x: x2,
3217
+ y: y2
3218
+ };
3219
+ }
3220
+ }
3221
+ } = _a, detectOverflowOptions = __objRest(_a, [
3222
+ "mainAxis",
3223
+ "crossAxis",
3224
+ "limiter"
3225
+ ]);
3226
+ const coords = {
3227
+ x,
3228
+ y
3229
+ };
3230
+ const overflow = await detectOverflow(state, detectOverflowOptions);
3231
+ const crossAxis = getSideAxis(getSide(placement));
3232
+ const mainAxis = getOppositeAxis(crossAxis);
3233
+ let mainAxisCoord = coords[mainAxis];
3234
+ let crossAxisCoord = coords[crossAxis];
3235
+ if (checkMainAxis) {
3236
+ const minSide = mainAxis === "y" ? "top" : "left";
3237
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
3238
+ const min2 = mainAxisCoord + overflow[minSide];
3239
+ const max2 = mainAxisCoord - overflow[maxSide];
3240
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
3241
+ }
3242
+ if (checkCrossAxis) {
3243
+ const minSide = crossAxis === "y" ? "top" : "left";
3244
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
3245
+ const min2 = crossAxisCoord + overflow[minSide];
3246
+ const max2 = crossAxisCoord - overflow[maxSide];
3247
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
3248
+ }
3249
+ const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), {
3250
+ [mainAxis]: mainAxisCoord,
3251
+ [crossAxis]: crossAxisCoord
3252
+ }));
3253
+ return __spreadProps(__spreadValues({}, limitedCoords), {
3254
+ data: {
3255
+ x: limitedCoords.x - x,
3256
+ y: limitedCoords.y - y
3257
+ }
3258
+ });
2712
3259
  }
2713
- const w3 = f3.fn(__spreadProps(__spreadValues({}, r4), { [p3]: y3, [h3]: x3 }));
2714
- return __spreadProps(__spreadValues({}, w3), { data: { x: w3.x - i3, y: w3.y - o3 } });
2715
- } };
3260
+ };
2716
3261
  };
2717
3262
 
2718
- // node_modules/.pnpm/@floating-ui+dom@0.5.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs
2719
- function n2(t2) {
2720
- return t2 && t2.document && t2.location && t2.alert && t2.setInterval;
3263
+ // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
3264
+ function getNodeName(node) {
3265
+ if (isNode(node)) {
3266
+ return (node.nodeName || "").toLowerCase();
3267
+ }
3268
+ return "#document";
2721
3269
  }
2722
- function o2(t2) {
2723
- if (null == t2)
2724
- return window;
2725
- if (!n2(t2)) {
2726
- const e2 = t2.ownerDocument;
2727
- return e2 && e2.defaultView || window;
2728
- }
2729
- return t2;
3270
+ function getWindow(node) {
3271
+ var _node$ownerDocument;
3272
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
2730
3273
  }
2731
- function i2(t2) {
2732
- return o2(t2).getComputedStyle(t2);
3274
+ function getDocumentElement(node) {
3275
+ var _ref;
3276
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
2733
3277
  }
2734
- function r3(t2) {
2735
- return n2(t2) ? "" : t2 ? (t2.nodeName || "").toLowerCase() : "";
3278
+ function isNode(value) {
3279
+ return value instanceof Node || value instanceof getWindow(value).Node;
2736
3280
  }
2737
- function l2() {
2738
- const t2 = navigator.userAgentData;
2739
- return null != t2 && t2.brands ? t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" ") : navigator.userAgent;
3281
+ function isElement(value) {
3282
+ return value instanceof Element || value instanceof getWindow(value).Element;
2740
3283
  }
2741
- function c2(t2) {
2742
- return t2 instanceof o2(t2).HTMLElement;
3284
+ function isHTMLElement(value) {
3285
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
2743
3286
  }
2744
- function f2(t2) {
2745
- return t2 instanceof o2(t2).Element;
3287
+ function isShadowRoot(value) {
3288
+ if (typeof ShadowRoot === "undefined") {
3289
+ return false;
3290
+ }
3291
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2746
3292
  }
2747
- function s2(t2) {
2748
- if ("undefined" == typeof ShadowRoot)
3293
+ function isOverflowElement(element) {
3294
+ const {
3295
+ overflow,
3296
+ overflowX,
3297
+ overflowY,
3298
+ display
3299
+ } = getComputedStyle(element);
3300
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
3301
+ }
3302
+ function isTableElement(element) {
3303
+ return ["table", "td", "th"].includes(getNodeName(element));
3304
+ }
3305
+ function isContainingBlock(element) {
3306
+ const webkit = isWebKit();
3307
+ const css10 = getComputedStyle(element);
3308
+ return css10.transform !== "none" || css10.perspective !== "none" || (css10.containerType ? css10.containerType !== "normal" : false) || !webkit && (css10.backdropFilter ? css10.backdropFilter !== "none" : false) || !webkit && (css10.filter ? css10.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css10.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css10.contain || "").includes(value));
3309
+ }
3310
+ function getContainingBlock(element) {
3311
+ let currentNode = getParentNode(element);
3312
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
3313
+ if (isContainingBlock(currentNode)) {
3314
+ return currentNode;
3315
+ } else {
3316
+ currentNode = getParentNode(currentNode);
3317
+ }
3318
+ }
3319
+ return null;
3320
+ }
3321
+ function isWebKit() {
3322
+ if (typeof CSS === "undefined" || !CSS.supports)
2749
3323
  return false;
2750
- return t2 instanceof o2(t2).ShadowRoot || t2 instanceof ShadowRoot;
3324
+ return CSS.supports("-webkit-backdrop-filter", "none");
2751
3325
  }
2752
- function u2(t2) {
2753
- const { overflow: e2, overflowX: n3, overflowY: o3 } = i2(t2);
2754
- return /auto|scroll|overlay|hidden/.test(e2 + o3 + n3);
3326
+ function isLastTraversableNode(node) {
3327
+ return ["html", "body", "#document"].includes(getNodeName(node));
2755
3328
  }
2756
- function d2(t2) {
2757
- return ["table", "td", "th"].includes(r3(t2));
3329
+ function getComputedStyle(element) {
3330
+ return getWindow(element).getComputedStyle(element);
2758
3331
  }
2759
- function h2(t2) {
2760
- const e2 = /firefox/i.test(l2()), n3 = i2(t2);
2761
- return "none" !== n3.transform || "none" !== n3.perspective || "paint" === n3.contain || ["transform", "perspective"].includes(n3.willChange) || e2 && "filter" === n3.willChange || e2 && !!n3.filter && "none" !== n3.filter;
3332
+ function getNodeScroll(element) {
3333
+ if (isElement(element)) {
3334
+ return {
3335
+ scrollLeft: element.scrollLeft,
3336
+ scrollTop: element.scrollTop
3337
+ };
3338
+ }
3339
+ return {
3340
+ scrollLeft: element.pageXOffset,
3341
+ scrollTop: element.pageYOffset
3342
+ };
2762
3343
  }
2763
- function a2() {
2764
- return !/^((?!chrome|android).)*safari/i.test(l2());
3344
+ function getParentNode(node) {
3345
+ if (getNodeName(node) === "html") {
3346
+ return node;
3347
+ }
3348
+ const result = (
3349
+ // Step into the shadow DOM of the parent of a slotted node.
3350
+ node.assignedSlot || // DOM Element detected.
3351
+ node.parentNode || // ShadowRoot detected.
3352
+ isShadowRoot(node) && node.host || // Fallback.
3353
+ getDocumentElement(node)
3354
+ );
3355
+ return isShadowRoot(result) ? result.host : result;
2765
3356
  }
2766
- var g2 = Math.min;
2767
- var p2 = Math.max;
2768
- var m2 = Math.round;
2769
- function w2(t2, e2, n3) {
2770
- var i3, r4, l3, s3;
2771
- void 0 === e2 && (e2 = false), void 0 === n3 && (n3 = false);
2772
- const u3 = t2.getBoundingClientRect();
2773
- let d3 = 1, h3 = 1;
2774
- e2 && c2(t2) && (d3 = t2.offsetWidth > 0 && m2(u3.width) / t2.offsetWidth || 1, h3 = t2.offsetHeight > 0 && m2(u3.height) / t2.offsetHeight || 1);
2775
- const g3 = f2(t2) ? o2(t2) : window, p3 = !a2() && n3, w3 = (u3.left + (p3 && null != (i3 = null == (r4 = g3.visualViewport) ? void 0 : r4.offsetLeft) ? i3 : 0)) / d3, v3 = (u3.top + (p3 && null != (l3 = null == (s3 = g3.visualViewport) ? void 0 : s3.offsetTop) ? l3 : 0)) / h3, y3 = u3.width / d3, x3 = u3.height / h3;
2776
- return { width: y3, height: x3, top: v3, right: w3 + y3, bottom: v3 + x3, left: w3, x: w3, y: v3 };
3357
+ function getNearestOverflowAncestor(node) {
3358
+ const parentNode = getParentNode(node);
3359
+ if (isLastTraversableNode(parentNode)) {
3360
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
3361
+ }
3362
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
3363
+ return parentNode;
3364
+ }
3365
+ return getNearestOverflowAncestor(parentNode);
2777
3366
  }
2778
- function v2(t2) {
2779
- return (e2 = t2, (e2 instanceof o2(e2).Node ? t2.ownerDocument : t2.document) || window.document).documentElement;
2780
- var e2;
3367
+ function getOverflowAncestors(node, list, traverseIframes) {
3368
+ var _node$ownerDocument2;
3369
+ if (list === void 0) {
3370
+ list = [];
3371
+ }
3372
+ if (traverseIframes === void 0) {
3373
+ traverseIframes = true;
3374
+ }
3375
+ const scrollableAncestor = getNearestOverflowAncestor(node);
3376
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
3377
+ const win = getWindow(scrollableAncestor);
3378
+ if (isBody) {
3379
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
3380
+ }
3381
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
2781
3382
  }
2782
- function y2(t2) {
2783
- return f2(t2) ? { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop } : { scrollLeft: t2.pageXOffset, scrollTop: t2.pageYOffset };
3383
+
3384
+ // node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
3385
+ function getCssDimensions(element) {
3386
+ const css10 = getComputedStyle(element);
3387
+ let width = parseFloat(css10.width) || 0;
3388
+ let height = parseFloat(css10.height) || 0;
3389
+ const hasOffset = isHTMLElement(element);
3390
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
3391
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
3392
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
3393
+ if (shouldFallback) {
3394
+ width = offsetWidth;
3395
+ height = offsetHeight;
3396
+ }
3397
+ return {
3398
+ width,
3399
+ height,
3400
+ $: shouldFallback
3401
+ };
2784
3402
  }
2785
- function x2(t2) {
2786
- return w2(v2(t2)).left + y2(t2).scrollLeft;
3403
+ function unwrapElement(element) {
3404
+ return !isElement(element) ? element.contextElement : element;
2787
3405
  }
2788
- function b2(t2, e2, n3) {
2789
- const o3 = c2(e2), i3 = v2(e2), l3 = w2(t2, o3 && function(t3) {
2790
- const e3 = w2(t3);
2791
- return m2(e3.width) !== t3.offsetWidth || m2(e3.height) !== t3.offsetHeight;
2792
- }(e2), "fixed" === n3);
2793
- let f3 = { scrollLeft: 0, scrollTop: 0 };
2794
- const s3 = { x: 0, y: 0 };
2795
- if (o3 || !o3 && "fixed" !== n3)
2796
- if (("body" !== r3(e2) || u2(i3)) && (f3 = y2(e2)), c2(e2)) {
2797
- const t3 = w2(e2, true);
2798
- s3.x = t3.x + e2.clientLeft, s3.y = t3.y + e2.clientTop;
2799
- } else
2800
- i3 && (s3.x = x2(i3));
2801
- return { x: l3.left + f3.scrollLeft - s3.x, y: l3.top + f3.scrollTop - s3.y, width: l3.width, height: l3.height };
3406
+ function getScale(element) {
3407
+ const domElement = unwrapElement(element);
3408
+ if (!isHTMLElement(domElement)) {
3409
+ return createCoords(1);
3410
+ }
3411
+ const rect = domElement.getBoundingClientRect();
3412
+ const {
3413
+ width,
3414
+ height,
3415
+ $
3416
+ } = getCssDimensions(domElement);
3417
+ let x = ($ ? round(rect.width) : rect.width) / width;
3418
+ let y = ($ ? round(rect.height) : rect.height) / height;
3419
+ if (!x || !Number.isFinite(x)) {
3420
+ x = 1;
3421
+ }
3422
+ if (!y || !Number.isFinite(y)) {
3423
+ y = 1;
3424
+ }
3425
+ return {
3426
+ x,
3427
+ y
3428
+ };
2802
3429
  }
2803
- function L2(t2) {
2804
- return "html" === r3(t2) ? t2 : t2.assignedSlot || t2.parentNode || (s2(t2) ? t2.host : null) || v2(t2);
3430
+ var noOffsets = /* @__PURE__ */ createCoords(0);
3431
+ function getVisualOffsets(element) {
3432
+ const win = getWindow(element);
3433
+ if (!isWebKit() || !win.visualViewport) {
3434
+ return noOffsets;
3435
+ }
3436
+ return {
3437
+ x: win.visualViewport.offsetLeft,
3438
+ y: win.visualViewport.offsetTop
3439
+ };
2805
3440
  }
2806
- function R(t2) {
2807
- return c2(t2) && "fixed" !== getComputedStyle(t2).position ? t2.offsetParent : null;
3441
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
3442
+ if (isFixed === void 0) {
3443
+ isFixed = false;
3444
+ }
3445
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
3446
+ return false;
3447
+ }
3448
+ return isFixed;
2808
3449
  }
2809
- function T2(t2) {
2810
- const e2 = o2(t2);
2811
- let n3 = R(t2);
2812
- for (; n3 && d2(n3) && "static" === getComputedStyle(n3).position; )
2813
- n3 = R(n3);
2814
- return n3 && ("html" === r3(n3) || "body" === r3(n3) && "static" === getComputedStyle(n3).position && !h2(n3)) ? e2 : n3 || function(t3) {
2815
- let e3 = L2(t3);
2816
- for (s2(e3) && (e3 = e3.host); c2(e3) && !["html", "body"].includes(r3(e3)); ) {
2817
- if (h2(e3))
2818
- return e3;
2819
- e3 = e3.parentNode;
3450
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
3451
+ if (includeScale === void 0) {
3452
+ includeScale = false;
3453
+ }
3454
+ if (isFixedStrategy === void 0) {
3455
+ isFixedStrategy = false;
3456
+ }
3457
+ const clientRect = element.getBoundingClientRect();
3458
+ const domElement = unwrapElement(element);
3459
+ let scale = createCoords(1);
3460
+ if (includeScale) {
3461
+ if (offsetParent) {
3462
+ if (isElement(offsetParent)) {
3463
+ scale = getScale(offsetParent);
3464
+ }
3465
+ } else {
3466
+ scale = getScale(element);
2820
3467
  }
2821
- return null;
2822
- }(t2) || e2;
3468
+ }
3469
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
3470
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
3471
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
3472
+ let width = clientRect.width / scale.x;
3473
+ let height = clientRect.height / scale.y;
3474
+ if (domElement) {
3475
+ const win = getWindow(domElement);
3476
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
3477
+ let currentWin = win;
3478
+ let currentIFrame = currentWin.frameElement;
3479
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
3480
+ const iframeScale = getScale(currentIFrame);
3481
+ const iframeRect = currentIFrame.getBoundingClientRect();
3482
+ const css10 = getComputedStyle(currentIFrame);
3483
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css10.paddingLeft)) * iframeScale.x;
3484
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css10.paddingTop)) * iframeScale.y;
3485
+ x *= iframeScale.x;
3486
+ y *= iframeScale.y;
3487
+ width *= iframeScale.x;
3488
+ height *= iframeScale.y;
3489
+ x += left;
3490
+ y += top;
3491
+ currentWin = getWindow(currentIFrame);
3492
+ currentIFrame = currentWin.frameElement;
3493
+ }
3494
+ }
3495
+ return rectToClientRect({
3496
+ width,
3497
+ height,
3498
+ x,
3499
+ y
3500
+ });
2823
3501
  }
2824
- function W(t2) {
2825
- if (c2(t2))
2826
- return { width: t2.offsetWidth, height: t2.offsetHeight };
2827
- const e2 = w2(t2);
2828
- return { width: e2.width, height: e2.height };
3502
+ var topLayerSelectors = [":popover-open", ":modal"];
3503
+ function isTopLayer(floating) {
3504
+ return topLayerSelectors.some((selector) => {
3505
+ try {
3506
+ return floating.matches(selector);
3507
+ } catch (e) {
3508
+ return false;
3509
+ }
3510
+ });
2829
3511
  }
2830
- function E2(t2) {
2831
- const e2 = L2(t2);
2832
- return ["html", "body", "#document"].includes(r3(e2)) ? t2.ownerDocument.body : c2(e2) && u2(e2) ? e2 : E2(e2);
3512
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
3513
+ let {
3514
+ elements,
3515
+ rect,
3516
+ offsetParent,
3517
+ strategy
3518
+ } = _ref;
3519
+ const isFixed = strategy === "fixed";
3520
+ const documentElement = getDocumentElement(offsetParent);
3521
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
3522
+ if (offsetParent === documentElement || topLayer && isFixed) {
3523
+ return rect;
3524
+ }
3525
+ let scroll = {
3526
+ scrollLeft: 0,
3527
+ scrollTop: 0
3528
+ };
3529
+ let scale = createCoords(1);
3530
+ const offsets = createCoords(0);
3531
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
3532
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
3533
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
3534
+ scroll = getNodeScroll(offsetParent);
3535
+ }
3536
+ if (isHTMLElement(offsetParent)) {
3537
+ const offsetRect = getBoundingClientRect(offsetParent);
3538
+ scale = getScale(offsetParent);
3539
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
3540
+ offsets.y = offsetRect.y + offsetParent.clientTop;
3541
+ }
3542
+ }
3543
+ return {
3544
+ width: rect.width * scale.x,
3545
+ height: rect.height * scale.y,
3546
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
3547
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
3548
+ };
2833
3549
  }
2834
- function H(t2, e2) {
2835
- var n3;
2836
- void 0 === e2 && (e2 = []);
2837
- const i3 = E2(t2), r4 = i3 === (null == (n3 = t2.ownerDocument) ? void 0 : n3.body), l3 = o2(i3), c3 = r4 ? [l3].concat(l3.visualViewport || [], u2(i3) ? i3 : []) : i3, f3 = e2.concat(c3);
2838
- return r4 ? f3 : f3.concat(H(c3));
3550
+ function getClientRects(element) {
3551
+ return Array.from(element.getClientRects());
2839
3552
  }
2840
- function C(e2, n3, r4) {
2841
- return "viewport" === n3 ? l(function(t2, e3) {
2842
- const n4 = o2(t2), i3 = v2(t2), r5 = n4.visualViewport;
2843
- let l3 = i3.clientWidth, c3 = i3.clientHeight, f3 = 0, s3 = 0;
2844
- if (r5) {
2845
- l3 = r5.width, c3 = r5.height;
2846
- const t3 = a2();
2847
- (t3 || !t3 && "fixed" === e3) && (f3 = r5.offsetLeft, s3 = r5.offsetTop);
2848
- }
2849
- return { width: l3, height: c3, x: f3, y: s3 };
2850
- }(e2, r4)) : f2(n3) ? function(t2, e3) {
2851
- const n4 = w2(t2, false, "fixed" === e3), o3 = n4.top + t2.clientTop, i3 = n4.left + t2.clientLeft;
2852
- return { top: o3, left: i3, x: i3, y: o3, right: i3 + t2.clientWidth, bottom: o3 + t2.clientHeight, width: t2.clientWidth, height: t2.clientHeight };
2853
- }(n3, r4) : l(function(t2) {
2854
- var e3;
2855
- const n4 = v2(t2), o3 = y2(t2), r5 = null == (e3 = t2.ownerDocument) ? void 0 : e3.body, l3 = p2(n4.scrollWidth, n4.clientWidth, r5 ? r5.scrollWidth : 0, r5 ? r5.clientWidth : 0), c3 = p2(n4.scrollHeight, n4.clientHeight, r5 ? r5.scrollHeight : 0, r5 ? r5.clientHeight : 0);
2856
- let f3 = -o3.scrollLeft + x2(t2);
2857
- const s3 = -o3.scrollTop;
2858
- return "rtl" === i2(r5 || n4).direction && (f3 += p2(n4.clientWidth, r5 ? r5.clientWidth : 0) - l3), { width: l3, height: c3, x: f3, y: s3 };
2859
- }(v2(e2)));
3553
+ function getWindowScrollBarX(element) {
3554
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
2860
3555
  }
2861
- function S(t2) {
2862
- const e2 = H(t2), n3 = ["absolute", "fixed"].includes(i2(t2).position) && c2(t2) ? T2(t2) : t2;
2863
- return f2(n3) ? e2.filter((t3) => f2(t3) && function(t4, e3) {
2864
- const n4 = null == e3.getRootNode ? void 0 : e3.getRootNode();
2865
- if (t4.contains(e3))
2866
- return true;
2867
- if (n4 && s2(n4)) {
2868
- let n5 = e3;
2869
- do {
2870
- if (n5 && t4 === n5)
2871
- return true;
2872
- n5 = n5.parentNode || n5.host;
2873
- } while (n5);
3556
+ function getDocumentRect(element) {
3557
+ const html26 = getDocumentElement(element);
3558
+ const scroll = getNodeScroll(element);
3559
+ const body = element.ownerDocument.body;
3560
+ const width = max(html26.scrollWidth, html26.clientWidth, body.scrollWidth, body.clientWidth);
3561
+ const height = max(html26.scrollHeight, html26.clientHeight, body.scrollHeight, body.clientHeight);
3562
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
3563
+ const y = -scroll.scrollTop;
3564
+ if (getComputedStyle(body).direction === "rtl") {
3565
+ x += max(html26.clientWidth, body.clientWidth) - width;
3566
+ }
3567
+ return {
3568
+ width,
3569
+ height,
3570
+ x,
3571
+ y
3572
+ };
3573
+ }
3574
+ function getViewportRect(element, strategy) {
3575
+ const win = getWindow(element);
3576
+ const html26 = getDocumentElement(element);
3577
+ const visualViewport = win.visualViewport;
3578
+ let width = html26.clientWidth;
3579
+ let height = html26.clientHeight;
3580
+ let x = 0;
3581
+ let y = 0;
3582
+ if (visualViewport) {
3583
+ width = visualViewport.width;
3584
+ height = visualViewport.height;
3585
+ const visualViewportBased = isWebKit();
3586
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
3587
+ x = visualViewport.offsetLeft;
3588
+ y = visualViewport.offsetTop;
2874
3589
  }
3590
+ }
3591
+ return {
3592
+ width,
3593
+ height,
3594
+ x,
3595
+ y
3596
+ };
3597
+ }
3598
+ function getInnerBoundingClientRect(element, strategy) {
3599
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
3600
+ const top = clientRect.top + element.clientTop;
3601
+ const left = clientRect.left + element.clientLeft;
3602
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
3603
+ const width = element.clientWidth * scale.x;
3604
+ const height = element.clientHeight * scale.y;
3605
+ const x = left * scale.x;
3606
+ const y = top * scale.y;
3607
+ return {
3608
+ width,
3609
+ height,
3610
+ x,
3611
+ y
3612
+ };
3613
+ }
3614
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
3615
+ let rect;
3616
+ if (clippingAncestor === "viewport") {
3617
+ rect = getViewportRect(element, strategy);
3618
+ } else if (clippingAncestor === "document") {
3619
+ rect = getDocumentRect(getDocumentElement(element));
3620
+ } else if (isElement(clippingAncestor)) {
3621
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
3622
+ } else {
3623
+ const visualOffsets = getVisualOffsets(element);
3624
+ rect = __spreadProps(__spreadValues({}, clippingAncestor), {
3625
+ x: clippingAncestor.x - visualOffsets.x,
3626
+ y: clippingAncestor.y - visualOffsets.y
3627
+ });
3628
+ }
3629
+ return rectToClientRect(rect);
3630
+ }
3631
+ function hasFixedPositionAncestor(element, stopNode) {
3632
+ const parentNode = getParentNode(element);
3633
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
2875
3634
  return false;
2876
- }(t3, n3) && "body" !== r3(t3)) : [];
3635
+ }
3636
+ return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
3637
+ }
3638
+ function getClippingElementAncestors(element, cache2) {
3639
+ const cachedResult = cache2.get(element);
3640
+ if (cachedResult) {
3641
+ return cachedResult;
3642
+ }
3643
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
3644
+ let currentContainingBlockComputedStyle = null;
3645
+ const elementIsFixed = getComputedStyle(element).position === "fixed";
3646
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
3647
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
3648
+ const computedStyle = getComputedStyle(currentNode);
3649
+ const currentNodeIsContaining = isContainingBlock(currentNode);
3650
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
3651
+ currentContainingBlockComputedStyle = null;
3652
+ }
3653
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
3654
+ if (shouldDropCurrentNode) {
3655
+ result = result.filter((ancestor) => ancestor !== currentNode);
3656
+ } else {
3657
+ currentContainingBlockComputedStyle = computedStyle;
3658
+ }
3659
+ currentNode = getParentNode(currentNode);
3660
+ }
3661
+ cache2.set(element, result);
3662
+ return result;
3663
+ }
3664
+ function getClippingRect(_ref) {
3665
+ let {
3666
+ element,
3667
+ boundary,
3668
+ rootBoundary,
3669
+ strategy
3670
+ } = _ref;
3671
+ const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
3672
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
3673
+ const firstClippingAncestor = clippingAncestors[0];
3674
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
3675
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
3676
+ accRect.top = max(rect.top, accRect.top);
3677
+ accRect.right = min(rect.right, accRect.right);
3678
+ accRect.bottom = min(rect.bottom, accRect.bottom);
3679
+ accRect.left = max(rect.left, accRect.left);
3680
+ return accRect;
3681
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
3682
+ return {
3683
+ width: clippingRect.right - clippingRect.left,
3684
+ height: clippingRect.bottom - clippingRect.top,
3685
+ x: clippingRect.left,
3686
+ y: clippingRect.top
3687
+ };
3688
+ }
3689
+ function getDimensions(element) {
3690
+ const {
3691
+ width,
3692
+ height
3693
+ } = getCssDimensions(element);
3694
+ return {
3695
+ width,
3696
+ height
3697
+ };
3698
+ }
3699
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
3700
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
3701
+ const documentElement = getDocumentElement(offsetParent);
3702
+ const isFixed = strategy === "fixed";
3703
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
3704
+ let scroll = {
3705
+ scrollLeft: 0,
3706
+ scrollTop: 0
3707
+ };
3708
+ const offsets = createCoords(0);
3709
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
3710
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
3711
+ scroll = getNodeScroll(offsetParent);
3712
+ }
3713
+ if (isOffsetParentAnElement) {
3714
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
3715
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
3716
+ offsets.y = offsetRect.y + offsetParent.clientTop;
3717
+ } else if (documentElement) {
3718
+ offsets.x = getWindowScrollBarX(documentElement);
3719
+ }
3720
+ }
3721
+ const x = rect.left + scroll.scrollLeft - offsets.x;
3722
+ const y = rect.top + scroll.scrollTop - offsets.y;
3723
+ return {
3724
+ x,
3725
+ y,
3726
+ width: rect.width,
3727
+ height: rect.height
3728
+ };
3729
+ }
3730
+ function getTrueOffsetParent(element, polyfill) {
3731
+ if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
3732
+ return null;
3733
+ }
3734
+ if (polyfill) {
3735
+ return polyfill(element);
3736
+ }
3737
+ return element.offsetParent;
3738
+ }
3739
+ function getOffsetParent(element, polyfill) {
3740
+ const window2 = getWindow(element);
3741
+ if (!isHTMLElement(element) || isTopLayer(element)) {
3742
+ return window2;
3743
+ }
3744
+ let offsetParent = getTrueOffsetParent(element, polyfill);
3745
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
3746
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
3747
+ }
3748
+ if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
3749
+ return window2;
3750
+ }
3751
+ return offsetParent || getContainingBlock(element) || window2;
3752
+ }
3753
+ var getElementRects = async function(data) {
3754
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
3755
+ const getDimensionsFn = this.getDimensions;
3756
+ return {
3757
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
3758
+ floating: __spreadValues({
3759
+ x: 0,
3760
+ y: 0
3761
+ }, await getDimensionsFn(data.floating))
3762
+ };
3763
+ };
3764
+ function isRTL(element) {
3765
+ return getComputedStyle(element).direction === "rtl";
2877
3766
  }
2878
- var D2 = { getClippingRect: function(t2) {
2879
- let { element: e2, boundary: n3, rootBoundary: o3, strategy: i3 } = t2;
2880
- const r4 = [..."clippingAncestors" === n3 ? S(e2) : [].concat(n3), o3], l3 = r4[0], c3 = r4.reduce((t3, n4) => {
2881
- const o4 = C(e2, n4, i3);
2882
- return t3.top = p2(o4.top, t3.top), t3.right = g2(o4.right, t3.right), t3.bottom = g2(o4.bottom, t3.bottom), t3.left = p2(o4.left, t3.left), t3;
2883
- }, C(e2, l3, i3));
2884
- return { width: c3.right - c3.left, height: c3.bottom - c3.top, x: c3.left, y: c3.top };
2885
- }, convertOffsetParentRelativeRectToViewportRelativeRect: function(t2) {
2886
- let { rect: e2, offsetParent: n3, strategy: o3 } = t2;
2887
- const i3 = c2(n3), l3 = v2(n3);
2888
- if (n3 === l3)
2889
- return e2;
2890
- let f3 = { scrollLeft: 0, scrollTop: 0 };
2891
- const s3 = { x: 0, y: 0 };
2892
- if ((i3 || !i3 && "fixed" !== o3) && (("body" !== r3(n3) || u2(l3)) && (f3 = y2(n3)), c2(n3))) {
2893
- const t3 = w2(n3, true);
2894
- s3.x = t3.x + n3.clientLeft, s3.y = t3.y + n3.clientTop;
2895
- }
2896
- return __spreadProps(__spreadValues({}, e2), { x: e2.x - f3.scrollLeft + s3.x, y: e2.y - f3.scrollTop + s3.y });
2897
- }, isElement: f2, getDimensions: W, getOffsetParent: T2, getDocumentElement: v2, getElementRects: (t2) => {
2898
- let { reference: e2, floating: n3, strategy: o3 } = t2;
2899
- return { reference: b2(e2, T2(n3), o3), floating: __spreadProps(__spreadValues({}, W(n3)), { x: 0, y: 0 }) };
2900
- }, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === i2(t2).direction };
2901
- var z = (t2, n3, o3) => o(t2, n3, __spreadValues({ platform: D2 }, o3));
3767
+ var platform = {
3768
+ convertOffsetParentRelativeRectToViewportRelativeRect,
3769
+ getDocumentElement,
3770
+ getClippingRect,
3771
+ getOffsetParent,
3772
+ getElementRects,
3773
+ getClientRects,
3774
+ getDimensions,
3775
+ getScale,
3776
+ isElement,
3777
+ isRTL
3778
+ };
3779
+ var autoPlacement2 = autoPlacement;
3780
+ var shift2 = shift;
3781
+ var flip2 = flip;
3782
+ var arrow2 = arrow;
3783
+ var computePosition2 = (reference, floating, options) => {
3784
+ const cache2 = /* @__PURE__ */ new Map();
3785
+ const mergedOptions = __spreadValues({
3786
+ platform
3787
+ }, options);
3788
+ const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), {
3789
+ _c: cache2
3790
+ });
3791
+ return computePosition(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), {
3792
+ platform: platformWithCache
3793
+ }));
3794
+ };
2902
3795
 
2903
- // node_modules/.pnpm/@warp-ds+core@1.0.2/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
3796
+ // node_modules/.pnpm/@warp-ds+core@1.1.0_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
3797
+ var TOP_START = "top-start";
2904
3798
  var TOP = "top";
3799
+ var TOP_END = "top-end";
3800
+ var RIGHT_START = "right-start";
3801
+ var RIGHT = "right";
3802
+ var RIGHT_END = "right-end";
3803
+ var BOTTOM_START = "bottom-start";
2905
3804
  var BOTTOM = "bottom";
3805
+ var BOTTOM_END = "bottom-end";
3806
+ var LEFT_START = "left-start";
2906
3807
  var LEFT = "left";
2907
- var RIGHT = "right";
3808
+ var LEFT_END = "left-end";
3809
+ var directions = [
3810
+ TOP_START,
3811
+ TOP,
3812
+ TOP_END,
3813
+ RIGHT_START,
3814
+ RIGHT,
3815
+ RIGHT_END,
3816
+ BOTTOM_START,
3817
+ BOTTOM,
3818
+ BOTTOM_END,
3819
+ LEFT_START,
3820
+ LEFT,
3821
+ LEFT_END
3822
+ ];
2908
3823
  var opposites = {
3824
+ [TOP_START]: BOTTOM_START,
2909
3825
  [TOP]: BOTTOM,
3826
+ [TOP_END]: BOTTOM_END,
3827
+ [BOTTOM_START]: TOP_START,
2910
3828
  [BOTTOM]: TOP,
3829
+ [BOTTOM_END]: TOP_END,
3830
+ [LEFT_START]: RIGHT_START,
2911
3831
  [LEFT]: RIGHT,
2912
- [RIGHT]: LEFT
2913
- };
2914
- var arrowLabels = {
2915
- [TOP]: "\u2191",
2916
- [BOTTOM]: "\u2193",
2917
- [LEFT]: "\u2190",
2918
- [RIGHT]: "\u2192"
3832
+ [LEFT_END]: RIGHT_END,
3833
+ [RIGHT_START]: LEFT_START,
3834
+ [RIGHT]: LEFT,
3835
+ [RIGHT_END]: LEFT_END
2919
3836
  };
2920
3837
  var rotation = {
3838
+ [LEFT_START]: -45,
2921
3839
  [LEFT]: -45,
3840
+ [LEFT_END]: -45,
3841
+ [TOP_START]: 45,
2922
3842
  [TOP]: 45,
3843
+ [TOP_END]: 45,
3844
+ [RIGHT_START]: 135,
2923
3845
  [RIGHT]: 135,
2924
- [BOTTOM]: -135
3846
+ [RIGHT_END]: 135,
3847
+ [BOTTOM_START]: -135,
3848
+ [BOTTOM]: -135,
3849
+ [BOTTOM_END]: -135
2925
3850
  };
2926
3851
  var middlePosition = "calc(50% - 7px)";
2927
- var isDirectionVertical = (name) => [TOP, BOTTOM].includes(name);
2928
- function computeCalloutArrow({ actualDirection, directionName, arrowEl }) {
3852
+ var isDirectionVertical = (name) => [TOP_START, TOP, TOP_END, BOTTOM_START, BOTTOM, BOTTOM_END].includes(name);
3853
+ var arrowDirectionClassname = (dir) => {
3854
+ let direction;
3855
+ if (/-/.test(dir)) {
3856
+ direction = dir.split("-").map((d) => d.charAt(0).toUpperCase() + d.slice(1)).join("");
3857
+ } else {
3858
+ direction = dir.charAt(0).toUpperCase() + dir.slice(1);
3859
+ }
3860
+ return direction;
3861
+ };
3862
+ var side = (dir) => dir.split("-")[0];
3863
+ var staticSide = (dir) => opposites[side(dir)];
3864
+ var arrowDirection = (dir) => opposites[dir];
3865
+ var arrowRotation = (dir) => rotation[arrowDirection(dir)];
3866
+ var applyArrowStyles = (arrowEl, arrowRotation2, dir) => {
3867
+ Object.assign(arrowEl == null ? void 0 : arrowEl.style, {
3868
+ borderTopLeftRadius: "4px",
3869
+ zIndex: 1,
3870
+ // border alignment is off by a fraction of a pixel, this fixes it
3871
+ [`margin${arrowDirectionClassname(staticSide(dir))}`]: "-0.5px",
3872
+ transform: `rotate(${arrowRotation2}deg)`
3873
+ });
3874
+ };
3875
+ function computeCalloutArrow({ actualDirection, directionName = BOTTOM, arrowEl }) {
2929
3876
  if (!arrowEl)
2930
3877
  return;
2931
3878
  actualDirection = directionName;
2932
3879
  const directionIsVertical = isDirectionVertical(directionName);
2933
- arrowEl.style.left = directionIsVertical ? middlePosition : "";
2934
- arrowEl.style.top = !directionIsVertical ? middlePosition : "";
3880
+ Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
3881
+ left: directionIsVertical ? middlePosition : "",
3882
+ top: !directionIsVertical ? middlePosition : ""
3883
+ });
3884
+ applyArrowStyles(arrowEl, arrowRotation(actualDirection), actualDirection);
2935
3885
  }
2936
3886
  async function useRecompute(state) {
2937
- var _a, _b;
2938
- if (!state.isShowing)
3887
+ var _a, _b, _c;
3888
+ if (!(state == null ? void 0 : state.isShowing))
2939
3889
  return;
2940
- await ((_a = state == null ? void 0 : state.waitForDOM) == null ? void 0 : _a.call(state));
2941
- if (state.isCallout)
3890
+ if (state == null ? void 0 : state.waitForDOM) {
3891
+ await (state == null ? void 0 : state.waitForDOM());
3892
+ }
3893
+ if (state == null ? void 0 : state.isCallout)
2942
3894
  return computeCalloutArrow(state);
2943
- const position = await z(state.targetEl, state.attentionEl, {
2944
- placement: state.directionName,
3895
+ if (!(state == null ? void 0 : state.targetEl) || !(state == null ? void 0 : state.attentionEl))
3896
+ return;
3897
+ const targetEl = state == null ? void 0 : state.targetEl;
3898
+ const attentionEl = state == null ? void 0 : state.attentionEl;
3899
+ computePosition2(targetEl, attentionEl, {
3900
+ placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
2945
3901
  middleware: [
2946
- // Should we make this configurable, but have these as sane defaults?
2947
- b(),
2948
- T(8),
2949
- D({ padding: 16 }),
2950
- // @ts-ignore
2951
- m({ element: state.noArrow ? void 0 : state.arrowEl })
2952
- // FIXME
3902
+ offset({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
3903
+ (state == null ? void 0 : state.flip) && flip2({
3904
+ fallbackAxisSideDirection: "start",
3905
+ fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
3906
+ }),
3907
+ !(state == null ? void 0 : state.flip) && autoPlacement2(),
3908
+ shift2({ padding: 16 }),
3909
+ !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl })
2953
3910
  ]
3911
+ }).then(({ x, y, middlewareData, placement }) => {
3912
+ state.actualDirection = placement;
3913
+ Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
3914
+ left: `${x}px`,
3915
+ top: `${y}px`
3916
+ });
3917
+ const isRtl = window.getComputedStyle(attentionEl).direction === "rtl";
3918
+ const arrowPlacement = arrowDirection(placement).split("-")[1];
3919
+ if ((middlewareData == null ? void 0 : middlewareData.arrow) && (state == null ? void 0 : state.arrowEl)) {
3920
+ const arrowEl = state == null ? void 0 : state.arrowEl;
3921
+ const { x: x2, y: y2 } = middlewareData == null ? void 0 : middlewareData.arrow;
3922
+ let top = "";
3923
+ let right = "";
3924
+ let bottom = "";
3925
+ let left = "";
3926
+ if (arrowPlacement === "start") {
3927
+ const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3928
+ top = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3929
+ right = isRtl ? value : "";
3930
+ left = isRtl ? "" : value;
3931
+ } else if (arrowPlacement === "end") {
3932
+ const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3933
+ right = isRtl ? "" : value;
3934
+ left = isRtl ? value : "";
3935
+ bottom = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3936
+ } else {
3937
+ left = typeof x2 === "number" ? `${x2}px` : "";
3938
+ top = typeof y2 === "number" ? `${y2}px` : "";
3939
+ }
3940
+ Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
3941
+ top,
3942
+ right,
3943
+ bottom,
3944
+ left
3945
+ });
3946
+ applyArrowStyles(arrowEl, arrowRotation(placement), placement);
3947
+ }
2954
3948
  });
2955
- state.actualDirection = position.placement;
2956
- Object.assign(((_b = state.attentionEl) == null ? void 0 : _b.style) || {}, {
2957
- left: "0",
2958
- top: "0",
2959
- transform: `translate3d(${Math.round(position.x)}px, ${Math.round(position.y)}px, 0)`
2960
- });
2961
- let { x: x3, y: y3 } = position.middlewareData.arrow;
2962
- if (state.arrowEl) {
2963
- state.arrowEl.style.left = x3 ? x3 + "px" : "";
2964
- state.arrowEl.style.top = y3 ? y3 + "px" : "";
2965
- }
3949
+ return state;
2966
3950
  }
2967
3951
 
2968
3952
  // packages/attention/locales/en/messages.mjs
@@ -2990,8 +3974,8 @@ function detectLocale7() {
2990
3974
  try {
2991
3975
  const htmlLocale = document.documentElement.lang;
2992
3976
  return getSupportedLocale7(htmlLocale);
2993
- } catch (e2) {
2994
- console.warn("could not detect locale, falling back to source locale", e2);
3977
+ } catch (e) {
3978
+ console.warn("could not detect locale, falling back to source locale", e);
2995
3979
  return defaultLocale8;
2996
3980
  }
2997
3981
  }
@@ -3014,30 +3998,128 @@ var WarpAttention = class extends kebabCaseAttributes(WarpElement3) {
3014
3998
  constructor() {
3015
3999
  super();
3016
4000
  activateI18n7(messages9, messages10, messages11);
4001
+ this.handleDone = this.handleDone.bind(this);
3017
4002
  this.show = false;
4003
+ this.placement = "bottom";
3018
4004
  this.tooltip = false;
3019
4005
  this.callout = false;
3020
4006
  this.popover = false;
3021
4007
  this.highlight = false;
3022
4008
  this.canClose = false;
3023
4009
  this.noArrow = false;
4010
+ this.distance = 8;
4011
+ this.skidding = 0;
4012
+ this.flip = false;
4013
+ this._initialPlacement = this.placement;
4014
+ this._actualDirection = this.placement;
3024
4015
  }
3025
4016
  connectedCallback() {
3026
4017
  super.connectedCallback();
3027
- if (!this.placement || !Object.keys(opposites).includes(this.placement)) {
4018
+ if (this.placement && !Object.keys(opposites).includes(this.placement)) {
3028
4019
  throw new Error(`Invalid "placement" attribute. Set its value to one of the following:
3029
4020
  ${JSON.stringify(Object.keys(opposites))}`);
4021
+ }
4022
+ if (this.fallbackPlacements && !this.fallbackPlacements.every((fallbackPlacement) => directions.includes(fallbackPlacement))) {
4023
+ throw new Error(`Invalid "fallbackPlacements" attribute. Set its value to an array with one or more of the following:
4024
+ ${JSON.stringify(directions)}`);
3030
4025
  }
3031
4026
  setTimeout(() => this.requestUpdate(), 0);
4027
+ if (!this.callout) {
4028
+ window.addEventListener("click", this.handleDone);
4029
+ window.addEventListener("scroll", this.handleDone);
4030
+ window.addEventListener("resize", this.handleDone);
4031
+ window.addEventListener("touch", this.handleDone);
4032
+ }
4033
+ if (this.tooltip) {
4034
+ window.addEventListener("mouseover", this.handleDone);
4035
+ window.addEventListener("mouseout", this.handleDone);
4036
+ }
4037
+ }
4038
+ disconnectedCallback() {
4039
+ window.removeEventListener("click", this.handleDone);
4040
+ window.removeEventListener("scroll", this.handleDone);
4041
+ window.removeEventListener("resize", this.handleDone);
4042
+ window.removeEventListener("touch", this.handleDone);
4043
+ window.removeEventListener("mouseover", this.handleDone);
4044
+ window.removeEventListener("mouseout", this.handleDone);
4045
+ super.disconnectedCallback();
4046
+ }
4047
+ handleDone() {
4048
+ window.requestAnimationFrame(() => {
4049
+ if (this.show && this._targetEl && this._attentionEl) {
4050
+ useRecompute(this.attentionState).then((state) => {
4051
+ this._actualDirection = state == null ? void 0 : state.actualDirection;
4052
+ });
4053
+ } else {
4054
+ this._actualDirection = this._initialPlacement;
4055
+ }
4056
+ });
3032
4057
  }
3033
4058
  get _actualDirection() {
3034
4059
  return this.placement;
3035
4060
  }
3036
- set _actualDirection(v3) {
3037
- this.placement = v3;
4061
+ set _actualDirection(v) {
4062
+ this.placement = v;
4063
+ }
4064
+ get _arrowEl() {
4065
+ return this.renderRoot.querySelector("#arrow");
3038
4066
  }
3039
4067
  get _arrowDirection() {
3040
- return opposites[this.placement];
4068
+ return opposites[this._actualDirection];
4069
+ }
4070
+ get _arrowClasses() {
4071
+ return classes({
4072
+ [attention.arrowBase]: true,
4073
+ [attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]]: true,
4074
+ [this._activeVariantClasses.arrow]: true
4075
+ });
4076
+ }
4077
+ get _arrowHtml() {
4078
+ return this.noArrow ? "" : html9`<div id="arrow" role="img" class="${this._arrowClasses}" />`;
4079
+ }
4080
+ get _activeVariantClasses() {
4081
+ const variantProps = {
4082
+ callout: this.callout,
4083
+ popover: this.popover,
4084
+ tooltip: this.tooltip,
4085
+ highlight: this.highlight
4086
+ };
4087
+ const activeVariant = Object.keys(variantProps).find((b) => !!variantProps[b]) || "";
4088
+ return {
4089
+ wrapper: attention[activeVariant],
4090
+ arrow: attention[`arrow${activeVariant.charAt(0).toUpperCase() + activeVariant.slice(1)}`]
4091
+ };
4092
+ }
4093
+ get _attentionEl() {
4094
+ return this.renderRoot.querySelector("#attention");
4095
+ }
4096
+ get _targetEl() {
4097
+ const targetSlot = this.renderRoot.querySelector("slot[name='target']");
4098
+ return targetSlot ? targetSlot.assignedNodes()[0] : null;
4099
+ }
4100
+ get _messageEl() {
4101
+ const messageSlot = this.renderRoot.querySelector("slot[name='message']");
4102
+ return messageSlot ? messageSlot.assignedNodes()[0] : null;
4103
+ }
4104
+ get _wrapperClasses() {
4105
+ return classes({
4106
+ [attention.base]: true,
4107
+ [this._activeVariantClasses.wrapper]: true
4108
+ });
4109
+ }
4110
+ get _ariaClose() {
4111
+ return i18n._({
4112
+ id: "attention.aria.close",
4113
+ message: "Close",
4114
+ comment: "Aria label for the close button in attention"
4115
+ });
4116
+ }
4117
+ get _closeBtnHtml() {
4118
+ return html9`
4119
+ <button aria-label="${this._ariaClose}" @click="${this.close}" @keydown=${this.keypressed} class="${attention.closeBtn}">
4120
+ <w-icon-close-16 />
4121
+ </button>
4122
+ `;
3041
4123
  }
3042
4124
  updated() {
3043
4125
  if (!this.callout) {
@@ -3051,34 +4133,46 @@ ${JSON.stringify(Object.keys(opposites))}`);
3051
4133
  isCallout: this.callout,
3052
4134
  actualDirection: this._actualDirection,
3053
4135
  directionName: this.placement,
3054
- arrowEl: this.renderRoot.querySelector("#arrow"),
4136
+ arrowEl: this._arrowEl,
3055
4137
  attentionEl: this._attentionEl,
3056
4138
  targetEl: this._targetEl,
3057
- noArrow: this.noArrow
4139
+ noArrow: this.noArrow,
4140
+ distance: this.distance,
4141
+ skidding: this.skidding,
4142
+ flip: this.flip,
4143
+ fallbackPlacements: this.fallbackPlacements
3058
4144
  };
3059
4145
  useRecompute(this.attentionState);
3060
4146
  }
3061
4147
  pointingAtDirection() {
3062
4148
  switch (opposites[this._actualDirection]) {
4149
+ case "top-start":
3063
4150
  case "top":
4151
+ case "top-end":
3064
4152
  return i18n._({
3065
4153
  id: "attention.aria.pointingUp",
3066
4154
  message: "pointing up",
3067
4155
  comment: "Default screenreader message for top direction in the attention component"
3068
4156
  });
4157
+ case "right-start":
3069
4158
  case "right":
4159
+ case "right-end":
3070
4160
  return i18n._({
3071
4161
  id: "attention.aria.pointingRight",
3072
4162
  message: "pointing right",
3073
4163
  comment: "Default screenreader message for right direction in the attention component"
3074
4164
  });
4165
+ case "bottom-start":
3075
4166
  case "bottom":
4167
+ case "bottom-end":
3076
4168
  return i18n._({
3077
4169
  id: "attention.aria.pointingDown",
3078
4170
  message: "pointing down",
3079
4171
  comment: "Default screenreader message for bottom direction in the attention component"
3080
4172
  });
4173
+ case "left-start":
3081
4174
  case "left":
4175
+ case "left-end":
3082
4176
  return i18n._({
3083
4177
  id: "attention.aria.pointingLeft",
3084
4178
  message: "pointing left",
@@ -3127,64 +4221,13 @@ ${JSON.stringify(Object.keys(opposites))}`);
3127
4221
  this._targetEl.setAttribute("aria-details", attentionMessageId);
3128
4222
  }
3129
4223
  }
3130
- get _activeVariantClasses() {
3131
- const variantProps = {
3132
- callout: this.callout,
3133
- popover: this.popover,
3134
- tooltip: this.tooltip,
3135
- highlight: this.highlight
3136
- };
3137
- const activeVariant = Object.keys(variantProps).find((b3) => !!variantProps[b3]) || "";
3138
- return {
3139
- wrapper: attention[activeVariant],
3140
- arrow: attention[`arrow${activeVariant.charAt(0).toUpperCase() + activeVariant.slice(1)}`]
3141
- };
3142
- }
3143
- get _ariaClose() {
3144
- return i18n._({
3145
- id: "attention.aria.close",
3146
- message: "Close",
3147
- comment: "Aria label for the close button in attention"
3148
- });
3149
- }
3150
4224
  firstUpdated() {
4225
+ this._initialPlacement = this.placement;
3151
4226
  this.setAriaLabels();
3152
4227
  if (this.callout) {
3153
4228
  this._attentionEl.style.position = "relative";
3154
4229
  }
3155
4230
  }
3156
- get _attentionEl() {
3157
- return this.renderRoot.querySelector("#attention");
3158
- }
3159
- get _targetEl() {
3160
- return this.renderRoot.querySelector("slot[name='target']").assignedNodes()[0];
3161
- }
3162
- get _messageEl() {
3163
- return this.renderRoot.querySelector("slot[name='message']").assignedNodes()[0];
3164
- }
3165
- get _wrapperClasses() {
3166
- return classes({
3167
- [attention.base]: true,
3168
- [this._activeVariantClasses.wrapper]: true
3169
- });
3170
- }
3171
- get _arrowClasses() {
3172
- return classes({
3173
- [attention.arrowBase]: true,
3174
- [attention[`arrowDirection${this._arrowDirection.charAt(0).toUpperCase() + this._arrowDirection.slice(1)}`]]: true,
3175
- [this._activeVariantClasses.arrow]: true
3176
- });
3177
- }
3178
- get _arrowHtml() {
3179
- return this.noArrow ? "" : html9`<div
3180
- id="arrow"
3181
- role="img"
3182
- class="${this._arrowClasses}"
3183
- style="transform:rotate(${rotation[this._arrowDirection]}deg);
3184
- margin-${// border alignment is off by a fraction of a pixel, this fixes it
3185
- this._arrowDirection.charAt(0).toLowerCase() + this._arrowDirection.slice(1)}:-0.5px;"
3186
- />`;
3187
- }
3188
4231
  close() {
3189
4232
  const event = new CustomEvent("close", {
3190
4233
  bubbles: true,
@@ -3192,25 +4235,18 @@ ${JSON.stringify(Object.keys(opposites))}`);
3192
4235
  });
3193
4236
  this.updateComplete.then(() => this.dispatchEvent(event));
3194
4237
  }
3195
- keypressed(e2) {
4238
+ keypressed(e) {
3196
4239
  if (!this.canClose)
3197
4240
  return;
3198
- if (e2.key === "Escape") {
3199
- e2.preventDefault();
4241
+ if (e.key === "Escape") {
4242
+ e.preventDefault();
3200
4243
  this.close();
3201
4244
  }
3202
4245
  }
3203
- get _closeBtnHtml() {
3204
- return html9`
3205
- <button aria-label="${this._ariaClose}" @click="${this.close}" @keydown=${this.keypressed} class="${attention.closeBtn}">
3206
- <w-icon-close-16 />
3207
- </button>
3208
- `;
3209
- }
3210
4246
  render() {
3211
4247
  return html9`
3212
4248
  <div class=${ifDefined2(this.className ? this.className : void 0)}>
3213
- ${this.placement === "right" || this.placement === "bottom" ? html9`
4249
+ ${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html9`
3214
4250
  <slot name="target"></slot>
3215
4251
 
3216
4252
  <div id="attention" role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}" class="${this._wrapperClasses}">
@@ -3234,7 +4270,7 @@ __publicField(WarpAttention, "properties", {
3234
4270
  show: { type: Boolean, reflect: true },
3235
4271
  // Placement according to the target element
3236
4272
  // Arrow would be on the opposite side of this position
3237
- placement: { type: String },
4273
+ placement: { type: String, reflect: true },
3238
4274
  // Whether Attention element is rendered as a tooltip
3239
4275
  tooltip: { type: Boolean, reflect: true },
3240
4276
  // Whether Attention element is rendered as an inline callout
@@ -3246,7 +4282,15 @@ __publicField(WarpAttention, "properties", {
3246
4282
  // Render Attention element with a close button
3247
4283
  canClose: { type: Boolean, reflect: true },
3248
4284
  // Render Attention element without an arrow
3249
- noArrow: { type: Boolean, reflect: true }
4285
+ noArrow: { type: Boolean, reflect: true },
4286
+ // Distance from which to offset the attentionEl from the targetEl vertically
4287
+ distance: { type: Number, reflect: true },
4288
+ // Distance from which to offset the attentionEl along its targetEl horizontally
4289
+ skidding: { type: Number, reflect: true },
4290
+ // Whether Attention element should flip its placement in order to keep it in view
4291
+ flip: { type: Boolean, reflect: true },
4292
+ // Choose which preferred placements the Attention element should flip to
4293
+ fallbackPlacements: { type: Array, reflect: true }
3250
4294
  });
3251
4295
  __publicField(WarpAttention, "styles", [
3252
4296
  WarpElement3.styles,
@@ -3261,11 +4305,6 @@ __publicField(WarpAttention, "styles", [
3261
4305
  :host([popover]:not(:popover-open):not(dialog[open])) {
3262
4306
  display: contents;
3263
4307
  }
3264
-
3265
- #arrow {
3266
- border-top-left-radius: 4px;
3267
- z-index: 1;
3268
- }
3269
4308
  `
3270
4309
  ]);
3271
4310
  if (!customElements.get("w-attention")) {
@@ -3367,7 +4406,7 @@ if (!customElements.get("w-box")) {
3367
4406
  import { html as html12 } from "lit";
3368
4407
  import WarpElement6 from "@warp-ds/elements-core";
3369
4408
 
3370
- // node_modules/.pnpm/@warp-ds+core@1.0.2/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
4409
+ // node_modules/.pnpm/@warp-ds+core@1.1.0_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
3371
4410
  function interleave(array, separator2) {
3372
4411
  return array.flatMap((el) => [el, separator2]).slice(0, -1);
3373
4412
  }
@@ -3662,11 +4701,11 @@ var WarpCard = class extends WarpElement9 {
3662
4701
  get uuSpan() {
3663
4702
  return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
3664
4703
  }
3665
- keypressed(e2) {
3666
- if (!this.clickable || e2.altKey || e2.ctrlKey)
4704
+ keypressed(e) {
4705
+ if (!this.clickable || e.altKey || e.ctrlKey)
3667
4706
  return;
3668
- if (e2.key === keys.ENTER || e2.key === keys.SPACE) {
3669
- e2.preventDefault();
4707
+ if (e.key === keys.ENTER || e.key === keys.SPACE) {
4708
+ e.preventDefault();
3670
4709
  this.click();
3671
4710
  }
3672
4711
  }
@@ -3771,8 +4810,8 @@ function detectLocale8() {
3771
4810
  return getSupportedLocale8(hostLocale);
3772
4811
  }
3773
4812
  return getSupportedLocale8(htmlLocale != null ? htmlLocale : hostLocale);
3774
- } catch (e2) {
3775
- console.warn("could not detect locale, falling back to source locale", e2);
4813
+ } catch (e) {
4814
+ console.warn("could not detect locale, falling back to source locale", e);
3776
4815
  return defaultLocale9;
3777
4816
  }
3778
4817
  }
@@ -3862,8 +4901,8 @@ function detectLocale9() {
3862
4901
  return getSupportedLocale9(hostLocale);
3863
4902
  }
3864
4903
  return getSupportedLocale9(htmlLocale != null ? htmlLocale : hostLocale);
3865
- } catch (e2) {
3866
- console.warn("could not detect locale, falling back to source locale", e2);
4904
+ } catch (e) {
4905
+ console.warn("could not detect locale, falling back to source locale", e);
3867
4906
  return defaultLocale10;
3868
4907
  }
3869
4908
  }
@@ -4247,24 +5286,24 @@ var WarpTextField = class extends WarpElement13 {
4247
5286
  if (this.invalid && this._helpId)
4248
5287
  return this._helpId;
4249
5288
  }
4250
- handler(e2) {
4251
- const { name, value } = e2.target;
4252
- const event = new CustomEvent(e2.type, {
5289
+ handler(e) {
5290
+ const { name, value } = e.target;
5291
+ const event = new CustomEvent(e.type, {
4253
5292
  detail: {
4254
5293
  name,
4255
5294
  value,
4256
- target: e2.target
5295
+ target: e.target
4257
5296
  }
4258
5297
  });
4259
5298
  this.dispatchEvent(event);
4260
5299
  }
4261
- prefixSlotChange(e2) {
5300
+ prefixSlotChange(e) {
4262
5301
  const el = this.renderRoot.querySelector("slot[name=prefix]");
4263
5302
  const affixes = el.assignedElements();
4264
5303
  if (affixes.length)
4265
5304
  this._hasPrefix = true;
4266
5305
  }
4267
- suffixSlotChange(e2) {
5306
+ suffixSlotChange(e) {
4268
5307
  const el = this.renderRoot.querySelector("slot[name=suffix]");
4269
5308
  const affixes = el.assignedElements();
4270
5309
  if (affixes.length)
@@ -4515,8 +5554,8 @@ var getAfterCollapseCallback = (done) => () => {
4515
5554
  var expand = (el, done) => {
4516
5555
  const returnPromise = (() => {
4517
5556
  if (!done)
4518
- return new Promise((r4) => {
4519
- done = r4;
5557
+ return new Promise((r2) => {
5558
+ done = r2;
4520
5559
  });
4521
5560
  })();
4522
5561
  const afterExpandCallback = getAfterExpandCallback(el, done);
@@ -4536,8 +5575,8 @@ var expand = (el, done) => {
4536
5575
  var collapse = (el, done) => {
4537
5576
  const returnPromise = (() => {
4538
5577
  if (!done)
4539
- return new Promise((r4) => {
4540
- done = r4;
5578
+ return new Promise((r2) => {
5579
+ done = r2;
4541
5580
  });
4542
5581
  })();
4543
5582
  const afterCollapseCallback = getAfterCollapseCallback(done);