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