Fix code quality violations and exclude Manifest from checks

Document application modes (development/debug/production)
Add global file drop handler, order column normalization, SPA hash fix
Serve CDN assets via /_vendor/ URLs instead of merging into bundles
Add production minification with license preservation
Improve JSON formatting for debugging and production optimization
Add CDN asset caching with CSS URL inlining for production builds
Add three-mode system (development, debug, production)
Update Manifest CLAUDE.md to reflect helper class architecture
Refactor Manifest.php into helper classes for better organization
Pre-manifest-refactor checkpoint: Add app_mode documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-01-14 10:38:22 +00:00
parent bb9046af1b
commit d523f0f600
2355 changed files with 231384 additions and 32223 deletions

1
node_modules/.bin/.svgo-AV73XapU generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../svgo/bin/svgo

2
node_modules/.bin/svgo generated vendored
View File

@@ -1 +1 @@
../svgo/bin/svgo
../svgo/bin/svgo.js

1407
node_modules/.package-lock.json generated vendored

File diff suppressed because it is too large Load Diff

21
node_modules/@parcel/watcher-linux-x64-musl/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017-present Devon Govett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
node_modules/@parcel/watcher-linux-x64-musl/README.md generated vendored Executable file
View File

@@ -0,0 +1 @@
This is the linux-x64-musl build of @parcel/watcher. See https://github.com/parcel-bundler/watcher for details.

33
node_modules/@parcel/watcher-linux-x64-musl/package.json generated vendored Executable file
View File

@@ -0,0 +1,33 @@
{
"name": "@parcel/watcher-linux-x64-musl",
"version": "2.5.1",
"main": "watcher.node",
"repository": {
"type": "git",
"url": "https://github.com/parcel-bundler/watcher.git"
},
"description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"files": [
"watcher.node"
],
"engines": {
"node": ">= 10.0.0"
},
"os": [
"linux"
],
"cpu": [
"x64"
],
"libc": [
"musl"
]
}

BIN
node_modules/@parcel/watcher-linux-x64-musl/watcher.node generated vendored Executable file

Binary file not shown.

3
node_modules/@rollup/rollup-linux-x64-musl/README.md generated vendored Executable file
View File

@@ -0,0 +1,3 @@
# `@rollup/rollup-linux-x64-musl`
This is the **x86_64-unknown-linux-musl** binary for `rollup`

25
node_modules/@rollup/rollup-linux-x64-musl/package.json generated vendored Executable file
View File

@@ -0,0 +1,25 @@
{
"name": "@rollup/rollup-linux-x64-musl",
"version": "4.54.0",
"os": [
"linux"
],
"cpu": [
"x64"
],
"files": [
"rollup.linux-x64-musl.node"
],
"description": "Native bindings for Rollup",
"author": "Lukas Taegert-Atkinson",
"homepage": "https://rollupjs.org/",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/rollup/rollup.git"
},
"libc": [
"musl"
],
"main": "./rollup.linux-x64-musl.node"
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,48 @@
{
"name": "css-declaration-sorter",
"version": "6.4.1",
"version": "7.3.1",
"description": "Sorts CSS declarations fast and automatically in a certain order.",
"type": "module",
"main": "./dist/main.cjs",
"exports": {
"import": "./src/main.mjs",
"require": "./dist/main.cjs"
"import": {
"types": "./src/core/main.d.mts",
"default": "./src/core/main.mjs"
},
"require": {
"types": "./src/core/main.d.cts",
"default": "./dist/main.cjs"
}
},
"types": "./src/main.d.ts",
"types": "./src/core/main.d.cts",
"main": "./dist/main.cjs",
"files": [
"src/main.mjs",
"src/main.d.ts",
"src/shorthand-data.mjs",
"src/bubble-sort.mjs",
"orders",
"dist"
"src/core/",
"src/orders/",
"dist/"
],
"scripts": {
"build": "rollup -c",
"preversion": "npm test",
"test": "uvu src .+\\.test\\.mjs",
"test:ci": "npm test && npm run lint -- --max-warnings 0",
"lint": "eslint src/*.mjs",
"scrape": "node --experimental-import-meta-resolve src/property-scraper.mjs",
"lint": "eslint src/core/*.mjs",
"scrape": "node src/property-scraper.mjs",
"prepack": "npm run build"
},
"devDependencies": {
"@mdn/browser-compat-data": "^5.2.23",
"@rollup/plugin-dynamic-import-vars": "^2.0.2",
"@rollup/plugin-replace": "^5.0.2",
"eslint": "^8.35.0",
"postcss": "^8.4.18",
"rollup": "^3.15.0",
"@eslint/js": "^9.35.0",
"@mdn/browser-compat-data": "^7.1.7",
"@rollup/plugin-dynamic-import-vars": "^2.1.5",
"eslint": "^9.35.0",
"postcss": "^8.5.6",
"rollup": "^4.52.4",
"uvu": "^0.5.6"
},
"peerDependencies": {
"postcss": "^8.0.9"
},
"engines": {
"node": "^10 || ^12 || >=14"
"node": "^14 || ^16 || >=18"
},
"repository": {
"type": "git",

View File

@@ -58,6 +58,18 @@ body {
4. Dimensions
5. Text
- [Frakto](https://github.com/fraktodev/frakto-css-order)
`frakto`
*Order from the outermost layout and positioning rules, moving inward through structure, style, and interaction — inspired by the browsers render tree.*
1. Positioning
2. Box Model
3. Layout
4. Typography
5. Visual
6. Transform
7. Interaction
8. Miscellaneous
## Usage
Following the PostCSS plugin guidelines, this package depends on PostCSS as a peer dependency:
`npm install postcss css-declaration-sorter --save-dev`

View File

@@ -0,0 +1,27 @@
import type { PluginCreator } from 'postcss';
declare const cssDeclarationSorter: PluginCreator<{
/**
Provide the name of one of the built-in sort orders or a comparison function that is passed to `Array.sort`.
@default 'alphabetical'
*/
order?: SortOrder | SortFunction | undefined;
/**
To prevent breaking legacy CSS where shorthand declarations override longhand declarations. For example `animation-name: some; animation: greeting;` will be kept in this order.
@default false
*/
keepOverrides?: boolean;
}>;
export = cssDeclarationSorter;
type SortOrder = 'alphabetical' | 'concentric-css' | 'smacss' | 'frakto';
/**
* This function receives two declaration property names and is expected
* to return -1, 0 or 1 depending on the wanted order.
*/
type SortFunction = (propertyNameA: string, propertyNameB: string) => -1 | 0 | 1;

View File

@@ -0,0 +1,27 @@
import type { PluginCreator } from 'postcss';
export const cssDeclarationSorter: PluginCreator<{
/**
Provide the name of one of the built-in sort orders or a comparison function that is passed to `Array.sort`.
@default 'alphabetical'
*/
order?: SortOrder | SortFunction | undefined;
/**
To prevent breaking legacy CSS where shorthand declarations override longhand declarations. For example `animation-name: some; animation: greeting;` will be kept in this order.
@default false
*/
keepOverrides?: boolean;
}>;
export default cssDeclarationSorter;
type SortOrder = 'alphabetical' | 'concentric-css' | 'smacss' | 'frakto';
/**
* This function receives two declaration property names and is expected
* to return -1, 0 or 1 depending on the wanted order.
*/
type SortFunction = (propertyNameA: string, propertyNameB: string) => -1 | 0 | 1;

153
node_modules/css-declaration-sorter/src/core/main.mjs generated vendored Normal file
View File

@@ -0,0 +1,153 @@
import { shorthandData } from './shorthand-data.mjs';
import { bubbleSort } from './bubble-sort.mjs';
const builtInOrders = [
'alphabetical',
'concentric-css',
'smacss',
'frakto'
];
export const cssDeclarationSorter = ({ order = 'alphabetical', keepOverrides = false } = {}) => ({
postcssPlugin: 'css-declaration-sorter',
OnceExit (css) {
let withKeepOverrides = comparator => comparator;
if (keepOverrides) {
withKeepOverrides = withOverridesComparator(shorthandData);
}
if (typeof order === 'function') {
return processCss({ css, comparator: withKeepOverrides(order) });
}
if (!builtInOrders.includes(order))
return Promise.reject(
Error([
`Invalid built-in order '${order}' provided.`,
`Available built-in orders are: ${builtInOrders}`,
].join('\n'))
);
return import(`../orders/${order}.mjs`)
.then(({ properties }) => processCss({
css,
comparator: withKeepOverrides(orderComparator(properties)),
}));
},
});
cssDeclarationSorter.postcss = true;
// Kept for backward compatibility
export default cssDeclarationSorter;
function processCss ({ css, comparator }) {
const comments = [];
const rulesCache = [];
css.walk(node => {
const nodes = node.nodes;
const type = node.type;
if (type === 'comment') {
// Don't do anything to root comments or the last newline comment
const isNewlineNode = node.raws.before && node.raws.before.includes('\n');
const lastNewlineNode = isNewlineNode && !node.next();
const onlyNode = !node.prev() && !node.next() || !node.parent;
if (lastNewlineNode || onlyNode || node.parent.type === 'root') {
return;
}
if (isNewlineNode) {
const pairedNode = node.next() || node.prev();
if (pairedNode) {
comments.unshift({
'comment': node,
'pairedNode': pairedNode,
'insertPosition': node.next() ? 'Before' : 'After',
});
node.remove();
}
} else {
const pairedNode = node.prev() || node.next();
if (pairedNode) {
comments.push({
'comment': node,
'pairedNode': pairedNode,
'insertPosition': 'After',
});
node.remove();
}
}
return;
}
// Add rule-like nodes to a cache so that we can remove all
// comment nodes before we start sorting.
const isRule = type === 'rule' || type === 'atrule';
if (isRule && nodes && nodes.length > 1) {
rulesCache.push(nodes);
}
});
// Perform a sort once all comment nodes are removed
rulesCache.forEach(nodes => {
sortCssDeclarations({ nodes, comparator });
});
// Add comments back to the nodes they are paired with
comments.forEach(node => {
const pairedNode = node.pairedNode;
node.comment.remove();
pairedNode.parent && pairedNode.parent['insert' + node.insertPosition](pairedNode, node.comment);
});
}
function sortCssDeclarations ({ nodes, comparator }) {
bubbleSort(nodes, (a, b) => {
if (a.type === 'decl' && b.type === 'decl') {
return comparator(a.prop, b.prop);
} else {
return compareDifferentType(a, b);
}
});
}
function withOverridesComparator (shorthandData) {
return function (comparator) {
return function (a, b) {
a = removeVendorPrefix(a);
b = removeVendorPrefix(b);
if (shorthandData[a] && shorthandData[a].includes(b)) return 0;
if (shorthandData[b] && shorthandData[b].includes(a)) return 0;
return comparator(a, b);
};
};
}
function orderComparator (order) {
return function (a, b) {
const bIndex = order.indexOf(b);
if (bIndex === -1) {
return 0;
}
return order.indexOf(a) - bIndex;
};
}
function compareDifferentType (a, b) {
if (b.type === 'atrule' || a.type === 'atrule') {
return 0;
}
return a.type === 'decl' ? -1 : b.type === 'decl' ? 1 : 0;
}
function removeVendorPrefix (property) {
return property.replace(/^-\w+-/, '');
}

View File

@@ -0,0 +1,261 @@
import { test } from 'uvu';
import * as assert from 'uvu/assert';
import postcss from 'postcss';
import { cssDeclarationSorter as plugin } from './main.mjs';
const testCssFixtures = (testMessage, tests) => {
test(testMessage, () => (
Promise.all(tests.map(({ message, fixture, expected, options }) => (
postcss(plugin(options))
.process(fixture, { from: undefined })
.then((result) => {
assert.is(result.css, expected, message);
assert.is(result.warnings().length, 0);
})
)))
));
};
const sortOrderTests = [
{
message: 'Keep same order for identical properties.',
fixture: 'a{flex: 0;flex: 2;}',
expected: 'a{flex: 0;flex: 2;}',
},
{
message: 'Sort alphabetically with no order defined.',
fixture: 'a{flex: 0;border: 0;}',
expected: 'a{border: 0;flex: 0;}',
},
{
message: 'Sort alphabetically with a defined order.',
fixture: 'a{flex: 0;border: 0;}',
expected: 'a{border: 0;flex: 0;}',
options: { order: 'alphabetical' },
},
{
message: 'Sort according to custom order, changed.',
fixture: 'a{border: 0;z-index: 0;}',
expected: 'a{z-index: 0;border: 0;}',
options: { order: () => 1 },
},
{
message: 'Sort according to custom order, retained.',
fixture: 'a{border: 0;z-index: 0;}',
expected: 'a{border: 0;z-index: 0;}',
options: { order: () => -1 },
},
{
message: 'Sort according to SMACSS.',
fixture: 'a{border: 0;flex: 0;}',
expected: 'a{flex: 0;border: 0;}',
options: { order: 'smacss' },
},
{
message: 'Sort according to Concentric CSS.',
fixture: 'a{border: 0;flex: 0;}',
expected: 'a{flex: 0;border: 0;}',
options: { order: 'concentric-css' },
},
{
message: 'Sort according to Frakto.',
fixture: 'a{border: 0;flex: 0;}',
expected: 'a{flex: 0;border: 0;}',
options: { order: 'frakto' },
},
{
message: 'Keep at-rule at the same position.',
fixture: 'a{border: 0;@import sii;flex:0;}',
expected: 'a{border: 0;@import sii;flex:0;}',
},
{
message: 'Retain unknown properties, left to right.',
fixture: 'a{unknown-a: 0;unknown-b: 0;}',
expected: 'a{unknown-a: 0;unknown-b: 0;}',
},
{
message: 'Retain unknown properties, right to left.',
fixture: 'a{unknown-b: 0;unknown-a: 0;}',
expected: 'a{unknown-b: 0;unknown-a: 0;}',
},
{
message: 'Retain unknown next to known properties, left to right.',
fixture: 'a{animation: 0;unknown-a: none;}',
expected: 'a{animation: 0;unknown-a: none;}',
},
{
message: 'Retain unknown next to known properties, right to left.',
fixture: 'a{unknown-a: none;animation: 0;}',
expected: 'a{unknown-a: none;animation: 0;}',
},
{
message: 'Sort shorthand, resulting in impactful ordering.',
fixture: 'a{border-width: 0;border-radius: 0;border-bottom: 1px;}',
expected: 'a{border-bottom: 1px;border-radius: 0;border-width: 0;}',
},
];
const commentOrderTests = [
{
message: 'Keep comment intact.',
fixture: 'a{flex: 0;/*flex*/}',
expected: 'a{flex: 0;/*flex*/}',
},
{
message: 'Keep root comments intact.',
fixture: '/*a*/\na{}\n/*b*/\nb{}',
expected: '/*a*/\na{}\n/*b*/\nb{}',
},
{
message: 'Handle declaration with one comment.',
fixture: 'a{/*comment*/}',
expected: 'a{/*comment*/}',
},
{
message: 'Keep dangling comment intact.',
fixture: 'a{flex: 0;\n/*end*/}',
expected: 'a{flex: 0;\n/*end*/}',
},
{
message: 'Keep multiple comments intact.',
fixture: 'a{flex: 0;\n/*flex*/\n/*flex 2*/}',
expected: 'a{flex: 0;\n/*flex*/\n/*flex 2*/}',
},
{
message: 'Keep newline comment above declaration.',
fixture: 'a{flex: 0;\n/*border*/\nborder: 0;}',
expected: 'a{\n/*border*/\nborder: 0;flex: 0;}',
},
{
message: 'Handle multiple newline comments.',
fixture: 'a{flex: 0;\n/*border a*/\n/*border b*/\nborder: 0;}',
expected: 'a{\n/*border a*/\n/*border b*/\nborder: 0;flex: 0;}',
},
{
message: 'Keep inline comment beside declaration.',
fixture: 'a{flex: 0;\nborder: 0; /*border*/}',
expected: 'a{\nborder: 0; /*border*/flex: 0;}',
},
{
message: 'Do not lose reference to paired comment node on one line.',
fixture: 'body{/*a*/border:0;/*b*/}',
expected: 'body{border:0;/*b*//*a*/}',
},
];
const nestedDeclarationTests = [
{
message: 'Sort nested declarations.',
fixture: 'a{a{flex: 0;border: 0;}}',
expected: 'a{a{border: 0;flex: 0;}}',
},
{
message: 'Sort nested at-rule declarations.',
fixture: 'a{@media(){flex: 0;border: 0;}}',
expected: 'a{@media(){border: 0;flex: 0;}}',
},
{
message: 'Keep nested newline comment above declaration.',
fixture: 'a{&:hover{flex: 0;\n/*border*/\nborder: 0;}}',
expected: 'a{&:hover{\n/*border*/\nborder: 0;flex: 0;}}',
},
{
message: 'Keep nested inline comment beside declaration.',
fixture: 'a{&:hover{flex: 0;\nborder: 0; /*border*/}}',
expected: 'a{&:hover{\nborder: 0; /*border*/flex: 0;}}',
},
{
message: 'Put declarations before nested selector.',
fixture: 'a{margin: 0;&:hover{color: red;}padding: 0;}',
expected: 'a{margin: 0;padding: 0;&:hover{color: red;}}',
},
];
const keepOverridesTests = [
{
message: 'Keep shorthand overrides in place.',
fixture: 'a{animation-name: hi;animation: hey 1s ease;}',
expected: 'a{animation-name: hi;animation: hey 1s ease;}',
options: { keepOverrides: true },
},
{
message: 'Keep longhand overrides in place.',
fixture: 'a{flex: 1;flex-grow: -1;}',
expected: 'a{flex: 1;flex-grow: -1;}',
options: { keepOverrides: true, order: () => -1 },
},
{
message: 'Sort overrides with other declarations.',
fixture: 'a{z-index: 1;animation: hey 1s ease;}',
expected: 'a{animation: hey 1s ease;z-index: 1;}',
options: { keepOverrides: true },
},
{
message: 'Keep overrides in place mixed with declaration.',
fixture: 'a{z-index: 1;animation: hey 1s ease;animation-name: hi;}',
expected: 'a{animation: hey 1s ease;animation-name: hi;z-index: 1;}',
options: { keepOverrides: true },
},
{
message: 'Keep vendor prefixed declarations in place.',
fixture: 'a{animation: a;-moz-animation:b;}',
expected: 'a{animation: a;-moz-animation:b;}',
options: { keepOverrides: true },
},
{
message: 'Keep border declarations in place.',
fixture: 'a{border-top: 1px solid;border-color: purple;}',
expected:'a{border-top: 1px solid;border-color: purple;}',
options: { keepOverrides: true },
},
{
message: 'Keep padding declarations in place.',
fixture: 'a{padding-left: unset;padding-inline-start: 0;}',
expected:'a{padding-left: unset;padding-inline-start: 0;}',
options: { keepOverrides: true },
},
{
message: 'Keep border block declarations in place.',
fixture: 'a{border-block-end: 1px solid purple;border-block: none;}',
expected: 'a{border-block-end: 1px solid purple;border-block: none;}',
options: { keepOverrides: true },
},
{
message: 'Keep border block style declarations in place.',
fixture: 'a{border-style: none;border-block-end: 1px solid purple;}',
expected: 'a{border-style: none;border-block-end: 1px solid purple;}',
options: { keepOverrides: true },
},
{
message: 'Keep border width logical property declarations in place.',
fixture: 'a{background: grey;border-width: 0;border-top-width: 1px;border-inline-start-width: 1px;}',
expected: 'a{background: grey;border-width: 0;border-inline-start-width: 1px;border-top-width: 1px;}',
options: { keepOverrides: true },
},
{
message: 'Keep longhand border style declaration in place.',
fixture: 'a{border-width: 0;border-radius: 0;border-bottom: 1px;}',
expected: 'a{border-radius: 0;border-width: 0;border-bottom: 1px;}',
options: { keepOverrides: true },
},
{
message: 'Keep longhand border logical declaration in place.',
fixture: 'a{border-radius: 5px;border-end-start-radius: 0;border-end-end-radius: 0;}',
expected: 'a{border-radius: 5px;border-end-end-radius: 0;border-end-start-radius: 0;}',
options: { keepOverrides: true },
},
];
testCssFixtures('Should order declarations.', sortOrderTests);
testCssFixtures('Should retain comments.', commentOrderTests);
testCssFixtures('Should order nested declarations.', nestedDeclarationTests);
testCssFixtures('Should keep shorthand override order.', keepOverridesTests);
test('Should use the PostCSS plugin API.', () => {
assert.is(plugin().postcssPlugin, 'css-declaration-sorter', 'Able to access name.');
});
test.run();

View File

@@ -0,0 +1,493 @@
export const shorthandData = {
'animation': [
'animation-duration',
'animation-timing-function',
'animation-delay',
'animation-iteration-count',
'animation-direction',
'animation-fill-mode',
'animation-play-state',
'animation-name',
'animation-timeline',
],
'animation-range': [
'animation-range-start',
'animation-range-end',
],
'background': [
'background-image',
'background-position',
'background-size',
'background-repeat',
'background-attachment',
'background-origin',
'background-clip',
'background-color',
],
'columns': [
'column-width',
'column-count',
],
'column-rule': [
'column-rule-width',
'column-rule-style',
'column-rule-color',
],
'contain-intrinsic-size': [
'contain-intrinsic-width',
'contain-intrinsic-height',
],
'flex': [
'flex-grow',
'flex-shrink',
'flex-basis',
],
'flex-flow': [
'flex-direction',
'flex-wrap',
],
'font': [
'font-style',
'font-variant',
'font-weight',
'font-stretch',
'font-size',
'font-family',
'line-height',
],
'gap': [
'column-gap',
'row-gap',
],
'grid': [
'grid-template-rows',
'grid-template-columns',
'grid-template-areas',
'grid-auto-rows',
'grid-auto-columns',
'grid-auto-flow',
'column-gap',
'row-gap',
],
'grid-area': [
'grid-row-start',
'grid-column-start',
'grid-row-end',
'grid-column-end',
],
'grid-column': [
'grid-column-start',
'grid-column-end',
],
'grid-row': [
'grid-row-start',
'grid-row-end',
],
'grid-template': [
'grid-template-columns',
'grid-template-rows',
'grid-template-areas',
],
'list-style': [
'list-style-type',
'list-style-position',
'list-style-image',
],
'offset': [
'offset-anchor',
'offset-distance',
'offset-path',
'offset-position',
'offset-rotate',
],
'padding': [
'padding-block',
'padding-block-start',
'padding-block-end',
'padding-inline',
'padding-inline-start',
'padding-inline-end',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
],
'padding-block': [
'padding-block-start',
'padding-block-end',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
],
'padding-block-start': [
'padding-top',
'padding-right',
'padding-left',
],
'padding-block-end': [
'padding-right',
'padding-bottom',
'padding-left',
],
'padding-inline': [
'padding-inline-start',
'padding-inline-end',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
],
'padding-inline-start': [
'padding-top',
'padding-right',
'padding-left',
],
'padding-inline-end': [
'padding-right',
'padding-bottom',
'padding-left',
],
'position-try': [
'position-try-order',
'position-try-fallbacks',
],
'scroll-timeline': [
'scroll-timeline-name',
'scroll-timeline-axis',
],
'margin': [
'margin-block',
'margin-block-start',
'margin-block-end',
'margin-inline',
'margin-inline-start',
'margin-inline-end',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
],
'margin-block': [
'margin-block-start',
'margin-block-end',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
],
'margin-inline': [
'margin-inline-start',
'margin-inline-end',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
],
'margin-inline-start': [
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
],
'margin-inline-end': [
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
],
'marker': [
'marker-start',
'marker-mid',
'marker-end',
],
'view-timeline': [
'view-timeline-name',
'view-timeline-axis',
'view-timeline-inset',
],
'border': [
'border-top',
'border-right',
'border-bottom',
'border-left',
'border-width',
'border-style',
'border-color',
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width',
'border-inline-start-width',
'border-inline-end-width',
'border-block-start-width',
'border-block-end-width',
'border-top-style',
'border-right-style',
'border-bottom-style',
'border-left-style',
'border-inline-start-style',
'border-inline-end-style',
'border-block-start-style',
'border-block-end-style',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-inline-start-color',
'border-inline-end-color',
'border-block-start-color',
'border-block-end-color',
'border-block',
'border-block-start',
'border-block-end',
'border-block-width',
'border-block-style',
'border-block-color',
'border-inline',
'border-inline-start',
'border-inline-end',
'border-inline-width',
'border-inline-style',
'border-inline-color',
],
'border-top': [
'border-width',
'border-style',
'border-color',
'border-top-width',
'border-top-style',
'border-top-color',
],
'border-right': [
'border-width',
'border-style',
'border-color',
'border-right-width',
'border-right-style',
'border-right-color',
],
'border-bottom': [
'border-width',
'border-style',
'border-color',
'border-bottom-width',
'border-bottom-style',
'border-bottom-color',
],
'border-left': [
'border-width',
'border-style',
'border-color',
'border-left-width',
'border-left-style',
'border-left-color',
],
'border-color': [
'border-top-color',
'border-bottom-color',
'border-left-color',
'border-right-color',
'border-inline-start-color',
'border-inline-end-color',
'border-block-start-color',
'border-block-end-color',
],
'border-width': [
'border-top-width',
'border-bottom-width',
'border-left-width',
'border-right-width',
'border-inline-start-width',
'border-inline-end-width',
'border-block-start-width',
'border-block-end-width',
],
'border-style': [
'border-top-style',
'border-bottom-style',
'border-left-style',
'border-right-style',
'border-inline-start-style',
'border-inline-end-style',
'border-block-start-style',
'border-block-end-style',
],
'border-radius': [
'border-top-right-radius',
'border-top-left-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-end-end-radius',
'border-end-start-radius',
'border-start-end-radius',
'border-start-start-radius',
],
'border-block': [
'border-block-start',
'border-block-end',
'border-block-width',
'border-width',
'border-block-style',
'border-style',
'border-block-color',
'border-color',
],
'border-block-start': [
'border-block-start-width',
'border-width',
'border-block-start-style',
'border-style',
'border-block-start-color',
'border-color',
],
'border-block-end': [
'border-block-end-width',
'border-width',
'border-block-end-style',
'border-style',
'border-block-end-color',
'border-color',
],
'border-inline': [
'border-inline-start',
'border-inline-end',
'border-inline-width',
'border-width',
'border-inline-style',
'border-style',
'border-inline-color',
'border-color',
],
'border-inline-start': [
'border-inline-start-width',
'border-width',
'border-inline-start-style',
'border-style',
'border-inline-start-color',
'border-color',
],
'border-inline-end': [
'border-inline-end-width',
'border-width',
'border-inline-end-style',
'border-style',
'border-inline-end-color',
'border-color',
],
'border-image': [
'border-image-source',
'border-image-slice',
'border-image-width',
'border-image-outset',
'border-image-repeat',
],
'mask': [
'mask-image',
'mask-mode',
'mask-position',
'mask-size',
'mask-repeat',
'mask-origin',
'mask-clip',
'mask-composite',
],
'inline-size': [
'width',
'height',
],
'block-size': [
'width',
'height',
],
'max-inline-size': [
'max-width',
'max-height',
],
'max-block-size': [
'max-width',
'max-height',
],
'inset': [
'inset-block',
'inset-block-start',
'inset-block-end',
'inset-inline',
'inset-inline-start',
'inset-inline-end',
'top',
'right',
'bottom',
'left',
],
'inset-block': [
'inset-block-start',
'inset-block-end',
'top',
'right',
'bottom',
'left',
],
'inset-inline': [
'inset-inline-start',
'inset-inline-end',
'top',
'right',
'bottom',
'left',
],
'outline': [
'outline-color',
'outline-style',
'outline-width',
],
'overflow': [
'overflow-x',
'overflow-y',
],
'place-content': [
'align-content',
'justify-content',
],
'place-items': [
'align-items',
'justify-items',
],
'place-self': [
'align-self',
'justify-self',
],
'text-box': [
'text-box-trim',
'text-box-edge',
],
'text-decoration': [
'text-decoration-color',
'text-decoration-style',
'text-decoration-line',
],
'text-wrap': [
'text-wrap-mode',
'text-wrap-style',
],
'transition': [
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
],
'text-emphasis': [
'text-emphasis-style',
'text-emphasis-color',
],
'font-synthesis': [
'font-synthesis-weight',
'font-synthesis-style',
'font-synthesis-small-caps',
'font-synthesis-position',
],
'-webkit-text-stroke': [
'-webkit-text-stroke-color',
'-webkit-text-stroke-width',
],
};

View File

@@ -0,0 +1,471 @@
export const properties = [
'all',
'-webkit-text-fill-color',
'-webkit-text-stroke',
'-webkit-text-stroke-color',
'-webkit-text-stroke-width',
'accent-color',
'align-content',
'align-items',
'align-self',
'alignment-baseline',
'anchor-name',
'animation',
'animation-composition',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-range',
'animation-range-end',
'animation-range-start',
'animation-timeline',
'animation-timing-function',
'appearance',
'ascent-override',
'aspect-ratio',
'backdrop-filter',
'backface-visibility',
'background',
'background-attachment',
'background-blend-mode',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-position-x',
'background-position-y',
'background-repeat',
'background-size',
'block-size',
'border',
'border-block',
'border-block-color',
'border-block-end',
'border-block-end-color',
'border-block-end-style',
'border-block-end-width',
'border-block-start',
'border-block-start-color',
'border-block-start-style',
'border-block-start-width',
'border-block-style',
'border-block-width',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-end-end-radius',
'border-end-start-radius',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-inline',
'border-inline-color',
'border-inline-end',
'border-inline-end-color',
'border-inline-end-style',
'border-inline-end-width',
'border-inline-start',
'border-inline-start-color',
'border-inline-start-style',
'border-inline-start-width',
'border-inline-style',
'border-inline-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-start-end-radius',
'border-start-start-radius',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'caret-color',
'clear',
'clip-path',
'clip-rule',
'color',
'color-interpolation',
'color-interpolation-filters',
'color-scheme',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'contain',
'contain-intrinsic-block-size',
'contain-intrinsic-height',
'contain-intrinsic-inline-size',
'contain-intrinsic-size',
'contain-intrinsic-width',
'container',
'container-name',
'container-type',
'content',
'content-visibility',
'counter-increment',
'counter-reset',
'counter-set',
'cursor',
'cx',
'cy',
'd',
'descent-override',
'direction',
'display',
'dominant-baseline',
'empty-cells',
'fill',
'fill-opacity',
'fill-rule',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'flood-color',
'flood-opacity',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-optical-sizing',
'font-palette',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-synthesis',
'font-synthesis-position',
'font-synthesis-small-caps',
'font-synthesis-style',
'font-synthesis-weight',
'font-variant',
'font-variant-alternates',
'font-variant-caps',
'font-variant-east-asian',
'font-variant-emoji',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variation-settings',
'font-weight',
'forced-color-adjust',
'gap',
'grid',
'grid-area',
'grid-auto-columns',
'grid-auto-flow',
'grid-auto-rows',
'grid-column',
'grid-column-end',
'grid-column-start',
'grid-row',
'grid-row-end',
'grid-row-start',
'grid-template',
'grid-template-areas',
'grid-template-columns',
'grid-template-rows',
'hanging-punctuation',
'height',
'hyphenate-character',
'hyphenate-limit-chars',
'hyphens',
'image-orientation',
'image-rendering',
'initial-letter',
'inline-size',
'inset',
'inset-block',
'inset-block-end',
'inset-block-start',
'inset-inline',
'inset-inline-end',
'inset-inline-start',
'isolation',
'justify-content',
'justify-items',
'justify-self',
'left',
'letter-spacing',
'lighting-color',
'line-break',
'line-clamp',
'line-gap-override',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-block',
'margin-block-end',
'margin-block-start',
'margin-bottom',
'margin-inline',
'margin-inline-end',
'margin-inline-start',
'margin-left',
'margin-right',
'margin-top',
'marker',
'marker-end',
'marker-mid',
'marker-start',
'mask',
'mask-border',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-mode',
'mask-origin',
'mask-position',
'mask-repeat',
'mask-size',
'mask-type',
'math-depth',
'math-style',
'max-block-size',
'max-height',
'max-inline-size',
'max-width',
'min-block-size',
'min-height',
'min-inline-size',
'min-width',
'mix-blend-mode',
'object-fit',
'object-position',
'offset',
'offset-anchor',
'offset-distance',
'offset-path',
'offset-position',
'offset-rotate',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-anchor',
'overflow-block',
'overflow-clip-margin',
'overflow-inline',
'overflow-wrap',
'overflow-x',
'overflow-y',
'overscroll-behavior',
'overscroll-behavior-block',
'overscroll-behavior-inline',
'overscroll-behavior-x',
'overscroll-behavior-y',
'padding',
'padding-block',
'padding-block-end',
'padding-block-start',
'padding-bottom',
'padding-inline',
'padding-inline-end',
'padding-inline-start',
'padding-left',
'padding-right',
'padding-top',
'page',
'paint-order',
'perspective',
'perspective-origin',
'place-content',
'place-items',
'place-self',
'pointer-events',
'position',
'position-anchor',
'position-area',
'position-try',
'position-try-fallbacks',
'position-try-order',
'print-color-adjust',
'quotes',
'r',
'resize',
'right',
'rotate',
'row-gap',
'ruby-align',
'ruby-overhang',
'ruby-position',
'rx',
'ry',
'scale',
'scroll-behavior',
'scroll-margin',
'scroll-margin-block',
'scroll-margin-block-end',
'scroll-margin-block-start',
'scroll-margin-bottom',
'scroll-margin-inline',
'scroll-margin-inline-end',
'scroll-margin-inline-start',
'scroll-margin-left',
'scroll-margin-right',
'scroll-margin-top',
'scroll-padding',
'scroll-padding-block',
'scroll-padding-block-end',
'scroll-padding-block-start',
'scroll-padding-bottom',
'scroll-padding-inline',
'scroll-padding-inline-end',
'scroll-padding-inline-start',
'scroll-padding-left',
'scroll-padding-right',
'scroll-padding-top',
'scroll-snap-align',
'scroll-snap-stop',
'scroll-snap-type',
'scroll-timeline',
'scroll-timeline-axis',
'scroll-timeline-name',
'scrollbar-color',
'scrollbar-gutter',
'scrollbar-width',
'shape-image-threshold',
'shape-margin',
'shape-outside',
'shape-rendering',
'size-adjust',
'src',
'stop-color',
'stop-opacity',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'tab-size',
'table-layout',
'text-align',
'text-align-last',
'text-anchor',
'text-autospace',
'text-box',
'text-box-edge',
'text-box-trim',
'text-combine-upright',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-skip-ink',
'text-decoration-style',
'text-decoration-thickness',
'text-emphasis',
'text-emphasis-color',
'text-emphasis-position',
'text-emphasis-style',
'text-indent',
'text-justify',
'text-orientation',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-offset',
'text-underline-position',
'text-wrap',
'text-wrap-mode',
'text-wrap-style',
'timeline-scope',
'top',
'touch-action',
'transform',
'transform-box',
'transform-origin',
'transform-style',
'transition',
'transition-behavior',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'translate',
'unicode-bidi',
'unicode-range',
'user-select',
'vector-effect',
'vertical-align',
'view-timeline',
'view-timeline-axis',
'view-timeline-inset',
'view-timeline-name',
'view-transition-class',
'view-transition-name',
'visibility',
'white-space',
'white-space-collapse',
'widows',
'width',
'will-change',
'word-break',
'word-spacing',
'writing-mode',
'x',
'y',
'z-index',
'zoom'
];

View File

@@ -0,0 +1,475 @@
export const properties = [
'all',
'display',
'position',
'position-anchor',
'position-area',
'position-try',
'position-try-order',
'position-try-fallbacks',
'anchor-name',
'top',
'right',
'bottom',
'left',
'offset',
'offset-anchor',
'offset-distance',
'offset-path',
'offset-position',
'offset-rotate',
'grid',
'grid-template-rows',
'grid-template-columns',
'grid-template-areas',
'grid-auto-rows',
'grid-auto-columns',
'grid-auto-flow',
'column-gap',
'row-gap',
'grid-area',
'grid-row',
'grid-row-start',
'grid-row-end',
'grid-column',
'grid-column-start',
'grid-column-end',
'grid-template',
'flex',
'flex-grow',
'flex-shrink',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-wrap',
'box-decoration-break',
'place-content',
'align-content',
'justify-content',
'place-items',
'align-items',
'justify-items',
'place-self',
'align-self',
'justify-self',
'vertical-align',
'order',
'float',
'clear',
'shape-margin',
'shape-outside',
'shape-rendering',
'shape-image-threshold',
'orphans',
'gap',
'columns',
'column-fill',
'column-rule',
'column-rule-width',
'column-rule-style',
'column-rule-color',
'column-width',
'column-span',
'column-count',
'break-before',
'break-after',
'break-inside',
'page',
'transform',
'transform-box',
'transform-origin',
'transform-style',
'vector-effect',
'translate',
'rotate',
'scale',
'zoom',
'perspective',
'perspective-origin',
'appearance',
'visibility',
'content-visibility',
'opacity',
'z-index',
'paint-order',
'mix-blend-mode',
'backface-visibility',
'backdrop-filter',
'clip-path',
'clip-rule',
'mask',
'mask-border',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-image',
'mask-mode',
'mask-position',
'mask-size',
'mask-repeat',
'mask-origin',
'mask-clip',
'mask-composite',
'mask-type',
'filter',
'timeline-scope',
'scroll-timeline',
'scroll-timeline-name',
'scroll-timeline-axis',
'view-timeline',
'view-timeline-name',
'view-timeline-axis',
'view-timeline-inset',
'animation',
'animation-duration',
'animation-timing-function',
'animation-delay',
'animation-iteration-count',
'animation-direction',
'animation-fill-mode',
'animation-play-state',
'animation-name',
'animation-timeline',
'animation-composition',
'animation-range',
'animation-range-start',
'animation-range-end',
'view-transition-name',
'view-transition-class',
'transition',
'transition-behavior',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'will-change',
'counter-increment',
'counter-reset',
'counter-set',
'cursor',
'fill',
'fill-opacity',
'fill-rule',
'flood-color',
'flood-opacity',
'lighting-color',
'marker',
'marker-end',
'marker-mid',
'marker-start',
'x',
'y',
'r',
'rx',
'ry',
'stop-color',
'stop-opacity',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'box-sizing',
'contain',
'contain-intrinsic-size',
'contain-intrinsic-width',
'contain-intrinsic-height',
'contain-intrinsic-inline-size',
'contain-intrinsic-block-size',
'container',
'container-name',
'container-type',
'cx',
'cy',
'd',
'margin',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
'margin-inline',
'margin-inline-start',
'margin-inline-end',
'margin-block',
'margin-block-start',
'margin-block-end',
'inset',
'inset-block',
'inset-block-end',
'inset-block-start',
'inset-inline',
'inset-inline-end',
'inset-inline-start',
'outline',
'outline-color',
'outline-style',
'outline-width',
'outline-offset',
'box-shadow',
'border',
'border-top',
'border-right',
'border-bottom',
'border-left',
'border-width',
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width',
'border-style',
'border-top-style',
'border-right-style',
'border-bottom-style',
'border-left-style',
'border-color',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-radius',
'border-top-right-radius',
'border-top-left-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-inline',
'border-inline-width',
'border-inline-style',
'border-inline-color',
'border-inline-start',
'border-inline-start-width',
'border-inline-start-style',
'border-inline-start-color',
'border-inline-end',
'border-inline-end-width',
'border-inline-end-style',
'border-inline-end-color',
'border-block',
'border-block-width',
'border-block-style',
'border-block-color',
'border-block-start',
'border-block-start-width',
'border-block-start-style',
'border-block-start-color',
'border-block-end',
'border-block-end-width',
'border-block-end-style',
'border-block-end-color',
'border-image',
'border-image-source',
'border-image-slice',
'border-image-width',
'border-image-outset',
'border-image-repeat',
'border-collapse',
'border-spacing',
'border-start-start-radius',
'border-start-end-radius',
'border-end-start-radius',
'border-end-end-radius',
'background',
'background-image',
'background-position',
'background-position-x',
'background-position-y',
'background-size',
'background-repeat',
'background-attachment',
'background-origin',
'background-clip',
'background-color',
'background-blend-mode',
'isolation',
'padding',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
'padding-inline',
'padding-inline-start',
'padding-inline-end',
'padding-block',
'padding-block-start',
'padding-block-end',
'image-orientation',
'image-rendering',
'aspect-ratio',
'width',
'min-width',
'max-width',
'height',
'min-height',
'max-height',
'line-clamp',
'-webkit-text-fill-color',
'-webkit-text-stroke',
'-webkit-text-stroke-width',
'-webkit-text-stroke-color',
'inline-size',
'min-inline-size',
'max-inline-size',
'block-size',
'min-block-size',
'max-block-size',
'table-layout',
'caption-side',
'empty-cells',
'overflow',
'overflow-anchor',
'overflow-block',
'overflow-clip-margin',
'overflow-inline',
'overflow-x',
'overflow-y',
'overscroll-behavior',
'overscroll-behavior-block',
'overscroll-behavior-inline',
'overscroll-behavior-x',
'overscroll-behavior-y',
'resize',
'object-fit',
'object-position',
'scroll-behavior',
'scroll-margin',
'scroll-margin-block',
'scroll-margin-block-end',
'scroll-margin-block-start',
'scroll-margin-bottom',
'scroll-margin-inline',
'scroll-margin-inline-end',
'scroll-margin-inline-start',
'scroll-margin-left',
'scroll-margin-right',
'scroll-margin-top',
'scroll-padding',
'scroll-padding-block',
'scroll-padding-block-end',
'scroll-padding-block-start',
'scroll-padding-bottom',
'scroll-padding-inline',
'scroll-padding-inline-end',
'scroll-padding-inline-start',
'scroll-padding-left',
'scroll-padding-right',
'scroll-padding-top',
'scroll-snap-align',
'scroll-snap-stop',
'scroll-snap-type',
'scrollbar-color',
'scrollbar-gutter',
'scrollbar-width',
'touch-action',
'pointer-events',
'content',
'quotes',
'hanging-punctuation',
'color',
'color-interpolation',
'color-interpolation-filters',
'accent-color',
'print-color-adjust',
'forced-color-adjust',
'color-scheme',
'caret-color',
'font',
'font-style',
'font-variant',
'font-weight',
'font-stretch',
'font-size',
'size-adjust',
'line-height',
'src',
'font-family',
'font-display',
'font-kerning',
'font-language-override',
'font-optical-sizing',
'font-palette',
'font-size-adjust',
'font-synthesis',
'font-synthesis-weight',
'font-synthesis-style',
'font-synthesis-small-caps',
'font-synthesis-position',
'font-variant-alternates',
'font-variant-caps',
'font-variant-east-asian',
'font-variant-emoji',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variation-settings',
'font-feature-settings',
'alignment-baseline',
'dominant-baseline',
'text-anchor',
'text-autospace',
'text-box',
'text-box-trim',
'text-box-edge',
'ascent-override',
'descent-override',
'line-gap-override',
'hyphens',
'hyphenate-character',
'hyphenate-limit-chars',
'initial-letter',
'letter-spacing',
'line-break',
'list-style',
'list-style-type',
'list-style-image',
'list-style-position',
'writing-mode',
'direction',
'unicode-bidi',
'unicode-range',
'user-select',
'ruby-align',
'ruby-overhang',
'ruby-position',
'math-depth',
'math-style',
'text-combine-upright',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-line',
'text-decoration-style',
'text-decoration-color',
'text-decoration-thickness',
'text-decoration-skip-ink',
'text-emphasis',
'text-emphasis-style',
'text-emphasis-color',
'text-emphasis-position',
'text-indent',
'text-justify',
'text-underline-position',
'text-underline-offset',
'text-orientation',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-wrap',
'text-wrap-mode',
'text-wrap-style',
'white-space',
'white-space-collapse',
'word-break',
'word-spacing',
'overflow-wrap',
'tab-size',
'widows',
];

View File

@@ -0,0 +1,478 @@
export const properties = [
'position',
'position-anchor',
'position-area',
'position-try',
'position-try-order',
'position-try-fallbacks',
'anchor-name',
'top',
'right',
'bottom',
'left',
'inset',
'inset-block',
'inset-block-start',
'inset-block-end',
'inset-inline',
'inset-inline-start',
'inset-inline-end',
'z-index',
'float',
'clear',
'display',
'box-sizing',
'box-decoration-break',
'aspect-ratio',
'contain',
'contain-intrinsic-size',
'contain-intrinsic-width',
'contain-intrinsic-height',
'contain-intrinsic-block-size',
'contain-intrinsic-inline-size',
'container',
'container-name',
'container-type',
'width',
'min-width',
'max-width',
'height',
'min-height',
'max-height',
'block-size',
'min-block-size',
'max-block-size',
'inline-size',
'min-inline-size',
'max-inline-size',
'margin',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
'margin-block',
'margin-block-start',
'margin-block-end',
'margin-inline',
'margin-inline-start',
'margin-inline-end',
'padding',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
'padding-block',
'padding-block-start',
'padding-block-end',
'padding-inline',
'padding-inline-start',
'padding-inline-end',
'flex',
'flex-grow',
'flex-shrink',
'flex-basis',
'flex-flow',
'flex-direction',
'flex-wrap',
'grid',
'grid-area',
'grid-auto-columns',
'grid-auto-flow',
'grid-auto-rows',
'grid-column',
'grid-column-end',
'grid-column-start',
'grid-row',
'grid-row-end',
'grid-row-start',
'grid-template',
'grid-template-areas',
'grid-template-columns',
'grid-template-rows',
'align-content',
'align-items',
'align-self',
'justify-content',
'justify-items',
'justify-self',
'place-content',
'place-items',
'place-self',
'gap',
'row-gap',
'column-gap',
'order',
'orphans',
'widows',
'columns',
'column-width',
'column-count',
'column-span',
'column-rule',
'column-rule-width',
'column-rule-style',
'column-rule-color',
'column-fill',
'table-layout',
'caption-side',
'color',
'caret-color',
'font',
'font-style',
'font-variant',
'font-weight',
'font-stretch',
'font-size',
'font-family',
'font-size-adjust',
'font-display',
'font-optical-sizing',
'font-variation-settings',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-palette',
'font-synthesis',
'font-synthesis-weight',
'font-synthesis-style',
'font-synthesis-small-caps',
'font-synthesis-position',
'font-variant-alternates',
'font-variant-caps',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variant-east-asian',
'font-variant-emoji',
'size-adjust',
'text-align',
'text-align-last',
'text-indent',
'text-justify',
'text-wrap',
'text-wrap-mode',
'text-wrap-style',
'text-overflow',
'text-transform',
'text-orientation',
'text-combine-upright',
'text-decoration',
'text-decoration-line',
'text-decoration-color',
'text-decoration-style',
'text-decoration-thickness',
'text-decoration-skip-ink',
'text-underline-offset',
'text-underline-position',
'text-emphasis',
'text-emphasis-style',
'text-emphasis-color',
'text-emphasis-position',
'text-shadow',
'text-rendering',
'text-anchor',
'text-autospace',
'text-box',
'text-box-trim',
'text-box-edge',
'-webkit-text-fill-color',
'-webkit-text-stroke',
'-webkit-text-stroke-width',
'-webkit-text-stroke-color',
'line-height',
'line-break',
'line-clamp',
'line-gap-override',
'white-space',
'white-space-collapse',
'word-break',
'word-spacing',
'letter-spacing',
'vertical-align',
'list-style',
'list-style-type',
'list-style-position',
'list-style-image',
'hyphens',
'hyphenate-character',
'hyphenate-limit-chars',
'hanging-punctuation',
'direction',
'unicode-bidi',
'unicode-range',
'writing-mode',
'dominant-baseline',
'alignment-baseline',
'ascent-override',
'descent-override',
'initial-letter',
'ruby-position',
'ruby-overhang',
'ruby-align',
'quotes',
'background',
'background-image',
'background-position',
'background-position-x',
'background-position-y',
'background-size',
'background-repeat',
'background-attachment',
'background-origin',
'background-clip',
'background-color',
'background-blend-mode',
'border',
'border-width',
'border-style',
'border-color',
'border-top',
'border-top-width',
'border-top-style',
'border-top-color',
'border-right',
'border-right-width',
'border-right-style',
'border-right-color',
'border-bottom',
'border-bottom-width',
'border-bottom-style',
'border-bottom-color',
'border-left',
'border-left-width',
'border-left-style',
'border-left-color',
'border-block',
'border-block-width',
'border-block-style',
'border-block-color',
'border-block-start',
'border-block-start-width',
'border-block-start-style',
'border-block-start-color',
'border-block-end',
'border-block-end-width',
'border-block-end-style',
'border-block-end-color',
'border-inline',
'border-inline-width',
'border-inline-style',
'border-inline-color',
'border-inline-start',
'border-inline-start-width',
'border-inline-start-style',
'border-inline-start-color',
'border-inline-end',
'border-inline-end-width',
'border-inline-end-style',
'border-inline-end-color',
'border-radius',
'border-top-left-radius',
'border-top-right-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-start-start-radius',
'border-start-end-radius',
'border-end-end-radius',
'border-end-start-radius',
'border-image',
'border-image-source',
'border-image-slice',
'border-image-width',
'border-image-outset',
'border-image-repeat',
'border-collapse',
'border-spacing',
'outline',
'outline-width',
'outline-style',
'outline-color',
'outline-offset',
'box-shadow',
'opacity',
'visibility',
'object-fit',
'object-position',
'filter',
'backdrop-filter',
'backface-visibility',
'mask',
'mask-border',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-mode',
'mask-origin',
'mask-position',
'mask-repeat',
'mask-size',
'mask-type',
'shape-outside',
'shape-margin',
'shape-rendering',
'shape-image-threshold',
'd',
'x',
'y',
'cx',
'cy',
'r',
'rx',
'ry',
'clip-path',
'clip-rule',
'fill',
'fill-opacity',
'fill-rule',
'flood-color',
'flood-opacity',
'lighting-color',
'marker',
'marker-start',
'marker-mid',
'marker-end',
'stroke',
'stroke-width',
'stroke-opacity',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stop-color',
'stop-opacity',
'accent-color',
'mix-blend-mode',
'paint-order',
'isolation',
'appearance',
'color-scheme',
'color-interpolation',
'color-interpolation-filters',
'transform',
'transform-box',
'transform-origin',
'transform-style',
'translate',
'scale',
'rotate',
'zoom',
'vector-effect',
'transition',
'transition-property',
'transition-duration',
'transition-timing-function',
'transition-delay',
'transition-behavior',
'view-transition-name',
'view-transition-class',
'timeline-scope',
'scroll-timeline',
'scroll-timeline-name',
'scroll-timeline-axis',
'view-timeline',
'view-timeline-name',
'view-timeline-axis',
'view-timeline-inset',
'animation',
'animation-duration',
'animation-timing-function',
'animation-delay',
'animation-iteration-count',
'animation-direction',
'animation-fill-mode',
'animation-play-state',
'animation-name',
'animation-timeline',
'animation-composition',
'animation-range',
'animation-range-start',
'animation-range-end',
'offset',
'offset-path',
'offset-position',
'offset-distance',
'offset-rotate',
'offset-anchor',
'image-orientation',
'image-rendering',
'perspective',
'perspective-origin',
'will-change',
'cursor',
'pointer-events',
'touch-action',
'user-select',
'resize',
'overflow',
'overflow-x',
'overflow-y',
'overflow-block',
'overflow-inline',
'overflow-wrap',
'overflow-anchor',
'overflow-clip-margin',
'overscroll-behavior',
'overscroll-behavior-x',
'overscroll-behavior-y',
'overscroll-behavior-block',
'overscroll-behavior-inline',
'scroll-behavior',
'scroll-margin',
'scroll-margin-top',
'scroll-margin-right',
'scroll-margin-bottom',
'scroll-margin-left',
'scroll-margin-block',
'scroll-margin-block-start',
'scroll-margin-block-end',
'scroll-margin-inline',
'scroll-margin-inline-start',
'scroll-margin-inline-end',
'scroll-padding',
'scroll-padding-top',
'scroll-padding-right',
'scroll-padding-bottom',
'scroll-padding-left',
'scroll-padding-block',
'scroll-padding-block-start',
'scroll-padding-block-end',
'scroll-padding-inline',
'scroll-padding-inline-start',
'scroll-padding-inline-end',
'scroll-snap-type',
'scroll-snap-align',
'scroll-snap-stop',
'scrollbar-width',
'scrollbar-color',
'scrollbar-gutter',
'all',
'content',
'content-visibility',
'page',
'break-after',
'break-before',
'break-inside',
'counter-reset',
'counter-increment',
'counter-set',
'empty-cells',
'forced-color-adjust',
'print-color-adjust',
'math-depth',
'math-style',
'src',
'tab-size',
];

View File

@@ -0,0 +1,476 @@
export const properties = [
'all',
'box-sizing',
'contain',
'contain-intrinsic-size',
'contain-intrinsic-width',
'contain-intrinsic-height',
'contain-intrinsic-inline-size',
'contain-intrinsic-block-size',
'container',
'container-name',
'container-type',
'cx',
'cy',
'd',
'display',
'appearance',
'visibility',
'content-visibility',
'z-index',
'paint-order',
'position',
'position-anchor',
'position-area',
'position-try',
'position-try-order',
'position-try-fallbacks',
'anchor-name',
'top',
'right',
'bottom',
'left',
'offset',
'offset-anchor',
'offset-distance',
'offset-path',
'offset-position',
'offset-rotate',
'grid',
'grid-template-rows',
'grid-template-columns',
'grid-template-areas',
'grid-auto-rows',
'grid-auto-columns',
'grid-auto-flow',
'column-gap',
'row-gap',
'grid-area',
'grid-row',
'grid-row-start',
'grid-row-end',
'grid-column',
'grid-column-start',
'grid-column-end',
'grid-template',
'flex',
'flex-grow',
'flex-shrink',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-wrap',
'box-decoration-break',
'place-content',
'place-items',
'place-self',
'align-content',
'align-items',
'align-self',
'justify-content',
'justify-items',
'justify-self',
'order',
'aspect-ratio',
'width',
'min-width',
'max-width',
'height',
'min-height',
'max-height',
'line-clamp',
'-webkit-text-fill-color',
'-webkit-text-stroke',
'-webkit-text-stroke-width',
'-webkit-text-stroke-color',
'inline-size',
'min-inline-size',
'max-inline-size',
'block-size',
'min-block-size',
'max-block-size',
'margin',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
'margin-inline',
'margin-inline-start',
'margin-inline-end',
'margin-block',
'margin-block-start',
'margin-block-end',
'inset',
'inset-block',
'inset-block-end',
'inset-block-start',
'inset-inline',
'inset-inline-end',
'inset-inline-start',
'padding',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
'padding-inline',
'padding-inline-start',
'padding-inline-end',
'padding-block',
'padding-block-start',
'padding-block-end',
'float',
'clear',
'overflow',
'overflow-anchor',
'overflow-block',
'overflow-clip-margin',
'overflow-inline',
'overflow-x',
'overflow-y',
'overscroll-behavior',
'overscroll-behavior-block',
'overscroll-behavior-inline',
'overscroll-behavior-x',
'overscroll-behavior-y',
'orphans',
'gap',
'columns',
'column-fill',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-count',
'column-width',
'object-fit',
'object-position',
'transform',
'transform-box',
'transform-origin',
'transform-style',
'vector-effect',
'translate',
'rotate',
'scale',
'zoom',
'border',
'border-top',
'border-right',
'border-bottom',
'border-left',
'border-width',
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width',
'border-style',
'border-top-style',
'border-right-style',
'border-bottom-style',
'border-left-style',
'border-radius',
'border-top-right-radius',
'border-top-left-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
'border-inline',
'border-inline-color',
'border-inline-style',
'border-inline-width',
'border-inline-start',
'border-inline-start-color',
'border-inline-start-style',
'border-inline-start-width',
'border-inline-end',
'border-inline-end-color',
'border-inline-end-style',
'border-inline-end-width',
'border-block',
'border-block-color',
'border-block-style',
'border-block-width',
'border-block-start',
'border-block-start-color',
'border-block-start-style',
'border-block-start-width',
'border-block-end',
'border-block-end-color',
'border-block-end-style',
'border-block-end-width',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-collapse',
'border-spacing',
'border-start-start-radius',
'border-start-end-radius',
'border-end-start-radius',
'border-end-end-radius',
'outline',
'outline-color',
'outline-style',
'outline-width',
'outline-offset',
'backdrop-filter',
'backface-visibility',
'background',
'background-image',
'background-position',
'background-position-x',
'background-position-y',
'background-size',
'background-repeat',
'background-attachment',
'background-origin',
'background-clip',
'background-color',
'background-blend-mode',
'box-shadow',
'isolation',
'fill',
'fill-opacity',
'fill-rule',
'flood-color',
'flood-opacity',
'lighting-color',
'marker',
'marker-end',
'marker-mid',
'marker-start',
'x',
'y',
'r',
'rx',
'ry',
'stop-color',
'stop-opacity',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'content',
'quotes',
'hanging-punctuation',
'color',
'color-interpolation',
'color-interpolation-filters',
'accent-color',
'print-color-adjust',
'forced-color-adjust',
'color-scheme',
'caret-color',
'font',
'font-style',
'font-variant',
'font-weight',
'src',
'font-stretch',
'font-size',
'size-adjust',
'line-height',
'font-family',
'font-display',
'font-kerning',
'font-language-override',
'font-optical-sizing',
'font-palette',
'font-size-adjust',
'font-synthesis',
'font-synthesis-weight',
'font-synthesis-style',
'font-synthesis-small-caps',
'font-synthesis-position',
'font-variant-alternates',
'font-variant-caps',
'font-variant-east-asian',
'font-variant-emoji',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variation-settings',
'font-feature-settings',
'alignment-baseline',
'dominant-baseline',
'text-anchor',
'text-autospace',
'text-box',
'text-box-trim',
'text-box-edge',
'ascent-override',
'descent-override',
'line-gap-override',
'hyphens',
'hyphenate-character',
'hyphenate-limit-chars',
'initial-letter',
'letter-spacing',
'line-break',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'direction',
'text-align',
'text-align-last',
'text-decoration',
'text-decoration-line',
'text-decoration-style',
'text-decoration-color',
'text-decoration-thickness',
'text-decoration-skip-ink',
'text-emphasis',
'text-emphasis-style',
'text-emphasis-color',
'text-emphasis-position',
'text-indent',
'text-justify',
'text-underline-position',
'text-underline-offset',
'text-orientation',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-wrap',
'text-wrap-mode',
'text-wrap-style',
'vertical-align',
'white-space',
'white-space-collapse',
'word-break',
'word-spacing',
'overflow-wrap',
'timeline-scope',
'scroll-timeline',
'scroll-timeline-name',
'scroll-timeline-axis',
'view-timeline',
'view-timeline-name',
'view-timeline-axis',
'view-timeline-inset',
'animation',
'animation-duration',
'animation-timing-function',
'animation-delay',
'animation-iteration-count',
'animation-direction',
'animation-fill-mode',
'animation-play-state',
'animation-name',
'animation-timeline',
'animation-composition',
'animation-range',
'animation-range-start',
'animation-range-end',
'view-transition-name',
'view-transition-class',
'mix-blend-mode',
'break-before',
'break-after',
'break-inside',
'page',
'caption-side',
'clip-path',
'clip-rule',
'counter-increment',
'counter-reset',
'counter-set',
'cursor',
'empty-cells',
'filter',
'image-orientation',
'image-rendering',
'mask',
'mask-border',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-mode',
'mask-origin',
'mask-position',
'mask-repeat',
'mask-size',
'mask-type',
'opacity',
'perspective',
'perspective-origin',
'pointer-events',
'resize',
'scroll-behavior',
'scroll-margin',
'scroll-margin-block',
'scroll-margin-block-end',
'scroll-margin-block-start',
'scroll-margin-bottom',
'scroll-margin-inline',
'scroll-margin-inline-end',
'scroll-margin-inline-start',
'scroll-margin-left',
'scroll-margin-right',
'scroll-margin-top',
'scroll-padding',
'scroll-padding-block',
'scroll-padding-block-end',
'scroll-padding-block-start',
'scroll-padding-bottom',
'scroll-padding-inline',
'scroll-padding-inline-end',
'scroll-padding-inline-start',
'scroll-padding-left',
'scroll-padding-right',
'scroll-padding-top',
'scroll-snap-align',
'scroll-snap-stop',
'scroll-snap-type',
'scrollbar-color',
'scrollbar-gutter',
'scrollbar-width',
'shape-image-threshold',
'shape-margin',
'shape-outside',
'shape-rendering',
'tab-size',
'table-layout',
'ruby-align',
'ruby-overhang',
'ruby-position',
'math-depth',
'math-style',
'text-combine-upright',
'touch-action',
'transition',
'transition-behavior',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'will-change',
'unicode-bidi',
'unicode-range',
'user-select',
'widows',
'writing-mode',
];

29
node_modules/css-select/README.md generated vendored
View File

@@ -22,19 +22,21 @@ below.
- 🧪 Partial implementation of jQuery/Sizzle extensions (see
[cheerio-select](https://github.com/cheeriojs/cheerio-select) for the
remaining selectors)
- 🧑‍🔬 High test coverage, including the full test suites from Sizzle, Qwery and
NWMatcher.
- 🧑‍🔬 High test coverage, including the full test suites from
[`Sizzle`](https://github.com/jquery/sizzle),
[`Qwery`](https://github.com/ded/qwery) and
[`NWMatcher`](https://github.com/dperini/nwmatcher/) and .
- 🥼 Reliably great performance
## Why?
Most CSS engines written in JavaScript execute selectors left-to-right. That
means thet execute every component of the selector in order, from left to right
_(duh)_. As an example: For the selector `a b`, these engines will first query
for `a` elements, then search these for `b` elements. (That's the approach of
eg. [`Sizzle`](https://github.com/jquery/sizzle),
[`nwmatcher`](https://github.com/dperini/nwmatcher/) and
[`qwery`](https://github.com/ded/qwery).)
means thet execute every component of the selector in order, from left to right.
As an example: For the selector `a b`, these engines will first query for `a`
elements, then search these for `b` elements. (That's the approach of eg.
[`Sizzle`](https://github.com/jquery/sizzle),
[`Qwery`](https://github.com/ded/qwery) and
[`NWMatcher`](https://github.com/dperini/nwmatcher/).)
While this works, it has some downsides: Children of `a`s will be checked
multiple times; first, to check if they are also `a`s, then, for every superior
@@ -100,7 +102,7 @@ _//TODO: More in-depth description. Implementation details. Build a spaceship._
const CSSselect = require("css-select");
```
**Note:** css-select throws errors when invalid selectors are passed to it.This
**Note:** css-select throws errors when invalid selectors are passed to it. This
is done to aid with writing css selectors, but can be unexpected when processing
arbitrary strings.
@@ -139,11 +141,18 @@ All options are optional.
- `adapter`: The adapter to use when interacting with the backing DOM
structure. By default it uses the `domutils` module.
- `context`: The context of the current query. Used to limit the scope of
searches. Can be matched directly using the `:scope` pseudo-selector.
searches. Can be matched directly using the `:scope` pseudo-class.
- `relativeSelector`: By default, selectors are relative to the `context`,
which means that no parent elements of the context will be matched. (Eg.
`a b c` with context `b` will never give any results.) If `relativeSelector`
is set to `false`, selectors won't be
[absolutized](http://www.w3.org/TR/selectors4/#absolutizing) and selectors
can test for parent elements outside of the `context`.
- `cacheResults`: Allow css-select to cache results for some selectors,
sometimes greatly improving querying performance. Disable this if your
document can change in between queries with the same compiled selector.
Default: `true`.
- `pseudos`: A map of pseudo-class names to functions or strings.
#### Custom Adapters

View File

@@ -1,4 +1,4 @@
import { CompiledQuery, InternalOptions } from "./types";
import type { CompiledQuery, InternalOptions } from "./types.js";
import type { AttributeSelector, AttributeAction } from "css-what";
/**
* Attribute selectors

View File

@@ -1 +1 @@
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../src/attributes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+EnE;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAC/B,eAAe,EACf,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3B,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,KAC1C,aAAa,CAAC,WAAW,CAAC,CAsLlC,CAAC"}
{"version":3,"file":"attributes.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["attributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+EnE;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAC/B,eAAe,EACf,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3B,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,KAC1C,aAAa,CAAC,WAAW,CAAC,CAsLlC,CAAC"}

View File

@@ -1,7 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.attributeRules = void 0;
var boolbase_1 = require("boolbase");
var boolbase_1 = __importDefault(require("boolbase"));
/**
* All reserved characters in a regex, used for escaping.
*
@@ -122,7 +125,7 @@ exports.attributeRules = {
var adapter = options.adapter;
var name = data.name, value = data.value;
if (/\s/.test(value)) {
return boolbase_1.falseFunc;
return boolbase_1.default.falseFunc;
}
var regex = new RegExp("(?:^|\\s)".concat(escapeRegex(value), "(?:$|\\s)"), shouldIgnoreCase(data, options) ? "i" : "");
return function element(elem) {
@@ -144,7 +147,7 @@ exports.attributeRules = {
var value = data.value;
var len = value.length;
if (len === 0) {
return boolbase_1.falseFunc;
return boolbase_1.default.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
@@ -168,7 +171,7 @@ exports.attributeRules = {
var value = data.value;
var len = -value.length;
if (len === 0) {
return boolbase_1.falseFunc;
return boolbase_1.default.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
@@ -188,7 +191,7 @@ exports.attributeRules = {
var adapter = options.adapter;
var name = data.name, value = data.value;
if (value === "") {
return boolbase_1.falseFunc;
return boolbase_1.default.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
var regex_1 = new RegExp(escapeRegex(value), "i");
@@ -230,3 +233,4 @@ exports.attributeRules = {
};
},
};
//# sourceMappingURL=attributes.js.map

1
node_modules/css-select/lib/attributes.js.map generated vendored Executable file

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,5 @@
import { InternalSelector } from "./types";
import { Selector } from "css-what";
import type { CompiledQuery, InternalOptions } from "./types";
import type { CompiledQuery, InternalOptions, InternalSelector } from "./types.js";
/**
* Compiles a selector to an executable function.
*

View File

@@ -1 +1 @@
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAS,QAAQ,EAAgB,MAAM,UAAU,CAAC;AASzD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACxD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAG5B;AAiDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACvD,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAC3B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CA2C5B"}
{"version":3,"file":"compile.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAgB,MAAM,UAAU,CAAC;AAQzD,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,gBAAgB,EACnB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACxD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAG5B;AAqDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACvD,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAC3B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAsD5B"}

View File

@@ -1,15 +1,37 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.compileToken = exports.compileUnsafe = exports.compile = void 0;
var css_what_1 = require("css-what");
var boolbase_1 = require("boolbase");
var sort_1 = __importDefault(require("./sort"));
var procedure_1 = require("./procedure");
var general_1 = require("./general");
var subselects_1 = require("./pseudo-selectors/subselects");
var boolbase_1 = __importDefault(require("boolbase"));
var sort_js_1 = __importStar(require("./sort.js"));
var general_js_1 = require("./general.js");
var subselects_js_1 = require("./pseudo-selectors/subselects.js");
/**
* Compiles a selector to an executable function.
*
@@ -19,7 +41,7 @@ var subselects_1 = require("./pseudo-selectors/subselects");
*/
function compile(selector, options, context) {
var next = compileUnsafe(selector, options, context);
return (0, subselects_1.ensureIsTag)(next, options.adapter);
return (0, subselects_js_1.ensureIsTag)(next, options.adapter);
}
exports.compile = compile;
function compileUnsafe(selector, options, context) {
@@ -28,7 +50,7 @@ function compileUnsafe(selector, options, context) {
}
exports.compileUnsafe = compileUnsafe;
function includesScopePseudo(t) {
return (t.type === "pseudo" &&
return (t.type === css_what_1.SelectorType.Pseudo &&
(t.name === "scope" ||
(Array.isArray(t.data) &&
t.data.some(function (data) { return data.some(includesScopePseudo); }))));
@@ -43,7 +65,7 @@ var SCOPE_TOKEN = {
data: null,
};
/*
* CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector
* CSS 4 Spec (Draft): 3.4.1. Absolutizing a Relative Selector
* http://www.w3.org/TR/selectors4/#absolutizing
*/
function absolutize(token, _a, context) {
@@ -51,11 +73,13 @@ function absolutize(token, _a, context) {
// TODO Use better check if the context is a document
var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function (e) {
var parent = adapter.isTag(e) && adapter.getParent(e);
return e === subselects_1.PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
return e === subselects_js_1.PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
}));
for (var _i = 0, token_1 = token; _i < token_1.length; _i++) {
var t = token_1[_i];
if (t.length > 0 && (0, procedure_1.isTraversal)(t[0]) && t[0].type !== "descendant") {
if (t.length > 0 &&
(0, sort_js_1.isTraversal)(t[0]) &&
t[0].type !== css_what_1.SelectorType.Descendant) {
// Don't continue in else branch
}
else if (hasContext && !t.some(includesScopePseudo)) {
@@ -69,31 +93,38 @@ function absolutize(token, _a, context) {
}
function compileToken(token, options, context) {
var _a;
token = token.filter(function (t) { return t.length > 0; });
token.forEach(sort_1.default);
token.forEach(sort_js_1.default);
context = (_a = options.context) !== null && _a !== void 0 ? _a : context;
var isArrayContext = Array.isArray(context);
var finalContext = context && (Array.isArray(context) ? context : [context]);
absolutize(token, options, finalContext);
// Check if the selector is relative
if (options.relativeSelector !== false) {
absolutize(token, options, finalContext);
}
else if (token.some(function (t) { return t.length > 0 && (0, sort_js_1.isTraversal)(t[0]); })) {
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
}
var shouldTestNextSiblings = false;
var query = token
.map(function (rules) {
if (rules.length >= 2) {
var first = rules[0], second = rules[1];
if (first.type !== "pseudo" || first.name !== "scope") {
if (first.type !== css_what_1.SelectorType.Pseudo ||
first.name !== "scope") {
// Ignore
}
else if (isArrayContext && second.type === "descendant") {
else if (isArrayContext &&
second.type === css_what_1.SelectorType.Descendant) {
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
}
else if (second.type === "adjacent" ||
second.type === "sibling") {
else if (second.type === css_what_1.SelectorType.Adjacent ||
second.type === css_what_1.SelectorType.Sibling) {
shouldTestNextSiblings = true;
}
}
return compileRules(rules, options, finalContext);
})
.reduce(reduceRules, boolbase_1.falseFunc);
.reduce(reduceRules, boolbase_1.default.falseFunc);
query.shouldTestNextSiblings = shouldTestNextSiblings;
return query;
}
@@ -101,19 +132,20 @@ exports.compileToken = compileToken;
function compileRules(rules, options, context) {
var _a;
return rules.reduce(function (previous, rule) {
return previous === boolbase_1.falseFunc
? boolbase_1.falseFunc
: (0, general_1.compileGeneralSelector)(previous, rule, options, context, compileToken);
}, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc);
return previous === boolbase_1.default.falseFunc
? boolbase_1.default.falseFunc
: (0, general_js_1.compileGeneralSelector)(previous, rule, options, context, compileToken);
}, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.default.trueFunc);
}
function reduceRules(a, b) {
if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) {
if (b === boolbase_1.default.falseFunc || a === boolbase_1.default.trueFunc) {
return a;
}
if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) {
if (a === boolbase_1.default.falseFunc || b === boolbase_1.default.trueFunc) {
return b;
}
return function combine(elem) {
return a(elem) || b(elem);
};
}
//# sourceMappingURL=compile.js.map

1
node_modules/css-select/lib/compile.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"compile.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["compile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyD;AACzD,sDAAgC;AAChC,mDAAmD;AACnD,2CAAsD;AACtD,kEAG0C;AAO1C;;;;;;GAMG;AACH,SAAgB,OAAO,CACnB,QAA+B,EAC/B,OAA2C,EAC3C,OAAuB;IAEvB,IAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,IAAA,2BAAW,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAPD,0BAOC;AAED,SAAgB,aAAa,CACzB,QAA+B,EAC/B,OAA2C,EAC3C,OAAuB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AAY,CACf;IARP,CAQO,EACX,MAAA,OAAO,CAAC,QAAQ,mCAAI,kBAAQ,CAAC,QAAQ,CACxC,CAAC;AACN,CAAC;AAED,SAAS,WAAW,CAChB,CAA6B,EAC7B,CAA6B;IAE7B,IAAI,CAAC,KAAK,kBAAQ,CAAC,SAAS,IAAI,CAAC,KAAK,kBAAQ,CAAC,QAAQ,EAAE;QACrD,OAAO,CAAC,CAAC;KACZ;IACD,IAAI,CAAC,KAAK,kBAAQ,CAAC,SAAS,IAAI,CAAC,KAAK,kBAAQ,CAAC,QAAQ,EAAE;QACrD,OAAO,CAAC,CAAC;KACZ;IAED,OAAO,SAAS,OAAO,CAAC,IAAI;QACxB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC;AACN,CAAC"}

7
node_modules/css-select/lib/esm/attributes.d.ts generated vendored Executable file
View File

@@ -0,0 +1,7 @@
import type { CompiledQuery, InternalOptions } from "./types.js";
import type { AttributeSelector, AttributeAction } from "css-what";
/**
* Attribute selectors
*/
export declare const attributeRules: Record<AttributeAction, <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, data: AttributeSelector, options: InternalOptions<Node, ElementNode>) => CompiledQuery<ElementNode>>;
//# sourceMappingURL=attributes.d.ts.map

1
node_modules/css-select/lib/esm/attributes.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"attributes.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["attributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+EnE;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAC/B,eAAe,EACf,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3B,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,KAC1C,aAAa,CAAC,WAAW,CAAC,CAsLlC,CAAC"}

222
node_modules/css-select/lib/esm/attributes.js generated vendored Executable file
View File

@@ -0,0 +1,222 @@
import boolbase from "boolbase";
/**
* All reserved characters in a regex, used for escaping.
*
* Taken from XRegExp, (c) 2007-2020 Steven Levithan under the MIT license
* https://github.com/slevithan/xregexp/blob/95eeebeb8fac8754d54eafe2b4743661ac1cf028/src/xregexp.js#L794
*/
const reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
function escapeRegex(value) {
return value.replace(reChars, "\\$&");
}
/**
* Attributes that are case-insensitive in HTML.
*
* @private
* @see https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors
*/
const 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);
}
/**
* Attribute selectors
*/
export const attributeRules = {
equals(next, data, options) {
const { adapter } = options;
const { name } = data;
let { value } = data;
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
return (elem) => {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
attr.length === value.length &&
attr.toLowerCase() === value &&
next(elem));
};
}
return (elem) => adapter.getAttributeValue(elem, name) === value && next(elem);
},
hyphen(next, data, options) {
const { adapter } = options;
const { name } = data;
let { value } = data;
const len = value.length;
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
return function hyphenIC(elem) {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
(attr.length === len || attr.charAt(len) === "-") &&
attr.substr(0, len).toLowerCase() === value &&
next(elem));
};
}
return function hyphen(elem) {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
(attr.length === len || attr.charAt(len) === "-") &&
attr.substr(0, len) === value &&
next(elem));
};
},
element(next, data, options) {
const { adapter } = options;
const { name, value } = data;
if (/\s/.test(value)) {
return boolbase.falseFunc;
}
const regex = new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`, shouldIgnoreCase(data, options) ? "i" : "");
return function element(elem) {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
attr.length >= value.length &&
regex.test(attr) &&
next(elem));
};
},
exists(next, { name }, { adapter }) {
return (elem) => adapter.hasAttrib(elem, name) && next(elem);
},
start(next, data, options) {
const { adapter } = options;
const { name } = data;
let { value } = data;
const len = value.length;
if (len === 0) {
return boolbase.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
return (elem) => {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
attr.length >= len &&
attr.substr(0, len).toLowerCase() === value &&
next(elem));
};
}
return (elem) => {
var _a;
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) &&
next(elem);
};
},
end(next, data, options) {
const { adapter } = options;
const { name } = data;
let { value } = data;
const len = -value.length;
if (len === 0) {
return boolbase.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
return (elem) => {
var _a;
return ((_a = adapter
.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem);
};
}
return (elem) => {
var _a;
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) &&
next(elem);
};
},
any(next, data, options) {
const { adapter } = options;
const { name, value } = data;
if (value === "") {
return boolbase.falseFunc;
}
if (shouldIgnoreCase(data, options)) {
const regex = new RegExp(escapeRegex(value), "i");
return function anyIC(elem) {
const attr = adapter.getAttributeValue(elem, name);
return (attr != null &&
attr.length >= value.length &&
regex.test(attr) &&
next(elem));
};
}
return (elem) => {
var _a;
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) &&
next(elem);
};
},
not(next, data, options) {
const { adapter } = options;
const { name } = data;
let { value } = data;
if (value === "") {
return (elem) => !!adapter.getAttributeValue(elem, name) && next(elem);
}
else if (shouldIgnoreCase(data, options)) {
value = value.toLowerCase();
return (elem) => {
const attr = adapter.getAttributeValue(elem, name);
return ((attr == null ||
attr.length !== value.length ||
attr.toLowerCase() !== value) &&
next(elem));
};
}
return (elem) => adapter.getAttributeValue(elem, name) !== value && next(elem);
},
};
//# sourceMappingURL=attributes.js.map

1
node_modules/css-select/lib/esm/attributes.js.map generated vendored Executable file

File diff suppressed because one or more lines are too long

13
node_modules/css-select/lib/esm/compile.d.ts generated vendored Executable file
View File

@@ -0,0 +1,13 @@
import { Selector } from "css-what";
import type { CompiledQuery, InternalOptions, InternalSelector } from "./types.js";
/**
* Compiles a selector to an executable function.
*
* @param selector Selector to compile.
* @param options Compilation options.
* @param context Optional context for the selector.
*/
export declare function compile<Node, ElementNode extends Node>(selector: string | Selector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<Node>;
export declare function compileUnsafe<Node, ElementNode extends Node>(selector: string | Selector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<ElementNode>;
export declare function compileToken<Node, ElementNode extends Node>(token: InternalSelector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<ElementNode>;
//# sourceMappingURL=compile.d.ts.map

1
node_modules/css-select/lib/esm/compile.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"compile.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAgB,MAAM,UAAU,CAAC;AAQzD,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,gBAAgB,EACnB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACxD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAG5B;AAqDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACvD,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAC3B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAsD5B"}

115
node_modules/css-select/lib/esm/compile.js generated vendored Executable file
View File

@@ -0,0 +1,115 @@
import { parse, SelectorType } from "css-what";
import boolbase from "boolbase";
import sortRules, { isTraversal } from "./sort.js";
import { compileGeneralSelector } from "./general.js";
import { ensureIsTag, PLACEHOLDER_ELEMENT, } from "./pseudo-selectors/subselects.js";
/**
* Compiles a selector to an executable function.
*
* @param selector Selector to compile.
* @param options Compilation options.
* @param context Optional context for the selector.
*/
export function compile(selector, options, context) {
const next = compileUnsafe(selector, options, context);
return ensureIsTag(next, options.adapter);
}
export function compileUnsafe(selector, options, context) {
const token = typeof selector === "string" ? parse(selector) : selector;
return compileToken(token, options, context);
}
function includesScopePseudo(t) {
return (t.type === SelectorType.Pseudo &&
(t.name === "scope" ||
(Array.isArray(t.data) &&
t.data.some((data) => data.some(includesScopePseudo)))));
}
const DESCENDANT_TOKEN = { type: SelectorType.Descendant };
const FLEXIBLE_DESCENDANT_TOKEN = {
type: "_flexibleDescendant",
};
const SCOPE_TOKEN = {
type: SelectorType.Pseudo,
name: "scope",
data: null,
};
/*
* CSS 4 Spec (Draft): 3.4.1. Absolutizing a Relative Selector
* http://www.w3.org/TR/selectors4/#absolutizing
*/
function absolutize(token, { adapter }, context) {
// TODO Use better check if the context is a document
const hasContext = !!(context === null || context === void 0 ? void 0 : context.every((e) => {
const parent = adapter.isTag(e) && adapter.getParent(e);
return e === PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
}));
for (const t of token) {
if (t.length > 0 &&
isTraversal(t[0]) &&
t[0].type !== SelectorType.Descendant) {
// Don't continue in else branch
}
else if (hasContext && !t.some(includesScopePseudo)) {
t.unshift(DESCENDANT_TOKEN);
}
else {
continue;
}
t.unshift(SCOPE_TOKEN);
}
}
export function compileToken(token, options, context) {
var _a;
token.forEach(sortRules);
context = (_a = options.context) !== null && _a !== void 0 ? _a : context;
const isArrayContext = Array.isArray(context);
const finalContext = context && (Array.isArray(context) ? context : [context]);
// Check if the selector is relative
if (options.relativeSelector !== false) {
absolutize(token, options, finalContext);
}
else if (token.some((t) => t.length > 0 && isTraversal(t[0]))) {
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
}
let shouldTestNextSiblings = false;
const query = token
.map((rules) => {
if (rules.length >= 2) {
const [first, second] = rules;
if (first.type !== SelectorType.Pseudo ||
first.name !== "scope") {
// Ignore
}
else if (isArrayContext &&
second.type === SelectorType.Descendant) {
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
}
else if (second.type === SelectorType.Adjacent ||
second.type === SelectorType.Sibling) {
shouldTestNextSiblings = true;
}
}
return compileRules(rules, options, finalContext);
})
.reduce(reduceRules, boolbase.falseFunc);
query.shouldTestNextSiblings = shouldTestNextSiblings;
return query;
}
function compileRules(rules, options, context) {
var _a;
return rules.reduce((previous, rule) => previous === boolbase.falseFunc
? boolbase.falseFunc
: compileGeneralSelector(previous, rule, options, context, compileToken), (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase.trueFunc);
}
function reduceRules(a, b) {
if (b === boolbase.falseFunc || a === boolbase.trueFunc) {
return a;
}
if (a === boolbase.falseFunc || b === boolbase.trueFunc) {
return b;
}
return function combine(elem) {
return a(elem) || b(elem);
};
}
//# sourceMappingURL=compile.js.map

1
node_modules/css-select/lib/esm/compile.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"compile.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAY,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EACH,WAAW,EACX,mBAAmB,GACtB,MAAM,kCAAkC,CAAC;AAO1C;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACnB,QAA+B,EAC/B,OAA2C,EAC3C,OAAuB;IAEvB,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,WAAW,CAAC,IAAI,EAAE,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f,EACX,MAAA,OAAO,CAAC,QAAQ,mCAAI,QAAQ,CAAC,QAAQ,CACxC,CAAC;AACN,CAAC;AAED,SAAS,WAAW,CAChB,CAA6B,EAC7B,CAA6B;IAE7B,IAAI,CAAC,KAAK,QAAQ,CAAC,SAAS,IAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,EAAE;QACrD,OAAO,CAAC,CAAC;KACZ;IACD,IAAI,CAAC,KAAK,QAAQ,CAAC,SAAS,IAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,EAAE;QACrD,OAAO,CAAC,CAAC;KACZ;IAED,OAAO,SAAS,OAAO,CAAC,IAAI;QACxB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC;AACN,CAAC"}

3
node_modules/css-select/lib/esm/general.d.ts generated vendored Executable file
View File

@@ -0,0 +1,3 @@
import type { CompiledQuery, InternalOptions, InternalSelector, CompileToken } from "./types.js";
export declare function compileGeneralSelector<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, selector: InternalSelector, options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>): CompiledQuery<ElementNode>;
//# sourceMappingURL=general.d.ts.map

1
node_modules/css-select/lib/esm/general.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"general.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["general.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACf,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACjE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CAiK5B"}

144
node_modules/css-select/lib/esm/general.js generated vendored Executable file
View File

@@ -0,0 +1,144 @@
import { attributeRules } from "./attributes.js";
import { compilePseudoSelector } from "./pseudo-selectors/index.js";
import { SelectorType } from "css-what";
function getElementParent(node, adapter) {
const parent = adapter.getParent(node);
if (parent && adapter.isTag(parent)) {
return parent;
}
return null;
}
/*
* All available rules
*/
export function compileGeneralSelector(next, selector, options, context, compileToken) {
const { adapter, equals } = 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);
}
// Tags
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(elem) {
return adapter.getName(elem) === name && next(elem);
};
}
// Traversal
case SelectorType.Descendant: {
if (options.cacheResults === false ||
typeof WeakSet === "undefined") {
return function descendant(elem) {
let current = elem;
while ((current = getElementParent(current, adapter))) {
if (next(current)) {
return true;
}
}
return false;
};
}
// @ts-expect-error `ElementNode` is not extending object
const isFalseCache = new WeakSet();
return function cachedDescendant(elem) {
let current = elem;
while ((current = getElementParent(current, adapter))) {
if (!isFalseCache.has(current)) {
if (adapter.isTag(current) && next(current)) {
return true;
}
isFalseCache.add(current);
}
}
return false;
};
}
case "_flexibleDescendant": {
// Include element itself, only used while querying an array
return function flexibleDescendant(elem) {
let current = elem;
do {
if (next(current))
return true;
} while ((current = getElementParent(current, adapter)));
return false;
};
}
case SelectorType.Parent: {
return function parent(elem) {
return adapter
.getChildren(elem)
.some((elem) => adapter.isTag(elem) && next(elem));
};
}
case SelectorType.Child: {
return function child(elem) {
const parent = adapter.getParent(elem);
return parent != null && adapter.isTag(parent) && next(parent);
};
}
case SelectorType.Sibling: {
return function sibling(elem) {
const siblings = adapter.getSiblings(elem);
for (let i = 0; i < siblings.length; i++) {
const currentSibling = siblings[i];
if (equals(elem, currentSibling))
break;
if (adapter.isTag(currentSibling) && next(currentSibling)) {
return true;
}
}
return false;
};
}
case SelectorType.Adjacent: {
if (adapter.prevElementSibling) {
return function adjacent(elem) {
const previous = adapter.prevElementSibling(elem);
return previous != null && next(previous);
};
}
return function adjacent(elem) {
const siblings = adapter.getSiblings(elem);
let lastElement;
for (let i = 0; i < siblings.length; i++) {
const currentSibling = siblings[i];
if (equals(elem, 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;
}
}
}
//# sourceMappingURL=general.js.map

1
node_modules/css-select/lib/esm/general.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"general.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAQpE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,SAAS,gBAAgB,CACrB,IAAiB,EACjB,OAAmC;IAEnC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,C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AAoE,CACvE,CAAC;aACL;YAED,OAAO,IAAI,CAAC;SACf;KACJ;AACL,CAAC"}

12
node_modules/css-select/lib/esm/helpers/cache.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import type { CompiledQuery, InternalOptions } from "../types.js";
/**
* Some selectors such as `:contains` and (non-relative) `:has` will only be
* able to match elements if their parents match the selector (as they contain
* a subset of the elements that the parent contains).
*
* This function wraps the given `matches` function in a function that caches
* the results of the parent elements, so that the `matches` function only
* needs to be called once for each subtree.
*/
export declare function cacheParentResults<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, { adapter, cacheResults }: InternalOptions<Node, ElementNode>, matches: (elem: ElementNode) => boolean): CompiledQuery<ElementNode>;
//# sourceMappingURL=cache.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC7D,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC7D,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,GACxC,aAAa,CAAC,WAAW,CAAC,CAsC5B"}

41
node_modules/css-select/lib/esm/helpers/cache.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
import { getElementParent } from "./querying.js";
/**
* Some selectors such as `:contains` and (non-relative) `:has` will only be
* able to match elements if their parents match the selector (as they contain
* a subset of the elements that the parent contains).
*
* This function wraps the given `matches` function in a function that caches
* the results of the parent elements, so that the `matches` function only
* needs to be called once for each subtree.
*/
export function cacheParentResults(next, { adapter, cacheResults }, matches) {
if (cacheResults === false || typeof WeakMap === "undefined") {
return (elem) => next(elem) && matches(elem);
}
// Use a cache to avoid re-checking children of an element.
// @ts-expect-error `Node` is not extending object
const resultCache = new WeakMap();
function addResultToCache(elem) {
const result = matches(elem);
resultCache.set(elem, result);
return result;
}
return function cachedMatcher(elem) {
if (!next(elem))
return false;
if (resultCache.has(elem)) {
return resultCache.get(elem);
}
// Check all of the element's parents.
let node = elem;
do {
const parent = getElementParent(node, adapter);
if (parent === null) {
return addResultToCache(elem);
}
node = parent;
} while (!resultCache.has(node));
return resultCache.get(node) && addResultToCache(elem);
};
}
//# sourceMappingURL=cache.js.map

1
node_modules/css-select/lib/esm/helpers/cache.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,IAAgC,EAChC,EAAE,OAAO,EAAE,YAAY,EAAsC,EAC7D,OAAuC;IAEvC,IAAI,YAAY,KAAK,KAAK,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QAC3D,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,2DAA2D;IAE3D,kDAAkD;IAClD,MAAM,WAAW,GAAG,IAAI,OAAO,EAAiB,CAAC;IAEjD,SAAS,gBAAgB,CAAC,IAAiB;QACvC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAE7B,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO,SAAS,aAAa,CAAC,IAAI;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,CAAC;QAED,sCAAsC;QACtC,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,GAAG,CAAC;YACA,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAE/C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClB,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;YAED,IAAI,GAAG,MAAM,CAAC;QAClB,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAEjC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAE,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;AACN,CAAC"}

24
node_modules/css-select/lib/esm/helpers/querying.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { InternalOptions, Predicate, Adapter } from "../types.js";
/**
* Find all elements matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns All matching elements.
*/
export declare function findAll<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode[];
/**
* Find the first element matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns The first matching element, or null if there was no match.
*/
export declare function findOne<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode | null;
export declare function getNextSiblings<Node, ElementNode extends Node>(elem: Node, adapter: Adapter<Node, ElementNode>): ElementNode[];
export declare function getElementParent<Node, ElementNode extends Node>(node: ElementNode, adapter: Adapter<Node, ElementNode>): ElementNode | null;
//# sourceMappingURL=querying.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"querying.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/querying.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,GAC5C,WAAW,EAAE,CAyCf;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,GAC5C,WAAW,GAAG,IAAI,CAwCpB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC1D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,EAAE,CAMf;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3D,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,GAAG,IAAI,CAGpB"}

105
node_modules/css-select/lib/esm/helpers/querying.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
/**
* Find all elements matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns All matching elements.
*/
export function findAll(query, elems, options) {
const { adapter, xmlMode = false } = options;
const result = [];
/** Stack of the arrays we are looking at. */
const nodeStack = [elems];
/** Stack of the indices within the arrays. */
const indexStack = [0];
for (;;) {
// First, check if the current array has any more elements to look at.
if (indexStack[0] >= nodeStack[0].length) {
// If we have no more arrays to look at, we are done.
if (nodeStack.length === 1) {
return result;
}
nodeStack.shift();
indexStack.shift();
// Loop back to the start to continue with the next array.
continue;
}
const elem = nodeStack[0][indexStack[0]++];
if (!adapter.isTag(elem))
continue;
if (query(elem))
result.push(elem);
if (xmlMode || adapter.getName(elem) !== "template") {
/*
* Add the children to the stack. We are depth-first, so this is
* the next array we look at.
*/
const children = adapter.getChildren(elem);
if (children.length > 0) {
nodeStack.unshift(children);
indexStack.unshift(0);
}
}
}
}
/**
* Find the first element matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns The first matching element, or null if there was no match.
*/
export function findOne(query, elems, options) {
const { adapter, xmlMode = false } = options;
/** Stack of the arrays we are looking at. */
const nodeStack = [elems];
/** Stack of the indices within the arrays. */
const indexStack = [0];
for (;;) {
// First, check if the current array has any more elements to look at.
if (indexStack[0] >= nodeStack[0].length) {
// If we have no more arrays to look at, we are done.
if (nodeStack.length === 1) {
return null;
}
nodeStack.shift();
indexStack.shift();
// Loop back to the start to continue with the next array.
continue;
}
const elem = nodeStack[0][indexStack[0]++];
if (!adapter.isTag(elem))
continue;
if (query(elem))
return elem;
if (xmlMode || adapter.getName(elem) !== "template") {
/*
* Add the children to the stack. We are depth-first, so this is
* the next array we look at.
*/
const children = adapter.getChildren(elem);
if (children.length > 0) {
nodeStack.unshift(children);
indexStack.unshift(0);
}
}
}
}
export function getNextSiblings(elem, adapter) {
const siblings = adapter.getSiblings(elem);
if (siblings.length <= 1)
return [];
const elemIndex = siblings.indexOf(elem);
if (elemIndex < 0 || elemIndex === siblings.length - 1)
return [];
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
}
export function getElementParent(node, adapter) {
const parent = adapter.getParent(node);
return parent != null && adapter.isTag(parent) ? parent : null;
}
//# sourceMappingURL=querying.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"querying.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/querying.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CACnB,KAA6B,EAC7B,KAAa,EACb,OAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAC7C,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,6CAA6C;IAC7C,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,8CAA8C;IAC9C,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IAEvB,SAAS,CAAC;QACN,sEAAsE;QACtE,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YACvC,qDAAqD;YACrD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC;YAClB,CAAC;YAED,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,UAAU,CAAC,KAAK,EAAE,CAAC;YAEnB,0DAA0D;YAC1D,SAAS;QACb,CAAC;QAED,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;Q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E,CAAC"}

20
node_modules/css-select/lib/esm/helpers/selectors.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import type { InternalSelector } from "../types.js";
import { type Traversal } from "css-what";
export declare function isTraversal(token: InternalSelector): token is Traversal;
/**
* Sort the parts of the passed selector, as there is potential for
* optimization (some types of selectors are faster than others).
*
* @param arr Selector to sort
*/
export declare function sortRules(arr: InternalSelector[]): void;
/**
* Determine the quality of the passed token. The higher the number, the
* faster the token is to execute.
*
* @param token Token to get the quality of.
* @returns The token's quality.
*/
export declare function getQuality(token: InternalSelector): number;
export declare function includesScopePseudo(t: InternalSelector): boolean;
//# sourceMappingURL=selectors.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"selectors.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAKH,KAAK,SAAS,EACjB,MAAM,UAAU,CAAC;AAElB,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAgBvD;AAgCD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAyC1D;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAOhE"}

103
node_modules/css-select/lib/esm/helpers/selectors.js generated vendored Normal file
View File

@@ -0,0 +1,103 @@
import { AttributeAction, SelectorType, isTraversal as isTraversalBase, } from "css-what";
export function isTraversal(token) {
return token.type === "_flexibleDescendant" || isTraversalBase(token);
}
/**
* Sort the parts of the passed selector, as there is potential for
* optimization (some types of selectors are faster than others).
*
* @param arr Selector to sort
*/
export function sortRules(arr) {
const ratings = arr.map(getQuality);
for (let i = 1; i < arr.length; i++) {
const procNew = ratings[i];
if (procNew < 0)
continue;
// Use insertion sort to move the token to the correct position.
for (let j = i; j > 0 && procNew < ratings[j - 1]; j--) {
const token = arr[j];
arr[j] = arr[j - 1];
arr[j - 1] = token;
ratings[j] = ratings[j - 1];
ratings[j - 1] = procNew;
}
}
}
function getAttributeQuality(token) {
switch (token.action) {
case AttributeAction.Exists: {
return 10;
}
case AttributeAction.Equals: {
// Prefer ID selectors (eg. #ID)
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;
}
}
}
/**
* Determine the quality of the passed token. The higher the number, the
* faster the token is to execute.
*
* @param token Token to get the quality of.
* @returns The token's quality.
*/
export function getQuality(token) {
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
switch (token.type) {
case SelectorType.Universal: {
return 50;
}
case SelectorType.Tag: {
return 30;
}
case SelectorType.Attribute: {
return Math.floor(getAttributeQuality(token) /
// `ignoreCase` adds some overhead, half the result if applicable.
(token.ignoreCase ? 2 : 1));
}
case SelectorType.Pseudo: {
return !token.data
? 3
: token.name === "has" ||
token.name === "contains" ||
token.name === "icontains"
? // Expensive in any case — run as late as possible.
0
: Array.isArray(token.data)
? // Eg. `:is`, `:not`
Math.max(
// If we have traversals, try to avoid executing this selector
0, Math.min(...token.data.map((d) => Math.min(...d.map(getQuality)))))
: 2;
}
default: {
return -1;
}
}
}
export function includesScopePseudo(t) {
return (t.type === SelectorType.Pseudo &&
(t.name === "scope" ||
(Array.isArray(t.data) &&
t.data.some((data) => data.some(includesScopePseudo)))));
}
//# sourceMappingURL=selectors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"selectors.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14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CACjC,CAAC;QACN,CAAC;QACD,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,IAAI;gBACd,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK;oBAClB,KAAK,CAAC,IAAI,KAAK,UAAU;oBACzB,KAAK,CAAC,IAAI,KAAK,WAAW;oBAC5B,CAAC,CAAC,mDAAmD;wBACnD,CAAC;oBACH,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;wBACzB,CAAC,CAAC,oBAAoB;4BACpB,IAAI,CAAC,GAAG;4BACJ,8DAA8D;4BAC9D,CAAC,EACD,IAAI,CAAC,GAAG,CACJ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACpB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACjC,CACJ,CACJ;wBACH,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACN,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;IACL,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,CAAmB;IACnD,OAAO,CACH,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM;QAC9B,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO;YACf,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;gBAClB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAClE,CAAC;AACN,CAAC"}

50
node_modules/css-select/lib/esm/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,50 @@
import type { CompiledQuery, Options, Query, Adapter } from "./types.js";
export type { Options };
/**
* Compiles the query, returns a function.
*/
export declare const compile: <Node, ElementNode extends Node>(selector: string | import("css-what").Selector[][], options?: Options<Node, ElementNode> | undefined, context?: Node | Node[] | undefined) => CompiledQuery<Node>;
export declare const _compileUnsafe: <Node, ElementNode extends Node>(selector: string | import("css-what").Selector[][], options?: Options<Node, ElementNode> | undefined, context?: Node | Node[] | undefined) => CompiledQuery<ElementNode>;
export declare const _compileToken: <Node, ElementNode extends Node>(selector: import("./types.js").InternalSelector[][], options?: Options<Node, ElementNode> | undefined, context?: Node | Node[] | undefined) => CompiledQuery<ElementNode>;
export declare function prepareContext<Node, ElementNode extends Node>(elems: Node | Node[], adapter: Adapter<Node, ElementNode>, shouldTestNextSiblings?: boolean): Node[];
/**
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elems Elements to query. If it is an element, its children will be queried..
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns All matching elements.
*
*/
export declare const selectAll: <Node, ElementNode extends Node>(query: Query<ElementNode>, elements: Node | Node[], options?: Options<Node, ElementNode> | undefined) => ElementNode[];
/**
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elems Elements to query. If it is an element, its children will be queried..
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns the first match, or null if there was no match.
*/
export declare const selectOne: <Node, ElementNode extends Node>(query: Query<ElementNode>, elements: Node | Node[], options?: Options<Node, ElementNode> | undefined) => ElementNode | null;
/**
* Tests whether or not an element is matched by query.
*
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elem The element to test if it matches the query.
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns
*/
export declare function is<Node, ElementNode extends Node>(elem: ElementNode, query: Query<ElementNode>, options?: Options<Node, ElementNode>): boolean;
/**
* Alias for selectAll(query, elems, options).
* @see [compile] for supported selector queries.
*/
export default selectAll;
/** @deprecated Use the `pseudos` option instead. */
export { filters, pseudos, aliases } from "./pseudo-selectors/index.js";
//# sourceMappingURL=index.d.ts.map

1
node_modules/css-select/lib/esm/index.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,aAAa,EACb,OAAO,EAEP,KAAK,EACL,OAAO,EAEV,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,OAAO,EAAE,CAAC;AA0CxB;;GAEG;AACH,eAAO,MAAM,OAAO,oMAA0B,CAAC;AAC/C,eAAO,MAAM,cAAc,2MAA6B,CAAC;AACzD,eAAO,MAAM,aAAa,4MAA4B,CAAC;AA6BvD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACzD,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,EACnC,sBAAsB,UAAQ,GAC/B,IAAI,EAAE,CAYR;AAiBD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,yJASrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,8JASrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC7C,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EACzB,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACrC,OAAO,CAKT;AAED;;;GAGG;AACH,eAAe,SAAS,CAAC;AAGzB,oDAAoD;AACpD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC"}

115
node_modules/css-select/lib/esm/index.js generated vendored Executable file
View File

@@ -0,0 +1,115 @@
import * as DomUtils from "domutils";
import boolbase from "boolbase";
import { compile as compileRaw, compileUnsafe, compileToken, } from "./compile.js";
import { getNextSiblings } from "./pseudo-selectors/subselects.js";
const defaultEquals = (a, b) => a === b;
const defaultOptions = {
adapter: DomUtils,
equals: defaultEquals,
};
function convertOptionFormats(options) {
var _a, _b, _c, _d;
/*
* We force one format of options to the other one.
*/
// @ts-expect-error Default options may have incompatible `Node` / `ElementNode`.
const opts = options !== null && options !== void 0 ? options : defaultOptions;
// @ts-expect-error Same as above.
(_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils);
// @ts-expect-error `equals` does not exist on `Options`
(_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals);
return opts;
}
function wrapCompile(func) {
return function addAdapter(selector, options, context) {
const opts = convertOptionFormats(options);
return func(selector, opts, context);
};
}
/**
* Compiles the query, returns a function.
*/
export const compile = wrapCompile(compileRaw);
export const _compileUnsafe = wrapCompile(compileUnsafe);
export const _compileToken = wrapCompile(compileToken);
function getSelectorFunc(searchFunc) {
return function select(query, elements, options) {
const opts = convertOptionFormats(options);
if (typeof query !== "function") {
query = compileUnsafe(query, opts, elements);
}
const filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings);
return searchFunc(query, filteredElements, opts);
};
}
export function prepareContext(elems, adapter, shouldTestNextSiblings = false) {
/*
* Add siblings if the query requires them.
* See https://github.com/fb55/css-select/pull/43#issuecomment-225414692
*/
if (shouldTestNextSiblings) {
elems = appendNextSiblings(elems, adapter);
}
return Array.isArray(elems)
? adapter.removeSubsets(elems)
: adapter.getChildren(elems);
}
function appendNextSiblings(elem, adapter) {
// Order matters because jQuery seems to check the children before the siblings
const elems = Array.isArray(elem) ? elem.slice(0) : [elem];
const elemsLength = elems.length;
for (let i = 0; i < elemsLength; i++) {
const nextSiblings = getNextSiblings(elems[i], adapter);
elems.push(...nextSiblings);
}
return elems;
}
/**
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elems Elements to query. If it is an element, its children will be queried..
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns All matching elements.
*
*/
export const selectAll = getSelectorFunc((query, elems, options) => query === boolbase.falseFunc || !elems || elems.length === 0
? []
: options.adapter.findAll(query, elems));
/**
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elems Elements to query. If it is an element, its children will be queried..
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns the first match, or null if there was no match.
*/
export const selectOne = getSelectorFunc((query, elems, options) => query === boolbase.falseFunc || !elems || elems.length === 0
? null
: options.adapter.findOne(query, elems));
/**
* Tests whether or not an element is matched by query.
*
* @template Node The generic Node type for the DOM adapter being used.
* @template ElementNode The Node type for elements for the DOM adapter being used.
* @param elem The element to test if it matches the query.
* @param query can be either a CSS selector string or a compiled query function.
* @param [options] options for querying the document.
* @see compile for supported selector queries.
* @returns
*/
export function is(elem, query, options) {
const opts = convertOptionFormats(options);
return (typeof query === "function" ? query : compileRaw(query, opts))(elem);
}
/**
* Alias for selectAll(query, elems, options).
* @see [compile] for supported selector queries.
*/
export default selectAll;
// Export filters, pseudos and aliases to allow users to supply their own.
/** @deprecated Use the `pseudos` option instead. */
export { filters, pseudos, aliases } from "./pseudo-selectors/index.js";
//# sourceMappingURL=index.js.map

1
node_modules/css-select/lib/esm/index.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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BAA6B,CAAC"}

1
node_modules/css-select/lib/esm/package.json generated vendored Executable file
View File

@@ -0,0 +1 @@
{"type":"module"}

View File

@@ -0,0 +1,5 @@
/**
* Aliases are pseudos that are expressed as selectors.
*/
export declare const aliases: Record<string, string>;
//# sourceMappingURL=aliases.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"aliases.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/aliases.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwC1C,CAAC"}

35
node_modules/css-select/lib/esm/pseudo-selectors/aliases.js generated vendored Executable file
View File

@@ -0,0 +1,35 @@
/**
* Aliases are pseudos that are expressed as selectors.
*/
export const aliases = {
// Links
"any-link": ":is(a, area, link)[href]",
link: ":any-link:not(:visited)",
// Forms
// https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
disabled: `:is(
:is(button, input, select, textarea, optgroup, option)[disabled],
optgroup[disabled] > option,
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
)`,
enabled: ":not(:disabled)",
checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
required: ":is(input, select, textarea)[required]",
optional: ":is(input, select, textarea):not([required])",
// JQuery extensions
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
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])",
};
//# sourceMappingURL=aliases.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"aliases.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/aliases.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAA2B;IAC3C,QAAQ;IAER,UAAU,EAAE,0BAA0B;IACtC,IAAI,EAAE,yBAAyB;IAE/B,QAAQ;IAER,0EAA0E;IAC1E,QAAQ,EAAE;;;;MAIR;IACF,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EACH,6EAA6E;IACjF,QAAQ,EAAE,wCAAwC;IAClD,QAAQ,EAAE,8CAA8C;IAExD,oBAAoB;IAEpB,wFAAwF;IACxF,QAAQ,EACJ,8FAA8F;IAElG,QAAQ,EAAE,iBAAiB;IAC3B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,iBAAiB;IAC3B,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE,eAAe;IAEvB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,6BAA6B;IAErC,MAAM,EAAE,iCAAiC;IACzC,KAAK,EAAE,sCAAsC;IAC7C,IAAI,EAAE,yCAAyC;CAClD,CAAC"}

View File

@@ -0,0 +1,4 @@
import type { CompiledQuery, InternalOptions } from "../types.js";
export declare type Filter = <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, text: string, options: InternalOptions<Node, ElementNode>, context?: Node[]) => CompiledQuery<ElementNode>;
export declare const filters: Record<string, Filter>;
//# sourceMappingURL=filters.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"filters.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/filters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAW,MAAM,aAAa,CAAC;AAE3E,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,KACf,aAAa,CAAC,WAAW,CAAC,CAAC;AAYhC,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2I1C,CAAC"}

143
node_modules/css-select/lib/esm/pseudo-selectors/filters.js generated vendored Executable file
View File

@@ -0,0 +1,143 @@
import getNCheck from "nth-check";
import boolbase from "boolbase";
function getChildFunc(next, adapter) {
return (elem) => {
const parent = adapter.getParent(elem);
return parent != null && adapter.isTag(parent) && next(elem);
};
}
export const filters = {
contains(next, text, { adapter }) {
return function contains(elem) {
return next(elem) && adapter.getText(elem).includes(text);
};
},
icontains(next, text, { adapter }) {
const itext = text.toLowerCase();
return function icontains(elem) {
return (next(elem) &&
adapter.getText(elem).toLowerCase().includes(itext));
};
},
// Location specific methods
"nth-child"(next, rule, { adapter, equals }) {
const func = getNCheck(rule);
if (func === boolbase.falseFunc)
return boolbase.falseFunc;
if (func === boolbase.trueFunc)
return getChildFunc(next, adapter);
return function nthChild(elem) {
const siblings = adapter.getSiblings(elem);
let pos = 0;
for (let i = 0; i < siblings.length; i++) {
if (equals(elem, siblings[i]))
break;
if (adapter.isTag(siblings[i])) {
pos++;
}
}
return func(pos) && next(elem);
};
},
"nth-last-child"(next, rule, { adapter, equals }) {
const func = getNCheck(rule);
if (func === boolbase.falseFunc)
return boolbase.falseFunc;
if (func === boolbase.trueFunc)
return getChildFunc(next, adapter);
return function nthLastChild(elem) {
const siblings = adapter.getSiblings(elem);
let pos = 0;
for (let i = siblings.length - 1; i >= 0; i--) {
if (equals(elem, siblings[i]))
break;
if (adapter.isTag(siblings[i])) {
pos++;
}
}
return func(pos) && next(elem);
};
},
"nth-of-type"(next, rule, { adapter, equals }) {
const func = getNCheck(rule);
if (func === boolbase.falseFunc)
return boolbase.falseFunc;
if (func === boolbase.trueFunc)
return getChildFunc(next, adapter);
return function nthOfType(elem) {
const siblings = adapter.getSiblings(elem);
let pos = 0;
for (let i = 0; i < siblings.length; i++) {
const currentSibling = siblings[i];
if (equals(elem, currentSibling))
break;
if (adapter.isTag(currentSibling) &&
adapter.getName(currentSibling) === adapter.getName(elem)) {
pos++;
}
}
return func(pos) && next(elem);
};
},
"nth-last-of-type"(next, rule, { adapter, equals }) {
const func = getNCheck(rule);
if (func === boolbase.falseFunc)
return boolbase.falseFunc;
if (func === boolbase.trueFunc)
return getChildFunc(next, adapter);
return function nthLastOfType(elem) {
const siblings = adapter.getSiblings(elem);
let pos = 0;
for (let i = siblings.length - 1; i >= 0; i--) {
const currentSibling = siblings[i];
if (equals(elem, currentSibling))
break;
if (adapter.isTag(currentSibling) &&
adapter.getName(currentSibling) === adapter.getName(elem)) {
pos++;
}
}
return func(pos) && next(elem);
};
},
// TODO determine the actual root element
root(next, _rule, { adapter }) {
return (elem) => {
const parent = adapter.getParent(elem);
return (parent == null || !adapter.isTag(parent)) && next(elem);
};
},
scope(next, rule, options, context) {
const { equals } = options;
if (!context || context.length === 0) {
// Equivalent to :root
return filters["root"](next, rule, options);
}
if (context.length === 1) {
// NOTE: can't be unpacked, as :has uses this for side-effects
return (elem) => equals(context[0], elem) && next(elem);
}
return (elem) => context.includes(elem) && next(elem);
},
hover: dynamicStatePseudo("isHovered"),
visited: dynamicStatePseudo("isVisited"),
active: dynamicStatePseudo("isActive"),
};
/**
* Dynamic state pseudos. These depend on optional Adapter methods.
*
* @param name The name of the adapter method to call.
* @returns Pseudo for the `filters` object.
*/
function dynamicStatePseudo(name) {
return function dynamicPseudo(next, _rule, { adapter }) {
const func = adapter[name];
if (typeof func !== "function") {
return boolbase.falseFunc;
}
return function active(elem) {
return func(elem) && next(elem);
};
};
}
//# sourceMappingURL=filters.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
import type { CompiledQuery, InternalOptions, CompileToken } from "../types.js";
import { PseudoSelector } from "css-what";
import { filters } from "./filters.js";
import { pseudos } from "./pseudos.js";
import { aliases } from "./aliases.js";
export { filters, pseudos, aliases };
export declare function compilePseudoSelector<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, selector: PseudoSelector, options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>): CompiledQuery<ElementNode>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAoB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAErC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CA4C5B"}

40
node_modules/css-select/lib/esm/pseudo-selectors/index.js generated vendored Executable file
View File

@@ -0,0 +1,40 @@
import { parse } from "css-what";
import { filters } from "./filters.js";
import { pseudos, verifyPseudoArgs } from "./pseudos.js";
import { aliases } from "./aliases.js";
import { subselects } from "./subselects.js";
export { filters, pseudos, aliases };
export function compilePseudoSelector(next, selector, options, context, compileToken) {
var _a;
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 = (_a = options.pseudos) === null || _a === void 0 ? void 0 : _a[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`);
}
// The alias has to be parsed here, to make sure options are respected.
const alias = parse(stringPseudo);
return subselects["is"](next, alias, options, context, compileToken);
}
if (typeof userPseudo === "function") {
verifyPseudoArgs(userPseudo, name, data, 1);
return (elem) => userPseudo(elem, data) && next(elem);
}
if (name in filters) {
return filters[name](next, data, options, context);
}
if (name in pseudos) {
const pseudo = pseudos[name];
verifyPseudoArgs(pseudo, name, data, 2);
return (elem) => pseudo(elem, options, data) && next(elem);
}
throw new Error(`Unknown pseudo-class :${name}`);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAkB,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAErC,MAAM,UAAU,qBAAqB,CACjC,IAAgC,EAChC,QAAwB,EACxB,OAA2C,EAC3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AI,EAAE,IAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAChE;IAED,IAAI,IAAI,IAAI,OAAO,EAAE;QACjB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7B,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAExC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;KAC9D;IAED,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC"}

View File

@@ -0,0 +1,6 @@
import type { PseudoSelector } from "css-what";
import type { InternalOptions } from "../types.js";
export declare type Pseudo = <Node, ElementNode extends Node>(elem: ElementNode, options: InternalOptions<Node, ElementNode>, subselect?: string | null) => boolean;
export declare const pseudos: Record<string, Pseudo>;
export declare function verifyPseudoArgs<T extends Array<unknown>>(func: (...args: T) => boolean, name: string, subselect: PseudoSelector["data"], argIndex: number): void;
//# sourceMappingURL=pseudos.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pseudos.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/pseudos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChD,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,KACxB,OAAO,CAAC;AAGb,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkF1C,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EACrD,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,EAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,EACjC,QAAQ,EAAE,MAAM,GACjB,IAAI,CAQN"}

79
node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js generated vendored Executable file
View File

@@ -0,0 +1,79 @@
// While filters are precompiled, pseudos get called when they are needed
export const pseudos = {
empty(elem, { adapter }) {
return !adapter.getChildren(elem).some((elem) =>
// FIXME: `getText` call is potentially expensive.
adapter.isTag(elem) || adapter.getText(elem) !== "");
},
"first-child"(elem, { adapter, equals }) {
if (adapter.prevElementSibling) {
return adapter.prevElementSibling(elem) == null;
}
const firstChild = adapter
.getSiblings(elem)
.find((elem) => adapter.isTag(elem));
return firstChild != null && equals(elem, firstChild);
},
"last-child"(elem, { adapter, equals }) {
const siblings = adapter.getSiblings(elem);
for (let i = siblings.length - 1; i >= 0; i--) {
if (equals(elem, siblings[i]))
return true;
if (adapter.isTag(siblings[i]))
break;
}
return false;
},
"first-of-type"(elem, { adapter, equals }) {
const siblings = adapter.getSiblings(elem);
const elemName = adapter.getName(elem);
for (let i = 0; i < siblings.length; i++) {
const currentSibling = siblings[i];
if (equals(elem, currentSibling))
return true;
if (adapter.isTag(currentSibling) &&
adapter.getName(currentSibling) === elemName) {
break;
}
}
return false;
},
"last-of-type"(elem, { adapter, equals }) {
const siblings = adapter.getSiblings(elem);
const elemName = adapter.getName(elem);
for (let i = siblings.length - 1; i >= 0; i--) {
const currentSibling = siblings[i];
if (equals(elem, currentSibling))
return true;
if (adapter.isTag(currentSibling) &&
adapter.getName(currentSibling) === elemName) {
break;
}
}
return false;
},
"only-of-type"(elem, { adapter, equals }) {
const elemName = adapter.getName(elem);
return adapter
.getSiblings(elem)
.every((sibling) => equals(elem, sibling) ||
!adapter.isTag(sibling) ||
adapter.getName(sibling) !== elemName);
},
"only-child"(elem, { adapter, equals }) {
return adapter
.getSiblings(elem)
.every((sibling) => equals(elem, sibling) || !adapter.isTag(sibling));
},
};
export function verifyPseudoArgs(func, name, subselect, argIndex) {
if (subselect === null) {
if (func.length > argIndex) {
throw new Error(`Pseudo-class :${name} requires an argument`);
}
}
else if (func.length === argIndex) {
throw new Error(`Pseudo-class :${name} doesn't have any arguments`);
}
}
//# sourceMappingURL=pseudos.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pseudos.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/pseudos.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,CAAC,MAAM,OAAO,GAA2B;IAC3C,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE;QACnB,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAClC,CAAC,IAAI,EAAE,EAAE;QACL,kDAAkD;QAClD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAC1D,CAAC;IACN,CAAC;IAED,aAAa,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACnC,IAAI,OAAO,CAAC,kBAAkB,EAAE;YAC5B,OAAO,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;SACnD;QAED,MAAM,UAAU,GAAG,OAAO;aACrB,WAAW,CAAC,IAAI,CAAC;aACjB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IACD,YAAY,C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YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,uBAAuB,CAAC,CAAC;SACjE;KACJ;SAAM,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,6BAA6B,CAAC,CAAC;KACvE;AACL,CAAC"}

View File

@@ -0,0 +1,9 @@
import type { Selector } from "css-what";
import type { CompiledQuery, InternalOptions, CompileToken, Adapter } from "../types.js";
/** Used as a placeholder for :has. Will be replaced with the actual element. */
export declare const PLACEHOLDER_ELEMENT: {};
export declare function ensureIsTag<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, adapter: Adapter<Node, ElementNode>): CompiledQuery<Node>;
export declare type Subselect = <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, subselect: Selector[][], options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>) => CompiledQuery<ElementNode>;
export declare function getNextSiblings<Node, ElementNode extends Node>(elem: Node, adapter: Adapter<Node, ElementNode>): ElementNode[];
export declare const subselects: Record<string, Subselect>;
//# sourceMappingURL=subselects.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"subselects.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/subselects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,OAAO,EACV,MAAM,aAAa,CAAC;AAGrB,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,IAAK,CAAC;AAEtC,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACtD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,oBAAY,SAAS,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACnD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,SAAS,EAAE,QAAQ,EAAE,EAAE,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,KAC5C,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC1D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,EAAE,CAMf;AAiCD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAgEhD,CAAC"}

View File

@@ -0,0 +1,94 @@
import boolbase from "boolbase";
import { isTraversal } from "../sort.js";
/** Used as a placeholder for :has. Will be replaced with the actual element. */
export const PLACEHOLDER_ELEMENT = {};
export function ensureIsTag(next, adapter) {
if (next === boolbase.falseFunc)
return boolbase.falseFunc;
return (elem) => adapter.isTag(elem) && next(elem);
}
export function getNextSiblings(elem, adapter) {
const siblings = adapter.getSiblings(elem);
if (siblings.length <= 1)
return [];
const elemIndex = siblings.indexOf(elem);
if (elemIndex < 0 || elemIndex === siblings.length - 1)
return [];
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
}
function copyOptions(options) {
// Not copied: context, rootFunc
return {
xmlMode: !!options.xmlMode,
lowerCaseAttributeNames: !!options.lowerCaseAttributeNames,
lowerCaseTags: !!options.lowerCaseTags,
quirksMode: !!options.quirksMode,
cacheResults: !!options.cacheResults,
pseudos: options.pseudos,
adapter: options.adapter,
equals: options.equals,
};
}
const is = (next, token, options, context, compileToken) => {
const func = compileToken(token, copyOptions(options), context);
return func === boolbase.trueFunc
? next
: func === boolbase.falseFunc
? boolbase.falseFunc
: (elem) => func(elem) && next(elem);
};
/*
* :not, :has, :is, :matches and :where have to compile selectors
* doing this in src/pseudos.ts would lead to circular dependencies,
* so we add them here
*/
export const subselects = {
is,
/**
* `:matches` and `:where` are aliases for `:is`.
*/
matches: is,
where: is,
not(next, token, options, context, compileToken) {
const func = compileToken(token, copyOptions(options), context);
return func === boolbase.falseFunc
? next
: func === boolbase.trueFunc
? boolbase.falseFunc
: (elem) => !func(elem) && next(elem);
},
has(next, subselect, options, _context, compileToken) {
const { adapter } = options;
const opts = copyOptions(options);
opts.relativeSelector = true;
const context = subselect.some((s) => s.some(isTraversal))
? // Used as a placeholder. Will be replaced with the actual element.
[PLACEHOLDER_ELEMENT]
: undefined;
const compiled = compileToken(subselect, opts, context);
if (compiled === boolbase.falseFunc)
return boolbase.falseFunc;
const hasElement = ensureIsTag(compiled, adapter);
// If `compiled` is `trueFunc`, we can skip this.
if (context && compiled !== boolbase.trueFunc) {
/*
* `shouldTestNextSiblings` will only be true if the query starts with
* a traversal (sibling or adjacent). That means we will always have a context.
*/
const { shouldTestNextSiblings = false } = compiled;
return (elem) => {
if (!next(elem))
return false;
context[0] = elem;
const childs = adapter.getChildren(elem);
const nextElements = shouldTestNextSiblings
? [...childs, ...getNextSiblings(elem, adapter)]
: childs;
return adapter.existsOne(hasElement, nextElements);
};
}
return (elem) => next(elem) &&
adapter.existsOne(hasElement, adapter.getChildren(elem));
},
};
//# sourceMappingURL=subselects.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"subselects.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["pseudo-selectors/subselects.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAOhC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC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}

12
node_modules/css-select/lib/esm/sort.d.ts generated vendored Executable file
View File

@@ -0,0 +1,12 @@
import type { InternalSelector } from "./types.js";
import { type Traversal } from "css-what";
export declare function isTraversal(token: InternalSelector): token is Traversal;
/**
* Sort the parts of the passed selector,
* as there is potential for optimization
* (some types of selectors are faster than others)
*
* @param arr Selector to sort
*/
export default function sortByProcedure(arr: InternalSelector[]): void;
//# sourceMappingURL=sort.d.ts.map

1
node_modules/css-select/lib/esm/sort.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"sort.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AASzE,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,SAAS,CAEvE;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAerE"}

79
node_modules/css-select/lib/esm/sort.js generated vendored Executable file
View File

@@ -0,0 +1,79 @@
import { AttributeAction, SelectorType } from "css-what";
const procedure = new Map([
[SelectorType.Universal, 50],
[SelectorType.Tag, 30],
[SelectorType.Attribute, 1],
[SelectorType.Pseudo, 0],
]);
export function isTraversal(token) {
return !procedure.has(token.type);
}
const attributes = new Map([
[AttributeAction.Exists, 10],
[AttributeAction.Equals, 8],
[AttributeAction.Not, 7],
[AttributeAction.Start, 6],
[AttributeAction.End, 6],
[AttributeAction.Any, 5],
]);
/**
* Sort the parts of the passed selector,
* as there is potential for optimization
* (some types of selectors are faster than others)
*
* @param arr Selector to sort
*/
export default function sortByProcedure(arr) {
const procs = arr.map(getProcedure);
for (let i = 1; i < arr.length; i++) {
const procNew = procs[i];
if (procNew < 0)
continue;
for (let j = i - 1; j >= 0 && procNew < procs[j]; j--) {
const token = arr[j + 1];
arr[j + 1] = arr[j];
arr[j] = token;
procs[j + 1] = procs[j];
procs[j] = procNew;
}
}
}
function getProcedure(token) {
var _a, _b;
let proc = (_a = procedure.get(token.type)) !== null && _a !== void 0 ? _a : -1;
if (token.type === SelectorType.Attribute) {
proc = (_b = attributes.get(token.action)) !== null && _b !== void 0 ? _b : 4;
if (token.action === AttributeAction.Equals && token.name === "id") {
// Prefer ID selectors (eg. #ID)
proc = 9;
}
if (token.ignoreCase) {
/*
* IgnoreCase adds some overhead, prefer "normal" token
* this is a binary operation, to ensure it's still an int
*/
proc >>= 1;
}
}
else if (token.type === SelectorType.Pseudo) {
if (!token.data) {
proc = 3;
}
else if (token.name === "has" || token.name === "contains") {
proc = 0; // Expensive in any case
}
else if (Array.isArray(token.data)) {
// Eg. :matches, :not
proc = Math.min(...token.data.map((d) => Math.min(...d.map(getProcedure))));
// If we have traversals, try to avoid executing this selector
if (proc < 0) {
proc = 0;
}
}
else {
proc = 2;
}
}
return proc;
}
//# sourceMappingURL=sort.js.map

1
node_modules/css-select/lib/esm/sort.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"sort.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["sort.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAkB,MAAM,UAAU,CAAC;AAEzE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAmC;IACxD,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC;IAC5B,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC;IACtB,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;IAC3B,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW,CAAC,KAAuB;IAC/C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;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}

167
node_modules/css-select/lib/esm/types.d.ts generated vendored Executable file
View File

@@ -0,0 +1,167 @@
import type { Selector } from "css-what";
export declare type InternalSelector = Selector | {
type: "_flexibleDescendant";
};
export declare type Predicate<Value> = (v: Value) => boolean;
export interface Adapter<Node, ElementNode extends Node> {
/**
* Is the node a tag?
*/
isTag: (node: Node) => node is ElementNode;
/**
* Does at least one of passed element nodes pass the test predicate?
*/
existsOne: (test: Predicate<ElementNode>, elems: Node[]) => boolean;
/**
* Get the attribute value.
*/
getAttributeValue: (elem: ElementNode, name: string) => string | undefined;
/**
* Get the node's children
*/
getChildren: (node: Node) => Node[];
/**
* Get the name of the tag
*/
getName: (elem: ElementNode) => string;
/**
* Get the parent of the node
*/
getParent: (node: ElementNode) => Node | null;
/**
* Get the siblings of the node. Note that unlike jQuery's `siblings` method,
* this is expected to include the current node as well
*/
getSiblings: (node: Node) => Node[];
/**
* Returns the previous element sibling of a node.
*/
prevElementSibling?: (node: Node) => ElementNode | null;
/**
* Get the text content of the node, and its children if it has any.
*/
getText: (node: Node) => string;
/**
* Does the element have the named attribute?
*/
hasAttrib: (elem: ElementNode, name: string) => boolean;
/**
* Takes an array of nodes, and removes any duplicates, as well as any
* nodes whose ancestors are also in the array.
*/
removeSubsets: (nodes: Node[]) => Node[];
/**
* Finds all of the element nodes in the array that match the test predicate,
* as well as any of their children that match it.
*/
findAll: (test: Predicate<ElementNode>, nodes: Node[]) => ElementNode[];
/**
* Finds the first node in the array that matches the test predicate, or one
* of its children.
*/
findOne: (test: Predicate<ElementNode>, elems: Node[]) => ElementNode | null;
/**
* The adapter can also optionally include an equals method, if your DOM
* structure needs a custom equality test to compare two objects which refer
* to the same underlying node. If not provided, `css-select` will fall back to
* `a === b`.
*/
equals?: (a: Node, b: Node) => boolean;
/**
* Is the element in hovered state?
*/
isHovered?: (elem: ElementNode) => boolean;
/**
* Is the element in visited state?
*/
isVisited?: (elem: ElementNode) => boolean;
/**
* Is the element in active state?
*/
isActive?: (elem: ElementNode) => boolean;
}
export interface Options<Node, ElementNode extends Node> {
/**
* When enabled, tag names will be case-sensitive.
*
* @default false
*/
xmlMode?: boolean;
/**
* Lower-case attribute names.
*
* @default !xmlMode
*/
lowerCaseAttributeNames?: boolean;
/**
* Lower-case tag names.
*
* @default !xmlMode
*/
lowerCaseTags?: boolean;
/**
* Is the document in quirks mode?
*
* This will lead to .className and #id being case-insensitive.
*
* @default false
*/
quirksMode?: boolean;
/**
* Pseudo-classes that override the default ones.
*
* Maps from names to either strings of functions.
* - A string value is a selector that the element must match to be selected.
* - A function is called with the element as its first argument, and optional
* parameters second. If it returns true, the element is selected.
*/
pseudos?: Record<string, string | ((elem: ElementNode, value?: string | null) => boolean)> | undefined;
/**
* The last function in the stack, will be called with the last element
* that's looked at.
*/
rootFunc?: (element: ElementNode) => boolean;
/**
* The adapter to use when interacting with the backing DOM structure. By
* default it uses the `domutils` module.
*/
adapter?: Adapter<Node, ElementNode>;
/**
* The context of the current query. Used to limit the scope of searches.
* Can be matched directly using the `:scope` pseudo-class.
*/
context?: Node | Node[];
/**
* Indicates whether to consider the selector as a relative selector.
*
* Relative selectors that don't include a `:scope` pseudo-class behave
* as if they have a `:scope ` prefix (a `:scope` pseudo-class, followed by
* a descendant selector).
*
* If relative selectors are disabled, selectors starting with a traversal
* will lead to an error.
*
* @default true
* @see {@link https://www.w3.org/TR/selectors-4/#relative}
*/
relativeSelector?: boolean;
/**
* Allow css-select to cache results for some selectors, sometimes greatly
* improving querying performance. Disable this if your document can
* change in between queries with the same compiled selector.
*
* @default true
*/
cacheResults?: boolean;
}
export interface InternalOptions<Node, ElementNode extends Node> extends Options<Node, ElementNode> {
adapter: Adapter<Node, ElementNode>;
equals: (a: Node, b: Node) => boolean;
}
export interface CompiledQuery<ElementNode> {
(node: ElementNode): boolean;
shouldTestNextSiblings?: boolean;
}
export declare type Query<ElementNode> = string | CompiledQuery<ElementNode> | Selector[][];
export declare type CompileToken<Node, ElementNode extends Node> = (token: InternalSelector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node) => CompiledQuery<ElementNode>;
//# sourceMappingURL=types.d.ts.map

1
node_modules/css-select/lib/esm/types.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,oBAAY,gBAAgB,GAAG,QAAQ,GAAG;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAE1E,oBAAY,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC;AACrD,MAAM,WAAW,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI;IACnD;;OAEG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI,WAAW,CAAC;IAE3C;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC;IAEpE;;OAEG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE3E;;OAEG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;IAEpC;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC;IAEvC;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;IAE9C;;;OAGG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;IAEpC;;OAEG;IACH,kBAAk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W,CAAC,CAAC"}

2
node_modules/css-select/lib/esm/types.js generated vendored Executable file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

1
node_modules/css-select/lib/esm/types.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["types.ts"],"names":[],"mappings":""}

View File

@@ -1,3 +1,3 @@
import type { CompiledQuery, InternalOptions, InternalSelector, CompileToken } from "./types";
import type { CompiledQuery, InternalOptions, InternalSelector, CompileToken } from "./types.js";
export declare function compileGeneralSelector<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, selector: InternalSelector, options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>): CompiledQuery<ElementNode>;
//# sourceMappingURL=general.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../src/general.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACf,MAAM,SAAS,CAAC;AAOjB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACjE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CAiK5B"}
{"version":3,"file":"general.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["general.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACf,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACjE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CAiK5B"}

View File

@@ -1,9 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compileGeneralSelector = void 0;
var attributes_1 = require("./attributes");
var pseudo_selectors_1 = require("./pseudo-selectors");
var attributes_js_1 = require("./attributes.js");
var index_js_1 = require("./pseudo-selectors/index.js");
var css_what_1 = require("css-what");
function getElementParent(node, adapter) {
var parent = adapter.getParent(node);
if (parent && adapter.isTag(parent)) {
return parent;
}
return null;
}
/*
* All available rules
*/
@@ -23,10 +30,10 @@ function compileGeneralSelector(next, selector, options, context, compileToken)
if (!options.xmlMode || options.lowerCaseAttributeNames) {
selector.name = selector.name.toLowerCase();
}
return attributes_1.attributeRules[selector.action](next, selector, options);
return attributes_js_1.attributeRules[selector.action](next, selector, options);
}
case css_what_1.SelectorType.Pseudo: {
return (0, pseudo_selectors_1.compilePseudoSelector)(next, selector, options, context, compileToken);
return (0, index_js_1.compilePseudoSelector)(next, selector, options, context, compileToken);
}
// Tags
case css_what_1.SelectorType.Tag: {
@@ -47,8 +54,8 @@ function compileGeneralSelector(next, selector, options, context, compileToken)
typeof WeakSet === "undefined") {
return function descendant(elem) {
var current = elem;
while ((current = adapter.getParent(current))) {
if (adapter.isTag(current) && next(current)) {
while ((current = getElementParent(current, adapter))) {
if (next(current)) {
return true;
}
}
@@ -59,7 +66,7 @@ function compileGeneralSelector(next, selector, options, context, compileToken)
var isFalseCache_1 = new WeakSet();
return function cachedDescendant(elem) {
var current = elem;
while ((current = adapter.getParent(current))) {
while ((current = getElementParent(current, adapter))) {
if (!isFalseCache_1.has(current)) {
if (adapter.isTag(current) && next(current)) {
return true;
@@ -75,9 +82,9 @@ function compileGeneralSelector(next, selector, options, context, compileToken)
return function flexibleDescendant(elem) {
var current = elem;
do {
if (adapter.isTag(current) && next(current))
if (next(current))
return true;
} while ((current = adapter.getParent(current)));
} while ((current = getElementParent(current, adapter)));
return false;
};
}
@@ -138,3 +145,4 @@ function compileGeneralSelector(next, selector, options, context, compileToken)
}
}
exports.compileGeneralSelector = compileGeneralSelector;
//# sourceMappingURL=general.js.map

1
node_modules/css-select/lib/general.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"general.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/93caad96c807da1d48f08166ef14cf26916b9364/src/","sources":["general.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,wDAAoE;AAQpE,qCAAwC;AAExC,SAAS,gBAAgB,CACrB,IAAiB,EACjB,OAAmC;IAEnC,IAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACjC,OAAO,MAAM,CAAC;KACjB;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;GAEG;AAEH,SAAgB,sBAAsB,CAClC,IAAgC,EAChC,QAA0B,EAC1B,OAA2C,EAC3C,OAA2B,EAC3B,YAA6C;IAErC,IAAA,OAAO,GAAa,OAAO,QAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAEpC,QAAQ,QAAQ,CAAC,IAAI,EAAE;QACnB,KAAK,uBAAY,CAAC,aAAa,CAAC,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;SACtE;QACD,KAAK,uBAAY,CAAC,gBAAgB,CAAC,CAAC;YAChC,MAAM,IAAI,KAAK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AAC;gBAC9C,CAAC,CAAC;aACL;YAED,OAAO,SAAS,QAAQ,CAAC,IAAiB;gBACtC,IAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,WAAW,CAAC;gBAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACtC,IAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACnC,IAAI,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC;wBAAE,MAAM;oBACxC,IAAI,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;wBAC/B,WAAW,GAAG,cAAc,CAAC;qBAChC;iBACJ;gBAED,OAAO,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;YAC9C,CAAC,CAAC;SACL;QACD,KAAK,uBAAY,CAAC,SAAS,CAAC,CAAC;YACzB,IAAI,QAAQ,CAAC,SAAS,IAAI,IAAI,IAAI,QAAQ,CAAC,SAAS,KAAK,GAAG,EAAE;gBAC1D,MAAM,IAAI,KAAK,CACX,oEAAoE,CACvE,CAAC;aACL;YAED,OAAO,IAAI,CAAC;SACf;KACJ;AACL,CAAC;AAvKD,wDAuKC"}

12
node_modules/css-select/lib/helpers/cache.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import type { CompiledQuery, InternalOptions } from "../types.js";
/**
* Some selectors such as `:contains` and (non-relative) `:has` will only be
* able to match elements if their parents match the selector (as they contain
* a subset of the elements that the parent contains).
*
* This function wraps the given `matches` function in a function that caches
* the results of the parent elements, so that the `matches` function only
* needs to be called once for each subtree.
*/
export declare function cacheParentResults<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, { adapter, cacheResults }: InternalOptions<Node, ElementNode>, matches: (elem: ElementNode) => boolean): CompiledQuery<ElementNode>;
//# sourceMappingURL=cache.d.ts.map

1
node_modules/css-select/lib/helpers/cache.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC7D,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC7D,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,GACxC,aAAa,CAAC,WAAW,CAAC,CAsC5B"}

45
node_modules/css-select/lib/helpers/cache.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cacheParentResults = cacheParentResults;
var querying_js_1 = require("./querying.js");
/**
* Some selectors such as `:contains` and (non-relative) `:has` will only be
* able to match elements if their parents match the selector (as they contain
* a subset of the elements that the parent contains).
*
* This function wraps the given `matches` function in a function that caches
* the results of the parent elements, so that the `matches` function only
* needs to be called once for each subtree.
*/
function cacheParentResults(next, _a, matches) {
var adapter = _a.adapter, cacheResults = _a.cacheResults;
if (cacheResults === false || typeof WeakMap === "undefined") {
return function (elem) { return next(elem) && matches(elem); };
}
// Use a cache to avoid re-checking children of an element.
// @ts-expect-error `Node` is not extending object
var resultCache = new WeakMap();
function addResultToCache(elem) {
var result = matches(elem);
resultCache.set(elem, result);
return result;
}
return function cachedMatcher(elem) {
if (!next(elem))
return false;
if (resultCache.has(elem)) {
return resultCache.get(elem);
}
// Check all of the element's parents.
var node = elem;
do {
var parent = (0, querying_js_1.getElementParent)(node, adapter);
if (parent === null) {
return addResultToCache(elem);
}
node = parent;
} while (!resultCache.has(node));
return resultCache.get(node) && addResultToCache(elem);
};
}
//# sourceMappingURL=cache.js.map

1
node_modules/css-select/lib/helpers/cache.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.js","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/cache.ts"],"names":[],"mappings":";;AAYA,gDA0CC;AArDD,6CAAiD;AAEjD;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAC9B,IAAgC,EAChC,EAA6D,EAC7D,OAAuC;QADrC,OAAO,aAAA,EAAE,YAAY,kBAAA;IAGvB,IAAI,YAAY,KAAK,KAAK,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QAC3D,OAAO,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,EAA3B,CAA2B,CAAC;IACjD,CAAC;IAED,2DAA2D;IAE3D,kDAAkD;IAClD,IAAM,WAAW,GAAG,IAAI,OAAO,EAAiB,CAAC;IAEjD,SAAS,gBAAgB,CAAC,IAAiB;QACvC,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAE7B,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO,SAAS,aAAa,CAAC,IAAI;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,CAAC;QAED,sCAAsC;QACtC,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,GAAG,CAAC;YACA,IAAM,MAAM,GAAG,IAAA,8BAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAE/C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClB,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;YAED,IAAI,GAAG,MAAM,CAAC;QAClB,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAEjC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAE,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC;AACN,CAAC"}

24
node_modules/css-select/lib/helpers/querying.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { InternalOptions, Predicate, Adapter } from "../types.js";
/**
* Find all elements matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns All matching elements.
*/
export declare function findAll<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode[];
/**
* Find the first element matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns The first matching element, or null if there was no match.
*/
export declare function findOne<Node, ElementNode extends Node>(query: Predicate<ElementNode>, elems: Node[], options: InternalOptions<Node, ElementNode>): ElementNode | null;
export declare function getNextSiblings<Node, ElementNode extends Node>(elem: Node, adapter: Adapter<Node, ElementNode>): ElementNode[];
export declare function getElementParent<Node, ElementNode extends Node>(node: ElementNode, adapter: Adapter<Node, ElementNode>): ElementNode | null;
//# sourceMappingURL=querying.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"querying.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/css-select/b3f14ecdb644827d0a7ea8f441abe2063c7ce2e7/src/","sources":["helpers/querying.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,GAC5C,WAAW,EAAE,CAyCf;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,EAC7B,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,GAC5C,WAAW,GAAG,IAAI,CAwCpB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC1D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,EAAE,CAMf;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3D,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,GAAG,IAAI,CAGpB"}

111
node_modules/css-select/lib/helpers/querying.js generated vendored Normal file
View File

@@ -0,0 +1,111 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findAll = findAll;
exports.findOne = findOne;
exports.getNextSiblings = getNextSiblings;
exports.getElementParent = getElementParent;
/**
* Find all elements matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns All matching elements.
*/
function findAll(query, elems, options) {
var adapter = options.adapter, _a = options.xmlMode, xmlMode = _a === void 0 ? false : _a;
var result = [];
/** Stack of the arrays we are looking at. */
var nodeStack = [elems];
/** Stack of the indices within the arrays. */
var indexStack = [0];
for (;;) {
// First, check if the current array has any more elements to look at.
if (indexStack[0] >= nodeStack[0].length) {
// If we have no more arrays to look at, we are done.
if (nodeStack.length === 1) {
return result;
}
nodeStack.shift();
indexStack.shift();
// Loop back to the start to continue with the next array.
continue;
}
var elem = nodeStack[0][indexStack[0]++];
if (!adapter.isTag(elem))
continue;
if (query(elem))
result.push(elem);
if (xmlMode || adapter.getName(elem) !== "template") {
/*
* Add the children to the stack. We are depth-first, so this is
* the next array we look at.
*/
var children = adapter.getChildren(elem);
if (children.length > 0) {
nodeStack.unshift(children);
indexStack.unshift(0);
}
}
}
}
/**
* Find the first element matching the query. If not in XML mode, the query will ignore
* the contents of `<template>` elements.
*
* @param query - Function that returns true if the element matches the query.
* @param elems - Nodes to query. If a node is an element, its children will be queried.
* @param options - Options for querying the document.
* @returns The first matching element, or null if there was no match.
*/
function findOne(query, elems, options) {
var adapter = options.adapter, _a = options.xmlMode, xmlMode = _a === void 0 ? false : _a;
/** Stack of the arrays we are looking at. */
var nodeStack = [elems];
/** Stack of the indices within the arrays. */
var indexStack = [0];
for (;;) {
// First, check if the current array has any more elements to look at.
if (indexStack[0] >= nodeStack[0].length) {
// If we have no more arrays to look at, we are done.
if (nodeStack.length === 1) {
return null;
}
nodeStack.shift();
indexStack.shift();
// Loop back to the start to continue with the next array.
continue;
}
var elem = nodeStack[0][indexStack[0]++];
if (!adapter.isTag(elem))
continue;
if (query(elem))
return elem;
if (xmlMode || adapter.getName(elem) !== "template") {
/*
* Add the children to the stack. We are depth-first, so this is
* the next array we look at.
*/
var children = adapter.getChildren(elem);
if (children.length > 0) {
nodeStack.unshift(children);
indexStack.unshift(0);
}
}
}
}
function getNextSiblings(elem, adapter) {
var siblings = adapter.getSiblings(elem);
if (siblings.length <= 1)
return [];
var elemIndex = siblings.indexOf(elem);
if (elemIndex < 0 || elemIndex === siblings.length - 1)
return [];
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
}
function getElementParent(node, adapter) {
var parent = adapter.getParent(node);
return parent != null && adapter.isTag(parent) ? parent : null;
}
//# sourceMappingURL=querying.js.map

Some files were not shown because too many files have changed in this diff Show More