mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 15:16:35 +03:00
Skill and plugin copies of the detector had no htmlparser2/css-select/css-tree/domutils, so HTML scans silently fell back to regex and exited 0. Bundle those parsers into the engine tree and exit 1 if the fallback still fires. AI assistance: Cursor Grok 4.6 implemented this change. Co-authored-by: Cursor <cursoragent@cursor.com>
9592 lines
314 KiB
JavaScript
9592 lines
314 KiB
JavaScript
/**
|
|
* GENERATED -- do not edit. Source: scripts/lib/static-html-parsers.entry.mjs
|
|
* Rebuild: node scripts/build-static-html-parsers.js
|
|
*
|
|
* Bundles htmlparser2, css-select, css-tree, and domutils for skill/plugin installs.
|
|
* Third-party licenses: see NOTICE.md.
|
|
*/
|
|
var __defProp = Object.defineProperty;
|
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
var __returnValue = (v) => v;
|
|
function __exportSetter(name, newValue) {
|
|
this[name] = __returnValue.bind(null, newValue);
|
|
}
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, {
|
|
get: all[name],
|
|
enumerable: true,
|
|
configurable: true,
|
|
set: __exportSetter.bind(all, name)
|
|
});
|
|
};
|
|
|
|
// node_modules/source-map-js/lib/base64.js
|
|
var require_base64 = __commonJS((exports) => {
|
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
exports.encode = function(number) {
|
|
if (0 <= number && number < intToCharMap.length) {
|
|
return intToCharMap[number];
|
|
}
|
|
throw new TypeError("Must be between 0 and 63: " + number);
|
|
};
|
|
exports.decode = function(charCode) {
|
|
var bigA = 65;
|
|
var bigZ = 90;
|
|
var littleA = 97;
|
|
var littleZ = 122;
|
|
var zero = 48;
|
|
var nine = 57;
|
|
var plus = 43;
|
|
var slash = 47;
|
|
var littleOffset = 26;
|
|
var numberOffset = 52;
|
|
if (bigA <= charCode && charCode <= bigZ) {
|
|
return charCode - bigA;
|
|
}
|
|
if (littleA <= charCode && charCode <= littleZ) {
|
|
return charCode - littleA + littleOffset;
|
|
}
|
|
if (zero <= charCode && charCode <= nine) {
|
|
return charCode - zero + numberOffset;
|
|
}
|
|
if (charCode == plus) {
|
|
return 62;
|
|
}
|
|
if (charCode == slash) {
|
|
return 63;
|
|
}
|
|
return -1;
|
|
};
|
|
});
|
|
|
|
// node_modules/source-map-js/lib/base64-vlq.js
|
|
var require_base64_vlq = __commonJS((exports) => {
|
|
var base64 = require_base64();
|
|
var VLQ_BASE_SHIFT = 5;
|
|
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
function toVLQSigned(aValue) {
|
|
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
}
|
|
function fromVLQSigned(aValue) {
|
|
var isNegative = (aValue & 1) === 1;
|
|
var shifted = aValue >> 1;
|
|
return isNegative ? -shifted : shifted;
|
|
}
|
|
exports.encode = function base64VLQ_encode(aValue) {
|
|
var encoded = "";
|
|
var digit;
|
|
var vlq = toVLQSigned(aValue);
|
|
do {
|
|
digit = vlq & VLQ_BASE_MASK;
|
|
vlq >>>= VLQ_BASE_SHIFT;
|
|
if (vlq > 0) {
|
|
digit |= VLQ_CONTINUATION_BIT;
|
|
}
|
|
encoded += base64.encode(digit);
|
|
} while (vlq > 0);
|
|
return encoded;
|
|
};
|
|
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
var strLen = aStr.length;
|
|
var result = 0;
|
|
var shift = 0;
|
|
var continuation, digit;
|
|
do {
|
|
if (aIndex >= strLen) {
|
|
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
}
|
|
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
if (digit === -1) {
|
|
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
}
|
|
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
digit &= VLQ_BASE_MASK;
|
|
result = result + (digit << shift);
|
|
shift += VLQ_BASE_SHIFT;
|
|
} while (continuation);
|
|
aOutParam.value = fromVLQSigned(result);
|
|
aOutParam.rest = aIndex;
|
|
};
|
|
});
|
|
|
|
// node_modules/source-map-js/lib/util.js
|
|
var require_util = __commonJS((exports) => {
|
|
function getArg(aArgs, aName, aDefaultValue) {
|
|
if (aName in aArgs) {
|
|
return aArgs[aName];
|
|
} else if (arguments.length === 3) {
|
|
return aDefaultValue;
|
|
} else {
|
|
throw new Error('"' + aName + '" is a required argument.');
|
|
}
|
|
}
|
|
exports.getArg = getArg;
|
|
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
function urlParse(aUrl) {
|
|
var match = aUrl.match(urlRegexp);
|
|
if (!match) {
|
|
return null;
|
|
}
|
|
return {
|
|
scheme: match[1],
|
|
auth: match[2],
|
|
host: match[3],
|
|
port: match[4],
|
|
path: match[5]
|
|
};
|
|
}
|
|
exports.urlParse = urlParse;
|
|
function urlGenerate(aParsedUrl) {
|
|
var url = "";
|
|
if (aParsedUrl.scheme) {
|
|
url += aParsedUrl.scheme + ":";
|
|
}
|
|
url += "//";
|
|
if (aParsedUrl.auth) {
|
|
url += aParsedUrl.auth + "@";
|
|
}
|
|
if (aParsedUrl.host) {
|
|
url += aParsedUrl.host;
|
|
}
|
|
if (aParsedUrl.port) {
|
|
url += ":" + aParsedUrl.port;
|
|
}
|
|
if (aParsedUrl.path) {
|
|
url += aParsedUrl.path;
|
|
}
|
|
return url;
|
|
}
|
|
exports.urlGenerate = urlGenerate;
|
|
var MAX_CACHED_INPUTS = 32;
|
|
function lruMemoize(f) {
|
|
var cache = [];
|
|
return function(input) {
|
|
for (var i = 0;i < cache.length; i++) {
|
|
if (cache[i].input === input) {
|
|
var temp = cache[0];
|
|
cache[0] = cache[i];
|
|
cache[i] = temp;
|
|
return cache[0].result;
|
|
}
|
|
}
|
|
var result = f(input);
|
|
cache.unshift({
|
|
input,
|
|
result
|
|
});
|
|
if (cache.length > MAX_CACHED_INPUTS) {
|
|
cache.pop();
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
var normalize = lruMemoize(function normalize2(aPath) {
|
|
var path = aPath;
|
|
var url = urlParse(aPath);
|
|
if (url) {
|
|
if (!url.path) {
|
|
return aPath;
|
|
}
|
|
path = url.path;
|
|
}
|
|
var isAbsolute = exports.isAbsolute(path);
|
|
var parts = [];
|
|
var start = 0;
|
|
var i = 0;
|
|
while (true) {
|
|
start = i;
|
|
i = path.indexOf("/", start);
|
|
if (i === -1) {
|
|
parts.push(path.slice(start));
|
|
break;
|
|
} else {
|
|
parts.push(path.slice(start, i));
|
|
while (i < path.length && path[i] === "/") {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
for (var part, up = 0, i = parts.length - 1;i >= 0; i--) {
|
|
part = parts[i];
|
|
if (part === ".") {
|
|
parts.splice(i, 1);
|
|
} else if (part === "..") {
|
|
up++;
|
|
} else if (up > 0) {
|
|
if (part === "") {
|
|
parts.splice(i + 1, up);
|
|
up = 0;
|
|
} else {
|
|
parts.splice(i, 2);
|
|
up--;
|
|
}
|
|
}
|
|
}
|
|
path = parts.join("/");
|
|
if (path === "") {
|
|
path = isAbsolute ? "/" : ".";
|
|
}
|
|
if (url) {
|
|
url.path = path;
|
|
return urlGenerate(url);
|
|
}
|
|
return path;
|
|
});
|
|
exports.normalize = normalize;
|
|
function join(aRoot, aPath) {
|
|
if (aRoot === "") {
|
|
aRoot = ".";
|
|
}
|
|
if (aPath === "") {
|
|
aPath = ".";
|
|
}
|
|
var aPathUrl = urlParse(aPath);
|
|
var aRootUrl = urlParse(aRoot);
|
|
if (aRootUrl) {
|
|
aRoot = aRootUrl.path || "/";
|
|
}
|
|
if (aPathUrl && !aPathUrl.scheme) {
|
|
if (aRootUrl) {
|
|
aPathUrl.scheme = aRootUrl.scheme;
|
|
}
|
|
return urlGenerate(aPathUrl);
|
|
}
|
|
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
|
return aPath;
|
|
}
|
|
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
aRootUrl.host = aPath;
|
|
return urlGenerate(aRootUrl);
|
|
}
|
|
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
if (aRootUrl) {
|
|
aRootUrl.path = joined;
|
|
return urlGenerate(aRootUrl);
|
|
}
|
|
return joined;
|
|
}
|
|
exports.join = join;
|
|
exports.isAbsolute = function(aPath) {
|
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
};
|
|
function relative(aRoot, aPath) {
|
|
if (aRoot === "") {
|
|
aRoot = ".";
|
|
}
|
|
aRoot = aRoot.replace(/\/$/, "");
|
|
var level = 0;
|
|
while (aPath.indexOf(aRoot + "/") !== 0) {
|
|
var index = aRoot.lastIndexOf("/");
|
|
if (index < 0) {
|
|
return aPath;
|
|
}
|
|
aRoot = aRoot.slice(0, index);
|
|
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
|
return aPath;
|
|
}
|
|
++level;
|
|
}
|
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
}
|
|
exports.relative = relative;
|
|
var supportsNullProto = function() {
|
|
var obj = Object.create(null);
|
|
return !("__proto__" in obj);
|
|
}();
|
|
function identity(s) {
|
|
return s;
|
|
}
|
|
function toSetString(aStr) {
|
|
if (isProtoString(aStr)) {
|
|
return "$" + aStr;
|
|
}
|
|
return aStr;
|
|
}
|
|
exports.toSetString = supportsNullProto ? identity : toSetString;
|
|
function fromSetString(aStr) {
|
|
if (isProtoString(aStr)) {
|
|
return aStr.slice(1);
|
|
}
|
|
return aStr;
|
|
}
|
|
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
function isProtoString(s) {
|
|
if (!s) {
|
|
return false;
|
|
}
|
|
var length = s.length;
|
|
if (length < 9) {
|
|
return false;
|
|
}
|
|
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
|
|
return false;
|
|
}
|
|
for (var i = length - 10;i >= 0; i--) {
|
|
if (s.charCodeAt(i) !== 36) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
var cmp = strcmp(mappingA.source, mappingB.source);
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
if (cmp !== 0 || onlyCompareOriginal) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
return strcmp(mappingA.name, mappingB.name);
|
|
}
|
|
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
|
|
var cmp;
|
|
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
if (cmp !== 0 || onlyCompareOriginal) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
return strcmp(mappingA.name, mappingB.name);
|
|
}
|
|
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
|
|
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
if (cmp !== 0 || onlyCompareGenerated) {
|
|
return cmp;
|
|
}
|
|
cmp = strcmp(mappingA.source, mappingB.source);
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
return strcmp(mappingA.name, mappingB.name);
|
|
}
|
|
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
|
|
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
if (cmp !== 0 || onlyCompareGenerated) {
|
|
return cmp;
|
|
}
|
|
cmp = strcmp(mappingA.source, mappingB.source);
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
return strcmp(mappingA.name, mappingB.name);
|
|
}
|
|
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
|
|
function strcmp(aStr1, aStr2) {
|
|
if (aStr1 === aStr2) {
|
|
return 0;
|
|
}
|
|
if (aStr1 === null) {
|
|
return 1;
|
|
}
|
|
if (aStr2 === null) {
|
|
return -1;
|
|
}
|
|
if (aStr1 > aStr2) {
|
|
return 1;
|
|
}
|
|
return -1;
|
|
}
|
|
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = strcmp(mappingA.source, mappingB.source);
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
if (cmp !== 0) {
|
|
return cmp;
|
|
}
|
|
return strcmp(mappingA.name, mappingB.name);
|
|
}
|
|
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
function parseSourceMapInput(str) {
|
|
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
|
|
}
|
|
exports.parseSourceMapInput = parseSourceMapInput;
|
|
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
sourceURL = sourceURL || "";
|
|
if (sourceRoot) {
|
|
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
|
|
sourceRoot += "/";
|
|
}
|
|
sourceURL = sourceRoot + sourceURL;
|
|
}
|
|
if (sourceMapURL) {
|
|
var parsed = urlParse(sourceMapURL);
|
|
if (!parsed) {
|
|
throw new Error("sourceMapURL could not be parsed");
|
|
}
|
|
if (parsed.path) {
|
|
var index = parsed.path.lastIndexOf("/");
|
|
if (index >= 0) {
|
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
}
|
|
}
|
|
sourceURL = join(urlGenerate(parsed), sourceURL);
|
|
}
|
|
return normalize(sourceURL);
|
|
}
|
|
exports.computeSourceURL = computeSourceURL;
|
|
});
|
|
|
|
// node_modules/source-map-js/lib/array-set.js
|
|
var require_array_set = __commonJS((exports) => {
|
|
var util = require_util();
|
|
var has = Object.prototype.hasOwnProperty;
|
|
var hasNativeMap = typeof Map !== "undefined";
|
|
function ArraySet() {
|
|
this._array = [];
|
|
this._set = hasNativeMap ? new Map : Object.create(null);
|
|
}
|
|
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
var set = new ArraySet;
|
|
for (var i = 0, len = aArray.length;i < len; i++) {
|
|
set.add(aArray[i], aAllowDuplicates);
|
|
}
|
|
return set;
|
|
};
|
|
ArraySet.prototype.size = function ArraySet_size() {
|
|
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
};
|
|
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
|
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
var idx = this._array.length;
|
|
if (!isDuplicate || aAllowDuplicates) {
|
|
this._array.push(aStr);
|
|
}
|
|
if (!isDuplicate) {
|
|
if (hasNativeMap) {
|
|
this._set.set(aStr, idx);
|
|
} else {
|
|
this._set[sStr] = idx;
|
|
}
|
|
}
|
|
};
|
|
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
|
if (hasNativeMap) {
|
|
return this._set.has(aStr);
|
|
} else {
|
|
var sStr = util.toSetString(aStr);
|
|
return has.call(this._set, sStr);
|
|
}
|
|
};
|
|
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
if (hasNativeMap) {
|
|
var idx = this._set.get(aStr);
|
|
if (idx >= 0) {
|
|
return idx;
|
|
}
|
|
} else {
|
|
var sStr = util.toSetString(aStr);
|
|
if (has.call(this._set, sStr)) {
|
|
return this._set[sStr];
|
|
}
|
|
}
|
|
throw new Error('"' + aStr + '" is not in the set.');
|
|
};
|
|
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
|
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
return this._array[aIdx];
|
|
}
|
|
throw new Error("No element indexed by " + aIdx);
|
|
};
|
|
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
return this._array.slice();
|
|
};
|
|
exports.ArraySet = ArraySet;
|
|
});
|
|
|
|
// node_modules/source-map-js/lib/mapping-list.js
|
|
var require_mapping_list = __commonJS((exports) => {
|
|
var util = require_util();
|
|
function generatedPositionAfter(mappingA, mappingB) {
|
|
var lineA = mappingA.generatedLine;
|
|
var lineB = mappingB.generatedLine;
|
|
var columnA = mappingA.generatedColumn;
|
|
var columnB = mappingB.generatedColumn;
|
|
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
|
}
|
|
function MappingList() {
|
|
this._array = [];
|
|
this._sorted = true;
|
|
this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
}
|
|
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
|
|
this._array.forEach(aCallback, aThisArg);
|
|
};
|
|
MappingList.prototype.add = function MappingList_add(aMapping) {
|
|
if (generatedPositionAfter(this._last, aMapping)) {
|
|
this._last = aMapping;
|
|
this._array.push(aMapping);
|
|
} else {
|
|
this._sorted = false;
|
|
this._array.push(aMapping);
|
|
}
|
|
};
|
|
MappingList.prototype.toArray = function MappingList_toArray() {
|
|
if (!this._sorted) {
|
|
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
this._sorted = true;
|
|
}
|
|
return this._array;
|
|
};
|
|
exports.MappingList = MappingList;
|
|
});
|
|
|
|
// node_modules/htmlparser2/dist/index.js
|
|
var exports_dist3 = {};
|
|
__export(exports_dist3, {
|
|
parseFeed: () => parseFeed,
|
|
parseDocument: () => parseDocument,
|
|
getFeed: () => getFeed,
|
|
createDocumentStream: () => createDocumentStream,
|
|
Tokenizer: () => Tokenizer,
|
|
QuoteType: () => QuoteType,
|
|
Parser: () => Parser,
|
|
ElementType: () => exports_dist,
|
|
DomUtils: () => exports_dist2,
|
|
DomHandler: () => DomHandler,
|
|
DefaultHandler: () => DomHandler
|
|
});
|
|
|
|
// node_modules/entities/dist/decode-codepoint.js
|
|
var decodeMap = new Map([
|
|
[0, 65533],
|
|
[128, 8364],
|
|
[130, 8218],
|
|
[131, 402],
|
|
[132, 8222],
|
|
[133, 8230],
|
|
[134, 8224],
|
|
[135, 8225],
|
|
[136, 710],
|
|
[137, 8240],
|
|
[138, 352],
|
|
[139, 8249],
|
|
[140, 338],
|
|
[142, 381],
|
|
[145, 8216],
|
|
[146, 8217],
|
|
[147, 8220],
|
|
[148, 8221],
|
|
[149, 8226],
|
|
[150, 8211],
|
|
[151, 8212],
|
|
[152, 732],
|
|
[153, 8482],
|
|
[154, 353],
|
|
[155, 8250],
|
|
[156, 339],
|
|
[158, 382],
|
|
[159, 376]
|
|
]);
|
|
function replaceCodePoint(codePoint) {
|
|
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
|
|
return 65533;
|
|
}
|
|
return decodeMap.get(codePoint) ?? codePoint;
|
|
}
|
|
|
|
// node_modules/entities/dist/internal/decode-shared.js
|
|
function decodeBase64(input) {
|
|
const binary = atob(input);
|
|
const evenLength = binary.length & ~1;
|
|
const out = new Uint16Array(evenLength / 2);
|
|
for (let index = 0, outIndex = 0;index < evenLength; index += 2) {
|
|
const lo = binary.charCodeAt(index);
|
|
const hi = binary.charCodeAt(index + 1);
|
|
out[outIndex++] = lo | hi << 8;
|
|
}
|
|
return out;
|
|
}
|
|
|
|
// node_modules/entities/dist/generated/decode-data-html.js
|
|
var htmlDecodeTree = /* @__PURE__ */ decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNm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AFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");
|
|
|
|
// node_modules/entities/dist/generated/decode-data-xml.js
|
|
var xmlDecodeTree = /* @__PURE__ */ decodeBase64("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");
|
|
|
|
// node_modules/entities/dist/internal/bin-trie-flags.js
|
|
var BinTrieFlags;
|
|
(function(BinTrieFlags2) {
|
|
BinTrieFlags2[BinTrieFlags2["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
|
BinTrieFlags2[BinTrieFlags2["FLAG13"] = 8192] = "FLAG13";
|
|
BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
|
|
BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
|
})(BinTrieFlags || (BinTrieFlags = {}));
|
|
|
|
// node_modules/entities/dist/decode.js
|
|
var CharCodes;
|
|
(function(CharCodes2) {
|
|
CharCodes2[CharCodes2["NUM"] = 35] = "NUM";
|
|
CharCodes2[CharCodes2["SEMI"] = 59] = "SEMI";
|
|
CharCodes2[CharCodes2["EQUALS"] = 61] = "EQUALS";
|
|
CharCodes2[CharCodes2["ZERO"] = 48] = "ZERO";
|
|
CharCodes2[CharCodes2["NINE"] = 57] = "NINE";
|
|
CharCodes2[CharCodes2["LOWER_A"] = 97] = "LOWER_A";
|
|
CharCodes2[CharCodes2["LOWER_F"] = 102] = "LOWER_F";
|
|
CharCodes2[CharCodes2["LOWER_X"] = 120] = "LOWER_X";
|
|
CharCodes2[CharCodes2["LOWER_Z"] = 122] = "LOWER_Z";
|
|
CharCodes2[CharCodes2["UPPER_A"] = 65] = "UPPER_A";
|
|
CharCodes2[CharCodes2["UPPER_F"] = 70] = "UPPER_F";
|
|
CharCodes2[CharCodes2["UPPER_Z"] = 90] = "UPPER_Z";
|
|
})(CharCodes || (CharCodes = {}));
|
|
var TO_LOWER_BIT = 32;
|
|
function isNumber(code) {
|
|
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
|
}
|
|
function isHexadecimalCharacter(code) {
|
|
return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;
|
|
}
|
|
function isAsciiAlphaNumeric(code) {
|
|
return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);
|
|
}
|
|
function isEntityInAttributeInvalidEnd(code) {
|
|
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
|
}
|
|
var EntityDecoderState;
|
|
(function(EntityDecoderState2) {
|
|
EntityDecoderState2[EntityDecoderState2["EntityStart"] = 0] = "EntityStart";
|
|
EntityDecoderState2[EntityDecoderState2["NumericStart"] = 1] = "NumericStart";
|
|
EntityDecoderState2[EntityDecoderState2["NumericDecimal"] = 2] = "NumericDecimal";
|
|
EntityDecoderState2[EntityDecoderState2["NumericHex"] = 3] = "NumericHex";
|
|
EntityDecoderState2[EntityDecoderState2["NamedEntity"] = 4] = "NamedEntity";
|
|
})(EntityDecoderState || (EntityDecoderState = {}));
|
|
var DecodingMode;
|
|
(function(DecodingMode2) {
|
|
DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy";
|
|
DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict";
|
|
DecodingMode2[DecodingMode2["Attribute"] = 2] = "Attribute";
|
|
})(DecodingMode || (DecodingMode = {}));
|
|
|
|
class EntityDecoder {
|
|
decodeTree;
|
|
emitCodePoint;
|
|
errors;
|
|
constructor(decodeTree, emitCodePoint, errors) {
|
|
this.decodeTree = decodeTree;
|
|
this.emitCodePoint = emitCodePoint;
|
|
this.errors = errors;
|
|
}
|
|
state = EntityDecoderState.EntityStart;
|
|
consumed = 1;
|
|
result = 0;
|
|
treeIndex = 0;
|
|
excess = 1;
|
|
decodeMode = DecodingMode.Strict;
|
|
runConsumed = 0;
|
|
startEntity(decodeMode) {
|
|
this.decodeMode = decodeMode;
|
|
this.state = EntityDecoderState.EntityStart;
|
|
this.result = 0;
|
|
this.treeIndex = 0;
|
|
this.excess = 1;
|
|
this.consumed = 1;
|
|
this.runConsumed = 0;
|
|
}
|
|
write(input, offset) {
|
|
switch (this.state) {
|
|
case EntityDecoderState.EntityStart: {
|
|
if (input.charCodeAt(offset) === CharCodes.NUM) {
|
|
this.state = EntityDecoderState.NumericStart;
|
|
this.consumed += 1;
|
|
return this.stateNumericStart(input, offset + 1);
|
|
}
|
|
this.state = EntityDecoderState.NamedEntity;
|
|
return this.stateNamedEntity(input, offset);
|
|
}
|
|
case EntityDecoderState.NumericStart: {
|
|
return this.stateNumericStart(input, offset);
|
|
}
|
|
case EntityDecoderState.NumericDecimal: {
|
|
return this.stateNumericDecimal(input, offset);
|
|
}
|
|
case EntityDecoderState.NumericHex: {
|
|
return this.stateNumericHex(input, offset);
|
|
}
|
|
case EntityDecoderState.NamedEntity: {
|
|
return this.stateNamedEntity(input, offset);
|
|
}
|
|
}
|
|
}
|
|
stateNumericStart(input, offset) {
|
|
if (offset >= input.length) {
|
|
return -1;
|
|
}
|
|
if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
|
|
this.state = EntityDecoderState.NumericHex;
|
|
this.consumed += 1;
|
|
return this.stateNumericHex(input, offset + 1);
|
|
}
|
|
this.state = EntityDecoderState.NumericDecimal;
|
|
return this.stateNumericDecimal(input, offset);
|
|
}
|
|
stateNumericHex(input, offset) {
|
|
while (offset < input.length) {
|
|
const char = input.charCodeAt(offset);
|
|
if (isNumber(char) || isHexadecimalCharacter(char)) {
|
|
const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
|
|
this.result = this.result * 16 + digit;
|
|
this.consumed++;
|
|
offset++;
|
|
} else {
|
|
return this.emitNumericEntity(char, 3);
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
stateNumericDecimal(input, offset) {
|
|
while (offset < input.length) {
|
|
const char = input.charCodeAt(offset);
|
|
if (isNumber(char)) {
|
|
this.result = this.result * 10 + (char - CharCodes.ZERO);
|
|
this.consumed++;
|
|
offset++;
|
|
} else {
|
|
return this.emitNumericEntity(char, 2);
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
emitNumericEntity(lastCp, expectedLength) {
|
|
if (this.consumed <= expectedLength) {
|
|
this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
return 0;
|
|
}
|
|
if (lastCp === CharCodes.SEMI) {
|
|
this.consumed += 1;
|
|
} else if (this.decodeMode === DecodingMode.Strict) {
|
|
return 0;
|
|
}
|
|
this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
|
|
if (this.errors) {
|
|
if (lastCp !== CharCodes.SEMI) {
|
|
this.errors.missingSemicolonAfterCharacterReference();
|
|
}
|
|
this.errors.validateNumericCharacterReference(this.result);
|
|
}
|
|
return this.consumed;
|
|
}
|
|
stateNamedEntity(input, offset) {
|
|
const { decodeTree } = this;
|
|
let current = decodeTree[this.treeIndex];
|
|
let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
while (offset < input.length) {
|
|
if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {
|
|
const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
|
if (this.runConsumed === 0) {
|
|
const firstChar = current & BinTrieFlags.JUMP_TABLE;
|
|
if (input.charCodeAt(offset) !== firstChar) {
|
|
return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
|
|
}
|
|
offset++;
|
|
this.excess++;
|
|
this.runConsumed++;
|
|
}
|
|
while (this.runConsumed < runLength) {
|
|
if (offset >= input.length) {
|
|
return -1;
|
|
}
|
|
const charIndexInPacked = this.runConsumed - 1;
|
|
const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
|
|
const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
|
|
if (input.charCodeAt(offset) !== expectedChar) {
|
|
this.runConsumed = 0;
|
|
return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
|
|
}
|
|
offset++;
|
|
this.excess++;
|
|
this.runConsumed++;
|
|
}
|
|
this.runConsumed = 0;
|
|
this.treeIndex += 1 + (runLength >> 1);
|
|
current = decodeTree[this.treeIndex];
|
|
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
}
|
|
if (offset >= input.length)
|
|
break;
|
|
const char = input.charCodeAt(offset);
|
|
if (char === CharCodes.SEMI && valueLength !== 0 && (current & BinTrieFlags.FLAG13) !== 0) {
|
|
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
|
}
|
|
this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
|
|
if (this.treeIndex < 0) {
|
|
return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
}
|
|
current = decodeTree[this.treeIndex];
|
|
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
if (valueLength !== 0) {
|
|
if (char === CharCodes.SEMI) {
|
|
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
|
}
|
|
if (this.decodeMode !== DecodingMode.Strict && (current & BinTrieFlags.FLAG13) === 0) {
|
|
this.result = this.treeIndex;
|
|
this.consumed += this.excess;
|
|
this.excess = 0;
|
|
}
|
|
}
|
|
offset++;
|
|
this.excess++;
|
|
}
|
|
return -1;
|
|
}
|
|
emitNotTerminatedNamedEntity() {
|
|
const { result, decodeTree } = this;
|
|
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
this.emitNamedEntityData(result, valueLength, this.consumed);
|
|
this.errors?.missingSemicolonAfterCharacterReference();
|
|
return this.consumed;
|
|
}
|
|
emitNamedEntityData(result, valueLength, consumed) {
|
|
const { decodeTree } = this;
|
|
this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13) : decodeTree[result + 1], consumed);
|
|
if (valueLength === 3) {
|
|
this.emitCodePoint(decodeTree[result + 2], consumed);
|
|
}
|
|
return consumed;
|
|
}
|
|
end() {
|
|
switch (this.state) {
|
|
case EntityDecoderState.NamedEntity: {
|
|
return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
}
|
|
case EntityDecoderState.NumericDecimal: {
|
|
return this.emitNumericEntity(0, 2);
|
|
}
|
|
case EntityDecoderState.NumericHex: {
|
|
return this.emitNumericEntity(0, 3);
|
|
}
|
|
case EntityDecoderState.NumericStart: {
|
|
this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
return 0;
|
|
}
|
|
case EntityDecoderState.EntityStart: {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function determineBranch(decodeTree, current, nodeIndex, char) {
|
|
const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
|
const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
|
if (branchCount === 0) {
|
|
return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
|
|
}
|
|
if (jumpOffset) {
|
|
const value = char - jumpOffset;
|
|
return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIndex + value] - 1;
|
|
}
|
|
const packedKeySlots = branchCount + 1 >> 1;
|
|
let lo = 0;
|
|
let hi = branchCount - 1;
|
|
while (lo <= hi) {
|
|
const mid = lo + hi >>> 1;
|
|
const slot = mid >> 1;
|
|
const packed = decodeTree[nodeIndex + slot];
|
|
const midKey = packed >> (mid & 1) * 8 & 255;
|
|
if (midKey < char) {
|
|
lo = mid + 1;
|
|
} else if (midKey > char) {
|
|
hi = mid - 1;
|
|
} else {
|
|
return decodeTree[nodeIndex + packedKeySlots + mid];
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// node_modules/htmlparser2/dist/Tokenizer.js
|
|
var CharCodes2;
|
|
(function(CharCodes3) {
|
|
CharCodes3[CharCodes3["Tab"] = 9] = "Tab";
|
|
CharCodes3[CharCodes3["NewLine"] = 10] = "NewLine";
|
|
CharCodes3[CharCodes3["FormFeed"] = 12] = "FormFeed";
|
|
CharCodes3[CharCodes3["CarriageReturn"] = 13] = "CarriageReturn";
|
|
CharCodes3[CharCodes3["Space"] = 32] = "Space";
|
|
CharCodes3[CharCodes3["ExclamationMark"] = 33] = "ExclamationMark";
|
|
CharCodes3[CharCodes3["Number"] = 35] = "Number";
|
|
CharCodes3[CharCodes3["Amp"] = 38] = "Amp";
|
|
CharCodes3[CharCodes3["SingleQuote"] = 39] = "SingleQuote";
|
|
CharCodes3[CharCodes3["DoubleQuote"] = 34] = "DoubleQuote";
|
|
CharCodes3[CharCodes3["Dash"] = 45] = "Dash";
|
|
CharCodes3[CharCodes3["Slash"] = 47] = "Slash";
|
|
CharCodes3[CharCodes3["Zero"] = 48] = "Zero";
|
|
CharCodes3[CharCodes3["Nine"] = 57] = "Nine";
|
|
CharCodes3[CharCodes3["Semi"] = 59] = "Semi";
|
|
CharCodes3[CharCodes3["Lt"] = 60] = "Lt";
|
|
CharCodes3[CharCodes3["Eq"] = 61] = "Eq";
|
|
CharCodes3[CharCodes3["Gt"] = 62] = "Gt";
|
|
CharCodes3[CharCodes3["Questionmark"] = 63] = "Questionmark";
|
|
CharCodes3[CharCodes3["UpperA"] = 65] = "UpperA";
|
|
CharCodes3[CharCodes3["LowerA"] = 97] = "LowerA";
|
|
CharCodes3[CharCodes3["UpperF"] = 70] = "UpperF";
|
|
CharCodes3[CharCodes3["LowerF"] = 102] = "LowerF";
|
|
CharCodes3[CharCodes3["UpperZ"] = 90] = "UpperZ";
|
|
CharCodes3[CharCodes3["LowerZ"] = 122] = "LowerZ";
|
|
CharCodes3[CharCodes3["LowerX"] = 120] = "LowerX";
|
|
CharCodes3[CharCodes3["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
|
|
})(CharCodes2 || (CharCodes2 = {}));
|
|
var State;
|
|
(function(State2) {
|
|
State2[State2["Text"] = 1] = "Text";
|
|
State2[State2["BeforeTagName"] = 2] = "BeforeTagName";
|
|
State2[State2["InTagName"] = 3] = "InTagName";
|
|
State2[State2["InSelfClosingTag"] = 4] = "InSelfClosingTag";
|
|
State2[State2["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
|
|
State2[State2["InClosingTagName"] = 6] = "InClosingTagName";
|
|
State2[State2["AfterClosingTagName"] = 7] = "AfterClosingTagName";
|
|
State2[State2["BeforeAttributeName"] = 8] = "BeforeAttributeName";
|
|
State2[State2["InAttributeName"] = 9] = "InAttributeName";
|
|
State2[State2["AfterAttributeName"] = 10] = "AfterAttributeName";
|
|
State2[State2["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
|
|
State2[State2["InAttributeValueDq"] = 12] = "InAttributeValueDq";
|
|
State2[State2["InAttributeValueSq"] = 13] = "InAttributeValueSq";
|
|
State2[State2["InAttributeValueNq"] = 14] = "InAttributeValueNq";
|
|
State2[State2["BeforeDeclaration"] = 15] = "BeforeDeclaration";
|
|
State2[State2["InDeclaration"] = 16] = "InDeclaration";
|
|
State2[State2["InProcessingInstruction"] = 17] = "InProcessingInstruction";
|
|
State2[State2["BeforeComment"] = 18] = "BeforeComment";
|
|
State2[State2["CDATASequence"] = 19] = "CDATASequence";
|
|
State2[State2["DeclarationSequence"] = 20] = "DeclarationSequence";
|
|
State2[State2["InSpecialComment"] = 21] = "InSpecialComment";
|
|
State2[State2["InCommentLike"] = 22] = "InCommentLike";
|
|
State2[State2["SpecialStartSequence"] = 23] = "SpecialStartSequence";
|
|
State2[State2["InSpecialTag"] = 24] = "InSpecialTag";
|
|
State2[State2["InPlainText"] = 25] = "InPlainText";
|
|
State2[State2["InEntity"] = 26] = "InEntity";
|
|
})(State || (State = {}));
|
|
function isWhitespace(c) {
|
|
return c === CharCodes2.Space || c === CharCodes2.NewLine || c === CharCodes2.Tab || c === CharCodes2.FormFeed || c === CharCodes2.CarriageReturn;
|
|
}
|
|
function isEndOfTagSection(c) {
|
|
return c === CharCodes2.Slash || c === CharCodes2.Gt || isWhitespace(c);
|
|
}
|
|
function isASCIIAlpha(c) {
|
|
return c >= CharCodes2.LowerA && c <= CharCodes2.LowerZ || c >= CharCodes2.UpperA && c <= CharCodes2.UpperZ;
|
|
}
|
|
var QuoteType;
|
|
(function(QuoteType2) {
|
|
QuoteType2[QuoteType2["NoValue"] = 0] = "NoValue";
|
|
QuoteType2[QuoteType2["Unquoted"] = 1] = "Unquoted";
|
|
QuoteType2[QuoteType2["Single"] = 2] = "Single";
|
|
QuoteType2[QuoteType2["Double"] = 3] = "Double";
|
|
})(QuoteType || (QuoteType = {}));
|
|
var Sequences = {
|
|
Empty: new Uint8Array(0),
|
|
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
CdataEnd: new Uint8Array([93, 93, 62]),
|
|
CommentEnd: new Uint8Array([45, 45, 33, 62]),
|
|
Doctype: new Uint8Array([100, 111, 99, 116, 121, 112, 101]),
|
|
IframeEnd: new Uint8Array([60, 47, 105, 102, 114, 97, 109, 101]),
|
|
NoembedEnd: new Uint8Array([
|
|
60,
|
|
47,
|
|
110,
|
|
111,
|
|
101,
|
|
109,
|
|
98,
|
|
101,
|
|
100
|
|
]),
|
|
NoframesEnd: new Uint8Array([
|
|
60,
|
|
47,
|
|
110,
|
|
111,
|
|
102,
|
|
114,
|
|
97,
|
|
109,
|
|
101,
|
|
115
|
|
]),
|
|
Plaintext: new Uint8Array([
|
|
60,
|
|
47,
|
|
112,
|
|
108,
|
|
97,
|
|
105,
|
|
110,
|
|
116,
|
|
101,
|
|
120,
|
|
116
|
|
]),
|
|
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
|
|
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
|
|
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
|
|
TextareaEnd: new Uint8Array([
|
|
60,
|
|
47,
|
|
116,
|
|
101,
|
|
120,
|
|
116,
|
|
97,
|
|
114,
|
|
101,
|
|
97
|
|
]),
|
|
XmpEnd: new Uint8Array([60, 47, 120, 109, 112])
|
|
};
|
|
var specialStartSequences = new Map([
|
|
[Sequences.IframeEnd[2], Sequences.IframeEnd],
|
|
[Sequences.NoembedEnd[2], Sequences.NoembedEnd],
|
|
[Sequences.Plaintext[2], Sequences.Plaintext],
|
|
[Sequences.ScriptEnd[2], Sequences.ScriptEnd],
|
|
[Sequences.TitleEnd[2], Sequences.TitleEnd],
|
|
[Sequences.XmpEnd[2], Sequences.XmpEnd]
|
|
]);
|
|
|
|
class Tokenizer {
|
|
cbs;
|
|
state = State.Text;
|
|
buffer = "";
|
|
sectionStart = 0;
|
|
index = 0;
|
|
entityStart = 0;
|
|
baseState = State.Text;
|
|
isSpecial = false;
|
|
running = true;
|
|
offset = 0;
|
|
xmlMode;
|
|
decodeEntities;
|
|
recognizeSelfClosing;
|
|
entityDecoder;
|
|
constructor({ xmlMode = false, decodeEntities = true, recognizeSelfClosing = xmlMode }, cbs) {
|
|
this.cbs = cbs;
|
|
this.xmlMode = xmlMode;
|
|
this.decodeEntities = decodeEntities;
|
|
this.recognizeSelfClosing = recognizeSelfClosing;
|
|
this.entityDecoder = new EntityDecoder(xmlMode ? xmlDecodeTree : htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));
|
|
}
|
|
reset() {
|
|
this.state = State.Text;
|
|
this.buffer = "";
|
|
this.sectionStart = 0;
|
|
this.index = 0;
|
|
this.baseState = State.Text;
|
|
this.isSpecial = false;
|
|
this.currentSequence = Sequences.Empty;
|
|
this.sequenceIndex = 0;
|
|
this.running = true;
|
|
this.offset = 0;
|
|
}
|
|
write(chunk) {
|
|
this.offset += this.buffer.length;
|
|
this.buffer = chunk;
|
|
this.parse();
|
|
}
|
|
end() {
|
|
if (this.running)
|
|
this.finish();
|
|
}
|
|
pause() {
|
|
this.running = false;
|
|
}
|
|
resume() {
|
|
this.running = true;
|
|
if (this.index < this.buffer.length + this.offset) {
|
|
this.parse();
|
|
}
|
|
}
|
|
stateText(c) {
|
|
if (c === CharCodes2.Lt || !this.decodeEntities && this.fastForwardTo(CharCodes2.Lt)) {
|
|
if (this.index > this.sectionStart) {
|
|
this.cbs.ontext(this.sectionStart, this.index);
|
|
}
|
|
this.state = State.BeforeTagName;
|
|
this.sectionStart = this.index;
|
|
} else if (this.decodeEntities && c === CharCodes2.Amp) {
|
|
this.startEntity();
|
|
}
|
|
}
|
|
currentSequence = Sequences.Empty;
|
|
sequenceIndex = 0;
|
|
enterTagBody() {
|
|
if (this.currentSequence === Sequences.Plaintext) {
|
|
this.currentSequence = Sequences.Empty;
|
|
this.state = State.InPlainText;
|
|
} else if (this.isSpecial) {
|
|
this.state = State.InSpecialTag;
|
|
this.sequenceIndex = 0;
|
|
} else {
|
|
this.state = State.Text;
|
|
}
|
|
}
|
|
stateSpecialStartSequence(c) {
|
|
const lower = c | 32;
|
|
if (this.sequenceIndex < this.currentSequence.length) {
|
|
if (lower === this.currentSequence[this.sequenceIndex]) {
|
|
this.sequenceIndex++;
|
|
return;
|
|
}
|
|
if (this.sequenceIndex === 3) {
|
|
if (this.currentSequence === Sequences.ScriptEnd && lower === Sequences.StyleEnd[3]) {
|
|
this.currentSequence = Sequences.StyleEnd;
|
|
this.sequenceIndex = 4;
|
|
return;
|
|
}
|
|
if (this.currentSequence === Sequences.TitleEnd && lower === Sequences.TextareaEnd[3]) {
|
|
this.currentSequence = Sequences.TextareaEnd;
|
|
this.sequenceIndex = 4;
|
|
return;
|
|
}
|
|
} else if (this.sequenceIndex === 4 && this.currentSequence === Sequences.NoembedEnd && lower === Sequences.NoframesEnd[4]) {
|
|
this.currentSequence = Sequences.NoframesEnd;
|
|
this.sequenceIndex = 5;
|
|
return;
|
|
}
|
|
} else if (isEndOfTagSection(c)) {
|
|
this.sequenceIndex = 0;
|
|
this.state = State.InTagName;
|
|
this.stateInTagName(c);
|
|
return;
|
|
}
|
|
this.isSpecial = false;
|
|
this.currentSequence = Sequences.Empty;
|
|
this.sequenceIndex = 0;
|
|
this.state = State.InTagName;
|
|
this.stateInTagName(c);
|
|
}
|
|
stateCDATASequence(c) {
|
|
if (c === Sequences.Cdata[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === Sequences.Cdata.length) {
|
|
this.state = State.InCommentLike;
|
|
this.currentSequence = Sequences.CdataEnd;
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this.index + 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = 0;
|
|
if (this.xmlMode) {
|
|
this.state = State.InDeclaration;
|
|
this.stateInDeclaration(c);
|
|
} else {
|
|
this.state = State.InSpecialComment;
|
|
this.stateInSpecialComment(c);
|
|
}
|
|
}
|
|
}
|
|
fastForwardTo(c) {
|
|
while (++this.index < this.buffer.length + this.offset) {
|
|
if (this.buffer.charCodeAt(this.index - this.offset) === c) {
|
|
return true;
|
|
}
|
|
}
|
|
this.index = this.buffer.length + this.offset - 1;
|
|
return false;
|
|
}
|
|
emitComment(offset) {
|
|
this.cbs.oncomment(this.sectionStart, this.index, offset);
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this.index + 1;
|
|
this.state = State.Text;
|
|
}
|
|
stateInCommentLike(c) {
|
|
if (!this.xmlMode && this.currentSequence === Sequences.CommentEnd && this.sequenceIndex <= 1 && this.index === this.sectionStart + this.sequenceIndex && c === CharCodes2.Gt) {
|
|
this.emitComment(this.sequenceIndex);
|
|
} else if (this.currentSequence === Sequences.CommentEnd && this.sequenceIndex === 2 && c === CharCodes2.Gt) {
|
|
this.emitComment(2);
|
|
} else if (this.currentSequence === Sequences.CommentEnd && this.sequenceIndex === this.currentSequence.length - 1 && c !== CharCodes2.Gt) {
|
|
this.sequenceIndex = Number(c === CharCodes2.Dash);
|
|
} else if (c === this.currentSequence[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === this.currentSequence.length) {
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
this.cbs.oncdata(this.sectionStart, this.index, 2);
|
|
} else {
|
|
this.cbs.oncomment(this.sectionStart, this.index, 3);
|
|
}
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this.index + 1;
|
|
this.state = State.Text;
|
|
}
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.fastForwardTo(this.currentSequence[0])) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
|
|
this.sequenceIndex = 0;
|
|
}
|
|
}
|
|
isTagStartChar(c) {
|
|
return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
|
|
}
|
|
stateInSpecialTag(c) {
|
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
if (isEndOfTagSection(c)) {
|
|
const endOfText = this.index - this.currentSequence.length;
|
|
if (this.sectionStart < endOfText) {
|
|
const actualIndex = this.index;
|
|
this.index = endOfText;
|
|
this.cbs.ontext(this.sectionStart, endOfText);
|
|
this.index = actualIndex;
|
|
}
|
|
this.isSpecial = false;
|
|
this.sectionStart = endOfText + 2;
|
|
this.stateInClosingTagName(c);
|
|
return;
|
|
}
|
|
this.sequenceIndex = 0;
|
|
}
|
|
if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
|
|
this.sequenceIndex += 1;
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd) {
|
|
if (this.decodeEntities && c === CharCodes2.Amp) {
|
|
this.startEntity();
|
|
}
|
|
} else if (this.fastForwardTo(CharCodes2.Lt)) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = Number(c === CharCodes2.Lt);
|
|
}
|
|
}
|
|
stateBeforeTagName(c) {
|
|
if (c === CharCodes2.ExclamationMark) {
|
|
this.state = State.BeforeDeclaration;
|
|
this.sectionStart = this.index + 1;
|
|
} else if (c === CharCodes2.Questionmark) {
|
|
if (this.xmlMode) {
|
|
this.state = State.InProcessingInstruction;
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this.index + 1;
|
|
} else {
|
|
this.state = State.InSpecialComment;
|
|
this.sectionStart = this.index;
|
|
}
|
|
} else if (this.isTagStartChar(c)) {
|
|
this.sectionStart = this.index;
|
|
const special = this.xmlMode || this.cbs.isInForeignContext?.() ? undefined : specialStartSequences.get(c | 32);
|
|
if (special === undefined) {
|
|
this.state = State.InTagName;
|
|
} else {
|
|
this.isSpecial = true;
|
|
this.currentSequence = special;
|
|
this.sequenceIndex = 3;
|
|
this.state = State.SpecialStartSequence;
|
|
}
|
|
} else if (c === CharCodes2.Slash) {
|
|
this.state = State.BeforeClosingTagName;
|
|
} else {
|
|
this.state = State.Text;
|
|
this.stateText(c);
|
|
}
|
|
}
|
|
stateInTagName(c) {
|
|
if (isEndOfTagSection(c)) {
|
|
this.cbs.onopentagname(this.sectionStart, this.index);
|
|
this.sectionStart = -1;
|
|
this.state = State.BeforeAttributeName;
|
|
this.stateBeforeAttributeName(c);
|
|
}
|
|
}
|
|
stateBeforeClosingTagName(c) {
|
|
if (isWhitespace(c)) {
|
|
if (this.xmlMode) {} else {
|
|
this.state = State.InSpecialComment;
|
|
this.sectionStart = this.index;
|
|
}
|
|
} else if (c === CharCodes2.Gt) {
|
|
this.state = State.Text;
|
|
if (!this.xmlMode) {
|
|
this.sectionStart = this.index + 1;
|
|
}
|
|
} else {
|
|
this.state = this.isTagStartChar(c) ? State.InClosingTagName : State.InSpecialComment;
|
|
this.sectionStart = this.index;
|
|
}
|
|
}
|
|
stateInClosingTagName(c) {
|
|
if (isEndOfTagSection(c)) {
|
|
this.cbs.onclosetag(this.sectionStart, this.index);
|
|
this.sectionStart = -1;
|
|
this.state = State.AfterClosingTagName;
|
|
this.stateAfterClosingTagName(c);
|
|
}
|
|
}
|
|
stateAfterClosingTagName(c) {
|
|
if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
}
|
|
}
|
|
stateBeforeAttributeName(c) {
|
|
if (c === CharCodes2.Gt) {
|
|
this.cbs.onopentagend(this.index);
|
|
this.enterTagBody();
|
|
this.sectionStart = this.index + 1;
|
|
} else if (c === CharCodes2.Slash) {
|
|
this.state = State.InSelfClosingTag;
|
|
} else if (!isWhitespace(c)) {
|
|
this.state = State.InAttributeName;
|
|
this.sectionStart = this.index;
|
|
}
|
|
}
|
|
stateInSelfClosingTag(c) {
|
|
if (c === CharCodes2.Gt) {
|
|
this.cbs.onselfclosingtag(this.index);
|
|
this.sectionStart = this.index + 1;
|
|
if (!this.recognizeSelfClosing) {
|
|
this.enterTagBody();
|
|
return;
|
|
}
|
|
this.state = State.Text;
|
|
this.isSpecial = false;
|
|
this.currentSequence = Sequences.Empty;
|
|
} else if (!isWhitespace(c)) {
|
|
this.state = State.BeforeAttributeName;
|
|
this.stateBeforeAttributeName(c);
|
|
}
|
|
}
|
|
stateInAttributeName(c) {
|
|
if (c === CharCodes2.Eq || isEndOfTagSection(c)) {
|
|
this.cbs.onattribname(this.sectionStart, this.index);
|
|
this.sectionStart = this.index;
|
|
this.state = State.AfterAttributeName;
|
|
this.stateAfterAttributeName(c);
|
|
}
|
|
}
|
|
stateAfterAttributeName(c) {
|
|
if (c === CharCodes2.Eq) {
|
|
this.state = State.BeforeAttributeValue;
|
|
} else if (c === CharCodes2.Slash || c === CharCodes2.Gt) {
|
|
this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
|
|
this.sectionStart = -1;
|
|
this.state = State.BeforeAttributeName;
|
|
this.stateBeforeAttributeName(c);
|
|
} else if (!isWhitespace(c)) {
|
|
this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
|
|
this.state = State.InAttributeName;
|
|
this.sectionStart = this.index;
|
|
}
|
|
}
|
|
stateBeforeAttributeValue(c) {
|
|
if (c === CharCodes2.DoubleQuote) {
|
|
this.state = State.InAttributeValueDq;
|
|
this.sectionStart = this.index + 1;
|
|
} else if (c === CharCodes2.SingleQuote) {
|
|
this.state = State.InAttributeValueSq;
|
|
this.sectionStart = this.index + 1;
|
|
} else if (!isWhitespace(c)) {
|
|
this.sectionStart = this.index;
|
|
this.state = State.InAttributeValueNq;
|
|
this.stateInAttributeValueNoQuotes(c);
|
|
}
|
|
}
|
|
handleInAttributeValue(c, quote) {
|
|
if (c === quote || !this.decodeEntities && this.fastForwardTo(quote)) {
|
|
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(quote === CharCodes2.DoubleQuote ? QuoteType.Double : QuoteType.Single, this.index + 1);
|
|
this.state = State.BeforeAttributeName;
|
|
} else if (this.decodeEntities && c === CharCodes2.Amp) {
|
|
this.startEntity();
|
|
}
|
|
}
|
|
stateInAttributeValueDoubleQuotes(c) {
|
|
this.handleInAttributeValue(c, CharCodes2.DoubleQuote);
|
|
}
|
|
stateInAttributeValueSingleQuotes(c) {
|
|
this.handleInAttributeValue(c, CharCodes2.SingleQuote);
|
|
}
|
|
stateInAttributeValueNoQuotes(c) {
|
|
if (isWhitespace(c) || c === CharCodes2.Gt) {
|
|
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(QuoteType.Unquoted, this.index);
|
|
this.state = State.BeforeAttributeName;
|
|
this.stateBeforeAttributeName(c);
|
|
} else if (this.decodeEntities && c === CharCodes2.Amp) {
|
|
this.startEntity();
|
|
}
|
|
}
|
|
stateBeforeDeclaration(c) {
|
|
if (c === CharCodes2.OpeningSquareBracket) {
|
|
this.state = State.CDATASequence;
|
|
this.sequenceIndex = 0;
|
|
} else if (this.xmlMode) {
|
|
this.state = c === CharCodes2.Dash ? State.BeforeComment : State.InDeclaration;
|
|
} else if ((c | 32) === Sequences.Doctype[0]) {
|
|
this.state = State.DeclarationSequence;
|
|
this.currentSequence = Sequences.Doctype;
|
|
this.sequenceIndex = 1;
|
|
} else if (c === CharCodes2.Gt) {
|
|
this.cbs.oncomment(this.sectionStart, this.index, 0);
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
} else if (c === CharCodes2.Dash) {
|
|
this.state = State.BeforeComment;
|
|
} else {
|
|
this.state = State.InSpecialComment;
|
|
}
|
|
}
|
|
stateDeclarationSequence(c) {
|
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
this.state = State.InDeclaration;
|
|
this.stateInDeclaration(c);
|
|
} else if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
|
|
this.sequenceIndex += 1;
|
|
} else if (c === CharCodes2.Gt) {
|
|
this.cbs.oncomment(this.sectionStart, this.index, 0);
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
} else {
|
|
this.state = State.InSpecialComment;
|
|
}
|
|
}
|
|
stateInDeclaration(c) {
|
|
if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
|
|
this.cbs.ondeclaration(this.sectionStart, this.index);
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
}
|
|
}
|
|
stateInProcessingInstruction(c) {
|
|
if (c === CharCodes2.Questionmark) {
|
|
this.sequenceIndex = 1;
|
|
} else if (c === CharCodes2.Gt && this.sequenceIndex === 1) {
|
|
this.cbs.onprocessinginstruction(this.sectionStart, this.index - 1);
|
|
this.sequenceIndex = 0;
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
} else {
|
|
this.sequenceIndex = Number(this.fastForwardTo(CharCodes2.Questionmark));
|
|
}
|
|
}
|
|
stateBeforeComment(c) {
|
|
if (c === CharCodes2.Dash) {
|
|
this.state = State.InCommentLike;
|
|
this.currentSequence = Sequences.CommentEnd;
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this.index + 1;
|
|
} else if (this.xmlMode) {
|
|
this.state = State.InDeclaration;
|
|
} else if (c === CharCodes2.Gt) {
|
|
this.cbs.oncomment(this.sectionStart, this.index, 0);
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
} else {
|
|
this.state = State.InSpecialComment;
|
|
}
|
|
}
|
|
stateInSpecialComment(c) {
|
|
if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
|
|
this.cbs.oncomment(this.sectionStart, this.index, 0);
|
|
this.state = State.Text;
|
|
this.sectionStart = this.index + 1;
|
|
}
|
|
}
|
|
startEntity() {
|
|
this.baseState = this.state;
|
|
this.state = State.InEntity;
|
|
this.entityStart = this.index;
|
|
this.entityDecoder.startEntity(this.xmlMode ? DecodingMode.Strict : this.baseState === State.Text || this.baseState === State.InSpecialTag ? DecodingMode.Legacy : DecodingMode.Attribute);
|
|
}
|
|
stateInEntity() {
|
|
const indexInBuffer = this.index - this.offset;
|
|
const length = this.entityDecoder.write(this.buffer, indexInBuffer);
|
|
if (length >= 0) {
|
|
this.state = this.baseState;
|
|
if (length === 0) {
|
|
this.index -= 1;
|
|
}
|
|
} else {
|
|
if (indexInBuffer < this.buffer.length && this.buffer.charCodeAt(indexInBuffer) === CharCodes2.Amp) {
|
|
this.state = this.baseState;
|
|
this.index -= 1;
|
|
return;
|
|
}
|
|
this.index = this.offset + this.buffer.length - 1;
|
|
}
|
|
}
|
|
cleanup() {
|
|
if (this.running && this.sectionStart !== this.index) {
|
|
if (this.state === State.Text || this.state === State.InPlainText || this.state === State.InSpecialTag && this.sequenceIndex === 0) {
|
|
this.cbs.ontext(this.sectionStart, this.index);
|
|
this.sectionStart = this.index;
|
|
} else if (this.state === State.InAttributeValueDq || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueNq) {
|
|
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
this.sectionStart = this.index;
|
|
}
|
|
}
|
|
}
|
|
shouldContinue() {
|
|
return this.index < this.buffer.length + this.offset && this.running;
|
|
}
|
|
parse() {
|
|
while (this.shouldContinue()) {
|
|
const c = this.buffer.charCodeAt(this.index - this.offset);
|
|
switch (this.state) {
|
|
case State.Text: {
|
|
this.stateText(c);
|
|
break;
|
|
}
|
|
case State.InPlainText: {
|
|
this.index = this.buffer.length + this.offset - 1;
|
|
break;
|
|
}
|
|
case State.SpecialStartSequence: {
|
|
this.stateSpecialStartSequence(c);
|
|
break;
|
|
}
|
|
case State.InSpecialTag: {
|
|
this.stateInSpecialTag(c);
|
|
break;
|
|
}
|
|
case State.CDATASequence: {
|
|
this.stateCDATASequence(c);
|
|
break;
|
|
}
|
|
case State.DeclarationSequence: {
|
|
this.stateDeclarationSequence(c);
|
|
break;
|
|
}
|
|
case State.InAttributeValueDq: {
|
|
this.stateInAttributeValueDoubleQuotes(c);
|
|
break;
|
|
}
|
|
case State.InAttributeName: {
|
|
this.stateInAttributeName(c);
|
|
break;
|
|
}
|
|
case State.InCommentLike: {
|
|
this.stateInCommentLike(c);
|
|
break;
|
|
}
|
|
case State.InSpecialComment: {
|
|
this.stateInSpecialComment(c);
|
|
break;
|
|
}
|
|
case State.BeforeAttributeName: {
|
|
this.stateBeforeAttributeName(c);
|
|
break;
|
|
}
|
|
case State.InTagName: {
|
|
this.stateInTagName(c);
|
|
break;
|
|
}
|
|
case State.InClosingTagName: {
|
|
this.stateInClosingTagName(c);
|
|
break;
|
|
}
|
|
case State.BeforeTagName: {
|
|
this.stateBeforeTagName(c);
|
|
break;
|
|
}
|
|
case State.AfterAttributeName: {
|
|
this.stateAfterAttributeName(c);
|
|
break;
|
|
}
|
|
case State.InAttributeValueSq: {
|
|
this.stateInAttributeValueSingleQuotes(c);
|
|
break;
|
|
}
|
|
case State.BeforeAttributeValue: {
|
|
this.stateBeforeAttributeValue(c);
|
|
break;
|
|
}
|
|
case State.BeforeClosingTagName: {
|
|
this.stateBeforeClosingTagName(c);
|
|
break;
|
|
}
|
|
case State.AfterClosingTagName: {
|
|
this.stateAfterClosingTagName(c);
|
|
break;
|
|
}
|
|
case State.InAttributeValueNq: {
|
|
this.stateInAttributeValueNoQuotes(c);
|
|
break;
|
|
}
|
|
case State.InSelfClosingTag: {
|
|
this.stateInSelfClosingTag(c);
|
|
break;
|
|
}
|
|
case State.InDeclaration: {
|
|
this.stateInDeclaration(c);
|
|
break;
|
|
}
|
|
case State.BeforeDeclaration: {
|
|
this.stateBeforeDeclaration(c);
|
|
break;
|
|
}
|
|
case State.BeforeComment: {
|
|
this.stateBeforeComment(c);
|
|
break;
|
|
}
|
|
case State.InProcessingInstruction: {
|
|
this.stateInProcessingInstruction(c);
|
|
break;
|
|
}
|
|
case State.InEntity: {
|
|
this.stateInEntity();
|
|
break;
|
|
}
|
|
}
|
|
this.index++;
|
|
}
|
|
this.cleanup();
|
|
}
|
|
finish() {
|
|
if (this.state === State.InEntity) {
|
|
this.entityDecoder.end();
|
|
this.state = this.baseState;
|
|
}
|
|
this.handleTrailingData();
|
|
this.cbs.onend();
|
|
}
|
|
handleTrailingCommentLikeData(endIndex) {
|
|
if (this.state !== State.InCommentLike) {
|
|
return false;
|
|
}
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
if (this.xmlMode) {
|
|
if (this.sectionStart < endIndex) {
|
|
this.cbs.oncdata(this.sectionStart, endIndex, 0);
|
|
}
|
|
} else {
|
|
const cdataStart = this.sectionStart - Sequences.Cdata.length - 1;
|
|
this.cbs.oncomment(cdataStart, endIndex, 0);
|
|
}
|
|
} else {
|
|
const offset = this.xmlMode ? 0 : Math.min(this.sequenceIndex, Sequences.CommentEnd.length - 1);
|
|
this.cbs.oncomment(this.sectionStart, endIndex, offset);
|
|
}
|
|
return true;
|
|
}
|
|
handleTrailingMarkupDeclaration(endIndex) {
|
|
if (this.xmlMode) {
|
|
switch (this.state) {
|
|
case State.InSpecialComment:
|
|
case State.BeforeComment:
|
|
case State.CDATASequence:
|
|
case State.DeclarationSequence:
|
|
case State.InDeclaration: {
|
|
this.cbs.ontext(this.sectionStart, endIndex);
|
|
return true;
|
|
}
|
|
default: {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
switch (this.state) {
|
|
case State.BeforeDeclaration:
|
|
case State.InSpecialComment:
|
|
case State.BeforeComment:
|
|
case State.CDATASequence: {
|
|
this.cbs.oncomment(this.sectionStart, endIndex, 0);
|
|
return true;
|
|
}
|
|
case State.DeclarationSequence: {
|
|
if (this.sequenceIndex !== Sequences.Doctype.length) {
|
|
this.cbs.oncomment(this.sectionStart, endIndex, 0);
|
|
}
|
|
return true;
|
|
}
|
|
case State.InDeclaration: {
|
|
return true;
|
|
}
|
|
default: {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
handleTrailingData() {
|
|
const endIndex = this.buffer.length + this.offset;
|
|
if (this.handleTrailingCommentLikeData(endIndex) || this.handleTrailingMarkupDeclaration(endIndex)) {
|
|
return;
|
|
}
|
|
if (this.sectionStart >= endIndex) {
|
|
return;
|
|
}
|
|
switch (this.state) {
|
|
case State.InTagName:
|
|
case State.BeforeAttributeName:
|
|
case State.BeforeAttributeValue:
|
|
case State.AfterAttributeName:
|
|
case State.InAttributeName:
|
|
case State.InAttributeValueSq:
|
|
case State.InAttributeValueDq:
|
|
case State.InAttributeValueNq:
|
|
case State.InClosingTagName: {
|
|
break;
|
|
}
|
|
default: {
|
|
this.cbs.ontext(this.sectionStart, endIndex);
|
|
}
|
|
}
|
|
}
|
|
emitCodePoint(cp, consumed) {
|
|
if (this.baseState !== State.Text && this.baseState !== State.InSpecialTag) {
|
|
if (this.sectionStart < this.entityStart) {
|
|
this.cbs.onattribdata(this.sectionStart, this.entityStart);
|
|
}
|
|
this.sectionStart = this.entityStart + consumed;
|
|
this.index = this.sectionStart - 1;
|
|
this.cbs.onattribentity(cp);
|
|
} else {
|
|
if (this.sectionStart < this.entityStart) {
|
|
this.cbs.ontext(this.sectionStart, this.entityStart);
|
|
}
|
|
this.sectionStart = this.entityStart + consumed;
|
|
this.index = this.sectionStart - 1;
|
|
this.cbs.ontextentity(cp, this.sectionStart);
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/htmlparser2/dist/Parser.js
|
|
var { fromCodePoint } = String;
|
|
var formTags = new Set([
|
|
"input",
|
|
"option",
|
|
"optgroup",
|
|
"select",
|
|
"button",
|
|
"datalist",
|
|
"textarea"
|
|
]);
|
|
var pTag = new Set(["p"]);
|
|
var headingTags = new Set(["h1", "h2", "h3", "h4", "h5", "h6", "p"]);
|
|
var tableSectionTags = new Set(["thead", "tbody"]);
|
|
var ddtTags = new Set(["dd", "dt"]);
|
|
var rtpTags = new Set(["rt", "rp"]);
|
|
var openImpliesClose = new Map([
|
|
["tr", new Set(["tr", "th", "td"])],
|
|
["th", new Set(["th"])],
|
|
["td", new Set(["thead", "th", "td"])],
|
|
["body", new Set(["head", "link", "script"])],
|
|
["a", new Set(["a"])],
|
|
["li", new Set(["li"])],
|
|
["p", pTag],
|
|
["h1", headingTags],
|
|
["h2", headingTags],
|
|
["h3", headingTags],
|
|
["h4", headingTags],
|
|
["h5", headingTags],
|
|
["h6", headingTags],
|
|
["select", formTags],
|
|
["input", formTags],
|
|
["output", formTags],
|
|
["button", formTags],
|
|
["datalist", formTags],
|
|
["textarea", formTags],
|
|
["option", new Set(["option"])],
|
|
["optgroup", new Set(["optgroup", "option"])],
|
|
["dd", ddtTags],
|
|
["dt", ddtTags],
|
|
["address", pTag],
|
|
["article", pTag],
|
|
["aside", pTag],
|
|
["blockquote", pTag],
|
|
["details", pTag],
|
|
["div", pTag],
|
|
["dl", pTag],
|
|
["fieldset", pTag],
|
|
["figcaption", pTag],
|
|
["figure", pTag],
|
|
["footer", pTag],
|
|
["form", pTag],
|
|
["header", pTag],
|
|
["hr", pTag],
|
|
["main", pTag],
|
|
["nav", pTag],
|
|
["ol", pTag],
|
|
["pre", pTag],
|
|
["section", pTag],
|
|
["table", pTag],
|
|
["ul", pTag],
|
|
["rt", rtpTags],
|
|
["rp", rtpTags],
|
|
["tbody", tableSectionTags],
|
|
["tfoot", tableSectionTags]
|
|
]);
|
|
var DOCUMENT_TYPE = "doctype";
|
|
var voidElements = new Set([
|
|
"area",
|
|
"base",
|
|
"basefont",
|
|
"br",
|
|
"col",
|
|
"command",
|
|
"embed",
|
|
"frame",
|
|
"hr",
|
|
"img",
|
|
"input",
|
|
"isindex",
|
|
"keygen",
|
|
"link",
|
|
"meta",
|
|
"param",
|
|
"source",
|
|
"track",
|
|
"wbr"
|
|
]);
|
|
var foreignContextElements = new Set(["math", "svg"]);
|
|
var htmlIntegrationElements = new Set([
|
|
"mi",
|
|
"mo",
|
|
"mn",
|
|
"ms",
|
|
"mtext",
|
|
"annotation-xml",
|
|
"foreignObject",
|
|
"desc",
|
|
"title"
|
|
]);
|
|
var svgTagNameAdjustments = new Map([
|
|
["altglyph", "altGlyph"],
|
|
["altglyphdef", "altGlyphDef"],
|
|
["altglyphitem", "altGlyphItem"],
|
|
["animatecolor", "animateColor"],
|
|
["animatemotion", "animateMotion"],
|
|
["animatetransform", "animateTransform"],
|
|
["clippath", "clipPath"],
|
|
["feblend", "feBlend"],
|
|
["fecolormatrix", "feColorMatrix"],
|
|
["fecomponenttransfer", "feComponentTransfer"],
|
|
["fecomposite", "feComposite"],
|
|
["feconvolvematrix", "feConvolveMatrix"],
|
|
["fediffuselighting", "feDiffuseLighting"],
|
|
["fedisplacementmap", "feDisplacementMap"],
|
|
["fedistantlight", "feDistantLight"],
|
|
["fedropshadow", "feDropShadow"],
|
|
["feflood", "feFlood"],
|
|
["fefunca", "feFuncA"],
|
|
["fefuncb", "feFuncB"],
|
|
["fefuncg", "feFuncG"],
|
|
["fefuncr", "feFuncR"],
|
|
["fegaussianblur", "feGaussianBlur"],
|
|
["feimage", "feImage"],
|
|
["femerge", "feMerge"],
|
|
["femergenode", "feMergeNode"],
|
|
["femorphology", "feMorphology"],
|
|
["feoffset", "feOffset"],
|
|
["fepointlight", "fePointLight"],
|
|
["fespecularlighting", "feSpecularLighting"],
|
|
["fespotlight", "feSpotLight"],
|
|
["fetile", "feTile"],
|
|
["feturbulence", "feTurbulence"],
|
|
["foreignobject", "foreignObject"],
|
|
["glyphref", "glyphRef"],
|
|
["lineargradient", "linearGradient"],
|
|
["radialgradient", "radialGradient"],
|
|
["textpath", "textPath"]
|
|
]);
|
|
var ForeignContext;
|
|
(function(ForeignContext2) {
|
|
ForeignContext2[ForeignContext2["None"] = 0] = "None";
|
|
ForeignContext2[ForeignContext2["Svg"] = 1] = "Svg";
|
|
ForeignContext2[ForeignContext2["MathML"] = 2] = "MathML";
|
|
})(ForeignContext || (ForeignContext = {}));
|
|
var reNameEnd = /\s|\//;
|
|
|
|
class Parser {
|
|
options;
|
|
startIndex = 0;
|
|
endIndex = 0;
|
|
openTagStart = 0;
|
|
tagname = "";
|
|
attribname = "";
|
|
attribvalue = "";
|
|
attribs = null;
|
|
stack = [];
|
|
foreignContext;
|
|
cbs;
|
|
lowerCaseTagNames;
|
|
lowerCaseAttributeNames;
|
|
recognizeSelfClosing;
|
|
htmlMode;
|
|
tokenizer;
|
|
buffers = [];
|
|
bufferOffset = 0;
|
|
writeIndex = 0;
|
|
ended = false;
|
|
constructor(cbs, options = {}) {
|
|
this.options = options;
|
|
this.cbs = cbs ?? {};
|
|
this.htmlMode = !this.options.xmlMode;
|
|
this.lowerCaseTagNames = options.lowerCaseTags ?? this.htmlMode;
|
|
this.lowerCaseAttributeNames = options.lowerCaseAttributeNames ?? this.htmlMode;
|
|
this.recognizeSelfClosing = options.recognizeSelfClosing ?? !this.htmlMode;
|
|
this.tokenizer = new (options.Tokenizer ?? Tokenizer)(this.options, this);
|
|
this.foreignContext = [ForeignContext.None];
|
|
this.cbs.onparserinit?.(this);
|
|
}
|
|
ontext(start, endIndex) {
|
|
const data = this.getSlice(start, endIndex);
|
|
this.endIndex = endIndex - 1;
|
|
this.cbs.ontext?.(data);
|
|
this.startIndex = endIndex;
|
|
}
|
|
ontextentity(cp, endIndex) {
|
|
this.endIndex = endIndex - 1;
|
|
this.cbs.ontext?.(fromCodePoint(cp));
|
|
this.startIndex = endIndex;
|
|
}
|
|
isInForeignContext() {
|
|
return this.foreignContext[0] !== ForeignContext.None;
|
|
}
|
|
isVoidElement(name) {
|
|
return this.htmlMode && voidElements.has(name);
|
|
}
|
|
readTagName(start, endIndex) {
|
|
const name = this.lowerCaseTagNames ? this.getSlice(start, endIndex).toLowerCase() : this.getSlice(start, endIndex);
|
|
if (!(this.lowerCaseTagNames && this.htmlMode)) {
|
|
return name;
|
|
}
|
|
if (this.foreignContext[0] === ForeignContext.Svg) {
|
|
return svgTagNameAdjustments.get(name) ?? name;
|
|
}
|
|
if (this.foreignContext.length > 1) {
|
|
const adjusted = svgTagNameAdjustments.get(name);
|
|
if (adjusted !== undefined && this.stack.includes(adjusted)) {
|
|
return adjusted;
|
|
}
|
|
}
|
|
if (!this.isInForeignContext()) {
|
|
return name === "image" ? "img" : name;
|
|
}
|
|
return name;
|
|
}
|
|
onopentagname(start, endIndex) {
|
|
this.endIndex = endIndex;
|
|
this.emitOpenTag(this.readTagName(start, endIndex));
|
|
}
|
|
emitOpenTag(name) {
|
|
this.openTagStart = this.startIndex;
|
|
this.tagname = name;
|
|
if (this.htmlMode && name === "form" && this.stack.includes("form")) {
|
|
this.tagname = "";
|
|
return;
|
|
}
|
|
const impliesClose = this.htmlMode && openImpliesClose.get(name);
|
|
if (impliesClose) {
|
|
while (this.stack.length > 0 && impliesClose.has(this.stack[0])) {
|
|
this.popElement(true);
|
|
}
|
|
}
|
|
if (!this.isVoidElement(name)) {
|
|
this.stack.unshift(name);
|
|
if (this.htmlMode) {
|
|
if (name === "svg") {
|
|
this.foreignContext.unshift(ForeignContext.Svg);
|
|
} else if (name === "math") {
|
|
this.foreignContext.unshift(ForeignContext.MathML);
|
|
} else if (htmlIntegrationElements.has(name)) {
|
|
this.foreignContext.unshift(ForeignContext.None);
|
|
}
|
|
}
|
|
}
|
|
this.cbs.onopentagname?.(name);
|
|
if (this.cbs.onopentag)
|
|
this.attribs = {};
|
|
}
|
|
endOpenTag(isImplied) {
|
|
this.startIndex = this.openTagStart;
|
|
if (this.attribs) {
|
|
this.cbs.onopentag?.(this.tagname, this.attribs, isImplied);
|
|
this.attribs = null;
|
|
}
|
|
if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
|
|
this.cbs.onclosetag(this.tagname, true);
|
|
}
|
|
this.tagname = "";
|
|
}
|
|
onopentagend(endIndex) {
|
|
this.endIndex = endIndex;
|
|
this.endOpenTag(false);
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
onclosetag(start, endIndex) {
|
|
this.endIndex = endIndex;
|
|
const name = this.readTagName(start, endIndex);
|
|
if (!this.isVoidElement(name)) {
|
|
const pos = this.stack.indexOf(name);
|
|
if (pos !== -1) {
|
|
for (let index = 0;index < pos; index++) {
|
|
this.popElement(true);
|
|
}
|
|
this.popElement(false);
|
|
} else if (this.htmlMode && name === "p") {
|
|
this.emitOpenTag("p");
|
|
this.closeCurrentTag(true);
|
|
}
|
|
} else if (this.htmlMode && name === "br") {
|
|
this.cbs.onopentagname?.("br");
|
|
this.cbs.onopentag?.("br", {}, true);
|
|
this.cbs.onclosetag?.("br", false);
|
|
}
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
onselfclosingtag(endIndex) {
|
|
this.endIndex = endIndex;
|
|
if (this.recognizeSelfClosing || this.isInForeignContext()) {
|
|
this.closeCurrentTag(false);
|
|
this.startIndex = endIndex + 1;
|
|
} else {
|
|
this.onopentagend(endIndex);
|
|
}
|
|
}
|
|
popElement(implied) {
|
|
const element = this.stack.shift();
|
|
if (this.htmlMode && (foreignContextElements.has(element) || htmlIntegrationElements.has(element))) {
|
|
this.foreignContext.shift();
|
|
}
|
|
this.cbs.onclosetag?.(element, implied);
|
|
}
|
|
closeCurrentTag(isOpenImplied) {
|
|
const name = this.tagname;
|
|
this.endOpenTag(isOpenImplied);
|
|
if (this.stack[0] === name) {
|
|
this.popElement(!isOpenImplied);
|
|
}
|
|
}
|
|
onattribname(start, endIndex) {
|
|
this.startIndex = start;
|
|
const name = this.getSlice(start, endIndex);
|
|
this.attribname = this.lowerCaseAttributeNames ? name.toLowerCase() : name;
|
|
}
|
|
onattribdata(start, endIndex) {
|
|
this.attribvalue += this.getSlice(start, endIndex);
|
|
}
|
|
onattribentity(cp) {
|
|
this.attribvalue += fromCodePoint(cp);
|
|
}
|
|
onattribend(quote, endIndex) {
|
|
this.endIndex = endIndex;
|
|
this.cbs.onattribute?.(this.attribname, this.attribvalue, quote === QuoteType.Double ? '"' : quote === QuoteType.Single ? "'" : quote === QuoteType.NoValue ? undefined : null);
|
|
if (this.attribs && !Object.hasOwn(this.attribs, this.attribname)) {
|
|
this.attribs[this.attribname] = this.attribvalue;
|
|
}
|
|
this.attribvalue = "";
|
|
}
|
|
getInstructionName(value) {
|
|
const index = value.search(reNameEnd);
|
|
let name = index < 0 ? value : value.substr(0, index);
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
return name;
|
|
}
|
|
ondeclaration(start, endIndex) {
|
|
this.endIndex = endIndex;
|
|
const value = this.getSlice(start, endIndex);
|
|
if (this.cbs.onprocessinginstruction) {
|
|
const name = this.htmlMode ? this.lowerCaseTagNames ? DOCUMENT_TYPE : value.slice(0, DOCUMENT_TYPE.length) : this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);
|
|
}
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
onprocessinginstruction(start, endIndex) {
|
|
this.endIndex = endIndex;
|
|
const value = this.getSlice(start, endIndex);
|
|
if (this.cbs.onprocessinginstruction) {
|
|
const name = this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);
|
|
}
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
oncomment(start, endIndex, offset) {
|
|
this.endIndex = endIndex;
|
|
this.cbs.oncomment?.(this.getSlice(start, endIndex - offset));
|
|
this.cbs.oncommentend?.();
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
oncdata(start, endIndex, offset) {
|
|
this.endIndex = endIndex;
|
|
const value = this.getSlice(start, endIndex - offset);
|
|
if (!this.htmlMode || this.options.recognizeCDATA) {
|
|
this.cbs.oncdatastart?.();
|
|
this.cbs.ontext?.(value);
|
|
this.cbs.oncdataend?.();
|
|
} else if (this.isInForeignContext()) {
|
|
this.cbs.ontext?.(value);
|
|
} else {
|
|
this.cbs.oncomment?.(`[CDATA[${value}]]`);
|
|
this.cbs.oncommentend?.();
|
|
}
|
|
this.startIndex = endIndex + 1;
|
|
}
|
|
onend() {
|
|
if (this.cbs.onclosetag) {
|
|
this.endIndex = this.startIndex;
|
|
for (let index = 0;index < this.stack.length; index++) {
|
|
this.cbs.onclosetag(this.stack[index], true);
|
|
}
|
|
}
|
|
this.cbs.onend?.();
|
|
}
|
|
reset() {
|
|
this.cbs.onreset?.();
|
|
this.tokenizer.reset();
|
|
this.tagname = "";
|
|
this.attribname = "";
|
|
this.attribvalue = "";
|
|
this.attribs = null;
|
|
this.stack.length = 0;
|
|
this.startIndex = 0;
|
|
this.endIndex = 0;
|
|
this.cbs.onparserinit?.(this);
|
|
this.buffers.length = 0;
|
|
this.foreignContext.length = 0;
|
|
this.foreignContext.unshift(ForeignContext.None);
|
|
this.bufferOffset = 0;
|
|
this.writeIndex = 0;
|
|
this.ended = false;
|
|
}
|
|
parseComplete(data) {
|
|
this.reset();
|
|
this.end(data);
|
|
}
|
|
getSlice(start, end) {
|
|
if (start === end) {
|
|
return "";
|
|
}
|
|
while (start - this.bufferOffset >= this.buffers[0].length) {
|
|
this.shiftBuffer();
|
|
}
|
|
let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
|
|
while (end - this.bufferOffset > this.buffers[0].length) {
|
|
this.shiftBuffer();
|
|
slice += this.buffers[0].slice(0, end - this.bufferOffset);
|
|
}
|
|
return slice;
|
|
}
|
|
shiftBuffer() {
|
|
this.bufferOffset += this.buffers[0].length;
|
|
this.writeIndex--;
|
|
this.buffers.shift();
|
|
}
|
|
write(chunk) {
|
|
if (this.ended) {
|
|
this.cbs.onerror?.(new Error(".write() after done!"));
|
|
return;
|
|
}
|
|
this.buffers.push(chunk);
|
|
if (this.tokenizer.running) {
|
|
this.tokenizer.write(chunk);
|
|
this.writeIndex++;
|
|
}
|
|
}
|
|
end(chunk) {
|
|
if (this.ended) {
|
|
this.cbs.onerror?.(new Error(".end() after done!"));
|
|
return;
|
|
}
|
|
if (chunk)
|
|
this.write(chunk);
|
|
this.ended = true;
|
|
this.tokenizer.end();
|
|
}
|
|
pause() {
|
|
this.tokenizer.pause();
|
|
}
|
|
resume() {
|
|
this.tokenizer.resume();
|
|
while (this.tokenizer.running && this.writeIndex < this.buffers.length) {
|
|
this.tokenizer.write(this.buffers[this.writeIndex++]);
|
|
}
|
|
if (this.ended)
|
|
this.tokenizer.end();
|
|
}
|
|
}
|
|
// node_modules/domelementtype/dist/index.js
|
|
var exports_dist = {};
|
|
__export(exports_dist, {
|
|
isTag: () => isTag,
|
|
Text: () => Text,
|
|
Tag: () => Tag,
|
|
Style: () => Style,
|
|
Script: () => Script,
|
|
Root: () => Root,
|
|
ElementType: () => ElementType,
|
|
Doctype: () => Doctype,
|
|
Directive: () => Directive,
|
|
Comment: () => Comment,
|
|
CDATA: () => CDATA
|
|
});
|
|
var ElementType;
|
|
(function(ElementType2) {
|
|
ElementType2["Root"] = "root";
|
|
ElementType2["Text"] = "text";
|
|
ElementType2["Directive"] = "directive";
|
|
ElementType2["Comment"] = "comment";
|
|
ElementType2["Script"] = "script";
|
|
ElementType2["Style"] = "style";
|
|
ElementType2["Tag"] = "tag";
|
|
ElementType2["CDATA"] = "cdata";
|
|
ElementType2["Doctype"] = "doctype";
|
|
})(ElementType || (ElementType = {}));
|
|
function isTag(element) {
|
|
return element.type === ElementType.Tag || element.type === ElementType.Script || element.type === ElementType.Style;
|
|
}
|
|
var Root = ElementType.Root;
|
|
var Text = ElementType.Text;
|
|
var Directive = ElementType.Directive;
|
|
var Comment = ElementType.Comment;
|
|
var Script = ElementType.Script;
|
|
var Style = ElementType.Style;
|
|
var Tag = ElementType.Tag;
|
|
var CDATA = ElementType.CDATA;
|
|
var Doctype = ElementType.Doctype;
|
|
|
|
// node_modules/domhandler/dist/node.js
|
|
class Node {
|
|
parent = null;
|
|
prev = null;
|
|
next = null;
|
|
startIndex = null;
|
|
endIndex = null;
|
|
get parentNode() {
|
|
return this.parent;
|
|
}
|
|
set parentNode(parent) {
|
|
this.parent = parent;
|
|
}
|
|
get previousSibling() {
|
|
return this.prev;
|
|
}
|
|
set previousSibling(previous) {
|
|
this.prev = previous;
|
|
}
|
|
get nextSibling() {
|
|
return this.next;
|
|
}
|
|
set nextSibling(next) {
|
|
this.next = next;
|
|
}
|
|
cloneNode(recursive = false) {
|
|
return cloneNode(this, recursive);
|
|
}
|
|
}
|
|
|
|
class DataNode extends Node {
|
|
data;
|
|
constructor(data) {
|
|
super();
|
|
this.data = data;
|
|
}
|
|
get nodeValue() {
|
|
return this.data;
|
|
}
|
|
set nodeValue(data) {
|
|
this.data = data;
|
|
}
|
|
}
|
|
|
|
class Text2 extends DataNode {
|
|
type = ElementType.Text;
|
|
get nodeType() {
|
|
return 3;
|
|
}
|
|
}
|
|
|
|
class Comment2 extends DataNode {
|
|
type = ElementType.Comment;
|
|
get nodeType() {
|
|
return 8;
|
|
}
|
|
}
|
|
|
|
class ProcessingInstruction extends DataNode {
|
|
type = ElementType.Directive;
|
|
name;
|
|
constructor(name, data) {
|
|
super(data);
|
|
this.name = name;
|
|
}
|
|
get nodeType() {
|
|
return 1;
|
|
}
|
|
"x-name";
|
|
"x-publicId";
|
|
"x-systemId";
|
|
}
|
|
|
|
class NodeWithChildren extends Node {
|
|
children;
|
|
constructor(children) {
|
|
super();
|
|
this.children = children;
|
|
}
|
|
get firstChild() {
|
|
return this.children[0] ?? null;
|
|
}
|
|
get lastChild() {
|
|
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
}
|
|
get childNodes() {
|
|
return this.children;
|
|
}
|
|
set childNodes(children) {
|
|
this.children = children;
|
|
}
|
|
}
|
|
|
|
class CDATA2 extends NodeWithChildren {
|
|
type = ElementType.CDATA;
|
|
get nodeType() {
|
|
return 4;
|
|
}
|
|
}
|
|
|
|
class Document extends NodeWithChildren {
|
|
type = ElementType.Root;
|
|
get nodeType() {
|
|
return 9;
|
|
}
|
|
}
|
|
|
|
class Element extends NodeWithChildren {
|
|
name;
|
|
attribs;
|
|
type;
|
|
constructor(name, attribs, children = [], type = name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag) {
|
|
super(children);
|
|
this.name = name;
|
|
this.attribs = attribs;
|
|
this.type = type;
|
|
}
|
|
get nodeType() {
|
|
return 1;
|
|
}
|
|
get tagName() {
|
|
return this.name;
|
|
}
|
|
set tagName(name) {
|
|
this.name = name;
|
|
}
|
|
get attributes() {
|
|
return Object.keys(this.attribs).map((name) => ({
|
|
name,
|
|
value: this.attribs[name],
|
|
namespace: this["x-attribsNamespace"]?.[name],
|
|
prefix: this["x-attribsPrefix"]?.[name]
|
|
}));
|
|
}
|
|
namespace;
|
|
"x-attribsNamespace";
|
|
"x-attribsPrefix";
|
|
}
|
|
function isTag2(node) {
|
|
return isTag(node);
|
|
}
|
|
function isCDATA(node) {
|
|
return node.type === ElementType.CDATA;
|
|
}
|
|
function isText(node) {
|
|
return node.type === ElementType.Text;
|
|
}
|
|
function isComment(node) {
|
|
return node.type === ElementType.Comment;
|
|
}
|
|
function isDirective(node) {
|
|
return node.type === ElementType.Directive;
|
|
}
|
|
function isDocument(node) {
|
|
return node.type === ElementType.Root;
|
|
}
|
|
function hasChildren(node) {
|
|
return Object.hasOwn(node, "children");
|
|
}
|
|
function cloneNode(node, recursive = false) {
|
|
let result;
|
|
if (isText(node)) {
|
|
result = new Text2(node.data);
|
|
} else if (isComment(node)) {
|
|
result = new Comment2(node.data);
|
|
} else if (isTag2(node)) {
|
|
const children = recursive ? cloneChildren(node.children) : [];
|
|
const clone = new Element(node.name, { ...node.attribs }, children);
|
|
for (const child of children) {
|
|
child.parent = clone;
|
|
}
|
|
if (node.namespace != null) {
|
|
clone.namespace = node.namespace;
|
|
}
|
|
if (node["x-attribsNamespace"]) {
|
|
clone["x-attribsNamespace"] = { ...node["x-attribsNamespace"] };
|
|
}
|
|
if (node["x-attribsPrefix"]) {
|
|
clone["x-attribsPrefix"] = { ...node["x-attribsPrefix"] };
|
|
}
|
|
result = clone;
|
|
} else if (isCDATA(node)) {
|
|
const children = recursive ? cloneChildren(node.children) : [];
|
|
const clone = new CDATA2(children);
|
|
for (const child of children) {
|
|
child.parent = clone;
|
|
}
|
|
result = clone;
|
|
} else if (isDocument(node)) {
|
|
const children = recursive ? cloneChildren(node.children) : [];
|
|
const clone = new Document(children);
|
|
for (const child of children) {
|
|
child.parent = clone;
|
|
}
|
|
if (node["x-mode"]) {
|
|
clone["x-mode"] = node["x-mode"];
|
|
}
|
|
result = clone;
|
|
} else if (isDirective(node)) {
|
|
const instruction = new ProcessingInstruction(node.name, node.data);
|
|
if (node["x-name"] != null) {
|
|
instruction["x-name"] = node["x-name"];
|
|
instruction["x-publicId"] = node["x-publicId"];
|
|
instruction["x-systemId"] = node["x-systemId"];
|
|
}
|
|
result = instruction;
|
|
} else {
|
|
throw new Error(`Not implemented yet: ${node.type}`);
|
|
}
|
|
result.startIndex = node.startIndex;
|
|
result.endIndex = node.endIndex;
|
|
if (node.sourceCodeLocation != null) {
|
|
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
}
|
|
return result;
|
|
}
|
|
function cloneChildren(childs) {
|
|
const children = childs.map((child) => cloneNode(child, true));
|
|
for (let index = 1;index < children.length; index++) {
|
|
children[index].prev = children[index - 1];
|
|
children[index - 1].next = children[index];
|
|
}
|
|
return children;
|
|
}
|
|
|
|
// node_modules/domhandler/dist/index.js
|
|
var defaultOptions = {
|
|
withStartIndices: false,
|
|
withEndIndices: false,
|
|
xmlMode: false
|
|
};
|
|
|
|
class DomHandler {
|
|
dom = [];
|
|
root = new Document(this.dom);
|
|
callback;
|
|
options;
|
|
elementCB;
|
|
done = false;
|
|
tagStack = [this.root];
|
|
lastNode = null;
|
|
parser = null;
|
|
constructor(callback, options, elementCB) {
|
|
if (typeof options === "function") {
|
|
elementCB = options;
|
|
options = defaultOptions;
|
|
}
|
|
if (typeof callback === "object") {
|
|
options = callback;
|
|
callback = undefined;
|
|
}
|
|
this.callback = callback ?? null;
|
|
this.options = options ?? defaultOptions;
|
|
this.elementCB = elementCB ?? null;
|
|
}
|
|
onparserinit(parser) {
|
|
this.parser = parser;
|
|
}
|
|
onreset() {
|
|
this.dom = [];
|
|
this.root = new Document(this.dom);
|
|
this.done = false;
|
|
this.tagStack = [this.root];
|
|
this.lastNode = null;
|
|
this.parser = null;
|
|
}
|
|
onend() {
|
|
if (this.done)
|
|
return;
|
|
this.done = true;
|
|
this.parser = null;
|
|
this.handleCallback(null);
|
|
}
|
|
onerror(error) {
|
|
this.handleCallback(error);
|
|
}
|
|
onclosetag() {
|
|
this.lastNode = null;
|
|
const element = this.tagStack.pop();
|
|
if (this.options.withEndIndices && this.parser) {
|
|
element.endIndex = this.parser.endIndex;
|
|
}
|
|
if (this.elementCB)
|
|
this.elementCB(element);
|
|
}
|
|
onopentag(name, attribs) {
|
|
const type = this.options.xmlMode ? ElementType.Tag : undefined;
|
|
const element = new Element(name, attribs, undefined, type);
|
|
this.addNode(element);
|
|
this.tagStack.push(element);
|
|
}
|
|
ontext(data) {
|
|
const { lastNode } = this;
|
|
if (lastNode && lastNode.type === ElementType.Text) {
|
|
lastNode.data += data;
|
|
if (this.options.withEndIndices && this.parser) {
|
|
lastNode.endIndex = this.parser.endIndex;
|
|
}
|
|
} else {
|
|
const node2 = new Text2(data);
|
|
this.addNode(node2);
|
|
this.lastNode = node2;
|
|
}
|
|
}
|
|
oncomment(data) {
|
|
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
|
|
this.lastNode.data += data;
|
|
return;
|
|
}
|
|
const node2 = new Comment2(data);
|
|
this.addNode(node2);
|
|
this.lastNode = node2;
|
|
}
|
|
oncommentend() {
|
|
this.lastNode = null;
|
|
}
|
|
oncdatastart() {
|
|
const text = new Text2("");
|
|
const node2 = new CDATA2([text]);
|
|
this.addNode(node2);
|
|
text.parent = node2;
|
|
this.lastNode = text;
|
|
}
|
|
oncdataend() {
|
|
this.lastNode = null;
|
|
}
|
|
onprocessinginstruction(name, data) {
|
|
const node2 = new ProcessingInstruction(name, data);
|
|
this.addNode(node2);
|
|
}
|
|
handleCallback(error) {
|
|
if (typeof this.callback === "function") {
|
|
this.callback(error, this.dom);
|
|
} else if (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
addNode(node2) {
|
|
const parent = this.tagStack[this.tagStack.length - 1];
|
|
const previousSibling = parent.children[parent.children.length - 1];
|
|
if (this.options.withStartIndices && this.parser) {
|
|
node2.startIndex = this.parser.startIndex;
|
|
}
|
|
if (this.options.withEndIndices && this.parser) {
|
|
node2.endIndex = this.parser.endIndex;
|
|
}
|
|
parent.children.push(node2);
|
|
if (previousSibling) {
|
|
node2.prev = previousSibling;
|
|
previousSibling.next = node2;
|
|
}
|
|
node2.parent = parent;
|
|
this.lastNode = null;
|
|
}
|
|
}
|
|
// node_modules/domutils/dist/index.js
|
|
var exports_dist2 = {};
|
|
__export(exports_dist2, {
|
|
uniqueSort: () => uniqueSort,
|
|
textContent: () => textContent,
|
|
testElement: () => testElement,
|
|
replaceElement: () => replaceElement,
|
|
removeSubsets: () => removeSubsets,
|
|
removeElement: () => removeElement,
|
|
prevElementSibling: () => prevElementSibling,
|
|
prependChild: () => prependChild,
|
|
prepend: () => prepend,
|
|
nextElementSibling: () => nextElementSibling,
|
|
innerText: () => innerText,
|
|
hasAttrib: () => hasAttrib,
|
|
getText: () => getText,
|
|
getSiblings: () => getSiblings,
|
|
getParent: () => getParent,
|
|
getOuterHTML: () => getOuterHTML,
|
|
getName: () => getName,
|
|
getInnerHTML: () => getInnerHTML,
|
|
getFeed: () => getFeed,
|
|
getElementsByTagType: () => getElementsByTagType,
|
|
getElementsByTagName: () => getElementsByTagName,
|
|
getElementsByClassName: () => getElementsByClassName,
|
|
getElements: () => getElements,
|
|
getElementById: () => getElementById,
|
|
getChildren: () => getChildren,
|
|
getAttributeValue: () => getAttributeValue,
|
|
findOne: () => findOne,
|
|
findAll: () => findAll,
|
|
find: () => find,
|
|
filter: () => filter,
|
|
existsOne: () => existsOne,
|
|
compareDocumentPosition: () => compareDocumentPosition,
|
|
appendChild: () => appendChild,
|
|
append: () => append,
|
|
DocumentPosition: () => DocumentPosition
|
|
});
|
|
|
|
// node_modules/domutils/dist/querying.js
|
|
function filter(test, node2, recurse = true, limit = Number.POSITIVE_INFINITY) {
|
|
return find(test, Array.isArray(node2) ? node2 : [node2], recurse, limit);
|
|
}
|
|
function find(test, nodes, recurse, limit) {
|
|
const result = [];
|
|
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
|
|
const indexStack = [0];
|
|
for (;; ) {
|
|
if (indexStack[0] >= nodeStack[0].length) {
|
|
if (indexStack.length === 1) {
|
|
return result;
|
|
}
|
|
nodeStack.shift();
|
|
indexStack.shift();
|
|
continue;
|
|
}
|
|
const element = nodeStack[0][indexStack[0]++];
|
|
if (test(element)) {
|
|
result.push(element);
|
|
if (--limit <= 0)
|
|
return result;
|
|
}
|
|
if (recurse && hasChildren(element) && element.children.length > 0) {
|
|
indexStack.unshift(0);
|
|
nodeStack.unshift(element.children);
|
|
}
|
|
}
|
|
}
|
|
function findOne(test, nodes, recurse = true) {
|
|
const searchedNodes = Array.isArray(nodes) ? nodes : [nodes];
|
|
for (const node2 of searchedNodes) {
|
|
if (isTag2(node2) && test(node2)) {
|
|
return node2;
|
|
}
|
|
if (recurse && hasChildren(node2) && node2.children.length > 0) {
|
|
const found = findOne(test, node2.children, true);
|
|
if (found)
|
|
return found;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function existsOne(test, nodes) {
|
|
return (Array.isArray(nodes) ? nodes : [nodes]).some((node2) => isTag2(node2) && test(node2) || hasChildren(node2) && existsOne(test, node2.children));
|
|
}
|
|
function findAll(test, nodes) {
|
|
const result = [];
|
|
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
|
|
const indexStack = [0];
|
|
for (;; ) {
|
|
if (indexStack[0] >= nodeStack[0].length) {
|
|
if (nodeStack.length === 1) {
|
|
return result;
|
|
}
|
|
nodeStack.shift();
|
|
indexStack.shift();
|
|
continue;
|
|
}
|
|
const element = nodeStack[0][indexStack[0]++];
|
|
if (isTag2(element) && test(element))
|
|
result.push(element);
|
|
if (hasChildren(element) && element.children.length > 0) {
|
|
indexStack.unshift(0);
|
|
nodeStack.unshift(element.children);
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/domutils/dist/legacy.js
|
|
var Checks = {
|
|
tag_name(name) {
|
|
if (typeof name === "function") {
|
|
return (element) => isTag2(element) && name(element.name);
|
|
}
|
|
if (name === "*") {
|
|
return isTag2;
|
|
}
|
|
return (element) => isTag2(element) && element.name === name;
|
|
},
|
|
tag_type(type) {
|
|
if (typeof type === "function") {
|
|
return (element) => type(element.type);
|
|
}
|
|
return (element) => element.type === type;
|
|
},
|
|
tag_contains(data) {
|
|
if (typeof data === "function") {
|
|
return (element) => isText(element) && data(element.data);
|
|
}
|
|
return (element) => isText(element) && element.data === data;
|
|
}
|
|
};
|
|
function getAttribCheck(attrib, value) {
|
|
if (typeof value === "function") {
|
|
return (element) => isTag2(element) && value(element.attribs[attrib]);
|
|
}
|
|
return (element) => isTag2(element) && element.attribs[attrib] === value;
|
|
}
|
|
function combineFuncs(a, b) {
|
|
return (element) => a(element) || b(element);
|
|
}
|
|
function compileTest(options) {
|
|
const funcs = Object.keys(options).map((key) => {
|
|
const value = options[key];
|
|
return Object.hasOwn(Checks, key) ? Checks[key](value) : getAttribCheck(key, value);
|
|
});
|
|
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
|
|
}
|
|
function testElement(options, node2) {
|
|
const test = compileTest(options);
|
|
return test ? test(node2) : true;
|
|
}
|
|
function getElements(options, nodes, recurse, limit = Number.POSITIVE_INFINITY) {
|
|
const test = compileTest(options);
|
|
return test ? filter(test, nodes, recurse, limit) : [];
|
|
}
|
|
function getElementById(id, nodes, recurse = true) {
|
|
if (!Array.isArray(nodes))
|
|
nodes = [nodes];
|
|
return findOne(getAttribCheck("id", id), nodes, recurse);
|
|
}
|
|
function getElementsByTagName(tagName, nodes, recurse = true, limit = Number.POSITIVE_INFINITY) {
|
|
return filter(Checks["tag_name"](tagName), nodes, recurse, limit);
|
|
}
|
|
function getElementsByClassName(className, nodes, recurse = true, limit = Number.POSITIVE_INFINITY) {
|
|
return filter(getAttribCheck("class", className), nodes, recurse, limit);
|
|
}
|
|
function getElementsByTagType(type, nodes, recurse = true, limit = Number.POSITIVE_INFINITY) {
|
|
return filter(Checks["tag_type"](type), nodes, recurse, limit);
|
|
}
|
|
|
|
// node_modules/entities/dist/escape.js
|
|
var xmlCodeMap = new Map([
|
|
[34, """],
|
|
[38, "&"],
|
|
[39, "'"],
|
|
[60, "<"],
|
|
[62, ">"]
|
|
]);
|
|
var getCodePoint = typeof String.prototype.codePointAt === "function" ? (input, index) => input.codePointAt(index) : (c, index) => (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index);
|
|
var XML_BITSET_VALUE = 1342177476;
|
|
function encodeXML(input) {
|
|
let out;
|
|
let last = 0;
|
|
const { length } = input;
|
|
for (let index = 0;index < length; index++) {
|
|
const char = input.charCodeAt(index);
|
|
if (char < 128 && ((XML_BITSET_VALUE >>> char & 1) === 0 || char >= 64 || char < 32)) {
|
|
continue;
|
|
}
|
|
if (out === undefined)
|
|
out = input.substring(0, index);
|
|
else if (last !== index)
|
|
out += input.substring(last, index);
|
|
if (char < 64) {
|
|
out += xmlCodeMap.get(char);
|
|
last = index + 1;
|
|
continue;
|
|
}
|
|
const cp = getCodePoint(input, index);
|
|
out += `&#x${cp.toString(16)};`;
|
|
if (cp !== char)
|
|
index++;
|
|
last = index + 1;
|
|
}
|
|
if (out === undefined)
|
|
return input;
|
|
if (last < length)
|
|
out += input.substr(last);
|
|
return out;
|
|
}
|
|
function getEscaper(regex, map) {
|
|
return function escape(data) {
|
|
let match;
|
|
let lastIndex = 0;
|
|
let result = "";
|
|
while (match = regex.exec(data)) {
|
|
if (lastIndex !== match.index) {
|
|
result += data.substring(lastIndex, match.index);
|
|
}
|
|
result += map.get(match[0].charCodeAt(0));
|
|
lastIndex = match.index + 1;
|
|
}
|
|
return result + data.substring(lastIndex);
|
|
};
|
|
}
|
|
var escapeAttribute = /* @__PURE__ */ getEscaper(/["&\u00A0]/g, new Map([
|
|
[34, """],
|
|
[38, "&"],
|
|
[160, " "]
|
|
]));
|
|
var escapeText = /* @__PURE__ */ getEscaper(/[&<>\u00A0]/g, new Map([
|
|
[38, "&"],
|
|
[60, "<"],
|
|
[62, ">"],
|
|
[160, " "]
|
|
]));
|
|
|
|
// node_modules/entities/dist/index.js
|
|
var EntityLevel;
|
|
(function(EntityLevel2) {
|
|
EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
|
|
EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
|
|
})(EntityLevel || (EntityLevel = {}));
|
|
var EncodingMode;
|
|
(function(EncodingMode2) {
|
|
EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
|
|
EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
|
|
EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
|
|
EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
|
|
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
|
|
})(EncodingMode || (EncodingMode = {}));
|
|
|
|
// node_modules/dom-serializer/dist/foreign-names.js
|
|
var elementNames = new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map((name) => [name.toLowerCase(), name]));
|
|
var attributeNames = new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map((name) => [name.toLowerCase(), name]));
|
|
|
|
// node_modules/dom-serializer/dist/index.js
|
|
var unencodedElements = new Set("style script xmp iframe noembed noframes plaintext noscript".split(" "));
|
|
var voidElements2 = new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" "));
|
|
var foreignElements = new Set(["svg", "math"]);
|
|
var foreignModeIntegrationPoints = new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" "));
|
|
function render(node2, options = {}) {
|
|
const nodes = "length" in node2 ? node2 : [node2];
|
|
const xmlMode = options.xmlMode ?? false;
|
|
let output = "";
|
|
for (let index = 0;index < nodes.length; index++) {
|
|
output += renderNode(nodes[index], options, xmlMode);
|
|
}
|
|
return output;
|
|
}
|
|
var dist_default = render;
|
|
function renderChildren(children, options, xmlMode) {
|
|
let output = "";
|
|
for (let index = 0;index < children.length; index++) {
|
|
output += renderNode(children[index], options, xmlMode);
|
|
}
|
|
return output;
|
|
}
|
|
function renderNode(node2, options, xmlMode) {
|
|
switch (node2.type) {
|
|
case Root: {
|
|
return renderChildren(node2.children, options, xmlMode);
|
|
}
|
|
case Directive: {
|
|
return `<${node2.data}>`;
|
|
}
|
|
case Comment: {
|
|
return `<!--${node2.data}-->`;
|
|
}
|
|
case CDATA: {
|
|
return `<![CDATA[${node2.children[0].data}]]>`;
|
|
}
|
|
case Script:
|
|
case Style:
|
|
case Tag: {
|
|
return renderTag(node2, options, xmlMode);
|
|
}
|
|
case Text: {
|
|
const element = node2;
|
|
const data = element.data || "";
|
|
if ((options.encodeEntities ?? options.decodeEntities) !== false && !(!xmlMode && element.parent && unencodedElements.has(element.parent.name))) {
|
|
return xmlMode || options.encodeEntities !== "utf8" ? encodeXML(data) : escapeText(data);
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
}
|
|
function renderTag(element, options, xmlMode) {
|
|
if (xmlMode === "foreign") {
|
|
element.name = elementNames.get(element.name) ?? element.name;
|
|
if (element.parent && foreignModeIntegrationPoints.has(element.parent.name)) {
|
|
xmlMode = false;
|
|
}
|
|
}
|
|
if (!xmlMode && foreignElements.has(element.name)) {
|
|
xmlMode = "foreign";
|
|
}
|
|
const { name, children } = element;
|
|
const isVoid = !xmlMode && voidElements2.has(name);
|
|
let tag = `<${name}${formatAttributes(element.attribs, options, xmlMode)}`;
|
|
if (children.length === 0 && (xmlMode ? options.selfClosingTags !== false : options.selfClosingTags && isVoid)) {
|
|
tag += xmlMode ? "/>" : " />";
|
|
} else {
|
|
tag += ">";
|
|
if (children.length > 0) {
|
|
tag += renderChildren(children, options, xmlMode);
|
|
}
|
|
if (!isVoid) {
|
|
tag += `</${name}>`;
|
|
}
|
|
}
|
|
return tag;
|
|
}
|
|
function replaceQuotes(value) {
|
|
return value.replaceAll('"', """);
|
|
}
|
|
function formatAttributes(attributes, options, xmlMode) {
|
|
if (!attributes)
|
|
return "";
|
|
const encode = (options.encodeEntities ?? options.decodeEntities) === false ? replaceQuotes : xmlMode || options.encodeEntities !== "utf8" ? encodeXML : escapeAttribute;
|
|
const isForeign = xmlMode === "foreign";
|
|
const showEmpty = !!(options.emptyAttrs ?? xmlMode);
|
|
let result = "";
|
|
for (const key in attributes) {
|
|
if (!Object.hasOwn(attributes, key))
|
|
continue;
|
|
const value = attributes[key];
|
|
const k = isForeign ? attributeNames.get(key) ?? key : key;
|
|
result += !showEmpty && (value == null || value === "") ? ` ${k}` : ` ${k}="${encode(value == null ? "" : String(value))}"`;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// node_modules/domutils/dist/stringify.js
|
|
function getOuterHTML(node2, options) {
|
|
return dist_default(node2, options);
|
|
}
|
|
function getInnerHTML(node2, options) {
|
|
return hasChildren(node2) ? node2.children.map((node3) => getOuterHTML(node3, options)).join("") : "";
|
|
}
|
|
function getText(node2) {
|
|
if (Array.isArray(node2))
|
|
return node2.map(getText).join("");
|
|
if (isTag2(node2))
|
|
return node2.name === "br" ? `
|
|
` : getText(node2.children);
|
|
if (isCDATA(node2))
|
|
return getText(node2.children);
|
|
if (isText(node2))
|
|
return node2.data;
|
|
return "";
|
|
}
|
|
function textContent(node2) {
|
|
if (Array.isArray(node2))
|
|
return node2.map(textContent).join("");
|
|
if (hasChildren(node2) && !isComment(node2)) {
|
|
return textContent(node2.children);
|
|
}
|
|
if (isText(node2))
|
|
return node2.data;
|
|
return "";
|
|
}
|
|
function innerText(node2) {
|
|
if (Array.isArray(node2))
|
|
return node2.map(innerText).join("");
|
|
if (hasChildren(node2) && (node2.type === ElementType.Tag || isCDATA(node2))) {
|
|
return innerText(node2.children);
|
|
}
|
|
if (isText(node2))
|
|
return node2.data;
|
|
return "";
|
|
}
|
|
|
|
// node_modules/domutils/dist/feeds.js
|
|
function getFeed(document) {
|
|
const feedRoot = getOneElement(isValidFeed, document);
|
|
return feedRoot ? feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot) : null;
|
|
}
|
|
function getAtomFeed(feedRoot) {
|
|
const childs = feedRoot.children;
|
|
const feed = {
|
|
type: "atom",
|
|
items: getElementsByTagName("entry", childs).map((item) => {
|
|
const { children } = item;
|
|
const entry = { media: getMediaElements(children) };
|
|
addConditionally(entry, "id", "id", children);
|
|
addConditionally(entry, "title", "title", children);
|
|
const href2 = getOneElement("link", children)?.attribs["href"];
|
|
if (href2) {
|
|
entry.link = href2;
|
|
}
|
|
const description = fetch("summary", children) || fetch("content", children);
|
|
if (description) {
|
|
entry.description = description;
|
|
}
|
|
const pubDate = fetch("updated", children);
|
|
if (pubDate) {
|
|
entry.pubDate = new Date(pubDate);
|
|
}
|
|
return entry;
|
|
})
|
|
};
|
|
addConditionally(feed, "id", "id", childs);
|
|
addConditionally(feed, "title", "title", childs);
|
|
const href = getOneElement("link", childs)?.attribs["href"];
|
|
if (href) {
|
|
feed.link = href;
|
|
}
|
|
addConditionally(feed, "description", "subtitle", childs);
|
|
const updated = fetch("updated", childs);
|
|
if (updated) {
|
|
feed.updated = new Date(updated);
|
|
}
|
|
addConditionally(feed, "author", "email", childs, true);
|
|
return feed;
|
|
}
|
|
function getRssFeed(feedRoot) {
|
|
const childs = getOneElement("channel", feedRoot.children)?.children ?? [];
|
|
const feed = {
|
|
type: feedRoot.name.substr(0, 3),
|
|
id: "",
|
|
items: getElementsByTagName("item", feedRoot.children).map((item) => {
|
|
const { children } = item;
|
|
const entry = { media: getMediaElements(children) };
|
|
addConditionally(entry, "id", "guid", children);
|
|
addConditionally(entry, "title", "title", children);
|
|
addConditionally(entry, "link", "link", children);
|
|
addConditionally(entry, "description", "description", children);
|
|
const pubDate = fetch("pubDate", children) || fetch("dc:date", children);
|
|
if (pubDate)
|
|
entry.pubDate = new Date(pubDate);
|
|
return entry;
|
|
})
|
|
};
|
|
addConditionally(feed, "title", "title", childs);
|
|
addConditionally(feed, "link", "link", childs);
|
|
addConditionally(feed, "description", "description", childs);
|
|
const updated = fetch("lastBuildDate", childs);
|
|
if (updated) {
|
|
feed.updated = new Date(updated);
|
|
}
|
|
addConditionally(feed, "author", "managingEditor", childs, true);
|
|
return feed;
|
|
}
|
|
var MEDIA_KEYS_STRING = ["url", "type", "lang"];
|
|
var MEDIA_KEYS_INT = [
|
|
"fileSize",
|
|
"bitrate",
|
|
"framerate",
|
|
"samplingrate",
|
|
"channels",
|
|
"duration",
|
|
"height",
|
|
"width"
|
|
];
|
|
function getMediaElements(where) {
|
|
return getElementsByTagName("media:content", where).map((element) => {
|
|
const { attribs } = element;
|
|
const media = {
|
|
medium: attribs["medium"],
|
|
isDefault: !!attribs["isDefault"]
|
|
};
|
|
for (const attrib of MEDIA_KEYS_STRING) {
|
|
if (attribs[attrib]) {
|
|
media[attrib] = attribs[attrib];
|
|
}
|
|
}
|
|
for (const attrib of MEDIA_KEYS_INT) {
|
|
if (attribs[attrib]) {
|
|
media[attrib] = Number.parseInt(attribs[attrib], 10);
|
|
}
|
|
}
|
|
if (attribs["expression"]) {
|
|
media.expression = attribs["expression"];
|
|
}
|
|
return media;
|
|
});
|
|
}
|
|
function getOneElement(tagName, node2) {
|
|
return getElementsByTagName(tagName, node2, true, 1)[0];
|
|
}
|
|
function fetch(tagName, where, recurse = false) {
|
|
return textContent(getElementsByTagName(tagName, where, recurse, 1)).trim();
|
|
}
|
|
function addConditionally(object, property, tagName, where, recurse = false) {
|
|
const value = fetch(tagName, where, recurse);
|
|
if (value)
|
|
object[property] = value;
|
|
}
|
|
function isValidFeed(value) {
|
|
return value === "rss" || value === "feed" || value === "rdf:RDF";
|
|
}
|
|
// node_modules/domutils/dist/helpers.js
|
|
function removeSubsets(nodes) {
|
|
let index = nodes.length;
|
|
while (--index >= 0) {
|
|
const node2 = nodes[index];
|
|
if (index > 0 && nodes.lastIndexOf(node2, index - 1) >= 0) {
|
|
nodes.splice(index, 1);
|
|
continue;
|
|
}
|
|
for (let ancestor = node2.parent;ancestor; ancestor = ancestor.parent) {
|
|
if (nodes.includes(ancestor)) {
|
|
nodes.splice(index, 1);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return nodes;
|
|
}
|
|
var DocumentPosition;
|
|
(function(DocumentPosition2) {
|
|
DocumentPosition2[DocumentPosition2["DISCONNECTED"] = 1] = "DISCONNECTED";
|
|
DocumentPosition2[DocumentPosition2["PRECEDING"] = 2] = "PRECEDING";
|
|
DocumentPosition2[DocumentPosition2["FOLLOWING"] = 4] = "FOLLOWING";
|
|
DocumentPosition2[DocumentPosition2["CONTAINS"] = 8] = "CONTAINS";
|
|
DocumentPosition2[DocumentPosition2["CONTAINED_BY"] = 16] = "CONTAINED_BY";
|
|
})(DocumentPosition || (DocumentPosition = {}));
|
|
function compareDocumentPosition(nodeA, nodeB) {
|
|
const aParents = [];
|
|
const bParents = [];
|
|
if (nodeA === nodeB) {
|
|
return 0;
|
|
}
|
|
let current = hasChildren(nodeA) ? nodeA : nodeA.parent;
|
|
while (current) {
|
|
aParents.unshift(current);
|
|
current = current.parent;
|
|
}
|
|
current = hasChildren(nodeB) ? nodeB : nodeB.parent;
|
|
while (current) {
|
|
bParents.unshift(current);
|
|
current = current.parent;
|
|
}
|
|
const maxIndex = Math.min(aParents.length, bParents.length);
|
|
let index = 0;
|
|
while (index < maxIndex && aParents[index] === bParents[index]) {
|
|
index++;
|
|
}
|
|
if (index === 0) {
|
|
return DocumentPosition.DISCONNECTED;
|
|
}
|
|
const sharedParent = aParents[index - 1];
|
|
const siblings = sharedParent.children;
|
|
const aSibling = aParents[index];
|
|
const bSibling = bParents[index];
|
|
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
|
|
if (sharedParent === nodeB) {
|
|
return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;
|
|
}
|
|
return DocumentPosition.FOLLOWING;
|
|
}
|
|
if (sharedParent === nodeA) {
|
|
return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;
|
|
}
|
|
return DocumentPosition.PRECEDING;
|
|
}
|
|
function uniqueSort(nodes) {
|
|
nodes = nodes.filter((node2, index, array) => !array.includes(node2, index + 1));
|
|
nodes.sort((a, b) => {
|
|
const relative = compareDocumentPosition(a, b);
|
|
if (relative & DocumentPosition.PRECEDING) {
|
|
return -1;
|
|
}
|
|
if (relative & DocumentPosition.FOLLOWING) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
});
|
|
return nodes;
|
|
}
|
|
// node_modules/domutils/dist/manipulation.js
|
|
function removeElement(element) {
|
|
if (element.prev)
|
|
element.prev.next = element.next;
|
|
if (element.next)
|
|
element.next.prev = element.prev;
|
|
if (element.parent) {
|
|
const childs = element.parent.children;
|
|
const childsIndex = childs.lastIndexOf(element);
|
|
if (childsIndex !== -1) {
|
|
childs.splice(childsIndex, 1);
|
|
}
|
|
}
|
|
element.next = null;
|
|
element.prev = null;
|
|
element.parent = null;
|
|
}
|
|
function replaceElement(element, replacement) {
|
|
replacement.prev = element.prev;
|
|
if (replacement.prev) {
|
|
replacement.prev.next = replacement;
|
|
}
|
|
replacement.next = element.next;
|
|
if (replacement.next) {
|
|
replacement.next.prev = replacement;
|
|
}
|
|
replacement.parent = element.parent;
|
|
if (replacement.parent) {
|
|
const { children } = replacement.parent;
|
|
const elementIndex = children.lastIndexOf(element);
|
|
if (elementIndex === -1) {
|
|
return;
|
|
}
|
|
children[elementIndex] = replacement;
|
|
element.parent = null;
|
|
}
|
|
}
|
|
function appendChild(parent, child) {
|
|
removeElement(child);
|
|
child.next = null;
|
|
child.parent = parent;
|
|
if (parent.children.push(child) > 1) {
|
|
const sibling = parent.children[parent.children.length - 2];
|
|
sibling.next = child;
|
|
child.prev = sibling;
|
|
} else {
|
|
child.prev = null;
|
|
}
|
|
}
|
|
function append(element, next) {
|
|
removeElement(next);
|
|
const { parent } = element;
|
|
const currentNext = element.next;
|
|
next.next = currentNext;
|
|
next.prev = element;
|
|
element.next = next;
|
|
next.parent = parent;
|
|
if (currentNext) {
|
|
currentNext.prev = next;
|
|
if (parent) {
|
|
const childs = parent.children;
|
|
childs.splice(childs.lastIndexOf(currentNext), 0, next);
|
|
}
|
|
} else if (parent) {
|
|
parent.children.push(next);
|
|
}
|
|
}
|
|
function prependChild(parent, child) {
|
|
removeElement(child);
|
|
child.parent = parent;
|
|
child.prev = null;
|
|
if (parent.children.unshift(child) === 1) {
|
|
child.next = null;
|
|
} else {
|
|
const sibling = parent.children[1];
|
|
sibling.prev = child;
|
|
child.next = sibling;
|
|
}
|
|
}
|
|
function prepend(element, previous) {
|
|
removeElement(previous);
|
|
const { parent } = element;
|
|
if (parent) {
|
|
const childs = parent.children;
|
|
childs.splice(childs.indexOf(element), 0, previous);
|
|
}
|
|
if (element.prev) {
|
|
element.prev.next = previous;
|
|
}
|
|
previous.parent = parent;
|
|
previous.prev = element.prev;
|
|
previous.next = element;
|
|
element.prev = previous;
|
|
}
|
|
// node_modules/domutils/dist/traversal.js
|
|
function getChildren(element) {
|
|
return hasChildren(element) ? element.children : [];
|
|
}
|
|
function getParent(element) {
|
|
return element.parent || null;
|
|
}
|
|
function getSiblings(element) {
|
|
const parent = getParent(element);
|
|
if (parent != null)
|
|
return getChildren(parent);
|
|
const siblings = [element];
|
|
let { prev, next } = element;
|
|
while (prev != null) {
|
|
siblings.unshift(prev);
|
|
({ prev } = prev);
|
|
}
|
|
while (next != null) {
|
|
siblings.push(next);
|
|
({ next } = next);
|
|
}
|
|
return siblings;
|
|
}
|
|
function getAttributeValue(element, name) {
|
|
const { attribs } = element;
|
|
return attribs?.[name];
|
|
}
|
|
function hasAttrib(element, name) {
|
|
const { attribs } = element;
|
|
return attribs != null && Object.hasOwn(attribs, name) && attribs[name] != null;
|
|
}
|
|
function getName(element) {
|
|
return element.name;
|
|
}
|
|
function nextElementSibling(element) {
|
|
let { next } = element;
|
|
while (next !== null && !isTag2(next))
|
|
({ next } = next);
|
|
return next;
|
|
}
|
|
function prevElementSibling(element) {
|
|
let { prev } = element;
|
|
while (prev !== null && !isTag2(prev))
|
|
({ prev } = prev);
|
|
return prev;
|
|
}
|
|
// node_modules/htmlparser2/dist/index.js
|
|
function parseDocument(data, options) {
|
|
const handler = new DomHandler(undefined, options);
|
|
new Parser(handler, options).end(data);
|
|
return handler.root;
|
|
}
|
|
function createDocumentStream(callback, options, elementCallback) {
|
|
const handler = new DomHandler((error) => callback(error, handler.root), options, elementCallback);
|
|
return new Parser(handler, options);
|
|
}
|
|
var parseFeedDefaultOptions = { xmlMode: true };
|
|
function parseFeed(feed, options = parseFeedDefaultOptions) {
|
|
return getFeed(parseDocument(feed, options).children);
|
|
}
|
|
// node_modules/css-select/dist/index.js
|
|
var exports_dist5 = {};
|
|
__export(exports_dist5, {
|
|
selectOne: () => selectOne,
|
|
selectAll: () => selectAll,
|
|
prepareContext: () => prepareContext,
|
|
is: () => is2,
|
|
default: () => dist_default2,
|
|
compile: () => compile2,
|
|
_compileUnsafe: () => _compileUnsafe
|
|
});
|
|
|
|
// node_modules/boolbase/dist/index.js
|
|
function trueFunc() {
|
|
return true;
|
|
}
|
|
function falseFunc() {
|
|
return false;
|
|
}
|
|
|
|
// node_modules/css-what/dist/types.js
|
|
var SelectorType;
|
|
(function(SelectorType2) {
|
|
SelectorType2["Attribute"] = "attribute";
|
|
SelectorType2["Pseudo"] = "pseudo";
|
|
SelectorType2["PseudoElement"] = "pseudo-element";
|
|
SelectorType2["Tag"] = "tag";
|
|
SelectorType2["Universal"] = "universal";
|
|
SelectorType2["Adjacent"] = "adjacent";
|
|
SelectorType2["Child"] = "child";
|
|
SelectorType2["Descendant"] = "descendant";
|
|
SelectorType2["Parent"] = "parent";
|
|
SelectorType2["Sibling"] = "sibling";
|
|
SelectorType2["ColumnCombinator"] = "column-combinator";
|
|
})(SelectorType || (SelectorType = {}));
|
|
var AttributeAction;
|
|
(function(AttributeAction2) {
|
|
AttributeAction2["Any"] = "any";
|
|
AttributeAction2["Element"] = "element";
|
|
AttributeAction2["End"] = "end";
|
|
AttributeAction2["Equals"] = "equals";
|
|
AttributeAction2["Exists"] = "exists";
|
|
AttributeAction2["Hyphen"] = "hyphen";
|
|
AttributeAction2["Not"] = "not";
|
|
AttributeAction2["Start"] = "start";
|
|
})(AttributeAction || (AttributeAction = {}));
|
|
|
|
// node_modules/css-what/dist/parse.js
|
|
var reName = /^[^#\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\u00B0-\uFFFF-])+/;
|
|
var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
|
|
var CharCode;
|
|
(function(CharCode2) {
|
|
CharCode2[CharCode2["LeftParenthesis"] = 40] = "LeftParenthesis";
|
|
CharCode2[CharCode2["RightParenthesis"] = 41] = "RightParenthesis";
|
|
CharCode2[CharCode2["LeftSquareBracket"] = 91] = "LeftSquareBracket";
|
|
CharCode2[CharCode2["RightSquareBracket"] = 93] = "RightSquareBracket";
|
|
CharCode2[CharCode2["Comma"] = 44] = "Comma";
|
|
CharCode2[CharCode2["Period"] = 46] = "Period";
|
|
CharCode2[CharCode2["Colon"] = 58] = "Colon";
|
|
CharCode2[CharCode2["SingleQuote"] = 39] = "SingleQuote";
|
|
CharCode2[CharCode2["DoubleQuote"] = 34] = "DoubleQuote";
|
|
CharCode2[CharCode2["Plus"] = 43] = "Plus";
|
|
CharCode2[CharCode2["Tilde"] = 126] = "Tilde";
|
|
CharCode2[CharCode2["QuestionMark"] = 63] = "QuestionMark";
|
|
CharCode2[CharCode2["ExclamationMark"] = 33] = "ExclamationMark";
|
|
CharCode2[CharCode2["Slash"] = 47] = "Slash";
|
|
CharCode2[CharCode2["Equal"] = 61] = "Equal";
|
|
CharCode2[CharCode2["Dollar"] = 36] = "Dollar";
|
|
CharCode2[CharCode2["Pipe"] = 124] = "Pipe";
|
|
CharCode2[CharCode2["Circumflex"] = 94] = "Circumflex";
|
|
CharCode2[CharCode2["Asterisk"] = 42] = "Asterisk";
|
|
CharCode2[CharCode2["GreaterThan"] = 62] = "GreaterThan";
|
|
CharCode2[CharCode2["LessThan"] = 60] = "LessThan";
|
|
CharCode2[CharCode2["Hash"] = 35] = "Hash";
|
|
CharCode2[CharCode2["LowerI"] = 105] = "LowerI";
|
|
CharCode2[CharCode2["LowerS"] = 115] = "LowerS";
|
|
CharCode2[CharCode2["BackSlash"] = 92] = "BackSlash";
|
|
CharCode2[CharCode2["Space"] = 32] = "Space";
|
|
CharCode2[CharCode2["Tab"] = 9] = "Tab";
|
|
CharCode2[CharCode2["NewLine"] = 10] = "NewLine";
|
|
CharCode2[CharCode2["FormFeed"] = 12] = "FormFeed";
|
|
CharCode2[CharCode2["CarriageReturn"] = 13] = "CarriageReturn";
|
|
})(CharCode || (CharCode = {}));
|
|
var actionTypes = new Map([
|
|
[CharCode.Tilde, AttributeAction.Element],
|
|
[CharCode.Circumflex, AttributeAction.Start],
|
|
[CharCode.Dollar, AttributeAction.End],
|
|
[CharCode.Asterisk, AttributeAction.Any],
|
|
[CharCode.ExclamationMark, AttributeAction.Not],
|
|
[CharCode.Pipe, AttributeAction.Hyphen]
|
|
]);
|
|
var unpackPseudos = new Set([
|
|
"has",
|
|
"not",
|
|
"matches",
|
|
"is",
|
|
"where",
|
|
"host",
|
|
"host-context"
|
|
]);
|
|
var pseudosToPseudoElements = new Set([
|
|
"before",
|
|
"after",
|
|
"first-line",
|
|
"first-letter"
|
|
]);
|
|
function isTraversal(selector) {
|
|
switch (selector.type) {
|
|
case SelectorType.Adjacent:
|
|
case SelectorType.Child:
|
|
case SelectorType.Descendant:
|
|
case SelectorType.Parent:
|
|
case SelectorType.Sibling:
|
|
case SelectorType.ColumnCombinator: {
|
|
return true;
|
|
}
|
|
case SelectorType.Attribute:
|
|
case SelectorType.Pseudo:
|
|
case SelectorType.PseudoElement:
|
|
case SelectorType.Tag:
|
|
case SelectorType.Universal: {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
var stripQuotesFromPseudos = new Set(["contains", "icontains"]);
|
|
function funescape(_, escaped, escapedWhitespace) {
|
|
const high = Number.parseInt(escaped, 16) - 65536;
|
|
return Number.isNaN(high) || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
|
|
}
|
|
function unescapeCSS(cssString) {
|
|
return cssString.replace(reEscape, funescape);
|
|
}
|
|
function isQuote(c) {
|
|
return c === CharCode.SingleQuote || c === CharCode.DoubleQuote;
|
|
}
|
|
function isWhitespace2(c) {
|
|
return c === CharCode.Space || c === CharCode.Tab || c === CharCode.NewLine || c === CharCode.FormFeed || c === CharCode.CarriageReturn;
|
|
}
|
|
function parse(selector) {
|
|
const subselects = [];
|
|
const endIndex = parseSelector(subselects, `${selector}`, 0);
|
|
if (endIndex < selector.length) {
|
|
throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);
|
|
}
|
|
return subselects;
|
|
}
|
|
function parseSelector(subselects, selector, selectorIndex) {
|
|
let tokens = [];
|
|
function getName2(offset) {
|
|
const match = selector.slice(selectorIndex + offset).match(reName);
|
|
if (!match) {
|
|
throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
|
|
}
|
|
const [name] = match;
|
|
selectorIndex += offset + name.length;
|
|
return unescapeCSS(name);
|
|
}
|
|
function stripWhitespace(offset) {
|
|
selectorIndex += offset;
|
|
while (selectorIndex < selector.length && isWhitespace2(selector.charCodeAt(selectorIndex))) {
|
|
selectorIndex++;
|
|
}
|
|
}
|
|
function readValueWithParenthesis() {
|
|
selectorIndex += 1;
|
|
const start = selectorIndex;
|
|
for (let counter = 1;selectorIndex < selector.length; selectorIndex++) {
|
|
switch (selector.charCodeAt(selectorIndex)) {
|
|
case CharCode.BackSlash: {
|
|
selectorIndex += 1;
|
|
break;
|
|
}
|
|
case CharCode.LeftParenthesis: {
|
|
counter += 1;
|
|
break;
|
|
}
|
|
case CharCode.RightParenthesis: {
|
|
counter -= 1;
|
|
if (counter === 0) {
|
|
return unescapeCSS(selector.slice(start, selectorIndex++));
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
throw new Error("Parenthesis not matched");
|
|
}
|
|
function ensureNotTraversal() {
|
|
if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
|
|
throw new Error("Did not expect successive traversals.");
|
|
}
|
|
}
|
|
function addTraversal(type) {
|
|
if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
|
|
tokens[tokens.length - 1].type = type;
|
|
return;
|
|
}
|
|
ensureNotTraversal();
|
|
tokens.push({ type });
|
|
}
|
|
function addSpecialAttribute(name, action) {
|
|
tokens.push({
|
|
type: SelectorType.Attribute,
|
|
name,
|
|
action,
|
|
value: getName2(1),
|
|
namespace: null,
|
|
ignoreCase: "quirks"
|
|
});
|
|
}
|
|
function finalizeSubselector() {
|
|
if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
|
|
tokens.pop();
|
|
}
|
|
if (tokens.length === 0) {
|
|
throw new Error("Empty sub-selector");
|
|
}
|
|
subselects.push(tokens);
|
|
}
|
|
stripWhitespace(0);
|
|
if (selector.length === selectorIndex) {
|
|
return selectorIndex;
|
|
}
|
|
loop:
|
|
while (selectorIndex < selector.length) {
|
|
const firstChar = selector.charCodeAt(selectorIndex);
|
|
switch (firstChar) {
|
|
case CharCode.Space:
|
|
case CharCode.Tab:
|
|
case CharCode.NewLine:
|
|
case CharCode.FormFeed:
|
|
case CharCode.CarriageReturn: {
|
|
if (tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) {
|
|
ensureNotTraversal();
|
|
tokens.push({ type: SelectorType.Descendant });
|
|
}
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.GreaterThan: {
|
|
addTraversal(SelectorType.Child);
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.LessThan: {
|
|
addTraversal(SelectorType.Parent);
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.Tilde: {
|
|
addTraversal(SelectorType.Sibling);
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.Plus: {
|
|
addTraversal(SelectorType.Adjacent);
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.Period: {
|
|
addSpecialAttribute("class", AttributeAction.Element);
|
|
break;
|
|
}
|
|
case CharCode.Hash: {
|
|
addSpecialAttribute("id", AttributeAction.Equals);
|
|
break;
|
|
}
|
|
case CharCode.LeftSquareBracket: {
|
|
stripWhitespace(1);
|
|
let name;
|
|
let namespace = null;
|
|
if (selector.charCodeAt(selectorIndex) === CharCode.Pipe) {
|
|
name = getName2(1);
|
|
} else if (selector.startsWith("*|", selectorIndex)) {
|
|
namespace = "*";
|
|
name = getName2(2);
|
|
} else {
|
|
name = getName2(0);
|
|
if (selector.charCodeAt(selectorIndex) === CharCode.Pipe && selector.charCodeAt(selectorIndex + 1) !== CharCode.Equal) {
|
|
namespace = name;
|
|
name = getName2(1);
|
|
}
|
|
}
|
|
stripWhitespace(0);
|
|
let action = AttributeAction.Exists;
|
|
const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));
|
|
if (possibleAction) {
|
|
action = possibleAction;
|
|
if (selector.charCodeAt(selectorIndex + 1) !== CharCode.Equal) {
|
|
throw new Error("Expected `=`");
|
|
}
|
|
stripWhitespace(2);
|
|
} else if (selector.charCodeAt(selectorIndex) === CharCode.Equal) {
|
|
action = AttributeAction.Equals;
|
|
stripWhitespace(1);
|
|
}
|
|
let value = "";
|
|
let ignoreCase = null;
|
|
if (action !== "exists") {
|
|
if (isQuote(selector.charCodeAt(selectorIndex))) {
|
|
const quote = selector.charCodeAt(selectorIndex);
|
|
selectorIndex += 1;
|
|
const sectionStart = selectorIndex;
|
|
while (selectorIndex < selector.length && selector.charCodeAt(selectorIndex) !== quote) {
|
|
selectorIndex += selector.charCodeAt(selectorIndex) === CharCode.BackSlash ? 2 : 1;
|
|
}
|
|
if (selector.charCodeAt(selectorIndex) !== quote) {
|
|
throw new Error("Attribute value didn't end");
|
|
}
|
|
value = unescapeCSS(selector.slice(sectionStart, selectorIndex));
|
|
selectorIndex += 1;
|
|
} else {
|
|
const valueStart = selectorIndex;
|
|
while (selectorIndex < selector.length && !isWhitespace2(selector.charCodeAt(selectorIndex)) && selector.charCodeAt(selectorIndex) !== CharCode.RightSquareBracket) {
|
|
selectorIndex += selector.charCodeAt(selectorIndex) === CharCode.BackSlash ? 2 : 1;
|
|
}
|
|
value = unescapeCSS(selector.slice(valueStart, selectorIndex));
|
|
}
|
|
stripWhitespace(0);
|
|
switch (selector.charCodeAt(selectorIndex) | 32) {
|
|
case CharCode.LowerI: {
|
|
ignoreCase = true;
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
case CharCode.LowerS: {
|
|
ignoreCase = false;
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (selector.charCodeAt(selectorIndex) !== CharCode.RightSquareBracket) {
|
|
throw new Error("Attribute selector didn't terminate");
|
|
}
|
|
selectorIndex += 1;
|
|
const attributeSelector = {
|
|
type: SelectorType.Attribute,
|
|
name,
|
|
action,
|
|
value,
|
|
namespace,
|
|
ignoreCase
|
|
};
|
|
tokens.push(attributeSelector);
|
|
break;
|
|
}
|
|
case CharCode.Colon: {
|
|
if (selector.charCodeAt(selectorIndex + 1) === CharCode.Colon) {
|
|
tokens.push({
|
|
type: SelectorType.PseudoElement,
|
|
name: getName2(2).toLowerCase(),
|
|
data: selector.charCodeAt(selectorIndex) === CharCode.LeftParenthesis ? readValueWithParenthesis() : null
|
|
});
|
|
break;
|
|
}
|
|
const name = getName2(1).toLowerCase();
|
|
if (pseudosToPseudoElements.has(name)) {
|
|
tokens.push({
|
|
type: SelectorType.PseudoElement,
|
|
name,
|
|
data: null
|
|
});
|
|
break;
|
|
}
|
|
let data = null;
|
|
if (selector.charCodeAt(selectorIndex) === CharCode.LeftParenthesis) {
|
|
if (unpackPseudos.has(name)) {
|
|
if (isQuote(selector.charCodeAt(selectorIndex + 1))) {
|
|
throw new Error(`Pseudo-selector ${name} cannot be quoted`);
|
|
}
|
|
data = [];
|
|
selectorIndex = parseSelector(data, selector, selectorIndex + 1);
|
|
if (selector.charCodeAt(selectorIndex) !== CharCode.RightParenthesis) {
|
|
throw new Error(`Missing closing parenthesis in :${name} (${selector})`);
|
|
}
|
|
selectorIndex += 1;
|
|
} else {
|
|
data = readValueWithParenthesis();
|
|
if (stripQuotesFromPseudos.has(name)) {
|
|
const quot = data.charCodeAt(0);
|
|
if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) {
|
|
data = data.slice(1, -1);
|
|
}
|
|
}
|
|
data = unescapeCSS(data);
|
|
}
|
|
}
|
|
tokens.push({ type: SelectorType.Pseudo, name, data });
|
|
break;
|
|
}
|
|
case CharCode.Comma: {
|
|
finalizeSubselector();
|
|
tokens = [];
|
|
stripWhitespace(1);
|
|
break;
|
|
}
|
|
default: {
|
|
if (selector.startsWith("/*", selectorIndex)) {
|
|
const endIndex = selector.indexOf("*/", selectorIndex + 2);
|
|
if (endIndex === -1) {
|
|
throw new Error("Comment was not terminated");
|
|
}
|
|
selectorIndex = endIndex + 2;
|
|
if (tokens.length === 0) {
|
|
stripWhitespace(0);
|
|
}
|
|
break;
|
|
}
|
|
let namespace = null;
|
|
let name;
|
|
if (firstChar === CharCode.Asterisk) {
|
|
selectorIndex += 1;
|
|
name = "*";
|
|
} else if (firstChar === CharCode.Pipe) {
|
|
name = "";
|
|
if (selector.charCodeAt(selectorIndex + 1) === CharCode.Pipe) {
|
|
addTraversal(SelectorType.ColumnCombinator);
|
|
stripWhitespace(2);
|
|
break;
|
|
}
|
|
} else if (reName.test(selector.slice(selectorIndex))) {
|
|
name = getName2(0);
|
|
} else {
|
|
break loop;
|
|
}
|
|
if (selector.charCodeAt(selectorIndex) === CharCode.Pipe && selector.charCodeAt(selectorIndex + 1) !== CharCode.Pipe) {
|
|
namespace = name;
|
|
if (selector.charCodeAt(selectorIndex + 1) === CharCode.Asterisk) {
|
|
name = "*";
|
|
selectorIndex += 2;
|
|
} else {
|
|
name = getName2(1);
|
|
}
|
|
}
|
|
tokens.push(name === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name, namespace });
|
|
}
|
|
}
|
|
}
|
|
finalizeSubselector();
|
|
return selectorIndex;
|
|
}
|
|
// node_modules/css-select/dist/attributes.js
|
|
var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
|
var whitespaceRe = /\s/;
|
|
function escapeRegex(value) {
|
|
return value.replace(reChars, "\\$&");
|
|
}
|
|
var caseInsensitiveAttributes = new Set([
|
|
"accept",
|
|
"accept-charset",
|
|
"align",
|
|
"alink",
|
|
"axis",
|
|
"bgcolor",
|
|
"charset",
|
|
"checked",
|
|
"clear",
|
|
"codetype",
|
|
"color",
|
|
"compact",
|
|
"declare",
|
|
"defer",
|
|
"dir",
|
|
"direction",
|
|
"disabled",
|
|
"enctype",
|
|
"face",
|
|
"frame",
|
|
"hreflang",
|
|
"http-equiv",
|
|
"lang",
|
|
"language",
|
|
"link",
|
|
"media",
|
|
"method",
|
|
"multiple",
|
|
"nohref",
|
|
"noresize",
|
|
"noshade",
|
|
"nowrap",
|
|
"readonly",
|
|
"rel",
|
|
"rev",
|
|
"rules",
|
|
"scope",
|
|
"scrolling",
|
|
"selected",
|
|
"shape",
|
|
"target",
|
|
"text",
|
|
"type",
|
|
"valign",
|
|
"valuetype",
|
|
"vlink"
|
|
]);
|
|
function shouldIgnoreCase(selector, options) {
|
|
return typeof selector.ignoreCase === "boolean" ? selector.ignoreCase : selector.ignoreCase === "quirks" ? !!options.quirksMode : !options.xmlMode && caseInsensitiveAttributes.has(selector.name);
|
|
}
|
|
var attributeRules = {
|
|
equals(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name } = data;
|
|
let { value } = data;
|
|
if (shouldIgnoreCase(data, options)) {
|
|
value = value.toLowerCase();
|
|
return (element) => {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return attribute != null && attribute.length === value.length && attribute.toLowerCase() === value && next(element);
|
|
};
|
|
}
|
|
return (element) => adapter.getAttributeValue(element, name) === value && next(element);
|
|
},
|
|
hyphen(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name } = data;
|
|
let { value } = data;
|
|
const { length } = value;
|
|
if (shouldIgnoreCase(data, options)) {
|
|
value = value.toLowerCase();
|
|
return function hyphenIC(element) {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return attribute != null && (attribute.length === length || attribute.charAt(length) === "-") && attribute.substr(0, length).toLowerCase() === value && next(element);
|
|
};
|
|
}
|
|
return function hyphen(element) {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return attribute != null && (attribute.length === length || attribute.charAt(length) === "-") && attribute.substr(0, length) === value && next(element);
|
|
};
|
|
},
|
|
element(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name, value } = data;
|
|
if (whitespaceRe.test(value)) {
|
|
return falseFunc;
|
|
}
|
|
const regex = new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`, shouldIgnoreCase(data, options) ? "i" : "");
|
|
return function element(node2) {
|
|
const attribute = adapter.getAttributeValue(node2, name);
|
|
return attribute != null && attribute.length >= value.length && regex.test(attribute) && next(node2);
|
|
};
|
|
},
|
|
exists(next, { name }, { adapter }) {
|
|
return (element) => adapter.hasAttrib(element, name) && next(element);
|
|
},
|
|
start(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name } = data;
|
|
let { value } = data;
|
|
const { length } = value;
|
|
if (length === 0) {
|
|
return falseFunc;
|
|
}
|
|
if (shouldIgnoreCase(data, options)) {
|
|
value = value.toLowerCase();
|
|
return (element) => {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return attribute != null && attribute.length >= length && attribute.substr(0, length).toLowerCase() === value && next(element);
|
|
};
|
|
}
|
|
return (element) => !!adapter.getAttributeValue(element, name)?.startsWith(value) && next(element);
|
|
},
|
|
end(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name } = data;
|
|
let { value } = data;
|
|
const length = -value.length;
|
|
if (length === 0) {
|
|
return falseFunc;
|
|
}
|
|
if (shouldIgnoreCase(data, options)) {
|
|
value = value.toLowerCase();
|
|
return (element) => adapter.getAttributeValue(element, name)?.substr(length).toLowerCase() === value && next(element);
|
|
}
|
|
return (element) => !!adapter.getAttributeValue(element, name)?.endsWith(value) && next(element);
|
|
},
|
|
any(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name, value } = data;
|
|
if (value === "") {
|
|
return falseFunc;
|
|
}
|
|
if (shouldIgnoreCase(data, options)) {
|
|
const regex = new RegExp(escapeRegex(value), "i");
|
|
return function anyIC(element) {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return attribute != null && attribute.length >= value.length && regex.test(attribute) && next(element);
|
|
};
|
|
}
|
|
return (element) => !!adapter.getAttributeValue(element, name)?.includes(value) && next(element);
|
|
},
|
|
not(next, data, options) {
|
|
const { adapter } = options;
|
|
const { name } = data;
|
|
let { value } = data;
|
|
if (value === "") {
|
|
return (element) => !!adapter.getAttributeValue(element, name) && next(element);
|
|
}
|
|
if (shouldIgnoreCase(data, options)) {
|
|
value = value.toLowerCase();
|
|
return (element) => {
|
|
const attribute = adapter.getAttributeValue(element, name);
|
|
return (attribute == null || attribute.length !== value.length || attribute.toLowerCase() !== value) && next(element);
|
|
};
|
|
}
|
|
return (element) => adapter.getAttributeValue(element, name) !== value && next(element);
|
|
}
|
|
};
|
|
|
|
// node_modules/css-select/dist/helpers/querying.js
|
|
function findAll2(query, nodes, options) {
|
|
const { adapter, xmlMode = false } = options;
|
|
const result = [];
|
|
const nodeStack = [nodes];
|
|
const indexStack = [0];
|
|
for (;; ) {
|
|
if (indexStack[0] >= nodeStack[0].length) {
|
|
if (nodeStack.length === 1) {
|
|
return result;
|
|
}
|
|
nodeStack.shift();
|
|
indexStack.shift();
|
|
continue;
|
|
}
|
|
const element = nodeStack[0][indexStack[0]++];
|
|
if (!adapter.isTag(element)) {
|
|
continue;
|
|
}
|
|
if (query(element)) {
|
|
result.push(element);
|
|
}
|
|
if (xmlMode || adapter.getName(element) !== "template") {
|
|
const children = adapter.getChildren(element);
|
|
if (children.length > 0) {
|
|
nodeStack.unshift(children);
|
|
indexStack.unshift(0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function findOne2(query, nodes, options) {
|
|
const { adapter, xmlMode = false } = options;
|
|
const nodeStack = [nodes];
|
|
const indexStack = [0];
|
|
for (;; ) {
|
|
if (indexStack[0] >= nodeStack[0].length) {
|
|
if (nodeStack.length === 1) {
|
|
return null;
|
|
}
|
|
nodeStack.shift();
|
|
indexStack.shift();
|
|
continue;
|
|
}
|
|
const element = nodeStack[0][indexStack[0]++];
|
|
if (!adapter.isTag(element)) {
|
|
continue;
|
|
}
|
|
if (query(element)) {
|
|
return element;
|
|
}
|
|
if (xmlMode || adapter.getName(element) !== "template") {
|
|
const children = adapter.getChildren(element);
|
|
if (children.length > 0) {
|
|
nodeStack.unshift(children);
|
|
indexStack.unshift(0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getNextSiblings(element, adapter) {
|
|
const siblings = adapter.getSiblings(element);
|
|
if (siblings.length <= 1) {
|
|
return [];
|
|
}
|
|
const elementIndex = siblings.indexOf(element);
|
|
if (elementIndex === -1 || elementIndex === siblings.length - 1) {
|
|
return [];
|
|
}
|
|
return siblings.slice(elementIndex + 1).filter(adapter.isTag);
|
|
}
|
|
function getElementParent(node2, adapter) {
|
|
const parent = adapter.getParent(node2);
|
|
return parent != null && adapter.isTag(parent) ? parent : null;
|
|
}
|
|
|
|
// node_modules/css-select/dist/pseudo-selectors/aliases.js
|
|
var textControl = "input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i])";
|
|
var aliases = {
|
|
"any-link": ":is(a, area, link)[href]",
|
|
link: ":any-link:not(:visited)",
|
|
disabled: `:is(
|
|
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
optgroup[disabled] > option,
|
|
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
)`,
|
|
enabled: ":is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)",
|
|
checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], :selected)",
|
|
required: ":is(input, select, textarea)[required]",
|
|
optional: ":is(input, select, textarea):not([required])",
|
|
"read-only": `[readonly]:is(textarea, ${textControl})`,
|
|
"read-write": `:not([readonly]):is(textarea, ${textControl})`,
|
|
selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
|
|
checkbox: "[type=checkbox]",
|
|
file: "[type=file]",
|
|
password: "[type=password]",
|
|
radio: "[type=radio]",
|
|
reset: "[type=reset]",
|
|
image: "[type=image]",
|
|
submit: "[type=submit]",
|
|
parent: ":not(:empty)",
|
|
header: ":is(h1, h2, h3, h4, h5, h6)",
|
|
button: ":is(button, input[type=button])",
|
|
input: ":is(input, textarea, select, button)",
|
|
text: "input:is(:not([type!='']), [type=text])"
|
|
};
|
|
|
|
// node_modules/nth-check/dist/compile.js
|
|
function compile(parsed) {
|
|
const a = parsed[0];
|
|
const b = parsed[1] - 1;
|
|
if (b < 0 && a <= 0)
|
|
return falseFunc;
|
|
if (a === -1)
|
|
return (index) => index <= b;
|
|
if (a === 0)
|
|
return (index) => index === b;
|
|
if (a === 1)
|
|
return b < 0 ? trueFunc : (index) => index >= b;
|
|
const absA = Math.abs(a);
|
|
const bModulo = (b % absA + absA) % absA;
|
|
return a > 1 ? (index) => index >= b && index % absA === bModulo : (index) => index <= b && index % absA === bModulo;
|
|
}
|
|
|
|
// node_modules/nth-check/dist/parse.js
|
|
var whitespace = new Set([9, 10, 12, 13, 32]);
|
|
var ZERO = 48;
|
|
var NINE = 57;
|
|
function parse2(formula) {
|
|
formula = formula.trim().toLowerCase();
|
|
switch (formula) {
|
|
case "even": {
|
|
return [2, 0];
|
|
}
|
|
case "odd": {
|
|
return [2, 1];
|
|
}
|
|
}
|
|
let index = 0;
|
|
let a = 0;
|
|
let sign = readSign();
|
|
let number = readNumber();
|
|
if (index < formula.length && formula.charAt(index) === "n") {
|
|
index++;
|
|
a = sign * (number ?? 1);
|
|
skipWhitespace();
|
|
if (index < formula.length) {
|
|
sign = readSign();
|
|
skipWhitespace();
|
|
number = readNumber();
|
|
} else {
|
|
sign = number = 0;
|
|
}
|
|
}
|
|
if (number === null || index < formula.length) {
|
|
throw new Error(`n-th rule couldn't be parsed ('${formula}')`);
|
|
}
|
|
return [a, sign * number];
|
|
function readSign() {
|
|
switch (formula.charAt(index)) {
|
|
case "-": {
|
|
index++;
|
|
return -1;
|
|
}
|
|
case "+": {
|
|
index++;
|
|
break;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
function readNumber() {
|
|
const start = index;
|
|
let value = 0;
|
|
while (index < formula.length && formula.charCodeAt(index) >= ZERO && formula.charCodeAt(index) <= NINE) {
|
|
value = value * 10 + (formula.charCodeAt(index) - ZERO);
|
|
index++;
|
|
}
|
|
return index === start ? null : value;
|
|
}
|
|
function skipWhitespace() {
|
|
while (index < formula.length && whitespace.has(formula.charCodeAt(index))) {
|
|
index++;
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/nth-check/dist/index.js
|
|
function nthCheck(formula) {
|
|
return compile(parse2(formula));
|
|
}
|
|
|
|
// node_modules/css-select/dist/helpers/cache.js
|
|
function cacheParentResults(next, { adapter, cacheResults }, matches) {
|
|
if (cacheResults === false || typeof WeakMap === "undefined") {
|
|
return (element) => next(element) && matches(element);
|
|
}
|
|
const resultCache = new WeakMap;
|
|
function addResultToCache(element) {
|
|
const result = matches(element);
|
|
resultCache.set(element, result);
|
|
return result;
|
|
}
|
|
return function cachedMatcher(element) {
|
|
if (!next(element)) {
|
|
return false;
|
|
}
|
|
if (resultCache.has(element)) {
|
|
return resultCache.get(element) ?? false;
|
|
}
|
|
let node2 = element;
|
|
do {
|
|
const parent = getElementParent(node2, adapter);
|
|
if (parent === null) {
|
|
return addResultToCache(element);
|
|
}
|
|
node2 = parent;
|
|
} while (!resultCache.has(node2));
|
|
return resultCache.get(node2) ? addResultToCache(element) : false;
|
|
};
|
|
}
|
|
|
|
// node_modules/css-select/dist/helpers/options.js
|
|
function copyOptions(options) {
|
|
const { context: _, rootFunc: __, ...copied } = options;
|
|
return copied;
|
|
}
|
|
|
|
// node_modules/css-select/dist/pseudo-selectors/filters.js
|
|
function extendedFilter(tag, range) {
|
|
if (range[0] !== "*" && range[0] !== tag[0])
|
|
return false;
|
|
let tagIndex = 1;
|
|
for (let rangeIndex = 1;rangeIndex < range.length; rangeIndex++) {
|
|
if (range[rangeIndex] === "*")
|
|
continue;
|
|
while (tagIndex < tag.length && tag[tagIndex] !== range[rangeIndex]) {
|
|
if (tag[tagIndex++].length <= 1)
|
|
return false;
|
|
}
|
|
if (tagIndex >= tag.length)
|
|
return false;
|
|
tagIndex++;
|
|
}
|
|
return true;
|
|
}
|
|
var nthOfRegex = /^(.+?)\s+of\s+(.+)$/is;
|
|
function compileNth(reverse, ofType) {
|
|
return function nth(next, rule, options, context, compileToken) {
|
|
const { adapter, equals } = options;
|
|
const ofMatch = ofType ? null : rule.match(nthOfRegex);
|
|
const nthCheck2 = nthCheck(ofMatch ? ofMatch[1].trim() : rule);
|
|
if (nthCheck2 === falseFunc)
|
|
return falseFunc;
|
|
const ofSelector = ofMatch && compileToken ? compileToken(parse(ofMatch[2].trim()), copyOptions(options), context) : undefined;
|
|
if (ofSelector === falseFunc)
|
|
return falseFunc;
|
|
if (nthCheck2 === trueFunc && !ofSelector) {
|
|
return (element) => getElementParent(element, adapter) !== null && next(element);
|
|
}
|
|
const shouldCount = ofSelector ? (_element, sibling) => ofSelector(sibling) : ofType ? (element, sibling) => adapter.getName(sibling) === adapter.getName(element) : trueFunc;
|
|
if (reverse) {
|
|
return function nthLast(element) {
|
|
if (ofSelector && !ofSelector(element))
|
|
return false;
|
|
const siblings = adapter.getSiblings(element);
|
|
let pos = 0;
|
|
for (let index = siblings.length - 1;index >= 0; index--) {
|
|
const sibling = siblings[index];
|
|
if (equals(element, sibling))
|
|
break;
|
|
if (adapter.isTag(sibling) && shouldCount(element, sibling))
|
|
pos++;
|
|
}
|
|
return nthCheck2(pos) && next(element);
|
|
};
|
|
}
|
|
return function nth2(element) {
|
|
if (ofSelector && !ofSelector(element))
|
|
return false;
|
|
const siblings = adapter.getSiblings(element);
|
|
let pos = 0;
|
|
for (const sibling of siblings) {
|
|
if (equals(element, sibling))
|
|
break;
|
|
if (adapter.isTag(sibling) && shouldCount(element, sibling))
|
|
pos++;
|
|
}
|
|
return nthCheck2(pos) && next(element);
|
|
};
|
|
};
|
|
}
|
|
var filters = {
|
|
contains(next, text, options) {
|
|
const { getText: getText2 } = options.adapter;
|
|
return cacheParentResults(next, options, (element) => getText2(element).includes(text));
|
|
},
|
|
icontains(next, text, options) {
|
|
const itext = text.toLowerCase();
|
|
const { getText: getText2 } = options.adapter;
|
|
return cacheParentResults(next, options, (element) => getText2(element).toLowerCase().includes(itext));
|
|
},
|
|
"nth-child": compileNth(false, false),
|
|
"nth-last-child": compileNth(true, false),
|
|
"nth-of-type": compileNth(false, true),
|
|
"nth-last-of-type": compileNth(true, true),
|
|
root(next, _rule, { adapter }) {
|
|
return (element) => getElementParent(element, adapter) === null && next(element);
|
|
},
|
|
scope(next, rule, options, context) {
|
|
const { equals } = options;
|
|
if (!context || context.length === 0) {
|
|
return filters["root"](next, rule, options);
|
|
}
|
|
if (context.length === 1) {
|
|
return (element) => equals(context[0], element) && next(element);
|
|
}
|
|
return (element) => context.includes(element) && next(element);
|
|
},
|
|
lang(next, code, { adapter }) {
|
|
const ranges = code.split(",").map((r) => r.trim()).filter((r) => r.length > 0).map((r) => r.replace(/^['"]|['"]$/g, "").toLowerCase().split("-"));
|
|
return function lang(element) {
|
|
let node2 = element;
|
|
while (node2 != null) {
|
|
const value = adapter.getAttributeValue(node2, "xml:lang") ?? adapter.getAttributeValue(node2, "lang");
|
|
if (value != null) {
|
|
if (!value) {
|
|
return ranges.some((r) => r[0] === "") && next(element);
|
|
}
|
|
const tag = value.toLowerCase().split("-");
|
|
return ranges.some((r) => extendedFilter(tag, r)) && next(element);
|
|
}
|
|
const parent = adapter.getParent(node2);
|
|
node2 = parent != null && adapter.isTag(parent) ? parent : null;
|
|
}
|
|
return ranges.some((r) => r[0] === "") && next(element);
|
|
};
|
|
},
|
|
hover: dynamicStatePseudo("isHovered"),
|
|
visited: dynamicStatePseudo("isVisited"),
|
|
active: dynamicStatePseudo("isActive")
|
|
};
|
|
function dynamicStatePseudo(name) {
|
|
return function dynamicPseudo(next, _rule, { adapter }) {
|
|
const filterFunction = adapter[name];
|
|
if (typeof filterFunction !== "function") {
|
|
return falseFunc;
|
|
}
|
|
return function active(element) {
|
|
return filterFunction(element) && next(element);
|
|
};
|
|
};
|
|
}
|
|
|
|
// node_modules/css-select/dist/pseudo-selectors/pseudos.js
|
|
var isDocumentWhiteSpace = /^[ \t\r\n]*$/;
|
|
var pseudos = {
|
|
empty(element, { adapter }) {
|
|
const children = adapter.getChildren(element);
|
|
return children.every((element2) => !adapter.isTag(element2)) && children.every((element2) => isDocumentWhiteSpace.test(adapter.getText(element2)));
|
|
},
|
|
"first-child"(element, { adapter, equals }) {
|
|
if (adapter.prevElementSibling) {
|
|
return adapter.prevElementSibling(element) == null;
|
|
}
|
|
const firstChild = adapter.getSiblings(element).find((sibling) => adapter.isTag(sibling));
|
|
return firstChild != null && equals(element, firstChild);
|
|
},
|
|
"last-child"(element, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(element);
|
|
for (let index = siblings.length - 1;index >= 0; index--) {
|
|
if (equals(element, siblings[index])) {
|
|
return true;
|
|
}
|
|
if (adapter.isTag(siblings[index])) {
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
"first-of-type"(element, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(element);
|
|
const elementName = adapter.getName(element);
|
|
for (const currentSibling of siblings) {
|
|
if (equals(element, currentSibling)) {
|
|
return true;
|
|
}
|
|
if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elementName) {
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
"last-of-type"(element, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(element);
|
|
const elementName = adapter.getName(element);
|
|
for (let index = siblings.length - 1;index >= 0; index--) {
|
|
const currentSibling = siblings[index];
|
|
if (equals(element, currentSibling)) {
|
|
return true;
|
|
}
|
|
if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elementName) {
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
"only-of-type"(element, { adapter, equals }) {
|
|
const elementName = adapter.getName(element);
|
|
return adapter.getSiblings(element).every((sibling) => equals(element, sibling) || !adapter.isTag(sibling) || adapter.getName(sibling) !== elementName);
|
|
},
|
|
"only-child"(element, { adapter, equals }) {
|
|
return adapter.getSiblings(element).every((sibling) => equals(element, sibling) || !adapter.isTag(sibling));
|
|
}
|
|
};
|
|
function verifyPseudoArguments(pseudoClassCondition, name, subselect, argumentIndex) {
|
|
if (subselect === null) {
|
|
if (pseudoClassCondition.length > argumentIndex) {
|
|
throw new Error(`Pseudo-class :${name} requires an argument`);
|
|
}
|
|
} else if (pseudoClassCondition.length === argumentIndex) {
|
|
throw new Error(`Pseudo-class :${name} doesn't have any arguments`);
|
|
}
|
|
}
|
|
|
|
// node_modules/css-select/dist/helpers/selectors.js
|
|
function isTraversal2(token) {
|
|
return token.type === "_flexibleDescendant" || isTraversal(token);
|
|
}
|
|
function sortRules(array) {
|
|
const ratings = array.map(getQuality);
|
|
for (let index = 1;index < array.length; index++) {
|
|
const procNew = ratings[index];
|
|
if (procNew < 0) {
|
|
continue;
|
|
}
|
|
for (let currentIndex = index;currentIndex > 0 && procNew < ratings[currentIndex - 1]; currentIndex--) {
|
|
const token = array[currentIndex];
|
|
array[currentIndex] = array[currentIndex - 1];
|
|
array[currentIndex - 1] = token;
|
|
ratings[currentIndex] = ratings[currentIndex - 1];
|
|
ratings[currentIndex - 1] = procNew;
|
|
}
|
|
}
|
|
}
|
|
function getAttributeQuality(token) {
|
|
switch (token.action) {
|
|
case AttributeAction.Exists: {
|
|
return 10;
|
|
}
|
|
case AttributeAction.Equals: {
|
|
return token.name === "id" ? 9 : 8;
|
|
}
|
|
case AttributeAction.Not: {
|
|
return 7;
|
|
}
|
|
case AttributeAction.Start: {
|
|
return 6;
|
|
}
|
|
case AttributeAction.End: {
|
|
return 6;
|
|
}
|
|
case AttributeAction.Any: {
|
|
return 5;
|
|
}
|
|
case AttributeAction.Hyphen: {
|
|
return 4;
|
|
}
|
|
case AttributeAction.Element: {
|
|
return 3;
|
|
}
|
|
}
|
|
}
|
|
function getQuality(token) {
|
|
switch (token.type) {
|
|
case SelectorType.Universal: {
|
|
return 50;
|
|
}
|
|
case SelectorType.Tag: {
|
|
return 30;
|
|
}
|
|
case SelectorType.Attribute: {
|
|
return Math.floor(getAttributeQuality(token) / (token.ignoreCase ? 2 : 1));
|
|
}
|
|
case SelectorType.Pseudo: {
|
|
return token.data ? token.name === "has" || token.name === "contains" || token.name === "icontains" ? 0 : Array.isArray(token.data) ? Math.max(0, Math.min(...token.data.map((d) => Math.min(...d.map(getQuality))))) : 2 : 3;
|
|
}
|
|
default: {
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
function includesScopePseudo(t) {
|
|
return t.type === SelectorType.Pseudo && (t.name === "scope" || Array.isArray(t.data) && t.data.some((data) => data.some(includesScopePseudo)));
|
|
}
|
|
|
|
// node_modules/css-select/dist/pseudo-selectors/subselects.js
|
|
var PLACEHOLDER_ELEMENT = {};
|
|
function hasDependsOnCurrentElement(selector) {
|
|
return selector.some((sel) => sel.length > 0 && (isTraversal2(sel[0]) || sel.some(includesScopePseudo)));
|
|
}
|
|
var is = (next, token, options, context, compileToken) => {
|
|
const compiledToken = compileToken(token, copyOptions(options), context);
|
|
return compiledToken === trueFunc ? next : compiledToken === falseFunc ? falseFunc : (element) => compiledToken(element) && next(element);
|
|
};
|
|
var subselects = {
|
|
is,
|
|
matches: is,
|
|
where: is,
|
|
not(next, token, options, context, compileToken) {
|
|
const compiledToken = compileToken(token, copyOptions(options), context);
|
|
return compiledToken === falseFunc ? next : compiledToken === trueFunc ? falseFunc : (element) => !compiledToken(element) && next(element);
|
|
},
|
|
has(next, subselect, options, _context, compileToken) {
|
|
const { adapter } = options;
|
|
const copiedOptions = copyOptions(options);
|
|
copiedOptions.relativeSelector = true;
|
|
const context = subselect.some((s) => s.some(isTraversal2)) ? [PLACEHOLDER_ELEMENT] : undefined;
|
|
const skipCache = hasDependsOnCurrentElement(subselect);
|
|
const compiled = compileToken(subselect, copiedOptions, context);
|
|
if (compiled === falseFunc) {
|
|
return falseFunc;
|
|
}
|
|
if (context && compiled !== trueFunc) {
|
|
return skipCache ? (element) => {
|
|
if (!next(element)) {
|
|
return false;
|
|
}
|
|
context[0] = element;
|
|
const childs = adapter.getChildren(element);
|
|
return findOne2(compiled, compiled.shouldTestNextSiblings ? [
|
|
...childs,
|
|
...getNextSiblings(element, adapter)
|
|
] : childs, options) !== null;
|
|
} : cacheParentResults(next, options, (element) => {
|
|
context[0] = element;
|
|
return findOne2(compiled, adapter.getChildren(element), options) !== null;
|
|
});
|
|
}
|
|
const hasOne = (element) => findOne2(compiled, adapter.getChildren(element), options) !== null;
|
|
return skipCache ? (element) => next(element) && hasOne(element) : cacheParentResults(next, options, hasOne);
|
|
}
|
|
};
|
|
|
|
// node_modules/css-select/dist/pseudo-selectors/index.js
|
|
function compilePseudoSelector(next, selector, options, context, compileToken) {
|
|
const { name, data } = selector;
|
|
if (Array.isArray(data)) {
|
|
if (!(name in subselects)) {
|
|
throw new Error(`Unknown pseudo-class :${name}(${data})`);
|
|
}
|
|
return subselects[name](next, data, options, context, compileToken);
|
|
}
|
|
const userPseudo = options.pseudos?.[name];
|
|
const stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases[name];
|
|
if (typeof stringPseudo === "string") {
|
|
if (data != null) {
|
|
throw new Error(`Pseudo ${name} doesn't have any arguments`);
|
|
}
|
|
const alias = parse(stringPseudo);
|
|
return subselects["is"](next, alias, options, context, compileToken);
|
|
}
|
|
if (typeof userPseudo === "function") {
|
|
verifyPseudoArguments(userPseudo, name, data, 1);
|
|
return (element) => userPseudo(element, data) && next(element);
|
|
}
|
|
if (name in filters) {
|
|
return filters[name](next, data, options, context, compileToken);
|
|
}
|
|
if (name in pseudos) {
|
|
const pseudo = pseudos[name];
|
|
verifyPseudoArguments(pseudo, name, data, 2);
|
|
return (element) => pseudo(element, options, data) && next(element);
|
|
}
|
|
throw new Error(`Unknown pseudo-class :${name}`);
|
|
}
|
|
|
|
// node_modules/css-select/dist/general.js
|
|
function compileGeneralSelector(next, selector, options, context, compileToken, hasExpensiveSubselector) {
|
|
const { adapter, equals, cacheResults } = options;
|
|
switch (selector.type) {
|
|
case SelectorType.PseudoElement: {
|
|
throw new Error("Pseudo-elements are not supported by css-select");
|
|
}
|
|
case SelectorType.ColumnCombinator: {
|
|
throw new Error("Column combinators are not yet supported by css-select");
|
|
}
|
|
case SelectorType.Attribute: {
|
|
if (selector.namespace != null) {
|
|
throw new Error("Namespaced attributes are not yet supported by css-select");
|
|
}
|
|
if (!options.xmlMode || options.lowerCaseAttributeNames) {
|
|
selector.name = selector.name.toLowerCase();
|
|
}
|
|
return attributeRules[selector.action](next, selector, options);
|
|
}
|
|
case SelectorType.Pseudo: {
|
|
return compilePseudoSelector(next, selector, options, context, compileToken);
|
|
}
|
|
case SelectorType.Tag: {
|
|
if (selector.namespace != null) {
|
|
throw new Error("Namespaced tag names are not yet supported by css-select");
|
|
}
|
|
let { name } = selector;
|
|
if (!options.xmlMode || options.lowerCaseTags) {
|
|
name = name.toLowerCase();
|
|
}
|
|
return function tag(element) {
|
|
return adapter.getName(element) === name && next(element);
|
|
};
|
|
}
|
|
case SelectorType.Descendant: {
|
|
if (!hasExpensiveSubselector || cacheResults === false || typeof WeakMap === "undefined") {
|
|
return function descendant(element) {
|
|
let current = element;
|
|
while (current = getElementParent(current, adapter)) {
|
|
if (next(current)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
const resultCache = new WeakMap;
|
|
return function cachedDescendant(element) {
|
|
let current = element;
|
|
let result;
|
|
while (current = getElementParent(current, adapter)) {
|
|
const cached = resultCache.get(current);
|
|
if (cached === undefined) {
|
|
result ??= { matches: false };
|
|
result.matches = next(current);
|
|
resultCache.set(current, result);
|
|
if (result.matches) {
|
|
return true;
|
|
}
|
|
} else {
|
|
if (result) {
|
|
result.matches = cached.matches;
|
|
}
|
|
return cached.matches;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
case "_flexibleDescendant": {
|
|
return function flexibleDescendant(element) {
|
|
let current = element;
|
|
do {
|
|
if (next(current)) {
|
|
return true;
|
|
}
|
|
current = getElementParent(current, adapter);
|
|
} while (current);
|
|
return false;
|
|
};
|
|
}
|
|
case SelectorType.Parent: {
|
|
return function parent(element) {
|
|
return adapter.getChildren(element).some((element2) => adapter.isTag(element2) && next(element2));
|
|
};
|
|
}
|
|
case SelectorType.Child: {
|
|
return function child(element) {
|
|
const parent = getElementParent(element, adapter);
|
|
return parent !== null && next(parent);
|
|
};
|
|
}
|
|
case SelectorType.Sibling: {
|
|
return function sibling(element) {
|
|
const siblings = adapter.getSiblings(element);
|
|
for (const currentSibling of siblings) {
|
|
if (equals(element, currentSibling)) {
|
|
break;
|
|
}
|
|
if (adapter.isTag(currentSibling) && next(currentSibling)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
case SelectorType.Adjacent: {
|
|
if (adapter.prevElementSibling) {
|
|
return function adjacent(element) {
|
|
const previous = adapter.prevElementSibling(element);
|
|
return previous != null && next(previous);
|
|
};
|
|
}
|
|
return function adjacent(element) {
|
|
const siblings = adapter.getSiblings(element);
|
|
let lastElement;
|
|
for (const currentSibling of siblings) {
|
|
if (equals(element, currentSibling)) {
|
|
break;
|
|
}
|
|
if (adapter.isTag(currentSibling)) {
|
|
lastElement = currentSibling;
|
|
}
|
|
}
|
|
return !!lastElement && next(lastElement);
|
|
};
|
|
}
|
|
case SelectorType.Universal: {
|
|
if (selector.namespace != null && selector.namespace !== "*") {
|
|
throw new Error("Namespaced universal selectors are not yet supported by css-select");
|
|
}
|
|
return next;
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/css-select/dist/compile.js
|
|
var DESCENDANT_TOKEN = { type: SelectorType.Descendant };
|
|
var FLEXIBLE_DESCENDANT_TOKEN = {
|
|
type: "_flexibleDescendant"
|
|
};
|
|
var SCOPE_TOKEN = {
|
|
type: SelectorType.Pseudo,
|
|
name: "scope",
|
|
data: null
|
|
};
|
|
function absolutize(token, { adapter }, context) {
|
|
const hasContext = !!context?.every((element) => element === PLACEHOLDER_ELEMENT || adapter.isTag(element) && getElementParent(element, adapter) !== null);
|
|
for (const t of token) {
|
|
if (t.length > 0 && isTraversal2(t[0]) && t[0].type !== SelectorType.Descendant) {} else if (hasContext && !t.some(includesScopePseudo)) {
|
|
t.unshift(DESCENDANT_TOKEN);
|
|
} else {
|
|
continue;
|
|
}
|
|
t.unshift(SCOPE_TOKEN);
|
|
}
|
|
}
|
|
function compileToken(token, options, compilationContext) {
|
|
for (const rules of token) {
|
|
sortRules(rules);
|
|
}
|
|
const { context = compilationContext, rootFunc: rootFunction = trueFunc } = options;
|
|
const isArrayContext = Array.isArray(context);
|
|
const finalContext = context && (Array.isArray(context) ? context : [context]);
|
|
if (options.relativeSelector !== false) {
|
|
absolutize(token, options, finalContext);
|
|
} else if (token.some((t) => t.length > 0 && isTraversal2(t[0]))) {
|
|
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
|
|
}
|
|
let shouldTestNextSiblings = false;
|
|
let query = falseFunc;
|
|
combineLoop:
|
|
for (const rules of token) {
|
|
if (rules.length >= 2) {
|
|
const [first, second] = rules;
|
|
if (first.type !== SelectorType.Pseudo || first.name !== "scope") {} else if (isArrayContext && second.type === SelectorType.Descendant) {
|
|
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
|
|
} else if (second.type === SelectorType.Adjacent || second.type === SelectorType.Sibling) {
|
|
shouldTestNextSiblings = true;
|
|
}
|
|
}
|
|
let next = rootFunction;
|
|
let hasExpensiveSubselector = false;
|
|
for (const rule of rules) {
|
|
next = compileGeneralSelector(next, rule, options, finalContext, compileToken, hasExpensiveSubselector);
|
|
const quality = getQuality(rule);
|
|
if (quality === 0) {
|
|
hasExpensiveSubselector = true;
|
|
}
|
|
if (next === falseFunc) {
|
|
continue combineLoop;
|
|
}
|
|
}
|
|
if (next === rootFunction) {
|
|
return rootFunction;
|
|
}
|
|
query = query === falseFunc ? next : or(query, next);
|
|
}
|
|
query.shouldTestNextSiblings = shouldTestNextSiblings;
|
|
return query;
|
|
}
|
|
function or(a, b) {
|
|
return (element) => a(element) || b(element);
|
|
}
|
|
|
|
// node_modules/css-select/dist/index.js
|
|
var defaultEquals = (a, b) => a === b;
|
|
var defaultOptions2 = {
|
|
adapter: { ...exports_dist2, isTag: isTag2 },
|
|
equals: defaultEquals
|
|
};
|
|
function convertOptionFormats(options) {
|
|
const finalOptions = options ?? defaultOptions2;
|
|
finalOptions.adapter ??= defaultOptions2.adapter;
|
|
finalOptions.equals ??= finalOptions.adapter?.equals ?? defaultEquals;
|
|
return finalOptions;
|
|
}
|
|
function compile2(selector, options, context) {
|
|
const convertedOptions = convertOptionFormats(options);
|
|
const next = _compileUnsafe(selector, convertedOptions, context);
|
|
return next === falseFunc ? falseFunc : (element) => convertedOptions.adapter.isTag(element) && next(element);
|
|
}
|
|
function _compileUnsafe(selector, options, context) {
|
|
return compileToken(typeof selector === "string" ? parse(selector) : selector, convertOptionFormats(options), context);
|
|
}
|
|
function getSelectorFunction(searchFunction) {
|
|
return function select(query, elements, options) {
|
|
const convertedOptions = convertOptionFormats(options);
|
|
if (typeof query !== "function") {
|
|
query = _compileUnsafe(query, convertedOptions, elements);
|
|
}
|
|
const filteredElements = prepareContext(elements, convertedOptions.adapter, query.shouldTestNextSiblings);
|
|
return searchFunction(query, filteredElements, convertedOptions);
|
|
};
|
|
}
|
|
function prepareContext(elements, adapter, shouldTestNextSiblings = false) {
|
|
if (shouldTestNextSiblings) {
|
|
elements = appendNextSiblings(elements, adapter);
|
|
}
|
|
return Array.isArray(elements) ? adapter.removeSubsets(elements) : adapter.getChildren(elements);
|
|
}
|
|
function appendNextSiblings(element, adapter) {
|
|
const elements = Array.isArray(element) ? [...element] : [element];
|
|
const elementsLength = elements.length;
|
|
for (let index = 0;index < elementsLength; index++) {
|
|
const nextSiblings = getNextSiblings(elements[index], adapter);
|
|
elements.push(...nextSiblings);
|
|
}
|
|
return elements;
|
|
}
|
|
var selectAll = getSelectorFunction((query, elements, options) => query === falseFunc || !elements || elements.length === 0 ? [] : findAll2(query, elements, options));
|
|
var selectOne = getSelectorFunction((query, elements, options) => query === falseFunc || !elements || elements.length === 0 ? null : findOne2(query, elements, options));
|
|
function is2(element, query, options) {
|
|
return (typeof query === "function" ? query : compile2(query, options))(element);
|
|
}
|
|
var dist_default2 = selectAll;
|
|
// node_modules/css-tree/lib/utils/List.js
|
|
var releasedCursors = null;
|
|
|
|
class List {
|
|
static createItem(data) {
|
|
return {
|
|
prev: null,
|
|
next: null,
|
|
data
|
|
};
|
|
}
|
|
constructor() {
|
|
this.head = null;
|
|
this.tail = null;
|
|
this.cursor = null;
|
|
}
|
|
createItem(data) {
|
|
return List.createItem(data);
|
|
}
|
|
allocateCursor(prev, next) {
|
|
let cursor;
|
|
if (releasedCursors !== null) {
|
|
cursor = releasedCursors;
|
|
releasedCursors = releasedCursors.cursor;
|
|
cursor.prev = prev;
|
|
cursor.next = next;
|
|
cursor.cursor = this.cursor;
|
|
} else {
|
|
cursor = {
|
|
prev,
|
|
next,
|
|
cursor: this.cursor
|
|
};
|
|
}
|
|
this.cursor = cursor;
|
|
return cursor;
|
|
}
|
|
releaseCursor() {
|
|
const { cursor } = this;
|
|
this.cursor = cursor.cursor;
|
|
cursor.prev = null;
|
|
cursor.next = null;
|
|
cursor.cursor = releasedCursors;
|
|
releasedCursors = cursor;
|
|
}
|
|
updateCursors(prevOld, prevNew, nextOld, nextNew) {
|
|
let { cursor } = this;
|
|
while (cursor !== null) {
|
|
if (cursor.prev === prevOld) {
|
|
cursor.prev = prevNew;
|
|
}
|
|
if (cursor.next === nextOld) {
|
|
cursor.next = nextNew;
|
|
}
|
|
cursor = cursor.cursor;
|
|
}
|
|
}
|
|
*[Symbol.iterator]() {
|
|
for (let cursor = this.head;cursor !== null; cursor = cursor.next) {
|
|
yield cursor.data;
|
|
}
|
|
}
|
|
get size() {
|
|
let size = 0;
|
|
for (let cursor = this.head;cursor !== null; cursor = cursor.next) {
|
|
size++;
|
|
}
|
|
return size;
|
|
}
|
|
get isEmpty() {
|
|
return this.head === null;
|
|
}
|
|
get first() {
|
|
return this.head && this.head.data;
|
|
}
|
|
get last() {
|
|
return this.tail && this.tail.data;
|
|
}
|
|
fromArray(array) {
|
|
let cursor = null;
|
|
this.head = null;
|
|
for (let data of array) {
|
|
const item = List.createItem(data);
|
|
if (cursor !== null) {
|
|
cursor.next = item;
|
|
} else {
|
|
this.head = item;
|
|
}
|
|
item.prev = cursor;
|
|
cursor = item;
|
|
}
|
|
this.tail = cursor;
|
|
return this;
|
|
}
|
|
toArray() {
|
|
return [...this];
|
|
}
|
|
toJSON() {
|
|
return [...this];
|
|
}
|
|
forEach(fn, thisArg = this) {
|
|
const cursor = this.allocateCursor(null, this.head);
|
|
while (cursor.next !== null) {
|
|
const item = cursor.next;
|
|
cursor.next = item.next;
|
|
fn.call(thisArg, item.data, item, this);
|
|
}
|
|
this.releaseCursor();
|
|
}
|
|
forEachRight(fn, thisArg = this) {
|
|
const cursor = this.allocateCursor(this.tail, null);
|
|
while (cursor.prev !== null) {
|
|
const item = cursor.prev;
|
|
cursor.prev = item.prev;
|
|
fn.call(thisArg, item.data, item, this);
|
|
}
|
|
this.releaseCursor();
|
|
}
|
|
reduce(fn, initialValue, thisArg = this) {
|
|
let cursor = this.allocateCursor(null, this.head);
|
|
let acc = initialValue;
|
|
let item;
|
|
while (cursor.next !== null) {
|
|
item = cursor.next;
|
|
cursor.next = item.next;
|
|
acc = fn.call(thisArg, acc, item.data, item, this);
|
|
}
|
|
this.releaseCursor();
|
|
return acc;
|
|
}
|
|
reduceRight(fn, initialValue, thisArg = this) {
|
|
let cursor = this.allocateCursor(this.tail, null);
|
|
let acc = initialValue;
|
|
let item;
|
|
while (cursor.prev !== null) {
|
|
item = cursor.prev;
|
|
cursor.prev = item.prev;
|
|
acc = fn.call(thisArg, acc, item.data, item, this);
|
|
}
|
|
this.releaseCursor();
|
|
return acc;
|
|
}
|
|
some(fn, thisArg = this) {
|
|
for (let cursor = this.head;cursor !== null; cursor = cursor.next) {
|
|
if (fn.call(thisArg, cursor.data, cursor, this)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
map(fn, thisArg = this) {
|
|
const result = new List;
|
|
for (let cursor = this.head;cursor !== null; cursor = cursor.next) {
|
|
result.appendData(fn.call(thisArg, cursor.data, cursor, this));
|
|
}
|
|
return result;
|
|
}
|
|
filter(fn, thisArg = this) {
|
|
const result = new List;
|
|
for (let cursor = this.head;cursor !== null; cursor = cursor.next) {
|
|
if (fn.call(thisArg, cursor.data, cursor, this)) {
|
|
result.appendData(cursor.data);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
nextUntil(start, fn, thisArg = this) {
|
|
if (start === null) {
|
|
return;
|
|
}
|
|
const cursor = this.allocateCursor(null, start);
|
|
while (cursor.next !== null) {
|
|
const item = cursor.next;
|
|
cursor.next = item.next;
|
|
if (fn.call(thisArg, item.data, item, this)) {
|
|
break;
|
|
}
|
|
}
|
|
this.releaseCursor();
|
|
}
|
|
prevUntil(start, fn, thisArg = this) {
|
|
if (start === null) {
|
|
return;
|
|
}
|
|
const cursor = this.allocateCursor(start, null);
|
|
while (cursor.prev !== null) {
|
|
const item = cursor.prev;
|
|
cursor.prev = item.prev;
|
|
if (fn.call(thisArg, item.data, item, this)) {
|
|
break;
|
|
}
|
|
}
|
|
this.releaseCursor();
|
|
}
|
|
clear() {
|
|
this.head = null;
|
|
this.tail = null;
|
|
}
|
|
copy() {
|
|
const result = new List;
|
|
for (let data of this) {
|
|
result.appendData(data);
|
|
}
|
|
return result;
|
|
}
|
|
prepend(item) {
|
|
this.updateCursors(null, item, this.head, item);
|
|
if (this.head !== null) {
|
|
this.head.prev = item;
|
|
item.next = this.head;
|
|
} else {
|
|
this.tail = item;
|
|
}
|
|
this.head = item;
|
|
return this;
|
|
}
|
|
prependData(data) {
|
|
return this.prepend(List.createItem(data));
|
|
}
|
|
append(item) {
|
|
return this.insert(item);
|
|
}
|
|
appendData(data) {
|
|
return this.insert(List.createItem(data));
|
|
}
|
|
insert(item, before = null) {
|
|
if (before !== null) {
|
|
this.updateCursors(before.prev, item, before, item);
|
|
if (before.prev === null) {
|
|
if (this.head !== before) {
|
|
throw new Error("before doesn't belong to list");
|
|
}
|
|
this.head = item;
|
|
before.prev = item;
|
|
item.next = before;
|
|
this.updateCursors(null, item);
|
|
} else {
|
|
before.prev.next = item;
|
|
item.prev = before.prev;
|
|
before.prev = item;
|
|
item.next = before;
|
|
}
|
|
} else {
|
|
this.updateCursors(this.tail, item, null, item);
|
|
if (this.tail !== null) {
|
|
this.tail.next = item;
|
|
item.prev = this.tail;
|
|
} else {
|
|
this.head = item;
|
|
}
|
|
this.tail = item;
|
|
}
|
|
return this;
|
|
}
|
|
insertData(data, before) {
|
|
return this.insert(List.createItem(data), before);
|
|
}
|
|
remove(item) {
|
|
this.updateCursors(item, item.prev, item, item.next);
|
|
if (item.prev !== null) {
|
|
item.prev.next = item.next;
|
|
} else {
|
|
if (this.head !== item) {
|
|
throw new Error("item doesn't belong to list");
|
|
}
|
|
this.head = item.next;
|
|
}
|
|
if (item.next !== null) {
|
|
item.next.prev = item.prev;
|
|
} else {
|
|
if (this.tail !== item) {
|
|
throw new Error("item doesn't belong to list");
|
|
}
|
|
this.tail = item.prev;
|
|
}
|
|
item.prev = null;
|
|
item.next = null;
|
|
return item;
|
|
}
|
|
push(data) {
|
|
this.insert(List.createItem(data));
|
|
}
|
|
pop() {
|
|
return this.tail !== null ? this.remove(this.tail) : null;
|
|
}
|
|
unshift(data) {
|
|
this.prepend(List.createItem(data));
|
|
}
|
|
shift() {
|
|
return this.head !== null ? this.remove(this.head) : null;
|
|
}
|
|
prependList(list) {
|
|
return this.insertList(list, this.head);
|
|
}
|
|
appendList(list) {
|
|
return this.insertList(list);
|
|
}
|
|
insertList(list, before) {
|
|
if (list.head === null) {
|
|
return this;
|
|
}
|
|
if (before !== undefined && before !== null) {
|
|
this.updateCursors(before.prev, list.tail, before, list.head);
|
|
if (before.prev !== null) {
|
|
before.prev.next = list.head;
|
|
list.head.prev = before.prev;
|
|
} else {
|
|
this.head = list.head;
|
|
}
|
|
before.prev = list.tail;
|
|
list.tail.next = before;
|
|
} else {
|
|
this.updateCursors(this.tail, list.tail, null, list.head);
|
|
if (this.tail !== null) {
|
|
this.tail.next = list.head;
|
|
list.head.prev = this.tail;
|
|
} else {
|
|
this.head = list.head;
|
|
}
|
|
this.tail = list.tail;
|
|
}
|
|
list.head = null;
|
|
list.tail = null;
|
|
return this;
|
|
}
|
|
replace(oldItem, newItemOrList) {
|
|
if ("head" in newItemOrList) {
|
|
this.insertList(newItemOrList, oldItem);
|
|
} else {
|
|
this.insert(newItemOrList, oldItem);
|
|
}
|
|
this.remove(oldItem);
|
|
}
|
|
}
|
|
|
|
// node_modules/css-tree/lib/utils/create-custom-error.js
|
|
function createCustomError(name, message) {
|
|
const error = Object.create(SyntaxError.prototype);
|
|
const errorStack = new Error;
|
|
return Object.assign(error, {
|
|
name,
|
|
message,
|
|
get stack() {
|
|
return (errorStack.stack || "").replace(/^(.+\n){1,3}/, `${name}: ${message}
|
|
`);
|
|
}
|
|
});
|
|
}
|
|
|
|
// node_modules/css-tree/lib/parser/SyntaxError.js
|
|
var MAX_LINE_LENGTH = 100;
|
|
var OFFSET_CORRECTION = 60;
|
|
var TAB_REPLACEMENT = " ";
|
|
function sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {
|
|
function processLines(start, end) {
|
|
return lines.slice(start, end).map((line2, idx) => String(start + idx + 1).padStart(maxNumLength) + " |" + line2).join(`
|
|
`);
|
|
}
|
|
const prelines = `
|
|
`.repeat(Math.max(baseLine - 1, 0));
|
|
const precolumns = " ".repeat(Math.max(baseColumn - 1, 0));
|
|
const lines = (prelines + precolumns + source).split(/\r\n?|\n|\f/);
|
|
const startLine = Math.max(1, line - extraLines) - 1;
|
|
const endLine = Math.min(line + extraLines, lines.length + 1);
|
|
const maxNumLength = Math.max(4, String(endLine).length) + 1;
|
|
let cutLeft = 0;
|
|
column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
|
|
if (column > MAX_LINE_LENGTH) {
|
|
cutLeft = column - OFFSET_CORRECTION + 3;
|
|
column = OFFSET_CORRECTION - 2;
|
|
}
|
|
for (let i = startLine;i <= endLine; i++) {
|
|
if (i >= 0 && i < lines.length) {
|
|
lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
|
|
lines[i] = (cutLeft > 0 && lines[i].length > cutLeft ? "…" : "") + lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) + (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? "…" : "");
|
|
}
|
|
}
|
|
return [
|
|
processLines(startLine, line),
|
|
new Array(column + maxNumLength + 2).join("-") + "^",
|
|
processLines(line, endLine)
|
|
].filter(Boolean).join(`
|
|
`).replace(/^(\s+\d+\s+\|\n)+/, "").replace(/\n(\s+\d+\s+\|)+$/, "");
|
|
}
|
|
function SyntaxError2(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {
|
|
const error = Object.assign(createCustomError("SyntaxError", message), {
|
|
source,
|
|
offset,
|
|
line,
|
|
column,
|
|
sourceFragment(extraLines) {
|
|
return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);
|
|
},
|
|
get formattedMessage() {
|
|
return `Parse error: ${message}
|
|
` + sourceFragment({ source, line, column, baseLine, baseColumn }, 2);
|
|
}
|
|
});
|
|
return error;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/tokenizer/types.js
|
|
var EOF = 0;
|
|
var Ident = 1;
|
|
var Function = 2;
|
|
var AtKeyword = 3;
|
|
var Hash = 4;
|
|
var String2 = 5;
|
|
var BadString = 6;
|
|
var Url = 7;
|
|
var BadUrl = 8;
|
|
var Delim = 9;
|
|
var Number2 = 10;
|
|
var Percentage = 11;
|
|
var Dimension = 12;
|
|
var WhiteSpace = 13;
|
|
var CDO = 14;
|
|
var CDC = 15;
|
|
var Colon = 16;
|
|
var Semicolon = 17;
|
|
var Comma = 18;
|
|
var LeftSquareBracket = 19;
|
|
var RightSquareBracket = 20;
|
|
var LeftParenthesis = 21;
|
|
var RightParenthesis = 22;
|
|
var LeftCurlyBracket = 23;
|
|
var RightCurlyBracket = 24;
|
|
var Comment3 = 25;
|
|
|
|
// node_modules/css-tree/lib/tokenizer/char-code-definitions.js
|
|
var EOF2 = 0;
|
|
function isDigit(code) {
|
|
return code >= 48 && code <= 57;
|
|
}
|
|
function isHexDigit(code) {
|
|
return isDigit(code) || code >= 65 && code <= 70 || code >= 97 && code <= 102;
|
|
}
|
|
function isUppercaseLetter(code) {
|
|
return code >= 65 && code <= 90;
|
|
}
|
|
function isLowercaseLetter(code) {
|
|
return code >= 97 && code <= 122;
|
|
}
|
|
function isLetter(code) {
|
|
return isUppercaseLetter(code) || isLowercaseLetter(code);
|
|
}
|
|
function isNonAscii(code) {
|
|
return code >= 128;
|
|
}
|
|
function isNameStart(code) {
|
|
return isLetter(code) || isNonAscii(code) || code === 95;
|
|
}
|
|
function isName(code) {
|
|
return isNameStart(code) || isDigit(code) || code === 45;
|
|
}
|
|
function isNonPrintable(code) {
|
|
return code >= 0 && code <= 8 || code === 11 || code >= 14 && code <= 31 || code === 127;
|
|
}
|
|
function isNewline(code) {
|
|
return code === 10 || code === 13 || code === 12;
|
|
}
|
|
function isWhiteSpace(code) {
|
|
return isNewline(code) || code === 32 || code === 9;
|
|
}
|
|
function isValidEscape(first, second) {
|
|
if (first !== 92) {
|
|
return false;
|
|
}
|
|
if (isNewline(second) || second === EOF2) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function isIdentifierStart(first, second, third) {
|
|
if (first === 45) {
|
|
return isNameStart(second) || second === 45 || isValidEscape(second, third);
|
|
}
|
|
if (isNameStart(first)) {
|
|
return true;
|
|
}
|
|
if (first === 92) {
|
|
return isValidEscape(first, second);
|
|
}
|
|
return false;
|
|
}
|
|
function isNumberStart(first, second, third) {
|
|
if (first === 43 || first === 45) {
|
|
if (isDigit(second)) {
|
|
return 2;
|
|
}
|
|
return second === 46 && isDigit(third) ? 3 : 0;
|
|
}
|
|
if (first === 46) {
|
|
return isDigit(second) ? 2 : 0;
|
|
}
|
|
if (isDigit(first)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
function isBOM(code) {
|
|
if (code === 65279) {
|
|
return 1;
|
|
}
|
|
if (code === 65534) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
var CATEGORY = new Array(128);
|
|
var EofCategory = 128;
|
|
var WhiteSpaceCategory = 130;
|
|
var DigitCategory = 131;
|
|
var NameStartCategory = 132;
|
|
var NonPrintableCategory = 133;
|
|
for (let i = 0;i < CATEGORY.length; i++) {
|
|
CATEGORY[i] = isWhiteSpace(i) && WhiteSpaceCategory || isDigit(i) && DigitCategory || isNameStart(i) && NameStartCategory || isNonPrintable(i) && NonPrintableCategory || i || EofCategory;
|
|
}
|
|
function charCodeCategory(code) {
|
|
return code < 128 ? CATEGORY[code] : NameStartCategory;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/tokenizer/utils.js
|
|
function getCharCode(source, offset) {
|
|
return offset < source.length ? source.charCodeAt(offset) : 0;
|
|
}
|
|
function getNewlineLength(source, offset, code) {
|
|
if (code === 13 && getCharCode(source, offset + 1) === 10) {
|
|
return 2;
|
|
}
|
|
return 1;
|
|
}
|
|
function cmpChar(testStr, offset, referenceCode) {
|
|
let code = testStr.charCodeAt(offset);
|
|
if (isUppercaseLetter(code)) {
|
|
code = code | 32;
|
|
}
|
|
return code === referenceCode;
|
|
}
|
|
function cmpStr(testStr, start, end, referenceStr) {
|
|
if (end - start !== referenceStr.length) {
|
|
return false;
|
|
}
|
|
if (start < 0 || end > testStr.length) {
|
|
return false;
|
|
}
|
|
for (let i = start;i < end; i++) {
|
|
const referenceCode = referenceStr.charCodeAt(i - start);
|
|
let testCode = testStr.charCodeAt(i);
|
|
if (isUppercaseLetter(testCode)) {
|
|
testCode = testCode | 32;
|
|
}
|
|
if (testCode !== referenceCode) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function findWhiteSpaceStart(source, offset) {
|
|
for (;offset >= 0; offset--) {
|
|
if (!isWhiteSpace(source.charCodeAt(offset))) {
|
|
break;
|
|
}
|
|
}
|
|
return offset + 1;
|
|
}
|
|
function findWhiteSpaceEnd(source, offset) {
|
|
for (;offset < source.length; offset++) {
|
|
if (!isWhiteSpace(source.charCodeAt(offset))) {
|
|
break;
|
|
}
|
|
}
|
|
return offset;
|
|
}
|
|
function findDecimalNumberEnd(source, offset) {
|
|
for (;offset < source.length; offset++) {
|
|
if (!isDigit(source.charCodeAt(offset))) {
|
|
break;
|
|
}
|
|
}
|
|
return offset;
|
|
}
|
|
function consumeEscaped(source, offset) {
|
|
offset += 2;
|
|
if (isHexDigit(getCharCode(source, offset - 1))) {
|
|
for (const maxOffset = Math.min(source.length, offset + 5);offset < maxOffset; offset++) {
|
|
if (!isHexDigit(getCharCode(source, offset))) {
|
|
break;
|
|
}
|
|
}
|
|
const code = getCharCode(source, offset);
|
|
if (isWhiteSpace(code)) {
|
|
offset += getNewlineLength(source, offset, code);
|
|
}
|
|
}
|
|
return offset;
|
|
}
|
|
function consumeName(source, offset) {
|
|
for (;offset < source.length; offset++) {
|
|
const code = source.charCodeAt(offset);
|
|
if (isName(code)) {
|
|
continue;
|
|
}
|
|
if (isValidEscape(code, getCharCode(source, offset + 1))) {
|
|
offset = consumeEscaped(source, offset) - 1;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
return offset;
|
|
}
|
|
function consumeNumber(source, offset) {
|
|
let code = source.charCodeAt(offset);
|
|
if (code === 43 || code === 45) {
|
|
code = source.charCodeAt(offset += 1);
|
|
}
|
|
if (isDigit(code)) {
|
|
offset = findDecimalNumberEnd(source, offset + 1);
|
|
code = source.charCodeAt(offset);
|
|
}
|
|
if (code === 46 && isDigit(source.charCodeAt(offset + 1))) {
|
|
offset += 2;
|
|
offset = findDecimalNumberEnd(source, offset);
|
|
}
|
|
if (cmpChar(source, offset, 101)) {
|
|
let sign = 0;
|
|
code = source.charCodeAt(offset + 1);
|
|
if (code === 45 || code === 43) {
|
|
sign = 1;
|
|
code = source.charCodeAt(offset + 2);
|
|
}
|
|
if (isDigit(code)) {
|
|
offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);
|
|
}
|
|
}
|
|
return offset;
|
|
}
|
|
function consumeBadUrlRemnants(source, offset) {
|
|
for (;offset < source.length; offset++) {
|
|
const code = source.charCodeAt(offset);
|
|
if (code === 41) {
|
|
offset++;
|
|
break;
|
|
}
|
|
if (isValidEscape(code, getCharCode(source, offset + 1))) {
|
|
offset = consumeEscaped(source, offset);
|
|
}
|
|
}
|
|
return offset;
|
|
}
|
|
function decodeEscaped(escaped) {
|
|
if (escaped.length === 1 && !isHexDigit(escaped.charCodeAt(0))) {
|
|
return escaped[0];
|
|
}
|
|
let code = parseInt(escaped, 16);
|
|
if (code === 0 || code >= 55296 && code <= 57343 || code > 1114111) {
|
|
code = 65533;
|
|
}
|
|
return String.fromCodePoint(code);
|
|
}
|
|
// node_modules/css-tree/lib/tokenizer/names.js
|
|
var names_default = [
|
|
"EOF-token",
|
|
"ident-token",
|
|
"function-token",
|
|
"at-keyword-token",
|
|
"hash-token",
|
|
"string-token",
|
|
"bad-string-token",
|
|
"url-token",
|
|
"bad-url-token",
|
|
"delim-token",
|
|
"number-token",
|
|
"percentage-token",
|
|
"dimension-token",
|
|
"whitespace-token",
|
|
"CDO-token",
|
|
"CDC-token",
|
|
"colon-token",
|
|
"semicolon-token",
|
|
"comma-token",
|
|
"[-token",
|
|
"]-token",
|
|
"(-token",
|
|
")-token",
|
|
"{-token",
|
|
"}-token",
|
|
"comment-token"
|
|
];
|
|
// node_modules/css-tree/lib/tokenizer/adopt-buffer.js
|
|
var MIN_SIZE = 16 * 1024;
|
|
function adoptBuffer(buffer = null, size) {
|
|
if (buffer === null || buffer.length < size) {
|
|
return new Uint32Array(Math.max(size + 1024, MIN_SIZE));
|
|
}
|
|
return buffer;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/tokenizer/OffsetToLocation.js
|
|
var N = 10;
|
|
var F = 12;
|
|
var R = 13;
|
|
function computeLinesAndColumns(host) {
|
|
const source = host.source;
|
|
const sourceLength = source.length;
|
|
const startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
|
|
const lines = adoptBuffer(host.lines, sourceLength);
|
|
const columns = adoptBuffer(host.columns, sourceLength);
|
|
let line = host.startLine;
|
|
let column = host.startColumn;
|
|
for (let i = startOffset;i < sourceLength; i++) {
|
|
const code = source.charCodeAt(i);
|
|
lines[i] = line;
|
|
columns[i] = column++;
|
|
if (code === N || code === R || code === F) {
|
|
if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {
|
|
i++;
|
|
lines[i] = line;
|
|
columns[i] = column;
|
|
}
|
|
line++;
|
|
column = 1;
|
|
}
|
|
}
|
|
lines[sourceLength] = line;
|
|
columns[sourceLength] = column;
|
|
host.lines = lines;
|
|
host.columns = columns;
|
|
host.computed = true;
|
|
}
|
|
|
|
class OffsetToLocation {
|
|
constructor(source, startOffset, startLine, startColumn) {
|
|
this.setSource(source, startOffset, startLine, startColumn);
|
|
this.lines = null;
|
|
this.columns = null;
|
|
}
|
|
setSource(source = "", startOffset = 0, startLine = 1, startColumn = 1) {
|
|
this.source = source;
|
|
this.startOffset = startOffset;
|
|
this.startLine = startLine;
|
|
this.startColumn = startColumn;
|
|
this.computed = false;
|
|
}
|
|
getLocation(offset, filename) {
|
|
if (!this.computed) {
|
|
computeLinesAndColumns(this);
|
|
}
|
|
return {
|
|
source: filename,
|
|
offset: this.startOffset + offset,
|
|
line: this.lines[offset],
|
|
column: this.columns[offset]
|
|
};
|
|
}
|
|
getLocationRange(start, end, filename) {
|
|
if (!this.computed) {
|
|
computeLinesAndColumns(this);
|
|
}
|
|
return {
|
|
source: filename,
|
|
start: {
|
|
offset: this.startOffset + start,
|
|
line: this.lines[start],
|
|
column: this.columns[start]
|
|
},
|
|
end: {
|
|
offset: this.startOffset + end,
|
|
line: this.lines[end],
|
|
column: this.columns[end]
|
|
}
|
|
};
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/tokenizer/TokenStream.js
|
|
var OFFSET_MASK = 16777215;
|
|
var TYPE_SHIFT = 24;
|
|
var BLOCK_OPEN_TOKEN = 1;
|
|
var BLOCK_CLOSE_TOKEN = 2;
|
|
var balancePair = new Uint8Array(32);
|
|
balancePair[Function] = RightParenthesis;
|
|
balancePair[LeftParenthesis] = RightParenthesis;
|
|
balancePair[LeftSquareBracket] = RightSquareBracket;
|
|
balancePair[LeftCurlyBracket] = RightCurlyBracket;
|
|
var blockTokens = new Uint8Array(32);
|
|
blockTokens[Function] = BLOCK_OPEN_TOKEN;
|
|
blockTokens[LeftParenthesis] = BLOCK_OPEN_TOKEN;
|
|
blockTokens[LeftSquareBracket] = BLOCK_OPEN_TOKEN;
|
|
blockTokens[LeftCurlyBracket] = BLOCK_OPEN_TOKEN;
|
|
blockTokens[RightParenthesis] = BLOCK_CLOSE_TOKEN;
|
|
blockTokens[RightSquareBracket] = BLOCK_CLOSE_TOKEN;
|
|
blockTokens[RightCurlyBracket] = BLOCK_CLOSE_TOKEN;
|
|
function boundIndex(index, min, max) {
|
|
return index < min ? min : index > max ? max : index;
|
|
}
|
|
|
|
class TokenStream {
|
|
constructor(source, tokenize) {
|
|
this.setSource(source, tokenize);
|
|
}
|
|
reset() {
|
|
this.eof = false;
|
|
this.tokenIndex = -1;
|
|
this.tokenType = 0;
|
|
this.tokenStart = this.firstCharOffset;
|
|
this.tokenEnd = this.firstCharOffset;
|
|
}
|
|
setSource(source = "", tokenize = () => {}) {
|
|
source = String(source || "");
|
|
const sourceLength = source.length;
|
|
const offsetAndType = adoptBuffer(this.offsetAndType, source.length + 1);
|
|
const balance = adoptBuffer(this.balance, source.length + 1);
|
|
let tokenCount = 0;
|
|
let firstCharOffset = -1;
|
|
let balanceCloseType = 0;
|
|
let balanceStart = source.length;
|
|
this.offsetAndType = null;
|
|
this.balance = null;
|
|
balance.fill(0);
|
|
tokenize(source, (type, start, end) => {
|
|
const index = tokenCount++;
|
|
offsetAndType[index] = type << TYPE_SHIFT | end;
|
|
if (firstCharOffset === -1) {
|
|
firstCharOffset = start;
|
|
}
|
|
balance[index] = balanceStart;
|
|
if (type === balanceCloseType) {
|
|
const prevBalanceStart = balance[balanceStart];
|
|
balance[balanceStart] = index;
|
|
balanceStart = prevBalanceStart;
|
|
balanceCloseType = balancePair[offsetAndType[prevBalanceStart] >> TYPE_SHIFT];
|
|
} else if (this.isBlockOpenerTokenType(type)) {
|
|
balanceStart = index;
|
|
balanceCloseType = balancePair[type];
|
|
}
|
|
});
|
|
offsetAndType[tokenCount] = EOF << TYPE_SHIFT | sourceLength;
|
|
balance[tokenCount] = tokenCount;
|
|
for (let i = 0;i < tokenCount; i++) {
|
|
const balanceStart2 = balance[i];
|
|
if (balanceStart2 <= i) {
|
|
const balanceEnd = balance[balanceStart2];
|
|
if (balanceEnd !== i) {
|
|
balance[i] = balanceEnd;
|
|
}
|
|
} else if (balanceStart2 > tokenCount) {
|
|
balance[i] = tokenCount;
|
|
}
|
|
}
|
|
this.source = source;
|
|
this.firstCharOffset = firstCharOffset === -1 ? 0 : firstCharOffset;
|
|
this.tokenCount = tokenCount;
|
|
this.offsetAndType = offsetAndType;
|
|
this.balance = balance;
|
|
this.reset();
|
|
this.next();
|
|
}
|
|
lookupType(offset) {
|
|
offset += this.tokenIndex;
|
|
if (offset < this.tokenCount) {
|
|
return this.offsetAndType[offset] >> TYPE_SHIFT;
|
|
}
|
|
return EOF;
|
|
}
|
|
lookupTypeNonSC(idx) {
|
|
for (let offset = this.tokenIndex;offset < this.tokenCount; offset++) {
|
|
const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;
|
|
if (tokenType !== WhiteSpace && tokenType !== Comment3) {
|
|
if (idx-- === 0) {
|
|
return tokenType;
|
|
}
|
|
}
|
|
}
|
|
return EOF;
|
|
}
|
|
lookupOffset(offset) {
|
|
offset += this.tokenIndex;
|
|
if (offset < this.tokenCount) {
|
|
return this.offsetAndType[offset - 1] & OFFSET_MASK;
|
|
}
|
|
return this.source.length;
|
|
}
|
|
lookupOffsetNonSC(idx) {
|
|
for (let offset = this.tokenIndex;offset < this.tokenCount; offset++) {
|
|
const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;
|
|
if (tokenType !== WhiteSpace && tokenType !== Comment3) {
|
|
if (idx-- === 0) {
|
|
return offset - this.tokenIndex;
|
|
}
|
|
}
|
|
}
|
|
return EOF;
|
|
}
|
|
lookupValue(offset, referenceStr) {
|
|
offset += this.tokenIndex;
|
|
if (offset < this.tokenCount) {
|
|
return cmpStr(this.source, this.offsetAndType[offset - 1] & OFFSET_MASK, this.offsetAndType[offset] & OFFSET_MASK, referenceStr);
|
|
}
|
|
return false;
|
|
}
|
|
getTokenStart(tokenIndex) {
|
|
if (tokenIndex === this.tokenIndex) {
|
|
return this.tokenStart;
|
|
}
|
|
if (tokenIndex > 0) {
|
|
return tokenIndex < this.tokenCount ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
|
|
}
|
|
return this.firstCharOffset;
|
|
}
|
|
getTokenEnd(tokenIndex) {
|
|
if (tokenIndex === this.tokenIndex) {
|
|
return this.tokenEnd;
|
|
}
|
|
return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] & OFFSET_MASK;
|
|
}
|
|
getTokenType(tokenIndex) {
|
|
if (tokenIndex === this.tokenIndex) {
|
|
return this.tokenType;
|
|
}
|
|
return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] >> TYPE_SHIFT;
|
|
}
|
|
substrToCursor(start) {
|
|
return this.source.substring(start, this.tokenStart);
|
|
}
|
|
isBlockOpenerTokenType(tokenType) {
|
|
return blockTokens[tokenType] === BLOCK_OPEN_TOKEN;
|
|
}
|
|
isBlockCloserTokenType(tokenType) {
|
|
return blockTokens[tokenType] === BLOCK_CLOSE_TOKEN;
|
|
}
|
|
getBlockTokenPairIndex(tokenIndex) {
|
|
const type = this.getTokenType(tokenIndex);
|
|
if (blockTokens[type] === 1) {
|
|
const pairIndex = this.balance[tokenIndex];
|
|
const closeType = this.getTokenType(pairIndex);
|
|
return balancePair[type] === closeType ? pairIndex : -1;
|
|
} else if (blockTokens[type] === 2) {
|
|
const pairIndex = this.balance[tokenIndex];
|
|
const openType = this.getTokenType(pairIndex);
|
|
return balancePair[openType] === type ? pairIndex : -1;
|
|
}
|
|
return -1;
|
|
}
|
|
isBalanceEdge(tokenIndex) {
|
|
return this.balance[this.tokenIndex] < tokenIndex;
|
|
}
|
|
isDelim(code, offset) {
|
|
if (offset) {
|
|
return this.lookupType(offset) === Delim && this.source.charCodeAt(this.lookupOffset(offset)) === code;
|
|
}
|
|
return this.tokenType === Delim && this.source.charCodeAt(this.tokenStart) === code;
|
|
}
|
|
skip(tokenCount) {
|
|
let next = this.tokenIndex + tokenCount;
|
|
if (next < this.tokenCount) {
|
|
this.tokenIndex = next;
|
|
this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
|
|
next = this.offsetAndType[next];
|
|
this.tokenType = next >> TYPE_SHIFT;
|
|
this.tokenEnd = next & OFFSET_MASK;
|
|
} else {
|
|
this.tokenIndex = this.tokenCount;
|
|
this.next();
|
|
}
|
|
}
|
|
next() {
|
|
let next = this.tokenIndex + 1;
|
|
if (next < this.tokenCount) {
|
|
this.tokenIndex = next;
|
|
this.tokenStart = this.tokenEnd;
|
|
next = this.offsetAndType[next];
|
|
this.tokenType = next >> TYPE_SHIFT;
|
|
this.tokenEnd = next & OFFSET_MASK;
|
|
} else {
|
|
this.eof = true;
|
|
this.tokenIndex = this.tokenCount;
|
|
this.tokenType = EOF;
|
|
this.tokenStart = this.tokenEnd = this.source.length;
|
|
}
|
|
}
|
|
skipSC() {
|
|
while (this.tokenType === WhiteSpace || this.tokenType === Comment3) {
|
|
this.next();
|
|
}
|
|
}
|
|
skipUntilBalanced(startToken, stopConsume) {
|
|
let cursor = startToken;
|
|
let balanceEnd = 0;
|
|
let offset = 0;
|
|
loop:
|
|
for (;cursor < this.tokenCount; cursor++) {
|
|
balanceEnd = this.balance[cursor];
|
|
if (balanceEnd < startToken) {
|
|
break loop;
|
|
}
|
|
offset = cursor > 0 ? this.offsetAndType[cursor - 1] & OFFSET_MASK : this.firstCharOffset;
|
|
switch (stopConsume(this.source.charCodeAt(offset))) {
|
|
case 1:
|
|
break loop;
|
|
case 2:
|
|
cursor++;
|
|
break loop;
|
|
default:
|
|
if (this.isBlockOpenerTokenType(this.offsetAndType[cursor] >> TYPE_SHIFT)) {
|
|
cursor = balanceEnd;
|
|
}
|
|
}
|
|
}
|
|
this.skip(cursor - this.tokenIndex);
|
|
}
|
|
forEachToken(fn) {
|
|
for (let i = 0, offset = this.firstCharOffset;i < this.tokenCount; i++) {
|
|
const start = offset;
|
|
const item = this.offsetAndType[i];
|
|
const end = item & OFFSET_MASK;
|
|
const type = item >> TYPE_SHIFT;
|
|
offset = end;
|
|
fn(type, start, end, i);
|
|
}
|
|
}
|
|
dump() {
|
|
const tokens = new Array(this.tokenCount);
|
|
this.forEachToken((type, start, end, index) => {
|
|
tokens[index] = {
|
|
idx: index,
|
|
type: names_default[type],
|
|
chunk: this.source.substring(start, end),
|
|
balance: this.balance[index]
|
|
};
|
|
});
|
|
return tokens;
|
|
}
|
|
}
|
|
|
|
// node_modules/css-tree/lib/tokenizer/index.js
|
|
function tokenize(source, onToken) {
|
|
function getCharCode2(offset2) {
|
|
return offset2 < sourceLength ? source.charCodeAt(offset2) : 0;
|
|
}
|
|
function consumeNumericToken() {
|
|
offset = consumeNumber(source, offset);
|
|
if (isIdentifierStart(getCharCode2(offset), getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
type = Dimension;
|
|
offset = consumeName(source, offset);
|
|
return;
|
|
}
|
|
if (getCharCode2(offset) === 37) {
|
|
type = Percentage;
|
|
offset++;
|
|
return;
|
|
}
|
|
type = Number2;
|
|
}
|
|
function consumeIdentLikeToken() {
|
|
const nameStartOffset = offset;
|
|
offset = consumeName(source, offset);
|
|
if (cmpStr(source, nameStartOffset, offset, "url") && getCharCode2(offset) === 40) {
|
|
offset = findWhiteSpaceEnd(source, offset + 1);
|
|
if (getCharCode2(offset) === 34 || getCharCode2(offset) === 39) {
|
|
type = Function;
|
|
offset = nameStartOffset + 4;
|
|
return;
|
|
}
|
|
consumeUrlToken();
|
|
return;
|
|
}
|
|
if (getCharCode2(offset) === 40) {
|
|
type = Function;
|
|
offset++;
|
|
return;
|
|
}
|
|
type = Ident;
|
|
}
|
|
function consumeStringToken(endingCodePoint) {
|
|
if (!endingCodePoint) {
|
|
endingCodePoint = getCharCode2(offset++);
|
|
}
|
|
type = String2;
|
|
for (;offset < source.length; offset++) {
|
|
const code = source.charCodeAt(offset);
|
|
switch (charCodeCategory(code)) {
|
|
case endingCodePoint:
|
|
offset++;
|
|
return;
|
|
case WhiteSpaceCategory:
|
|
if (isNewline(code)) {
|
|
offset += getNewlineLength(source, offset, code);
|
|
type = BadString;
|
|
return;
|
|
}
|
|
break;
|
|
case 92:
|
|
if (offset === source.length - 1) {
|
|
break;
|
|
}
|
|
const nextCode = getCharCode2(offset + 1);
|
|
if (isNewline(nextCode)) {
|
|
offset += getNewlineLength(source, offset + 1, nextCode);
|
|
} else if (isValidEscape(code, nextCode)) {
|
|
offset = consumeEscaped(source, offset) - 1;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function consumeUrlToken() {
|
|
type = Url;
|
|
offset = findWhiteSpaceEnd(source, offset);
|
|
for (;offset < source.length; offset++) {
|
|
const code = source.charCodeAt(offset);
|
|
switch (charCodeCategory(code)) {
|
|
case 41:
|
|
offset++;
|
|
return;
|
|
case WhiteSpaceCategory:
|
|
offset = findWhiteSpaceEnd(source, offset);
|
|
if (getCharCode2(offset) === 41 || offset >= source.length) {
|
|
if (offset < source.length) {
|
|
offset++;
|
|
}
|
|
return;
|
|
}
|
|
offset = consumeBadUrlRemnants(source, offset);
|
|
type = BadUrl;
|
|
return;
|
|
case 34:
|
|
case 39:
|
|
case 40:
|
|
case NonPrintableCategory:
|
|
offset = consumeBadUrlRemnants(source, offset);
|
|
type = BadUrl;
|
|
return;
|
|
case 92:
|
|
if (isValidEscape(code, getCharCode2(offset + 1))) {
|
|
offset = consumeEscaped(source, offset) - 1;
|
|
break;
|
|
}
|
|
offset = consumeBadUrlRemnants(source, offset);
|
|
type = BadUrl;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
source = String(source || "");
|
|
const sourceLength = source.length;
|
|
let start = isBOM(getCharCode2(0));
|
|
let offset = start;
|
|
let type;
|
|
while (offset < sourceLength) {
|
|
const code = source.charCodeAt(offset);
|
|
switch (charCodeCategory(code)) {
|
|
case WhiteSpaceCategory:
|
|
type = WhiteSpace;
|
|
offset = findWhiteSpaceEnd(source, offset + 1);
|
|
break;
|
|
case 34:
|
|
consumeStringToken();
|
|
break;
|
|
case 35:
|
|
if (isName(getCharCode2(offset + 1)) || isValidEscape(getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
type = Hash;
|
|
offset = consumeName(source, offset + 1);
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 39:
|
|
consumeStringToken();
|
|
break;
|
|
case 40:
|
|
type = LeftParenthesis;
|
|
offset++;
|
|
break;
|
|
case 41:
|
|
type = RightParenthesis;
|
|
offset++;
|
|
break;
|
|
case 43:
|
|
if (isNumberStart(code, getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
consumeNumericToken();
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 44:
|
|
type = Comma;
|
|
offset++;
|
|
break;
|
|
case 45:
|
|
if (isNumberStart(code, getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
consumeNumericToken();
|
|
} else {
|
|
if (getCharCode2(offset + 1) === 45 && getCharCode2(offset + 2) === 62) {
|
|
type = CDC;
|
|
offset = offset + 3;
|
|
} else {
|
|
if (isIdentifierStart(code, getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
consumeIdentLikeToken();
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 46:
|
|
if (isNumberStart(code, getCharCode2(offset + 1), getCharCode2(offset + 2))) {
|
|
consumeNumericToken();
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 47:
|
|
if (getCharCode2(offset + 1) === 42) {
|
|
type = Comment3;
|
|
offset = source.indexOf("*/", offset + 2);
|
|
offset = offset === -1 ? source.length : offset + 2;
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 58:
|
|
type = Colon;
|
|
offset++;
|
|
break;
|
|
case 59:
|
|
type = Semicolon;
|
|
offset++;
|
|
break;
|
|
case 60:
|
|
if (getCharCode2(offset + 1) === 33 && getCharCode2(offset + 2) === 45 && getCharCode2(offset + 3) === 45) {
|
|
type = CDO;
|
|
offset = offset + 4;
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 64:
|
|
if (isIdentifierStart(getCharCode2(offset + 1), getCharCode2(offset + 2), getCharCode2(offset + 3))) {
|
|
type = AtKeyword;
|
|
offset = consumeName(source, offset + 1);
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 91:
|
|
type = LeftSquareBracket;
|
|
offset++;
|
|
break;
|
|
case 92:
|
|
if (isValidEscape(code, getCharCode2(offset + 1))) {
|
|
consumeIdentLikeToken();
|
|
} else {
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
break;
|
|
case 93:
|
|
type = RightSquareBracket;
|
|
offset++;
|
|
break;
|
|
case 123:
|
|
type = LeftCurlyBracket;
|
|
offset++;
|
|
break;
|
|
case 125:
|
|
type = RightCurlyBracket;
|
|
offset++;
|
|
break;
|
|
case DigitCategory:
|
|
consumeNumericToken();
|
|
break;
|
|
case NameStartCategory:
|
|
consumeIdentLikeToken();
|
|
break;
|
|
default:
|
|
type = Delim;
|
|
offset++;
|
|
}
|
|
onToken(type, start, start = offset);
|
|
}
|
|
}
|
|
|
|
// node_modules/css-tree/lib/parser/sequence.js
|
|
function readSequence(recognizer) {
|
|
const children = this.createList();
|
|
let space = false;
|
|
const context = {
|
|
recognizer
|
|
};
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case Comment3:
|
|
this.next();
|
|
continue;
|
|
case WhiteSpace:
|
|
space = true;
|
|
this.next();
|
|
continue;
|
|
}
|
|
let child = recognizer.getNode.call(this, context);
|
|
if (child === undefined) {
|
|
break;
|
|
}
|
|
if (space) {
|
|
if (recognizer.onWhiteSpace) {
|
|
recognizer.onWhiteSpace.call(this, child, children, context);
|
|
}
|
|
space = false;
|
|
}
|
|
children.push(child);
|
|
}
|
|
if (space && recognizer.onWhiteSpace) {
|
|
recognizer.onWhiteSpace.call(this, null, children, context);
|
|
}
|
|
return children;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/parser/create.js
|
|
var NOOP = () => {};
|
|
var EXCLAMATIONMARK = 33;
|
|
var NUMBERSIGN = 35;
|
|
var SEMICOLON = 59;
|
|
var LEFTCURLYBRACKET = 123;
|
|
var NULL = 0;
|
|
var arrayMethods = {
|
|
createList() {
|
|
return [];
|
|
},
|
|
createSingleNodeList(node2) {
|
|
return [node2];
|
|
},
|
|
getFirstListNode(list) {
|
|
return list && list[0] || null;
|
|
},
|
|
getLastListNode(list) {
|
|
return list && list.length > 0 ? list[list.length - 1] : null;
|
|
}
|
|
};
|
|
var listMethods = {
|
|
createList() {
|
|
return new List;
|
|
},
|
|
createSingleNodeList(node2) {
|
|
return new List().appendData(node2);
|
|
},
|
|
getFirstListNode(list) {
|
|
return list && list.first;
|
|
},
|
|
getLastListNode(list) {
|
|
return list && list.last;
|
|
}
|
|
};
|
|
function createParseContext(name) {
|
|
return function() {
|
|
return this[name]();
|
|
};
|
|
}
|
|
function fetchParseValues(dict) {
|
|
const result = Object.create(null);
|
|
for (const name of Object.keys(dict)) {
|
|
const item = dict[name];
|
|
const fn = item.parse || item;
|
|
if (fn) {
|
|
result[name] = fn;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function processConfig(config) {
|
|
const parseConfig = {
|
|
context: Object.create(null),
|
|
features: Object.assign(Object.create(null), config.features),
|
|
scope: Object.assign(Object.create(null), config.scope),
|
|
atrule: fetchParseValues(config.atrule),
|
|
pseudo: fetchParseValues(config.pseudo),
|
|
node: fetchParseValues(config.node)
|
|
};
|
|
for (const [name, context] of Object.entries(config.parseContext)) {
|
|
switch (typeof context) {
|
|
case "function":
|
|
parseConfig.context[name] = context;
|
|
break;
|
|
case "string":
|
|
parseConfig.context[name] = createParseContext(context);
|
|
break;
|
|
}
|
|
}
|
|
return {
|
|
config: parseConfig,
|
|
...parseConfig,
|
|
...parseConfig.node
|
|
};
|
|
}
|
|
function createParser(config) {
|
|
let source = "";
|
|
let filename = "<unknown>";
|
|
let needPositions = false;
|
|
let onParseError = NOOP;
|
|
let onParseErrorThrow = false;
|
|
const locationMap = new OffsetToLocation;
|
|
const parser = Object.assign(new TokenStream, processConfig(config || {}), {
|
|
parseAtrulePrelude: true,
|
|
parseRulePrelude: true,
|
|
parseValue: true,
|
|
parseCustomProperty: false,
|
|
readSequence,
|
|
consumeUntilBalanceEnd: () => 0,
|
|
consumeUntilLeftCurlyBracket(code) {
|
|
return code === LEFTCURLYBRACKET ? 1 : 0;
|
|
},
|
|
consumeUntilLeftCurlyBracketOrSemicolon(code) {
|
|
return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;
|
|
},
|
|
consumeUntilExclamationMarkOrSemicolon(code) {
|
|
return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;
|
|
},
|
|
consumeUntilSemicolonIncluded(code) {
|
|
return code === SEMICOLON ? 2 : 0;
|
|
},
|
|
createList: NOOP,
|
|
createSingleNodeList: NOOP,
|
|
getFirstListNode: NOOP,
|
|
getLastListNode: NOOP,
|
|
parseWithFallback(consumer, fallback) {
|
|
const startIndex = this.tokenIndex;
|
|
try {
|
|
return consumer.call(this);
|
|
} catch (e) {
|
|
if (onParseErrorThrow) {
|
|
throw e;
|
|
}
|
|
this.skip(startIndex - this.tokenIndex);
|
|
const fallbackNode = fallback.call(this);
|
|
onParseErrorThrow = true;
|
|
onParseError(e, fallbackNode);
|
|
onParseErrorThrow = false;
|
|
return fallbackNode;
|
|
}
|
|
},
|
|
lookupNonWSType(offset) {
|
|
let type;
|
|
do {
|
|
type = this.lookupType(offset++);
|
|
if (type !== WhiteSpace && type !== Comment3) {
|
|
return type;
|
|
}
|
|
} while (type !== NULL);
|
|
return NULL;
|
|
},
|
|
charCodeAt(offset) {
|
|
return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;
|
|
},
|
|
substring(offsetStart, offsetEnd) {
|
|
return source.substring(offsetStart, offsetEnd);
|
|
},
|
|
substrToCursor(start) {
|
|
return this.source.substring(start, this.tokenStart);
|
|
},
|
|
cmpChar(offset, charCode) {
|
|
return cmpChar(source, offset, charCode);
|
|
},
|
|
cmpStr(offsetStart, offsetEnd, str) {
|
|
return cmpStr(source, offsetStart, offsetEnd, str);
|
|
},
|
|
consume(tokenType) {
|
|
const start = this.tokenStart;
|
|
this.eat(tokenType);
|
|
return this.substrToCursor(start);
|
|
},
|
|
consumeFunctionName() {
|
|
const name = source.substring(this.tokenStart, this.tokenEnd - 1);
|
|
this.eat(Function);
|
|
return name;
|
|
},
|
|
consumeNumber(type) {
|
|
const number = source.substring(this.tokenStart, consumeNumber(source, this.tokenStart));
|
|
this.eat(type);
|
|
return number;
|
|
},
|
|
eat(tokenType) {
|
|
if (this.tokenType !== tokenType) {
|
|
const tokenName = names_default[tokenType].slice(0, -6).replace(/-/g, " ").replace(/^./, (m) => m.toUpperCase());
|
|
let message = `${/[[\](){}]/.test(tokenName) ? `"${tokenName}"` : tokenName} is expected`;
|
|
let offset = this.tokenStart;
|
|
switch (tokenType) {
|
|
case Ident:
|
|
if (this.tokenType === Function || this.tokenType === Url) {
|
|
offset = this.tokenEnd - 1;
|
|
message = "Identifier is expected but function found";
|
|
} else {
|
|
message = "Identifier is expected";
|
|
}
|
|
break;
|
|
case Hash:
|
|
if (this.isDelim(NUMBERSIGN)) {
|
|
this.next();
|
|
offset++;
|
|
message = "Name is expected";
|
|
}
|
|
break;
|
|
case Percentage:
|
|
if (this.tokenType === Number2) {
|
|
offset = this.tokenEnd;
|
|
message = "Percent sign is expected";
|
|
}
|
|
break;
|
|
}
|
|
this.error(message, offset);
|
|
}
|
|
this.next();
|
|
},
|
|
eatIdent(name) {
|
|
if (this.tokenType !== Ident || this.lookupValue(0, name) === false) {
|
|
this.error(`Identifier "${name}" is expected`);
|
|
}
|
|
this.next();
|
|
},
|
|
eatDelim(code) {
|
|
if (!this.isDelim(code)) {
|
|
this.error(`Delim "${String.fromCharCode(code)}" is expected`);
|
|
}
|
|
this.next();
|
|
},
|
|
getLocation(start, end) {
|
|
if (needPositions) {
|
|
return locationMap.getLocationRange(start, end, filename);
|
|
}
|
|
return null;
|
|
},
|
|
getLocationFromList(list) {
|
|
if (needPositions) {
|
|
const head = this.getFirstListNode(list);
|
|
const tail = this.getLastListNode(list);
|
|
return locationMap.getLocationRange(head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart, tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart, filename);
|
|
}
|
|
return null;
|
|
},
|
|
error(message, offset) {
|
|
const location = typeof offset !== "undefined" && offset < source.length ? locationMap.getLocation(offset) : this.eof ? locationMap.getLocation(findWhiteSpaceStart(source, source.length - 1)) : locationMap.getLocation(this.tokenStart);
|
|
throw new SyntaxError2(message || "Unexpected input", source, location.offset, location.line, location.column, locationMap.startLine, locationMap.startColumn);
|
|
}
|
|
});
|
|
const createTokenIterateAPI = () => ({
|
|
filename,
|
|
source,
|
|
tokenCount: parser.tokenCount,
|
|
getTokenType: (index) => parser.getTokenType(index),
|
|
getTokenTypeName: (index) => names_default[parser.getTokenType(index)],
|
|
getTokenStart: (index) => parser.getTokenStart(index),
|
|
getTokenEnd: (index) => parser.getTokenEnd(index),
|
|
getTokenValue: (index) => parser.source.substring(parser.getTokenStart(index), parser.getTokenEnd(index)),
|
|
substring: (start, end) => parser.source.substring(start, end),
|
|
balance: parser.balance.subarray(0, parser.tokenCount + 1),
|
|
isBlockOpenerTokenType: parser.isBlockOpenerTokenType,
|
|
isBlockCloserTokenType: parser.isBlockCloserTokenType,
|
|
getBlockTokenPairIndex: (index) => parser.getBlockTokenPairIndex(index),
|
|
getLocation: (offset) => locationMap.getLocation(offset, filename),
|
|
getRangeLocation: (start, end) => locationMap.getLocationRange(start, end, filename)
|
|
});
|
|
const parse3 = function(source_, options) {
|
|
source = source_;
|
|
options = options || {};
|
|
parser.setSource(source, tokenize);
|
|
locationMap.setSource(source, options.offset, options.line, options.column);
|
|
filename = options.filename || "<unknown>";
|
|
needPositions = Boolean(options.positions);
|
|
onParseError = typeof options.onParseError === "function" ? options.onParseError : NOOP;
|
|
onParseErrorThrow = false;
|
|
parser.parseAtrulePrelude = "parseAtrulePrelude" in options ? Boolean(options.parseAtrulePrelude) : true;
|
|
parser.parseRulePrelude = "parseRulePrelude" in options ? Boolean(options.parseRulePrelude) : true;
|
|
parser.parseValue = "parseValue" in options ? Boolean(options.parseValue) : true;
|
|
parser.parseCustomProperty = "parseCustomProperty" in options ? Boolean(options.parseCustomProperty) : false;
|
|
const { context = "default", list = true, onComment, onToken } = options;
|
|
if (context in parser.context === false) {
|
|
throw new Error("Unknown context `" + context + "`");
|
|
}
|
|
Object.assign(parser, list ? listMethods : arrayMethods);
|
|
if (Array.isArray(onToken)) {
|
|
parser.forEachToken((type, start, end) => {
|
|
onToken.push({ type, start, end });
|
|
});
|
|
} else if (typeof onToken === "function") {
|
|
parser.forEachToken(onToken.bind(createTokenIterateAPI()));
|
|
}
|
|
if (typeof onComment === "function") {
|
|
parser.forEachToken((type, start, end) => {
|
|
if (type === Comment3) {
|
|
const loc = parser.getLocation(start, end);
|
|
const value = cmpStr(source, end - 2, end, "*/") ? source.slice(start + 2, end - 2) : source.slice(start + 2, end);
|
|
onComment(value, loc);
|
|
}
|
|
});
|
|
}
|
|
const ast = parser.context[context].call(parser, options);
|
|
if (!parser.eof) {
|
|
parser.error();
|
|
}
|
|
return ast;
|
|
};
|
|
return Object.assign(parse3, {
|
|
SyntaxError: SyntaxError2,
|
|
config: parser.config
|
|
});
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/scope/index.js
|
|
var exports_scope = {};
|
|
__export(exports_scope, {
|
|
Value: () => value_default,
|
|
Selector: () => selector_default,
|
|
AtrulePrelude: () => atrulePrelude_default
|
|
});
|
|
|
|
// node_modules/css-tree/lib/syntax/scope/default.js
|
|
var NUMBERSIGN2 = 35;
|
|
var ASTERISK = 42;
|
|
var PLUSSIGN = 43;
|
|
var HYPHENMINUS = 45;
|
|
var SOLIDUS = 47;
|
|
var U = 117;
|
|
function defaultRecognizer(context) {
|
|
switch (this.tokenType) {
|
|
case Hash:
|
|
return this.Hash();
|
|
case Comma:
|
|
return this.Operator();
|
|
case LeftParenthesis:
|
|
return this.Parentheses(this.readSequence, context.recognizer);
|
|
case LeftSquareBracket:
|
|
return this.Brackets(this.readSequence, context.recognizer);
|
|
case String2:
|
|
return this.String();
|
|
case Dimension:
|
|
return this.Dimension();
|
|
case Percentage:
|
|
return this.Percentage();
|
|
case Number2:
|
|
return this.Number();
|
|
case Function:
|
|
return this.cmpStr(this.tokenStart, this.tokenEnd, "url(") ? this.Url() : this.Function(this.readSequence, context.recognizer);
|
|
case Url:
|
|
return this.Url();
|
|
case Ident:
|
|
if (this.cmpChar(this.tokenStart, U) && this.cmpChar(this.tokenStart + 1, PLUSSIGN)) {
|
|
return this.UnicodeRange();
|
|
} else {
|
|
return this.Identifier();
|
|
}
|
|
case Delim: {
|
|
const code = this.charCodeAt(this.tokenStart);
|
|
if (code === SOLIDUS || code === ASTERISK || code === PLUSSIGN || code === HYPHENMINUS) {
|
|
return this.Operator();
|
|
}
|
|
if (code === NUMBERSIGN2) {
|
|
this.error("Hex or identifier is expected", this.tokenStart + 1);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/scope/atrulePrelude.js
|
|
var atrulePrelude_default = {
|
|
getNode: defaultRecognizer
|
|
};
|
|
// node_modules/css-tree/lib/syntax/scope/selector.js
|
|
var NUMBERSIGN3 = 35;
|
|
var AMPERSAND = 38;
|
|
var ASTERISK2 = 42;
|
|
var PLUSSIGN2 = 43;
|
|
var SOLIDUS2 = 47;
|
|
var FULLSTOP = 46;
|
|
var GREATERTHANSIGN = 62;
|
|
var VERTICALLINE = 124;
|
|
var TILDE = 126;
|
|
function onWhiteSpace(next, children) {
|
|
if (children.last !== null && children.last.type !== "Combinator" && next !== null && next.type !== "Combinator") {
|
|
children.push({
|
|
type: "Combinator",
|
|
loc: null,
|
|
name: " "
|
|
});
|
|
}
|
|
}
|
|
function getNode() {
|
|
switch (this.tokenType) {
|
|
case LeftSquareBracket:
|
|
return this.AttributeSelector();
|
|
case Hash:
|
|
return this.IdSelector();
|
|
case Colon:
|
|
if (this.lookupType(1) === Colon) {
|
|
return this.PseudoElementSelector();
|
|
} else {
|
|
return this.PseudoClassSelector();
|
|
}
|
|
case Ident:
|
|
return this.TypeSelector();
|
|
case Number2:
|
|
case Percentage:
|
|
return this.Percentage();
|
|
case Dimension:
|
|
if (this.charCodeAt(this.tokenStart) === FULLSTOP) {
|
|
this.error("Identifier is expected", this.tokenStart + 1);
|
|
}
|
|
break;
|
|
case Delim: {
|
|
const code = this.charCodeAt(this.tokenStart);
|
|
switch (code) {
|
|
case PLUSSIGN2:
|
|
case GREATERTHANSIGN:
|
|
case TILDE:
|
|
case SOLIDUS2:
|
|
return this.Combinator();
|
|
case FULLSTOP:
|
|
return this.ClassSelector();
|
|
case ASTERISK2:
|
|
case VERTICALLINE:
|
|
return this.TypeSelector();
|
|
case NUMBERSIGN3:
|
|
return this.IdSelector();
|
|
case AMPERSAND:
|
|
return this.NestingSelector();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
var selector_default = {
|
|
onWhiteSpace,
|
|
getNode
|
|
};
|
|
// node_modules/css-tree/lib/syntax/function/expression.js
|
|
function expression_default() {
|
|
return this.createSingleNodeList(this.Raw(null, false));
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/function/var.js
|
|
function var_default() {
|
|
const children = this.createList();
|
|
this.skipSC();
|
|
children.push(this.Identifier());
|
|
this.skipSC();
|
|
if (this.tokenType === Comma) {
|
|
children.push(this.Operator());
|
|
const startIndex = this.tokenIndex;
|
|
const value = this.parseCustomProperty ? this.Value(null) : this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);
|
|
if (value.type === "Value" && value.children.isEmpty) {
|
|
for (let offset = startIndex - this.tokenIndex;offset <= 0; offset++) {
|
|
if (this.lookupType(offset) === WhiteSpace) {
|
|
value.children.appendData({
|
|
type: "WhiteSpace",
|
|
loc: null,
|
|
value: " "
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
children.push(value);
|
|
}
|
|
return children;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/scope/value.js
|
|
function isPlusMinusOperator(node2) {
|
|
return node2 !== null && node2.type === "Operator" && (node2.value[node2.value.length - 1] === "-" || node2.value[node2.value.length - 1] === "+");
|
|
}
|
|
var value_default = {
|
|
getNode: defaultRecognizer,
|
|
onWhiteSpace(next, children) {
|
|
if (isPlusMinusOperator(next)) {
|
|
next.value = " " + next.value;
|
|
}
|
|
if (isPlusMinusOperator(children.last)) {
|
|
children.last.value += " ";
|
|
}
|
|
},
|
|
expression: expression_default,
|
|
var: var_default
|
|
};
|
|
// node_modules/css-tree/lib/syntax/atrule/container.js
|
|
var nonContainerNameKeywords = new Set(["none", "and", "not", "or"]);
|
|
var container_default = {
|
|
parse: {
|
|
prelude() {
|
|
const children = this.createList();
|
|
if (this.tokenType === Ident) {
|
|
const name = this.substring(this.tokenStart, this.tokenEnd);
|
|
if (!nonContainerNameKeywords.has(name.toLowerCase())) {
|
|
children.push(this.Identifier());
|
|
}
|
|
}
|
|
children.push(this.Condition("container"));
|
|
return children;
|
|
},
|
|
block(nested = false) {
|
|
return this.Block(nested);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/font-face.js
|
|
var font_face_default = {
|
|
parse: {
|
|
prelude: null,
|
|
block() {
|
|
return this.Block(true);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/import.js
|
|
function parseWithFallback(parse3, fallback) {
|
|
return this.parseWithFallback(() => {
|
|
try {
|
|
return parse3.call(this);
|
|
} finally {
|
|
this.skipSC();
|
|
if (this.lookupNonWSType(0) !== RightParenthesis) {
|
|
this.error();
|
|
}
|
|
}
|
|
}, fallback || (() => this.Raw(null, true)));
|
|
}
|
|
var parseFunctions = {
|
|
layer() {
|
|
this.skipSC();
|
|
const children = this.createList();
|
|
const node2 = parseWithFallback.call(this, this.Layer);
|
|
if (node2.type !== "Raw" || node2.value !== "") {
|
|
children.push(node2);
|
|
}
|
|
return children;
|
|
},
|
|
supports() {
|
|
this.skipSC();
|
|
const children = this.createList();
|
|
const node2 = parseWithFallback.call(this, this.Declaration, () => parseWithFallback.call(this, () => this.Condition("supports")));
|
|
if (node2.type !== "Raw" || node2.value !== "") {
|
|
children.push(node2);
|
|
}
|
|
return children;
|
|
}
|
|
};
|
|
var import_default3 = {
|
|
parse: {
|
|
prelude() {
|
|
const children = this.createList();
|
|
switch (this.tokenType) {
|
|
case String2:
|
|
children.push(this.String());
|
|
break;
|
|
case Url:
|
|
case Function:
|
|
children.push(this.Url());
|
|
break;
|
|
default:
|
|
this.error("String or url() is expected");
|
|
}
|
|
this.skipSC();
|
|
if (this.tokenType === Ident && this.cmpStr(this.tokenStart, this.tokenEnd, "layer")) {
|
|
children.push(this.Identifier());
|
|
} else if (this.tokenType === Function && this.cmpStr(this.tokenStart, this.tokenEnd, "layer(")) {
|
|
children.push(this.Function(null, parseFunctions));
|
|
}
|
|
this.skipSC();
|
|
if (this.tokenType === Function && this.cmpStr(this.tokenStart, this.tokenEnd, "supports(")) {
|
|
children.push(this.Function(null, parseFunctions));
|
|
}
|
|
if (this.lookupNonWSType(0) === Ident || this.lookupNonWSType(0) === LeftParenthesis) {
|
|
children.push(this.MediaQueryList());
|
|
}
|
|
return children;
|
|
},
|
|
block: null
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/layer.js
|
|
var layer_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.LayerList());
|
|
},
|
|
block() {
|
|
return this.Block(false);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/media.js
|
|
var media_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.MediaQueryList());
|
|
},
|
|
block(nested = false) {
|
|
return this.Block(nested);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/nest.js
|
|
var nest_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.SelectorList());
|
|
},
|
|
block() {
|
|
return this.Block(true);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/page.js
|
|
var page_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.SelectorList());
|
|
},
|
|
block() {
|
|
return this.Block(true);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/scope.js
|
|
var scope_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.Scope());
|
|
},
|
|
block(nested = false) {
|
|
return this.Block(nested);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/starting-style.js
|
|
var starting_style_default = {
|
|
parse: {
|
|
prelude: null,
|
|
block(nested = false) {
|
|
return this.Block(nested);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/supports.js
|
|
var supports_default = {
|
|
parse: {
|
|
prelude() {
|
|
return this.createSingleNodeList(this.Condition("supports"));
|
|
},
|
|
block(nested = false) {
|
|
return this.Block(nested);
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/atrule/index.js
|
|
var atrule_default = {
|
|
container: container_default,
|
|
"font-face": font_face_default,
|
|
import: import_default3,
|
|
layer: layer_default,
|
|
media: media_default,
|
|
nest: nest_default,
|
|
page: page_default,
|
|
scope: scope_default,
|
|
"starting-style": starting_style_default,
|
|
supports: supports_default
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/pseudo/lang.js
|
|
function parseLanguageRangeList() {
|
|
const children = this.createList();
|
|
this.skipSC();
|
|
loop:
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case Ident:
|
|
children.push(this.Identifier());
|
|
break;
|
|
case String2:
|
|
children.push(this.String());
|
|
break;
|
|
case Comma:
|
|
children.push(this.Operator());
|
|
break;
|
|
case RightParenthesis:
|
|
break loop;
|
|
default:
|
|
this.error("Identifier, string or comma is expected");
|
|
}
|
|
this.skipSC();
|
|
}
|
|
return children;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/pseudo/index.js
|
|
var selectorList = {
|
|
parse() {
|
|
return this.createSingleNodeList(this.SelectorList());
|
|
}
|
|
};
|
|
var selector = {
|
|
parse() {
|
|
return this.createSingleNodeList(this.Selector());
|
|
}
|
|
};
|
|
var identList = {
|
|
parse() {
|
|
return this.createSingleNodeList(this.Identifier());
|
|
}
|
|
};
|
|
var langList = {
|
|
parse: parseLanguageRangeList
|
|
};
|
|
var nth = {
|
|
parse() {
|
|
return this.createSingleNodeList(this.Nth());
|
|
}
|
|
};
|
|
var pseudo_default = {
|
|
dir: identList,
|
|
has: selectorList,
|
|
lang: langList,
|
|
matches: selectorList,
|
|
is: selectorList,
|
|
"-moz-any": selectorList,
|
|
"-webkit-any": selectorList,
|
|
where: selectorList,
|
|
not: selectorList,
|
|
"nth-child": nth,
|
|
"nth-last-child": nth,
|
|
"nth-last-of-type": nth,
|
|
"nth-of-type": nth,
|
|
slotted: selector,
|
|
host: selector,
|
|
"host-context": selector
|
|
};
|
|
|
|
// node_modules/css-tree/lib/syntax/node/index-parse.js
|
|
var exports_index_parse = {};
|
|
__export(exports_index_parse, {
|
|
WhiteSpace: () => parse51,
|
|
Value: () => parse50,
|
|
Url: () => parse49,
|
|
UnicodeRange: () => parse48,
|
|
TypeSelector: () => parse47,
|
|
SupportsDeclaration: () => parse46,
|
|
StyleSheet: () => parse45,
|
|
String: () => parse44,
|
|
SelectorList: () => parse43,
|
|
Selector: () => parse42,
|
|
Scope: () => parse41,
|
|
Rule: () => parse40,
|
|
Raw: () => parse39,
|
|
Ratio: () => parse38,
|
|
PseudoElementSelector: () => parse37,
|
|
PseudoClassSelector: () => parse36,
|
|
Percentage: () => parse35,
|
|
Parentheses: () => parse34,
|
|
Operator: () => parse33,
|
|
Number: () => parse32,
|
|
Nth: () => parse31,
|
|
NestingSelector: () => parse30,
|
|
MediaQueryList: () => parse29,
|
|
MediaQuery: () => parse28,
|
|
LayerList: () => parse27,
|
|
Layer: () => parse26,
|
|
Identifier: () => parse24,
|
|
IdSelector: () => parse25,
|
|
Hash: () => parse23,
|
|
GeneralEnclosed: () => parse22,
|
|
Function: () => parse21,
|
|
FeatureRange: () => parse20,
|
|
FeatureFunction: () => parse19,
|
|
Feature: () => parse18,
|
|
Dimension: () => parse17,
|
|
DeclarationList: () => parse16,
|
|
Declaration: () => parse15,
|
|
Condition: () => parse14,
|
|
Comment: () => parse13,
|
|
Combinator: () => parse12,
|
|
ClassSelector: () => parse11,
|
|
CDO: () => parse10,
|
|
CDC: () => parse9,
|
|
Brackets: () => parse8,
|
|
Block: () => parse7,
|
|
AttributeSelector: () => parse6,
|
|
AtrulePrelude: () => parse5,
|
|
Atrule: () => parse4,
|
|
AnPlusB: () => parse3
|
|
});
|
|
|
|
// node_modules/css-tree/lib/syntax/node/AnPlusB.js
|
|
var PLUSSIGN3 = 43;
|
|
var HYPHENMINUS2 = 45;
|
|
var N2 = 110;
|
|
var DISALLOW_SIGN = true;
|
|
var ALLOW_SIGN = false;
|
|
function checkInteger(offset, disallowSign) {
|
|
let pos = this.tokenStart + offset;
|
|
const code = this.charCodeAt(pos);
|
|
if (code === PLUSSIGN3 || code === HYPHENMINUS2) {
|
|
if (disallowSign) {
|
|
this.error("Number sign is not allowed");
|
|
}
|
|
pos++;
|
|
}
|
|
for (;pos < this.tokenEnd; pos++) {
|
|
if (!isDigit(this.charCodeAt(pos))) {
|
|
this.error("Integer is expected", pos);
|
|
}
|
|
}
|
|
}
|
|
function checkTokenIsInteger(disallowSign) {
|
|
return checkInteger.call(this, 0, disallowSign);
|
|
}
|
|
function expectCharCode(offset, code) {
|
|
if (!this.cmpChar(this.tokenStart + offset, code)) {
|
|
let msg = "";
|
|
switch (code) {
|
|
case N2:
|
|
msg = "N is expected";
|
|
break;
|
|
case HYPHENMINUS2:
|
|
msg = "HyphenMinus is expected";
|
|
break;
|
|
}
|
|
this.error(msg, this.tokenStart + offset);
|
|
}
|
|
}
|
|
function consumeB() {
|
|
let offset = 0;
|
|
let sign = 0;
|
|
let type = this.tokenType;
|
|
while (type === WhiteSpace || type === Comment3) {
|
|
type = this.lookupType(++offset);
|
|
}
|
|
if (type !== Number2) {
|
|
if (this.isDelim(PLUSSIGN3, offset) || this.isDelim(HYPHENMINUS2, offset)) {
|
|
sign = this.isDelim(PLUSSIGN3, offset) ? PLUSSIGN3 : HYPHENMINUS2;
|
|
do {
|
|
type = this.lookupType(++offset);
|
|
} while (type === WhiteSpace || type === Comment3);
|
|
if (type !== Number2) {
|
|
this.skip(offset);
|
|
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
|
}
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
if (offset > 0) {
|
|
this.skip(offset);
|
|
}
|
|
if (sign === 0) {
|
|
type = this.charCodeAt(this.tokenStart);
|
|
if (type !== PLUSSIGN3 && type !== HYPHENMINUS2) {
|
|
this.error("Number sign is expected");
|
|
}
|
|
}
|
|
checkTokenIsInteger.call(this, sign !== 0);
|
|
return sign === HYPHENMINUS2 ? "-" + this.consume(Number2) : this.consume(Number2);
|
|
}
|
|
function parse3() {
|
|
const start = this.tokenStart;
|
|
let a = null;
|
|
let b = null;
|
|
if (this.tokenType === Number2) {
|
|
checkTokenIsInteger.call(this, ALLOW_SIGN);
|
|
b = this.consume(Number2);
|
|
} else if (this.tokenType === Ident && this.cmpChar(this.tokenStart, HYPHENMINUS2)) {
|
|
a = "-1";
|
|
expectCharCode.call(this, 1, N2);
|
|
switch (this.tokenEnd - this.tokenStart) {
|
|
case 2:
|
|
this.next();
|
|
b = consumeB.call(this);
|
|
break;
|
|
case 3:
|
|
expectCharCode.call(this, 2, HYPHENMINUS2);
|
|
this.next();
|
|
this.skipSC();
|
|
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
|
b = "-" + this.consume(Number2);
|
|
break;
|
|
default:
|
|
expectCharCode.call(this, 2, HYPHENMINUS2);
|
|
checkInteger.call(this, 3, DISALLOW_SIGN);
|
|
this.next();
|
|
b = this.substrToCursor(start + 2);
|
|
}
|
|
} else if (this.tokenType === Ident || this.isDelim(PLUSSIGN3) && this.lookupType(1) === Ident) {
|
|
let sign = 0;
|
|
a = "1";
|
|
if (this.isDelim(PLUSSIGN3)) {
|
|
sign = 1;
|
|
this.next();
|
|
}
|
|
expectCharCode.call(this, 0, N2);
|
|
switch (this.tokenEnd - this.tokenStart) {
|
|
case 1:
|
|
this.next();
|
|
b = consumeB.call(this);
|
|
break;
|
|
case 2:
|
|
expectCharCode.call(this, 1, HYPHENMINUS2);
|
|
this.next();
|
|
this.skipSC();
|
|
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
|
b = "-" + this.consume(Number2);
|
|
break;
|
|
default:
|
|
expectCharCode.call(this, 1, HYPHENMINUS2);
|
|
checkInteger.call(this, 2, DISALLOW_SIGN);
|
|
this.next();
|
|
b = this.substrToCursor(start + sign + 1);
|
|
}
|
|
} else if (this.tokenType === Dimension) {
|
|
const code = this.charCodeAt(this.tokenStart);
|
|
const sign = code === PLUSSIGN3 || code === HYPHENMINUS2;
|
|
let i = this.tokenStart + sign;
|
|
for (;i < this.tokenEnd; i++) {
|
|
if (!isDigit(this.charCodeAt(i))) {
|
|
break;
|
|
}
|
|
}
|
|
if (i === this.tokenStart + sign) {
|
|
this.error("Integer is expected", this.tokenStart + sign);
|
|
}
|
|
expectCharCode.call(this, i - this.tokenStart, N2);
|
|
a = this.substring(start, i);
|
|
if (i + 1 === this.tokenEnd) {
|
|
this.next();
|
|
b = consumeB.call(this);
|
|
} else {
|
|
expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS2);
|
|
if (i + 2 === this.tokenEnd) {
|
|
this.next();
|
|
this.skipSC();
|
|
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
|
b = "-" + this.consume(Number2);
|
|
} else {
|
|
checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);
|
|
this.next();
|
|
b = this.substrToCursor(i + 1);
|
|
}
|
|
}
|
|
} else {
|
|
this.error();
|
|
}
|
|
if (a !== null && a.charCodeAt(0) === PLUSSIGN3) {
|
|
a = a.substr(1);
|
|
}
|
|
if (b !== null && b.charCodeAt(0) === PLUSSIGN3) {
|
|
b = b.substr(1);
|
|
}
|
|
return {
|
|
type: "AnPlusB",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
a,
|
|
b
|
|
};
|
|
}
|
|
function generate2(node2) {
|
|
if (node2.a) {
|
|
const a = node2.a === "+1" && "n" || node2.a === "1" && "n" || node2.a === "-1" && "-n" || node2.a + "n";
|
|
if (node2.b) {
|
|
const b = node2.b[0] === "-" || node2.b[0] === "+" ? node2.b : "+" + node2.b;
|
|
this.tokenize(a + b);
|
|
} else {
|
|
this.tokenize(a);
|
|
}
|
|
} else {
|
|
this.tokenize(node2.b);
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Atrule.js
|
|
function consumeRaw() {
|
|
return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon, true);
|
|
}
|
|
function isDeclarationBlockAtrule() {
|
|
for (let offset = 1, type;type = this.lookupType(offset); offset++) {
|
|
if (type === RightCurlyBracket) {
|
|
return true;
|
|
}
|
|
if (type === LeftCurlyBracket || type === AtKeyword) {
|
|
return false;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function parse4(isDeclaration = false) {
|
|
const start = this.tokenStart;
|
|
let name;
|
|
let nameLowerCase;
|
|
let prelude = null;
|
|
let block = null;
|
|
this.eat(AtKeyword);
|
|
name = this.substrToCursor(start + 1);
|
|
nameLowerCase = name.toLowerCase();
|
|
this.skipSC();
|
|
if (this.eof === false && this.tokenType !== LeftCurlyBracket && this.tokenType !== Semicolon) {
|
|
if (this.parseAtrulePrelude) {
|
|
prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name, isDeclaration), consumeRaw);
|
|
} else {
|
|
prelude = consumeRaw.call(this, this.tokenIndex);
|
|
}
|
|
this.skipSC();
|
|
}
|
|
switch (this.tokenType) {
|
|
case Semicolon:
|
|
this.next();
|
|
break;
|
|
case LeftCurlyBracket:
|
|
if (hasOwnProperty.call(this.atrule, nameLowerCase) && typeof this.atrule[nameLowerCase].block === "function") {
|
|
block = this.atrule[nameLowerCase].block.call(this, isDeclaration);
|
|
} else {
|
|
block = this.Block(isDeclarationBlockAtrule.call(this));
|
|
}
|
|
break;
|
|
}
|
|
return {
|
|
type: "Atrule",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name,
|
|
prelude,
|
|
block
|
|
};
|
|
}
|
|
function generate3(node2) {
|
|
this.token(AtKeyword, "@" + node2.name);
|
|
if (node2.prelude !== null) {
|
|
this.node(node2.prelude);
|
|
}
|
|
if (node2.block) {
|
|
this.node(node2.block);
|
|
} else {
|
|
this.token(Semicolon, ";");
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
|
|
function parse5(name) {
|
|
let children = null;
|
|
if (name !== null) {
|
|
name = name.toLowerCase();
|
|
}
|
|
this.skipSC();
|
|
if (hasOwnProperty.call(this.atrule, name) && typeof this.atrule[name].prelude === "function") {
|
|
children = this.atrule[name].prelude.call(this);
|
|
} else {
|
|
children = this.readSequence(this.scope.AtrulePrelude);
|
|
}
|
|
this.skipSC();
|
|
if (this.eof !== true && this.tokenType !== LeftCurlyBracket && this.tokenType !== Semicolon) {
|
|
this.error("Semicolon or block is expected");
|
|
}
|
|
return {
|
|
type: "AtrulePrelude",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate4(node2) {
|
|
this.children(node2);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/AttributeSelector.js
|
|
var DOLLARSIGN = 36;
|
|
var ASTERISK3 = 42;
|
|
var EQUALSSIGN = 61;
|
|
var CIRCUMFLEXACCENT = 94;
|
|
var VERTICALLINE2 = 124;
|
|
var TILDE2 = 126;
|
|
function getAttributeName() {
|
|
if (this.eof) {
|
|
this.error("Unexpected end of input");
|
|
}
|
|
const start = this.tokenStart;
|
|
let expectIdent = false;
|
|
if (this.isDelim(ASTERISK3)) {
|
|
expectIdent = true;
|
|
this.next();
|
|
} else if (!this.isDelim(VERTICALLINE2)) {
|
|
this.eat(Ident);
|
|
}
|
|
if (this.isDelim(VERTICALLINE2)) {
|
|
if (this.charCodeAt(this.tokenStart + 1) !== EQUALSSIGN) {
|
|
this.next();
|
|
this.eat(Ident);
|
|
} else if (expectIdent) {
|
|
this.error("Identifier is expected", this.tokenEnd);
|
|
}
|
|
} else if (expectIdent) {
|
|
this.error("Vertical line is expected");
|
|
}
|
|
return {
|
|
type: "Identifier",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name: this.substrToCursor(start)
|
|
};
|
|
}
|
|
function getOperator() {
|
|
const start = this.tokenStart;
|
|
const code = this.charCodeAt(start);
|
|
if (code !== EQUALSSIGN && code !== TILDE2 && code !== CIRCUMFLEXACCENT && code !== DOLLARSIGN && code !== ASTERISK3 && code !== VERTICALLINE2) {
|
|
this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected");
|
|
}
|
|
this.next();
|
|
if (code !== EQUALSSIGN) {
|
|
if (!this.isDelim(EQUALSSIGN)) {
|
|
this.error("Equal sign is expected");
|
|
}
|
|
this.next();
|
|
}
|
|
return this.substrToCursor(start);
|
|
}
|
|
function parse6() {
|
|
const start = this.tokenStart;
|
|
let name;
|
|
let matcher = null;
|
|
let value = null;
|
|
let flags = null;
|
|
this.eat(LeftSquareBracket);
|
|
this.skipSC();
|
|
name = getAttributeName.call(this);
|
|
this.skipSC();
|
|
if (this.tokenType !== RightSquareBracket) {
|
|
if (this.tokenType !== Ident) {
|
|
matcher = getOperator.call(this);
|
|
this.skipSC();
|
|
value = this.tokenType === String2 ? this.String() : this.Identifier();
|
|
this.skipSC();
|
|
}
|
|
if (this.tokenType === Ident) {
|
|
flags = this.consume(Ident);
|
|
this.skipSC();
|
|
}
|
|
}
|
|
this.eat(RightSquareBracket);
|
|
return {
|
|
type: "AttributeSelector",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name,
|
|
matcher,
|
|
value,
|
|
flags
|
|
};
|
|
}
|
|
function generate5(node2) {
|
|
this.token(Delim, "[");
|
|
this.node(node2.name);
|
|
if (node2.matcher !== null) {
|
|
this.tokenize(node2.matcher);
|
|
this.node(node2.value);
|
|
}
|
|
if (node2.flags !== null) {
|
|
this.token(Ident, node2.flags);
|
|
}
|
|
this.token(Delim, "]");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Block.js
|
|
var AMPERSAND2 = 38;
|
|
function consumeRaw2() {
|
|
return this.Raw(null, true);
|
|
}
|
|
function consumeRule() {
|
|
return this.parseWithFallback(this.Rule, consumeRaw2);
|
|
}
|
|
function consumeRawDeclaration() {
|
|
return this.Raw(this.consumeUntilSemicolonIncluded, true);
|
|
}
|
|
function consumeDeclaration() {
|
|
if (this.tokenType === Semicolon) {
|
|
return consumeRawDeclaration.call(this, this.tokenIndex);
|
|
}
|
|
const node2 = this.parseWithFallback(this.Declaration, consumeRawDeclaration);
|
|
if (this.tokenType === Semicolon) {
|
|
this.next();
|
|
}
|
|
return node2;
|
|
}
|
|
function parse7(isStyleBlock) {
|
|
const consumer = isStyleBlock ? consumeDeclaration : consumeRule;
|
|
const start = this.tokenStart;
|
|
let children = this.createList();
|
|
this.eat(LeftCurlyBracket);
|
|
scan:
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case RightCurlyBracket:
|
|
break scan;
|
|
case WhiteSpace:
|
|
case Comment3:
|
|
this.next();
|
|
break;
|
|
case AtKeyword:
|
|
children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock), consumeRaw2));
|
|
break;
|
|
default:
|
|
if (isStyleBlock && this.isDelim(AMPERSAND2)) {
|
|
children.push(consumeRule.call(this));
|
|
} else {
|
|
children.push(consumer.call(this));
|
|
}
|
|
}
|
|
}
|
|
if (!this.eof) {
|
|
this.eat(RightCurlyBracket);
|
|
}
|
|
return {
|
|
type: "Block",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
children
|
|
};
|
|
}
|
|
function generate6(node2) {
|
|
this.token(LeftCurlyBracket, "{");
|
|
this.children(node2, (prev) => {
|
|
if (prev.type === "Declaration") {
|
|
this.token(Semicolon, ";");
|
|
}
|
|
});
|
|
this.token(RightCurlyBracket, "}");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Brackets.js
|
|
function parse8(readSequence2, recognizer) {
|
|
const start = this.tokenStart;
|
|
let children = null;
|
|
this.eat(LeftSquareBracket);
|
|
children = readSequence2.call(this, recognizer);
|
|
if (!this.eof) {
|
|
this.eat(RightSquareBracket);
|
|
}
|
|
return {
|
|
type: "Brackets",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
children
|
|
};
|
|
}
|
|
function generate7(node2) {
|
|
this.token(Delim, "[");
|
|
this.children(node2);
|
|
this.token(Delim, "]");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/CDC.js
|
|
function parse9() {
|
|
const start = this.tokenStart;
|
|
this.eat(CDC);
|
|
return {
|
|
type: "CDC",
|
|
loc: this.getLocation(start, this.tokenStart)
|
|
};
|
|
}
|
|
function generate8() {
|
|
this.token(CDC, "-->");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/CDO.js
|
|
function parse10() {
|
|
const start = this.tokenStart;
|
|
this.eat(CDO);
|
|
return {
|
|
type: "CDO",
|
|
loc: this.getLocation(start, this.tokenStart)
|
|
};
|
|
}
|
|
function generate9() {
|
|
this.token(CDO, "<!--");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/ClassSelector.js
|
|
var FULLSTOP2 = 46;
|
|
function parse11() {
|
|
this.eatDelim(FULLSTOP2);
|
|
return {
|
|
type: "ClassSelector",
|
|
loc: this.getLocation(this.tokenStart - 1, this.tokenEnd),
|
|
name: this.consume(Ident)
|
|
};
|
|
}
|
|
function generate10(node2) {
|
|
this.token(Delim, ".");
|
|
this.token(Ident, node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Combinator.js
|
|
var PLUSSIGN4 = 43;
|
|
var SOLIDUS3 = 47;
|
|
var GREATERTHANSIGN2 = 62;
|
|
var TILDE3 = 126;
|
|
function parse12() {
|
|
const start = this.tokenStart;
|
|
let name;
|
|
switch (this.tokenType) {
|
|
case WhiteSpace:
|
|
name = " ";
|
|
break;
|
|
case Delim:
|
|
switch (this.charCodeAt(this.tokenStart)) {
|
|
case GREATERTHANSIGN2:
|
|
case PLUSSIGN4:
|
|
case TILDE3:
|
|
this.next();
|
|
break;
|
|
case SOLIDUS3:
|
|
this.next();
|
|
this.eatIdent("deep");
|
|
this.eatDelim(SOLIDUS3);
|
|
break;
|
|
default:
|
|
this.error("Combinator is expected");
|
|
}
|
|
name = this.substrToCursor(start);
|
|
break;
|
|
}
|
|
return {
|
|
type: "Combinator",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name
|
|
};
|
|
}
|
|
function generate11(node2) {
|
|
this.tokenize(node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Comment.js
|
|
var ASTERISK4 = 42;
|
|
var SOLIDUS4 = 47;
|
|
function parse13() {
|
|
const start = this.tokenStart;
|
|
let end = this.tokenEnd;
|
|
this.eat(Comment3);
|
|
if (end - start + 2 >= 2 && this.charCodeAt(end - 2) === ASTERISK4 && this.charCodeAt(end - 1) === SOLIDUS4) {
|
|
end -= 2;
|
|
}
|
|
return {
|
|
type: "Comment",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value: this.substring(start + 2, end)
|
|
};
|
|
}
|
|
function generate12(node2) {
|
|
this.token(Comment3, "/*" + node2.value + "*/");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Condition.js
|
|
var likelyFeatureToken = new Set([Colon, RightParenthesis, EOF]);
|
|
function featureOrRange(kind) {
|
|
if (this.lookupTypeNonSC(1) === Ident && likelyFeatureToken.has(this.lookupTypeNonSC(2))) {
|
|
return this.Feature(kind);
|
|
}
|
|
return this.FeatureRange(kind);
|
|
}
|
|
var parentheses = {
|
|
media: featureOrRange,
|
|
container: featureOrRange,
|
|
supports() {
|
|
return this.SupportsDeclaration();
|
|
}
|
|
};
|
|
function parse14(kind = "media") {
|
|
const children = this.createList();
|
|
scan:
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case Comment3:
|
|
case WhiteSpace:
|
|
this.next();
|
|
continue;
|
|
case Ident:
|
|
children.push(this.Identifier());
|
|
break;
|
|
case LeftParenthesis: {
|
|
let term = this.parseWithFallback(() => parentheses[kind].call(this, kind), () => null);
|
|
if (!term) {
|
|
term = this.parseWithFallback(() => {
|
|
this.eat(LeftParenthesis);
|
|
const res = this.Condition(kind);
|
|
this.eat(RightParenthesis);
|
|
return res;
|
|
}, () => {
|
|
return this.GeneralEnclosed(kind);
|
|
});
|
|
}
|
|
children.push(term);
|
|
break;
|
|
}
|
|
case Function: {
|
|
let term = this.parseWithFallback(() => this.FeatureFunction(kind), () => null);
|
|
if (!term) {
|
|
term = this.GeneralEnclosed(kind);
|
|
}
|
|
children.push(term);
|
|
break;
|
|
}
|
|
default:
|
|
break scan;
|
|
}
|
|
}
|
|
if (children.isEmpty) {
|
|
this.error("Condition is expected");
|
|
}
|
|
return {
|
|
type: "Condition",
|
|
loc: this.getLocationFromList(children),
|
|
kind,
|
|
children
|
|
};
|
|
}
|
|
function generate13(node2) {
|
|
node2.children.forEach((child) => {
|
|
if (child.type === "Condition") {
|
|
this.token(LeftParenthesis, "(");
|
|
this.node(child);
|
|
this.token(RightParenthesis, ")");
|
|
} else {
|
|
this.node(child);
|
|
}
|
|
});
|
|
}
|
|
// node_modules/css-tree/lib/utils/names.js
|
|
var keywords = new Map;
|
|
var properties = new Map;
|
|
var HYPHENMINUS3 = 45;
|
|
function isCustomProperty(str, offset) {
|
|
offset = offset || 0;
|
|
return str.length - offset >= 2 && str.charCodeAt(offset) === HYPHENMINUS3 && str.charCodeAt(offset + 1) === HYPHENMINUS3;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/node/Declaration.js
|
|
var EXCLAMATIONMARK2 = 33;
|
|
var NUMBERSIGN4 = 35;
|
|
var DOLLARSIGN2 = 36;
|
|
var AMPERSAND3 = 38;
|
|
var ASTERISK5 = 42;
|
|
var PLUSSIGN5 = 43;
|
|
var SOLIDUS5 = 47;
|
|
function consumeValueRaw() {
|
|
return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, true);
|
|
}
|
|
function consumeCustomPropertyRaw() {
|
|
return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);
|
|
}
|
|
function consumeValue() {
|
|
const startValueToken = this.tokenIndex;
|
|
const value = this.Value();
|
|
if (value.type !== "Raw" && this.eof === false && this.tokenType !== Semicolon && this.isDelim(EXCLAMATIONMARK2) === false && this.isBalanceEdge(startValueToken) === false) {
|
|
this.error();
|
|
}
|
|
return value;
|
|
}
|
|
function parse15() {
|
|
const start = this.tokenStart;
|
|
const startToken = this.tokenIndex;
|
|
const property = readProperty.call(this);
|
|
const customProperty = isCustomProperty(property);
|
|
const parseValue = customProperty ? this.parseCustomProperty : this.parseValue;
|
|
const consumeRaw3 = customProperty ? consumeCustomPropertyRaw : consumeValueRaw;
|
|
let important = false;
|
|
let value;
|
|
this.skipSC();
|
|
this.eat(Colon);
|
|
const valueStart = this.tokenIndex;
|
|
if (!customProperty) {
|
|
this.skipSC();
|
|
}
|
|
if (parseValue) {
|
|
value = this.parseWithFallback(consumeValue, consumeRaw3);
|
|
} else {
|
|
value = consumeRaw3.call(this, this.tokenIndex);
|
|
}
|
|
if (customProperty && value.type === "Value" && value.children.isEmpty) {
|
|
for (let offset = valueStart - this.tokenIndex;offset <= 0; offset++) {
|
|
if (this.lookupType(offset) === WhiteSpace) {
|
|
value.children.appendData({
|
|
type: "WhiteSpace",
|
|
loc: null,
|
|
value: " "
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (this.isDelim(EXCLAMATIONMARK2)) {
|
|
important = getImportant.call(this);
|
|
this.skipSC();
|
|
}
|
|
if (this.eof === false && this.tokenType !== Semicolon && this.isBalanceEdge(startToken) === false) {
|
|
this.error();
|
|
}
|
|
return {
|
|
type: "Declaration",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
important,
|
|
property,
|
|
value
|
|
};
|
|
}
|
|
function generate14(node2) {
|
|
this.token(Ident, node2.property);
|
|
this.token(Colon, ":");
|
|
this.node(node2.value);
|
|
if (node2.important) {
|
|
this.token(Delim, "!");
|
|
this.token(Ident, node2.important === true ? "important" : node2.important);
|
|
}
|
|
}
|
|
function readProperty() {
|
|
const start = this.tokenStart;
|
|
if (this.tokenType === Delim) {
|
|
switch (this.charCodeAt(this.tokenStart)) {
|
|
case ASTERISK5:
|
|
case DOLLARSIGN2:
|
|
case PLUSSIGN5:
|
|
case NUMBERSIGN4:
|
|
case AMPERSAND3:
|
|
this.next();
|
|
break;
|
|
case SOLIDUS5:
|
|
this.next();
|
|
if (this.isDelim(SOLIDUS5)) {
|
|
this.next();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
if (this.tokenType === Hash) {
|
|
this.eat(Hash);
|
|
} else {
|
|
this.eat(Ident);
|
|
}
|
|
return this.substrToCursor(start);
|
|
}
|
|
function getImportant() {
|
|
this.eat(Delim);
|
|
this.skipSC();
|
|
const important = this.consume(Ident);
|
|
return important === "important" ? true : important;
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/DeclarationList.js
|
|
var AMPERSAND4 = 38;
|
|
function consumeRaw3() {
|
|
return this.Raw(this.consumeUntilSemicolonIncluded, true);
|
|
}
|
|
function parse16() {
|
|
const children = this.createList();
|
|
scan:
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case WhiteSpace:
|
|
case Comment3:
|
|
case Semicolon:
|
|
this.next();
|
|
break;
|
|
case AtKeyword:
|
|
children.push(this.parseWithFallback(this.Atrule.bind(this, true), consumeRaw3));
|
|
break;
|
|
default:
|
|
if (this.isDelim(AMPERSAND4)) {
|
|
children.push(this.parseWithFallback(this.Rule, consumeRaw3));
|
|
} else {
|
|
children.push(this.parseWithFallback(this.Declaration, consumeRaw3));
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
type: "DeclarationList",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate15(node2) {
|
|
this.children(node2, (prev) => {
|
|
if (prev.type === "Declaration") {
|
|
this.token(Semicolon, ";");
|
|
}
|
|
});
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Dimension.js
|
|
function parse17() {
|
|
const start = this.tokenStart;
|
|
const value = this.consumeNumber(Dimension);
|
|
return {
|
|
type: "Dimension",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value,
|
|
unit: this.substring(start + value.length, this.tokenStart)
|
|
};
|
|
}
|
|
function generate16(node2) {
|
|
this.token(Dimension, node2.value + node2.unit);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Feature.js
|
|
var SOLIDUS6 = 47;
|
|
function parse18(kind) {
|
|
const start = this.tokenStart;
|
|
let name;
|
|
let value = null;
|
|
this.eat(LeftParenthesis);
|
|
this.skipSC();
|
|
name = this.consume(Ident);
|
|
this.skipSC();
|
|
if (this.tokenType !== RightParenthesis) {
|
|
this.eat(Colon);
|
|
this.skipSC();
|
|
switch (this.tokenType) {
|
|
case Number2:
|
|
if (this.lookupNonWSType(1) === Delim) {
|
|
value = this.Ratio();
|
|
} else {
|
|
value = this.Number();
|
|
}
|
|
break;
|
|
case Dimension:
|
|
value = this.Dimension();
|
|
break;
|
|
case Ident:
|
|
value = this.Identifier();
|
|
break;
|
|
case Function:
|
|
value = this.parseWithFallback(() => {
|
|
const res = this.Function(this.readSequence, this.scope.Value);
|
|
this.skipSC();
|
|
if (this.isDelim(SOLIDUS6)) {
|
|
this.error();
|
|
}
|
|
return res;
|
|
}, () => {
|
|
return this.Ratio();
|
|
});
|
|
break;
|
|
default:
|
|
this.error("Number, dimension, ratio or identifier is expected");
|
|
}
|
|
this.skipSC();
|
|
}
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "Feature",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
kind,
|
|
name,
|
|
value
|
|
};
|
|
}
|
|
function generate17(node2) {
|
|
this.token(LeftParenthesis, "(");
|
|
this.token(Ident, node2.name);
|
|
if (node2.value !== null) {
|
|
this.token(Colon, ":");
|
|
this.node(node2.value);
|
|
}
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/FeatureFunction.js
|
|
function getFeatureParser(kind, name) {
|
|
const featuresOfKind = this.features[kind] || {};
|
|
const parser = featuresOfKind[name];
|
|
if (typeof parser !== "function") {
|
|
this.error(`Unknown feature ${name}()`);
|
|
}
|
|
return parser;
|
|
}
|
|
function parse19(kind = "unknown") {
|
|
const start = this.tokenStart;
|
|
const functionName = this.consumeFunctionName();
|
|
const valueParser = getFeatureParser.call(this, kind, functionName.toLowerCase());
|
|
this.skipSC();
|
|
const value = this.parseWithFallback(() => {
|
|
const startValueToken = this.tokenIndex;
|
|
const value2 = valueParser.call(this);
|
|
if (this.eof === false && this.isBalanceEdge(startValueToken) === false) {
|
|
this.error();
|
|
}
|
|
return value2;
|
|
}, () => this.Raw(null, false));
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "FeatureFunction",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
kind,
|
|
feature: functionName,
|
|
value
|
|
};
|
|
}
|
|
function generate18(node2) {
|
|
this.token(Function, node2.feature + "(");
|
|
this.node(node2.value);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/FeatureRange.js
|
|
var SOLIDUS7 = 47;
|
|
var LESSTHANSIGN = 60;
|
|
var EQUALSSIGN2 = 61;
|
|
var GREATERTHANSIGN3 = 62;
|
|
function readTerm() {
|
|
this.skipSC();
|
|
switch (this.tokenType) {
|
|
case Number2:
|
|
if (this.isDelim(SOLIDUS7, this.lookupOffsetNonSC(1))) {
|
|
return this.Ratio();
|
|
} else {
|
|
return this.Number();
|
|
}
|
|
case Dimension:
|
|
return this.Dimension();
|
|
case Ident:
|
|
return this.Identifier();
|
|
case Function:
|
|
return this.parseWithFallback(() => {
|
|
const res = this.Function(this.readSequence, this.scope.Value);
|
|
this.skipSC();
|
|
if (this.isDelim(SOLIDUS7)) {
|
|
this.error();
|
|
}
|
|
return res;
|
|
}, () => {
|
|
return this.Ratio();
|
|
});
|
|
default:
|
|
this.error("Number, dimension, ratio or identifier is expected");
|
|
}
|
|
}
|
|
function readComparison(expectColon) {
|
|
this.skipSC();
|
|
if (this.isDelim(LESSTHANSIGN) || this.isDelim(GREATERTHANSIGN3)) {
|
|
const value = this.source[this.tokenStart];
|
|
this.next();
|
|
if (this.isDelim(EQUALSSIGN2)) {
|
|
this.next();
|
|
return value + "=";
|
|
}
|
|
return value;
|
|
}
|
|
if (this.isDelim(EQUALSSIGN2)) {
|
|
return "=";
|
|
}
|
|
this.error(`Expected ${expectColon ? '":", ' : ""}"<", ">", "=" or ")"`);
|
|
}
|
|
function parse20(kind = "unknown") {
|
|
const start = this.tokenStart;
|
|
this.skipSC();
|
|
this.eat(LeftParenthesis);
|
|
const left = readTerm.call(this);
|
|
const leftComparison = readComparison.call(this, left.type === "Identifier");
|
|
const middle = readTerm.call(this);
|
|
let rightComparison = null;
|
|
let right = null;
|
|
if (this.lookupNonWSType(0) !== RightParenthesis) {
|
|
rightComparison = readComparison.call(this);
|
|
right = readTerm.call(this);
|
|
}
|
|
this.skipSC();
|
|
this.eat(RightParenthesis);
|
|
return {
|
|
type: "FeatureRange",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
kind,
|
|
left,
|
|
leftComparison,
|
|
middle,
|
|
rightComparison,
|
|
right
|
|
};
|
|
}
|
|
function generate19(node2) {
|
|
this.token(LeftParenthesis, "(");
|
|
this.node(node2.left);
|
|
this.tokenize(node2.leftComparison);
|
|
this.node(node2.middle);
|
|
if (node2.right) {
|
|
this.tokenize(node2.rightComparison);
|
|
this.node(node2.right);
|
|
}
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Function.js
|
|
function parse21(readSequence2, recognizer) {
|
|
const start = this.tokenStart;
|
|
const name = this.consumeFunctionName();
|
|
const nameLowerCase = name.toLowerCase();
|
|
let children;
|
|
children = recognizer.hasOwnProperty(nameLowerCase) ? recognizer[nameLowerCase].call(this, recognizer) : readSequence2.call(this, recognizer);
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "Function",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name,
|
|
children
|
|
};
|
|
}
|
|
function generate20(node2) {
|
|
this.token(Function, node2.name + "(");
|
|
this.children(node2);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js
|
|
function parse22(kind) {
|
|
const start = this.tokenStart;
|
|
let functionName = null;
|
|
if (this.tokenType === Function) {
|
|
functionName = this.consumeFunctionName();
|
|
} else {
|
|
this.eat(LeftParenthesis);
|
|
}
|
|
const children = this.parseWithFallback(() => {
|
|
const startValueToken = this.tokenIndex;
|
|
const children2 = this.readSequence(this.scope.Value);
|
|
if (this.eof === false && this.isBalanceEdge(startValueToken) === false) {
|
|
this.error();
|
|
}
|
|
return children2;
|
|
}, () => this.createSingleNodeList(this.Raw(null, false)));
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "GeneralEnclosed",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
kind,
|
|
function: functionName,
|
|
children
|
|
};
|
|
}
|
|
function generate21(node2) {
|
|
if (node2.function) {
|
|
this.token(Function, node2.function + "(");
|
|
} else {
|
|
this.token(LeftParenthesis, "(");
|
|
}
|
|
this.children(node2);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Hash.js
|
|
function parse23() {
|
|
const start = this.tokenStart;
|
|
this.eat(Hash);
|
|
return {
|
|
type: "Hash",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value: this.substrToCursor(start + 1)
|
|
};
|
|
}
|
|
function generate22(node2) {
|
|
this.token(Hash, "#" + node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Identifier.js
|
|
function parse24() {
|
|
return {
|
|
type: "Identifier",
|
|
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
name: this.consume(Ident)
|
|
};
|
|
}
|
|
function generate23(node2) {
|
|
this.token(Ident, node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/IdSelector.js
|
|
function parse25() {
|
|
const start = this.tokenStart;
|
|
this.eat(Hash);
|
|
return {
|
|
type: "IdSelector",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name: this.substrToCursor(start + 1)
|
|
};
|
|
}
|
|
function generate24(node2) {
|
|
this.token(Delim, "#" + node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Layer.js
|
|
var FULLSTOP3 = 46;
|
|
function parse26() {
|
|
let tokenStart = this.tokenStart;
|
|
let name = this.consume(Ident);
|
|
while (this.isDelim(FULLSTOP3)) {
|
|
this.eat(Delim);
|
|
name += "." + this.consume(Ident);
|
|
}
|
|
return {
|
|
type: "Layer",
|
|
loc: this.getLocation(tokenStart, this.tokenStart),
|
|
name
|
|
};
|
|
}
|
|
function generate25(node2) {
|
|
this.tokenize(node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/LayerList.js
|
|
function parse27() {
|
|
const children = this.createList();
|
|
this.skipSC();
|
|
while (!this.eof) {
|
|
children.push(this.Layer());
|
|
if (this.lookupTypeNonSC(0) !== Comma) {
|
|
break;
|
|
}
|
|
this.skipSC();
|
|
this.next();
|
|
this.skipSC();
|
|
}
|
|
return {
|
|
type: "LayerList",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate26(node2) {
|
|
this.children(node2, () => this.token(Comma, ","));
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/MediaQuery.js
|
|
function parse28() {
|
|
const start = this.tokenStart;
|
|
let modifier = null;
|
|
let mediaType = null;
|
|
let condition = null;
|
|
this.skipSC();
|
|
if (this.tokenType === Ident && this.lookupTypeNonSC(1) !== LeftParenthesis) {
|
|
const ident = this.consume(Ident);
|
|
const identLowerCase = ident.toLowerCase();
|
|
if (identLowerCase === "not" || identLowerCase === "only") {
|
|
this.skipSC();
|
|
modifier = identLowerCase;
|
|
mediaType = this.consume(Ident);
|
|
} else {
|
|
mediaType = ident;
|
|
}
|
|
switch (this.lookupTypeNonSC(0)) {
|
|
case Ident: {
|
|
this.skipSC();
|
|
this.eatIdent("and");
|
|
condition = this.Condition("media");
|
|
break;
|
|
}
|
|
case LeftCurlyBracket:
|
|
case Semicolon:
|
|
case Comma:
|
|
case EOF:
|
|
break;
|
|
default:
|
|
this.error("Identifier or parenthesis is expected");
|
|
}
|
|
} else {
|
|
switch (this.tokenType) {
|
|
case Ident:
|
|
case LeftParenthesis:
|
|
case Function: {
|
|
condition = this.Condition("media");
|
|
break;
|
|
}
|
|
case LeftCurlyBracket:
|
|
case Semicolon:
|
|
case EOF:
|
|
break;
|
|
default:
|
|
this.error("Identifier or parenthesis is expected");
|
|
}
|
|
}
|
|
return {
|
|
type: "MediaQuery",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
modifier,
|
|
mediaType,
|
|
condition
|
|
};
|
|
}
|
|
function generate27(node2) {
|
|
if (node2.mediaType) {
|
|
if (node2.modifier) {
|
|
this.token(Ident, node2.modifier);
|
|
}
|
|
this.token(Ident, node2.mediaType);
|
|
if (node2.condition) {
|
|
this.token(Ident, "and");
|
|
this.node(node2.condition);
|
|
}
|
|
} else if (node2.condition) {
|
|
this.node(node2.condition);
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/MediaQueryList.js
|
|
function parse29() {
|
|
const children = this.createList();
|
|
this.skipSC();
|
|
while (!this.eof) {
|
|
children.push(this.MediaQuery());
|
|
if (this.tokenType !== Comma) {
|
|
break;
|
|
}
|
|
this.next();
|
|
}
|
|
return {
|
|
type: "MediaQueryList",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate28(node2) {
|
|
this.children(node2, () => this.token(Comma, ","));
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/NestingSelector.js
|
|
var AMPERSAND5 = 38;
|
|
function parse30() {
|
|
const start = this.tokenStart;
|
|
this.eatDelim(AMPERSAND5);
|
|
return {
|
|
type: "NestingSelector",
|
|
loc: this.getLocation(start, this.tokenStart)
|
|
};
|
|
}
|
|
function generate29() {
|
|
this.token(Delim, "&");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Nth.js
|
|
function parse31() {
|
|
this.skipSC();
|
|
const start = this.tokenStart;
|
|
let end = start;
|
|
let selector2 = null;
|
|
let nth2;
|
|
if (this.lookupValue(0, "odd") || this.lookupValue(0, "even")) {
|
|
nth2 = this.Identifier();
|
|
} else {
|
|
nth2 = this.AnPlusB();
|
|
}
|
|
end = this.tokenStart;
|
|
this.skipSC();
|
|
if (this.lookupValue(0, "of")) {
|
|
this.next();
|
|
selector2 = this.SelectorList();
|
|
end = this.tokenStart;
|
|
}
|
|
return {
|
|
type: "Nth",
|
|
loc: this.getLocation(start, end),
|
|
nth: nth2,
|
|
selector: selector2
|
|
};
|
|
}
|
|
function generate30(node2) {
|
|
this.node(node2.nth);
|
|
if (node2.selector !== null) {
|
|
this.token(Ident, "of");
|
|
this.node(node2.selector);
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Number.js
|
|
function parse32() {
|
|
return {
|
|
type: "Number",
|
|
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
value: this.consume(Number2)
|
|
};
|
|
}
|
|
function generate31(node2) {
|
|
this.token(Number2, node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Operator.js
|
|
function parse33() {
|
|
const start = this.tokenStart;
|
|
this.next();
|
|
return {
|
|
type: "Operator",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value: this.substrToCursor(start)
|
|
};
|
|
}
|
|
function generate32(node2) {
|
|
this.tokenize(node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Parentheses.js
|
|
function parse34(readSequence2, recognizer) {
|
|
const start = this.tokenStart;
|
|
let children = null;
|
|
this.eat(LeftParenthesis);
|
|
children = readSequence2.call(this, recognizer);
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "Parentheses",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
children
|
|
};
|
|
}
|
|
function generate33(node2) {
|
|
this.token(LeftParenthesis, "(");
|
|
this.children(node2);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Percentage.js
|
|
function parse35() {
|
|
return {
|
|
type: "Percentage",
|
|
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
value: this.consumeNumber(Percentage)
|
|
};
|
|
}
|
|
function generate34(node2) {
|
|
this.token(Percentage, node2.value + "%");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js
|
|
function parse36() {
|
|
const start = this.tokenStart;
|
|
let children = null;
|
|
let name;
|
|
let nameLowerCase;
|
|
this.eat(Colon);
|
|
if (this.tokenType === Function) {
|
|
name = this.consumeFunctionName();
|
|
nameLowerCase = name.toLowerCase();
|
|
if (this.lookupNonWSType(0) == RightParenthesis) {
|
|
children = this.createList();
|
|
} else if (hasOwnProperty.call(this.pseudo, nameLowerCase)) {
|
|
this.skipSC();
|
|
children = this.pseudo[nameLowerCase].call(this);
|
|
this.skipSC();
|
|
} else {
|
|
children = this.createList();
|
|
children.push(this.Raw(null, false));
|
|
}
|
|
this.eat(RightParenthesis);
|
|
} else {
|
|
name = this.consume(Ident);
|
|
}
|
|
return {
|
|
type: "PseudoClassSelector",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name,
|
|
children
|
|
};
|
|
}
|
|
function generate35(node2) {
|
|
this.token(Colon, ":");
|
|
if (node2.children === null) {
|
|
this.token(Ident, node2.name);
|
|
} else {
|
|
this.token(Function, node2.name + "(");
|
|
this.children(node2);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js
|
|
function parse37() {
|
|
const start = this.tokenStart;
|
|
let children = null;
|
|
let name;
|
|
let nameLowerCase;
|
|
this.eat(Colon);
|
|
this.eat(Colon);
|
|
if (this.tokenType === Function) {
|
|
name = this.consumeFunctionName();
|
|
nameLowerCase = name.toLowerCase();
|
|
if (this.lookupNonWSType(0) == RightParenthesis) {
|
|
children = this.createList();
|
|
} else if (hasOwnProperty.call(this.pseudo, nameLowerCase)) {
|
|
this.skipSC();
|
|
children = this.pseudo[nameLowerCase].call(this);
|
|
this.skipSC();
|
|
} else {
|
|
children = this.createList();
|
|
children.push(this.Raw(null, false));
|
|
}
|
|
this.eat(RightParenthesis);
|
|
} else {
|
|
name = this.consume(Ident);
|
|
}
|
|
return {
|
|
type: "PseudoElementSelector",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name,
|
|
children
|
|
};
|
|
}
|
|
function generate36(node2) {
|
|
this.token(Colon, ":");
|
|
this.token(Colon, ":");
|
|
if (node2.children === null) {
|
|
this.token(Ident, node2.name);
|
|
} else {
|
|
this.token(Function, node2.name + "(");
|
|
this.children(node2);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Ratio.js
|
|
var SOLIDUS8 = 47;
|
|
function consumeTerm() {
|
|
this.skipSC();
|
|
switch (this.tokenType) {
|
|
case Number2:
|
|
return this.Number();
|
|
case Function:
|
|
return this.Function(this.readSequence, this.scope.Value);
|
|
default:
|
|
this.error("Number of function is expected");
|
|
}
|
|
}
|
|
function parse38() {
|
|
const start = this.tokenStart;
|
|
const left = consumeTerm.call(this);
|
|
let right = null;
|
|
this.skipSC();
|
|
if (this.isDelim(SOLIDUS8)) {
|
|
this.eatDelim(SOLIDUS8);
|
|
right = consumeTerm.call(this);
|
|
}
|
|
return {
|
|
type: "Ratio",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
left,
|
|
right
|
|
};
|
|
}
|
|
function generate37(node2) {
|
|
this.node(node2.left);
|
|
this.token(Delim, "/");
|
|
if (node2.right) {
|
|
this.node(node2.right);
|
|
} else {
|
|
this.node(Number2, 1);
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Raw.js
|
|
function getOffsetExcludeWS() {
|
|
if (this.tokenIndex > 0) {
|
|
if (this.lookupType(-1) === WhiteSpace) {
|
|
return this.tokenIndex > 1 ? this.getTokenStart(this.tokenIndex - 1) : this.firstCharOffset;
|
|
}
|
|
}
|
|
return this.tokenStart;
|
|
}
|
|
function parse39(consumeUntil, excludeWhiteSpace) {
|
|
const startOffset = this.getTokenStart(this.tokenIndex);
|
|
let endOffset;
|
|
this.skipUntilBalanced(this.tokenIndex, consumeUntil || this.consumeUntilBalanceEnd);
|
|
if (excludeWhiteSpace && this.tokenStart > startOffset) {
|
|
endOffset = getOffsetExcludeWS.call(this);
|
|
} else {
|
|
endOffset = this.tokenStart;
|
|
}
|
|
return {
|
|
type: "Raw",
|
|
loc: this.getLocation(startOffset, endOffset),
|
|
value: this.substring(startOffset, endOffset)
|
|
};
|
|
}
|
|
function generate38(node2) {
|
|
this.tokenize(node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Rule.js
|
|
function consumeRaw4() {
|
|
return this.Raw(this.consumeUntilLeftCurlyBracket, true);
|
|
}
|
|
function consumePrelude() {
|
|
const prelude = this.SelectorList();
|
|
if (prelude.type !== "Raw" && this.eof === false && this.tokenType !== LeftCurlyBracket) {
|
|
this.error();
|
|
}
|
|
return prelude;
|
|
}
|
|
function parse40() {
|
|
const startToken = this.tokenIndex;
|
|
const startOffset = this.tokenStart;
|
|
let prelude;
|
|
let block;
|
|
if (this.parseRulePrelude) {
|
|
prelude = this.parseWithFallback(consumePrelude, consumeRaw4);
|
|
} else {
|
|
prelude = consumeRaw4.call(this, startToken);
|
|
}
|
|
block = this.Block(true);
|
|
return {
|
|
type: "Rule",
|
|
loc: this.getLocation(startOffset, this.tokenStart),
|
|
prelude,
|
|
block
|
|
};
|
|
}
|
|
function generate39(node2) {
|
|
this.node(node2.prelude);
|
|
this.node(node2.block);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Scope.js
|
|
function parse41() {
|
|
let root = null;
|
|
let limit = null;
|
|
this.skipSC();
|
|
const startOffset = this.tokenStart;
|
|
if (this.tokenType === LeftParenthesis) {
|
|
this.next();
|
|
this.skipSC();
|
|
root = this.parseWithFallback(this.SelectorList, () => this.Raw(false, true));
|
|
this.skipSC();
|
|
this.eat(RightParenthesis);
|
|
}
|
|
if (this.lookupNonWSType(0) === Ident) {
|
|
this.skipSC();
|
|
this.eatIdent("to");
|
|
this.skipSC();
|
|
this.eat(LeftParenthesis);
|
|
this.skipSC();
|
|
limit = this.parseWithFallback(this.SelectorList, () => this.Raw(false, true));
|
|
this.skipSC();
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "Scope",
|
|
loc: this.getLocation(startOffset, this.tokenStart),
|
|
root,
|
|
limit
|
|
};
|
|
}
|
|
function generate40(node2) {
|
|
if (node2.root) {
|
|
this.token(LeftParenthesis, "(");
|
|
this.node(node2.root);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
if (node2.limit) {
|
|
this.token(Ident, "to");
|
|
this.token(LeftParenthesis, "(");
|
|
this.node(node2.limit);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Selector.js
|
|
function parse42() {
|
|
const children = this.readSequence(this.scope.Selector);
|
|
if (this.getFirstListNode(children) === null) {
|
|
this.error("Selector is expected");
|
|
}
|
|
return {
|
|
type: "Selector",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate41(node2) {
|
|
this.children(node2);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/SelectorList.js
|
|
function parse43() {
|
|
const children = this.createList();
|
|
while (!this.eof) {
|
|
children.push(this.Selector());
|
|
if (this.tokenType === Comma) {
|
|
this.next();
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
return {
|
|
type: "SelectorList",
|
|
loc: this.getLocationFromList(children),
|
|
children
|
|
};
|
|
}
|
|
function generate42(node2) {
|
|
this.children(node2, () => this.token(Comma, ","));
|
|
}
|
|
// node_modules/css-tree/lib/utils/string.js
|
|
var REVERSE_SOLIDUS = 92;
|
|
var QUOTATION_MARK = 34;
|
|
var APOSTROPHE = 39;
|
|
function decode(str) {
|
|
const len = str.length;
|
|
const firstChar = str.charCodeAt(0);
|
|
const start = firstChar === QUOTATION_MARK || firstChar === APOSTROPHE ? 1 : 0;
|
|
const end = start === 1 && len > 1 && str.charCodeAt(len - 1) === firstChar ? len - 2 : len - 1;
|
|
let decoded = "";
|
|
for (let i = start;i <= end; i++) {
|
|
let code = str.charCodeAt(i);
|
|
if (code === REVERSE_SOLIDUS) {
|
|
if (i === end) {
|
|
if (i !== len - 1) {
|
|
decoded = str.substr(i + 1);
|
|
}
|
|
break;
|
|
}
|
|
code = str.charCodeAt(++i);
|
|
if (isValidEscape(REVERSE_SOLIDUS, code)) {
|
|
const escapeStart = i - 1;
|
|
const escapeEnd = consumeEscaped(str, escapeStart);
|
|
i = escapeEnd - 1;
|
|
decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
|
|
} else {
|
|
if (code === 13 && str.charCodeAt(i + 1) === 10) {
|
|
i++;
|
|
}
|
|
}
|
|
} else {
|
|
decoded += str[i];
|
|
}
|
|
}
|
|
return decoded;
|
|
}
|
|
function encode(str, apostrophe) {
|
|
const quote = apostrophe ? "'" : '"';
|
|
const quoteCode = apostrophe ? APOSTROPHE : QUOTATION_MARK;
|
|
let encoded = "";
|
|
let wsBeforeHexIsNeeded = false;
|
|
for (let i = 0;i < str.length; i++) {
|
|
const code = str.charCodeAt(i);
|
|
if (code === 0) {
|
|
encoded += "�";
|
|
continue;
|
|
}
|
|
if (code <= 31 || code === 127) {
|
|
encoded += "\\" + code.toString(16);
|
|
wsBeforeHexIsNeeded = true;
|
|
continue;
|
|
}
|
|
if (code === quoteCode || code === REVERSE_SOLIDUS) {
|
|
encoded += "\\" + str.charAt(i);
|
|
wsBeforeHexIsNeeded = false;
|
|
} else {
|
|
if (wsBeforeHexIsNeeded && (isHexDigit(code) || isWhiteSpace(code))) {
|
|
encoded += " ";
|
|
}
|
|
encoded += str.charAt(i);
|
|
wsBeforeHexIsNeeded = false;
|
|
}
|
|
}
|
|
return quote + encoded + quote;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/node/String.js
|
|
function parse44() {
|
|
return {
|
|
type: "String",
|
|
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
value: decode(this.consume(String2))
|
|
};
|
|
}
|
|
function generate43(node2) {
|
|
this.token(String2, encode(node2.value));
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/StyleSheet.js
|
|
var EXCLAMATIONMARK3 = 33;
|
|
function consumeRaw5() {
|
|
return this.Raw(null, false);
|
|
}
|
|
function parse45() {
|
|
const start = this.tokenStart;
|
|
const children = this.createList();
|
|
let child;
|
|
scan:
|
|
while (!this.eof) {
|
|
switch (this.tokenType) {
|
|
case WhiteSpace:
|
|
this.next();
|
|
continue;
|
|
case Comment3:
|
|
if (this.charCodeAt(this.tokenStart + 2) !== EXCLAMATIONMARK3) {
|
|
this.next();
|
|
continue;
|
|
}
|
|
child = this.Comment();
|
|
break;
|
|
case CDO:
|
|
child = this.CDO();
|
|
break;
|
|
case CDC:
|
|
child = this.CDC();
|
|
break;
|
|
case AtKeyword:
|
|
child = this.parseWithFallback(this.Atrule, consumeRaw5);
|
|
break;
|
|
default:
|
|
child = this.parseWithFallback(this.Rule, consumeRaw5);
|
|
}
|
|
children.push(child);
|
|
}
|
|
return {
|
|
type: "StyleSheet",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
children
|
|
};
|
|
}
|
|
function generate44(node2) {
|
|
this.children(node2);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js
|
|
function parse46() {
|
|
const start = this.tokenStart;
|
|
this.eat(LeftParenthesis);
|
|
this.skipSC();
|
|
const declaration = this.Declaration();
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
return {
|
|
type: "SupportsDeclaration",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
declaration
|
|
};
|
|
}
|
|
function generate45(node2) {
|
|
this.token(LeftParenthesis, "(");
|
|
this.node(node2.declaration);
|
|
this.token(RightParenthesis, ")");
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/TypeSelector.js
|
|
var ASTERISK6 = 42;
|
|
var VERTICALLINE3 = 124;
|
|
function eatIdentifierOrAsterisk() {
|
|
if (this.tokenType !== Ident && this.isDelim(ASTERISK6) === false) {
|
|
this.error("Identifier or asterisk is expected");
|
|
}
|
|
this.next();
|
|
}
|
|
function parse47() {
|
|
const start = this.tokenStart;
|
|
if (this.isDelim(VERTICALLINE3)) {
|
|
this.next();
|
|
eatIdentifierOrAsterisk.call(this);
|
|
} else {
|
|
eatIdentifierOrAsterisk.call(this);
|
|
if (this.isDelim(VERTICALLINE3)) {
|
|
this.next();
|
|
eatIdentifierOrAsterisk.call(this);
|
|
}
|
|
}
|
|
return {
|
|
type: "TypeSelector",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
name: this.substrToCursor(start)
|
|
};
|
|
}
|
|
function generate46(node2) {
|
|
this.tokenize(node2.name);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/UnicodeRange.js
|
|
var PLUSSIGN6 = 43;
|
|
var HYPHENMINUS4 = 45;
|
|
var QUESTIONMARK = 63;
|
|
function eatHexSequence(offset, allowDash) {
|
|
let len = 0;
|
|
for (let pos = this.tokenStart + offset;pos < this.tokenEnd; pos++) {
|
|
const code = this.charCodeAt(pos);
|
|
if (code === HYPHENMINUS4 && allowDash && len !== 0) {
|
|
eatHexSequence.call(this, offset + len + 1, false);
|
|
return -1;
|
|
}
|
|
if (!isHexDigit(code)) {
|
|
this.error(allowDash && len !== 0 ? "Hyphen minus" + (len < 6 ? " or hex digit" : "") + " is expected" : len < 6 ? "Hex digit is expected" : "Unexpected input", pos);
|
|
}
|
|
if (++len > 6) {
|
|
this.error("Too many hex digits", pos);
|
|
}
|
|
}
|
|
this.next();
|
|
return len;
|
|
}
|
|
function eatQuestionMarkSequence(max) {
|
|
let count = 0;
|
|
while (this.isDelim(QUESTIONMARK)) {
|
|
if (++count > max) {
|
|
this.error("Too many question marks");
|
|
}
|
|
this.next();
|
|
}
|
|
}
|
|
function startsWith(code) {
|
|
if (this.charCodeAt(this.tokenStart) !== code) {
|
|
this.error((code === PLUSSIGN6 ? "Plus sign" : "Hyphen minus") + " is expected");
|
|
}
|
|
}
|
|
function scanUnicodeRange() {
|
|
let hexLength = 0;
|
|
switch (this.tokenType) {
|
|
case Number2:
|
|
hexLength = eatHexSequence.call(this, 1, true);
|
|
if (this.isDelim(QUESTIONMARK)) {
|
|
eatQuestionMarkSequence.call(this, 6 - hexLength);
|
|
break;
|
|
}
|
|
if (this.tokenType === Dimension || this.tokenType === Number2) {
|
|
startsWith.call(this, HYPHENMINUS4);
|
|
eatHexSequence.call(this, 1, false);
|
|
break;
|
|
}
|
|
break;
|
|
case Dimension:
|
|
hexLength = eatHexSequence.call(this, 1, true);
|
|
if (hexLength > 0) {
|
|
eatQuestionMarkSequence.call(this, 6 - hexLength);
|
|
}
|
|
break;
|
|
default:
|
|
this.eatDelim(PLUSSIGN6);
|
|
if (this.tokenType === Ident) {
|
|
hexLength = eatHexSequence.call(this, 0, true);
|
|
if (hexLength > 0) {
|
|
eatQuestionMarkSequence.call(this, 6 - hexLength);
|
|
}
|
|
break;
|
|
}
|
|
if (this.isDelim(QUESTIONMARK)) {
|
|
this.next();
|
|
eatQuestionMarkSequence.call(this, 5);
|
|
break;
|
|
}
|
|
this.error("Hex digit or question mark is expected");
|
|
}
|
|
}
|
|
function parse48() {
|
|
const start = this.tokenStart;
|
|
this.eatIdent("u");
|
|
scanUnicodeRange.call(this);
|
|
return {
|
|
type: "UnicodeRange",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value: this.substrToCursor(start)
|
|
};
|
|
}
|
|
function generate47(node2) {
|
|
this.tokenize(node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/utils/url.js
|
|
var SPACE = 32;
|
|
var REVERSE_SOLIDUS2 = 92;
|
|
var QUOTATION_MARK2 = 34;
|
|
var APOSTROPHE2 = 39;
|
|
var LEFTPARENTHESIS = 40;
|
|
var RIGHTPARENTHESIS = 41;
|
|
function decode2(str) {
|
|
const len = str.length;
|
|
let start = 4;
|
|
let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;
|
|
let decoded = "";
|
|
while (start < end && isWhiteSpace(str.charCodeAt(start))) {
|
|
start++;
|
|
}
|
|
while (start < end && isWhiteSpace(str.charCodeAt(end))) {
|
|
end--;
|
|
}
|
|
for (let i = start;i <= end; i++) {
|
|
let code = str.charCodeAt(i);
|
|
if (code === REVERSE_SOLIDUS2) {
|
|
if (i === end) {
|
|
if (i !== len - 1) {
|
|
decoded = str.substr(i + 1);
|
|
}
|
|
break;
|
|
}
|
|
code = str.charCodeAt(++i);
|
|
if (isValidEscape(REVERSE_SOLIDUS2, code)) {
|
|
const escapeStart = i - 1;
|
|
const escapeEnd = consumeEscaped(str, escapeStart);
|
|
i = escapeEnd - 1;
|
|
decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
|
|
} else {
|
|
if (code === 13 && str.charCodeAt(i + 1) === 10) {
|
|
i++;
|
|
}
|
|
}
|
|
} else {
|
|
decoded += str[i];
|
|
}
|
|
}
|
|
return decoded;
|
|
}
|
|
function encode2(str) {
|
|
let encoded = "";
|
|
let wsBeforeHexIsNeeded = false;
|
|
for (let i = 0;i < str.length; i++) {
|
|
const code = str.charCodeAt(i);
|
|
if (code === 0) {
|
|
encoded += "�";
|
|
continue;
|
|
}
|
|
if (code <= 31 || code === 127) {
|
|
encoded += "\\" + code.toString(16);
|
|
wsBeforeHexIsNeeded = true;
|
|
continue;
|
|
}
|
|
if (code === SPACE || code === REVERSE_SOLIDUS2 || code === QUOTATION_MARK2 || code === APOSTROPHE2 || code === LEFTPARENTHESIS || code === RIGHTPARENTHESIS) {
|
|
encoded += "\\" + str.charAt(i);
|
|
wsBeforeHexIsNeeded = false;
|
|
} else {
|
|
if (wsBeforeHexIsNeeded && isHexDigit(code)) {
|
|
encoded += " ";
|
|
}
|
|
encoded += str.charAt(i);
|
|
wsBeforeHexIsNeeded = false;
|
|
}
|
|
}
|
|
return "url(" + encoded + ")";
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/node/Url.js
|
|
function parse49() {
|
|
const start = this.tokenStart;
|
|
let value;
|
|
switch (this.tokenType) {
|
|
case Url:
|
|
value = decode2(this.consume(Url));
|
|
break;
|
|
case Function:
|
|
if (!this.cmpStr(this.tokenStart, this.tokenEnd, "url(")) {
|
|
this.error("Function name must be `url`");
|
|
}
|
|
this.eat(Function);
|
|
this.skipSC();
|
|
value = decode(this.consume(String2));
|
|
this.skipSC();
|
|
if (!this.eof) {
|
|
this.eat(RightParenthesis);
|
|
}
|
|
break;
|
|
default:
|
|
this.error("Url or Function is expected");
|
|
}
|
|
return {
|
|
type: "Url",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
value
|
|
};
|
|
}
|
|
function generate48(node2) {
|
|
this.token(Url, encode2(node2.value));
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/Value.js
|
|
function parse50() {
|
|
const start = this.tokenStart;
|
|
const children = this.readSequence(this.scope.Value);
|
|
return {
|
|
type: "Value",
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
children
|
|
};
|
|
}
|
|
function generate49(node2) {
|
|
this.children(node2);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/node/WhiteSpace.js
|
|
var SPACE2 = Object.freeze({
|
|
type: "WhiteSpace",
|
|
loc: null,
|
|
value: " "
|
|
});
|
|
function parse51() {
|
|
this.eat(WhiteSpace);
|
|
return SPACE2;
|
|
}
|
|
function generate50(node2) {
|
|
this.token(WhiteSpace, node2.value);
|
|
}
|
|
// node_modules/css-tree/lib/syntax/config/parser.js
|
|
var parser_default = {
|
|
parseContext: {
|
|
default: "StyleSheet",
|
|
stylesheet: "StyleSheet",
|
|
atrule: "Atrule",
|
|
atrulePrelude(options) {
|
|
return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
|
|
},
|
|
mediaQueryList: "MediaQueryList",
|
|
mediaQuery: "MediaQuery",
|
|
condition(options) {
|
|
return this.Condition(options.kind);
|
|
},
|
|
rule: "Rule",
|
|
selectorList: "SelectorList",
|
|
selector: "Selector",
|
|
block() {
|
|
return this.Block(true);
|
|
},
|
|
declarationList: "DeclarationList",
|
|
declaration: "Declaration",
|
|
value: "Value"
|
|
},
|
|
features: {
|
|
supports: {
|
|
selector() {
|
|
return this.Selector();
|
|
}
|
|
},
|
|
container: {
|
|
style() {
|
|
return this.Declaration();
|
|
}
|
|
}
|
|
},
|
|
scope: exports_scope,
|
|
atrule: atrule_default,
|
|
pseudo: pseudo_default,
|
|
node: exports_index_parse
|
|
};
|
|
|
|
// node_modules/css-tree/lib/parser/index.js
|
|
var parser_default2 = createParser(parser_default);
|
|
|
|
// node_modules/source-map-js/lib/source-map-generator.js
|
|
var base64VLQ = require_base64_vlq();
|
|
var util = require_util();
|
|
var ArraySet = require_array_set().ArraySet;
|
|
var MappingList = require_mapping_list().MappingList;
|
|
function SourceMapGenerator(aArgs) {
|
|
if (!aArgs) {
|
|
aArgs = {};
|
|
}
|
|
this._file = util.getArg(aArgs, "file", null);
|
|
this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
|
|
this._skipValidation = util.getArg(aArgs, "skipValidation", false);
|
|
this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false);
|
|
this._sources = new ArraySet;
|
|
this._names = new ArraySet;
|
|
this._mappings = new MappingList;
|
|
this._sourcesContents = null;
|
|
}
|
|
SourceMapGenerator.prototype._version = 3;
|
|
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
|
|
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
|
|
file: aSourceMapConsumer.file,
|
|
sourceRoot
|
|
}));
|
|
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
var newMapping = {
|
|
generated: {
|
|
line: mapping.generatedLine,
|
|
column: mapping.generatedColumn
|
|
}
|
|
};
|
|
if (mapping.source != null) {
|
|
newMapping.source = mapping.source;
|
|
if (sourceRoot != null) {
|
|
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
}
|
|
newMapping.original = {
|
|
line: mapping.originalLine,
|
|
column: mapping.originalColumn
|
|
};
|
|
if (mapping.name != null) {
|
|
newMapping.name = mapping.name;
|
|
}
|
|
}
|
|
generator.addMapping(newMapping);
|
|
});
|
|
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
var sourceRelative = sourceFile;
|
|
if (sourceRoot !== null) {
|
|
sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
}
|
|
if (!generator._sources.has(sourceRelative)) {
|
|
generator._sources.add(sourceRelative);
|
|
}
|
|
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
if (content != null) {
|
|
generator.setSourceContent(sourceFile, content);
|
|
}
|
|
});
|
|
return generator;
|
|
};
|
|
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
var generated = util.getArg(aArgs, "generated");
|
|
var original = util.getArg(aArgs, "original", null);
|
|
var source = util.getArg(aArgs, "source", null);
|
|
var name = util.getArg(aArgs, "name", null);
|
|
if (!this._skipValidation) {
|
|
if (this._validateMapping(generated, original, source, name) === false) {
|
|
return;
|
|
}
|
|
}
|
|
if (source != null) {
|
|
source = String(source);
|
|
if (!this._sources.has(source)) {
|
|
this._sources.add(source);
|
|
}
|
|
}
|
|
if (name != null) {
|
|
name = String(name);
|
|
if (!this._names.has(name)) {
|
|
this._names.add(name);
|
|
}
|
|
}
|
|
this._mappings.add({
|
|
generatedLine: generated.line,
|
|
generatedColumn: generated.column,
|
|
originalLine: original != null && original.line,
|
|
originalColumn: original != null && original.column,
|
|
source,
|
|
name
|
|
});
|
|
};
|
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
var source = aSourceFile;
|
|
if (this._sourceRoot != null) {
|
|
source = util.relative(this._sourceRoot, source);
|
|
}
|
|
if (aSourceContent != null) {
|
|
if (!this._sourcesContents) {
|
|
this._sourcesContents = Object.create(null);
|
|
}
|
|
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
|
} else if (this._sourcesContents) {
|
|
delete this._sourcesContents[util.toSetString(source)];
|
|
if (Object.keys(this._sourcesContents).length === 0) {
|
|
this._sourcesContents = null;
|
|
}
|
|
}
|
|
};
|
|
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
|
var sourceFile = aSourceFile;
|
|
if (aSourceFile == null) {
|
|
if (aSourceMapConsumer.file == null) {
|
|
throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + `or the source map's "file" property. Both were omitted.`);
|
|
}
|
|
sourceFile = aSourceMapConsumer.file;
|
|
}
|
|
var sourceRoot = this._sourceRoot;
|
|
if (sourceRoot != null) {
|
|
sourceFile = util.relative(sourceRoot, sourceFile);
|
|
}
|
|
var newSources = new ArraySet;
|
|
var newNames = new ArraySet;
|
|
this._mappings.unsortedForEach(function(mapping) {
|
|
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
|
var original = aSourceMapConsumer.originalPositionFor({
|
|
line: mapping.originalLine,
|
|
column: mapping.originalColumn
|
|
});
|
|
if (original.source != null) {
|
|
mapping.source = original.source;
|
|
if (aSourceMapPath != null) {
|
|
mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
}
|
|
if (sourceRoot != null) {
|
|
mapping.source = util.relative(sourceRoot, mapping.source);
|
|
}
|
|
mapping.originalLine = original.line;
|
|
mapping.originalColumn = original.column;
|
|
if (original.name != null) {
|
|
mapping.name = original.name;
|
|
}
|
|
}
|
|
}
|
|
var source = mapping.source;
|
|
if (source != null && !newSources.has(source)) {
|
|
newSources.add(source);
|
|
}
|
|
var name = mapping.name;
|
|
if (name != null && !newNames.has(name)) {
|
|
newNames.add(name);
|
|
}
|
|
}, this);
|
|
this._sources = newSources;
|
|
this._names = newNames;
|
|
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
|
|
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
|
|
if (content != null) {
|
|
if (aSourceMapPath != null) {
|
|
sourceFile2 = util.join(aSourceMapPath, sourceFile2);
|
|
}
|
|
if (sourceRoot != null) {
|
|
sourceFile2 = util.relative(sourceRoot, sourceFile2);
|
|
}
|
|
this.setSourceContent(sourceFile2, content);
|
|
}
|
|
}, this);
|
|
};
|
|
SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
|
|
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
|
|
var message = "original.line and original.column are not numbers -- you probably meant to omit " + "the original mapping entirely and only map the generated position. If so, pass " + "null for the original mapping instead of an object with empty or null values.";
|
|
if (this._ignoreInvalidMapping) {
|
|
if (typeof console !== "undefined" && console.warn) {
|
|
console.warn(message);
|
|
}
|
|
return false;
|
|
} else {
|
|
throw new Error(message);
|
|
}
|
|
}
|
|
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
|
|
return;
|
|
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
|
|
return;
|
|
} else {
|
|
var message = "Invalid mapping: " + JSON.stringify({
|
|
generated: aGenerated,
|
|
source: aSource,
|
|
original: aOriginal,
|
|
name: aName
|
|
});
|
|
if (this._ignoreInvalidMapping) {
|
|
if (typeof console !== "undefined" && console.warn) {
|
|
console.warn(message);
|
|
}
|
|
return false;
|
|
} else {
|
|
throw new Error(message);
|
|
}
|
|
}
|
|
};
|
|
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
|
|
var previousGeneratedColumn = 0;
|
|
var previousGeneratedLine = 1;
|
|
var previousOriginalColumn = 0;
|
|
var previousOriginalLine = 0;
|
|
var previousName = 0;
|
|
var previousSource = 0;
|
|
var result = "";
|
|
var next;
|
|
var mapping;
|
|
var nameIdx;
|
|
var sourceIdx;
|
|
var mappings = this._mappings.toArray();
|
|
for (var i = 0, len = mappings.length;i < len; i++) {
|
|
mapping = mappings[i];
|
|
next = "";
|
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
previousGeneratedColumn = 0;
|
|
while (mapping.generatedLine !== previousGeneratedLine) {
|
|
next += ";";
|
|
previousGeneratedLine++;
|
|
}
|
|
} else {
|
|
if (i > 0) {
|
|
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
|
continue;
|
|
}
|
|
next += ",";
|
|
}
|
|
}
|
|
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
|
|
previousGeneratedColumn = mapping.generatedColumn;
|
|
if (mapping.source != null) {
|
|
sourceIdx = this._sources.indexOf(mapping.source);
|
|
next += base64VLQ.encode(sourceIdx - previousSource);
|
|
previousSource = sourceIdx;
|
|
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
|
|
previousOriginalLine = mapping.originalLine - 1;
|
|
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
|
|
previousOriginalColumn = mapping.originalColumn;
|
|
if (mapping.name != null) {
|
|
nameIdx = this._names.indexOf(mapping.name);
|
|
next += base64VLQ.encode(nameIdx - previousName);
|
|
previousName = nameIdx;
|
|
}
|
|
}
|
|
result += next;
|
|
}
|
|
return result;
|
|
};
|
|
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
return aSources.map(function(source) {
|
|
if (!this._sourcesContents) {
|
|
return null;
|
|
}
|
|
if (aSourceRoot != null) {
|
|
source = util.relative(aSourceRoot, source);
|
|
}
|
|
var key = util.toSetString(source);
|
|
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
}, this);
|
|
};
|
|
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
var map = {
|
|
version: this._version,
|
|
sources: this._sources.toArray(),
|
|
names: this._names.toArray(),
|
|
mappings: this._serializeMappings()
|
|
};
|
|
if (this._file != null) {
|
|
map.file = this._file;
|
|
}
|
|
if (this._sourceRoot != null) {
|
|
map.sourceRoot = this._sourceRoot;
|
|
}
|
|
if (this._sourcesContents) {
|
|
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
|
}
|
|
return map;
|
|
};
|
|
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
return JSON.stringify(this.toJSON());
|
|
};
|
|
var $SourceMapGenerator = SourceMapGenerator;
|
|
|
|
// node_modules/css-tree/lib/generator/sourceMap.js
|
|
var trackNodes = new Set(["Atrule", "Selector", "Declaration"]);
|
|
function generateSourceMap(handlers) {
|
|
const map = new $SourceMapGenerator;
|
|
const generated = {
|
|
line: 1,
|
|
column: 0
|
|
};
|
|
const original = {
|
|
line: 0,
|
|
column: 0
|
|
};
|
|
const activatedGenerated = {
|
|
line: 1,
|
|
column: 0
|
|
};
|
|
const activatedMapping = {
|
|
generated: activatedGenerated
|
|
};
|
|
let line = 1;
|
|
let column = 0;
|
|
let sourceMappingActive = false;
|
|
const origHandlersNode = handlers.node;
|
|
handlers.node = function(node2) {
|
|
if (node2.loc && node2.loc.start && trackNodes.has(node2.type)) {
|
|
const nodeLine = node2.loc.start.line;
|
|
const nodeColumn = node2.loc.start.column - 1;
|
|
if (original.line !== nodeLine || original.column !== nodeColumn) {
|
|
original.line = nodeLine;
|
|
original.column = nodeColumn;
|
|
generated.line = line;
|
|
generated.column = column;
|
|
if (sourceMappingActive) {
|
|
sourceMappingActive = false;
|
|
if (generated.line !== activatedGenerated.line || generated.column !== activatedGenerated.column) {
|
|
map.addMapping(activatedMapping);
|
|
}
|
|
}
|
|
sourceMappingActive = true;
|
|
map.addMapping({
|
|
source: node2.loc.source,
|
|
original,
|
|
generated
|
|
});
|
|
}
|
|
}
|
|
origHandlersNode.call(this, node2);
|
|
if (sourceMappingActive && trackNodes.has(node2.type)) {
|
|
activatedGenerated.line = line;
|
|
activatedGenerated.column = column;
|
|
}
|
|
};
|
|
const origHandlersEmit = handlers.emit;
|
|
handlers.emit = function(value, type, auto) {
|
|
for (let i = 0;i < value.length; i++) {
|
|
if (value.charCodeAt(i) === 10) {
|
|
line++;
|
|
column = 0;
|
|
} else {
|
|
column++;
|
|
}
|
|
}
|
|
origHandlersEmit(value, type, auto);
|
|
};
|
|
const origHandlersResult = handlers.result;
|
|
handlers.result = function() {
|
|
if (sourceMappingActive) {
|
|
map.addMapping(activatedMapping);
|
|
}
|
|
return {
|
|
css: origHandlersResult(),
|
|
map
|
|
};
|
|
};
|
|
return handlers;
|
|
}
|
|
|
|
// node_modules/css-tree/lib/generator/token-before.js
|
|
var exports_token_before = {};
|
|
__export(exports_token_before, {
|
|
spec: () => spec,
|
|
safe: () => safe
|
|
});
|
|
var PLUSSIGN7 = 43;
|
|
var HYPHENMINUS5 = 45;
|
|
var code = (type, value) => {
|
|
if (type === Delim) {
|
|
type = value;
|
|
}
|
|
if (typeof type === "string") {
|
|
type = Math.min(type.charCodeAt(0), 128) << 6;
|
|
}
|
|
return type << 1;
|
|
};
|
|
var specPairs = [
|
|
[Ident, Ident],
|
|
[Ident, Function],
|
|
[Ident, Url],
|
|
[Ident, BadUrl],
|
|
[Ident, "-"],
|
|
[Ident, Number2],
|
|
[Ident, Percentage],
|
|
[Ident, Dimension],
|
|
[Ident, CDC],
|
|
[Ident, LeftParenthesis],
|
|
[AtKeyword, Ident],
|
|
[AtKeyword, Function],
|
|
[AtKeyword, Url],
|
|
[AtKeyword, BadUrl],
|
|
[AtKeyword, "-"],
|
|
[AtKeyword, Number2],
|
|
[AtKeyword, Percentage],
|
|
[AtKeyword, Dimension],
|
|
[AtKeyword, CDC],
|
|
[Hash, Ident],
|
|
[Hash, Function],
|
|
[Hash, Url],
|
|
[Hash, BadUrl],
|
|
[Hash, "-"],
|
|
[Hash, Number2],
|
|
[Hash, Percentage],
|
|
[Hash, Dimension],
|
|
[Hash, CDC],
|
|
[Dimension, Ident],
|
|
[Dimension, Function],
|
|
[Dimension, Url],
|
|
[Dimension, BadUrl],
|
|
[Dimension, "-"],
|
|
[Dimension, Number2],
|
|
[Dimension, Percentage],
|
|
[Dimension, Dimension],
|
|
[Dimension, CDC],
|
|
["#", Ident],
|
|
["#", Function],
|
|
["#", Url],
|
|
["#", BadUrl],
|
|
["#", "-"],
|
|
["#", Number2],
|
|
["#", Percentage],
|
|
["#", Dimension],
|
|
["#", CDC],
|
|
["-", Ident],
|
|
["-", Function],
|
|
["-", Url],
|
|
["-", BadUrl],
|
|
["-", "-"],
|
|
["-", Number2],
|
|
["-", Percentage],
|
|
["-", Dimension],
|
|
["-", CDC],
|
|
[Number2, Ident],
|
|
[Number2, Function],
|
|
[Number2, Url],
|
|
[Number2, BadUrl],
|
|
[Number2, Number2],
|
|
[Number2, Percentage],
|
|
[Number2, Dimension],
|
|
[Number2, "%"],
|
|
[Number2, CDC],
|
|
["@", Ident],
|
|
["@", Function],
|
|
["@", Url],
|
|
["@", BadUrl],
|
|
["@", "-"],
|
|
["@", CDC],
|
|
[".", Number2],
|
|
[".", Percentage],
|
|
[".", Dimension],
|
|
["+", Number2],
|
|
["+", Percentage],
|
|
["+", Dimension],
|
|
["/", "*"]
|
|
];
|
|
var safePairs = specPairs.concat([
|
|
[Ident, Hash],
|
|
[Dimension, Hash],
|
|
[Hash, Hash],
|
|
[AtKeyword, LeftParenthesis],
|
|
[AtKeyword, String2],
|
|
[AtKeyword, Colon],
|
|
[Percentage, Percentage],
|
|
[Percentage, Dimension],
|
|
[Percentage, Function],
|
|
[Percentage, "-"],
|
|
[RightParenthesis, Ident],
|
|
[RightParenthesis, Function],
|
|
[RightParenthesis, Percentage],
|
|
[RightParenthesis, Dimension],
|
|
[RightParenthesis, Hash],
|
|
[RightParenthesis, "-"]
|
|
]);
|
|
function createMap(pairs) {
|
|
const isWhiteSpaceRequired = new Set(pairs.map(([prev, next]) => code(prev) << 16 | code(next)));
|
|
return function(prevCode, type, value) {
|
|
const nextCode = code(type, value);
|
|
const nextCharCode = value.charCodeAt(0);
|
|
const emitWs = nextCharCode === HYPHENMINUS5 && type !== Ident && type !== Function && type !== CDC || nextCharCode === PLUSSIGN7 ? isWhiteSpaceRequired.has((prevCode & 65534) << 16 | nextCharCode << 7) : isWhiteSpaceRequired.has((prevCode & 65534) << 16 | nextCode);
|
|
return nextCode | emitWs;
|
|
};
|
|
}
|
|
var spec = createMap(specPairs);
|
|
var safe = createMap(safePairs);
|
|
|
|
// node_modules/css-tree/lib/generator/create.js
|
|
var REVERSESOLIDUS = 92;
|
|
function processChildren(node2, delimeter) {
|
|
if (typeof delimeter === "function") {
|
|
let prev = null;
|
|
node2.children.forEach((node3) => {
|
|
if (prev !== null) {
|
|
delimeter.call(this, prev);
|
|
}
|
|
this.node(node3);
|
|
prev = node3;
|
|
});
|
|
return;
|
|
}
|
|
node2.children.forEach(this.node, this);
|
|
}
|
|
function createGenerator(config) {
|
|
const types3 = new Map;
|
|
for (let [name, item] of Object.entries(config.node)) {
|
|
const fn = item.generate || item;
|
|
if (typeof fn === "function") {
|
|
types3.set(name, item.generate || item);
|
|
}
|
|
}
|
|
return function(node2, options) {
|
|
let buffer = "";
|
|
let prevCode = 0;
|
|
let handlers = {
|
|
node(node3) {
|
|
if (types3.has(node3.type)) {
|
|
types3.get(node3.type).call(publicApi, node3);
|
|
} else {
|
|
throw new Error("Unknown node type: " + node3.type);
|
|
}
|
|
},
|
|
tokenBefore: safe,
|
|
token(type, value, suppressAutoWhiteSpace) {
|
|
prevCode = this.tokenBefore(prevCode, type, value);
|
|
if (!suppressAutoWhiteSpace && prevCode & 1) {
|
|
this.emit(" ", WhiteSpace, true);
|
|
}
|
|
this.emit(value, type, false);
|
|
if (type === Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
|
|
this.emit(`
|
|
`, WhiteSpace, true);
|
|
}
|
|
},
|
|
emit(value) {
|
|
buffer += value;
|
|
},
|
|
result() {
|
|
return buffer;
|
|
}
|
|
};
|
|
if (options) {
|
|
if (typeof options.decorator === "function") {
|
|
handlers = options.decorator(handlers);
|
|
}
|
|
if (options.sourceMap) {
|
|
handlers = generateSourceMap(handlers);
|
|
}
|
|
if (options.mode in exports_token_before) {
|
|
handlers.tokenBefore = exports_token_before[options.mode];
|
|
}
|
|
}
|
|
const publicApi = {
|
|
node: (node3) => handlers.node(node3),
|
|
children: processChildren,
|
|
token: (type, value) => handlers.token(type, value),
|
|
tokenize: (raw) => tokenize(raw, (type, start, end) => {
|
|
handlers.token(type, raw.slice(start, end), start !== 0);
|
|
})
|
|
};
|
|
handlers.node(node2);
|
|
return handlers.result();
|
|
};
|
|
}
|
|
|
|
// node_modules/css-tree/lib/syntax/node/index-generate.js
|
|
var exports_index_generate = {};
|
|
__export(exports_index_generate, {
|
|
WhiteSpace: () => generate50,
|
|
Value: () => generate49,
|
|
Url: () => generate48,
|
|
UnicodeRange: () => generate47,
|
|
TypeSelector: () => generate46,
|
|
SupportsDeclaration: () => generate45,
|
|
StyleSheet: () => generate44,
|
|
String: () => generate43,
|
|
SelectorList: () => generate42,
|
|
Selector: () => generate41,
|
|
Scope: () => generate40,
|
|
Rule: () => generate39,
|
|
Raw: () => generate38,
|
|
Ratio: () => generate37,
|
|
PseudoElementSelector: () => generate36,
|
|
PseudoClassSelector: () => generate35,
|
|
Percentage: () => generate34,
|
|
Parentheses: () => generate33,
|
|
Operator: () => generate32,
|
|
Number: () => generate31,
|
|
Nth: () => generate30,
|
|
NestingSelector: () => generate29,
|
|
MediaQueryList: () => generate28,
|
|
MediaQuery: () => generate27,
|
|
LayerList: () => generate26,
|
|
Layer: () => generate25,
|
|
Identifier: () => generate23,
|
|
IdSelector: () => generate24,
|
|
Hash: () => generate22,
|
|
GeneralEnclosed: () => generate21,
|
|
Function: () => generate20,
|
|
FeatureRange: () => generate19,
|
|
FeatureFunction: () => generate18,
|
|
Feature: () => generate17,
|
|
Dimension: () => generate16,
|
|
DeclarationList: () => generate15,
|
|
Declaration: () => generate14,
|
|
Condition: () => generate13,
|
|
Comment: () => generate12,
|
|
Combinator: () => generate11,
|
|
ClassSelector: () => generate10,
|
|
CDO: () => generate9,
|
|
CDC: () => generate8,
|
|
Brackets: () => generate7,
|
|
Block: () => generate6,
|
|
AttributeSelector: () => generate5,
|
|
AtrulePrelude: () => generate4,
|
|
Atrule: () => generate3,
|
|
AnPlusB: () => generate2
|
|
});
|
|
|
|
// node_modules/css-tree/lib/syntax/config/generator.js
|
|
var generator_default = {
|
|
node: exports_index_generate
|
|
};
|
|
|
|
// node_modules/css-tree/lib/generator/index.js
|
|
var generator_default2 = createGenerator(generator_default);
|
|
|
|
// scripts/lib/static-html-parsers.entry.mjs
|
|
var csstree = { parse: parser_default2, generate: generator_default2 };
|
|
export {
|
|
exports_dist3 as htmlparser2,
|
|
exports_dist2 as domutils,
|
|
csstree,
|
|
exports_dist5 as cssSelect
|
|
};
|