@appsurify-testmap/rrweb-record 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.
@@ -767,7 +767,7 @@ try {
767
767
  }
768
768
  } catch (error) {
769
769
  }
770
- const U$1 = {
770
+ const z$1 = {
771
771
  ANCHOR: 0.4,
772
772
  PATH: 0.3,
773
773
  TARGET: 0.2,
@@ -781,9 +781,9 @@ const U$1 = {
781
781
  DEPTH_PENALTY_THRESHOLD: 5,
782
782
  DEPTH_PENALTY_FACTOR: 0.05,
783
783
  DEGRADED_SCORE: 0.3
784
- }, gt$1 = {
784
+ }, bt$1 = {
785
785
  MIN_CONFIDENCE_FOR_SKIP: 0.7
786
- }, K$1 = [
786
+ }, tt$1 = [
787
787
  "form",
788
788
  "main",
789
789
  "nav",
@@ -791,7 +791,7 @@ const U$1 = {
791
791
  "article",
792
792
  "footer",
793
793
  "header"
794
- ], J$1 = [
794
+ ], et$1 = [
795
795
  "form",
796
796
  "navigation",
797
797
  "main",
@@ -800,7 +800,7 @@ const U$1 = {
800
800
  "complementary",
801
801
  "banner",
802
802
  "search"
803
- ], mt$1 = [
803
+ ], St$1 = [
804
804
  // HTML5 Semantic
805
805
  "article",
806
806
  "aside",
@@ -904,7 +904,7 @@ const U$1 = {
904
904
  "data-*": 30,
905
905
  // Any aria-* attribute (if not above)
906
906
  "aria-*": 25
907
- }, V$1 = /* @__PURE__ */ new Set([
907
+ }, Y$1 = /* @__PURE__ */ new Set([
908
908
  "id",
909
909
  // handled separately
910
910
  "class",
@@ -916,7 +916,7 @@ const U$1 = {
916
916
  "tabindex",
917
917
  // can change
918
918
  "contenteditable"
919
- ]), bt$1 = {
919
+ ]), At$1 = {
920
920
  maxPathDepth: 10,
921
921
  enableSvgFingerprint: true,
922
922
  confidenceThreshold: 0,
@@ -924,7 +924,7 @@ const U$1 = {
924
924
  includeUtilityClasses: false,
925
925
  source: "dom-dsl"
926
926
  };
927
- function P$1(r2) {
927
+ function L$1(r2) {
928
928
  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))
929
929
  return true;
930
930
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -934,7 +934,7 @@ function P$1(r2) {
934
934
  }
935
935
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
936
936
  }
937
- const Q$1 = /* @__PURE__ */ new Set([
937
+ const Z$1 = /* @__PURE__ */ new Set([
938
938
  "aria-labelledby",
939
939
  "aria-describedby",
940
940
  "aria-controls",
@@ -948,10 +948,10 @@ const Q$1 = /* @__PURE__ */ new Set([
948
948
  "aria-errormessage",
949
949
  "aria-flowto"
950
950
  ]);
951
- function Y$1(r2) {
952
- return r2.trim().split(/\s+/).some((e2) => P$1(e2));
951
+ function K$1(r2) {
952
+ return r2.trim().split(/\s+/).some((e2) => L$1(e2));
953
953
  }
954
- let St$1 = class St {
954
+ let Ct$1 = class Ct {
955
955
  constructor(t2, e2) {
956
956
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
957
957
  }
@@ -984,25 +984,25 @@ let St$1 = class St {
984
984
  if (e2 === "head" || this.isInsideHead(t2)) {
985
985
  const c2 = s2 == null ? void 0 : s2.documentElement;
986
986
  if (c2) {
987
- const u2 = {
987
+ const l2 = {
988
988
  element: c2,
989
989
  score: 1,
990
990
  tier: "A",
991
991
  depth: 0
992
992
  };
993
- return this.cacheResult(t2, u2), u2;
993
+ return this.cacheResult(t2, l2), l2;
994
994
  }
995
995
  }
996
996
  if (e2 === "body") {
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
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -1016,10 +1016,10 @@ let St$1 = class St {
1016
1016
  };
1017
1017
  const c2 = this.scoreAnchor(n2);
1018
1018
  if (c2 > 0) {
1019
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
1020
- if (d === "A")
1021
- return l2;
1022
- (!i2 || u2 > i2.score) && (i2 = l2);
1019
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
1020
+ if (f2 === "A")
1021
+ return h;
1022
+ (!i2 || l2 > i2.score) && (i2 = h);
1023
1023
  }
1024
1024
  n2 = n2.parentElement, a2++;
1025
1025
  }
@@ -1034,11 +1034,11 @@ let St$1 = class St {
1034
1034
  scoreAnchor(t2) {
1035
1035
  let e2 = 0;
1036
1036
  const s2 = t2.tagName.toLowerCase();
1037
- K$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1037
+ tt$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1038
1038
  const n2 = t2.getAttribute("role");
1039
- n2 && J$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1039
+ n2 && et$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1040
1040
  const a2 = t2.id;
1041
- 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);
1041
+ 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);
1042
1042
  }
1043
1043
  /**
1044
1044
  * Applies depth penalty to score
@@ -1055,10 +1055,10 @@ let St$1 = class St {
1055
1055
  */
1056
1056
  getTier(t2) {
1057
1057
  const e2 = t2.tagName.toLowerCase();
1058
- if (K$1.includes(e2))
1058
+ if (tt$1.includes(e2))
1059
1059
  return "A";
1060
1060
  const s2 = t2.getAttribute("role");
1061
- return s2 && J$1.includes(s2) ? "B" : "C";
1061
+ return s2 && et$1.includes(s2) ? "B" : "C";
1062
1062
  }
1063
1063
  /**
1064
1064
  * Checks if element is inside <head> section.
@@ -1091,7 +1091,7 @@ let St$1 = class St {
1091
1091
  this.cache && this.cache.setAnchor(t2, e2);
1092
1092
  }
1093
1093
  };
1094
- const At$1 = [
1094
+ const Tt$1 = [
1095
1095
  // CSS-in-JS
1096
1096
  /^css-[a-z0-9]+$/i,
1097
1097
  /^sc-[a-z0-9]+-\d+$/i,
@@ -1111,7 +1111,7 @@ const At$1 = [
1111
1111
  /^_[a-z0-9]{5,}$/i,
1112
1112
  /\d{5,}/
1113
1113
  // 5+ digits in a row
1114
- ], xt$1 = [
1114
+ ], Et$1 = [
1115
1115
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
1116
1116
  /^\[/,
1117
1117
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -1223,29 +1223,81 @@ const At$1 = [
1223
1223
  /^pull-(left|right)$/,
1224
1224
  /^float-(left|right|none)$/
1225
1225
  ];
1226
- function O$1(r2) {
1227
- return At$1.some((t2) => t2.test(r2));
1226
+ function q$1(r2) {
1227
+ return Tt$1.some((t2) => t2.test(r2));
1228
1228
  }
1229
- function _$1(r2) {
1230
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt$1.some((t2) => t2.test(r2));
1229
+ function U$1(r2) {
1230
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et$1.some((t2) => t2.test(r2));
1231
1231
  }
1232
- function Et$1(r2) {
1233
- return !O$1(r2) && !_$1(r2);
1232
+ function $t$1(r2) {
1233
+ return !q$1(r2) && !U$1(r2);
1234
1234
  }
1235
1235
  function M$1(r2) {
1236
- return r2.filter((t2) => Et$1(t2));
1236
+ return r2.filter((t2) => $t$1(t2));
1237
1237
  }
1238
- function vt$1(r2) {
1238
+ function It$1(r2) {
1239
1239
  const t2 = [], e2 = [];
1240
1240
  for (const s2 of r2)
1241
- _$1(s2) || O$1(s2) ? e2.push(s2) : t2.push(s2);
1241
+ U$1(s2) || q$1(s2) ? e2.push(s2) : t2.push(s2);
1242
1242
  return { semantic: t2, utility: e2 };
1243
1243
  }
1244
- function tt$1(r2) {
1245
- return _$1(r2) || O$1(r2);
1244
+ function st$1(r2) {
1245
+ return U$1(r2) || q$1(r2);
1246
+ }
1247
+ const Rt$1 = /* @__PURE__ */ new Set([
1248
+ "tr",
1249
+ "td",
1250
+ "th",
1251
+ "thead",
1252
+ "tbody",
1253
+ "tfoot"
1254
+ ]), Dt$1 = /* @__PURE__ */ new Set([
1255
+ "data-testid",
1256
+ "data-qa",
1257
+ "data-cy",
1258
+ "data-test",
1259
+ "aria-label",
1260
+ "name",
1261
+ "href"
1262
+ ]);
1263
+ function Mt$1(r2) {
1264
+ if (r2.id) return true;
1265
+ if (r2.attributes) {
1266
+ for (const t2 of Object.keys(r2.attributes))
1267
+ if (Dt$1.has(t2)) return true;
1268
+ }
1269
+ return false;
1270
+ }
1271
+ function Lt$1(r2, t2, e2) {
1272
+ var _a2;
1273
+ const s2 = r2.parentElement;
1274
+ if (!s2) return true;
1275
+ for (const n2 of Array.from(s2.children)) {
1276
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
1277
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
1278
+ }
1279
+ return true;
1280
+ }
1281
+ function _$1(r2, t2, e2) {
1282
+ var _a2;
1283
+ if (Rt$1.has(r2)) return true;
1284
+ if (Mt$1(t2)) return false;
1285
+ if (e2) {
1286
+ const s2 = e2.parentElement;
1287
+ if (s2) {
1288
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
1289
+ if (n2 && Lt$1(e2, r2, n2))
1290
+ return false;
1291
+ if (Array.from(s2.children).some(
1292
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
1293
+ )) return true;
1294
+ }
1295
+ return false;
1296
+ }
1297
+ return true;
1246
1298
  }
1247
- const et$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1248
- let $t$1 = class $t {
1299
+ const rt$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1300
+ let Pt$1 = class Pt {
1249
1301
  constructor(t2, e2) {
1250
1302
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
1251
1303
  }
@@ -1280,19 +1332,22 @@ let $t$1 = class $t {
1280
1332
  degraded: true,
1281
1333
  degradationReason: "target-not-descendant-of-anchor"
1282
1334
  };
1283
- let u2 = this.filterNoise(i2);
1284
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
1285
- path: u2.map((l2) => {
1286
- const h = l2.parentElement;
1335
+ let l2 = this.filterNoise(i2);
1336
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
1337
+ path: l2.map((h) => {
1338
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
1287
1339
  let g;
1288
- if (h) {
1289
- const m = Array.from(h.children).indexOf(l2);
1290
- m !== -1 && (g = m + 1);
1340
+ if (_$1(d, u2, h)) {
1341
+ const m = h.parentElement;
1342
+ if (m) {
1343
+ const b = Array.from(m.children).indexOf(h);
1344
+ b !== -1 && (g = b + 1);
1345
+ }
1291
1346
  }
1292
1347
  return {
1293
- tag: l2.tagName.toLowerCase(),
1294
- semantics: s2.extract(l2),
1295
- score: s2.scoreElement(l2),
1348
+ tag: d,
1349
+ semantics: u2,
1350
+ score: s2.scoreElement(h),
1296
1351
  nthChild: g
1297
1352
  };
1298
1353
  }),
@@ -1317,27 +1372,27 @@ let $t$1 = class $t {
1317
1372
  if (!o2) return e2;
1318
1373
  let c2;
1319
1374
  if (this.cache) {
1320
- const d = this.cache.getSelectorResults(i2);
1321
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1375
+ const f2 = this.cache.getSelectorResults(i2);
1376
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1322
1377
  } else
1323
1378
  c2 = o2.querySelectorAll(i2);
1324
1379
  if (c2.length <= 1)
1325
1380
  return e2;
1326
- const u2 = t2.filter((d) => !e2.includes(d));
1327
- for (const d of u2) {
1328
- if (a2.scoreElement(d) < gt$1.MIN_CONFIDENCE_FOR_SKIP)
1381
+ const l2 = t2.filter((f2) => !e2.includes(f2));
1382
+ for (const f2 of l2) {
1383
+ if (a2.scoreElement(f2) < bt$1.MIN_CONFIDENCE_FOR_SKIP)
1329
1384
  continue;
1330
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
1385
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
1331
1386
  try {
1332
- let f2;
1387
+ let g;
1333
1388
  if (this.cache) {
1334
- const m = this.cache.getSelectorResults(g);
1335
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
1389
+ const m = this.cache.getSelectorResults(u2);
1390
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
1336
1391
  } else
1337
- f2 = o2.querySelectorAll(g);
1338
- if (f2.length === 1)
1339
- return h;
1340
- f2.length < c2.length && (e2 = h);
1392
+ g = o2.querySelectorAll(u2);
1393
+ if (g.length === 1)
1394
+ return d;
1395
+ g.length < c2.length && (e2 = d);
1341
1396
  } catch {
1342
1397
  }
1343
1398
  }
@@ -1371,9 +1426,9 @@ let $t$1 = class $t {
1371
1426
  */
1372
1427
  elementToSelector(t2) {
1373
1428
  let e2 = t2.tagName.toLowerCase();
1374
- t2.id && !P$1(t2.id) && (e2 += `#${et$1(t2.id)}`);
1429
+ t2.id && !L$1(t2.id) && (e2 += `#${rt$1(t2.id)}`);
1375
1430
  for (const s2 of Array.from(t2.classList))
1376
- tt$1(s2) || (e2 += `.${et$1(s2)}`);
1431
+ st$1(s2) || (e2 += `.${rt$1(s2)}`);
1377
1432
  return e2;
1378
1433
  }
1379
1434
  /**
@@ -1387,7 +1442,7 @@ let $t$1 = class $t {
1387
1442
  */
1388
1443
  shouldInclude(t2) {
1389
1444
  const e2 = t2.tagName.toLowerCase();
1390
- return mt$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1445
+ return St$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1391
1446
  }
1392
1447
  /**
1393
1448
  * Checks if element has meaningful semantic features
@@ -1398,12 +1453,12 @@ let $t$1 = class $t {
1398
1453
  if (s2.name.startsWith("aria-")) return true;
1399
1454
  if (t2.classList.length > 0) {
1400
1455
  for (const s2 of Array.from(t2.classList))
1401
- if (!tt$1(s2)) return true;
1456
+ if (!st$1(s2)) return true;
1402
1457
  }
1403
1458
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
1404
1459
  return true;
1405
1460
  const e2 = t2.id;
1406
- return !!(e2 && !P$1(e2));
1461
+ return !!(e2 && !L$1(e2));
1407
1462
  }
1408
1463
  /**
1409
1464
  * Checks if element is inside <head> section.
@@ -1450,31 +1505,34 @@ let $t$1 = class $t {
1450
1505
  degradationReason: "head-not-found-in-path"
1451
1506
  } : {
1452
1507
  path: n2.map((c2) => {
1453
- const u2 = c2.parentElement;
1454
- let d;
1455
- if (u2) {
1456
- const h = Array.from(u2.children).indexOf(c2);
1457
- h !== -1 && (d = h + 1);
1508
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
1509
+ let h;
1510
+ if (_$1(l2, f2, c2)) {
1511
+ const d = c2.parentElement;
1512
+ if (d) {
1513
+ const g = Array.from(d.children).indexOf(c2);
1514
+ g !== -1 && (h = g + 1);
1515
+ }
1458
1516
  }
1459
1517
  return {
1460
- tag: c2.tagName.toLowerCase(),
1461
- semantics: s2.extract(c2),
1518
+ tag: l2,
1519
+ semantics: f2,
1462
1520
  score: s2.scoreElement(c2),
1463
- nthChild: d
1521
+ nthChild: h
1464
1522
  };
1465
1523
  }),
1466
1524
  degraded: false
1467
1525
  };
1468
1526
  }
1469
1527
  };
1470
- function F$1(r2) {
1528
+ function j$1(r2) {
1471
1529
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
1472
1530
  }
1473
- const Nt$1 = {
1531
+ const Ht$1 = {
1474
1532
  preserveQueryForAbsolute: true,
1475
1533
  removeDynamicHashes: true
1476
1534
  };
1477
- function It$1(r2) {
1535
+ function kt$1(r2) {
1478
1536
  return r2 ? [
1479
1537
  /\d{5,}/,
1480
1538
  // 5+ digits
@@ -1488,18 +1546,18 @@ function It$1(r2) {
1488
1546
  // UUID-like
1489
1547
  ].some((e2) => e2.test(r2)) : false;
1490
1548
  }
1491
- function Rt$1(r2, t2) {
1549
+ function _t$1(r2, t2) {
1492
1550
  if (!r2) return r2;
1493
1551
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
1494
1552
  let o2 = a2;
1495
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It$1(n2) || (o2 += `#${n2}`)), o2;
1553
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt$1(n2) || (o2 += `#${n2}`)), o2;
1496
1554
  }
1497
1555
  function D$1(r2, t2, e2 = {}) {
1498
1556
  if (!t2) return t2;
1499
- const s2 = { ...Nt$1, ...e2 };
1500
- return r2 === "href" || r2 === "src" ? Rt$1(t2, s2) : t2;
1557
+ const s2 = { ...Ht$1, ...e2 };
1558
+ return r2 === "href" || r2 === "src" ? _t$1(t2, s2) : t2;
1501
1559
  }
1502
- const Dt$1 = [
1560
+ const Ot$1 = [
1503
1561
  "role",
1504
1562
  "aria-label",
1505
1563
  "aria-labelledby",
@@ -1510,7 +1568,7 @@ const Dt$1 = [
1510
1568
  "aria-posinset",
1511
1569
  "aria-setsize",
1512
1570
  "aria-haspopup"
1513
- ], Mt$1 = [
1571
+ ], qt$1 = [
1514
1572
  "aria-selected",
1515
1573
  "aria-checked",
1516
1574
  "aria-pressed",
@@ -1523,7 +1581,7 @@ const Dt$1 = [
1523
1581
  "aria-grabbed",
1524
1582
  "aria-live",
1525
1583
  "aria-atomic"
1526
- ], Pt$1 = [
1584
+ ], Ut$1 = [
1527
1585
  "data-state",
1528
1586
  "data-active",
1529
1587
  "data-inactive",
@@ -1542,7 +1600,7 @@ const Dt$1 = [
1542
1600
  "data-hover",
1543
1601
  "data-orientation",
1544
1602
  "data-theme"
1545
- ], Ht$1 = [
1603
+ ], zt$1 = [
1546
1604
  "data-radix-",
1547
1605
  "data-headlessui-",
1548
1606
  "data-reach-",
@@ -1550,7 +1608,7 @@ const Dt$1 = [
1550
1608
  "data-chakra-",
1551
1609
  "data-mantine-",
1552
1610
  "data-tw-"
1553
- ], Lt$1 = [
1611
+ ], Ft$1 = [
1554
1612
  "data-testid",
1555
1613
  "data-test-id",
1556
1614
  "data-test",
@@ -1562,7 +1620,7 @@ const Dt$1 = [
1562
1620
  "data-entity-id",
1563
1621
  "data-product-id",
1564
1622
  "data-user-id"
1565
- ], kt$1 = [
1623
+ ], jt$1 = [
1566
1624
  // Google Analytics / GTM
1567
1625
  "data-ga",
1568
1626
  "data-gtm",
@@ -1598,7 +1656,7 @@ const Dt$1 = [
1598
1656
  "data-conversion",
1599
1657
  "data-segment",
1600
1658
  "data-analytics"
1601
- ], qt$1 = [
1659
+ ], Wt$1 = [
1602
1660
  "data-category",
1603
1661
  // Google Analytics category
1604
1662
  "data-action",
@@ -1607,7 +1665,7 @@ const Dt$1 = [
1607
1665
  // Google Analytics label
1608
1666
  "data-value"
1609
1667
  // Google Analytics value
1610
- ], Ot$1 = [
1668
+ ], Bt$1 = [
1611
1669
  "id",
1612
1670
  "name",
1613
1671
  "type",
@@ -1616,7 +1674,7 @@ const Dt$1 = [
1616
1674
  "for",
1617
1675
  "alt",
1618
1676
  "href"
1619
- ], _t$1 = [
1677
+ ], Gt$1 = [
1620
1678
  "disabled",
1621
1679
  "checked",
1622
1680
  "selected",
@@ -1624,17 +1682,17 @@ const Dt$1 = [
1624
1682
  "readonly",
1625
1683
  "required",
1626
1684
  "value"
1627
- ], Ut$1 = [
1685
+ ], Vt$1 = [
1628
1686
  /^radix-/,
1629
1687
  /^headlessui-/,
1630
1688
  /^mui-/,
1631
1689
  /:\w+:/
1632
1690
  // matches :ru:, :r1:, etc.
1633
1691
  ];
1634
- function zt$1(r2, t2) {
1635
- 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-");
1692
+ function Qt$1(r2, t2) {
1693
+ 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-");
1636
1694
  }
1637
- let st$1 = class st {
1695
+ let nt$1 = class nt {
1638
1696
  constructor(t2, e2) {
1639
1697
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
1640
1698
  }
@@ -1650,12 +1708,12 @@ let st$1 = class st {
1650
1708
  return i2;
1651
1709
  }
1652
1710
  const e2 = {}, s2 = t2.id;
1653
- if (s2 && !P$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1711
+ if (s2 && !L$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1654
1712
  const i2 = Array.from(t2.classList);
1655
1713
  if (this.includeUtilityClasses)
1656
1714
  e2.classes = i2;
1657
1715
  else {
1658
- const { semantic: o2 } = vt$1(i2);
1716
+ const { semantic: o2 } = It$1(i2);
1659
1717
  o2.length > 0 && (e2.classes = o2);
1660
1718
  }
1661
1719
  }
@@ -1684,7 +1742,7 @@ let st$1 = class st {
1684
1742
  * @returns True if should be ignored
1685
1743
  */
1686
1744
  shouldIgnoreAttribute(t2) {
1687
- 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-"));
1745
+ 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-"));
1688
1746
  }
1689
1747
  /**
1690
1748
  * Gets attribute priority
@@ -1719,7 +1777,7 @@ let st$1 = class st {
1719
1777
  const e2 = {};
1720
1778
  for (const s2 of Array.from(t2.attributes)) {
1721
1779
  const n2 = s2.name;
1722
- if (this.shouldIgnoreAttribute(n2) || !zt$1(n2, s2.value) || Q$1.has(n2) && Y$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1780
+ if (this.shouldIgnoreAttribute(n2) || !Qt$1(n2, s2.value) || Z$1.has(n2) && K$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1723
1781
  const i2 = n2 === "href" || n2 === "src" ? D$1(n2, s2.value) : s2.value;
1724
1782
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
1725
1783
  }
@@ -1731,7 +1789,7 @@ let st$1 = class st {
1731
1789
  extractText(t2) {
1732
1790
  const e2 = this.getDirectTextContent(t2);
1733
1791
  if (!e2) return null;
1734
- const s2 = F$1(e2);
1792
+ const s2 = j$1(e2);
1735
1793
  if (!s2) return null;
1736
1794
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
1737
1795
  return {
@@ -1779,7 +1837,7 @@ let st$1 = class st {
1779
1837
  ].includes(e2);
1780
1838
  }
1781
1839
  };
1782
- let Ft$1 = class Ft {
1840
+ let Yt$1 = class Yt {
1783
1841
  /**
1784
1842
  * Generates fingerprint for SVG element
1785
1843
  * @param element - SVG element to fingerprint
@@ -1890,11 +1948,11 @@ let Ft$1 = class Ft {
1890
1948
  return Math.abs(e2).toString(16).padStart(8, "0");
1891
1949
  }
1892
1950
  };
1893
- function jt$1(r2, t2 = 0) {
1894
- 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;
1951
+ function Zt$1(r2, t2 = 0) {
1952
+ 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;
1895
1953
  return Math.max(0, Math.min(1, a2 - i2));
1896
1954
  }
1897
- let Wt$1 = class Wt {
1955
+ let Kt$1 = class Kt {
1898
1956
  constructor(t2) {
1899
1957
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
1900
1958
  }
@@ -1925,9 +1983,9 @@ let Wt$1 = class Wt {
1925
1983
  return this.cache.size;
1926
1984
  }
1927
1985
  };
1928
- let Bt$1 = class Bt {
1986
+ let Xt$1 = class Xt {
1929
1987
  constructor(t2 = {}) {
1930
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt$1(
1988
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt$1(
1931
1989
  t2.maxSelectorCacheSize ?? 1e3
1932
1990
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
1933
1991
  eidHits: 0,
@@ -2076,12 +2134,12 @@ let Bt$1 = class Bt {
2076
2134
  return s2 > 0 ? t2 / s2 : 0;
2077
2135
  }
2078
2136
  };
2079
- function Gt$1(r2) {
2080
- return new Bt$1(r2);
2137
+ function Jt$1(r2) {
2138
+ return new Xt$1(r2);
2081
2139
  }
2082
- let z$1 = null;
2083
- function Z$1() {
2084
- return z$1 || (z$1 = Gt$1()), z$1;
2140
+ let F$1 = null;
2141
+ function X$1() {
2142
+ return F$1 || (F$1 = Jt$1()), F$1;
2085
2143
  }
2086
2144
  function k$1(r2) {
2087
2145
  if (r2.ownerDocument)
@@ -2099,7 +2157,7 @@ function k$1(r2) {
2099
2157
  3. You are working with a document node instead of an element`
2100
2158
  );
2101
2159
  }
2102
- function Vt$1(r2, t2) {
2160
+ function te$1(r2, t2) {
2103
2161
  if (!t2)
2104
2162
  return;
2105
2163
  const e2 = k$1(r2), s2 = t2 instanceof Document ? t2 : k$1(t2);
@@ -2114,64 +2172,65 @@ Common causes:
2114
2172
  Solution: Ensure element and root parameter are from the same document context.`
2115
2173
  );
2116
2174
  }
2117
- function X$1(r2, t2 = {}) {
2175
+ function J$1(r2, t2 = {}) {
2118
2176
  var _a2;
2119
2177
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
2120
2178
  return null;
2121
- const e2 = { ...bt$1, ...t2 };
2179
+ const e2 = { ...At$1, ...t2 };
2122
2180
  if (e2.root)
2123
2181
  try {
2124
- Vt$1(r2, e2.root);
2182
+ te$1(r2, e2.root);
2125
2183
  } catch (x2) {
2126
2184
  return console.error("Cross-document generation detected:", x2), null;
2127
2185
  }
2128
- const s2 = e2.cache ?? Z$1(), n2 = s2.getEID(r2);
2186
+ const s2 = e2.cache ?? X$1(), n2 = s2.getEID(r2);
2129
2187
  if (n2 !== void 0)
2130
2188
  return n2;
2131
- if (r2.tagName.toLowerCase() === "html") {
2132
- const x2 = new st$1(e2, s2), y = Zt$1(r2, e2, x2);
2189
+ const a2 = r2.tagName.toLowerCase();
2190
+ if (a2 === "html") {
2191
+ const x2 = new nt$1(e2, s2), y = re$1(r2, e2, x2);
2133
2192
  return s2.setEID(r2, y), y;
2134
2193
  }
2135
- 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);
2136
- if (!d && !e2.fallbackToBody)
2194
+ 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);
2195
+ if (!f2 && !e2.fallbackToBody)
2137
2196
  return null;
2138
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2139
- if (!l2) return null;
2140
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
2141
- let m;
2142
- if (f2 && g !== "body" && g !== "html") {
2143
- const y = Array.from(f2.children).indexOf(l2);
2144
- y !== -1 && (m = y + 1);
2145
- }
2146
- const p = c2.extract(l2), b = {
2147
- tag: l2.tagName.toLowerCase(),
2148
- semantics: p,
2149
- score: (d == null ? void 0 : d.score) ?? I$1.DEGRADED_SCORE,
2150
- degraded: h,
2151
- nthChild: m
2152
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
2153
- e2.enableSvgFingerprint && Qt$1(r2) && (E.svg = u2.fingerprint(r2));
2197
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2198
+ if (!h) return null;
2199
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
2200
+ let p;
2201
+ if (m && u2 !== "body" && u2 !== "html" && _$1(u2, g, h)) {
2202
+ const y = Array.from(m.children).indexOf(h);
2203
+ y !== -1 && (p = y + 1);
2204
+ }
2205
+ const b = {
2206
+ tag: h.tagName.toLowerCase(),
2207
+ semantics: g,
2208
+ score: (f2 == null ? void 0 : f2.score) ?? I$1.DEGRADED_SCORE,
2209
+ degraded: d,
2210
+ nthChild: p
2211
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
2212
+ e2.enableSvgFingerprint && ee$1(r2) && (T.svg = l2.fingerprint(r2));
2154
2213
  const C = r2.parentElement;
2155
2214
  let A;
2156
- if (C) {
2215
+ if (C && _$1(a2, T, r2)) {
2157
2216
  const y = Array.from(C.children).indexOf(r2);
2158
2217
  y !== -1 && (A = y + 1);
2159
2218
  }
2160
2219
  const v2 = {
2161
2220
  tag: r2.tagName.toLowerCase(),
2162
- semantics: E,
2221
+ semantics: T,
2163
2222
  score: c2.scoreElement(r2),
2164
2223
  nthChild: A
2165
- }, H = [], $ = {
2224
+ }, P = [], $ = {
2166
2225
  onMultiple: "best-score",
2167
2226
  onMissing: "anchor-only",
2168
2227
  maxDepth: 3
2169
- }, T = b.degraded || S.degraded, R = Yt$1(b.degraded, S), N = {
2228
+ }, E = b.degraded || S.degraded, R = se$1(b.degraded, S), N = {
2170
2229
  version: "1.0",
2171
2230
  anchor: b,
2172
2231
  path: S.path,
2173
2232
  target: v2,
2174
- constraints: H,
2233
+ constraints: P,
2175
2234
  fallback: $,
2176
2235
  meta: {
2177
2236
  confidence: 0,
@@ -2179,16 +2238,16 @@ function X$1(r2, t2 = {}) {
2179
2238
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2180
2239
  generator: "dom-eid@1.0",
2181
2240
  source: e2.source,
2182
- degraded: T,
2241
+ degraded: E,
2183
2242
  degradationReason: R
2184
2243
  }
2185
2244
  };
2186
- return N.meta.confidence = jt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2245
+ return N.meta.confidence = Zt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2187
2246
  }
2188
- function Qt$1(r2) {
2247
+ function ee$1(r2) {
2189
2248
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
2190
2249
  }
2191
- function Yt$1(r2, t2) {
2250
+ function se$1(r2, t2) {
2192
2251
  if (r2 && t2.degraded)
2193
2252
  return "anchor-and-path-degraded";
2194
2253
  if (r2)
@@ -2196,7 +2255,7 @@ function Yt$1(r2, t2) {
2196
2255
  if (t2.degraded)
2197
2256
  return t2.degradationReason;
2198
2257
  }
2199
- function Zt$1(r2, t2, e2, s2) {
2258
+ function re$1(r2, t2, e2, s2) {
2200
2259
  const a2 = {
2201
2260
  tag: "html",
2202
2261
  semantics: e2.extract(r2),
@@ -2225,91 +2284,119 @@ function Zt$1(r2, t2, e2, s2) {
2225
2284
  }
2226
2285
  };
2227
2286
  }
2228
- const ct$1 = {
2287
+ const ht$2 = {
2288
+ id: "i",
2289
+ "data-testid": "tid",
2290
+ "data-qa": "qa",
2291
+ "data-cy": "cy",
2292
+ "data-test": "dt",
2293
+ "aria-label": "al",
2294
+ "aria-labelledby": "alb",
2295
+ "aria-describedby": "adb",
2296
+ name: "n",
2297
+ href: "h",
2298
+ src: "s",
2299
+ type: "t",
2300
+ role: "r",
2301
+ alt: "at",
2302
+ title: "tt",
2303
+ for: "f",
2304
+ placeholder: "ph",
2305
+ text: "x"
2306
+ }, G$1 = Object.fromEntries(
2307
+ Object.entries(ht$2).map(([r2, t2]) => [t2, r2])
2308
+ ), ut$1 = {
2229
2309
  maxClasses: 2,
2230
2310
  maxAttributes: 5,
2231
2311
  includeText: true,
2232
2312
  maxTextLength: 50,
2233
2313
  simplifyTarget: true,
2234
- includeConstraints: true
2314
+ includeConstraints: true,
2315
+ format: "compact"
2235
2316
  };
2236
- function it$1(r2) {
2317
+ function ct$1(r2) {
2237
2318
  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;
2238
2319
  }
2239
- function ae$1(r2) {
2320
+ function de$1(r2) {
2240
2321
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
2241
2322
  }
2242
- function ie$1(r2) {
2323
+ function fe$1(r2) {
2243
2324
  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));
2244
2325
  }
2245
- function oe$1(r2, t2) {
2246
- 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) : "";
2247
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
2248
- }
2249
- function j$1(r2, t2 = false, e2 = ct$1) {
2250
- const { tag: s2, semantics: n2 } = r2;
2251
- let a2 = s2;
2252
- const i2 = [], o2 = { ...n2.attributes };
2253
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
2254
- const c2 = Object.entries(o2).map(([l2, h]) => {
2255
- const g = it$1(l2), f2 = l2 === "href" || l2 === "src" ? D$1(l2, h) : h;
2256
- return { name: l2, value: f2, priority: g };
2257
- }).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");
2258
- c2.sort((l2, h) => h.priority - l2.priority);
2259
- const u2 = c2.slice(0, e2.maxAttributes);
2260
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
2261
- for (const { name: l2, value: h } of u2)
2262
- i2.push(`${l2}="${B$1(h)}"`);
2263
- if (e2.includeText && n2.text && !ie$1(n2.text.normalized)) {
2264
- const l2 = n2.text.normalized;
2265
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B$1(l2)}"`);
2266
- }
2267
- let d = i2;
2268
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
2269
- const h = l2.split("=")[0];
2270
- return it$1(h) >= 60 || h === "text" || h === "id" || h === "role";
2271
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
2272
- const l2 = M$1(n2.classes), h = !!n2.id || i2.some(
2273
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
2274
- );
2275
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
2276
- const f2 = l2.sort().slice(0, e2.maxClasses);
2277
- a2 += f2.map((m) => `.${m}`).join("");
2326
+ function ge$1(r2, t2) {
2327
+ 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) : "";
2328
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
2329
+ }
2330
+ function W$1(r2, t2 = false, e2 = ut$1, s2) {
2331
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
2332
+ let o2 = n2;
2333
+ const c2 = [], l2 = { ...a2.attributes };
2334
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
2335
+ const f2 = Object.entries(l2).map(([u2, g]) => {
2336
+ const m = ct$1(u2), p = u2 === "href" || u2 === "src" ? D$1(u2, g) : g;
2337
+ return { name: u2, value: p, priority: m };
2338
+ }).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");
2339
+ f2.sort((u2, g) => g.priority - u2.priority);
2340
+ const h = f2.slice(0, e2.maxAttributes);
2341
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
2342
+ for (const { name: u2, value: g } of h) {
2343
+ const m = i2 ? ht$2[u2] ?? u2 : u2;
2344
+ c2.push(`${m}="${V$1(g)}"`);
2345
+ }
2346
+ if (e2.includeText && a2.text && !fe$1(a2.text.normalized)) {
2347
+ const u2 = a2.text.normalized;
2348
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
2349
+ const m = i2 ? "x" : "text";
2350
+ c2.push(`${m}="${V$1(u2)}"`);
2351
+ }
2352
+ }
2353
+ let d = c2;
2354
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
2355
+ const g = u2.split("=")[0], m = G$1[g] ?? g;
2356
+ return ct$1(m) >= 60 || m === "text" || m === "id" || m === "role";
2357
+ })), a2.classes && a2.classes.length > 0) {
2358
+ const u2 = M$1(a2.classes), g = !!a2.id || c2.some((p) => {
2359
+ const b = p.split("=")[0], S = G$1[b] ?? b;
2360
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
2361
+ });
2362
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
2363
+ const p = u2.sort().slice(0, e2.maxClasses);
2364
+ o2 += p.map((b) => `.${b}`).join("");
2278
2365
  }
2279
2366
  }
2280
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2281
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae$1);
2282
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
2367
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2368
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de$1);
2369
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
2283
2370
  }
2284
- return a2;
2371
+ return o2;
2285
2372
  }
2286
- function le$1(r2) {
2373
+ function pe$1(r2, t2) {
2287
2374
  if (!r2.constraints || r2.constraints.length === 0)
2288
2375
  return "";
2289
- const t2 = [];
2290
- for (const e2 of r2.constraints)
2291
- switch (e2.type) {
2376
+ const e2 = [];
2377
+ for (const n2 of r2.constraints)
2378
+ switch (n2.type) {
2292
2379
  case "uniqueness":
2293
- t2.push("unique=true");
2380
+ e2.push("unique=true");
2294
2381
  break;
2295
2382
  case "position":
2296
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
2383
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
2297
2384
  break;
2298
2385
  case "text-proximity":
2299
- if (e2.params && e2.params.reference) {
2300
- const s2 = B$1(String(e2.params.reference));
2301
- t2.push(`text="${s2}"`);
2386
+ if (n2.params && n2.params.reference) {
2387
+ const a2 = V$1(String(n2.params.reference));
2388
+ e2.push(`text="${a2}"`);
2302
2389
  }
2303
2390
  break;
2304
2391
  }
2305
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
2392
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
2306
2393
  }
2307
- function B$1(r2) {
2394
+ function V$1(r2) {
2308
2395
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
2309
2396
  }
2310
- function xe$1(r2, t2, e2) {
2311
- const s2 = X$1(r2, t2);
2312
- return s2 ? oe$1(s2, e2) : null;
2397
+ function Ne$1(r2, t2, e2) {
2398
+ const s2 = J$1(r2, t2);
2399
+ return s2 ? ge$1(s2, e2) : null;
2313
2400
  }
2314
2401
  let _id = 1;
2315
2402
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -2982,7 +3069,7 @@ function serializeNodeWithId(n2, options) {
2982
3069
  enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
2983
3070
  fallbackToBody: selectorOptions.fallbackToBody
2984
3071
  };
2985
- const selector = xe$1(n2, seqlGeneratorOptions);
3072
+ const selector = Ne$1(n2, seqlGeneratorOptions);
2986
3073
  if (selector) {
2987
3074
  serializedNode.selector = selector;
2988
3075
  }
@@ -6977,6 +7064,29 @@ try {
6977
7064
  }
6978
7065
  } catch (error) {
6979
7066
  }
7067
+ const ht$1 = {
7068
+ id: "i",
7069
+ "data-testid": "tid",
7070
+ "data-qa": "qa",
7071
+ "data-cy": "cy",
7072
+ "data-test": "dt",
7073
+ "aria-label": "al",
7074
+ "aria-labelledby": "alb",
7075
+ "aria-describedby": "adb",
7076
+ name: "n",
7077
+ href: "h",
7078
+ src: "s",
7079
+ type: "t",
7080
+ role: "r",
7081
+ alt: "at",
7082
+ title: "tt",
7083
+ for: "f",
7084
+ placeholder: "ph",
7085
+ text: "x"
7086
+ };
7087
+ Object.fromEntries(
7088
+ Object.entries(ht$1).map(([r2, t2]) => [t2, r2])
7089
+ );
6980
7090
  function getDefaultExportFromCjs(x2) {
6981
7091
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
6982
7092
  }
@@ -11184,7 +11294,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
11184
11294
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
11185
11295
  return NodeType2;
11186
11296
  })(NodeType || {});
11187
- const U = {
11297
+ const z = {
11188
11298
  ANCHOR: 0.4,
11189
11299
  PATH: 0.3,
11190
11300
  TARGET: 0.2,
@@ -11198,9 +11308,9 @@ const U = {
11198
11308
  DEPTH_PENALTY_THRESHOLD: 5,
11199
11309
  DEPTH_PENALTY_FACTOR: 0.05,
11200
11310
  DEGRADED_SCORE: 0.3
11201
- }, gt = {
11311
+ }, bt = {
11202
11312
  MIN_CONFIDENCE_FOR_SKIP: 0.7
11203
- }, K = [
11313
+ }, tt = [
11204
11314
  "form",
11205
11315
  "main",
11206
11316
  "nav",
@@ -11208,7 +11318,7 @@ const U = {
11208
11318
  "article",
11209
11319
  "footer",
11210
11320
  "header"
11211
- ], J = [
11321
+ ], et = [
11212
11322
  "form",
11213
11323
  "navigation",
11214
11324
  "main",
@@ -11217,7 +11327,7 @@ const U = {
11217
11327
  "complementary",
11218
11328
  "banner",
11219
11329
  "search"
11220
- ], mt = [
11330
+ ], St = [
11221
11331
  // HTML5 Semantic
11222
11332
  "article",
11223
11333
  "aside",
@@ -11321,7 +11431,7 @@ const U = {
11321
11431
  "data-*": 30,
11322
11432
  // Any aria-* attribute (if not above)
11323
11433
  "aria-*": 25
11324
- }, V = /* @__PURE__ */ new Set([
11434
+ }, Y = /* @__PURE__ */ new Set([
11325
11435
  "id",
11326
11436
  // handled separately
11327
11437
  "class",
@@ -11333,7 +11443,7 @@ const U = {
11333
11443
  "tabindex",
11334
11444
  // can change
11335
11445
  "contenteditable"
11336
- ]), bt = {
11446
+ ]), At = {
11337
11447
  maxPathDepth: 10,
11338
11448
  enableSvgFingerprint: true,
11339
11449
  confidenceThreshold: 0,
@@ -11341,7 +11451,7 @@ const U = {
11341
11451
  includeUtilityClasses: false,
11342
11452
  source: "dom-dsl"
11343
11453
  };
11344
- function P(r2) {
11454
+ function L(r2) {
11345
11455
  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))
11346
11456
  return true;
11347
11457
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -11351,7 +11461,7 @@ function P(r2) {
11351
11461
  }
11352
11462
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
11353
11463
  }
11354
- const Q = /* @__PURE__ */ new Set([
11464
+ const Z = /* @__PURE__ */ new Set([
11355
11465
  "aria-labelledby",
11356
11466
  "aria-describedby",
11357
11467
  "aria-controls",
@@ -11365,10 +11475,10 @@ const Q = /* @__PURE__ */ new Set([
11365
11475
  "aria-errormessage",
11366
11476
  "aria-flowto"
11367
11477
  ]);
11368
- function Y(r2) {
11369
- return r2.trim().split(/\s+/).some((e2) => P(e2));
11478
+ function K(r2) {
11479
+ return r2.trim().split(/\s+/).some((e2) => L(e2));
11370
11480
  }
11371
- class St2 {
11481
+ class Ct2 {
11372
11482
  constructor(t2, e2) {
11373
11483
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
11374
11484
  }
@@ -11401,25 +11511,25 @@ class St2 {
11401
11511
  if (e2 === "head" || this.isInsideHead(t2)) {
11402
11512
  const c2 = s2 == null ? void 0 : s2.documentElement;
11403
11513
  if (c2) {
11404
- const u2 = {
11514
+ const l2 = {
11405
11515
  element: c2,
11406
11516
  score: 1,
11407
11517
  tier: "A",
11408
11518
  depth: 0
11409
11519
  };
11410
- return this.cacheResult(t2, u2), u2;
11520
+ return this.cacheResult(t2, l2), l2;
11411
11521
  }
11412
11522
  }
11413
11523
  if (e2 === "body") {
11414
11524
  const c2 = s2 == null ? void 0 : s2.documentElement;
11415
11525
  if (c2) {
11416
- const u2 = {
11526
+ const l2 = {
11417
11527
  element: c2,
11418
11528
  score: 1,
11419
11529
  tier: "A",
11420
11530
  depth: 0
11421
11531
  };
11422
- return this.cacheResult(t2, u2), u2;
11532
+ return this.cacheResult(t2, l2), l2;
11423
11533
  }
11424
11534
  }
11425
11535
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -11433,10 +11543,10 @@ class St2 {
11433
11543
  };
11434
11544
  const c2 = this.scoreAnchor(n2);
11435
11545
  if (c2 > 0) {
11436
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
11437
- if (d === "A")
11438
- return l2;
11439
- (!i2 || u2 > i2.score) && (i2 = l2);
11546
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
11547
+ if (f2 === "A")
11548
+ return h;
11549
+ (!i2 || l2 > i2.score) && (i2 = h);
11440
11550
  }
11441
11551
  n2 = n2.parentElement, a2++;
11442
11552
  }
@@ -11451,11 +11561,11 @@ class St2 {
11451
11561
  scoreAnchor(t2) {
11452
11562
  let e2 = 0;
11453
11563
  const s2 = t2.tagName.toLowerCase();
11454
- K.includes(s2) && (e2 += I.SEMANTIC_TAG);
11564
+ tt.includes(s2) && (e2 += I.SEMANTIC_TAG);
11455
11565
  const n2 = t2.getAttribute("role");
11456
- n2 && J.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
11566
+ n2 && et.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
11457
11567
  const a2 = t2.id;
11458
- 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);
11568
+ 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);
11459
11569
  }
11460
11570
  /**
11461
11571
  * Applies depth penalty to score
@@ -11472,10 +11582,10 @@ class St2 {
11472
11582
  */
11473
11583
  getTier(t2) {
11474
11584
  const e2 = t2.tagName.toLowerCase();
11475
- if (K.includes(e2))
11585
+ if (tt.includes(e2))
11476
11586
  return "A";
11477
11587
  const s2 = t2.getAttribute("role");
11478
- return s2 && J.includes(s2) ? "B" : "C";
11588
+ return s2 && et.includes(s2) ? "B" : "C";
11479
11589
  }
11480
11590
  /**
11481
11591
  * Checks if element is inside <head> section.
@@ -11508,7 +11618,7 @@ class St2 {
11508
11618
  this.cache && this.cache.setAnchor(t2, e2);
11509
11619
  }
11510
11620
  }
11511
- const At = [
11621
+ const Tt = [
11512
11622
  // CSS-in-JS
11513
11623
  /^css-[a-z0-9]+$/i,
11514
11624
  /^sc-[a-z0-9]+-\d+$/i,
@@ -11528,7 +11638,7 @@ const At = [
11528
11638
  /^_[a-z0-9]{5,}$/i,
11529
11639
  /\d{5,}/
11530
11640
  // 5+ digits in a row
11531
- ], xt = [
11641
+ ], Et = [
11532
11642
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
11533
11643
  /^\[/,
11534
11644
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -11640,29 +11750,81 @@ const At = [
11640
11750
  /^pull-(left|right)$/,
11641
11751
  /^float-(left|right|none)$/
11642
11752
  ];
11643
- function O(r2) {
11644
- return At.some((t2) => t2.test(r2));
11753
+ function q(r2) {
11754
+ return Tt.some((t2) => t2.test(r2));
11645
11755
  }
11646
- function _(r2) {
11647
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt.some((t2) => t2.test(r2));
11756
+ function U(r2) {
11757
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et.some((t2) => t2.test(r2));
11648
11758
  }
11649
- function Et(r2) {
11650
- return !O(r2) && !_(r2);
11759
+ function $t(r2) {
11760
+ return !q(r2) && !U(r2);
11651
11761
  }
11652
11762
  function M(r2) {
11653
- return r2.filter((t2) => Et(t2));
11763
+ return r2.filter((t2) => $t(t2));
11654
11764
  }
11655
- function vt(r2) {
11765
+ function It(r2) {
11656
11766
  const t2 = [], e2 = [];
11657
11767
  for (const s2 of r2)
11658
- _(s2) || O(s2) ? e2.push(s2) : t2.push(s2);
11768
+ U(s2) || q(s2) ? e2.push(s2) : t2.push(s2);
11659
11769
  return { semantic: t2, utility: e2 };
11660
11770
  }
11661
- function tt(r2) {
11662
- return _(r2) || O(r2);
11771
+ function st(r2) {
11772
+ return U(r2) || q(r2);
11773
+ }
11774
+ const Rt = /* @__PURE__ */ new Set([
11775
+ "tr",
11776
+ "td",
11777
+ "th",
11778
+ "thead",
11779
+ "tbody",
11780
+ "tfoot"
11781
+ ]), Dt = /* @__PURE__ */ new Set([
11782
+ "data-testid",
11783
+ "data-qa",
11784
+ "data-cy",
11785
+ "data-test",
11786
+ "aria-label",
11787
+ "name",
11788
+ "href"
11789
+ ]);
11790
+ function Mt(r2) {
11791
+ if (r2.id) return true;
11792
+ if (r2.attributes) {
11793
+ for (const t2 of Object.keys(r2.attributes))
11794
+ if (Dt.has(t2)) return true;
11795
+ }
11796
+ return false;
11797
+ }
11798
+ function Lt(r2, t2, e2) {
11799
+ var _a2;
11800
+ const s2 = r2.parentElement;
11801
+ if (!s2) return true;
11802
+ for (const n2 of Array.from(s2.children)) {
11803
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
11804
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
11805
+ }
11806
+ return true;
11807
+ }
11808
+ function _(r2, t2, e2) {
11809
+ var _a2;
11810
+ if (Rt.has(r2)) return true;
11811
+ if (Mt(t2)) return false;
11812
+ if (e2) {
11813
+ const s2 = e2.parentElement;
11814
+ if (s2) {
11815
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
11816
+ if (n2 && Lt(e2, r2, n2))
11817
+ return false;
11818
+ if (Array.from(s2.children).some(
11819
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
11820
+ )) return true;
11821
+ }
11822
+ return false;
11823
+ }
11824
+ return true;
11663
11825
  }
11664
- const et = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
11665
- class $t2 {
11826
+ const rt = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
11827
+ class Pt2 {
11666
11828
  constructor(t2, e2) {
11667
11829
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
11668
11830
  }
@@ -11697,19 +11859,22 @@ class $t2 {
11697
11859
  degraded: true,
11698
11860
  degradationReason: "target-not-descendant-of-anchor"
11699
11861
  };
11700
- let u2 = this.filterNoise(i2);
11701
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
11702
- path: u2.map((l2) => {
11703
- const h = l2.parentElement;
11862
+ let l2 = this.filterNoise(i2);
11863
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
11864
+ path: l2.map((h) => {
11865
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
11704
11866
  let g;
11705
- if (h) {
11706
- const m = Array.from(h.children).indexOf(l2);
11707
- m !== -1 && (g = m + 1);
11867
+ if (_(d, u2, h)) {
11868
+ const m = h.parentElement;
11869
+ if (m) {
11870
+ const b = Array.from(m.children).indexOf(h);
11871
+ b !== -1 && (g = b + 1);
11872
+ }
11708
11873
  }
11709
11874
  return {
11710
- tag: l2.tagName.toLowerCase(),
11711
- semantics: s2.extract(l2),
11712
- score: s2.scoreElement(l2),
11875
+ tag: d,
11876
+ semantics: u2,
11877
+ score: s2.scoreElement(h),
11713
11878
  nthChild: g
11714
11879
  };
11715
11880
  }),
@@ -11734,27 +11899,27 @@ class $t2 {
11734
11899
  if (!o2) return e2;
11735
11900
  let c2;
11736
11901
  if (this.cache) {
11737
- const d = this.cache.getSelectorResults(i2);
11738
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
11902
+ const f2 = this.cache.getSelectorResults(i2);
11903
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
11739
11904
  } else
11740
11905
  c2 = o2.querySelectorAll(i2);
11741
11906
  if (c2.length <= 1)
11742
11907
  return e2;
11743
- const u2 = t2.filter((d) => !e2.includes(d));
11744
- for (const d of u2) {
11745
- if (a2.scoreElement(d) < gt.MIN_CONFIDENCE_FOR_SKIP)
11908
+ const l2 = t2.filter((f2) => !e2.includes(f2));
11909
+ for (const f2 of l2) {
11910
+ if (a2.scoreElement(f2) < bt.MIN_CONFIDENCE_FOR_SKIP)
11746
11911
  continue;
11747
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
11912
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
11748
11913
  try {
11749
- let f2;
11914
+ let g;
11750
11915
  if (this.cache) {
11751
- const m = this.cache.getSelectorResults(g);
11752
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
11916
+ const m = this.cache.getSelectorResults(u2);
11917
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
11753
11918
  } else
11754
- f2 = o2.querySelectorAll(g);
11755
- if (f2.length === 1)
11756
- return h;
11757
- f2.length < c2.length && (e2 = h);
11919
+ g = o2.querySelectorAll(u2);
11920
+ if (g.length === 1)
11921
+ return d;
11922
+ g.length < c2.length && (e2 = d);
11758
11923
  } catch {
11759
11924
  }
11760
11925
  }
@@ -11788,9 +11953,9 @@ class $t2 {
11788
11953
  */
11789
11954
  elementToSelector(t2) {
11790
11955
  let e2 = t2.tagName.toLowerCase();
11791
- t2.id && !P(t2.id) && (e2 += `#${et(t2.id)}`);
11956
+ t2.id && !L(t2.id) && (e2 += `#${rt(t2.id)}`);
11792
11957
  for (const s2 of Array.from(t2.classList))
11793
- tt(s2) || (e2 += `.${et(s2)}`);
11958
+ st(s2) || (e2 += `.${rt(s2)}`);
11794
11959
  return e2;
11795
11960
  }
11796
11961
  /**
@@ -11804,7 +11969,7 @@ class $t2 {
11804
11969
  */
11805
11970
  shouldInclude(t2) {
11806
11971
  const e2 = t2.tagName.toLowerCase();
11807
- return mt.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
11972
+ return St.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
11808
11973
  }
11809
11974
  /**
11810
11975
  * Checks if element has meaningful semantic features
@@ -11815,12 +11980,12 @@ class $t2 {
11815
11980
  if (s2.name.startsWith("aria-")) return true;
11816
11981
  if (t2.classList.length > 0) {
11817
11982
  for (const s2 of Array.from(t2.classList))
11818
- if (!tt(s2)) return true;
11983
+ if (!st(s2)) return true;
11819
11984
  }
11820
11985
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
11821
11986
  return true;
11822
11987
  const e2 = t2.id;
11823
- return !!(e2 && !P(e2));
11988
+ return !!(e2 && !L(e2));
11824
11989
  }
11825
11990
  /**
11826
11991
  * Checks if element is inside <head> section.
@@ -11867,31 +12032,34 @@ class $t2 {
11867
12032
  degradationReason: "head-not-found-in-path"
11868
12033
  } : {
11869
12034
  path: n2.map((c2) => {
11870
- const u2 = c2.parentElement;
11871
- let d;
11872
- if (u2) {
11873
- const h = Array.from(u2.children).indexOf(c2);
11874
- h !== -1 && (d = h + 1);
12035
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
12036
+ let h;
12037
+ if (_(l2, f2, c2)) {
12038
+ const d = c2.parentElement;
12039
+ if (d) {
12040
+ const g = Array.from(d.children).indexOf(c2);
12041
+ g !== -1 && (h = g + 1);
12042
+ }
11875
12043
  }
11876
12044
  return {
11877
- tag: c2.tagName.toLowerCase(),
11878
- semantics: s2.extract(c2),
12045
+ tag: l2,
12046
+ semantics: f2,
11879
12047
  score: s2.scoreElement(c2),
11880
- nthChild: d
12048
+ nthChild: h
11881
12049
  };
11882
12050
  }),
11883
12051
  degraded: false
11884
12052
  };
11885
12053
  }
11886
12054
  }
11887
- function F(r2) {
12055
+ function j(r2) {
11888
12056
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
11889
12057
  }
11890
- const Nt = {
12058
+ const Ht = {
11891
12059
  preserveQueryForAbsolute: true,
11892
12060
  removeDynamicHashes: true
11893
12061
  };
11894
- function It(r2) {
12062
+ function kt(r2) {
11895
12063
  return r2 ? [
11896
12064
  /\d{5,}/,
11897
12065
  // 5+ digits
@@ -11905,18 +12073,18 @@ function It(r2) {
11905
12073
  // UUID-like
11906
12074
  ].some((e2) => e2.test(r2)) : false;
11907
12075
  }
11908
- function Rt(r2, t2) {
12076
+ function _t(r2, t2) {
11909
12077
  if (!r2) return r2;
11910
12078
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
11911
12079
  let o2 = a2;
11912
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It(n2) || (o2 += `#${n2}`)), o2;
12080
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt(n2) || (o2 += `#${n2}`)), o2;
11913
12081
  }
11914
12082
  function D(r2, t2, e2 = {}) {
11915
12083
  if (!t2) return t2;
11916
- const s2 = { ...Nt, ...e2 };
11917
- return r2 === "href" || r2 === "src" ? Rt(t2, s2) : t2;
12084
+ const s2 = { ...Ht, ...e2 };
12085
+ return r2 === "href" || r2 === "src" ? _t(t2, s2) : t2;
11918
12086
  }
11919
- const Dt = [
12087
+ const Ot = [
11920
12088
  "role",
11921
12089
  "aria-label",
11922
12090
  "aria-labelledby",
@@ -11927,7 +12095,7 @@ const Dt = [
11927
12095
  "aria-posinset",
11928
12096
  "aria-setsize",
11929
12097
  "aria-haspopup"
11930
- ], Mt = [
12098
+ ], qt = [
11931
12099
  "aria-selected",
11932
12100
  "aria-checked",
11933
12101
  "aria-pressed",
@@ -11940,7 +12108,7 @@ const Dt = [
11940
12108
  "aria-grabbed",
11941
12109
  "aria-live",
11942
12110
  "aria-atomic"
11943
- ], Pt = [
12111
+ ], Ut = [
11944
12112
  "data-state",
11945
12113
  "data-active",
11946
12114
  "data-inactive",
@@ -11959,7 +12127,7 @@ const Dt = [
11959
12127
  "data-hover",
11960
12128
  "data-orientation",
11961
12129
  "data-theme"
11962
- ], Ht = [
12130
+ ], zt = [
11963
12131
  "data-radix-",
11964
12132
  "data-headlessui-",
11965
12133
  "data-reach-",
@@ -11967,7 +12135,7 @@ const Dt = [
11967
12135
  "data-chakra-",
11968
12136
  "data-mantine-",
11969
12137
  "data-tw-"
11970
- ], Lt = [
12138
+ ], Ft = [
11971
12139
  "data-testid",
11972
12140
  "data-test-id",
11973
12141
  "data-test",
@@ -11979,7 +12147,7 @@ const Dt = [
11979
12147
  "data-entity-id",
11980
12148
  "data-product-id",
11981
12149
  "data-user-id"
11982
- ], kt = [
12150
+ ], jt = [
11983
12151
  // Google Analytics / GTM
11984
12152
  "data-ga",
11985
12153
  "data-gtm",
@@ -12015,7 +12183,7 @@ const Dt = [
12015
12183
  "data-conversion",
12016
12184
  "data-segment",
12017
12185
  "data-analytics"
12018
- ], qt = [
12186
+ ], Wt = [
12019
12187
  "data-category",
12020
12188
  // Google Analytics category
12021
12189
  "data-action",
@@ -12024,7 +12192,7 @@ const Dt = [
12024
12192
  // Google Analytics label
12025
12193
  "data-value"
12026
12194
  // Google Analytics value
12027
- ], Ot = [
12195
+ ], Bt = [
12028
12196
  "id",
12029
12197
  "name",
12030
12198
  "type",
@@ -12033,7 +12201,7 @@ const Dt = [
12033
12201
  "for",
12034
12202
  "alt",
12035
12203
  "href"
12036
- ], _t = [
12204
+ ], Gt = [
12037
12205
  "disabled",
12038
12206
  "checked",
12039
12207
  "selected",
@@ -12041,17 +12209,17 @@ const Dt = [
12041
12209
  "readonly",
12042
12210
  "required",
12043
12211
  "value"
12044
- ], Ut = [
12212
+ ], Vt = [
12045
12213
  /^radix-/,
12046
12214
  /^headlessui-/,
12047
12215
  /^mui-/,
12048
12216
  /:\w+:/
12049
12217
  // matches :ru:, :r1:, etc.
12050
12218
  ];
12051
- function zt(r2, t2) {
12052
- 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-");
12219
+ function Qt(r2, t2) {
12220
+ 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-");
12053
12221
  }
12054
- class st2 {
12222
+ class nt2 {
12055
12223
  constructor(t2, e2) {
12056
12224
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
12057
12225
  }
@@ -12067,12 +12235,12 @@ class st2 {
12067
12235
  return i2;
12068
12236
  }
12069
12237
  const e2 = {}, s2 = t2.id;
12070
- if (s2 && !P(s2) && (e2.id = s2), t2.classList.length > 0) {
12238
+ if (s2 && !L(s2) && (e2.id = s2), t2.classList.length > 0) {
12071
12239
  const i2 = Array.from(t2.classList);
12072
12240
  if (this.includeUtilityClasses)
12073
12241
  e2.classes = i2;
12074
12242
  else {
12075
- const { semantic: o2 } = vt(i2);
12243
+ const { semantic: o2 } = It(i2);
12076
12244
  o2.length > 0 && (e2.classes = o2);
12077
12245
  }
12078
12246
  }
@@ -12101,7 +12269,7 @@ class st2 {
12101
12269
  * @returns True if should be ignored
12102
12270
  */
12103
12271
  shouldIgnoreAttribute(t2) {
12104
- 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-"));
12272
+ 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-"));
12105
12273
  }
12106
12274
  /**
12107
12275
  * Gets attribute priority
@@ -12136,7 +12304,7 @@ class st2 {
12136
12304
  const e2 = {};
12137
12305
  for (const s2 of Array.from(t2.attributes)) {
12138
12306
  const n2 = s2.name;
12139
- if (this.shouldIgnoreAttribute(n2) || !zt(n2, s2.value) || Q.has(n2) && Y(s2.value) || this.getAttributePriority(n2) === 0) continue;
12307
+ if (this.shouldIgnoreAttribute(n2) || !Qt(n2, s2.value) || Z.has(n2) && K(s2.value) || this.getAttributePriority(n2) === 0) continue;
12140
12308
  const i2 = n2 === "href" || n2 === "src" ? D(n2, s2.value) : s2.value;
12141
12309
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
12142
12310
  }
@@ -12148,7 +12316,7 @@ class st2 {
12148
12316
  extractText(t2) {
12149
12317
  const e2 = this.getDirectTextContent(t2);
12150
12318
  if (!e2) return null;
12151
- const s2 = F(e2);
12319
+ const s2 = j(e2);
12152
12320
  if (!s2) return null;
12153
12321
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
12154
12322
  return {
@@ -12196,7 +12364,7 @@ class st2 {
12196
12364
  ].includes(e2);
12197
12365
  }
12198
12366
  }
12199
- class Ft2 {
12367
+ class Yt2 {
12200
12368
  /**
12201
12369
  * Generates fingerprint for SVG element
12202
12370
  * @param element - SVG element to fingerprint
@@ -12307,11 +12475,11 @@ class Ft2 {
12307
12475
  return Math.abs(e2).toString(16).padStart(8, "0");
12308
12476
  }
12309
12477
  }
12310
- function jt(r2, t2 = 0) {
12311
- 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;
12478
+ function Zt(r2, t2 = 0) {
12479
+ 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;
12312
12480
  return Math.max(0, Math.min(1, a2 - i2));
12313
12481
  }
12314
- class Wt2 {
12482
+ class Kt2 {
12315
12483
  constructor(t2) {
12316
12484
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
12317
12485
  }
@@ -12342,9 +12510,9 @@ class Wt2 {
12342
12510
  return this.cache.size;
12343
12511
  }
12344
12512
  }
12345
- class Bt2 {
12513
+ class Xt2 {
12346
12514
  constructor(t2 = {}) {
12347
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt2(
12515
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt2(
12348
12516
  t2.maxSelectorCacheSize ?? 1e3
12349
12517
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
12350
12518
  eidHits: 0,
@@ -12493,12 +12661,12 @@ class Bt2 {
12493
12661
  return s2 > 0 ? t2 / s2 : 0;
12494
12662
  }
12495
12663
  }
12496
- function Gt(r2) {
12497
- return new Bt2(r2);
12664
+ function Jt(r2) {
12665
+ return new Xt2(r2);
12498
12666
  }
12499
- let z = null;
12500
- function Z() {
12501
- return z || (z = Gt()), z;
12667
+ let F = null;
12668
+ function X() {
12669
+ return F || (F = Jt()), F;
12502
12670
  }
12503
12671
  function k(r2) {
12504
12672
  if (r2.ownerDocument)
@@ -12516,7 +12684,7 @@ function k(r2) {
12516
12684
  3. You are working with a document node instead of an element`
12517
12685
  );
12518
12686
  }
12519
- function Vt(r2, t2) {
12687
+ function te(r2, t2) {
12520
12688
  if (!t2)
12521
12689
  return;
12522
12690
  const e2 = k(r2), s2 = t2 instanceof Document ? t2 : k(t2);
@@ -12531,64 +12699,65 @@ Common causes:
12531
12699
  Solution: Ensure element and root parameter are from the same document context.`
12532
12700
  );
12533
12701
  }
12534
- function X(r2, t2 = {}) {
12702
+ function J(r2, t2 = {}) {
12535
12703
  var _a2;
12536
12704
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
12537
12705
  return null;
12538
- const e2 = { ...bt, ...t2 };
12706
+ const e2 = { ...At, ...t2 };
12539
12707
  if (e2.root)
12540
12708
  try {
12541
- Vt(r2, e2.root);
12709
+ te(r2, e2.root);
12542
12710
  } catch (x2) {
12543
12711
  return console.error("Cross-document generation detected:", x2), null;
12544
12712
  }
12545
- const s2 = e2.cache ?? Z(), n2 = s2.getEID(r2);
12713
+ const s2 = e2.cache ?? X(), n2 = s2.getEID(r2);
12546
12714
  if (n2 !== void 0)
12547
12715
  return n2;
12548
- if (r2.tagName.toLowerCase() === "html") {
12549
- const x2 = new st2(e2, s2), y = Zt(r2, e2, x2);
12716
+ const a2 = r2.tagName.toLowerCase();
12717
+ if (a2 === "html") {
12718
+ const x2 = new nt2(e2, s2), y = re(r2, e2, x2);
12550
12719
  return s2.setEID(r2, y), y;
12551
12720
  }
12552
- const i2 = new St2(e2, s2), o2 = new $t2(e2, s2), c2 = new st2(e2, s2), u2 = new Ft2(), d = i2.findAnchor(r2);
12553
- if (!d && !e2.fallbackToBody)
12721
+ const i2 = new Ct2(e2, s2), o2 = new Pt2(e2, s2), c2 = new nt2(e2, s2), l2 = new Yt2(), f2 = i2.findAnchor(r2);
12722
+ if (!f2 && !e2.fallbackToBody)
12554
12723
  return null;
12555
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
12556
- if (!l2) return null;
12557
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
12558
- let m;
12559
- if (f2 && g !== "body" && g !== "html") {
12560
- const y = Array.from(f2.children).indexOf(l2);
12561
- y !== -1 && (m = y + 1);
12562
- }
12563
- const p = c2.extract(l2), b = {
12564
- tag: l2.tagName.toLowerCase(),
12565
- semantics: p,
12566
- score: (d == null ? void 0 : d.score) ?? I.DEGRADED_SCORE,
12567
- degraded: h,
12568
- nthChild: m
12569
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
12570
- e2.enableSvgFingerprint && Qt(r2) && (E.svg = u2.fingerprint(r2));
12724
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
12725
+ if (!h) return null;
12726
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
12727
+ let p;
12728
+ if (m && u2 !== "body" && u2 !== "html" && _(u2, g, h)) {
12729
+ const y = Array.from(m.children).indexOf(h);
12730
+ y !== -1 && (p = y + 1);
12731
+ }
12732
+ const b = {
12733
+ tag: h.tagName.toLowerCase(),
12734
+ semantics: g,
12735
+ score: (f2 == null ? void 0 : f2.score) ?? I.DEGRADED_SCORE,
12736
+ degraded: d,
12737
+ nthChild: p
12738
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
12739
+ e2.enableSvgFingerprint && ee(r2) && (T.svg = l2.fingerprint(r2));
12571
12740
  const C = r2.parentElement;
12572
12741
  let A;
12573
- if (C) {
12742
+ if (C && _(a2, T, r2)) {
12574
12743
  const y = Array.from(C.children).indexOf(r2);
12575
12744
  y !== -1 && (A = y + 1);
12576
12745
  }
12577
12746
  const v2 = {
12578
12747
  tag: r2.tagName.toLowerCase(),
12579
- semantics: E,
12748
+ semantics: T,
12580
12749
  score: c2.scoreElement(r2),
12581
12750
  nthChild: A
12582
- }, H = [], $ = {
12751
+ }, P = [], $ = {
12583
12752
  onMultiple: "best-score",
12584
12753
  onMissing: "anchor-only",
12585
12754
  maxDepth: 3
12586
- }, T = b.degraded || S.degraded, R = Yt(b.degraded, S), N = {
12755
+ }, E = b.degraded || S.degraded, R = se(b.degraded, S), N = {
12587
12756
  version: "1.0",
12588
12757
  anchor: b,
12589
12758
  path: S.path,
12590
12759
  target: v2,
12591
- constraints: H,
12760
+ constraints: P,
12592
12761
  fallback: $,
12593
12762
  meta: {
12594
12763
  confidence: 0,
@@ -12596,16 +12765,16 @@ function X(r2, t2 = {}) {
12596
12765
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
12597
12766
  generator: "dom-eid@1.0",
12598
12767
  source: e2.source,
12599
- degraded: T,
12768
+ degraded: E,
12600
12769
  degradationReason: R
12601
12770
  }
12602
12771
  };
12603
- return N.meta.confidence = jt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
12772
+ return N.meta.confidence = Zt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
12604
12773
  }
12605
- function Qt(r2) {
12774
+ function ee(r2) {
12606
12775
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
12607
12776
  }
12608
- function Yt(r2, t2) {
12777
+ function se(r2, t2) {
12609
12778
  if (r2 && t2.degraded)
12610
12779
  return "anchor-and-path-degraded";
12611
12780
  if (r2)
@@ -12613,7 +12782,7 @@ function Yt(r2, t2) {
12613
12782
  if (t2.degraded)
12614
12783
  return t2.degradationReason;
12615
12784
  }
12616
- function Zt(r2, t2, e2, s2) {
12785
+ function re(r2, t2, e2, s2) {
12617
12786
  const a2 = {
12618
12787
  tag: "html",
12619
12788
  semantics: e2.extract(r2),
@@ -12642,91 +12811,119 @@ function Zt(r2, t2, e2, s2) {
12642
12811
  }
12643
12812
  };
12644
12813
  }
12645
- const ct = {
12814
+ const ht = {
12815
+ id: "i",
12816
+ "data-testid": "tid",
12817
+ "data-qa": "qa",
12818
+ "data-cy": "cy",
12819
+ "data-test": "dt",
12820
+ "aria-label": "al",
12821
+ "aria-labelledby": "alb",
12822
+ "aria-describedby": "adb",
12823
+ name: "n",
12824
+ href: "h",
12825
+ src: "s",
12826
+ type: "t",
12827
+ role: "r",
12828
+ alt: "at",
12829
+ title: "tt",
12830
+ for: "f",
12831
+ placeholder: "ph",
12832
+ text: "x"
12833
+ }, G = Object.fromEntries(
12834
+ Object.entries(ht).map(([r2, t2]) => [t2, r2])
12835
+ ), ut = {
12646
12836
  maxClasses: 2,
12647
12837
  maxAttributes: 5,
12648
12838
  includeText: true,
12649
12839
  maxTextLength: 50,
12650
12840
  simplifyTarget: true,
12651
- includeConstraints: true
12841
+ includeConstraints: true,
12842
+ format: "compact"
12652
12843
  };
12653
- function it(r2) {
12844
+ function ct(r2) {
12654
12845
  return r2 === "id" ? 101 : w[r2] !== void 0 ? w[r2] : r2.startsWith("data-") ? w["data-*"] : r2.startsWith("aria-") ? w["aria-*"] : 0;
12655
12846
  }
12656
- function ae(r2) {
12847
+ function de(r2) {
12657
12848
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
12658
12849
  }
12659
- function ie(r2) {
12850
+ function fe(r2) {
12660
12851
  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));
12661
12852
  }
12662
- function oe(r2, t2) {
12663
- 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) : "";
12664
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
12665
- }
12666
- function j(r2, t2 = false, e2 = ct) {
12667
- const { tag: s2, semantics: n2 } = r2;
12668
- let a2 = s2;
12669
- const i2 = [], o2 = { ...n2.attributes };
12670
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
12671
- const c2 = Object.entries(o2).map(([l2, h]) => {
12672
- const g = it(l2), f2 = l2 === "href" || l2 === "src" ? D(l2, h) : h;
12673
- return { name: l2, value: f2, priority: g };
12674
- }).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");
12675
- c2.sort((l2, h) => h.priority - l2.priority);
12676
- const u2 = c2.slice(0, e2.maxAttributes);
12677
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
12678
- for (const { name: l2, value: h } of u2)
12679
- i2.push(`${l2}="${B(h)}"`);
12680
- if (e2.includeText && n2.text && !ie(n2.text.normalized)) {
12681
- const l2 = n2.text.normalized;
12682
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B(l2)}"`);
12683
- }
12684
- let d = i2;
12685
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
12686
- const h = l2.split("=")[0];
12687
- return it(h) >= 60 || h === "text" || h === "id" || h === "role";
12688
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
12689
- const l2 = M(n2.classes), h = !!n2.id || i2.some(
12690
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
12691
- );
12692
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
12693
- const f2 = l2.sort().slice(0, e2.maxClasses);
12694
- a2 += f2.map((m) => `.${m}`).join("");
12853
+ function ge(r2, t2) {
12854
+ 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) : "";
12855
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
12856
+ }
12857
+ function W(r2, t2 = false, e2 = ut, s2) {
12858
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
12859
+ let o2 = n2;
12860
+ const c2 = [], l2 = { ...a2.attributes };
12861
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
12862
+ const f2 = Object.entries(l2).map(([u2, g]) => {
12863
+ const m = ct(u2), p = u2 === "href" || u2 === "src" ? D(u2, g) : g;
12864
+ return { name: u2, value: p, priority: m };
12865
+ }).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");
12866
+ f2.sort((u2, g) => g.priority - u2.priority);
12867
+ const h = f2.slice(0, e2.maxAttributes);
12868
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
12869
+ for (const { name: u2, value: g } of h) {
12870
+ const m = i2 ? ht[u2] ?? u2 : u2;
12871
+ c2.push(`${m}="${V(g)}"`);
12872
+ }
12873
+ if (e2.includeText && a2.text && !fe(a2.text.normalized)) {
12874
+ const u2 = a2.text.normalized;
12875
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
12876
+ const m = i2 ? "x" : "text";
12877
+ c2.push(`${m}="${V(u2)}"`);
12878
+ }
12879
+ }
12880
+ let d = c2;
12881
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
12882
+ const g = u2.split("=")[0], m = G[g] ?? g;
12883
+ return ct(m) >= 60 || m === "text" || m === "id" || m === "role";
12884
+ })), a2.classes && a2.classes.length > 0) {
12885
+ const u2 = M(a2.classes), g = !!a2.id || c2.some((p) => {
12886
+ const b = p.split("=")[0], S = G[b] ?? b;
12887
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
12888
+ });
12889
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
12890
+ const p = u2.sort().slice(0, e2.maxClasses);
12891
+ o2 += p.map((b) => `.${b}`).join("");
12695
12892
  }
12696
12893
  }
12697
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
12698
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae);
12699
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
12894
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
12895
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de);
12896
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
12700
12897
  }
12701
- return a2;
12898
+ return o2;
12702
12899
  }
12703
- function le(r2) {
12900
+ function pe(r2, t2) {
12704
12901
  if (!r2.constraints || r2.constraints.length === 0)
12705
12902
  return "";
12706
- const t2 = [];
12707
- for (const e2 of r2.constraints)
12708
- switch (e2.type) {
12903
+ const e2 = [];
12904
+ for (const n2 of r2.constraints)
12905
+ switch (n2.type) {
12709
12906
  case "uniqueness":
12710
- t2.push("unique=true");
12907
+ e2.push("unique=true");
12711
12908
  break;
12712
12909
  case "position":
12713
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
12910
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
12714
12911
  break;
12715
12912
  case "text-proximity":
12716
- if (e2.params && e2.params.reference) {
12717
- const s2 = B(String(e2.params.reference));
12718
- t2.push(`text="${s2}"`);
12913
+ if (n2.params && n2.params.reference) {
12914
+ const a2 = V(String(n2.params.reference));
12915
+ e2.push(`text="${a2}"`);
12719
12916
  }
12720
12917
  break;
12721
12918
  }
12722
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
12919
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
12723
12920
  }
12724
- function B(r2) {
12921
+ function V(r2) {
12725
12922
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
12726
12923
  }
12727
- function xe(r2, t2, e2) {
12728
- const s2 = X(r2, t2);
12729
- return s2 ? oe(s2, e2) : null;
12924
+ function Ne(r2, t2, e2) {
12925
+ const s2 = J(r2, t2);
12926
+ return s2 ? ge(s2, e2) : null;
12730
12927
  }
12731
12928
  const defaultSelectorOptions = {
12732
12929
  maxPathDepth: 10,
@@ -12772,7 +12969,7 @@ function resolveNodeSelector(node2, mirror2, selectorOptions, options) {
12772
12969
  fallbackToBody: selectorOptions.fallbackToBody
12773
12970
  };
12774
12971
  try {
12775
- const selector = xe(element, seqlOptions);
12972
+ const selector = Ne(element, seqlOptions);
12776
12973
  if (selector) {
12777
12974
  if (elementMeta) {
12778
12975
  elementMeta.selector = selector;
@@ -13901,7 +14098,8 @@ function initInputObserver({
13901
14098
  maskInputOptions,
13902
14099
  maskInputFn,
13903
14100
  sampling,
13904
- userTriggeredOnInput
14101
+ userTriggeredOnInput,
14102
+ trustSyntheticInput
13905
14103
  }) {
13906
14104
  function eventHandler(event) {
13907
14105
  let target = getEventTarget(event);
@@ -13951,34 +14149,53 @@ function initInputObserver({
13951
14149
  function cbWithDedup(target, v2) {
13952
14150
  const lastInputValue = lastInputValueMap.get(target);
13953
14151
  const el = target;
13954
- const hasPlaceholder = el.hasAttribute("placeholder");
13955
- const isEmpty = el.value === "";
13956
- const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
13957
- const isNonUser = !v2.userTriggered;
13958
- const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
13959
- const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
13960
- const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
13961
- const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
13962
- const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
13963
- const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
13964
- if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
13965
- console.debug(
13966
- `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
13967
- {
13968
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
13969
- node: index.describeNode(el),
13970
- tag: el.tagName,
13971
- nodeType: el.nodeType,
13972
- attribute: el.attributes,
13973
- value: el.value,
13974
- isLikelyPhantom,
13975
- isRenderDrivenTextInput,
13976
- isValueFromDefault,
13977
- isPhantomCheckbox,
13978
- isPhantomRadio
13979
- }
13980
- );
13981
- return;
14152
+ if (trustSyntheticInput) {
14153
+ const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
14154
+ const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
14155
+ if (isInitialEmpty || isSelectDefaultSelection) {
14156
+ console.debug(
14157
+ `[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
14158
+ {
14159
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
14160
+ node: index.describeNode(el),
14161
+ tag: el.tagName,
14162
+ value: el.value,
14163
+ isInitialEmpty,
14164
+ isSelectDefaultSelection
14165
+ }
14166
+ );
14167
+ return;
14168
+ }
14169
+ } else {
14170
+ const hasPlaceholder = el.hasAttribute("placeholder");
14171
+ const isEmpty = el.value === "";
14172
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
14173
+ const isNonUser = !v2.userTriggered;
14174
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
14175
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
14176
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
14177
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
14178
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
14179
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
14180
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
14181
+ console.debug(
14182
+ `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
14183
+ {
14184
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
14185
+ node: index.describeNode(el),
14186
+ tag: el.tagName,
14187
+ nodeType: el.nodeType,
14188
+ attribute: el.attributes,
14189
+ value: el.value,
14190
+ isLikelyPhantom,
14191
+ isRenderDrivenTextInput,
14192
+ isValueFromDefault,
14193
+ isPhantomCheckbox,
14194
+ isPhantomRadio
14195
+ }
14196
+ );
14197
+ return;
14198
+ }
13982
14199
  }
13983
14200
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
13984
14201
  lastInputValueMap.set(target, v2);
@@ -16009,8 +16226,15 @@ class NavigationManager {
16009
16226
  handleNavigation(data) {
16010
16227
  if (this.disabled) return;
16011
16228
  if (this.locked) return;
16012
- this.cancelTimers();
16013
- this.disconnectSettlingObserver();
16229
+ if (this.pendingNavigation) {
16230
+ this.cancelTimers();
16231
+ this.disconnectSettlingObserver();
16232
+ this.pendingNavigation = null;
16233
+ this.onSnapshot(true);
16234
+ } else {
16235
+ this.cancelTimers();
16236
+ this.disconnectSettlingObserver();
16237
+ }
16014
16238
  this.pendingNavigation = data;
16015
16239
  if (this.frozen) {
16016
16240
  return;
@@ -16217,7 +16441,7 @@ class ProcessedNodeManager {
16217
16441
  destroy() {
16218
16442
  }
16219
16443
  }
16220
- const version$1 = "3.6.0-alpha.1";
16444
+ const version$1 = "3.11.0-alpha.1";
16221
16445
  let wrappedEmit;
16222
16446
  let takeFullSnapshot$1;
16223
16447
  let canvasManager;
@@ -16266,6 +16490,7 @@ function record(options = {}) {
16266
16490
  recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
16267
16491
  flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
16268
16492
  userTriggeredOnInput = false,
16493
+ trustSyntheticInput = false,
16269
16494
  collectFonts = false,
16270
16495
  inlineImages = false,
16271
16496
  plugins,
@@ -16805,6 +17030,7 @@ function record(options = {}) {
16805
17030
  recordCanvas,
16806
17031
  inlineImages,
16807
17032
  userTriggeredOnInput,
17033
+ trustSyntheticInput,
16808
17034
  collectFonts,
16809
17035
  doc,
16810
17036
  maskInputFn,
@@ -16881,6 +17107,43 @@ function record(options = {}) {
16881
17107
  );
16882
17108
  }
16883
17109
  return () => {
17110
+ if (recording) {
17111
+ const activeEl = document.activeElement;
17112
+ if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
17113
+ const inputEl = activeEl;
17114
+ const id = mirror.getId(inputEl);
17115
+ if (id !== -1) {
17116
+ const lastValue = lastInputValueMap.get(inputEl);
17117
+ let text = inputEl.value;
17118
+ let isChecked = false;
17119
+ const type = getInputType(inputEl) || "";
17120
+ if (type === "radio" || type === "checkbox") {
17121
+ isChecked = inputEl.checked;
17122
+ } else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
17123
+ text = maskInputValue({
17124
+ element: inputEl,
17125
+ maskInputOptions,
17126
+ tagName: inputEl.tagName,
17127
+ type,
17128
+ value: text,
17129
+ maskInputFn
17130
+ });
17131
+ }
17132
+ if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
17133
+ const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
17134
+ lastInputValueMap.set(inputEl, inputData);
17135
+ wrappedEmit({
17136
+ type: EventType.IncrementalSnapshot,
17137
+ data: {
17138
+ source: IncrementalSource.Input,
17139
+ ...inputData,
17140
+ id
17141
+ }
17142
+ });
17143
+ }
17144
+ }
17145
+ }
17146
+ }
16884
17147
  if (checkoutDebounceTimer) {
16885
17148
  clearTimeout(checkoutDebounceTimer);
16886
17149
  checkoutDebounceTimer = null;