@appsurify-testmap/rrweb 3.6.0-alpha.1 → 3.11.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rrweb.js CHANGED
@@ -779,7 +779,7 @@ try {
779
779
  }
780
780
  } catch (error) {
781
781
  }
782
- const U$1 = {
782
+ const z$1 = {
783
783
  ANCHOR: 0.4,
784
784
  PATH: 0.3,
785
785
  TARGET: 0.2,
@@ -793,9 +793,9 @@ const U$1 = {
793
793
  DEPTH_PENALTY_THRESHOLD: 5,
794
794
  DEPTH_PENALTY_FACTOR: 0.05,
795
795
  DEGRADED_SCORE: 0.3
796
- }, gt$1 = {
796
+ }, bt$1 = {
797
797
  MIN_CONFIDENCE_FOR_SKIP: 0.7
798
- }, K$1 = [
798
+ }, tt$1 = [
799
799
  "form",
800
800
  "main",
801
801
  "nav",
@@ -803,7 +803,7 @@ const U$1 = {
803
803
  "article",
804
804
  "footer",
805
805
  "header"
806
- ], J$1 = [
806
+ ], et$1 = [
807
807
  "form",
808
808
  "navigation",
809
809
  "main",
@@ -812,7 +812,7 @@ const U$1 = {
812
812
  "complementary",
813
813
  "banner",
814
814
  "search"
815
- ], mt$1 = [
815
+ ], St$1 = [
816
816
  // HTML5 Semantic
817
817
  "article",
818
818
  "aside",
@@ -916,7 +916,7 @@ const U$1 = {
916
916
  "data-*": 30,
917
917
  // Any aria-* attribute (if not above)
918
918
  "aria-*": 25
919
- }, V$1 = /* @__PURE__ */ new Set([
919
+ }, Y$1 = /* @__PURE__ */ new Set([
920
920
  "id",
921
921
  // handled separately
922
922
  "class",
@@ -928,7 +928,7 @@ const U$1 = {
928
928
  "tabindex",
929
929
  // can change
930
930
  "contenteditable"
931
- ]), bt$1 = {
931
+ ]), At$1 = {
932
932
  maxPathDepth: 10,
933
933
  enableSvgFingerprint: true,
934
934
  confidenceThreshold: 0,
@@ -936,7 +936,7 @@ const U$1 = {
936
936
  includeUtilityClasses: false,
937
937
  source: "dom-dsl"
938
938
  };
939
- function P$1(r2) {
939
+ function L$1(r2) {
940
940
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
941
941
  return true;
942
942
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -946,7 +946,7 @@ function P$1(r2) {
946
946
  }
947
947
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
948
948
  }
949
- const Q$1 = /* @__PURE__ */ new Set([
949
+ const Z$1 = /* @__PURE__ */ new Set([
950
950
  "aria-labelledby",
951
951
  "aria-describedby",
952
952
  "aria-controls",
@@ -960,10 +960,10 @@ const Q$1 = /* @__PURE__ */ new Set([
960
960
  "aria-errormessage",
961
961
  "aria-flowto"
962
962
  ]);
963
- function Y$1(r2) {
964
- return r2.trim().split(/\s+/).some((e2) => P$1(e2));
963
+ function K$1(r2) {
964
+ return r2.trim().split(/\s+/).some((e2) => L$1(e2));
965
965
  }
966
- let St$1 = class St {
966
+ let Ct$1 = class Ct {
967
967
  constructor(t2, e2) {
968
968
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
969
969
  }
@@ -996,25 +996,25 @@ let St$1 = class St {
996
996
  if (e2 === "head" || this.isInsideHead(t2)) {
997
997
  const c2 = s2 == null ? void 0 : s2.documentElement;
998
998
  if (c2) {
999
- const u2 = {
999
+ const l2 = {
1000
1000
  element: c2,
1001
1001
  score: 1,
1002
1002
  tier: "A",
1003
1003
  depth: 0
1004
1004
  };
1005
- return this.cacheResult(t2, u2), u2;
1005
+ return this.cacheResult(t2, l2), l2;
1006
1006
  }
1007
1007
  }
1008
1008
  if (e2 === "body") {
1009
1009
  const c2 = s2 == null ? void 0 : s2.documentElement;
1010
1010
  if (c2) {
1011
- const u2 = {
1011
+ const l2 = {
1012
1012
  element: c2,
1013
1013
  score: 1,
1014
1014
  tier: "A",
1015
1015
  depth: 0
1016
1016
  };
1017
- return this.cacheResult(t2, u2), u2;
1017
+ return this.cacheResult(t2, l2), l2;
1018
1018
  }
1019
1019
  }
1020
1020
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -1028,10 +1028,10 @@ let St$1 = class St {
1028
1028
  };
1029
1029
  const c2 = this.scoreAnchor(n2);
1030
1030
  if (c2 > 0) {
1031
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
1032
- if (d === "A")
1033
- return l2;
1034
- (!i2 || u2 > i2.score) && (i2 = l2);
1031
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
1032
+ if (f2 === "A")
1033
+ return h;
1034
+ (!i2 || l2 > i2.score) && (i2 = h);
1035
1035
  }
1036
1036
  n2 = n2.parentElement, a2++;
1037
1037
  }
@@ -1046,11 +1046,11 @@ let St$1 = class St {
1046
1046
  scoreAnchor(t2) {
1047
1047
  let e2 = 0;
1048
1048
  const s2 = t2.tagName.toLowerCase();
1049
- K$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1049
+ tt$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1050
1050
  const n2 = t2.getAttribute("role");
1051
- n2 && J$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1051
+ n2 && et$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1052
1052
  const a2 = t2.id;
1053
- return a2 && !P$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1053
+ return a2 && !L$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1054
1054
  }
1055
1055
  /**
1056
1056
  * Applies depth penalty to score
@@ -1067,10 +1067,10 @@ let St$1 = class St {
1067
1067
  */
1068
1068
  getTier(t2) {
1069
1069
  const e2 = t2.tagName.toLowerCase();
1070
- if (K$1.includes(e2))
1070
+ if (tt$1.includes(e2))
1071
1071
  return "A";
1072
1072
  const s2 = t2.getAttribute("role");
1073
- return s2 && J$1.includes(s2) ? "B" : "C";
1073
+ return s2 && et$1.includes(s2) ? "B" : "C";
1074
1074
  }
1075
1075
  /**
1076
1076
  * Checks if element is inside <head> section.
@@ -1103,7 +1103,7 @@ let St$1 = class St {
1103
1103
  this.cache && this.cache.setAnchor(t2, e2);
1104
1104
  }
1105
1105
  };
1106
- const At$1 = [
1106
+ const Tt$1 = [
1107
1107
  // CSS-in-JS
1108
1108
  /^css-[a-z0-9]+$/i,
1109
1109
  /^sc-[a-z0-9]+-\d+$/i,
@@ -1123,7 +1123,7 @@ const At$1 = [
1123
1123
  /^_[a-z0-9]{5,}$/i,
1124
1124
  /\d{5,}/
1125
1125
  // 5+ digits in a row
1126
- ], xt$1 = [
1126
+ ], Et$1 = [
1127
1127
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
1128
1128
  /^\[/,
1129
1129
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -1235,29 +1235,81 @@ const At$1 = [
1235
1235
  /^pull-(left|right)$/,
1236
1236
  /^float-(left|right|none)$/
1237
1237
  ];
1238
- function O$1(r2) {
1239
- return At$1.some((t2) => t2.test(r2));
1238
+ function q$1(r2) {
1239
+ return Tt$1.some((t2) => t2.test(r2));
1240
1240
  }
1241
- function _$1(r2) {
1242
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt$1.some((t2) => t2.test(r2));
1241
+ function U$1(r2) {
1242
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et$1.some((t2) => t2.test(r2));
1243
1243
  }
1244
- function Et$1(r2) {
1245
- return !O$1(r2) && !_$1(r2);
1244
+ function $t$1(r2) {
1245
+ return !q$1(r2) && !U$1(r2);
1246
1246
  }
1247
1247
  function M$1(r2) {
1248
- return r2.filter((t2) => Et$1(t2));
1248
+ return r2.filter((t2) => $t$1(t2));
1249
1249
  }
1250
- function vt$1(r2) {
1250
+ function It$1(r2) {
1251
1251
  const t2 = [], e2 = [];
1252
1252
  for (const s2 of r2)
1253
- _$1(s2) || O$1(s2) ? e2.push(s2) : t2.push(s2);
1253
+ U$1(s2) || q$1(s2) ? e2.push(s2) : t2.push(s2);
1254
1254
  return { semantic: t2, utility: e2 };
1255
1255
  }
1256
- function tt$1(r2) {
1257
- return _$1(r2) || O$1(r2);
1256
+ function st$1(r2) {
1257
+ return U$1(r2) || q$1(r2);
1258
+ }
1259
+ const Rt$1 = /* @__PURE__ */ new Set([
1260
+ "tr",
1261
+ "td",
1262
+ "th",
1263
+ "thead",
1264
+ "tbody",
1265
+ "tfoot"
1266
+ ]), Dt$1 = /* @__PURE__ */ new Set([
1267
+ "data-testid",
1268
+ "data-qa",
1269
+ "data-cy",
1270
+ "data-test",
1271
+ "aria-label",
1272
+ "name",
1273
+ "href"
1274
+ ]);
1275
+ function Mt$1(r2) {
1276
+ if (r2.id) return true;
1277
+ if (r2.attributes) {
1278
+ for (const t2 of Object.keys(r2.attributes))
1279
+ if (Dt$1.has(t2)) return true;
1280
+ }
1281
+ return false;
1282
+ }
1283
+ function Lt$1(r2, t2, e2) {
1284
+ var _a2;
1285
+ const s2 = r2.parentElement;
1286
+ if (!s2) return true;
1287
+ for (const n2 of Array.from(s2.children)) {
1288
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
1289
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
1290
+ }
1291
+ return true;
1292
+ }
1293
+ function _$1(r2, t2, e2) {
1294
+ var _a2;
1295
+ if (Rt$1.has(r2)) return true;
1296
+ if (Mt$1(t2)) return false;
1297
+ if (e2) {
1298
+ const s2 = e2.parentElement;
1299
+ if (s2) {
1300
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
1301
+ if (n2 && Lt$1(e2, r2, n2))
1302
+ return false;
1303
+ if (Array.from(s2.children).some(
1304
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
1305
+ )) return true;
1306
+ }
1307
+ return false;
1308
+ }
1309
+ return true;
1258
1310
  }
1259
- const et$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1260
- let $t$1 = class $t {
1311
+ const rt$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1312
+ let Pt$1 = class Pt {
1261
1313
  constructor(t2, e2) {
1262
1314
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
1263
1315
  }
@@ -1292,19 +1344,22 @@ let $t$1 = class $t {
1292
1344
  degraded: true,
1293
1345
  degradationReason: "target-not-descendant-of-anchor"
1294
1346
  };
1295
- let u2 = this.filterNoise(i2);
1296
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
1297
- path: u2.map((l2) => {
1298
- const h = l2.parentElement;
1347
+ let l2 = this.filterNoise(i2);
1348
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
1349
+ path: l2.map((h) => {
1350
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
1299
1351
  let g;
1300
- if (h) {
1301
- const m = Array.from(h.children).indexOf(l2);
1302
- m !== -1 && (g = m + 1);
1352
+ if (_$1(d, u2, h)) {
1353
+ const m = h.parentElement;
1354
+ if (m) {
1355
+ const b = Array.from(m.children).indexOf(h);
1356
+ b !== -1 && (g = b + 1);
1357
+ }
1303
1358
  }
1304
1359
  return {
1305
- tag: l2.tagName.toLowerCase(),
1306
- semantics: s2.extract(l2),
1307
- score: s2.scoreElement(l2),
1360
+ tag: d,
1361
+ semantics: u2,
1362
+ score: s2.scoreElement(h),
1308
1363
  nthChild: g
1309
1364
  };
1310
1365
  }),
@@ -1329,27 +1384,27 @@ let $t$1 = class $t {
1329
1384
  if (!o2) return e2;
1330
1385
  let c2;
1331
1386
  if (this.cache) {
1332
- const d = this.cache.getSelectorResults(i2);
1333
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1387
+ const f2 = this.cache.getSelectorResults(i2);
1388
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1334
1389
  } else
1335
1390
  c2 = o2.querySelectorAll(i2);
1336
1391
  if (c2.length <= 1)
1337
1392
  return e2;
1338
- const u2 = t2.filter((d) => !e2.includes(d));
1339
- for (const d of u2) {
1340
- if (a2.scoreElement(d) < gt$1.MIN_CONFIDENCE_FOR_SKIP)
1393
+ const l2 = t2.filter((f2) => !e2.includes(f2));
1394
+ for (const f2 of l2) {
1395
+ if (a2.scoreElement(f2) < bt$1.MIN_CONFIDENCE_FOR_SKIP)
1341
1396
  continue;
1342
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
1397
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
1343
1398
  try {
1344
- let f2;
1399
+ let g;
1345
1400
  if (this.cache) {
1346
- const m = this.cache.getSelectorResults(g);
1347
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
1401
+ const m = this.cache.getSelectorResults(u2);
1402
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
1348
1403
  } else
1349
- f2 = o2.querySelectorAll(g);
1350
- if (f2.length === 1)
1351
- return h;
1352
- f2.length < c2.length && (e2 = h);
1404
+ g = o2.querySelectorAll(u2);
1405
+ if (g.length === 1)
1406
+ return d;
1407
+ g.length < c2.length && (e2 = d);
1353
1408
  } catch {
1354
1409
  }
1355
1410
  }
@@ -1383,9 +1438,9 @@ let $t$1 = class $t {
1383
1438
  */
1384
1439
  elementToSelector(t2) {
1385
1440
  let e2 = t2.tagName.toLowerCase();
1386
- t2.id && !P$1(t2.id) && (e2 += `#${et$1(t2.id)}`);
1441
+ t2.id && !L$1(t2.id) && (e2 += `#${rt$1(t2.id)}`);
1387
1442
  for (const s2 of Array.from(t2.classList))
1388
- tt$1(s2) || (e2 += `.${et$1(s2)}`);
1443
+ st$1(s2) || (e2 += `.${rt$1(s2)}`);
1389
1444
  return e2;
1390
1445
  }
1391
1446
  /**
@@ -1399,7 +1454,7 @@ let $t$1 = class $t {
1399
1454
  */
1400
1455
  shouldInclude(t2) {
1401
1456
  const e2 = t2.tagName.toLowerCase();
1402
- return mt$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1457
+ return St$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1403
1458
  }
1404
1459
  /**
1405
1460
  * Checks if element has meaningful semantic features
@@ -1410,12 +1465,12 @@ let $t$1 = class $t {
1410
1465
  if (s2.name.startsWith("aria-")) return true;
1411
1466
  if (t2.classList.length > 0) {
1412
1467
  for (const s2 of Array.from(t2.classList))
1413
- if (!tt$1(s2)) return true;
1468
+ if (!st$1(s2)) return true;
1414
1469
  }
1415
1470
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
1416
1471
  return true;
1417
1472
  const e2 = t2.id;
1418
- return !!(e2 && !P$1(e2));
1473
+ return !!(e2 && !L$1(e2));
1419
1474
  }
1420
1475
  /**
1421
1476
  * Checks if element is inside <head> section.
@@ -1462,31 +1517,34 @@ let $t$1 = class $t {
1462
1517
  degradationReason: "head-not-found-in-path"
1463
1518
  } : {
1464
1519
  path: n2.map((c2) => {
1465
- const u2 = c2.parentElement;
1466
- let d;
1467
- if (u2) {
1468
- const h = Array.from(u2.children).indexOf(c2);
1469
- h !== -1 && (d = h + 1);
1520
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
1521
+ let h;
1522
+ if (_$1(l2, f2, c2)) {
1523
+ const d = c2.parentElement;
1524
+ if (d) {
1525
+ const g = Array.from(d.children).indexOf(c2);
1526
+ g !== -1 && (h = g + 1);
1527
+ }
1470
1528
  }
1471
1529
  return {
1472
- tag: c2.tagName.toLowerCase(),
1473
- semantics: s2.extract(c2),
1530
+ tag: l2,
1531
+ semantics: f2,
1474
1532
  score: s2.scoreElement(c2),
1475
- nthChild: d
1533
+ nthChild: h
1476
1534
  };
1477
1535
  }),
1478
1536
  degraded: false
1479
1537
  };
1480
1538
  }
1481
1539
  };
1482
- function F$1(r2) {
1540
+ function j$1(r2) {
1483
1541
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
1484
1542
  }
1485
- const Nt$1 = {
1543
+ const Ht$1 = {
1486
1544
  preserveQueryForAbsolute: true,
1487
1545
  removeDynamicHashes: true
1488
1546
  };
1489
- function It$1(r2) {
1547
+ function kt$1(r2) {
1490
1548
  return r2 ? [
1491
1549
  /\d{5,}/,
1492
1550
  // 5+ digits
@@ -1500,18 +1558,18 @@ function It$1(r2) {
1500
1558
  // UUID-like
1501
1559
  ].some((e2) => e2.test(r2)) : false;
1502
1560
  }
1503
- function Rt$1(r2, t2) {
1561
+ function _t$1(r2, t2) {
1504
1562
  if (!r2) return r2;
1505
1563
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
1506
1564
  let o2 = a2;
1507
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It$1(n2) || (o2 += `#${n2}`)), o2;
1565
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt$1(n2) || (o2 += `#${n2}`)), o2;
1508
1566
  }
1509
1567
  function D$1(r2, t2, e2 = {}) {
1510
1568
  if (!t2) return t2;
1511
- const s2 = { ...Nt$1, ...e2 };
1512
- return r2 === "href" || r2 === "src" ? Rt$1(t2, s2) : t2;
1569
+ const s2 = { ...Ht$1, ...e2 };
1570
+ return r2 === "href" || r2 === "src" ? _t$1(t2, s2) : t2;
1513
1571
  }
1514
- const Dt$1 = [
1572
+ const Ot$1 = [
1515
1573
  "role",
1516
1574
  "aria-label",
1517
1575
  "aria-labelledby",
@@ -1522,7 +1580,7 @@ const Dt$1 = [
1522
1580
  "aria-posinset",
1523
1581
  "aria-setsize",
1524
1582
  "aria-haspopup"
1525
- ], Mt$1 = [
1583
+ ], qt$1 = [
1526
1584
  "aria-selected",
1527
1585
  "aria-checked",
1528
1586
  "aria-pressed",
@@ -1535,7 +1593,7 @@ const Dt$1 = [
1535
1593
  "aria-grabbed",
1536
1594
  "aria-live",
1537
1595
  "aria-atomic"
1538
- ], Pt$1 = [
1596
+ ], Ut$1 = [
1539
1597
  "data-state",
1540
1598
  "data-active",
1541
1599
  "data-inactive",
@@ -1554,7 +1612,7 @@ const Dt$1 = [
1554
1612
  "data-hover",
1555
1613
  "data-orientation",
1556
1614
  "data-theme"
1557
- ], Ht$1 = [
1615
+ ], zt$1 = [
1558
1616
  "data-radix-",
1559
1617
  "data-headlessui-",
1560
1618
  "data-reach-",
@@ -1562,7 +1620,7 @@ const Dt$1 = [
1562
1620
  "data-chakra-",
1563
1621
  "data-mantine-",
1564
1622
  "data-tw-"
1565
- ], Lt$1 = [
1623
+ ], Ft$1 = [
1566
1624
  "data-testid",
1567
1625
  "data-test-id",
1568
1626
  "data-test",
@@ -1574,7 +1632,7 @@ const Dt$1 = [
1574
1632
  "data-entity-id",
1575
1633
  "data-product-id",
1576
1634
  "data-user-id"
1577
- ], kt$1 = [
1635
+ ], jt$1 = [
1578
1636
  // Google Analytics / GTM
1579
1637
  "data-ga",
1580
1638
  "data-gtm",
@@ -1610,7 +1668,7 @@ const Dt$1 = [
1610
1668
  "data-conversion",
1611
1669
  "data-segment",
1612
1670
  "data-analytics"
1613
- ], qt$1 = [
1671
+ ], Wt$1 = [
1614
1672
  "data-category",
1615
1673
  // Google Analytics category
1616
1674
  "data-action",
@@ -1619,7 +1677,7 @@ const Dt$1 = [
1619
1677
  // Google Analytics label
1620
1678
  "data-value"
1621
1679
  // Google Analytics value
1622
- ], Ot$1 = [
1680
+ ], Bt$1 = [
1623
1681
  "id",
1624
1682
  "name",
1625
1683
  "type",
@@ -1628,7 +1686,7 @@ const Dt$1 = [
1628
1686
  "for",
1629
1687
  "alt",
1630
1688
  "href"
1631
- ], _t$1 = [
1689
+ ], Gt$1 = [
1632
1690
  "disabled",
1633
1691
  "checked",
1634
1692
  "selected",
@@ -1636,17 +1694,17 @@ const Dt$1 = [
1636
1694
  "readonly",
1637
1695
  "required",
1638
1696
  "value"
1639
- ], Ut$1 = [
1697
+ ], Vt$1 = [
1640
1698
  /^radix-/,
1641
1699
  /^headlessui-/,
1642
1700
  /^mui-/,
1643
1701
  /:\w+:/
1644
1702
  // matches :ru:, :r1:, etc.
1645
1703
  ];
1646
- function zt$1(r2, t2) {
1647
- return Dt$1.includes(r2) ? true : Mt$1.includes(r2) || Pt$1.includes(r2) || Ht$1.some((e2) => r2.startsWith(e2)) ? false : Lt$1.includes(r2) ? true : kt$1.some((e2) => r2.startsWith(e2)) || qt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut$1.some((e2) => e2.test(t2)) : Ot$1.includes(r2) ? true : _t$1.includes(r2) ? false : !!r2.startsWith("data-");
1704
+ function Qt$1(r2, t2) {
1705
+ return Ot$1.includes(r2) ? true : qt$1.includes(r2) || Ut$1.includes(r2) || zt$1.some((e2) => r2.startsWith(e2)) ? false : Ft$1.includes(r2) ? true : jt$1.some((e2) => r2.startsWith(e2)) || Wt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt$1.some((e2) => e2.test(t2)) : Bt$1.includes(r2) ? true : Gt$1.includes(r2) ? false : !!r2.startsWith("data-");
1648
1706
  }
1649
- let st$1 = class st {
1707
+ let nt$1 = class nt {
1650
1708
  constructor(t2, e2) {
1651
1709
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
1652
1710
  }
@@ -1662,12 +1720,12 @@ let st$1 = class st {
1662
1720
  return i2;
1663
1721
  }
1664
1722
  const e2 = {}, s2 = t2.id;
1665
- if (s2 && !P$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1723
+ if (s2 && !L$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1666
1724
  const i2 = Array.from(t2.classList);
1667
1725
  if (this.includeUtilityClasses)
1668
1726
  e2.classes = i2;
1669
1727
  else {
1670
- const { semantic: o2 } = vt$1(i2);
1728
+ const { semantic: o2 } = It$1(i2);
1671
1729
  o2.length > 0 && (e2.classes = o2);
1672
1730
  }
1673
1731
  }
@@ -1696,7 +1754,7 @@ let st$1 = class st {
1696
1754
  * @returns True if should be ignored
1697
1755
  */
1698
1756
  shouldIgnoreAttribute(t2) {
1699
- return !!(V$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1757
+ return !!(Y$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1700
1758
  }
1701
1759
  /**
1702
1760
  * Gets attribute priority
@@ -1731,7 +1789,7 @@ let st$1 = class st {
1731
1789
  const e2 = {};
1732
1790
  for (const s2 of Array.from(t2.attributes)) {
1733
1791
  const n2 = s2.name;
1734
- if (this.shouldIgnoreAttribute(n2) || !zt$1(n2, s2.value) || Q$1.has(n2) && Y$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1792
+ if (this.shouldIgnoreAttribute(n2) || !Qt$1(n2, s2.value) || Z$1.has(n2) && K$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1735
1793
  const i2 = n2 === "href" || n2 === "src" ? D$1(n2, s2.value) : s2.value;
1736
1794
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
1737
1795
  }
@@ -1743,7 +1801,7 @@ let st$1 = class st {
1743
1801
  extractText(t2) {
1744
1802
  const e2 = this.getDirectTextContent(t2);
1745
1803
  if (!e2) return null;
1746
- const s2 = F$1(e2);
1804
+ const s2 = j$1(e2);
1747
1805
  if (!s2) return null;
1748
1806
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
1749
1807
  return {
@@ -1791,7 +1849,7 @@ let st$1 = class st {
1791
1849
  ].includes(e2);
1792
1850
  }
1793
1851
  };
1794
- let Ft$1 = class Ft {
1852
+ let Yt$1 = class Yt {
1795
1853
  /**
1796
1854
  * Generates fingerprint for SVG element
1797
1855
  * @param element - SVG element to fingerprint
@@ -1902,11 +1960,11 @@ let Ft$1 = class Ft {
1902
1960
  return Math.abs(e2).toString(16).padStart(8, "0");
1903
1961
  }
1904
1962
  };
1905
- function jt$1(r2, t2 = 0) {
1906
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U$1.ANCHOR + s2 * U$1.PATH + n2 * U$1.TARGET + t2 * U$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
1963
+ function Zt$1(r2, t2 = 0) {
1964
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z$1.ANCHOR + s2 * z$1.PATH + n2 * z$1.TARGET + t2 * z$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
1907
1965
  return Math.max(0, Math.min(1, a2 - i2));
1908
1966
  }
1909
- let Wt$1 = class Wt {
1967
+ let Kt$1 = class Kt {
1910
1968
  constructor(t2) {
1911
1969
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
1912
1970
  }
@@ -1937,9 +1995,9 @@ let Wt$1 = class Wt {
1937
1995
  return this.cache.size;
1938
1996
  }
1939
1997
  };
1940
- let Bt$1 = class Bt {
1998
+ let Xt$1 = class Xt {
1941
1999
  constructor(t2 = {}) {
1942
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt$1(
2000
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt$1(
1943
2001
  t2.maxSelectorCacheSize ?? 1e3
1944
2002
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
1945
2003
  eidHits: 0,
@@ -2088,12 +2146,12 @@ let Bt$1 = class Bt {
2088
2146
  return s2 > 0 ? t2 / s2 : 0;
2089
2147
  }
2090
2148
  };
2091
- function Gt$1(r2) {
2092
- return new Bt$1(r2);
2149
+ function Jt$1(r2) {
2150
+ return new Xt$1(r2);
2093
2151
  }
2094
- let z$1 = null;
2095
- function Z$1() {
2096
- return z$1 || (z$1 = Gt$1()), z$1;
2152
+ let F$1 = null;
2153
+ function X$1() {
2154
+ return F$1 || (F$1 = Jt$1()), F$1;
2097
2155
  }
2098
2156
  function k$1(r2) {
2099
2157
  if (r2.ownerDocument)
@@ -2111,7 +2169,7 @@ function k$1(r2) {
2111
2169
  3. You are working with a document node instead of an element`
2112
2170
  );
2113
2171
  }
2114
- function Vt$1(r2, t2) {
2172
+ function te$1(r2, t2) {
2115
2173
  if (!t2)
2116
2174
  return;
2117
2175
  const e2 = k$1(r2), s2 = t2 instanceof Document ? t2 : k$1(t2);
@@ -2126,64 +2184,65 @@ Common causes:
2126
2184
  Solution: Ensure element and root parameter are from the same document context.`
2127
2185
  );
2128
2186
  }
2129
- function X$1(r2, t2 = {}) {
2187
+ function J$1(r2, t2 = {}) {
2130
2188
  var _a2;
2131
2189
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
2132
2190
  return null;
2133
- const e2 = { ...bt$1, ...t2 };
2191
+ const e2 = { ...At$1, ...t2 };
2134
2192
  if (e2.root)
2135
2193
  try {
2136
- Vt$1(r2, e2.root);
2194
+ te$1(r2, e2.root);
2137
2195
  } catch (x2) {
2138
2196
  return console.error("Cross-document generation detected:", x2), null;
2139
2197
  }
2140
- const s2 = e2.cache ?? Z$1(), n2 = s2.getEID(r2);
2198
+ const s2 = e2.cache ?? X$1(), n2 = s2.getEID(r2);
2141
2199
  if (n2 !== void 0)
2142
2200
  return n2;
2143
- if (r2.tagName.toLowerCase() === "html") {
2144
- const x2 = new st$1(e2, s2), y = Zt$1(r2, e2, x2);
2201
+ const a2 = r2.tagName.toLowerCase();
2202
+ if (a2 === "html") {
2203
+ const x2 = new nt$1(e2, s2), y = re$1(r2, e2, x2);
2145
2204
  return s2.setEID(r2, y), y;
2146
2205
  }
2147
- const i2 = new St$1(e2, s2), o2 = new $t$1(e2, s2), c2 = new st$1(e2, s2), u2 = new Ft$1(), d = i2.findAnchor(r2);
2148
- if (!d && !e2.fallbackToBody)
2206
+ const i2 = new Ct$1(e2, s2), o2 = new Pt$1(e2, s2), c2 = new nt$1(e2, s2), l2 = new Yt$1(), f2 = i2.findAnchor(r2);
2207
+ if (!f2 && !e2.fallbackToBody)
2149
2208
  return null;
2150
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2151
- if (!l2) return null;
2152
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
2153
- let m;
2154
- if (f2 && g !== "body" && g !== "html") {
2155
- const y = Array.from(f2.children).indexOf(l2);
2156
- y !== -1 && (m = y + 1);
2157
- }
2158
- const p = c2.extract(l2), b = {
2159
- tag: l2.tagName.toLowerCase(),
2160
- semantics: p,
2161
- score: (d == null ? void 0 : d.score) ?? I$1.DEGRADED_SCORE,
2162
- degraded: h,
2163
- nthChild: m
2164
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
2165
- e2.enableSvgFingerprint && Qt$1(r2) && (E.svg = u2.fingerprint(r2));
2209
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2210
+ if (!h) return null;
2211
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
2212
+ let p;
2213
+ if (m && u2 !== "body" && u2 !== "html" && _$1(u2, g, h)) {
2214
+ const y = Array.from(m.children).indexOf(h);
2215
+ y !== -1 && (p = y + 1);
2216
+ }
2217
+ const b = {
2218
+ tag: h.tagName.toLowerCase(),
2219
+ semantics: g,
2220
+ score: (f2 == null ? void 0 : f2.score) ?? I$1.DEGRADED_SCORE,
2221
+ degraded: d,
2222
+ nthChild: p
2223
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
2224
+ e2.enableSvgFingerprint && ee$1(r2) && (T.svg = l2.fingerprint(r2));
2166
2225
  const C = r2.parentElement;
2167
2226
  let A;
2168
- if (C) {
2227
+ if (C && _$1(a2, T, r2)) {
2169
2228
  const y = Array.from(C.children).indexOf(r2);
2170
2229
  y !== -1 && (A = y + 1);
2171
2230
  }
2172
2231
  const v2 = {
2173
2232
  tag: r2.tagName.toLowerCase(),
2174
- semantics: E,
2233
+ semantics: T,
2175
2234
  score: c2.scoreElement(r2),
2176
2235
  nthChild: A
2177
- }, H = [], $ = {
2236
+ }, P = [], $ = {
2178
2237
  onMultiple: "best-score",
2179
2238
  onMissing: "anchor-only",
2180
2239
  maxDepth: 3
2181
- }, T = b.degraded || S.degraded, R = Yt$1(b.degraded, S), N = {
2240
+ }, E = b.degraded || S.degraded, R = se$1(b.degraded, S), N = {
2182
2241
  version: "1.0",
2183
2242
  anchor: b,
2184
2243
  path: S.path,
2185
2244
  target: v2,
2186
- constraints: H,
2245
+ constraints: P,
2187
2246
  fallback: $,
2188
2247
  meta: {
2189
2248
  confidence: 0,
@@ -2191,16 +2250,16 @@ function X$1(r2, t2 = {}) {
2191
2250
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2192
2251
  generator: "dom-eid@1.0",
2193
2252
  source: e2.source,
2194
- degraded: T,
2253
+ degraded: E,
2195
2254
  degradationReason: R
2196
2255
  }
2197
2256
  };
2198
- return N.meta.confidence = jt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2257
+ return N.meta.confidence = Zt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2199
2258
  }
2200
- function Qt$1(r2) {
2259
+ function ee$1(r2) {
2201
2260
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
2202
2261
  }
2203
- function Yt$1(r2, t2) {
2262
+ function se$1(r2, t2) {
2204
2263
  if (r2 && t2.degraded)
2205
2264
  return "anchor-and-path-degraded";
2206
2265
  if (r2)
@@ -2208,7 +2267,7 @@ function Yt$1(r2, t2) {
2208
2267
  if (t2.degraded)
2209
2268
  return t2.degradationReason;
2210
2269
  }
2211
- function Zt$1(r2, t2, e2, s2) {
2270
+ function re$1(r2, t2, e2, s2) {
2212
2271
  const a2 = {
2213
2272
  tag: "html",
2214
2273
  semantics: e2.extract(r2),
@@ -2237,91 +2296,119 @@ function Zt$1(r2, t2, e2, s2) {
2237
2296
  }
2238
2297
  };
2239
2298
  }
2240
- const ct$1 = {
2299
+ const ht$2 = {
2300
+ id: "i",
2301
+ "data-testid": "tid",
2302
+ "data-qa": "qa",
2303
+ "data-cy": "cy",
2304
+ "data-test": "dt",
2305
+ "aria-label": "al",
2306
+ "aria-labelledby": "alb",
2307
+ "aria-describedby": "adb",
2308
+ name: "n",
2309
+ href: "h",
2310
+ src: "s",
2311
+ type: "t",
2312
+ role: "r",
2313
+ alt: "at",
2314
+ title: "tt",
2315
+ for: "f",
2316
+ placeholder: "ph",
2317
+ text: "x"
2318
+ }, G$1 = Object.fromEntries(
2319
+ Object.entries(ht$2).map(([r2, t2]) => [t2, r2])
2320
+ ), ut$1 = {
2241
2321
  maxClasses: 2,
2242
2322
  maxAttributes: 5,
2243
2323
  includeText: true,
2244
2324
  maxTextLength: 50,
2245
2325
  simplifyTarget: true,
2246
- includeConstraints: true
2326
+ includeConstraints: true,
2327
+ format: "compact"
2247
2328
  };
2248
- function it$1(r2) {
2329
+ function ct$1(r2) {
2249
2330
  return r2 === "id" ? 101 : w$1[r2] !== void 0 ? w$1[r2] : r2.startsWith("data-") ? w$1["data-*"] : r2.startsWith("aria-") ? w$1["aria-*"] : 0;
2250
2331
  }
2251
- function ae$1(r2) {
2332
+ function de$1(r2) {
2252
2333
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
2253
2334
  }
2254
- function ie$1(r2) {
2335
+ function fe$1(r2) {
2255
2336
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
2256
2337
  }
2257
- function oe$1(r2, t2) {
2258
- const e2 = { ...ct$1, ...t2 }, s2 = `v${r2.version}`, n2 = j$1(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j$1(c2, false, e2)).join(" > ") + " > " : "", i2 = j$1(r2.target, true, e2), o2 = e2.includeConstraints ? le$1(r2) : "";
2259
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
2260
- }
2261
- function j$1(r2, t2 = false, e2 = ct$1) {
2262
- const { tag: s2, semantics: n2 } = r2;
2263
- let a2 = s2;
2264
- const i2 = [], o2 = { ...n2.attributes };
2265
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
2266
- const c2 = Object.entries(o2).map(([l2, h]) => {
2267
- const g = it$1(l2), f2 = l2 === "href" || l2 === "src" ? D$1(l2, h) : h;
2268
- return { name: l2, value: f2, priority: g };
2269
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V$1.has(l2.name) || Q$1.has(l2.name) && Y$1(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
2270
- c2.sort((l2, h) => h.priority - l2.priority);
2271
- const u2 = c2.slice(0, e2.maxAttributes);
2272
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
2273
- for (const { name: l2, value: h } of u2)
2274
- i2.push(`${l2}="${B$1(h)}"`);
2275
- if (e2.includeText && n2.text && !ie$1(n2.text.normalized)) {
2276
- const l2 = n2.text.normalized;
2277
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B$1(l2)}"`);
2278
- }
2279
- let d = i2;
2280
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
2281
- const h = l2.split("=")[0];
2282
- return it$1(h) >= 60 || h === "text" || h === "id" || h === "role";
2283
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
2284
- const l2 = M$1(n2.classes), h = !!n2.id || i2.some(
2285
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
2286
- );
2287
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
2288
- const f2 = l2.sort().slice(0, e2.maxClasses);
2289
- a2 += f2.map((m) => `.${m}`).join("");
2338
+ function ge$1(r2, t2) {
2339
+ const e2 = { ...ut$1, ...t2 }, s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W$1(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W$1(u2, false, e2, c2)).join(o2) + o2 : "", h = W$1(r2.target, true, e2), d = e2.includeConstraints ? pe$1(r2, e2) : "";
2340
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
2341
+ }
2342
+ function W$1(r2, t2 = false, e2 = ut$1, s2) {
2343
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
2344
+ let o2 = n2;
2345
+ const c2 = [], l2 = { ...a2.attributes };
2346
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
2347
+ const f2 = Object.entries(l2).map(([u2, g]) => {
2348
+ const m = ct$1(u2), p = u2 === "href" || u2 === "src" ? D$1(u2, g) : g;
2349
+ return { name: u2, value: p, priority: m };
2350
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y$1.has(u2.name) || Z$1.has(u2.name) && K$1(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
2351
+ f2.sort((u2, g) => g.priority - u2.priority);
2352
+ const h = f2.slice(0, e2.maxAttributes);
2353
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
2354
+ for (const { name: u2, value: g } of h) {
2355
+ const m = i2 ? ht$2[u2] ?? u2 : u2;
2356
+ c2.push(`${m}="${V$1(g)}"`);
2357
+ }
2358
+ if (e2.includeText && a2.text && !fe$1(a2.text.normalized)) {
2359
+ const u2 = a2.text.normalized;
2360
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
2361
+ const m = i2 ? "x" : "text";
2362
+ c2.push(`${m}="${V$1(u2)}"`);
2363
+ }
2364
+ }
2365
+ let d = c2;
2366
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
2367
+ const g = u2.split("=")[0], m = G$1[g] ?? g;
2368
+ return ct$1(m) >= 60 || m === "text" || m === "id" || m === "role";
2369
+ })), a2.classes && a2.classes.length > 0) {
2370
+ const u2 = M$1(a2.classes), g = !!a2.id || c2.some((p) => {
2371
+ const b = p.split("=")[0], S = G$1[b] ?? b;
2372
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
2373
+ });
2374
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
2375
+ const p = u2.sort().slice(0, e2.maxClasses);
2376
+ o2 += p.map((b) => `.${b}`).join("");
2290
2377
  }
2291
2378
  }
2292
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2293
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae$1);
2294
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
2379
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2380
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de$1);
2381
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
2295
2382
  }
2296
- return a2;
2383
+ return o2;
2297
2384
  }
2298
- function le$1(r2) {
2385
+ function pe$1(r2, t2) {
2299
2386
  if (!r2.constraints || r2.constraints.length === 0)
2300
2387
  return "";
2301
- const t2 = [];
2302
- for (const e2 of r2.constraints)
2303
- switch (e2.type) {
2388
+ const e2 = [];
2389
+ for (const n2 of r2.constraints)
2390
+ switch (n2.type) {
2304
2391
  case "uniqueness":
2305
- t2.push("unique=true");
2392
+ e2.push("unique=true");
2306
2393
  break;
2307
2394
  case "position":
2308
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
2395
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
2309
2396
  break;
2310
2397
  case "text-proximity":
2311
- if (e2.params && e2.params.reference) {
2312
- const s2 = B$1(String(e2.params.reference));
2313
- t2.push(`text="${s2}"`);
2398
+ if (n2.params && n2.params.reference) {
2399
+ const a2 = V$1(String(n2.params.reference));
2400
+ e2.push(`text="${a2}"`);
2314
2401
  }
2315
2402
  break;
2316
2403
  }
2317
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
2404
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
2318
2405
  }
2319
- function B$1(r2) {
2406
+ function V$1(r2) {
2320
2407
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
2321
2408
  }
2322
- function xe$1(r2, t2, e2) {
2323
- const s2 = X$1(r2, t2);
2324
- return s2 ? oe$1(s2, e2) : null;
2409
+ function Ne$1(r2, t2, e2) {
2410
+ const s2 = J$1(r2, t2);
2411
+ return s2 ? ge$1(s2, e2) : null;
2325
2412
  }
2326
2413
  let _id = 1;
2327
2414
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -2994,7 +3081,7 @@ function serializeNodeWithId(n2, options) {
2994
3081
  enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
2995
3082
  fallbackToBody: selectorOptions.fallbackToBody
2996
3083
  };
2997
- const selector = xe$1(n2, seqlGeneratorOptions);
3084
+ const selector = Ne$1(n2, seqlGeneratorOptions);
2998
3085
  if (selector) {
2999
3086
  serializedNode.selector = selector;
3000
3087
  }
@@ -7571,6 +7658,29 @@ try {
7571
7658
  }
7572
7659
  } catch (error) {
7573
7660
  }
7661
+ const ht$1 = {
7662
+ id: "i",
7663
+ "data-testid": "tid",
7664
+ "data-qa": "qa",
7665
+ "data-cy": "cy",
7666
+ "data-test": "dt",
7667
+ "aria-label": "al",
7668
+ "aria-labelledby": "alb",
7669
+ "aria-describedby": "adb",
7670
+ name: "n",
7671
+ href: "h",
7672
+ src: "s",
7673
+ type: "t",
7674
+ role: "r",
7675
+ alt: "at",
7676
+ title: "tt",
7677
+ for: "f",
7678
+ placeholder: "ph",
7679
+ text: "x"
7680
+ };
7681
+ Object.fromEntries(
7682
+ Object.entries(ht$1).map(([r2, t2]) => [t2, r2])
7683
+ );
7574
7684
  function getDefaultExportFromCjs(x2) {
7575
7685
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
7576
7686
  }
@@ -13183,7 +13293,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
13183
13293
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
13184
13294
  return NodeType2;
13185
13295
  })(NodeType || {});
13186
- const U = {
13296
+ const z = {
13187
13297
  ANCHOR: 0.4,
13188
13298
  PATH: 0.3,
13189
13299
  TARGET: 0.2,
@@ -13197,9 +13307,9 @@ const U = {
13197
13307
  DEPTH_PENALTY_THRESHOLD: 5,
13198
13308
  DEPTH_PENALTY_FACTOR: 0.05,
13199
13309
  DEGRADED_SCORE: 0.3
13200
- }, gt = {
13310
+ }, bt = {
13201
13311
  MIN_CONFIDENCE_FOR_SKIP: 0.7
13202
- }, K = [
13312
+ }, tt = [
13203
13313
  "form",
13204
13314
  "main",
13205
13315
  "nav",
@@ -13207,7 +13317,7 @@ const U = {
13207
13317
  "article",
13208
13318
  "footer",
13209
13319
  "header"
13210
- ], J = [
13320
+ ], et = [
13211
13321
  "form",
13212
13322
  "navigation",
13213
13323
  "main",
@@ -13216,7 +13326,7 @@ const U = {
13216
13326
  "complementary",
13217
13327
  "banner",
13218
13328
  "search"
13219
- ], mt = [
13329
+ ], St = [
13220
13330
  // HTML5 Semantic
13221
13331
  "article",
13222
13332
  "aside",
@@ -13320,7 +13430,7 @@ const U = {
13320
13430
  "data-*": 30,
13321
13431
  // Any aria-* attribute (if not above)
13322
13432
  "aria-*": 25
13323
- }, V = /* @__PURE__ */ new Set([
13433
+ }, Y = /* @__PURE__ */ new Set([
13324
13434
  "id",
13325
13435
  // handled separately
13326
13436
  "class",
@@ -13332,7 +13442,7 @@ const U = {
13332
13442
  "tabindex",
13333
13443
  // can change
13334
13444
  "contenteditable"
13335
- ]), bt = {
13445
+ ]), At = {
13336
13446
  maxPathDepth: 10,
13337
13447
  enableSvgFingerprint: true,
13338
13448
  confidenceThreshold: 0,
@@ -13340,7 +13450,7 @@ const U = {
13340
13450
  includeUtilityClasses: false,
13341
13451
  source: "dom-dsl"
13342
13452
  };
13343
- function P(r2) {
13453
+ function L(r2) {
13344
13454
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
13345
13455
  return true;
13346
13456
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -13350,7 +13460,7 @@ function P(r2) {
13350
13460
  }
13351
13461
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
13352
13462
  }
13353
- const Q = /* @__PURE__ */ new Set([
13463
+ const Z = /* @__PURE__ */ new Set([
13354
13464
  "aria-labelledby",
13355
13465
  "aria-describedby",
13356
13466
  "aria-controls",
@@ -13364,10 +13474,10 @@ const Q = /* @__PURE__ */ new Set([
13364
13474
  "aria-errormessage",
13365
13475
  "aria-flowto"
13366
13476
  ]);
13367
- function Y(r2) {
13368
- return r2.trim().split(/\s+/).some((e2) => P(e2));
13477
+ function K(r2) {
13478
+ return r2.trim().split(/\s+/).some((e2) => L(e2));
13369
13479
  }
13370
- class St2 {
13480
+ class Ct2 {
13371
13481
  constructor(t2, e2) {
13372
13482
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
13373
13483
  }
@@ -13400,25 +13510,25 @@ class St2 {
13400
13510
  if (e2 === "head" || this.isInsideHead(t2)) {
13401
13511
  const c2 = s2 == null ? void 0 : s2.documentElement;
13402
13512
  if (c2) {
13403
- const u2 = {
13513
+ const l2 = {
13404
13514
  element: c2,
13405
13515
  score: 1,
13406
13516
  tier: "A",
13407
13517
  depth: 0
13408
13518
  };
13409
- return this.cacheResult(t2, u2), u2;
13519
+ return this.cacheResult(t2, l2), l2;
13410
13520
  }
13411
13521
  }
13412
13522
  if (e2 === "body") {
13413
13523
  const c2 = s2 == null ? void 0 : s2.documentElement;
13414
13524
  if (c2) {
13415
- const u2 = {
13525
+ const l2 = {
13416
13526
  element: c2,
13417
13527
  score: 1,
13418
13528
  tier: "A",
13419
13529
  depth: 0
13420
13530
  };
13421
- return this.cacheResult(t2, u2), u2;
13531
+ return this.cacheResult(t2, l2), l2;
13422
13532
  }
13423
13533
  }
13424
13534
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -13432,10 +13542,10 @@ class St2 {
13432
13542
  };
13433
13543
  const c2 = this.scoreAnchor(n2);
13434
13544
  if (c2 > 0) {
13435
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
13436
- if (d === "A")
13437
- return l2;
13438
- (!i2 || u2 > i2.score) && (i2 = l2);
13545
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
13546
+ if (f2 === "A")
13547
+ return h;
13548
+ (!i2 || l2 > i2.score) && (i2 = h);
13439
13549
  }
13440
13550
  n2 = n2.parentElement, a2++;
13441
13551
  }
@@ -13450,11 +13560,11 @@ class St2 {
13450
13560
  scoreAnchor(t2) {
13451
13561
  let e2 = 0;
13452
13562
  const s2 = t2.tagName.toLowerCase();
13453
- K.includes(s2) && (e2 += I.SEMANTIC_TAG);
13563
+ tt.includes(s2) && (e2 += I.SEMANTIC_TAG);
13454
13564
  const n2 = t2.getAttribute("role");
13455
- n2 && J.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
13565
+ n2 && et.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
13456
13566
  const a2 = t2.id;
13457
- return a2 && !P(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
13567
+ return a2 && !L(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
13458
13568
  }
13459
13569
  /**
13460
13570
  * Applies depth penalty to score
@@ -13471,10 +13581,10 @@ class St2 {
13471
13581
  */
13472
13582
  getTier(t2) {
13473
13583
  const e2 = t2.tagName.toLowerCase();
13474
- if (K.includes(e2))
13584
+ if (tt.includes(e2))
13475
13585
  return "A";
13476
13586
  const s2 = t2.getAttribute("role");
13477
- return s2 && J.includes(s2) ? "B" : "C";
13587
+ return s2 && et.includes(s2) ? "B" : "C";
13478
13588
  }
13479
13589
  /**
13480
13590
  * Checks if element is inside <head> section.
@@ -13507,7 +13617,7 @@ class St2 {
13507
13617
  this.cache && this.cache.setAnchor(t2, e2);
13508
13618
  }
13509
13619
  }
13510
- const At = [
13620
+ const Tt = [
13511
13621
  // CSS-in-JS
13512
13622
  /^css-[a-z0-9]+$/i,
13513
13623
  /^sc-[a-z0-9]+-\d+$/i,
@@ -13527,7 +13637,7 @@ const At = [
13527
13637
  /^_[a-z0-9]{5,}$/i,
13528
13638
  /\d{5,}/
13529
13639
  // 5+ digits in a row
13530
- ], xt = [
13640
+ ], Et = [
13531
13641
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
13532
13642
  /^\[/,
13533
13643
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -13639,29 +13749,81 @@ const At = [
13639
13749
  /^pull-(left|right)$/,
13640
13750
  /^float-(left|right|none)$/
13641
13751
  ];
13642
- function O(r2) {
13643
- return At.some((t2) => t2.test(r2));
13752
+ function q(r2) {
13753
+ return Tt.some((t2) => t2.test(r2));
13644
13754
  }
13645
- function _(r2) {
13646
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt.some((t2) => t2.test(r2));
13755
+ function U(r2) {
13756
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et.some((t2) => t2.test(r2));
13647
13757
  }
13648
- function Et(r2) {
13649
- return !O(r2) && !_(r2);
13758
+ function $t(r2) {
13759
+ return !q(r2) && !U(r2);
13650
13760
  }
13651
13761
  function M(r2) {
13652
- return r2.filter((t2) => Et(t2));
13762
+ return r2.filter((t2) => $t(t2));
13653
13763
  }
13654
- function vt(r2) {
13764
+ function It(r2) {
13655
13765
  const t2 = [], e2 = [];
13656
13766
  for (const s2 of r2)
13657
- _(s2) || O(s2) ? e2.push(s2) : t2.push(s2);
13767
+ U(s2) || q(s2) ? e2.push(s2) : t2.push(s2);
13658
13768
  return { semantic: t2, utility: e2 };
13659
13769
  }
13660
- function tt(r2) {
13661
- return _(r2) || O(r2);
13770
+ function st(r2) {
13771
+ return U(r2) || q(r2);
13772
+ }
13773
+ const Rt = /* @__PURE__ */ new Set([
13774
+ "tr",
13775
+ "td",
13776
+ "th",
13777
+ "thead",
13778
+ "tbody",
13779
+ "tfoot"
13780
+ ]), Dt = /* @__PURE__ */ new Set([
13781
+ "data-testid",
13782
+ "data-qa",
13783
+ "data-cy",
13784
+ "data-test",
13785
+ "aria-label",
13786
+ "name",
13787
+ "href"
13788
+ ]);
13789
+ function Mt(r2) {
13790
+ if (r2.id) return true;
13791
+ if (r2.attributes) {
13792
+ for (const t2 of Object.keys(r2.attributes))
13793
+ if (Dt.has(t2)) return true;
13794
+ }
13795
+ return false;
13796
+ }
13797
+ function Lt(r2, t2, e2) {
13798
+ var _a2;
13799
+ const s2 = r2.parentElement;
13800
+ if (!s2) return true;
13801
+ for (const n2 of Array.from(s2.children)) {
13802
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
13803
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
13804
+ }
13805
+ return true;
13806
+ }
13807
+ function _(r2, t2, e2) {
13808
+ var _a2;
13809
+ if (Rt.has(r2)) return true;
13810
+ if (Mt(t2)) return false;
13811
+ if (e2) {
13812
+ const s2 = e2.parentElement;
13813
+ if (s2) {
13814
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
13815
+ if (n2 && Lt(e2, r2, n2))
13816
+ return false;
13817
+ if (Array.from(s2.children).some(
13818
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
13819
+ )) return true;
13820
+ }
13821
+ return false;
13822
+ }
13823
+ return true;
13662
13824
  }
13663
- const et = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
13664
- class $t2 {
13825
+ const rt = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
13826
+ class Pt2 {
13665
13827
  constructor(t2, e2) {
13666
13828
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
13667
13829
  }
@@ -13696,19 +13858,22 @@ class $t2 {
13696
13858
  degraded: true,
13697
13859
  degradationReason: "target-not-descendant-of-anchor"
13698
13860
  };
13699
- let u2 = this.filterNoise(i2);
13700
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
13701
- path: u2.map((l2) => {
13702
- const h = l2.parentElement;
13861
+ let l2 = this.filterNoise(i2);
13862
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
13863
+ path: l2.map((h) => {
13864
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
13703
13865
  let g;
13704
- if (h) {
13705
- const m = Array.from(h.children).indexOf(l2);
13706
- m !== -1 && (g = m + 1);
13866
+ if (_(d, u2, h)) {
13867
+ const m = h.parentElement;
13868
+ if (m) {
13869
+ const b = Array.from(m.children).indexOf(h);
13870
+ b !== -1 && (g = b + 1);
13871
+ }
13707
13872
  }
13708
13873
  return {
13709
- tag: l2.tagName.toLowerCase(),
13710
- semantics: s2.extract(l2),
13711
- score: s2.scoreElement(l2),
13874
+ tag: d,
13875
+ semantics: u2,
13876
+ score: s2.scoreElement(h),
13712
13877
  nthChild: g
13713
13878
  };
13714
13879
  }),
@@ -13733,27 +13898,27 @@ class $t2 {
13733
13898
  if (!o2) return e2;
13734
13899
  let c2;
13735
13900
  if (this.cache) {
13736
- const d = this.cache.getSelectorResults(i2);
13737
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
13901
+ const f2 = this.cache.getSelectorResults(i2);
13902
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
13738
13903
  } else
13739
13904
  c2 = o2.querySelectorAll(i2);
13740
13905
  if (c2.length <= 1)
13741
13906
  return e2;
13742
- const u2 = t2.filter((d) => !e2.includes(d));
13743
- for (const d of u2) {
13744
- if (a2.scoreElement(d) < gt.MIN_CONFIDENCE_FOR_SKIP)
13907
+ const l2 = t2.filter((f2) => !e2.includes(f2));
13908
+ for (const f2 of l2) {
13909
+ if (a2.scoreElement(f2) < bt.MIN_CONFIDENCE_FOR_SKIP)
13745
13910
  continue;
13746
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
13911
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
13747
13912
  try {
13748
- let f2;
13913
+ let g;
13749
13914
  if (this.cache) {
13750
- const m = this.cache.getSelectorResults(g);
13751
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
13915
+ const m = this.cache.getSelectorResults(u2);
13916
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
13752
13917
  } else
13753
- f2 = o2.querySelectorAll(g);
13754
- if (f2.length === 1)
13755
- return h;
13756
- f2.length < c2.length && (e2 = h);
13918
+ g = o2.querySelectorAll(u2);
13919
+ if (g.length === 1)
13920
+ return d;
13921
+ g.length < c2.length && (e2 = d);
13757
13922
  } catch {
13758
13923
  }
13759
13924
  }
@@ -13787,9 +13952,9 @@ class $t2 {
13787
13952
  */
13788
13953
  elementToSelector(t2) {
13789
13954
  let e2 = t2.tagName.toLowerCase();
13790
- t2.id && !P(t2.id) && (e2 += `#${et(t2.id)}`);
13955
+ t2.id && !L(t2.id) && (e2 += `#${rt(t2.id)}`);
13791
13956
  for (const s2 of Array.from(t2.classList))
13792
- tt(s2) || (e2 += `.${et(s2)}`);
13957
+ st(s2) || (e2 += `.${rt(s2)}`);
13793
13958
  return e2;
13794
13959
  }
13795
13960
  /**
@@ -13803,7 +13968,7 @@ class $t2 {
13803
13968
  */
13804
13969
  shouldInclude(t2) {
13805
13970
  const e2 = t2.tagName.toLowerCase();
13806
- return mt.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
13971
+ return St.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
13807
13972
  }
13808
13973
  /**
13809
13974
  * Checks if element has meaningful semantic features
@@ -13814,12 +13979,12 @@ class $t2 {
13814
13979
  if (s2.name.startsWith("aria-")) return true;
13815
13980
  if (t2.classList.length > 0) {
13816
13981
  for (const s2 of Array.from(t2.classList))
13817
- if (!tt(s2)) return true;
13982
+ if (!st(s2)) return true;
13818
13983
  }
13819
13984
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
13820
13985
  return true;
13821
13986
  const e2 = t2.id;
13822
- return !!(e2 && !P(e2));
13987
+ return !!(e2 && !L(e2));
13823
13988
  }
13824
13989
  /**
13825
13990
  * Checks if element is inside <head> section.
@@ -13866,31 +14031,34 @@ class $t2 {
13866
14031
  degradationReason: "head-not-found-in-path"
13867
14032
  } : {
13868
14033
  path: n2.map((c2) => {
13869
- const u2 = c2.parentElement;
13870
- let d;
13871
- if (u2) {
13872
- const h = Array.from(u2.children).indexOf(c2);
13873
- h !== -1 && (d = h + 1);
14034
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
14035
+ let h;
14036
+ if (_(l2, f2, c2)) {
14037
+ const d = c2.parentElement;
14038
+ if (d) {
14039
+ const g = Array.from(d.children).indexOf(c2);
14040
+ g !== -1 && (h = g + 1);
14041
+ }
13874
14042
  }
13875
14043
  return {
13876
- tag: c2.tagName.toLowerCase(),
13877
- semantics: s2.extract(c2),
14044
+ tag: l2,
14045
+ semantics: f2,
13878
14046
  score: s2.scoreElement(c2),
13879
- nthChild: d
14047
+ nthChild: h
13880
14048
  };
13881
14049
  }),
13882
14050
  degraded: false
13883
14051
  };
13884
14052
  }
13885
14053
  }
13886
- function F(r2) {
14054
+ function j(r2) {
13887
14055
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
13888
14056
  }
13889
- const Nt = {
14057
+ const Ht = {
13890
14058
  preserveQueryForAbsolute: true,
13891
14059
  removeDynamicHashes: true
13892
14060
  };
13893
- function It(r2) {
14061
+ function kt(r2) {
13894
14062
  return r2 ? [
13895
14063
  /\d{5,}/,
13896
14064
  // 5+ digits
@@ -13904,18 +14072,18 @@ function It(r2) {
13904
14072
  // UUID-like
13905
14073
  ].some((e2) => e2.test(r2)) : false;
13906
14074
  }
13907
- function Rt(r2, t2) {
14075
+ function _t(r2, t2) {
13908
14076
  if (!r2) return r2;
13909
14077
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
13910
14078
  let o2 = a2;
13911
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It(n2) || (o2 += `#${n2}`)), o2;
14079
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt(n2) || (o2 += `#${n2}`)), o2;
13912
14080
  }
13913
14081
  function D(r2, t2, e2 = {}) {
13914
14082
  if (!t2) return t2;
13915
- const s2 = { ...Nt, ...e2 };
13916
- return r2 === "href" || r2 === "src" ? Rt(t2, s2) : t2;
14083
+ const s2 = { ...Ht, ...e2 };
14084
+ return r2 === "href" || r2 === "src" ? _t(t2, s2) : t2;
13917
14085
  }
13918
- const Dt = [
14086
+ const Ot = [
13919
14087
  "role",
13920
14088
  "aria-label",
13921
14089
  "aria-labelledby",
@@ -13926,7 +14094,7 @@ const Dt = [
13926
14094
  "aria-posinset",
13927
14095
  "aria-setsize",
13928
14096
  "aria-haspopup"
13929
- ], Mt = [
14097
+ ], qt = [
13930
14098
  "aria-selected",
13931
14099
  "aria-checked",
13932
14100
  "aria-pressed",
@@ -13939,7 +14107,7 @@ const Dt = [
13939
14107
  "aria-grabbed",
13940
14108
  "aria-live",
13941
14109
  "aria-atomic"
13942
- ], Pt = [
14110
+ ], Ut = [
13943
14111
  "data-state",
13944
14112
  "data-active",
13945
14113
  "data-inactive",
@@ -13958,7 +14126,7 @@ const Dt = [
13958
14126
  "data-hover",
13959
14127
  "data-orientation",
13960
14128
  "data-theme"
13961
- ], Ht = [
14129
+ ], zt = [
13962
14130
  "data-radix-",
13963
14131
  "data-headlessui-",
13964
14132
  "data-reach-",
@@ -13966,7 +14134,7 @@ const Dt = [
13966
14134
  "data-chakra-",
13967
14135
  "data-mantine-",
13968
14136
  "data-tw-"
13969
- ], Lt = [
14137
+ ], Ft = [
13970
14138
  "data-testid",
13971
14139
  "data-test-id",
13972
14140
  "data-test",
@@ -13978,7 +14146,7 @@ const Dt = [
13978
14146
  "data-entity-id",
13979
14147
  "data-product-id",
13980
14148
  "data-user-id"
13981
- ], kt = [
14149
+ ], jt = [
13982
14150
  // Google Analytics / GTM
13983
14151
  "data-ga",
13984
14152
  "data-gtm",
@@ -14014,7 +14182,7 @@ const Dt = [
14014
14182
  "data-conversion",
14015
14183
  "data-segment",
14016
14184
  "data-analytics"
14017
- ], qt = [
14185
+ ], Wt = [
14018
14186
  "data-category",
14019
14187
  // Google Analytics category
14020
14188
  "data-action",
@@ -14023,7 +14191,7 @@ const Dt = [
14023
14191
  // Google Analytics label
14024
14192
  "data-value"
14025
14193
  // Google Analytics value
14026
- ], Ot = [
14194
+ ], Bt = [
14027
14195
  "id",
14028
14196
  "name",
14029
14197
  "type",
@@ -14032,7 +14200,7 @@ const Dt = [
14032
14200
  "for",
14033
14201
  "alt",
14034
14202
  "href"
14035
- ], _t = [
14203
+ ], Gt = [
14036
14204
  "disabled",
14037
14205
  "checked",
14038
14206
  "selected",
@@ -14040,17 +14208,17 @@ const Dt = [
14040
14208
  "readonly",
14041
14209
  "required",
14042
14210
  "value"
14043
- ], Ut = [
14211
+ ], Vt = [
14044
14212
  /^radix-/,
14045
14213
  /^headlessui-/,
14046
14214
  /^mui-/,
14047
14215
  /:\w+:/
14048
14216
  // matches :ru:, :r1:, etc.
14049
14217
  ];
14050
- function zt(r2, t2) {
14051
- return Dt.includes(r2) ? true : Mt.includes(r2) || Pt.includes(r2) || Ht.some((e2) => r2.startsWith(e2)) ? false : Lt.includes(r2) ? true : kt.some((e2) => r2.startsWith(e2)) || qt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut.some((e2) => e2.test(t2)) : Ot.includes(r2) ? true : _t.includes(r2) ? false : !!r2.startsWith("data-");
14218
+ function Qt(r2, t2) {
14219
+ return Ot.includes(r2) ? true : qt.includes(r2) || Ut.includes(r2) || zt.some((e2) => r2.startsWith(e2)) ? false : Ft.includes(r2) ? true : jt.some((e2) => r2.startsWith(e2)) || Wt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt.some((e2) => e2.test(t2)) : Bt.includes(r2) ? true : Gt.includes(r2) ? false : !!r2.startsWith("data-");
14052
14220
  }
14053
- class st2 {
14221
+ class nt2 {
14054
14222
  constructor(t2, e2) {
14055
14223
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
14056
14224
  }
@@ -14066,12 +14234,12 @@ class st2 {
14066
14234
  return i2;
14067
14235
  }
14068
14236
  const e2 = {}, s2 = t2.id;
14069
- if (s2 && !P(s2) && (e2.id = s2), t2.classList.length > 0) {
14237
+ if (s2 && !L(s2) && (e2.id = s2), t2.classList.length > 0) {
14070
14238
  const i2 = Array.from(t2.classList);
14071
14239
  if (this.includeUtilityClasses)
14072
14240
  e2.classes = i2;
14073
14241
  else {
14074
- const { semantic: o2 } = vt(i2);
14242
+ const { semantic: o2 } = It(i2);
14075
14243
  o2.length > 0 && (e2.classes = o2);
14076
14244
  }
14077
14245
  }
@@ -14100,7 +14268,7 @@ class st2 {
14100
14268
  * @returns True if should be ignored
14101
14269
  */
14102
14270
  shouldIgnoreAttribute(t2) {
14103
- return !!(V.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14271
+ return !!(Y.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14104
14272
  }
14105
14273
  /**
14106
14274
  * Gets attribute priority
@@ -14135,7 +14303,7 @@ class st2 {
14135
14303
  const e2 = {};
14136
14304
  for (const s2 of Array.from(t2.attributes)) {
14137
14305
  const n2 = s2.name;
14138
- if (this.shouldIgnoreAttribute(n2) || !zt(n2, s2.value) || Q.has(n2) && Y(s2.value) || this.getAttributePriority(n2) === 0) continue;
14306
+ if (this.shouldIgnoreAttribute(n2) || !Qt(n2, s2.value) || Z.has(n2) && K(s2.value) || this.getAttributePriority(n2) === 0) continue;
14139
14307
  const i2 = n2 === "href" || n2 === "src" ? D(n2, s2.value) : s2.value;
14140
14308
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
14141
14309
  }
@@ -14147,7 +14315,7 @@ class st2 {
14147
14315
  extractText(t2) {
14148
14316
  const e2 = this.getDirectTextContent(t2);
14149
14317
  if (!e2) return null;
14150
- const s2 = F(e2);
14318
+ const s2 = j(e2);
14151
14319
  if (!s2) return null;
14152
14320
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
14153
14321
  return {
@@ -14195,7 +14363,7 @@ class st2 {
14195
14363
  ].includes(e2);
14196
14364
  }
14197
14365
  }
14198
- class Ft2 {
14366
+ class Yt2 {
14199
14367
  /**
14200
14368
  * Generates fingerprint for SVG element
14201
14369
  * @param element - SVG element to fingerprint
@@ -14306,11 +14474,11 @@ class Ft2 {
14306
14474
  return Math.abs(e2).toString(16).padStart(8, "0");
14307
14475
  }
14308
14476
  }
14309
- function jt(r2, t2 = 0) {
14310
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U.ANCHOR + s2 * U.PATH + n2 * U.TARGET + t2 * U.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14477
+ function Zt(r2, t2 = 0) {
14478
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z.ANCHOR + s2 * z.PATH + n2 * z.TARGET + t2 * z.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14311
14479
  return Math.max(0, Math.min(1, a2 - i2));
14312
14480
  }
14313
- class Wt2 {
14481
+ class Kt2 {
14314
14482
  constructor(t2) {
14315
14483
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
14316
14484
  }
@@ -14341,9 +14509,9 @@ class Wt2 {
14341
14509
  return this.cache.size;
14342
14510
  }
14343
14511
  }
14344
- class Bt2 {
14512
+ class Xt2 {
14345
14513
  constructor(t2 = {}) {
14346
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt2(
14514
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt2(
14347
14515
  t2.maxSelectorCacheSize ?? 1e3
14348
14516
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
14349
14517
  eidHits: 0,
@@ -14492,12 +14660,12 @@ class Bt2 {
14492
14660
  return s2 > 0 ? t2 / s2 : 0;
14493
14661
  }
14494
14662
  }
14495
- function Gt(r2) {
14496
- return new Bt2(r2);
14663
+ function Jt(r2) {
14664
+ return new Xt2(r2);
14497
14665
  }
14498
- let z = null;
14499
- function Z() {
14500
- return z || (z = Gt()), z;
14666
+ let F = null;
14667
+ function X() {
14668
+ return F || (F = Jt()), F;
14501
14669
  }
14502
14670
  function k(r2) {
14503
14671
  if (r2.ownerDocument)
@@ -14515,7 +14683,7 @@ function k(r2) {
14515
14683
  3. You are working with a document node instead of an element`
14516
14684
  );
14517
14685
  }
14518
- function Vt(r2, t2) {
14686
+ function te(r2, t2) {
14519
14687
  if (!t2)
14520
14688
  return;
14521
14689
  const e2 = k(r2), s2 = t2 instanceof Document ? t2 : k(t2);
@@ -14530,64 +14698,65 @@ Common causes:
14530
14698
  Solution: Ensure element and root parameter are from the same document context.`
14531
14699
  );
14532
14700
  }
14533
- function X(r2, t2 = {}) {
14701
+ function J(r2, t2 = {}) {
14534
14702
  var _a2;
14535
14703
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
14536
14704
  return null;
14537
- const e2 = { ...bt, ...t2 };
14705
+ const e2 = { ...At, ...t2 };
14538
14706
  if (e2.root)
14539
14707
  try {
14540
- Vt(r2, e2.root);
14708
+ te(r2, e2.root);
14541
14709
  } catch (x2) {
14542
14710
  return console.error("Cross-document generation detected:", x2), null;
14543
14711
  }
14544
- const s2 = e2.cache ?? Z(), n2 = s2.getEID(r2);
14712
+ const s2 = e2.cache ?? X(), n2 = s2.getEID(r2);
14545
14713
  if (n2 !== void 0)
14546
14714
  return n2;
14547
- if (r2.tagName.toLowerCase() === "html") {
14548
- const x2 = new st2(e2, s2), y = Zt(r2, e2, x2);
14715
+ const a2 = r2.tagName.toLowerCase();
14716
+ if (a2 === "html") {
14717
+ const x2 = new nt2(e2, s2), y = re(r2, e2, x2);
14549
14718
  return s2.setEID(r2, y), y;
14550
14719
  }
14551
- const i2 = new St2(e2, s2), o2 = new $t2(e2, s2), c2 = new st2(e2, s2), u2 = new Ft2(), d = i2.findAnchor(r2);
14552
- if (!d && !e2.fallbackToBody)
14720
+ const i2 = new Ct2(e2, s2), o2 = new Pt2(e2, s2), c2 = new nt2(e2, s2), l2 = new Yt2(), f2 = i2.findAnchor(r2);
14721
+ if (!f2 && !e2.fallbackToBody)
14553
14722
  return null;
14554
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
14555
- if (!l2) return null;
14556
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
14557
- let m;
14558
- if (f2 && g !== "body" && g !== "html") {
14559
- const y = Array.from(f2.children).indexOf(l2);
14560
- y !== -1 && (m = y + 1);
14561
- }
14562
- const p = c2.extract(l2), b = {
14563
- tag: l2.tagName.toLowerCase(),
14564
- semantics: p,
14565
- score: (d == null ? void 0 : d.score) ?? I.DEGRADED_SCORE,
14566
- degraded: h,
14567
- nthChild: m
14568
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
14569
- e2.enableSvgFingerprint && Qt(r2) && (E.svg = u2.fingerprint(r2));
14723
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
14724
+ if (!h) return null;
14725
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
14726
+ let p;
14727
+ if (m && u2 !== "body" && u2 !== "html" && _(u2, g, h)) {
14728
+ const y = Array.from(m.children).indexOf(h);
14729
+ y !== -1 && (p = y + 1);
14730
+ }
14731
+ const b = {
14732
+ tag: h.tagName.toLowerCase(),
14733
+ semantics: g,
14734
+ score: (f2 == null ? void 0 : f2.score) ?? I.DEGRADED_SCORE,
14735
+ degraded: d,
14736
+ nthChild: p
14737
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
14738
+ e2.enableSvgFingerprint && ee(r2) && (T.svg = l2.fingerprint(r2));
14570
14739
  const C = r2.parentElement;
14571
14740
  let A;
14572
- if (C) {
14741
+ if (C && _(a2, T, r2)) {
14573
14742
  const y = Array.from(C.children).indexOf(r2);
14574
14743
  y !== -1 && (A = y + 1);
14575
14744
  }
14576
14745
  const v2 = {
14577
14746
  tag: r2.tagName.toLowerCase(),
14578
- semantics: E,
14747
+ semantics: T,
14579
14748
  score: c2.scoreElement(r2),
14580
14749
  nthChild: A
14581
- }, H = [], $ = {
14750
+ }, P = [], $ = {
14582
14751
  onMultiple: "best-score",
14583
14752
  onMissing: "anchor-only",
14584
14753
  maxDepth: 3
14585
- }, T = b.degraded || S.degraded, R = Yt(b.degraded, S), N = {
14754
+ }, E = b.degraded || S.degraded, R = se(b.degraded, S), N = {
14586
14755
  version: "1.0",
14587
14756
  anchor: b,
14588
14757
  path: S.path,
14589
14758
  target: v2,
14590
- constraints: H,
14759
+ constraints: P,
14591
14760
  fallback: $,
14592
14761
  meta: {
14593
14762
  confidence: 0,
@@ -14595,16 +14764,16 @@ function X(r2, t2 = {}) {
14595
14764
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
14596
14765
  generator: "dom-eid@1.0",
14597
14766
  source: e2.source,
14598
- degraded: T,
14767
+ degraded: E,
14599
14768
  degradationReason: R
14600
14769
  }
14601
14770
  };
14602
- return N.meta.confidence = jt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
14771
+ return N.meta.confidence = Zt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
14603
14772
  }
14604
- function Qt(r2) {
14773
+ function ee(r2) {
14605
14774
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
14606
14775
  }
14607
- function Yt(r2, t2) {
14776
+ function se(r2, t2) {
14608
14777
  if (r2 && t2.degraded)
14609
14778
  return "anchor-and-path-degraded";
14610
14779
  if (r2)
@@ -14612,7 +14781,7 @@ function Yt(r2, t2) {
14612
14781
  if (t2.degraded)
14613
14782
  return t2.degradationReason;
14614
14783
  }
14615
- function Zt(r2, t2, e2, s2) {
14784
+ function re(r2, t2, e2, s2) {
14616
14785
  const a2 = {
14617
14786
  tag: "html",
14618
14787
  semantics: e2.extract(r2),
@@ -14641,91 +14810,119 @@ function Zt(r2, t2, e2, s2) {
14641
14810
  }
14642
14811
  };
14643
14812
  }
14644
- const ct = {
14813
+ const ht = {
14814
+ id: "i",
14815
+ "data-testid": "tid",
14816
+ "data-qa": "qa",
14817
+ "data-cy": "cy",
14818
+ "data-test": "dt",
14819
+ "aria-label": "al",
14820
+ "aria-labelledby": "alb",
14821
+ "aria-describedby": "adb",
14822
+ name: "n",
14823
+ href: "h",
14824
+ src: "s",
14825
+ type: "t",
14826
+ role: "r",
14827
+ alt: "at",
14828
+ title: "tt",
14829
+ for: "f",
14830
+ placeholder: "ph",
14831
+ text: "x"
14832
+ }, G = Object.fromEntries(
14833
+ Object.entries(ht).map(([r2, t2]) => [t2, r2])
14834
+ ), ut = {
14645
14835
  maxClasses: 2,
14646
14836
  maxAttributes: 5,
14647
14837
  includeText: true,
14648
14838
  maxTextLength: 50,
14649
14839
  simplifyTarget: true,
14650
- includeConstraints: true
14840
+ includeConstraints: true,
14841
+ format: "compact"
14651
14842
  };
14652
- function it(r2) {
14843
+ function ct(r2) {
14653
14844
  return r2 === "id" ? 101 : w[r2] !== void 0 ? w[r2] : r2.startsWith("data-") ? w["data-*"] : r2.startsWith("aria-") ? w["aria-*"] : 0;
14654
14845
  }
14655
- function ae(r2) {
14846
+ function de(r2) {
14656
14847
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
14657
14848
  }
14658
- function ie(r2) {
14849
+ function fe(r2) {
14659
14850
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
14660
14851
  }
14661
- function oe(r2, t2) {
14662
- const e2 = { ...ct, ...t2 }, s2 = `v${r2.version}`, n2 = j(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j(c2, false, e2)).join(" > ") + " > " : "", i2 = j(r2.target, true, e2), o2 = e2.includeConstraints ? le(r2) : "";
14663
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
14664
- }
14665
- function j(r2, t2 = false, e2 = ct) {
14666
- const { tag: s2, semantics: n2 } = r2;
14667
- let a2 = s2;
14668
- const i2 = [], o2 = { ...n2.attributes };
14669
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
14670
- const c2 = Object.entries(o2).map(([l2, h]) => {
14671
- const g = it(l2), f2 = l2 === "href" || l2 === "src" ? D(l2, h) : h;
14672
- return { name: l2, value: f2, priority: g };
14673
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V.has(l2.name) || Q.has(l2.name) && Y(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
14674
- c2.sort((l2, h) => h.priority - l2.priority);
14675
- const u2 = c2.slice(0, e2.maxAttributes);
14676
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
14677
- for (const { name: l2, value: h } of u2)
14678
- i2.push(`${l2}="${B(h)}"`);
14679
- if (e2.includeText && n2.text && !ie(n2.text.normalized)) {
14680
- const l2 = n2.text.normalized;
14681
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B(l2)}"`);
14682
- }
14683
- let d = i2;
14684
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
14685
- const h = l2.split("=")[0];
14686
- return it(h) >= 60 || h === "text" || h === "id" || h === "role";
14687
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
14688
- const l2 = M(n2.classes), h = !!n2.id || i2.some(
14689
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
14690
- );
14691
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
14692
- const f2 = l2.sort().slice(0, e2.maxClasses);
14693
- a2 += f2.map((m) => `.${m}`).join("");
14852
+ function ge(r2, t2) {
14853
+ const e2 = { ...ut, ...t2 }, s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W(u2, false, e2, c2)).join(o2) + o2 : "", h = W(r2.target, true, e2), d = e2.includeConstraints ? pe(r2, e2) : "";
14854
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
14855
+ }
14856
+ function W(r2, t2 = false, e2 = ut, s2) {
14857
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
14858
+ let o2 = n2;
14859
+ const c2 = [], l2 = { ...a2.attributes };
14860
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
14861
+ const f2 = Object.entries(l2).map(([u2, g]) => {
14862
+ const m = ct(u2), p = u2 === "href" || u2 === "src" ? D(u2, g) : g;
14863
+ return { name: u2, value: p, priority: m };
14864
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y.has(u2.name) || Z.has(u2.name) && K(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
14865
+ f2.sort((u2, g) => g.priority - u2.priority);
14866
+ const h = f2.slice(0, e2.maxAttributes);
14867
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
14868
+ for (const { name: u2, value: g } of h) {
14869
+ const m = i2 ? ht[u2] ?? u2 : u2;
14870
+ c2.push(`${m}="${V(g)}"`);
14871
+ }
14872
+ if (e2.includeText && a2.text && !fe(a2.text.normalized)) {
14873
+ const u2 = a2.text.normalized;
14874
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
14875
+ const m = i2 ? "x" : "text";
14876
+ c2.push(`${m}="${V(u2)}"`);
14877
+ }
14878
+ }
14879
+ let d = c2;
14880
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
14881
+ const g = u2.split("=")[0], m = G[g] ?? g;
14882
+ return ct(m) >= 60 || m === "text" || m === "id" || m === "role";
14883
+ })), a2.classes && a2.classes.length > 0) {
14884
+ const u2 = M(a2.classes), g = !!a2.id || c2.some((p) => {
14885
+ const b = p.split("=")[0], S = G[b] ?? b;
14886
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
14887
+ });
14888
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
14889
+ const p = u2.sort().slice(0, e2.maxClasses);
14890
+ o2 += p.map((b) => `.${b}`).join("");
14694
14891
  }
14695
14892
  }
14696
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
14697
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae);
14698
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
14893
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
14894
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de);
14895
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
14699
14896
  }
14700
- return a2;
14897
+ return o2;
14701
14898
  }
14702
- function le(r2) {
14899
+ function pe(r2, t2) {
14703
14900
  if (!r2.constraints || r2.constraints.length === 0)
14704
14901
  return "";
14705
- const t2 = [];
14706
- for (const e2 of r2.constraints)
14707
- switch (e2.type) {
14902
+ const e2 = [];
14903
+ for (const n2 of r2.constraints)
14904
+ switch (n2.type) {
14708
14905
  case "uniqueness":
14709
- t2.push("unique=true");
14906
+ e2.push("unique=true");
14710
14907
  break;
14711
14908
  case "position":
14712
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
14909
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
14713
14910
  break;
14714
14911
  case "text-proximity":
14715
- if (e2.params && e2.params.reference) {
14716
- const s2 = B(String(e2.params.reference));
14717
- t2.push(`text="${s2}"`);
14912
+ if (n2.params && n2.params.reference) {
14913
+ const a2 = V(String(n2.params.reference));
14914
+ e2.push(`text="${a2}"`);
14718
14915
  }
14719
14916
  break;
14720
14917
  }
14721
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
14918
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
14722
14919
  }
14723
- function B(r2) {
14920
+ function V(r2) {
14724
14921
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
14725
14922
  }
14726
- function xe(r2, t2, e2) {
14727
- const s2 = X(r2, t2);
14728
- return s2 ? oe(s2, e2) : null;
14923
+ function Ne(r2, t2, e2) {
14924
+ const s2 = J(r2, t2);
14925
+ return s2 ? ge(s2, e2) : null;
14729
14926
  }
14730
14927
  const defaultSelectorOptions = {
14731
14928
  maxPathDepth: 10,
@@ -14771,7 +14968,7 @@ function resolveNodeSelector(node2, mirror2, selectorOptions, options) {
14771
14968
  fallbackToBody: selectorOptions.fallbackToBody
14772
14969
  };
14773
14970
  try {
14774
- const selector = xe(element, seqlOptions);
14971
+ const selector = Ne(element, seqlOptions);
14775
14972
  if (selector) {
14776
14973
  if (elementMeta) {
14777
14974
  elementMeta.selector = selector;
@@ -15920,7 +16117,8 @@ function initInputObserver({
15920
16117
  maskInputOptions,
15921
16118
  maskInputFn,
15922
16119
  sampling,
15923
- userTriggeredOnInput
16120
+ userTriggeredOnInput,
16121
+ trustSyntheticInput
15924
16122
  }) {
15925
16123
  function eventHandler(event) {
15926
16124
  let target = getEventTarget(event);
@@ -15970,34 +16168,53 @@ function initInputObserver({
15970
16168
  function cbWithDedup(target, v2) {
15971
16169
  const lastInputValue = lastInputValueMap.get(target);
15972
16170
  const el = target;
15973
- const hasPlaceholder = el.hasAttribute("placeholder");
15974
- const isEmpty = el.value === "";
15975
- const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
15976
- const isNonUser = !v2.userTriggered;
15977
- const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
15978
- const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15979
- const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
15980
- const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15981
- const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15982
- const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15983
- if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
15984
- console.debug(
15985
- `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
15986
- {
15987
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
15988
- node: index.describeNode(el),
15989
- tag: el.tagName,
15990
- nodeType: el.nodeType,
15991
- attribute: el.attributes,
15992
- value: el.value,
15993
- isLikelyPhantom,
15994
- isRenderDrivenTextInput,
15995
- isValueFromDefault,
15996
- isPhantomCheckbox,
15997
- isPhantomRadio
15998
- }
15999
- );
16000
- return;
16171
+ if (trustSyntheticInput) {
16172
+ const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
16173
+ const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
16174
+ if (isInitialEmpty || isSelectDefaultSelection) {
16175
+ console.debug(
16176
+ `[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
16177
+ {
16178
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16179
+ node: index.describeNode(el),
16180
+ tag: el.tagName,
16181
+ value: el.value,
16182
+ isInitialEmpty,
16183
+ isSelectDefaultSelection
16184
+ }
16185
+ );
16186
+ return;
16187
+ }
16188
+ } else {
16189
+ const hasPlaceholder = el.hasAttribute("placeholder");
16190
+ const isEmpty = el.value === "";
16191
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
16192
+ const isNonUser = !v2.userTriggered;
16193
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
16194
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16195
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
16196
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16197
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16198
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16199
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
16200
+ console.debug(
16201
+ `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
16202
+ {
16203
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16204
+ node: index.describeNode(el),
16205
+ tag: el.tagName,
16206
+ nodeType: el.nodeType,
16207
+ attribute: el.attributes,
16208
+ value: el.value,
16209
+ isLikelyPhantom,
16210
+ isRenderDrivenTextInput,
16211
+ isValueFromDefault,
16212
+ isPhantomCheckbox,
16213
+ isPhantomRadio
16214
+ }
16215
+ );
16216
+ return;
16217
+ }
16001
16218
  }
16002
16219
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
16003
16220
  lastInputValueMap.set(target, v2);
@@ -18048,8 +18265,15 @@ class NavigationManager {
18048
18265
  handleNavigation(data) {
18049
18266
  if (this.disabled) return;
18050
18267
  if (this.locked) return;
18051
- this.cancelTimers();
18052
- this.disconnectSettlingObserver();
18268
+ if (this.pendingNavigation) {
18269
+ this.cancelTimers();
18270
+ this.disconnectSettlingObserver();
18271
+ this.pendingNavigation = null;
18272
+ this.onSnapshot(true);
18273
+ } else {
18274
+ this.cancelTimers();
18275
+ this.disconnectSettlingObserver();
18276
+ }
18053
18277
  this.pendingNavigation = data;
18054
18278
  if (this.frozen) {
18055
18279
  return;
@@ -18256,7 +18480,7 @@ class ProcessedNodeManager {
18256
18480
  destroy() {
18257
18481
  }
18258
18482
  }
18259
- const version$1 = "3.6.0-alpha.1";
18483
+ const version$1 = "3.11.0-alpha.1";
18260
18484
  let wrappedEmit;
18261
18485
  let takeFullSnapshot$1;
18262
18486
  let canvasManager;
@@ -18305,6 +18529,7 @@ function record(options = {}) {
18305
18529
  recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
18306
18530
  flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
18307
18531
  userTriggeredOnInput = false,
18532
+ trustSyntheticInput = false,
18308
18533
  collectFonts = false,
18309
18534
  inlineImages = false,
18310
18535
  plugins,
@@ -18844,6 +19069,7 @@ function record(options = {}) {
18844
19069
  recordCanvas,
18845
19070
  inlineImages,
18846
19071
  userTriggeredOnInput,
19072
+ trustSyntheticInput,
18847
19073
  collectFonts,
18848
19074
  doc,
18849
19075
  maskInputFn,
@@ -18920,6 +19146,43 @@ function record(options = {}) {
18920
19146
  );
18921
19147
  }
18922
19148
  return () => {
19149
+ if (recording) {
19150
+ const activeEl = document.activeElement;
19151
+ if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
19152
+ const inputEl = activeEl;
19153
+ const id = mirror.getId(inputEl);
19154
+ if (id !== -1) {
19155
+ const lastValue = lastInputValueMap.get(inputEl);
19156
+ let text = inputEl.value;
19157
+ let isChecked = false;
19158
+ const type = getInputType(inputEl) || "";
19159
+ if (type === "radio" || type === "checkbox") {
19160
+ isChecked = inputEl.checked;
19161
+ } else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
19162
+ text = maskInputValue({
19163
+ element: inputEl,
19164
+ maskInputOptions,
19165
+ tagName: inputEl.tagName,
19166
+ type,
19167
+ value: text,
19168
+ maskInputFn
19169
+ });
19170
+ }
19171
+ if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
19172
+ const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
19173
+ lastInputValueMap.set(inputEl, inputData);
19174
+ wrappedEmit({
19175
+ type: EventType.IncrementalSnapshot,
19176
+ data: {
19177
+ source: IncrementalSource.Input,
19178
+ ...inputData,
19179
+ id
19180
+ }
19181
+ });
19182
+ }
19183
+ }
19184
+ }
19185
+ }
18923
19186
  if (checkoutDebounceTimer) {
18924
19187
  clearTimeout(checkoutDebounceTimer);
18925
19188
  checkoutDebounceTimer = null;
@@ -19382,16 +19645,16 @@ function s(n2, o2) {
19382
19645
  }(m), b = h.next(); !b.done; b = h.next()) {
19383
19646
  var S = b.value;
19384
19647
  if (void 0 === S) return c(p, g);
19385
- var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O2 = void 0 === N ? function() {
19648
+ var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O = void 0 === N ? function() {
19386
19649
  return true;
19387
19650
  } : N, _2 = void 0 === j2, k2 = null != j2 ? j2 : p, T = n2.states[k2];
19388
- if (O2(g, d)) {
19389
- var q = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
19651
+ if (O(g, d)) {
19652
+ var q2 = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
19390
19653
  return t2;
19391
19654
  })).map(function(t2) {
19392
19655
  return i(t2, y._options.actions);
19393
- }), g, d), 3), z2 = q[0], A = q[1], B2 = q[2], C = null != j2 ? j2 : p;
19394
- return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B2, matches: a(C) };
19656
+ }), g, d), 3), z2 = q2[0], A = q2[1], B = q2[2], C = null != j2 ? j2 : p;
19657
+ return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B, matches: a(C) };
19395
19658
  }
19396
19659
  }
19397
19660
  } catch (t2) {
@@ -21859,7 +22122,7 @@ class Replayer {
21859
22122
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
21860
22123
  }
21861
22124
  }
21862
- const version = "3.6.0-alpha.1";
22125
+ const version = "3.11.0-alpha.1";
21863
22126
  const { getVersion } = record;
21864
22127
  const { isRecording } = record;
21865
22128
  const { flushCustomEventQueue } = record;