@warp-ds/elements 1.3.4-next.1 → 1.4.0-next.2
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/api.js.map +1 -1
- package/dist/index.js +1465 -526
- package/dist/index.js.map +4 -4
- package/dist/packages/attention/index.d.ts +51 -17
- package/dist/packages/attention/index.js +1446 -507
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/breadcrumbs/index.js +1 -1
- package/dist/packages/breadcrumbs/index.js.map +1 -1
- package/dist/packages/toast/api.d.ts +9 -9
- package/dist/packages/toast/index.js.map +1 -1
- package/package.json +2 -2
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 = (
|
|
13
|
-
for (var prop in
|
|
14
|
-
if (__hasOwnProp.call(
|
|
15
|
-
__defNormalProp(
|
|
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(
|
|
18
|
-
if (__propIsEnum.call(
|
|
19
|
-
__defNormalProp(
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return a;
|
|
22
22
|
};
|
|
23
|
-
var __spreadProps = (
|
|
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(
|
|
228
|
-
return
|
|
227
|
+
function isRegExp(o) {
|
|
228
|
+
return o && toString.call(o) === "[object RegExp]";
|
|
229
229
|
}
|
|
230
|
-
function isObject(
|
|
231
|
-
return
|
|
230
|
+
function isObject(o) {
|
|
231
|
+
return o && typeof o === "object" && !isRegExp(o) && !Array.isArray(o);
|
|
232
232
|
}
|
|
233
|
-
function reEscape(
|
|
234
|
-
return
|
|
233
|
+
function reEscape(s) {
|
|
234
|
+
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
235
235
|
}
|
|
236
|
-
function reGroups(
|
|
237
|
-
var re = new RegExp("|" +
|
|
236
|
+
function reGroups(s) {
|
|
237
|
+
var re = new RegExp("|" + s);
|
|
238
238
|
return re.exec("").length - 1;
|
|
239
239
|
}
|
|
240
|
-
function reCapture(
|
|
241
|
-
return "(" +
|
|
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(
|
|
247
|
-
return "(?:" +
|
|
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(
|
|
269
|
-
if (
|
|
270
|
-
return
|
|
268
|
+
function pad(s, length) {
|
|
269
|
+
if (s.length > length) {
|
|
270
|
+
return s;
|
|
271
271
|
}
|
|
272
|
-
return Array(length -
|
|
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
|
|
299
|
-
var key = keys2[
|
|
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
|
|
327
|
-
var obj = array[
|
|
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(
|
|
372
|
-
return isRegExp(
|
|
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
|
|
388
|
-
if (rules[
|
|
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
|
|
393
|
-
var options = rules[
|
|
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(
|
|
465
|
-
var state =
|
|
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 '" +
|
|
467
|
+
throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')");
|
|
468
468
|
}
|
|
469
|
-
if (
|
|
470
|
-
throw new Error("pop must be 1 (in token '" +
|
|
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
|
|
481
|
-
var key = keys2[
|
|
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
|
|
485
|
-
var key = keys2[
|
|
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
|
|
500
|
-
var newRule = newRules[
|
|
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
|
|
512
|
-
var key = keys2[
|
|
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
|
|
516
|
-
var name = keys2[
|
|
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
|
|
534
|
-
var tokenType = types[
|
|
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(
|
|
549
|
-
return isMap ? reverseMap.get(
|
|
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
|
|
611
|
-
if (match[
|
|
612
|
-
return this.groups[
|
|
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,
|
|
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
|
|
677
|
-
this.index +=
|
|
676
|
+
var size2 = text.length;
|
|
677
|
+
this.index += size2;
|
|
678
678
|
this.line += lineBreaks;
|
|
679
679
|
if (lineBreaks !== 0) {
|
|
680
|
-
this.col =
|
|
680
|
+
this.col = size2 - nl + 1;
|
|
681
681
|
} else {
|
|
682
|
-
this.col +=
|
|
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
|
|
734
|
-
var line = displayedLines[
|
|
735
|
-
var lineNo = firstDisplayedLine +
|
|
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
|
|
846
|
-
const pText =
|
|
845
|
+
for (const p of param) {
|
|
846
|
+
const pText = p.ctx.text;
|
|
847
847
|
text += pText;
|
|
848
|
-
switch (
|
|
848
|
+
switch (p.type) {
|
|
849
849
|
case "content":
|
|
850
|
-
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
|
|
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 [
|
|
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
|
|
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 = (
|
|
1490
|
+
function compileMessage(message, mapText = (v) => v) {
|
|
1491
1491
|
try {
|
|
1492
1492
|
return processTokens((0, import_parser.parse)(message), mapText);
|
|
1493
|
-
} catch (
|
|
1494
|
-
console.error(`${
|
|
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 = (
|
|
1503
|
-
var isFunction = (
|
|
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 -
|
|
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 -
|
|
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 -
|
|
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 (
|
|
1871
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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 (
|
|
1962
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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
|
|
2091
|
-
|
|
2092
|
-
return
|
|
2093
|
-
return
|
|
2094
|
-
return
|
|
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 (
|
|
2162
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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 (
|
|
2253
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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 (
|
|
2344
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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 (
|
|
2435
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
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,1294 @@ 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+
|
|
2556
|
-
|
|
2557
|
-
|
|
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 min = Math.min;
|
|
2558
|
+
var max = Math.max;
|
|
2559
|
+
var round = Math.round;
|
|
2560
|
+
var createCoords = (v) => ({
|
|
2561
|
+
x: v,
|
|
2562
|
+
y: v
|
|
2563
|
+
});
|
|
2564
|
+
var oppositeSideMap = {
|
|
2565
|
+
left: "right",
|
|
2566
|
+
right: "left",
|
|
2567
|
+
bottom: "top",
|
|
2568
|
+
top: "bottom"
|
|
2569
|
+
};
|
|
2570
|
+
var oppositeAlignmentMap = {
|
|
2571
|
+
start: "end",
|
|
2572
|
+
end: "start"
|
|
2573
|
+
};
|
|
2574
|
+
function clamp(start, value, end) {
|
|
2575
|
+
return max(start, min(value, end));
|
|
2576
|
+
}
|
|
2577
|
+
function evaluate(value, param) {
|
|
2578
|
+
return typeof value === "function" ? value(param) : value;
|
|
2579
|
+
}
|
|
2580
|
+
function getSide(placement) {
|
|
2581
|
+
return placement.split("-")[0];
|
|
2582
|
+
}
|
|
2583
|
+
function getAlignment(placement) {
|
|
2584
|
+
return placement.split("-")[1];
|
|
2585
|
+
}
|
|
2586
|
+
function getOppositeAxis(axis) {
|
|
2587
|
+
return axis === "x" ? "y" : "x";
|
|
2588
|
+
}
|
|
2589
|
+
function getAxisLength(axis) {
|
|
2590
|
+
return axis === "y" ? "height" : "width";
|
|
2591
|
+
}
|
|
2592
|
+
function getSideAxis(placement) {
|
|
2593
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
2594
|
+
}
|
|
2595
|
+
function getAlignmentAxis(placement) {
|
|
2596
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
2597
|
+
}
|
|
2598
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
2599
|
+
if (rtl === void 0) {
|
|
2600
|
+
rtl = false;
|
|
2601
|
+
}
|
|
2602
|
+
const alignment = getAlignment(placement);
|
|
2603
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
2604
|
+
const length = getAxisLength(alignmentAxis);
|
|
2605
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
2606
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
2607
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
2608
|
+
}
|
|
2609
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
2610
|
+
}
|
|
2611
|
+
function getExpandedPlacements(placement) {
|
|
2612
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
2613
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
2614
|
+
}
|
|
2615
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
2616
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
2617
|
+
}
|
|
2618
|
+
function getSideList(side2, isStart, rtl) {
|
|
2619
|
+
const lr = ["left", "right"];
|
|
2620
|
+
const rl = ["right", "left"];
|
|
2621
|
+
const tb = ["top", "bottom"];
|
|
2622
|
+
const bt = ["bottom", "top"];
|
|
2623
|
+
switch (side2) {
|
|
2624
|
+
case "top":
|
|
2625
|
+
case "bottom":
|
|
2626
|
+
if (rtl)
|
|
2627
|
+
return isStart ? rl : lr;
|
|
2628
|
+
return isStart ? lr : rl;
|
|
2629
|
+
case "left":
|
|
2630
|
+
case "right":
|
|
2631
|
+
return isStart ? tb : bt;
|
|
2632
|
+
default:
|
|
2633
|
+
return [];
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
2637
|
+
const alignment = getAlignment(placement);
|
|
2638
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
2639
|
+
if (alignment) {
|
|
2640
|
+
list = list.map((side2) => side2 + "-" + alignment);
|
|
2641
|
+
if (flipAlignment) {
|
|
2642
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
return list;
|
|
2558
2646
|
}
|
|
2559
|
-
function
|
|
2560
|
-
return
|
|
2647
|
+
function getOppositePlacement(placement) {
|
|
2648
|
+
return placement.replace(/left|right|bottom|top/g, (side2) => oppositeSideMap[side2]);
|
|
2561
2649
|
}
|
|
2562
|
-
function
|
|
2563
|
-
return
|
|
2650
|
+
function expandPaddingObject(padding) {
|
|
2651
|
+
return __spreadValues({
|
|
2652
|
+
top: 0,
|
|
2653
|
+
right: 0,
|
|
2654
|
+
bottom: 0,
|
|
2655
|
+
left: 0
|
|
2656
|
+
}, padding);
|
|
2564
2657
|
}
|
|
2565
|
-
function
|
|
2566
|
-
return
|
|
2658
|
+
function getPaddingObject(padding) {
|
|
2659
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
2660
|
+
top: padding,
|
|
2661
|
+
right: padding,
|
|
2662
|
+
bottom: padding,
|
|
2663
|
+
left: padding
|
|
2664
|
+
};
|
|
2665
|
+
}
|
|
2666
|
+
function rectToClientRect(rect) {
|
|
2667
|
+
return __spreadProps(__spreadValues({}, rect), {
|
|
2668
|
+
top: rect.y,
|
|
2669
|
+
left: rect.x,
|
|
2670
|
+
right: rect.x + rect.width,
|
|
2671
|
+
bottom: rect.y + rect.height
|
|
2672
|
+
});
|
|
2567
2673
|
}
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
let
|
|
2572
|
-
|
|
2674
|
+
|
|
2675
|
+
// node_modules/.pnpm/@floating-ui+core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
2676
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
2677
|
+
let {
|
|
2678
|
+
reference,
|
|
2679
|
+
floating
|
|
2680
|
+
} = _ref;
|
|
2681
|
+
const sideAxis = getSideAxis(placement);
|
|
2682
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
2683
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
2684
|
+
const side2 = getSide(placement);
|
|
2685
|
+
const isVertical = sideAxis === "y";
|
|
2686
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
2687
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
2688
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
2689
|
+
let coords;
|
|
2690
|
+
switch (side2) {
|
|
2573
2691
|
case "top":
|
|
2574
|
-
|
|
2692
|
+
coords = {
|
|
2693
|
+
x: commonX,
|
|
2694
|
+
y: reference.y - floating.height
|
|
2695
|
+
};
|
|
2575
2696
|
break;
|
|
2576
2697
|
case "bottom":
|
|
2577
|
-
|
|
2698
|
+
coords = {
|
|
2699
|
+
x: commonX,
|
|
2700
|
+
y: reference.y + reference.height
|
|
2701
|
+
};
|
|
2578
2702
|
break;
|
|
2579
2703
|
case "right":
|
|
2580
|
-
|
|
2704
|
+
coords = {
|
|
2705
|
+
x: reference.x + reference.width,
|
|
2706
|
+
y: commonY
|
|
2707
|
+
};
|
|
2581
2708
|
break;
|
|
2582
2709
|
case "left":
|
|
2583
|
-
|
|
2710
|
+
coords = {
|
|
2711
|
+
x: reference.x - floating.width,
|
|
2712
|
+
y: commonY
|
|
2713
|
+
};
|
|
2584
2714
|
break;
|
|
2585
2715
|
default:
|
|
2586
|
-
|
|
2716
|
+
coords = {
|
|
2717
|
+
x: reference.x,
|
|
2718
|
+
y: reference.y
|
|
2719
|
+
};
|
|
2587
2720
|
}
|
|
2588
|
-
switch (
|
|
2721
|
+
switch (getAlignment(placement)) {
|
|
2589
2722
|
case "start":
|
|
2590
|
-
|
|
2723
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
2591
2724
|
break;
|
|
2592
2725
|
case "end":
|
|
2593
|
-
|
|
2726
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
2727
|
+
break;
|
|
2594
2728
|
}
|
|
2595
|
-
return
|
|
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 };
|
|
2729
|
+
return coords;
|
|
2610
2730
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
let
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2731
|
+
var computePosition = async (reference, floating, config) => {
|
|
2732
|
+
const {
|
|
2733
|
+
placement = "bottom",
|
|
2734
|
+
strategy = "absolute",
|
|
2735
|
+
middleware = [],
|
|
2736
|
+
platform: platform2
|
|
2737
|
+
} = config;
|
|
2738
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
2739
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
2740
|
+
let rects = await platform2.getElementRects({
|
|
2741
|
+
reference,
|
|
2742
|
+
floating,
|
|
2743
|
+
strategy
|
|
2744
|
+
});
|
|
2745
|
+
let {
|
|
2746
|
+
x,
|
|
2747
|
+
y
|
|
2748
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
2749
|
+
let statefulPlacement = placement;
|
|
2750
|
+
let middlewareData = {};
|
|
2751
|
+
let resetCount = 0;
|
|
2752
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
2753
|
+
const {
|
|
2754
|
+
name,
|
|
2755
|
+
fn
|
|
2756
|
+
} = validMiddleware[i];
|
|
2757
|
+
const {
|
|
2758
|
+
x: nextX,
|
|
2759
|
+
y: nextY,
|
|
2760
|
+
data,
|
|
2761
|
+
reset
|
|
2762
|
+
} = await fn({
|
|
2763
|
+
x,
|
|
2764
|
+
y,
|
|
2765
|
+
initialPlacement: placement,
|
|
2766
|
+
placement: statefulPlacement,
|
|
2767
|
+
strategy,
|
|
2768
|
+
middlewareData,
|
|
2769
|
+
rects,
|
|
2770
|
+
platform: platform2,
|
|
2771
|
+
elements: {
|
|
2772
|
+
reference,
|
|
2773
|
+
floating
|
|
2774
|
+
}
|
|
2775
|
+
});
|
|
2776
|
+
x = nextX != null ? nextX : x;
|
|
2777
|
+
y = nextY != null ? nextY : y;
|
|
2778
|
+
middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
|
|
2779
|
+
[name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
|
|
2780
|
+
});
|
|
2781
|
+
if (reset && resetCount <= 50) {
|
|
2782
|
+
resetCount++;
|
|
2783
|
+
if (typeof reset === "object") {
|
|
2784
|
+
if (reset.placement) {
|
|
2785
|
+
statefulPlacement = reset.placement;
|
|
2786
|
+
}
|
|
2787
|
+
if (reset.rects) {
|
|
2788
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
2789
|
+
reference,
|
|
2790
|
+
floating,
|
|
2791
|
+
strategy
|
|
2792
|
+
}) : reset.rects;
|
|
2793
|
+
}
|
|
2794
|
+
({
|
|
2795
|
+
x,
|
|
2796
|
+
y
|
|
2797
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
2798
|
+
}
|
|
2799
|
+
i = -1;
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
return {
|
|
2803
|
+
x,
|
|
2804
|
+
y,
|
|
2805
|
+
placement: statefulPlacement,
|
|
2806
|
+
strategy,
|
|
2807
|
+
middlewareData
|
|
2808
|
+
};
|
|
2809
|
+
};
|
|
2810
|
+
async function detectOverflow(state, options) {
|
|
2811
|
+
var _await$platform$isEle;
|
|
2812
|
+
if (options === void 0) {
|
|
2813
|
+
options = {};
|
|
2814
|
+
}
|
|
2815
|
+
const {
|
|
2816
|
+
x,
|
|
2817
|
+
y,
|
|
2818
|
+
platform: platform2,
|
|
2819
|
+
rects,
|
|
2820
|
+
elements,
|
|
2821
|
+
strategy
|
|
2822
|
+
} = state;
|
|
2823
|
+
const {
|
|
2824
|
+
boundary = "clippingAncestors",
|
|
2825
|
+
rootBoundary = "viewport",
|
|
2826
|
+
elementContext = "floating",
|
|
2827
|
+
altBoundary = false,
|
|
2828
|
+
padding = 0
|
|
2829
|
+
} = evaluate(options, state);
|
|
2830
|
+
const paddingObject = getPaddingObject(padding);
|
|
2831
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
2832
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
2833
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
2834
|
+
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)),
|
|
2835
|
+
boundary,
|
|
2836
|
+
rootBoundary,
|
|
2837
|
+
strategy
|
|
2838
|
+
}));
|
|
2839
|
+
const rect = elementContext === "floating" ? __spreadProps(__spreadValues({}, rects.floating), {
|
|
2840
|
+
x,
|
|
2841
|
+
y
|
|
2842
|
+
}) : rects.reference;
|
|
2843
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
2844
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
2845
|
+
x: 1,
|
|
2846
|
+
y: 1
|
|
2847
|
+
} : {
|
|
2848
|
+
x: 1,
|
|
2849
|
+
y: 1
|
|
2850
|
+
};
|
|
2851
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2852
|
+
elements,
|
|
2853
|
+
rect,
|
|
2854
|
+
offsetParent,
|
|
2855
|
+
strategy
|
|
2856
|
+
}) : rect);
|
|
2857
|
+
return {
|
|
2858
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2859
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2860
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2861
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2862
|
+
};
|
|
2648
2863
|
}
|
|
2649
|
-
var
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2864
|
+
var arrow = (options) => ({
|
|
2865
|
+
name: "arrow",
|
|
2866
|
+
options,
|
|
2867
|
+
async fn(state) {
|
|
2868
|
+
const {
|
|
2869
|
+
x,
|
|
2870
|
+
y,
|
|
2871
|
+
placement,
|
|
2872
|
+
rects,
|
|
2873
|
+
platform: platform2,
|
|
2874
|
+
elements,
|
|
2875
|
+
middlewareData
|
|
2876
|
+
} = state;
|
|
2877
|
+
const {
|
|
2878
|
+
element,
|
|
2879
|
+
padding = 0
|
|
2880
|
+
} = evaluate(options, state) || {};
|
|
2881
|
+
if (element == null) {
|
|
2882
|
+
return {};
|
|
2662
2883
|
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2884
|
+
const paddingObject = getPaddingObject(padding);
|
|
2885
|
+
const coords = {
|
|
2886
|
+
x,
|
|
2887
|
+
y
|
|
2888
|
+
};
|
|
2889
|
+
const axis = getAlignmentAxis(placement);
|
|
2890
|
+
const length = getAxisLength(axis);
|
|
2891
|
+
const arrowDimensions = await platform2.getDimensions(element);
|
|
2892
|
+
const isYAxis = axis === "y";
|
|
2893
|
+
const minProp = isYAxis ? "top" : "left";
|
|
2894
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
2895
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
2896
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
2897
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
2898
|
+
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
2899
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
2900
|
+
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
2901
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
2902
|
+
}
|
|
2903
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
2904
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
2905
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
2906
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
2907
|
+
const min$1 = minPadding;
|
|
2908
|
+
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
2909
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2910
|
+
const offset2 = clamp(min$1, center, max2);
|
|
2911
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2912
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
2913
|
+
return {
|
|
2914
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
2915
|
+
data: __spreadValues({
|
|
2916
|
+
[axis]: offset2,
|
|
2917
|
+
centerOffset: center - offset2 - alignmentOffset
|
|
2918
|
+
}, shouldAddOffset && {
|
|
2919
|
+
alignmentOffset
|
|
2920
|
+
}),
|
|
2921
|
+
reset: shouldAddOffset
|
|
2922
|
+
};
|
|
2923
|
+
}
|
|
2924
|
+
});
|
|
2925
|
+
var flip = function(options) {
|
|
2926
|
+
if (options === void 0) {
|
|
2927
|
+
options = {};
|
|
2928
|
+
}
|
|
2929
|
+
return {
|
|
2930
|
+
name: "flip",
|
|
2931
|
+
options,
|
|
2932
|
+
async fn(state) {
|
|
2933
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
2934
|
+
const {
|
|
2935
|
+
placement,
|
|
2936
|
+
middlewareData,
|
|
2937
|
+
rects,
|
|
2938
|
+
initialPlacement,
|
|
2939
|
+
platform: platform2,
|
|
2940
|
+
elements
|
|
2941
|
+
} = state;
|
|
2942
|
+
const _a = evaluate(options, state), {
|
|
2943
|
+
mainAxis: checkMainAxis = true,
|
|
2944
|
+
crossAxis: checkCrossAxis = true,
|
|
2945
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
2946
|
+
fallbackStrategy = "bestFit",
|
|
2947
|
+
fallbackAxisSideDirection = "none",
|
|
2948
|
+
flipAlignment = true
|
|
2949
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
2950
|
+
"mainAxis",
|
|
2951
|
+
"crossAxis",
|
|
2952
|
+
"fallbackPlacements",
|
|
2953
|
+
"fallbackStrategy",
|
|
2954
|
+
"fallbackAxisSideDirection",
|
|
2955
|
+
"flipAlignment"
|
|
2956
|
+
]);
|
|
2957
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
2958
|
+
return {};
|
|
2959
|
+
}
|
|
2960
|
+
const side2 = getSide(placement);
|
|
2961
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
2962
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
2963
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
2964
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
|
2965
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2966
|
+
}
|
|
2967
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
2968
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2969
|
+
const overflows = [];
|
|
2970
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
2971
|
+
if (checkMainAxis) {
|
|
2972
|
+
overflows.push(overflow[side2]);
|
|
2973
|
+
}
|
|
2974
|
+
if (checkCrossAxis) {
|
|
2975
|
+
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
2976
|
+
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
2977
|
+
}
|
|
2978
|
+
overflowsData = [...overflowsData, {
|
|
2979
|
+
placement,
|
|
2980
|
+
overflows
|
|
2981
|
+
}];
|
|
2982
|
+
if (!overflows.every((side3) => side3 <= 0)) {
|
|
2983
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
2984
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
2985
|
+
const nextPlacement = placements2[nextIndex];
|
|
2986
|
+
if (nextPlacement) {
|
|
2987
|
+
return {
|
|
2988
|
+
data: {
|
|
2989
|
+
index: nextIndex,
|
|
2990
|
+
overflows: overflowsData
|
|
2991
|
+
},
|
|
2992
|
+
reset: {
|
|
2993
|
+
placement: nextPlacement
|
|
2994
|
+
}
|
|
2995
|
+
};
|
|
2996
|
+
}
|
|
2997
|
+
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;
|
|
2998
|
+
if (!resetPlacement) {
|
|
2999
|
+
switch (fallbackStrategy) {
|
|
3000
|
+
case "bestFit": {
|
|
3001
|
+
var _overflowsData$map$so;
|
|
3002
|
+
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];
|
|
3003
|
+
if (placement2) {
|
|
3004
|
+
resetPlacement = placement2;
|
|
3005
|
+
}
|
|
3006
|
+
break;
|
|
3007
|
+
}
|
|
3008
|
+
case "initialPlacement":
|
|
3009
|
+
resetPlacement = initialPlacement;
|
|
3010
|
+
break;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
if (placement !== resetPlacement) {
|
|
3014
|
+
return {
|
|
3015
|
+
reset: {
|
|
3016
|
+
placement: resetPlacement
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
2675
3019
|
}
|
|
2676
|
-
case "initialPlacement":
|
|
2677
|
-
n4 = l3;
|
|
2678
3020
|
}
|
|
2679
|
-
|
|
2680
|
-
return { reset: { placement: n4 } };
|
|
3021
|
+
return {};
|
|
2681
3022
|
}
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
};
|
|
2695
|
-
function O(t2) {
|
|
2696
|
-
return "x" === t2 ? "y" : "x";
|
|
3023
|
+
};
|
|
3024
|
+
};
|
|
3025
|
+
function getSideOffsets(overflow, rect) {
|
|
3026
|
+
return {
|
|
3027
|
+
top: overflow.top - rect.height,
|
|
3028
|
+
right: overflow.right - rect.width,
|
|
3029
|
+
bottom: overflow.bottom - rect.height,
|
|
3030
|
+
left: overflow.left - rect.width
|
|
3031
|
+
};
|
|
3032
|
+
}
|
|
3033
|
+
function isAnySideFullyClipped(overflow) {
|
|
3034
|
+
return sides.some((side2) => overflow[side2] >= 0);
|
|
2697
3035
|
}
|
|
2698
|
-
var
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
const
|
|
2707
|
-
|
|
3036
|
+
var hide = function(options) {
|
|
3037
|
+
if (options === void 0) {
|
|
3038
|
+
options = {};
|
|
3039
|
+
}
|
|
3040
|
+
return {
|
|
3041
|
+
name: "hide",
|
|
3042
|
+
options,
|
|
3043
|
+
async fn(state) {
|
|
3044
|
+
const {
|
|
3045
|
+
rects
|
|
3046
|
+
} = state;
|
|
3047
|
+
const _a = evaluate(options, state), {
|
|
3048
|
+
strategy = "referenceHidden"
|
|
3049
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
3050
|
+
"strategy"
|
|
3051
|
+
]);
|
|
3052
|
+
switch (strategy) {
|
|
3053
|
+
case "referenceHidden": {
|
|
3054
|
+
const overflow = await detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
|
|
3055
|
+
elementContext: "reference"
|
|
3056
|
+
}));
|
|
3057
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
3058
|
+
return {
|
|
3059
|
+
data: {
|
|
3060
|
+
referenceHiddenOffsets: offsets,
|
|
3061
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
3062
|
+
}
|
|
3063
|
+
};
|
|
3064
|
+
}
|
|
3065
|
+
case "escaped": {
|
|
3066
|
+
const overflow = await detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
|
|
3067
|
+
altBoundary: true
|
|
3068
|
+
}));
|
|
3069
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
3070
|
+
return {
|
|
3071
|
+
data: {
|
|
3072
|
+
escapedOffsets: offsets,
|
|
3073
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
}
|
|
3077
|
+
default: {
|
|
3078
|
+
return {};
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
2708
3081
|
}
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
3082
|
+
};
|
|
3083
|
+
};
|
|
3084
|
+
async function convertValueToCoords(state, options) {
|
|
3085
|
+
const {
|
|
3086
|
+
placement,
|
|
3087
|
+
platform: platform2,
|
|
3088
|
+
elements
|
|
3089
|
+
} = state;
|
|
3090
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
3091
|
+
const side2 = getSide(placement);
|
|
3092
|
+
const alignment = getAlignment(placement);
|
|
3093
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
3094
|
+
const mainAxisMulti = ["left", "top"].includes(side2) ? -1 : 1;
|
|
3095
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
3096
|
+
const rawValue = evaluate(options, state);
|
|
3097
|
+
let {
|
|
3098
|
+
mainAxis,
|
|
3099
|
+
crossAxis,
|
|
3100
|
+
alignmentAxis
|
|
3101
|
+
} = typeof rawValue === "number" ? {
|
|
3102
|
+
mainAxis: rawValue,
|
|
3103
|
+
crossAxis: 0,
|
|
3104
|
+
alignmentAxis: null
|
|
3105
|
+
} : __spreadValues({
|
|
3106
|
+
mainAxis: 0,
|
|
3107
|
+
crossAxis: 0,
|
|
3108
|
+
alignmentAxis: null
|
|
3109
|
+
}, rawValue);
|
|
3110
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
3111
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
3112
|
+
}
|
|
3113
|
+
return isVertical ? {
|
|
3114
|
+
x: crossAxis * crossAxisMulti,
|
|
3115
|
+
y: mainAxis * mainAxisMulti
|
|
3116
|
+
} : {
|
|
3117
|
+
x: mainAxis * mainAxisMulti,
|
|
3118
|
+
y: crossAxis * crossAxisMulti
|
|
3119
|
+
};
|
|
3120
|
+
}
|
|
3121
|
+
var offset = function(options) {
|
|
3122
|
+
if (options === void 0) {
|
|
3123
|
+
options = 0;
|
|
3124
|
+
}
|
|
3125
|
+
return {
|
|
3126
|
+
name: "offset",
|
|
3127
|
+
options,
|
|
3128
|
+
async fn(state) {
|
|
3129
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
3130
|
+
const {
|
|
3131
|
+
x,
|
|
3132
|
+
y,
|
|
3133
|
+
placement,
|
|
3134
|
+
middlewareData
|
|
3135
|
+
} = state;
|
|
3136
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
3137
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
3138
|
+
return {};
|
|
3139
|
+
}
|
|
3140
|
+
return {
|
|
3141
|
+
x: x + diffCoords.x,
|
|
3142
|
+
y: y + diffCoords.y,
|
|
3143
|
+
data: __spreadProps(__spreadValues({}, diffCoords), {
|
|
3144
|
+
placement
|
|
3145
|
+
})
|
|
3146
|
+
};
|
|
2712
3147
|
}
|
|
2713
|
-
|
|
2714
|
-
return __spreadProps(__spreadValues({}, w3), { data: { x: w3.x - i3, y: w3.y - o3 } });
|
|
2715
|
-
} };
|
|
3148
|
+
};
|
|
2716
3149
|
};
|
|
2717
3150
|
|
|
2718
|
-
// node_modules/.pnpm/@floating-ui+
|
|
2719
|
-
function
|
|
2720
|
-
|
|
3151
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
3152
|
+
function getNodeName(node) {
|
|
3153
|
+
if (isNode(node)) {
|
|
3154
|
+
return (node.nodeName || "").toLowerCase();
|
|
3155
|
+
}
|
|
3156
|
+
return "#document";
|
|
3157
|
+
}
|
|
3158
|
+
function getWindow(node) {
|
|
3159
|
+
var _node$ownerDocument;
|
|
3160
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
2721
3161
|
}
|
|
2722
|
-
function
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
if (!n2(t2)) {
|
|
2726
|
-
const e2 = t2.ownerDocument;
|
|
2727
|
-
return e2 && e2.defaultView || window;
|
|
2728
|
-
}
|
|
2729
|
-
return t2;
|
|
3162
|
+
function getDocumentElement(node) {
|
|
3163
|
+
var _ref;
|
|
3164
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
2730
3165
|
}
|
|
2731
|
-
function
|
|
2732
|
-
return
|
|
3166
|
+
function isNode(value) {
|
|
3167
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
2733
3168
|
}
|
|
2734
|
-
function
|
|
2735
|
-
return
|
|
3169
|
+
function isElement(value) {
|
|
3170
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
2736
3171
|
}
|
|
2737
|
-
function
|
|
2738
|
-
|
|
2739
|
-
return null != t2 && t2.brands ? t2.brands.map((t3) => t3.brand + "/" + t3.version).join(" ") : navigator.userAgent;
|
|
3172
|
+
function isHTMLElement(value) {
|
|
3173
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
2740
3174
|
}
|
|
2741
|
-
function
|
|
2742
|
-
|
|
3175
|
+
function isShadowRoot(value) {
|
|
3176
|
+
if (typeof ShadowRoot === "undefined") {
|
|
3177
|
+
return false;
|
|
3178
|
+
}
|
|
3179
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
2743
3180
|
}
|
|
2744
|
-
function
|
|
2745
|
-
|
|
3181
|
+
function isOverflowElement(element) {
|
|
3182
|
+
const {
|
|
3183
|
+
overflow,
|
|
3184
|
+
overflowX,
|
|
3185
|
+
overflowY,
|
|
3186
|
+
display
|
|
3187
|
+
} = getComputedStyle(element);
|
|
3188
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
2746
3189
|
}
|
|
2747
|
-
function
|
|
2748
|
-
|
|
3190
|
+
function isTableElement(element) {
|
|
3191
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
3192
|
+
}
|
|
3193
|
+
function isContainingBlock(element) {
|
|
3194
|
+
const webkit = isWebKit();
|
|
3195
|
+
const css10 = getComputedStyle(element);
|
|
3196
|
+
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));
|
|
3197
|
+
}
|
|
3198
|
+
function getContainingBlock(element) {
|
|
3199
|
+
let currentNode = getParentNode(element);
|
|
3200
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3201
|
+
if (isContainingBlock(currentNode)) {
|
|
3202
|
+
return currentNode;
|
|
3203
|
+
} else {
|
|
3204
|
+
currentNode = getParentNode(currentNode);
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
return null;
|
|
3208
|
+
}
|
|
3209
|
+
function isWebKit() {
|
|
3210
|
+
if (typeof CSS === "undefined" || !CSS.supports)
|
|
2749
3211
|
return false;
|
|
2750
|
-
return
|
|
3212
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
3213
|
+
}
|
|
3214
|
+
function isLastTraversableNode(node) {
|
|
3215
|
+
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
3216
|
+
}
|
|
3217
|
+
function getComputedStyle(element) {
|
|
3218
|
+
return getWindow(element).getComputedStyle(element);
|
|
2751
3219
|
}
|
|
2752
|
-
function
|
|
2753
|
-
|
|
2754
|
-
|
|
3220
|
+
function getNodeScroll(element) {
|
|
3221
|
+
if (isElement(element)) {
|
|
3222
|
+
return {
|
|
3223
|
+
scrollLeft: element.scrollLeft,
|
|
3224
|
+
scrollTop: element.scrollTop
|
|
3225
|
+
};
|
|
3226
|
+
}
|
|
3227
|
+
return {
|
|
3228
|
+
scrollLeft: element.pageXOffset,
|
|
3229
|
+
scrollTop: element.pageYOffset
|
|
3230
|
+
};
|
|
2755
3231
|
}
|
|
2756
|
-
function
|
|
2757
|
-
|
|
3232
|
+
function getParentNode(node) {
|
|
3233
|
+
if (getNodeName(node) === "html") {
|
|
3234
|
+
return node;
|
|
3235
|
+
}
|
|
3236
|
+
const result = (
|
|
3237
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
3238
|
+
node.assignedSlot || // DOM Element detected.
|
|
3239
|
+
node.parentNode || // ShadowRoot detected.
|
|
3240
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
3241
|
+
getDocumentElement(node)
|
|
3242
|
+
);
|
|
3243
|
+
return isShadowRoot(result) ? result.host : result;
|
|
2758
3244
|
}
|
|
2759
|
-
function
|
|
2760
|
-
const
|
|
2761
|
-
|
|
3245
|
+
function getNearestOverflowAncestor(node) {
|
|
3246
|
+
const parentNode = getParentNode(node);
|
|
3247
|
+
if (isLastTraversableNode(parentNode)) {
|
|
3248
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
3249
|
+
}
|
|
3250
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
3251
|
+
return parentNode;
|
|
3252
|
+
}
|
|
3253
|
+
return getNearestOverflowAncestor(parentNode);
|
|
2762
3254
|
}
|
|
2763
|
-
function
|
|
2764
|
-
|
|
3255
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
3256
|
+
var _node$ownerDocument2;
|
|
3257
|
+
if (list === void 0) {
|
|
3258
|
+
list = [];
|
|
3259
|
+
}
|
|
3260
|
+
if (traverseIframes === void 0) {
|
|
3261
|
+
traverseIframes = true;
|
|
3262
|
+
}
|
|
3263
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
3264
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
3265
|
+
const win = getWindow(scrollableAncestor);
|
|
3266
|
+
if (isBody) {
|
|
3267
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
3268
|
+
}
|
|
3269
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2765
3270
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
const
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
const
|
|
2776
|
-
|
|
3271
|
+
|
|
3272
|
+
// node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
3273
|
+
function getCssDimensions(element) {
|
|
3274
|
+
const css10 = getComputedStyle(element);
|
|
3275
|
+
let width = parseFloat(css10.width) || 0;
|
|
3276
|
+
let height = parseFloat(css10.height) || 0;
|
|
3277
|
+
const hasOffset = isHTMLElement(element);
|
|
3278
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
3279
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
3280
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
3281
|
+
if (shouldFallback) {
|
|
3282
|
+
width = offsetWidth;
|
|
3283
|
+
height = offsetHeight;
|
|
3284
|
+
}
|
|
3285
|
+
return {
|
|
3286
|
+
width,
|
|
3287
|
+
height,
|
|
3288
|
+
$: shouldFallback
|
|
3289
|
+
};
|
|
2777
3290
|
}
|
|
2778
|
-
function
|
|
2779
|
-
return (
|
|
2780
|
-
var e2;
|
|
3291
|
+
function unwrapElement(element) {
|
|
3292
|
+
return !isElement(element) ? element.contextElement : element;
|
|
2781
3293
|
}
|
|
2782
|
-
function
|
|
2783
|
-
|
|
3294
|
+
function getScale(element) {
|
|
3295
|
+
const domElement = unwrapElement(element);
|
|
3296
|
+
if (!isHTMLElement(domElement)) {
|
|
3297
|
+
return createCoords(1);
|
|
3298
|
+
}
|
|
3299
|
+
const rect = domElement.getBoundingClientRect();
|
|
3300
|
+
const {
|
|
3301
|
+
width,
|
|
3302
|
+
height,
|
|
3303
|
+
$
|
|
3304
|
+
} = getCssDimensions(domElement);
|
|
3305
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
3306
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
3307
|
+
if (!x || !Number.isFinite(x)) {
|
|
3308
|
+
x = 1;
|
|
3309
|
+
}
|
|
3310
|
+
if (!y || !Number.isFinite(y)) {
|
|
3311
|
+
y = 1;
|
|
3312
|
+
}
|
|
3313
|
+
return {
|
|
3314
|
+
x,
|
|
3315
|
+
y
|
|
3316
|
+
};
|
|
2784
3317
|
}
|
|
2785
|
-
|
|
2786
|
-
|
|
3318
|
+
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
3319
|
+
function getVisualOffsets(element) {
|
|
3320
|
+
const win = getWindow(element);
|
|
3321
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
3322
|
+
return noOffsets;
|
|
3323
|
+
}
|
|
3324
|
+
return {
|
|
3325
|
+
x: win.visualViewport.offsetLeft,
|
|
3326
|
+
y: win.visualViewport.offsetTop
|
|
3327
|
+
};
|
|
2787
3328
|
}
|
|
2788
|
-
function
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
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 };
|
|
3329
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
3330
|
+
if (isFixed === void 0) {
|
|
3331
|
+
isFixed = false;
|
|
3332
|
+
}
|
|
3333
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
3334
|
+
return false;
|
|
3335
|
+
}
|
|
3336
|
+
return isFixed;
|
|
2802
3337
|
}
|
|
2803
|
-
function
|
|
2804
|
-
|
|
3338
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
3339
|
+
if (includeScale === void 0) {
|
|
3340
|
+
includeScale = false;
|
|
3341
|
+
}
|
|
3342
|
+
if (isFixedStrategy === void 0) {
|
|
3343
|
+
isFixedStrategy = false;
|
|
3344
|
+
}
|
|
3345
|
+
const clientRect = element.getBoundingClientRect();
|
|
3346
|
+
const domElement = unwrapElement(element);
|
|
3347
|
+
let scale = createCoords(1);
|
|
3348
|
+
if (includeScale) {
|
|
3349
|
+
if (offsetParent) {
|
|
3350
|
+
if (isElement(offsetParent)) {
|
|
3351
|
+
scale = getScale(offsetParent);
|
|
3352
|
+
}
|
|
3353
|
+
} else {
|
|
3354
|
+
scale = getScale(element);
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
3358
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
3359
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
3360
|
+
let width = clientRect.width / scale.x;
|
|
3361
|
+
let height = clientRect.height / scale.y;
|
|
3362
|
+
if (domElement) {
|
|
3363
|
+
const win = getWindow(domElement);
|
|
3364
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3365
|
+
let currentWin = win;
|
|
3366
|
+
let currentIFrame = currentWin.frameElement;
|
|
3367
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
3368
|
+
const iframeScale = getScale(currentIFrame);
|
|
3369
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
3370
|
+
const css10 = getComputedStyle(currentIFrame);
|
|
3371
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css10.paddingLeft)) * iframeScale.x;
|
|
3372
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css10.paddingTop)) * iframeScale.y;
|
|
3373
|
+
x *= iframeScale.x;
|
|
3374
|
+
y *= iframeScale.y;
|
|
3375
|
+
width *= iframeScale.x;
|
|
3376
|
+
height *= iframeScale.y;
|
|
3377
|
+
x += left;
|
|
3378
|
+
y += top;
|
|
3379
|
+
currentWin = getWindow(currentIFrame);
|
|
3380
|
+
currentIFrame = currentWin.frameElement;
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
return rectToClientRect({
|
|
3384
|
+
width,
|
|
3385
|
+
height,
|
|
3386
|
+
x,
|
|
3387
|
+
y
|
|
3388
|
+
});
|
|
2805
3389
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
3390
|
+
var topLayerSelectors = [":popover-open", ":modal"];
|
|
3391
|
+
function isTopLayer(floating) {
|
|
3392
|
+
return topLayerSelectors.some((selector) => {
|
|
3393
|
+
try {
|
|
3394
|
+
return floating.matches(selector);
|
|
3395
|
+
} catch (e) {
|
|
3396
|
+
return false;
|
|
3397
|
+
}
|
|
3398
|
+
});
|
|
2808
3399
|
}
|
|
2809
|
-
function
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
3400
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
3401
|
+
let {
|
|
3402
|
+
elements,
|
|
3403
|
+
rect,
|
|
3404
|
+
offsetParent,
|
|
3405
|
+
strategy
|
|
3406
|
+
} = _ref;
|
|
3407
|
+
const isFixed = strategy === "fixed";
|
|
3408
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
3409
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
3410
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
3411
|
+
return rect;
|
|
3412
|
+
}
|
|
3413
|
+
let scroll = {
|
|
3414
|
+
scrollLeft: 0,
|
|
3415
|
+
scrollTop: 0
|
|
3416
|
+
};
|
|
3417
|
+
let scale = createCoords(1);
|
|
3418
|
+
const offsets = createCoords(0);
|
|
3419
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
3420
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3421
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
3422
|
+
scroll = getNodeScroll(offsetParent);
|
|
2820
3423
|
}
|
|
2821
|
-
|
|
2822
|
-
|
|
3424
|
+
if (isHTMLElement(offsetParent)) {
|
|
3425
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
3426
|
+
scale = getScale(offsetParent);
|
|
3427
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3428
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
return {
|
|
3432
|
+
width: rect.width * scale.x,
|
|
3433
|
+
height: rect.height * scale.y,
|
|
3434
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
3435
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
3436
|
+
};
|
|
2823
3437
|
}
|
|
2824
|
-
function
|
|
2825
|
-
|
|
2826
|
-
return { width: t2.offsetWidth, height: t2.offsetHeight };
|
|
2827
|
-
const e2 = w2(t2);
|
|
2828
|
-
return { width: e2.width, height: e2.height };
|
|
3438
|
+
function getClientRects(element) {
|
|
3439
|
+
return Array.from(element.getClientRects());
|
|
2829
3440
|
}
|
|
2830
|
-
function
|
|
2831
|
-
|
|
2832
|
-
return ["html", "body", "#document"].includes(r3(e2)) ? t2.ownerDocument.body : c2(e2) && u2(e2) ? e2 : E2(e2);
|
|
3441
|
+
function getWindowScrollBarX(element) {
|
|
3442
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
2833
3443
|
}
|
|
2834
|
-
function
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
const
|
|
2838
|
-
|
|
3444
|
+
function getDocumentRect(element) {
|
|
3445
|
+
const html26 = getDocumentElement(element);
|
|
3446
|
+
const scroll = getNodeScroll(element);
|
|
3447
|
+
const body = element.ownerDocument.body;
|
|
3448
|
+
const width = max(html26.scrollWidth, html26.clientWidth, body.scrollWidth, body.clientWidth);
|
|
3449
|
+
const height = max(html26.scrollHeight, html26.clientHeight, body.scrollHeight, body.clientHeight);
|
|
3450
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
3451
|
+
const y = -scroll.scrollTop;
|
|
3452
|
+
if (getComputedStyle(body).direction === "rtl") {
|
|
3453
|
+
x += max(html26.clientWidth, body.clientWidth) - width;
|
|
3454
|
+
}
|
|
3455
|
+
return {
|
|
3456
|
+
width,
|
|
3457
|
+
height,
|
|
3458
|
+
x,
|
|
3459
|
+
y
|
|
3460
|
+
};
|
|
2839
3461
|
}
|
|
2840
|
-
function
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
3462
|
+
function getViewportRect(element, strategy) {
|
|
3463
|
+
const win = getWindow(element);
|
|
3464
|
+
const html26 = getDocumentElement(element);
|
|
3465
|
+
const visualViewport = win.visualViewport;
|
|
3466
|
+
let width = html26.clientWidth;
|
|
3467
|
+
let height = html26.clientHeight;
|
|
3468
|
+
let x = 0;
|
|
3469
|
+
let y = 0;
|
|
3470
|
+
if (visualViewport) {
|
|
3471
|
+
width = visualViewport.width;
|
|
3472
|
+
height = visualViewport.height;
|
|
3473
|
+
const visualViewportBased = isWebKit();
|
|
3474
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
3475
|
+
x = visualViewport.offsetLeft;
|
|
3476
|
+
y = visualViewport.offsetTop;
|
|
2848
3477
|
}
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
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)));
|
|
3478
|
+
}
|
|
3479
|
+
return {
|
|
3480
|
+
width,
|
|
3481
|
+
height,
|
|
3482
|
+
x,
|
|
3483
|
+
y
|
|
3484
|
+
};
|
|
2860
3485
|
}
|
|
2861
|
-
function
|
|
2862
|
-
const
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
3486
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
3487
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
3488
|
+
const top = clientRect.top + element.clientTop;
|
|
3489
|
+
const left = clientRect.left + element.clientLeft;
|
|
3490
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
3491
|
+
const width = element.clientWidth * scale.x;
|
|
3492
|
+
const height = element.clientHeight * scale.y;
|
|
3493
|
+
const x = left * scale.x;
|
|
3494
|
+
const y = top * scale.y;
|
|
3495
|
+
return {
|
|
3496
|
+
width,
|
|
3497
|
+
height,
|
|
3498
|
+
x,
|
|
3499
|
+
y
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
3503
|
+
let rect;
|
|
3504
|
+
if (clippingAncestor === "viewport") {
|
|
3505
|
+
rect = getViewportRect(element, strategy);
|
|
3506
|
+
} else if (clippingAncestor === "document") {
|
|
3507
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
3508
|
+
} else if (isElement(clippingAncestor)) {
|
|
3509
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
3510
|
+
} else {
|
|
3511
|
+
const visualOffsets = getVisualOffsets(element);
|
|
3512
|
+
rect = __spreadProps(__spreadValues({}, clippingAncestor), {
|
|
3513
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
3514
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
3515
|
+
});
|
|
3516
|
+
}
|
|
3517
|
+
return rectToClientRect(rect);
|
|
3518
|
+
}
|
|
3519
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
3520
|
+
const parentNode = getParentNode(element);
|
|
3521
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
2875
3522
|
return false;
|
|
2876
|
-
}
|
|
3523
|
+
}
|
|
3524
|
+
return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
3525
|
+
}
|
|
3526
|
+
function getClippingElementAncestors(element, cache2) {
|
|
3527
|
+
const cachedResult = cache2.get(element);
|
|
3528
|
+
if (cachedResult) {
|
|
3529
|
+
return cachedResult;
|
|
3530
|
+
}
|
|
3531
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
3532
|
+
let currentContainingBlockComputedStyle = null;
|
|
3533
|
+
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
3534
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
3535
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3536
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
3537
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
3538
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
3539
|
+
currentContainingBlockComputedStyle = null;
|
|
3540
|
+
}
|
|
3541
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
3542
|
+
if (shouldDropCurrentNode) {
|
|
3543
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
3544
|
+
} else {
|
|
3545
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
3546
|
+
}
|
|
3547
|
+
currentNode = getParentNode(currentNode);
|
|
3548
|
+
}
|
|
3549
|
+
cache2.set(element, result);
|
|
3550
|
+
return result;
|
|
3551
|
+
}
|
|
3552
|
+
function getClippingRect(_ref) {
|
|
3553
|
+
let {
|
|
3554
|
+
element,
|
|
3555
|
+
boundary,
|
|
3556
|
+
rootBoundary,
|
|
3557
|
+
strategy
|
|
3558
|
+
} = _ref;
|
|
3559
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3560
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
3561
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
3562
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
3563
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
3564
|
+
accRect.top = max(rect.top, accRect.top);
|
|
3565
|
+
accRect.right = min(rect.right, accRect.right);
|
|
3566
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
3567
|
+
accRect.left = max(rect.left, accRect.left);
|
|
3568
|
+
return accRect;
|
|
3569
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
3570
|
+
return {
|
|
3571
|
+
width: clippingRect.right - clippingRect.left,
|
|
3572
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
3573
|
+
x: clippingRect.left,
|
|
3574
|
+
y: clippingRect.top
|
|
3575
|
+
};
|
|
3576
|
+
}
|
|
3577
|
+
function getDimensions(element) {
|
|
3578
|
+
const {
|
|
3579
|
+
width,
|
|
3580
|
+
height
|
|
3581
|
+
} = getCssDimensions(element);
|
|
3582
|
+
return {
|
|
3583
|
+
width,
|
|
3584
|
+
height
|
|
3585
|
+
};
|
|
3586
|
+
}
|
|
3587
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
3588
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
3589
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
3590
|
+
const isFixed = strategy === "fixed";
|
|
3591
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
3592
|
+
let scroll = {
|
|
3593
|
+
scrollLeft: 0,
|
|
3594
|
+
scrollTop: 0
|
|
3595
|
+
};
|
|
3596
|
+
const offsets = createCoords(0);
|
|
3597
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3598
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
3599
|
+
scroll = getNodeScroll(offsetParent);
|
|
3600
|
+
}
|
|
3601
|
+
if (isOffsetParentAnElement) {
|
|
3602
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
3603
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3604
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3605
|
+
} else if (documentElement) {
|
|
3606
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
|
3610
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
|
3611
|
+
return {
|
|
3612
|
+
x,
|
|
3613
|
+
y,
|
|
3614
|
+
width: rect.width,
|
|
3615
|
+
height: rect.height
|
|
3616
|
+
};
|
|
3617
|
+
}
|
|
3618
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
3619
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
3620
|
+
return null;
|
|
3621
|
+
}
|
|
3622
|
+
if (polyfill) {
|
|
3623
|
+
return polyfill(element);
|
|
3624
|
+
}
|
|
3625
|
+
return element.offsetParent;
|
|
2877
3626
|
}
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
},
|
|
2901
|
-
|
|
3627
|
+
function getOffsetParent(element, polyfill) {
|
|
3628
|
+
const window2 = getWindow(element);
|
|
3629
|
+
if (!isHTMLElement(element) || isTopLayer(element)) {
|
|
3630
|
+
return window2;
|
|
3631
|
+
}
|
|
3632
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
3633
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
3634
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
3635
|
+
}
|
|
3636
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
3637
|
+
return window2;
|
|
3638
|
+
}
|
|
3639
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
3640
|
+
}
|
|
3641
|
+
var getElementRects = async function(data) {
|
|
3642
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
3643
|
+
const getDimensionsFn = this.getDimensions;
|
|
3644
|
+
return {
|
|
3645
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
3646
|
+
floating: __spreadValues({
|
|
3647
|
+
x: 0,
|
|
3648
|
+
y: 0
|
|
3649
|
+
}, await getDimensionsFn(data.floating))
|
|
3650
|
+
};
|
|
3651
|
+
};
|
|
3652
|
+
function isRTL(element) {
|
|
3653
|
+
return getComputedStyle(element).direction === "rtl";
|
|
3654
|
+
}
|
|
3655
|
+
var platform = {
|
|
3656
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
3657
|
+
getDocumentElement,
|
|
3658
|
+
getClippingRect,
|
|
3659
|
+
getOffsetParent,
|
|
3660
|
+
getElementRects,
|
|
3661
|
+
getClientRects,
|
|
3662
|
+
getDimensions,
|
|
3663
|
+
getScale,
|
|
3664
|
+
isElement,
|
|
3665
|
+
isRTL
|
|
3666
|
+
};
|
|
3667
|
+
var flip2 = flip;
|
|
3668
|
+
var hide2 = hide;
|
|
3669
|
+
var arrow2 = arrow;
|
|
3670
|
+
var computePosition2 = (reference, floating, options) => {
|
|
3671
|
+
const cache2 = /* @__PURE__ */ new Map();
|
|
3672
|
+
const mergedOptions = __spreadValues({
|
|
3673
|
+
platform
|
|
3674
|
+
}, options);
|
|
3675
|
+
const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), {
|
|
3676
|
+
_c: cache2
|
|
3677
|
+
});
|
|
3678
|
+
return computePosition(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), {
|
|
3679
|
+
platform: platformWithCache
|
|
3680
|
+
}));
|
|
3681
|
+
};
|
|
2902
3682
|
|
|
2903
|
-
// node_modules/.pnpm/@warp-ds+core@1.
|
|
3683
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.1_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
|
|
3684
|
+
var TOP_START = "top-start";
|
|
2904
3685
|
var TOP = "top";
|
|
3686
|
+
var TOP_END = "top-end";
|
|
3687
|
+
var RIGHT_START = "right-start";
|
|
3688
|
+
var RIGHT = "right";
|
|
3689
|
+
var RIGHT_END = "right-end";
|
|
3690
|
+
var BOTTOM_START = "bottom-start";
|
|
2905
3691
|
var BOTTOM = "bottom";
|
|
3692
|
+
var BOTTOM_END = "bottom-end";
|
|
3693
|
+
var LEFT_START = "left-start";
|
|
2906
3694
|
var LEFT = "left";
|
|
2907
|
-
var
|
|
3695
|
+
var LEFT_END = "left-end";
|
|
3696
|
+
var directions = [
|
|
3697
|
+
TOP_START,
|
|
3698
|
+
TOP,
|
|
3699
|
+
TOP_END,
|
|
3700
|
+
RIGHT_START,
|
|
3701
|
+
RIGHT,
|
|
3702
|
+
RIGHT_END,
|
|
3703
|
+
BOTTOM_START,
|
|
3704
|
+
BOTTOM,
|
|
3705
|
+
BOTTOM_END,
|
|
3706
|
+
LEFT_START,
|
|
3707
|
+
LEFT,
|
|
3708
|
+
LEFT_END
|
|
3709
|
+
];
|
|
2908
3710
|
var opposites = {
|
|
3711
|
+
[TOP_START]: BOTTOM_START,
|
|
2909
3712
|
[TOP]: BOTTOM,
|
|
3713
|
+
[TOP_END]: BOTTOM_END,
|
|
3714
|
+
[BOTTOM_START]: TOP_START,
|
|
2910
3715
|
[BOTTOM]: TOP,
|
|
3716
|
+
[BOTTOM_END]: TOP_END,
|
|
3717
|
+
[LEFT_START]: RIGHT_START,
|
|
2911
3718
|
[LEFT]: RIGHT,
|
|
2912
|
-
[
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
[
|
|
2916
|
-
[BOTTOM]: "\u2193",
|
|
2917
|
-
[LEFT]: "\u2190",
|
|
2918
|
-
[RIGHT]: "\u2192"
|
|
3719
|
+
[LEFT_END]: RIGHT_END,
|
|
3720
|
+
[RIGHT_START]: LEFT_START,
|
|
3721
|
+
[RIGHT]: LEFT,
|
|
3722
|
+
[RIGHT_END]: LEFT_END
|
|
2919
3723
|
};
|
|
2920
3724
|
var rotation = {
|
|
3725
|
+
[LEFT_START]: -45,
|
|
2921
3726
|
[LEFT]: -45,
|
|
3727
|
+
[LEFT_END]: -45,
|
|
3728
|
+
[TOP_START]: 45,
|
|
2922
3729
|
[TOP]: 45,
|
|
3730
|
+
[TOP_END]: 45,
|
|
3731
|
+
[RIGHT_START]: 135,
|
|
2923
3732
|
[RIGHT]: 135,
|
|
2924
|
-
[
|
|
3733
|
+
[RIGHT_END]: 135,
|
|
3734
|
+
[BOTTOM_START]: -135,
|
|
3735
|
+
[BOTTOM]: -135,
|
|
3736
|
+
[BOTTOM_END]: -135
|
|
2925
3737
|
};
|
|
2926
3738
|
var middlePosition = "calc(50% - 7px)";
|
|
2927
|
-
var isDirectionVertical = (name) => [TOP, BOTTOM].includes(name);
|
|
2928
|
-
|
|
3739
|
+
var isDirectionVertical = (name) => [TOP_START, TOP, TOP_END, BOTTOM_START, BOTTOM, BOTTOM_END].includes(name);
|
|
3740
|
+
var arrowDirectionClassname = (dir) => {
|
|
3741
|
+
let direction;
|
|
3742
|
+
if (/-/.test(dir)) {
|
|
3743
|
+
direction = dir.split("-").map((d) => d.charAt(0).toUpperCase() + d.slice(1)).join("");
|
|
3744
|
+
} else {
|
|
3745
|
+
direction = dir.charAt(0).toUpperCase() + dir.slice(1);
|
|
3746
|
+
}
|
|
3747
|
+
return direction;
|
|
3748
|
+
};
|
|
3749
|
+
var side = (dir) => dir.split("-")[0];
|
|
3750
|
+
var staticSide = (dir) => opposites[side(dir)];
|
|
3751
|
+
var arrowDirection = (dir) => opposites[dir];
|
|
3752
|
+
var arrowRotation = (dir) => rotation[arrowDirection(dir)];
|
|
3753
|
+
var applyArrowStyles = (arrowEl, arrowRotation2, dir) => {
|
|
3754
|
+
Object.assign(arrowEl == null ? void 0 : arrowEl.style, {
|
|
3755
|
+
borderTopLeftRadius: "4px",
|
|
3756
|
+
zIndex: 1,
|
|
3757
|
+
// border alignment is off by a fraction of a pixel, this fixes it
|
|
3758
|
+
[`margin${arrowDirectionClassname(staticSide(dir))}`]: "-0.5px",
|
|
3759
|
+
transform: `rotate(${arrowRotation2}deg)`
|
|
3760
|
+
});
|
|
3761
|
+
};
|
|
3762
|
+
function computeCalloutArrow({ actualDirection, directionName = BOTTOM, arrowEl }) {
|
|
2929
3763
|
if (!arrowEl)
|
|
2930
3764
|
return;
|
|
2931
3765
|
actualDirection = directionName;
|
|
2932
3766
|
const directionIsVertical = isDirectionVertical(directionName);
|
|
2933
|
-
arrowEl
|
|
2934
|
-
|
|
3767
|
+
Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
|
|
3768
|
+
left: directionIsVertical ? middlePosition : "",
|
|
3769
|
+
top: !directionIsVertical ? middlePosition : ""
|
|
3770
|
+
});
|
|
3771
|
+
applyArrowStyles(arrowEl, arrowRotation(actualDirection), actualDirection);
|
|
2935
3772
|
}
|
|
2936
3773
|
async function useRecompute(state) {
|
|
2937
|
-
var _a, _b;
|
|
2938
|
-
if (!state.isShowing)
|
|
3774
|
+
var _a, _b, _c;
|
|
3775
|
+
if (!(state == null ? void 0 : state.isShowing))
|
|
2939
3776
|
return;
|
|
2940
|
-
|
|
2941
|
-
|
|
3777
|
+
if (state == null ? void 0 : state.waitForDOM) {
|
|
3778
|
+
await (state == null ? void 0 : state.waitForDOM());
|
|
3779
|
+
}
|
|
3780
|
+
if (state == null ? void 0 : state.isCallout)
|
|
2942
3781
|
return computeCalloutArrow(state);
|
|
2943
|
-
|
|
2944
|
-
|
|
3782
|
+
if (!(state == null ? void 0 : state.targetEl) || !(state == null ? void 0 : state.attentionEl))
|
|
3783
|
+
return;
|
|
3784
|
+
const targetEl = state == null ? void 0 : state.targetEl;
|
|
3785
|
+
const attentionEl = state == null ? void 0 : state.attentionEl;
|
|
3786
|
+
computePosition2(targetEl, attentionEl, {
|
|
3787
|
+
placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
|
|
2945
3788
|
middleware: [
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
3789
|
+
offset({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
|
|
3790
|
+
(state == null ? void 0 : state.flip) && flip2({
|
|
3791
|
+
crossAxis: state == null ? void 0 : state.crossAxis,
|
|
3792
|
+
fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
|
|
3793
|
+
}),
|
|
3794
|
+
!(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
|
|
3795
|
+
hide2()
|
|
3796
|
+
//will hide the attentionEl when it appears detached from the targetEl. Can be called multiple times in the middleware-array if you want to use several strategies. Default strategy is 'referenceHidden'.
|
|
2953
3797
|
]
|
|
3798
|
+
}).then(({ x, y, middlewareData, placement }) => {
|
|
3799
|
+
state.actualDirection = placement;
|
|
3800
|
+
Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
|
|
3801
|
+
left: `${x}px`,
|
|
3802
|
+
top: `${y}px`
|
|
3803
|
+
});
|
|
3804
|
+
if ((middlewareData == null ? void 0 : middlewareData.hide) && !(state == null ? void 0 : state.isCallout)) {
|
|
3805
|
+
const { referenceHidden } = middlewareData == null ? void 0 : middlewareData.hide;
|
|
3806
|
+
Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
|
|
3807
|
+
visibility: referenceHidden ? "hidden" : ""
|
|
3808
|
+
});
|
|
3809
|
+
}
|
|
3810
|
+
const isRtl = window.getComputedStyle(attentionEl).direction === "rtl";
|
|
3811
|
+
const arrowPlacement = arrowDirection(placement).split("-")[1];
|
|
3812
|
+
if ((middlewareData == null ? void 0 : middlewareData.arrow) && (state == null ? void 0 : state.arrowEl)) {
|
|
3813
|
+
const arrowEl = state == null ? void 0 : state.arrowEl;
|
|
3814
|
+
const { x: x2, y: y2 } = middlewareData == null ? void 0 : middlewareData.arrow;
|
|
3815
|
+
let top = "";
|
|
3816
|
+
let right = "";
|
|
3817
|
+
let bottom = "";
|
|
3818
|
+
let left = "";
|
|
3819
|
+
if (arrowPlacement === "start") {
|
|
3820
|
+
const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
|
|
3821
|
+
top = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
|
|
3822
|
+
right = isRtl ? value : "";
|
|
3823
|
+
left = isRtl ? "" : value;
|
|
3824
|
+
} else if (arrowPlacement === "end") {
|
|
3825
|
+
const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
|
|
3826
|
+
right = isRtl ? "" : value;
|
|
3827
|
+
left = isRtl ? value : "";
|
|
3828
|
+
bottom = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
|
|
3829
|
+
} else {
|
|
3830
|
+
left = typeof x2 === "number" ? `${x2}px` : "";
|
|
3831
|
+
top = typeof y2 === "number" ? `${y2}px` : "";
|
|
3832
|
+
}
|
|
3833
|
+
Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
|
|
3834
|
+
top,
|
|
3835
|
+
right,
|
|
3836
|
+
bottom,
|
|
3837
|
+
left
|
|
3838
|
+
});
|
|
3839
|
+
applyArrowStyles(arrowEl, arrowRotation(placement), placement);
|
|
3840
|
+
}
|
|
2954
3841
|
});
|
|
2955
|
-
state
|
|
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
|
-
}
|
|
3842
|
+
return state;
|
|
2966
3843
|
}
|
|
2967
3844
|
|
|
2968
3845
|
// packages/attention/locales/en/messages.mjs
|
|
@@ -2990,8 +3867,8 @@ function detectLocale7() {
|
|
|
2990
3867
|
try {
|
|
2991
3868
|
const htmlLocale = document.documentElement.lang;
|
|
2992
3869
|
return getSupportedLocale7(htmlLocale);
|
|
2993
|
-
} catch (
|
|
2994
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
3870
|
+
} catch (e) {
|
|
3871
|
+
console.warn("could not detect locale, falling back to source locale", e);
|
|
2995
3872
|
return defaultLocale8;
|
|
2996
3873
|
}
|
|
2997
3874
|
}
|
|
@@ -3014,30 +3891,130 @@ var WarpAttention = class extends kebabCaseAttributes(WarpElement3) {
|
|
|
3014
3891
|
constructor() {
|
|
3015
3892
|
super();
|
|
3016
3893
|
activateI18n7(messages9, messages10, messages11);
|
|
3894
|
+
this.handleDone = this.handleDone.bind(this);
|
|
3017
3895
|
this.show = false;
|
|
3896
|
+
this.placement = "bottom";
|
|
3018
3897
|
this.tooltip = false;
|
|
3019
3898
|
this.callout = false;
|
|
3020
3899
|
this.popover = false;
|
|
3021
3900
|
this.highlight = false;
|
|
3022
3901
|
this.canClose = false;
|
|
3023
3902
|
this.noArrow = false;
|
|
3903
|
+
this.distance = 8;
|
|
3904
|
+
this.skidding = 0;
|
|
3905
|
+
this.flip = false;
|
|
3906
|
+
this.crossAxis = false;
|
|
3907
|
+
this._initialPlacement = this.placement;
|
|
3908
|
+
this._actualDirection = this.placement;
|
|
3024
3909
|
}
|
|
3025
3910
|
connectedCallback() {
|
|
3026
3911
|
super.connectedCallback();
|
|
3027
|
-
if (
|
|
3912
|
+
if (this.placement && !Object.keys(opposites).includes(this.placement)) {
|
|
3028
3913
|
throw new Error(`Invalid "placement" attribute. Set its value to one of the following:
|
|
3029
3914
|
${JSON.stringify(Object.keys(opposites))}`);
|
|
3915
|
+
}
|
|
3916
|
+
if (this.fallbackPlacements && !this.fallbackPlacements.every((fallbackPlacement) => directions.includes(fallbackPlacement))) {
|
|
3917
|
+
throw new Error(`Invalid "fallbackPlacements" attribute. Set its value to an array with one or more of the following:
|
|
3918
|
+
${JSON.stringify(directions)}`);
|
|
3030
3919
|
}
|
|
3031
3920
|
setTimeout(() => this.requestUpdate(), 0);
|
|
3921
|
+
if (!this.callout) {
|
|
3922
|
+
window.addEventListener("click", this.handleDone);
|
|
3923
|
+
window.addEventListener("scroll", this.handleDone);
|
|
3924
|
+
window.addEventListener("resize", this.handleDone);
|
|
3925
|
+
window.addEventListener("touch", this.handleDone);
|
|
3926
|
+
}
|
|
3927
|
+
if (this.tooltip) {
|
|
3928
|
+
window.addEventListener("mouseover", this.handleDone);
|
|
3929
|
+
window.addEventListener("mouseout", this.handleDone);
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
disconnectedCallback() {
|
|
3933
|
+
window.removeEventListener("click", this.handleDone);
|
|
3934
|
+
window.removeEventListener("scroll", this.handleDone);
|
|
3935
|
+
window.removeEventListener("resize", this.handleDone);
|
|
3936
|
+
window.removeEventListener("touch", this.handleDone);
|
|
3937
|
+
window.removeEventListener("mouseover", this.handleDone);
|
|
3938
|
+
window.removeEventListener("mouseout", this.handleDone);
|
|
3939
|
+
super.disconnectedCallback();
|
|
3940
|
+
}
|
|
3941
|
+
handleDone() {
|
|
3942
|
+
window.requestAnimationFrame(() => {
|
|
3943
|
+
if (this.show && this._targetEl && this._attentionEl) {
|
|
3944
|
+
useRecompute(this.attentionState).then((state) => {
|
|
3945
|
+
this._actualDirection = state == null ? void 0 : state.actualDirection;
|
|
3946
|
+
});
|
|
3947
|
+
} else {
|
|
3948
|
+
this._actualDirection = this._initialPlacement;
|
|
3949
|
+
}
|
|
3950
|
+
});
|
|
3032
3951
|
}
|
|
3033
3952
|
get _actualDirection() {
|
|
3034
3953
|
return this.placement;
|
|
3035
3954
|
}
|
|
3036
|
-
set _actualDirection(
|
|
3037
|
-
this.placement =
|
|
3955
|
+
set _actualDirection(v) {
|
|
3956
|
+
this.placement = v;
|
|
3957
|
+
}
|
|
3958
|
+
get _arrowEl() {
|
|
3959
|
+
return this.renderRoot.querySelector("#arrow");
|
|
3038
3960
|
}
|
|
3039
3961
|
get _arrowDirection() {
|
|
3040
|
-
return opposites[this.
|
|
3962
|
+
return opposites[this._actualDirection];
|
|
3963
|
+
}
|
|
3964
|
+
get _arrowClasses() {
|
|
3965
|
+
return classes({
|
|
3966
|
+
[attention.arrowBase]: true,
|
|
3967
|
+
[attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]]: true,
|
|
3968
|
+
[this._activeVariantClasses.arrow]: true
|
|
3969
|
+
});
|
|
3970
|
+
}
|
|
3971
|
+
get _arrowHtml() {
|
|
3972
|
+
return this.noArrow ? "" : html9`<div id="arrow" role="img" class="${this._arrowClasses}" />`;
|
|
3973
|
+
}
|
|
3974
|
+
get _activeVariantClasses() {
|
|
3975
|
+
const variantProps = {
|
|
3976
|
+
callout: this.callout,
|
|
3977
|
+
popover: this.popover,
|
|
3978
|
+
tooltip: this.tooltip,
|
|
3979
|
+
highlight: this.highlight
|
|
3980
|
+
};
|
|
3981
|
+
const activeVariant = Object.keys(variantProps).find((b) => !!variantProps[b]) || "";
|
|
3982
|
+
return {
|
|
3983
|
+
wrapper: attention[activeVariant],
|
|
3984
|
+
arrow: attention[`arrow${activeVariant.charAt(0).toUpperCase() + activeVariant.slice(1)}`]
|
|
3985
|
+
};
|
|
3986
|
+
}
|
|
3987
|
+
get _attentionEl() {
|
|
3988
|
+
return this.renderRoot.querySelector("#attention");
|
|
3989
|
+
}
|
|
3990
|
+
get _targetEl() {
|
|
3991
|
+
var _a;
|
|
3992
|
+
const targetSlot = (_a = this.renderRoot) == null ? void 0 : _a.querySelector("slot[name='target']");
|
|
3993
|
+
return targetSlot ? targetSlot.assignedNodes()[0] : null;
|
|
3994
|
+
}
|
|
3995
|
+
get _messageEl() {
|
|
3996
|
+
const messageSlot = this.renderRoot.querySelector("slot[name='message']");
|
|
3997
|
+
return messageSlot ? messageSlot.assignedNodes()[0] : null;
|
|
3998
|
+
}
|
|
3999
|
+
get _wrapperClasses() {
|
|
4000
|
+
return classes({
|
|
4001
|
+
[attention.base]: true,
|
|
4002
|
+
[this._activeVariantClasses.wrapper]: true
|
|
4003
|
+
});
|
|
4004
|
+
}
|
|
4005
|
+
get _ariaClose() {
|
|
4006
|
+
return i18n._({
|
|
4007
|
+
id: "attention.aria.close",
|
|
4008
|
+
message: "Close",
|
|
4009
|
+
comment: "Aria label for the close button in attention"
|
|
4010
|
+
});
|
|
4011
|
+
}
|
|
4012
|
+
get _closeBtnHtml() {
|
|
4013
|
+
return html9`
|
|
4014
|
+
<button aria-label="${this._ariaClose}" @click="${this.close}" @keydown=${this.keypressed} class="${attention.closeBtn}">
|
|
4015
|
+
<w-icon-close-16 />
|
|
4016
|
+
</button>
|
|
4017
|
+
`;
|
|
3041
4018
|
}
|
|
3042
4019
|
updated() {
|
|
3043
4020
|
if (!this.callout) {
|
|
@@ -3051,34 +4028,47 @@ ${JSON.stringify(Object.keys(opposites))}`);
|
|
|
3051
4028
|
isCallout: this.callout,
|
|
3052
4029
|
actualDirection: this._actualDirection,
|
|
3053
4030
|
directionName: this.placement,
|
|
3054
|
-
arrowEl: this.
|
|
4031
|
+
arrowEl: this._arrowEl,
|
|
3055
4032
|
attentionEl: this._attentionEl,
|
|
3056
4033
|
targetEl: this._targetEl,
|
|
3057
|
-
noArrow: this.noArrow
|
|
4034
|
+
noArrow: this.noArrow,
|
|
4035
|
+
distance: this.distance,
|
|
4036
|
+
skidding: this.skidding,
|
|
4037
|
+
flip: this.flip,
|
|
4038
|
+
crossAxis: this.crossAxis,
|
|
4039
|
+
fallbackPlacements: this.fallbackPlacements
|
|
3058
4040
|
};
|
|
3059
4041
|
useRecompute(this.attentionState);
|
|
3060
4042
|
}
|
|
3061
4043
|
pointingAtDirection() {
|
|
3062
4044
|
switch (opposites[this._actualDirection]) {
|
|
4045
|
+
case "top-start":
|
|
3063
4046
|
case "top":
|
|
4047
|
+
case "top-end":
|
|
3064
4048
|
return i18n._({
|
|
3065
4049
|
id: "attention.aria.pointingUp",
|
|
3066
4050
|
message: "pointing up",
|
|
3067
4051
|
comment: "Default screenreader message for top direction in the attention component"
|
|
3068
4052
|
});
|
|
4053
|
+
case "right-start":
|
|
3069
4054
|
case "right":
|
|
4055
|
+
case "right-end":
|
|
3070
4056
|
return i18n._({
|
|
3071
4057
|
id: "attention.aria.pointingRight",
|
|
3072
4058
|
message: "pointing right",
|
|
3073
4059
|
comment: "Default screenreader message for right direction in the attention component"
|
|
3074
4060
|
});
|
|
4061
|
+
case "bottom-start":
|
|
3075
4062
|
case "bottom":
|
|
4063
|
+
case "bottom-end":
|
|
3076
4064
|
return i18n._({
|
|
3077
4065
|
id: "attention.aria.pointingDown",
|
|
3078
4066
|
message: "pointing down",
|
|
3079
4067
|
comment: "Default screenreader message for bottom direction in the attention component"
|
|
3080
4068
|
});
|
|
4069
|
+
case "left-start":
|
|
3081
4070
|
case "left":
|
|
4071
|
+
case "left-end":
|
|
3082
4072
|
return i18n._({
|
|
3083
4073
|
id: "attention.aria.pointingLeft",
|
|
3084
4074
|
message: "pointing left",
|
|
@@ -3127,64 +4117,13 @@ ${JSON.stringify(Object.keys(opposites))}`);
|
|
|
3127
4117
|
this._targetEl.setAttribute("aria-details", attentionMessageId);
|
|
3128
4118
|
}
|
|
3129
4119
|
}
|
|
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
4120
|
firstUpdated() {
|
|
4121
|
+
this._initialPlacement = this.placement;
|
|
3151
4122
|
this.setAriaLabels();
|
|
3152
4123
|
if (this.callout) {
|
|
3153
4124
|
this._attentionEl.style.position = "relative";
|
|
3154
4125
|
}
|
|
3155
4126
|
}
|
|
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
4127
|
close() {
|
|
3189
4128
|
const event = new CustomEvent("close", {
|
|
3190
4129
|
bubbles: true,
|
|
@@ -3192,25 +4131,20 @@ ${JSON.stringify(Object.keys(opposites))}`);
|
|
|
3192
4131
|
});
|
|
3193
4132
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
3194
4133
|
}
|
|
3195
|
-
keypressed(
|
|
4134
|
+
keypressed(e) {
|
|
3196
4135
|
if (!this.canClose)
|
|
3197
4136
|
return;
|
|
3198
|
-
if (
|
|
3199
|
-
|
|
4137
|
+
if (e.key === "Escape") {
|
|
4138
|
+
e.preventDefault();
|
|
3200
4139
|
this.close();
|
|
3201
4140
|
}
|
|
3202
4141
|
}
|
|
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
4142
|
render() {
|
|
4143
|
+
if (!this.callout && this._targetEl === void 0)
|
|
4144
|
+
return html9``;
|
|
3211
4145
|
return html9`
|
|
3212
4146
|
<div class=${ifDefined2(this.className ? this.className : void 0)}>
|
|
3213
|
-
${this.placement === "right" || this.placement === "bottom" ? html9`
|
|
4147
|
+
${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html9`
|
|
3214
4148
|
<slot name="target"></slot>
|
|
3215
4149
|
|
|
3216
4150
|
<div id="attention" role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}" class="${this._wrapperClasses}">
|
|
@@ -3234,7 +4168,7 @@ __publicField(WarpAttention, "properties", {
|
|
|
3234
4168
|
show: { type: Boolean, reflect: true },
|
|
3235
4169
|
// Placement according to the target element
|
|
3236
4170
|
// Arrow would be on the opposite side of this position
|
|
3237
|
-
placement: { type: String },
|
|
4171
|
+
placement: { type: String, reflect: true },
|
|
3238
4172
|
// Whether Attention element is rendered as a tooltip
|
|
3239
4173
|
tooltip: { type: Boolean, reflect: true },
|
|
3240
4174
|
// Whether Attention element is rendered as an inline callout
|
|
@@ -3246,7 +4180,17 @@ __publicField(WarpAttention, "properties", {
|
|
|
3246
4180
|
// Render Attention element with a close button
|
|
3247
4181
|
canClose: { type: Boolean, reflect: true },
|
|
3248
4182
|
// Render Attention element without an arrow
|
|
3249
|
-
noArrow: { type: Boolean, reflect: true }
|
|
4183
|
+
noArrow: { type: Boolean, reflect: true },
|
|
4184
|
+
// Distance from which to offset the attentionEl from the targetEl vertically
|
|
4185
|
+
distance: { type: Number, reflect: true },
|
|
4186
|
+
// Distance from which to offset the attentionEl along its targetEl horizontally
|
|
4187
|
+
skidding: { type: Number, reflect: true },
|
|
4188
|
+
// Whether Attention element should flip its placement in order to keep it in view
|
|
4189
|
+
flip: { type: Boolean, reflect: true },
|
|
4190
|
+
// Whether Attention element should ignore cross axis overflow when flip is enabled
|
|
4191
|
+
crossAxis: { type: Boolean, reflect: true },
|
|
4192
|
+
// Choose which preferred placements the Attention element should flip to
|
|
4193
|
+
fallbackPlacements: { type: Array, reflect: true }
|
|
3250
4194
|
});
|
|
3251
4195
|
__publicField(WarpAttention, "styles", [
|
|
3252
4196
|
WarpElement3.styles,
|
|
@@ -3261,11 +4205,6 @@ __publicField(WarpAttention, "styles", [
|
|
|
3261
4205
|
:host([popover]:not(:popover-open):not(dialog[open])) {
|
|
3262
4206
|
display: contents;
|
|
3263
4207
|
}
|
|
3264
|
-
|
|
3265
|
-
#arrow {
|
|
3266
|
-
border-top-left-radius: 4px;
|
|
3267
|
-
z-index: 1;
|
|
3268
|
-
}
|
|
3269
4208
|
`
|
|
3270
4209
|
]);
|
|
3271
4210
|
if (!customElements.get("w-attention")) {
|
|
@@ -3367,7 +4306,7 @@ if (!customElements.get("w-box")) {
|
|
|
3367
4306
|
import { html as html12 } from "lit";
|
|
3368
4307
|
import WarpElement6 from "@warp-ds/elements-core";
|
|
3369
4308
|
|
|
3370
|
-
// node_modules/.pnpm/@warp-ds+core@1.
|
|
4309
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.1_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
|
|
3371
4310
|
function interleave(array, separator2) {
|
|
3372
4311
|
return array.flatMap((el) => [el, separator2]).slice(0, -1);
|
|
3373
4312
|
}
|
|
@@ -3662,11 +4601,11 @@ var WarpCard = class extends WarpElement9 {
|
|
|
3662
4601
|
get uuSpan() {
|
|
3663
4602
|
return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
3664
4603
|
}
|
|
3665
|
-
keypressed(
|
|
3666
|
-
if (!this.clickable ||
|
|
4604
|
+
keypressed(e) {
|
|
4605
|
+
if (!this.clickable || e.altKey || e.ctrlKey)
|
|
3667
4606
|
return;
|
|
3668
|
-
if (
|
|
3669
|
-
|
|
4607
|
+
if (e.key === keys.ENTER || e.key === keys.SPACE) {
|
|
4608
|
+
e.preventDefault();
|
|
3670
4609
|
this.click();
|
|
3671
4610
|
}
|
|
3672
4611
|
}
|
|
@@ -3771,8 +4710,8 @@ function detectLocale8() {
|
|
|
3771
4710
|
return getSupportedLocale8(hostLocale);
|
|
3772
4711
|
}
|
|
3773
4712
|
return getSupportedLocale8(htmlLocale != null ? htmlLocale : hostLocale);
|
|
3774
|
-
} catch (
|
|
3775
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
4713
|
+
} catch (e) {
|
|
4714
|
+
console.warn("could not detect locale, falling back to source locale", e);
|
|
3776
4715
|
return defaultLocale9;
|
|
3777
4716
|
}
|
|
3778
4717
|
}
|
|
@@ -3862,8 +4801,8 @@ function detectLocale9() {
|
|
|
3862
4801
|
return getSupportedLocale9(hostLocale);
|
|
3863
4802
|
}
|
|
3864
4803
|
return getSupportedLocale9(htmlLocale != null ? htmlLocale : hostLocale);
|
|
3865
|
-
} catch (
|
|
3866
|
-
console.warn("could not detect locale, falling back to source locale",
|
|
4804
|
+
} catch (e) {
|
|
4805
|
+
console.warn("could not detect locale, falling back to source locale", e);
|
|
3867
4806
|
return defaultLocale10;
|
|
3868
4807
|
}
|
|
3869
4808
|
}
|
|
@@ -4247,24 +5186,24 @@ var WarpTextField = class extends WarpElement13 {
|
|
|
4247
5186
|
if (this.invalid && this._helpId)
|
|
4248
5187
|
return this._helpId;
|
|
4249
5188
|
}
|
|
4250
|
-
handler(
|
|
4251
|
-
const { name, value } =
|
|
4252
|
-
const event = new CustomEvent(
|
|
5189
|
+
handler(e) {
|
|
5190
|
+
const { name, value } = e.target;
|
|
5191
|
+
const event = new CustomEvent(e.type, {
|
|
4253
5192
|
detail: {
|
|
4254
5193
|
name,
|
|
4255
5194
|
value,
|
|
4256
|
-
target:
|
|
5195
|
+
target: e.target
|
|
4257
5196
|
}
|
|
4258
5197
|
});
|
|
4259
5198
|
this.dispatchEvent(event);
|
|
4260
5199
|
}
|
|
4261
|
-
prefixSlotChange(
|
|
5200
|
+
prefixSlotChange(e) {
|
|
4262
5201
|
const el = this.renderRoot.querySelector("slot[name=prefix]");
|
|
4263
5202
|
const affixes = el.assignedElements();
|
|
4264
5203
|
if (affixes.length)
|
|
4265
5204
|
this._hasPrefix = true;
|
|
4266
5205
|
}
|
|
4267
|
-
suffixSlotChange(
|
|
5206
|
+
suffixSlotChange(e) {
|
|
4268
5207
|
const el = this.renderRoot.querySelector("slot[name=suffix]");
|
|
4269
5208
|
const affixes = el.assignedElements();
|
|
4270
5209
|
if (affixes.length)
|
|
@@ -4515,8 +5454,8 @@ var getAfterCollapseCallback = (done) => () => {
|
|
|
4515
5454
|
var expand = (el, done) => {
|
|
4516
5455
|
const returnPromise = (() => {
|
|
4517
5456
|
if (!done)
|
|
4518
|
-
return new Promise((
|
|
4519
|
-
done =
|
|
5457
|
+
return new Promise((r2) => {
|
|
5458
|
+
done = r2;
|
|
4520
5459
|
});
|
|
4521
5460
|
})();
|
|
4522
5461
|
const afterExpandCallback = getAfterExpandCallback(el, done);
|
|
@@ -4536,8 +5475,8 @@ var expand = (el, done) => {
|
|
|
4536
5475
|
var collapse = (el, done) => {
|
|
4537
5476
|
const returnPromise = (() => {
|
|
4538
5477
|
if (!done)
|
|
4539
|
-
return new Promise((
|
|
4540
|
-
done =
|
|
5478
|
+
return new Promise((r2) => {
|
|
5479
|
+
done = r2;
|
|
4541
5480
|
});
|
|
4542
5481
|
})();
|
|
4543
5482
|
const afterCollapseCallback = getAfterCollapseCallback(done);
|