readability_js 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +119 -0
- data/Rakefile +30 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/cli/pry.rb +5 -0
- data/lib/custom_errors/error.rb +4 -0
- data/lib/readability_js/node/node_modules/.bin/tldts +1 -0
- data/lib/readability_js/node/node_modules/.yarn-integrity +67 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/LICENSE +21 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/README.md +316 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js +220 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs +5666 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.d.cts +109 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.d.ts +17 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.js +27 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.d.ts +44 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js +82 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.d.ts +537 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.js +2833 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.d.ts +21 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.js +7 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.d.ts +43 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js +101 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.d.ts +99 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js +361 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.d.ts +89 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js +860 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.d.ts +79 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js +261 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.d.ts +31 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js +195 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.d.ts +29 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js +507 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.d.ts +52 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js +350 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/typedef.d.ts +80 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.d.ts +45 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.js +279 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.js.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/package.json +82 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/index.ts +24 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/cache.ts +114 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/color.ts +3511 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/common.ts +31 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/constant.ts +68 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/convert.ts +469 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-calc.ts +965 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-gradient.ts +384 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-var.ts +250 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/relative-color.ts +603 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/resolve.ts +443 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/typedef.ts +88 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/util.ts +336 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/LICENSE +21 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/README.md +324 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.cjs +4613 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.cjs.map +1 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.d.cts +16 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/package.json +83 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/index.js +353 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/constant.js +129 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/finder.js +3108 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/matcher.js +587 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/parser.js +431 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/utility.js +1107 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/index.d.ts +14 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/constant.d.ts +79 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/finder.d.ts +64 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/matcher.d.ts +16 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/parser.d.ts +14 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/utility.d.ts +30 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/LICENSE +22 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/README.md +132 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/package.json +43 -0
- data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/src/nwsapi.js +1855 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/CHANGELOG.md +10 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/LICENSE.md +18 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/README.md +32 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.cjs +263 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.d.ts +429 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.mjs +263 -0
- data/lib/readability_js/node/node_modules/@csstools/color-helpers/package.json +62 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/CHANGELOG.md +10 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/LICENSE.md +20 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/README.md +132 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.cjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.d.ts +71 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.mjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-calc/package.json +66 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/CHANGELOG.md +13 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/LICENSE.md +20 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/README.md +37 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.cjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.d.ts +168 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.mjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-color-parser/package.json +71 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md +9 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/LICENSE.md +20 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/README.md +119 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.cjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts +604 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.mjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/package.json +65 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md +9 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md +18 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/README.md +43 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts +5 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json +765 -0
- data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/package.json +54 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/CHANGELOG.md +9 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/LICENSE.md +20 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/README.md +111 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.cjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.d.ts +593 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.mjs +1 -0
- data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/package.json +62 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/.prettierrc.js +13 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/CHANGELOG.md +104 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/CODE_OF_CONDUCT.md +15 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/CONTRIBUTING.md +78 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/JSDOMParser.js +1278 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/LICENSE.md +13 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/README.md +129 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/Readability-readerable.js +122 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/Readability.js +2786 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/SECURITY.md +8 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/eslint.config.mjs +55 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/index.d.ts +64 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/index.js +8 -0
- data/lib/readability_js/node/node_modules/@mozilla/readability/package.json +41 -0
- data/lib/readability_js/node/node_modules/agent-base/LICENSE +22 -0
- data/lib/readability_js/node/node_modules/agent-base/README.md +69 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/helpers.d.ts +15 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/helpers.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/helpers.js +66 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/helpers.js.map +1 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/index.d.ts +41 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/index.js +178 -0
- data/lib/readability_js/node/node_modules/agent-base/dist/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/agent-base/package.json +46 -0
- data/lib/readability_js/node/node_modules/bidi-js/LICENSE.txt +22 -0
- data/lib/readability_js/node/node_modules/bidi-js/README.md +133 -0
- data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.js +1010 -0
- data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.min.js +1 -0
- data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.min.mjs +1 -0
- data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.mjs +1002 -0
- data/lib/readability_js/node/node_modules/bidi-js/package.json +39 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/brackets.js +30 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/charTypes.js +66 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiBrackets.data.js +5 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiCharTypes.data.js +25 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiMirroring.data.js +2 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/embeddingLevels.js +690 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/index.js +5 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/mirroring.js +48 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/reordering.js +99 -0
- data/lib/readability_js/node/node_modules/bidi-js/src/util/parseCharacterMap.js +30 -0
- data/lib/readability_js/node/node_modules/css-tree/LICENSE +19 -0
- data/lib/readability_js/node/node_modules/css-tree/README.md +192 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/convertor/create.cjs +32 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/convertor/index.cjs +8 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/data-patch.cjs +7 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/data.cjs +120 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/generate.cjs +139 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/index.cjs +13 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/parse.cjs +556 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/scanner.cjs +113 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs +59 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/walk.cjs +57 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/generator/create.cjs +102 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/generator/index.cjs +8 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/generator/sourceMap.cjs +96 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/generator/token-before.cjs +170 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/index.cjs +65 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/Lexer.cjs +517 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/error.cjs +128 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs +235 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-const.cjs +12 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-urange.cjs +149 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic.cjs +589 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/index.cjs +7 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/match-graph.cjs +530 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/match.cjs +632 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/prepare-tokens.cjs +54 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/search.cjs +65 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/structure.cjs +173 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/trace.cjs +73 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/units.cjs +38 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/parser/SyntaxError.cjs +74 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/parser/create.cjs +340 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/parser/index.cjs +8 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/parser/parse-selector.cjs +8 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/parser/sequence.cjs +47 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/container.cjs +32 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/font-face.cjs +12 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/import.cjs +101 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/index.cjs +27 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/layer.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/media.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/nest.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/page.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/scope.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/starting-style.cjs +12 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/supports.cjs +16 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/generator.cjs +9 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/lexer.cjs +14 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/mix.cjs +127 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/parser-selector.cjs +19 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/parser.cjs +49 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/walker.cjs +9 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/create.cjs +58 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/function/expression.cjs +11 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/function/var.cjs +43 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/index.cjs +14 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs +293 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Atrule.cjs +103 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs +52 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs +148 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Block.cjs +96 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Brackets.cjs +38 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/CDC.cjs +26 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/CDO.cjs +26 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/ClassSelector.cjs +31 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Combinator.cjs +61 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Comment.cjs +40 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Condition.cjs +120 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Declaration.cjs +166 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/DeclarationList.cjs +62 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Dimension.cjs +30 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Feature.cjs +101 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/FeatureFunction.cjs +67 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/FeatureRange.cjs +133 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Function.cjs +45 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/GeneralEnclosed.cjs +68 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Hash.cjs +30 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/IdSelector.cjs +33 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Identifier.cjs +25 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Layer.cjs +35 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerList.cjs +43 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerName.cjs +34 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerNameList.cjs +42 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaCondition.cjs +70 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaFeature.cjs +76 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaFeatureRange.cjs +11 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaQuery.cjs +100 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaQueryList.cjs +41 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/NestingSelector.cjs +29 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Nth.cjs +54 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Number.cjs +25 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Operator.cjs +28 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Parentheses.cjs +38 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Percentage.cjs +25 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/PseudoClassSelector.cjs +67 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/PseudoElementSelector.cjs +69 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Ratio.cjs +71 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Raw.cjs +48 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Rule.cjs +58 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Scope.cjs +69 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Selector.cjs +38 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SelectorList.cjs +43 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/String.cjs +26 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/StyleSheet.cjs +83 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SupportsDeclaration.cjs +38 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SupportsFeature.cjs +69 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs +59 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs +158 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Url.cjs +54 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Value.cjs +26 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/WhiteSpace.cjs +34 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/common/feature-range.cjs +112 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/common/feature.cjs +76 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-generate.cjs +103 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-parse-selector.cjs +39 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-parse.cjs +103 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index.cjs +103 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/pseudo/index.cjs +60 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/pseudo/lang.cjs +37 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/atrulePrelude.cjs +9 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/default.cjs +76 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/index.cjs +11 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/selector.cjs +88 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/value.cjs +29 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs +91 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/TokenStream.cjs +308 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/adopt-buffer.cjs +13 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/char-code-definitions.cjs +236 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/index.cjs +554 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/names.cjs +32 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/types.cjs +57 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/utils.cjs +261 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/List.cjs +473 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/clone.cjs +25 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/create-custom-error.cjs +18 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/ident.cjs +102 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/index.cjs +20 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/names.cjs +113 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/string.cjs +99 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/utils/url.cjs +108 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/version.cjs +5 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/walker/create.cjs +291 -0
- data/lib/readability_js/node/node_modules/css-tree/cjs/walker/index.cjs +8 -0
- data/lib/readability_js/node/node_modules/css-tree/data/patch.json +982 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/csstree.esm.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/csstree.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/data.cjs +1308 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/data.js +1308 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/version.cjs +1 -0
- data/lib/readability_js/node/node_modules/css-tree/dist/version.js +1 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/convertor/create.js +28 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/convertor/index.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/data-patch.js +6 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/data.js +118 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/SyntaxError.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/generate.js +135 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/index.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/parse.js +552 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/scanner.js +109 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/walk.js +53 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/generator/create.js +97 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/generator/index.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/generator/sourceMap.js +92 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/generator/token-before.js +182 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/index.js +30 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/Lexer.js +511 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/error.js +123 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-an-plus-b.js +238 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-const.js +8 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-urange.js +151 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic.js +622 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/index.js +1 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/match-graph.js +527 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/match.js +630 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/prepare-tokens.js +50 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/search.js +61 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/structure.js +169 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/trace.js +66 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/lexer/units.js +27 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/parser/SyntaxError.js +70 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/parser/create.js +350 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/parser/index.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/parser/parse-selector.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/parser/sequence.js +43 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/container.js +28 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/font-face.js +8 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/import.js +104 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/index.js +23 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/layer.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/media.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/nest.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/page.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/scope.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/starting-style.js +8 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/supports.js +12 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/generator.js +5 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/lexer.js +10 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/mix.js +123 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/parser-selector.js +15 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/parser.js +45 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/walker.js +5 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/create.js +55 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/function/expression.js +7 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/function/var.js +39 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/index.js +10 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AnPlusB.js +292 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Atrule.js +100 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js +47 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AttributeSelector.js +147 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Block.js +95 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Brackets.js +35 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/CDC.js +19 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/CDO.js +19 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/ClassSelector.js +24 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Combinator.js +54 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Comment.js +33 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Condition.js +123 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Declaration.js +165 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/DeclarationList.js +62 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Dimension.js +23 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Feature.js +103 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/FeatureFunction.js +63 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/FeatureRange.js +133 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Function.js +41 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js +66 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Hash.js +23 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/IdSelector.js +26 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Identifier.js +18 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Layer.js +28 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/LayerList.js +36 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/MediaQuery.js +102 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/MediaQueryList.js +34 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/NestingSelector.js +22 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Nth.js +47 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Number.js +18 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Operator.js +21 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Parentheses.js +34 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Percentage.js +18 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js +65 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js +66 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Ratio.js +68 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Raw.js +41 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Rule.js +51 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Scope.js +66 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Selector.js +31 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/SelectorList.js +35 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/String.js +19 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/StyleSheet.js +82 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js +34 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/TypeSelector.js +52 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/UnicodeRange.js +156 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Url.js +52 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Value.js +19 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/WhiteSpace.js +27 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-generate.js +49 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-parse-selector.js +17 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-parse.js +49 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index.js +49 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/pseudo/index.js +56 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/pseudo/lang.js +33 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js +5 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/default.js +85 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/index.js +3 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/selector.js +94 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/value.js +25 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/OffsetToLocation.js +87 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/TokenStream.js +316 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/adopt-buffer.js +9 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/char-code-definitions.js +212 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/index.js +513 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/names.js +28 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/types.js +28 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/utils.js +254 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/List.js +469 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/clone.js +21 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/create-custom-error.js +14 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/ident.js +101 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/index.js +6 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/names.js +106 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/string.js +99 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/utils/url.js +108 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/version.js +5 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/walker/create.js +287 -0
- data/lib/readability_js/node/node_modules/css-tree/lib/walker/index.js +4 -0
- data/lib/readability_js/node/node_modules/css-tree/package.json +125 -0
- data/lib/readability_js/node/node_modules/cssstyle/LICENSE +20 -0
- data/lib/readability_js/node/node_modules/cssstyle/README.md +11 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/CSSStyleDeclaration.js +636 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/generated/allProperties.js +653 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/generated/implementedProperties.js +2222 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/generated/properties.js +6951 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/normalize.js +1417 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/parsers.js +535 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/background.js +396 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundAttachment.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundClip.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundColor.js +55 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundImage.js +78 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundOrigin.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundPosition.js +193 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundRepeat.js +89 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundSize.js +120 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/border.js +164 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottom.js +156 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomColor.js +60 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomStyle.js +59 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomWidth.js +69 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderCollapse.js +50 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderColor.js +116 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeft.js +156 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftColor.js +60 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftStyle.js +59 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftWidth.js +69 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRight.js +156 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightColor.js +60 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightStyle.js +59 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightWidth.js +69 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderSpacing.js +62 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderStyle.js +116 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTop.js +156 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopColor.js +60 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopStyle.js +59 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopWidth.js +69 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderWidth.js +129 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/bottom.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/clear.js +50 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/clip.js +68 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/color.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/display.js +207 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flex.js +176 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexBasis.js +62 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexGrow.js +61 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexShrink.js +61 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/float.js +50 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/floodColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/font.js +289 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontFamily.js +94 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontSize.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontStyle.js +63 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontVariant.js +73 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontWeight.js +68 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/height.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/left.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/lightingColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/lineHeight.js +66 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/margin.js +95 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginBottom.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginLeft.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginRight.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginTop.js +64 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/opacity.js +59 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/outlineColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/padding.js +93 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingBottom.js +65 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingLeft.js +65 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingRight.js +65 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingTop.js +65 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/right.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/stopColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/top.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextFillColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js +51 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/properties/width.js +58 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/utils/allExtraProperties.js +155 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/utils/camelize.js +37 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/utils/propertyDescriptors.js +19 -0
- data/lib/readability_js/node/node_modules/cssstyle/lib/utils/strings.js +167 -0
- data/lib/readability_js/node/node_modules/cssstyle/package.json +74 -0
- data/lib/readability_js/node/node_modules/data-urls/LICENSE.txt +7 -0
- data/lib/readability_js/node/node_modules/data-urls/README.md +62 -0
- data/lib/readability_js/node/node_modules/data-urls/lib/parser.js +69 -0
- data/lib/readability_js/node/node_modules/data-urls/lib/utils.js +20 -0
- data/lib/readability_js/node/node_modules/data-urls/package.json +52 -0
- data/lib/readability_js/node/node_modules/debug/LICENSE +20 -0
- data/lib/readability_js/node/node_modules/debug/README.md +481 -0
- data/lib/readability_js/node/node_modules/debug/package.json +64 -0
- data/lib/readability_js/node/node_modules/debug/src/browser.js +272 -0
- data/lib/readability_js/node/node_modules/debug/src/common.js +292 -0
- data/lib/readability_js/node/node_modules/debug/src/index.js +10 -0
- data/lib/readability_js/node/node_modules/debug/src/node.js +263 -0
- data/lib/readability_js/node/node_modules/decimal.js/LICENCE.md +23 -0
- data/lib/readability_js/node/node_modules/decimal.js/README.md +246 -0
- data/lib/readability_js/node/node_modules/decimal.js/decimal.d.ts +301 -0
- data/lib/readability_js/node/node_modules/decimal.js/decimal.js +4951 -0
- data/lib/readability_js/node/node_modules/decimal.js/decimal.mjs +4914 -0
- data/lib/readability_js/node/node_modules/decimal.js/package.json +55 -0
- data/lib/readability_js/node/node_modules/entities/LICENSE +11 -0
- data/lib/readability_js/node/node_modules/entities/decode.d.ts +1 -0
- data/lib/readability_js/node/node_modules/entities/decode.js +3 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +19 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.d.ts +209 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.js +511 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.d.ts +22 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.js +73 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.d.ts +43 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.js +121 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +2 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +2 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +8 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.d.ts +96 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.js +131 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/commonjs/package.json +3 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.d.ts +19 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode.d.ts +209 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode.js +497 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/decode.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/encode.d.ts +22 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/encode.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/encode.js +69 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/encode.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/escape.d.ts +43 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/escape.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/escape.js +117 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/escape.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +2 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +2 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.d.ts +8 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/index.d.ts +96 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/index.js +107 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/entities/dist/esm/package.json +3 -0
- data/lib/readability_js/node/node_modules/entities/escape.d.ts +1 -0
- data/lib/readability_js/node/node_modules/entities/escape.js +3 -0
- data/lib/readability_js/node/node_modules/entities/package.json +118 -0
- data/lib/readability_js/node/node_modules/entities/readme.md +122 -0
- data/lib/readability_js/node/node_modules/entities/src/decode-codepoint.ts +81 -0
- data/lib/readability_js/node/node_modules/entities/src/decode.spec.ts +320 -0
- data/lib/readability_js/node/node_modules/entities/src/decode.ts +620 -0
- data/lib/readability_js/node/node_modules/entities/src/encode.spec.ts +78 -0
- data/lib/readability_js/node/node_modules/entities/src/encode.ts +77 -0
- data/lib/readability_js/node/node_modules/entities/src/escape.spec.ts +14 -0
- data/lib/readability_js/node/node_modules/entities/src/escape.ts +148 -0
- data/lib/readability_js/node/node_modules/entities/src/generated/.eslintrc.json +10 -0
- data/lib/readability_js/node/node_modules/entities/src/generated/decode-data-html.ts +8 -0
- data/lib/readability_js/node/node_modules/entities/src/generated/decode-data-xml.ts +8 -0
- data/lib/readability_js/node/node_modules/entities/src/generated/encode-html.ts +17 -0
- data/lib/readability_js/node/node_modules/entities/src/index.spec.ts +125 -0
- data/lib/readability_js/node/node_modules/entities/src/index.ts +188 -0
- data/lib/readability_js/node/node_modules/html-encoding-sniffer/LICENSE.txt +7 -0
- data/lib/readability_js/node/node_modules/html-encoding-sniffer/README.md +40 -0
- data/lib/readability_js/node/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js +295 -0
- data/lib/readability_js/node/node_modules/html-encoding-sniffer/package.json +30 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/LICENSE +22 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/README.md +44 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.d.ts +44 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.js +148 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/http-proxy-agent/package.json +47 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/LICENSE +22 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/README.md +70 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.d.ts +47 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.js +180 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +15 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- data/lib/readability_js/node/node_modules/https-proxy-agent/package.json +50 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/modules.xml +8 -0
- data/lib/readability_js/node/node_modules/iconv-lite/.idea/vcs.xml +6 -0
- data/lib/readability_js/node/node_modules/iconv-lite/Changelog.md +212 -0
- data/lib/readability_js/node/node_modules/iconv-lite/LICENSE +21 -0
- data/lib/readability_js/node/node_modules/iconv-lite/README.md +130 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/index.js +23 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/internal.js +198 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf16.js +197 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf32.js +319 -0
- data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf7.js +290 -0
- data/lib/readability_js/node/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- data/lib/readability_js/node/node_modules/iconv-lite/lib/index.d.ts +41 -0
- data/lib/readability_js/node/node_modules/iconv-lite/lib/index.js +180 -0
- data/lib/readability_js/node/node_modules/iconv-lite/lib/streams.js +109 -0
- data/lib/readability_js/node/node_modules/iconv-lite/package.json +44 -0
- data/lib/readability_js/node/node_modules/is-potential-custom-element-name/LICENSE-MIT.txt +20 -0
- data/lib/readability_js/node/node_modules/is-potential-custom-element-name/README.md +40 -0
- data/lib/readability_js/node/node_modules/is-potential-custom-element-name/index.js +9 -0
- data/lib/readability_js/node/node_modules/is-potential-custom-element-name/package.json +35 -0
- data/lib/readability_js/node/node_modules/jsdom/LICENSE.txt +22 -0
- data/lib/readability_js/node/node_modules/jsdom/README.md +551 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/api.js +335 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/Window.js +1022 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.css +415 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/js-globals.json +312 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/not-implemented.js +20 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/html.js +208 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/index.js +37 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/xml.js +202 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/async-resource-queue.js +114 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/no-op-resource-loader.js +8 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js +98 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js +33 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js +142 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js +142 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/level2/style.js +57 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/level3/xpath.js +1875 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/aborting/AbortController-impl.js +17 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/aborting/AbortSignal-impl.js +131 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js +60 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl.js +78 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes.js +312 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js +75 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl.js +66 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/crypto/Crypto-impl.js +68 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/cssom/StyleSheetList-impl.js +38 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js +279 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/custom-elements/ElementInternals-impl.js +56 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/deviceorientation/DeviceMotionEventAcceleration-impl.js +7 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/deviceorientation/DeviceMotionEventRotationRate-impl.js +7 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/documents.js +15 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js +59 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js +30 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl.js +18 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization.js +63 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/serialization.js +36 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/BeforeUnloadEvent-impl.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/BlobEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CloseEvent-impl.js +10 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CompositionEvent-impl.js +20 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CustomEvent-impl.js +21 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/DeviceMotionEvent-impl.js +49 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/DeviceOrientationEvent-impl.js +10 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/ErrorEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/Event-impl.js +195 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js +24 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js +438 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/FocusEvent-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js +11 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js +29 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/MessageEvent-impl.js +25 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/MouseEvent-impl.js +72 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PageTransitionEvent-impl.js +20 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PointerEvent-impl.js +21 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PopStateEvent-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/ProgressEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PromiseRejectionEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/StorageEvent-impl.js +26 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/SubmitEvent-impl.js +13 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/TouchEvent-impl.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/TransitionEvent-impl.js +10 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/UIEvent-impl.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/WheelEvent-impl.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/Headers-impl.js +172 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/header-list.js +65 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/header-types.js +103 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/Blob-impl.js +93 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/File-impl.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/FileList-impl.js +15 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/FileReader-impl.js +130 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbortController.js +143 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbortSignal.js +249 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbstractRange.js +171 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js +53 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AssignedNodesOptions.js +28 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Attr.js +217 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BarProp.js +117 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BeforeUnloadEvent.js +139 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BinaryType.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Blob.js +211 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobCallback.js +30 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobEvent.js +157 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobEventInit.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobPropertyBag.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CDATASection.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CanPlayTypeResult.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js +453 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CloseEvent.js +168 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CloseEventInit.js +65 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Comment.js +120 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CompositionEvent.js +219 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CompositionEventInit.js +32 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Crypto.js +148 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomElementConstructor.js +34 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomElementRegistry.js +267 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomEvent.js +206 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomEventInit.js +32 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMException.js +222 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMImplementation.js +237 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMParser.js +140 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRect.js +276 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRectInit.js +76 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRectReadOnly.js +285 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMStringMap.js +297 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMTokenList.js +537 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEvent.js +183 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventAcceleration.js +145 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventAccelerationInit.js +61 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventInit.js +70 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventRotationRate.js +145 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventRotationRateInit.js +61 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceOrientationEvent.js +183 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceOrientationEventInit.js +80 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Document.js +4509 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentFragment.js +334 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentReadyState.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentType.js +252 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Element.js +3718 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementCreationOptions.js +26 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementDefinitionOptions.js +29 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementInternals.js +2150 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EndingType.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ErrorEvent.js +192 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ErrorEventInit.js +92 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Event.js +430 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js +36 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventInit.js +58 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js +35 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventListenerOptions.js +28 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventModifierInit.js +221 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js +259 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/External.js +130 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/File.js +185 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FileList.js +298 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FilePropertyBag.js +33 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FileReader.js +468 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FocusEvent.js +144 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FocusEventInit.js +36 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FormData.js +468 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Function.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/GetRootNodeOptions.js +31 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js +1023 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAreaElement.js +822 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAudioElement.js +110 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBRElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBaseElement.js +193 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBodyElement.js +877 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLButtonElement.js +522 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js +304 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLCollection.js +352 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataListElement.js +125 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDetailsElement.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDialogElement.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDivElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js +3489 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js +378 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js +329 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFontElement.js +236 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormControlsCollection.js +318 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js +658 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameElement.js +510 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js +708 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHRElement.js +320 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadElement.js +110 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js +686 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLImageElement.js +902 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLInputElement.js +1927 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLIElement.js +201 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLabelElement.js +179 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLegendElement.js +166 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLinkElement.js +552 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMapElement.js +168 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMarqueeElement.js +554 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMediaElement.js +898 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMenuElement.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMetaElement.js +276 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js +365 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLModElement.js +214 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOListElement.js +281 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js +941 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js +197 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionElement.js +376 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionsCollection.js +511 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOutputElement.js +392 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLParamElement.js +276 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLPictureElement.js +110 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLPreElement.js +160 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js +228 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js +173 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLScriptElement.js +469 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSelectElement.js +989 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSlotElement.js +192 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSourceElement.js +337 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSpanElement.js +110 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLStyleElement.js +207 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js +729 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableColElement.js +372 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js +799 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js +414 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js +346 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js +123 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js +1206 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTimeElement.js +153 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTitleElement.js +152 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTrackElement.js +363 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLUListElement.js +197 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLVideoElement.js +340 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEvent.js +157 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEventInit.js +50 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Headers.js +418 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/History.js +266 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js +168 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js +68 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEvent.js +445 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEventInit.js +116 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Location.js +404 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MessageEvent.js +317 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MessageEventInit.js +100 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MimeType.js +156 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MimeTypeArray.js +326 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MouseEvent.js +595 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MouseEventInit.js +189 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationCallback.js +34 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationObserver.js +178 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationObserverInit.js +121 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationRecord.js +229 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NamedNodeMap.js +527 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Navigator.js +326 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Node.js +763 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeFilter.js +75 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeIterator.js +207 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeList.js +302 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js +56 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js +144 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js +35 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Performance.js +142 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Plugin.js +359 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js +336 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PointerEvent.js +324 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PointerEventInit.js +241 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js +144 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js +32 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js +122 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js +170 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js +65 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEvent.js +157 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEventInit.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/RadioNodeList.js +296 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Range.js +641 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedPreserveAspectRatio.js +136 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedRect.js +136 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js +149 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js +64 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGDefsElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGDescElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js +3155 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGGElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js +139 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGMetadataElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js +132 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGPreserveAspectRatio.js +196 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGRect.js +210 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js +786 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js +511 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSwitchElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSymbolElement.js +146 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Screen.js +180 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollBehavior.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js +45 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js +30 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollRestoration.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Selection.js +569 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js +187 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js +30 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js +123 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js +72 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Storage.js +397 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StorageEvent.js +318 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StorageEventInit.js +99 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StyleSheetList.js +300 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SubmitEvent.js +144 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SubmitEventInit.js +36 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SupportedType.js +18 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Text.js +170 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TextTrackKind.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TouchEvent.js +222 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TouchEventInit.js +89 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TransitionEvent.js +170 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TransitionEventInit.js +65 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TreeWalker.js +255 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/UIEvent.js +235 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/UIEventInit.js +62 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ValidityState.js +249 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/VisibilityState.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/VoidFunction.js +26 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WebSocket.js +480 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WheelEvent.js +191 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WheelEventInit.js +71 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLDocument.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequest.js +663 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget.js +334 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType.js +14 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload.js +109 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLSerializer.js +132 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/utils.js +252 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/geometry/DOMRect-impl.js +39 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/geometry/DOMRectReadOnly-impl.js +72 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/agent-factory.js +13 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/binary-data.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/colors.js +245 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/create-element.js +329 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js +188 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/custom-elements.js +272 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/dates-and-times.js +270 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/details.js +15 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/events.js +24 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/focusing.js +104 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js +309 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/html-constructor.js +78 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js +266 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/internal-constants.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/is-window.js +18 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/iterable-weak-set.js +48 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/json.js +12 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/mutation-observers.js +198 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/namespaces.js +16 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/node.js +68 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/number-and-date-inputs.js +195 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/ordered-set.js +104 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/page-transition-event.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js +75 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/shadow-dom.js +285 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/strings.js +162 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/style-rules.js +319 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js +129 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/svg/basic-types.js +41 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/svg/render.js +46 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/system-colors.js +147 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/text.js +19 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/traversal.js +72 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js +65 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/hr-time/Performance-impl.js +22 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/interfaces.js +249 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl.js +95 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl.js +37 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/MimeType-impl.js +3 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl.js +21 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/Navigator-impl.js +29 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js +8 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js +7 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js +37 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js +7 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js +8 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/Plugin-impl.js +3 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/PluginArray-impl.js +23 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node-document-position.js +10 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node-type.js +16 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node.js +331 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/CDATASection-impl.js +16 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js +118 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ChildNode-impl.js +80 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Comment-impl.js +20 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js +120 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMStringMap-impl.js +64 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMTokenList-impl.js +171 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js +1014 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js +44 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js +28 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentType-impl.js +24 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js +608 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js +22 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js +7 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js +157 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js +50 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js +44 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js +17 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js +79 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js +136 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCollection-impl.js +96 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js +20 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js +35 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js +211 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js +8 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormControlsCollection-impl.js +33 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js +248 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js +266 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js +17 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js +366 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js +131 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js +1097 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js +94 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js +18 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js +107 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js +13 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js +138 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js +180 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js +22 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js +26 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js +146 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js +110 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js +88 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js +88 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js +72 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js +261 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js +283 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl.js +59 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js +8 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js +73 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js +73 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js +236 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js +88 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js +61 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js +67 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js +244 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js +18 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js +13 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js +17 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js +2 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js +1160 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NodeList-impl.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js +28 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js +11 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js +90 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js +22 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/RadioNodeList-impl.js +49 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGDefsElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGDescElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGElement-impl.js +64 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGGElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js +16 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGMetadataElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl.js +47 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSwitchElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSymbolElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGTests-impl.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js +41 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Slotable-impl.js +48 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Text-impl.js +96 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js +52 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js +4 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/AbstractRange-impl.js +43 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/Range-impl.js +897 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/StaticRange-impl.js +39 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/boundary-point.js +47 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/selection/Selection-impl.js +358 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedPreserveAspectRatio-impl.js +24 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedRect-impl.js +122 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl.js +42 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGListBase.js +195 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGNumber-impl.js +48 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGPreserveAspectRatio-impl.js +100 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGRect-impl.js +143 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGStringList-impl.js +16 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/NodeIterator-impl.js +107 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js +217 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/helpers.js +44 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/webidl/DOMException-impl.js +46 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js +328 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/webstorage/Storage-impl.js +102 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/BarProp-impl.js +10 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/External-impl.js +9 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/History-impl.js +148 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js +227 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/Screen-impl.js +13 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/SessionHistory.js +163 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/navigation.js +85 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window-properties.js +241 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/FormData-impl.js +191 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js +1005 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js +17 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js +4 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/multipart-form-data.js +105 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js +59 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js +410 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/utils.js +105 -0
- data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/virtual-console.js +46 -0
- data/lib/readability_js/node/node_modules/jsdom/package.json +93 -0
- data/lib/readability_js/node/node_modules/lru-cache/LICENSE +15 -0
- data/lib/readability_js/node/node_modules/lru-cache/README.md +338 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.d.ts +1322 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.js +1568 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.d.ts +1322 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.js +1564 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- data/lib/readability_js/node/node_modules/lru-cache/dist/esm/package.json +3 -0
- data/lib/readability_js/node/node_modules/lru-cache/package.json +113 -0
- data/lib/readability_js/node/node_modules/mdn-data/LICENSE +116 -0
- data/lib/readability_js/node/node_modules/mdn-data/README.md +59 -0
- data/lib/readability_js/node/node_modules/mdn-data/api/index.js +3 -0
- data/lib/readability_js/node/node_modules/mdn-data/api/inheritance.json +2681 -0
- data/lib/readability_js/node/node_modules/mdn-data/api/inheritance.schema.json +31 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/at-rules.json +504 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/at-rules.schema.json +131 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/definitions.json +80 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/functions.json +593 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/functions.schema.json +45 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/index.js +9 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/properties.json +10806 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/properties.schema.json +449 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/selectors.json +1071 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/selectors.schema.json +36 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/syntaxes.json +899 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/syntaxes.schema.json +15 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/types.json +287 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/types.schema.json +32 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/units.json +213 -0
- data/lib/readability_js/node/node_modules/mdn-data/css/units.schema.json +28 -0
- data/lib/readability_js/node/node_modules/mdn-data/index.js +5 -0
- data/lib/readability_js/node/node_modules/mdn-data/l10n/css.json +1876 -0
- data/lib/readability_js/node/node_modules/mdn-data/l10n/index.js +3 -0
- data/lib/readability_js/node/node_modules/mdn-data/package.json +38 -0
- data/lib/readability_js/node/node_modules/ms/index.js +162 -0
- data/lib/readability_js/node/node_modules/ms/license.md +21 -0
- data/lib/readability_js/node/node_modules/ms/package.json +38 -0
- data/lib/readability_js/node/node_modules/ms/readme.md +59 -0
- data/lib/readability_js/node/node_modules/parse5/LICENSE +19 -0
- data/lib/readability_js/node/node_modules/parse5/README.md +38 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/doctype.d.ts +4 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/doctype.js +114 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/error-codes.d.ts +67 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/error-codes.js +63 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/foreign-content.d.ts +9 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/foreign-content.js +228 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/html.d.ts +289 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/html.js +523 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/token.d.ts +84 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/token.js +20 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/unicode.d.ts +42 -0
- data/lib/readability_js/node/node_modules/parse5/dist/common/unicode.js +62 -0
- data/lib/readability_js/node/node_modules/parse5/dist/index.d.ts +71 -0
- data/lib/readability_js/node/node_modules/parse5/dist/index.js +42 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/formatting-element-list.d.ts +36 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/index.d.ts +221 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/index.js +3245 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/open-element-stack.d.ts +53 -0
- data/lib/readability_js/node/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
- data/lib/readability_js/node/node_modules/parse5/dist/serializer/index.d.ts +60 -0
- data/lib/readability_js/node/node_modules/parse5/dist/serializer/index.js +168 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/index.d.ts +247 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/index.js +2710 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +36 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/default.d.ts +84 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/default.js +173 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/interface.d.ts +255 -0
- data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
- data/lib/readability_js/node/node_modules/parse5/package.json +48 -0
- data/lib/readability_js/node/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/lib/readability_js/node/node_modules/punycode/README.md +148 -0
- data/lib/readability_js/node/node_modules/punycode/package.json +58 -0
- data/lib/readability_js/node/node_modules/punycode/punycode.es6.js +444 -0
- data/lib/readability_js/node/node_modules/punycode/punycode.js +443 -0
- data/lib/readability_js/node/node_modules/require-from-string/index.js +34 -0
- data/lib/readability_js/node/node_modules/require-from-string/license +21 -0
- data/lib/readability_js/node/node_modules/require-from-string/package.json +28 -0
- data/lib/readability_js/node/node_modules/require-from-string/readme.md +56 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/LICENSE.txt +20 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/README.mdown +74 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/build/CSSOM.js +1995 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSConditionRule.js +25 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSContainerRule.js +50 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSDocumentRule.js +39 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSFontFaceRule.js +36 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSGroupingRule.js +69 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSHostRule.js +37 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSImportRule.js +132 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSKeyframeRule.js +37 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSKeyframesRule.js +39 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSLayerBlockRule.js +48 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSMediaRule.js +53 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSOM.js +3 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSRule.js +42 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStartingStyleRule.js +37 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleDeclaration.js +148 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleRule.js +190 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleSheet.js +88 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSSupportsRule.js +36 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSValue.js +43 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSValueExpression.js +344 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/MatcherList.js +62 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/MediaList.js +61 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/StyleSheet.js +17 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/clone.js +80 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/index.js +26 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/lib/parse.js +525 -0
- data/lib/readability_js/node/node_modules/rrweb-cssom/package.json +27 -0
- data/lib/readability_js/node/node_modules/safer-buffer/LICENSE +21 -0
- data/lib/readability_js/node/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- data/lib/readability_js/node/node_modules/safer-buffer/Readme.md +156 -0
- data/lib/readability_js/node/node_modules/safer-buffer/dangerous.js +58 -0
- data/lib/readability_js/node/node_modules/safer-buffer/package.json +34 -0
- data/lib/readability_js/node/node_modules/safer-buffer/safer.js +77 -0
- data/lib/readability_js/node/node_modules/safer-buffer/tests.js +406 -0
- data/lib/readability_js/node/node_modules/saxes/README.md +323 -0
- data/lib/readability_js/node/node_modules/saxes/package.json +71 -0
- data/lib/readability_js/node/node_modules/saxes/saxes.d.ts +635 -0
- data/lib/readability_js/node/node_modules/saxes/saxes.js +2053 -0
- data/lib/readability_js/node/node_modules/saxes/saxes.js.map +1 -0
- data/lib/readability_js/node/node_modules/source-map-js/LICENSE +28 -0
- data/lib/readability_js/node/node_modules/source-map-js/README.md +765 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/array-set.js +121 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/base64.js +67 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/binary-search.js +111 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/mapping-list.js +79 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/quick-sort.js +132 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/source-node.js +413 -0
- data/lib/readability_js/node/node_modules/source-map-js/lib/util.js +594 -0
- data/lib/readability_js/node/node_modules/source-map-js/package.json +71 -0
- data/lib/readability_js/node/node_modules/source-map-js/source-map.d.ts +104 -0
- data/lib/readability_js/node/node_modules/source-map-js/source-map.js +8 -0
- data/lib/readability_js/node/node_modules/symbol-tree/LICENSE +21 -0
- data/lib/readability_js/node/node_modules/symbol-tree/README.md +545 -0
- data/lib/readability_js/node/node_modules/symbol-tree/lib/SymbolTree.js +838 -0
- data/lib/readability_js/node/node_modules/symbol-tree/lib/SymbolTreeNode.js +54 -0
- data/lib/readability_js/node/node_modules/symbol-tree/lib/TreeIterator.js +69 -0
- data/lib/readability_js/node/node_modules/symbol-tree/lib/TreePosition.js +11 -0
- data/lib/readability_js/node/node_modules/symbol-tree/package.json +47 -0
- data/lib/readability_js/node/node_modules/tldts/LICENSE +13 -0
- data/lib/readability_js/node/node_modules/tldts/README.md +327 -0
- data/lib/readability_js/node/node_modules/tldts/bin/cli.js +21 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/index.js +669 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/data/trie.js +14 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/data/trie.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/suffix-trie.js +67 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/index.js +33 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/src/data/trie.js +11 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/src/data/trie.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/src/suffix-trie.js +64 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/src/suffix-trie.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.cjs.min.js +2 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.cjs.min.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.esm.min.js +2 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.esm.min.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.umd.min.js +2 -0
- data/lib/readability_js/node/node_modules/tldts/dist/index.umd.min.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts/dist/types/index.d.ts +7 -0
- data/lib/readability_js/node/node_modules/tldts/dist/types/src/data/trie.d.ts +5 -0
- data/lib/readability_js/node/node_modules/tldts/dist/types/src/suffix-trie.d.ts +5 -0
- data/lib/readability_js/node/node_modules/tldts/index.ts +62 -0
- data/lib/readability_js/node/node_modules/tldts/package.json +91 -0
- data/lib/readability_js/node/node_modules/tldts/src/data/trie.ts +14 -0
- data/lib/readability_js/node/node_modules/tldts/src/suffix-trie.ts +110 -0
- data/lib/readability_js/node/node_modules/tldts-core/LICENSE +13 -0
- data/lib/readability_js/node/node_modules/tldts-core/README.md +3 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/index.js +564 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +15 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain.js +83 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +149 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/factory.js +107 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/factory.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-ip.js +72 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-valid.js +69 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +69 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +3 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/options.js +22 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/options.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/subdomain.js +14 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/index.js +4 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +12 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain.js +80 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/extract-hostname.js +146 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/factory.js +102 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/factory.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-ip.js +69 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-ip.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-valid.js +66 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-valid.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +66 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/interface.js +2 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/options.js +19 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/options.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/subdomain.js +11 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/subdomain.js.map +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/index.d.ts +4 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +6 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/domain.d.ts +5 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +5 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/factory.d.ts +28 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/is-ip.d.ts +6 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/is-valid.d.ts +15 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +2 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +9 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/options.d.ts +10 -0
- data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/subdomain.d.ts +4 -0
- data/lib/readability_js/node/node_modules/tldts-core/index.ts +10 -0
- data/lib/readability_js/node/node_modules/tldts-core/package.json +68 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/domain-without-suffix.ts +14 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/domain.ts +100 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/extract-hostname.ts +170 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/factory.ts +163 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/is-ip.ts +87 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/is-valid.ts +79 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/lookup/fast-path.ts +80 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/lookup/interface.ts +10 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/options.ts +39 -0
- data/lib/readability_js/node/node_modules/tldts-core/src/subdomain.ts +11 -0
- data/lib/readability_js/node/node_modules/tough-cookie/LICENSE +12 -0
- data/lib/readability_js/node/node_modules/tough-cookie/README.md +195 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.cjs +2313 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.cjs.map +1 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.d.cts +1879 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.d.ts +1879 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.js +2268 -0
- data/lib/readability_js/node/node_modules/tough-cookie/dist/index.js.map +1 -0
- data/lib/readability_js/node/node_modules/tough-cookie/node_modules/.bin/tldts +1 -0
- data/lib/readability_js/node/node_modules/tough-cookie/package.json +149 -0
- data/lib/readability_js/node/node_modules/tr46/LICENSE.md +21 -0
- data/lib/readability_js/node/node_modules/tr46/README.md +76 -0
- data/lib/readability_js/node/node_modules/tr46/index.js +344 -0
- data/lib/readability_js/node/node_modules/tr46/lib/mappingTable.json +1 -0
- data/lib/readability_js/node/node_modules/tr46/lib/regexes.js +29 -0
- data/lib/readability_js/node/node_modules/tr46/lib/statusMapping.js +9 -0
- data/lib/readability_js/node/node_modules/tr46/package.json +47 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/LICENSE.md +25 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/README.md +41 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/attributes.js +125 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/constants.js +44 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/serialize.js +365 -0
- data/lib/readability_js/node/node_modules/w3c-xmlserializer/package.json +32 -0
- data/lib/readability_js/node/node_modules/webidl-conversions/LICENSE.md +12 -0
- data/lib/readability_js/node/node_modules/webidl-conversions/README.md +99 -0
- data/lib/readability_js/node/node_modules/webidl-conversions/lib/index.js +462 -0
- data/lib/readability_js/node/node_modules/webidl-conversions/package.json +34 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/LICENSE.txt +7 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/README.md +50 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/lib/labels-to-names.json +217 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/lib/supported-names.json +38 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/lib/whatwg-encoding.js +60 -0
- data/lib/readability_js/node/node_modules/whatwg-encoding/package.json +32 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/LICENSE.txt +7 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/README.md +101 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/mime-type-parameters.js +70 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/mime-type.js +127 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/parser.js +105 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/serializer.js +25 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/utils.js +60 -0
- data/lib/readability_js/node/node_modules/whatwg-mimetype/package.json +45 -0
- data/lib/readability_js/node/node_modules/whatwg-url/LICENSE.txt +21 -0
- data/lib/readability_js/node/node_modules/whatwg-url/README.md +106 -0
- data/lib/readability_js/node/node_modules/whatwg-url/index.js +27 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/Function.js +42 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/URL-impl.js +233 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/URL.js +499 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/URLSearchParams-impl.js +135 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/URLSearchParams.js +505 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/encoding.js +16 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/infra.js +26 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/url-state-machine.js +1277 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/urlencoded.js +89 -0
- data/lib/readability_js/node/node_modules/whatwg-url/lib/utils.js +240 -0
- data/lib/readability_js/node/node_modules/whatwg-url/package.json +56 -0
- data/lib/readability_js/node/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
- data/lib/readability_js/node/node_modules/ws/LICENSE +20 -0
- data/lib/readability_js/node/node_modules/ws/README.md +548 -0
- data/lib/readability_js/node/node_modules/ws/browser.js +8 -0
- data/lib/readability_js/node/node_modules/ws/index.js +13 -0
- data/lib/readability_js/node/node_modules/ws/lib/buffer-util.js +131 -0
- data/lib/readability_js/node/node_modules/ws/lib/constants.js +18 -0
- data/lib/readability_js/node/node_modules/ws/lib/event-target.js +292 -0
- data/lib/readability_js/node/node_modules/ws/lib/extension.js +203 -0
- data/lib/readability_js/node/node_modules/ws/lib/limiter.js +55 -0
- data/lib/readability_js/node/node_modules/ws/lib/permessage-deflate.js +528 -0
- data/lib/readability_js/node/node_modules/ws/lib/receiver.js +706 -0
- data/lib/readability_js/node/node_modules/ws/lib/sender.js +602 -0
- data/lib/readability_js/node/node_modules/ws/lib/stream.js +161 -0
- data/lib/readability_js/node/node_modules/ws/lib/subprotocol.js +62 -0
- data/lib/readability_js/node/node_modules/ws/lib/validation.js +152 -0
- data/lib/readability_js/node/node_modules/ws/lib/websocket-server.js +550 -0
- data/lib/readability_js/node/node_modules/ws/lib/websocket.js +1388 -0
- data/lib/readability_js/node/node_modules/ws/package.json +69 -0
- data/lib/readability_js/node/node_modules/ws/wrapper.mjs +8 -0
- data/lib/readability_js/node/node_modules/xml-name-validator/LICENSE.txt +176 -0
- data/lib/readability_js/node/node_modules/xml-name-validator/README.md +35 -0
- data/lib/readability_js/node/node_modules/xml-name-validator/lib/xml-name-validator.js +9 -0
- data/lib/readability_js/node/node_modules/xml-name-validator/package.json +30 -0
- data/lib/readability_js/node/node_modules/xmlchars/LICENSE +18 -0
- data/lib/readability_js/node/node_modules/xmlchars/README.md +33 -0
- data/lib/readability_js/node/node_modules/xmlchars/package.json +51 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.d.ts +31 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.js +44 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.js.map +1 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.d.ts +51 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.js +105 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.js.map +1 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.d.ts +73 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.js +145 -0
- data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.js.map +1 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlchars.d.ts +170 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlchars.js +191 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlchars.js.map +1 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.d.ts +28 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.js +65 -0
- data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.js.map +1 -0
- data/lib/readability_js/node/package.json +9 -0
- data/lib/readability_js/node/readability-example.js +10 -0
- data/lib/readability_js/node/yarn.lock +315 -0
- data/lib/readability_js/nodo.rb +67 -0
- data/lib/readability_js/version.rb +3 -0
- data/lib/readability_js.rb +207 -0
- data/readability_js.gemspec +47 -0
- metadata +1775 -0
|
@@ -0,0 +1,2833 @@
|
|
|
1
|
+
import { NullObject, createCacheKey, getCache, CacheItem, setCache } from "./cache.js";
|
|
2
|
+
import { isString } from "./common.js";
|
|
3
|
+
import { resolveColor } from "./resolve.js";
|
|
4
|
+
import { roundToPrecision, splitValue, interpolateHue } from "./util.js";
|
|
5
|
+
import { NONE, VAL_MIX, VAL_COMP, VAL_SPEC, FN_COLOR, FN_MIX, FN_LIGHT_DARK, SYN_FN_COLOR, SYN_COLOR_TYPE, SYN_LCH, SYN_MOD, SYN_HSL, SYN_HSL_LV3, SYN_MIX, CS_RGB, CS_XYZ, CS_MIX, CS_HUE_CAPT, PCT, SYN_MIX_PART, SYN_MIX_CAPT, SYN_RGB_LV3, NUM, ANGLE } from "./constant.js";
|
|
6
|
+
const NAMESPACE = "color";
|
|
7
|
+
const PPTH = 1e-3;
|
|
8
|
+
const HALF = 0.5;
|
|
9
|
+
const DUO = 2;
|
|
10
|
+
const TRIA = 3;
|
|
11
|
+
const QUAD = 4;
|
|
12
|
+
const OCT = 8;
|
|
13
|
+
const DEC = 10;
|
|
14
|
+
const DOZ = 12;
|
|
15
|
+
const HEX = 16;
|
|
16
|
+
const SEXA = 60;
|
|
17
|
+
const DEG_HALF = 180;
|
|
18
|
+
const DEG = 360;
|
|
19
|
+
const MAX_PCT = 100;
|
|
20
|
+
const MAX_RGB = 255;
|
|
21
|
+
const POW_SQR = 2;
|
|
22
|
+
const POW_CUBE = 3;
|
|
23
|
+
const POW_LINEAR = 2.4;
|
|
24
|
+
const LINEAR_COEF = 12.92;
|
|
25
|
+
const LINEAR_OFFSET = 0.055;
|
|
26
|
+
const LAB_L = 116;
|
|
27
|
+
const LAB_A = 500;
|
|
28
|
+
const LAB_B = 200;
|
|
29
|
+
const LAB_EPSILON = 216 / 24389;
|
|
30
|
+
const LAB_KAPPA = 24389 / 27;
|
|
31
|
+
const D50 = [
|
|
32
|
+
0.3457 / 0.3585,
|
|
33
|
+
1,
|
|
34
|
+
(1 - 0.3457 - 0.3585) / 0.3585
|
|
35
|
+
];
|
|
36
|
+
const MATRIX_D50_TO_D65 = [
|
|
37
|
+
[0.955473421488075, -0.02309845494876471, 0.06325924320057072],
|
|
38
|
+
[-0.0283697093338637, 1.0099953980813041, 0.021041441191917323],
|
|
39
|
+
[0.012314014864481998, -0.020507649298898964, 1.330365926242124]
|
|
40
|
+
];
|
|
41
|
+
const MATRIX_D65_TO_D50 = [
|
|
42
|
+
[1.0479297925449969, 0.022946870601609652, -0.05019226628920524],
|
|
43
|
+
[0.02962780877005599, 0.9904344267538799, -0.017073799063418826],
|
|
44
|
+
[-0.009243040646204504, 0.015055191490298152, 0.7518742814281371]
|
|
45
|
+
];
|
|
46
|
+
const MATRIX_L_RGB_TO_XYZ = [
|
|
47
|
+
[506752 / 1228815, 87881 / 245763, 12673 / 70218],
|
|
48
|
+
[87098 / 409605, 175762 / 245763, 12673 / 175545],
|
|
49
|
+
[7918 / 409605, 87881 / 737289, 1001167 / 1053270]
|
|
50
|
+
];
|
|
51
|
+
const MATRIX_XYZ_TO_L_RGB = [
|
|
52
|
+
[12831 / 3959, -329 / 214, -1974 / 3959],
|
|
53
|
+
[-851781 / 878810, 1648619 / 878810, 36519 / 878810],
|
|
54
|
+
[705 / 12673, -2585 / 12673, 705 / 667]
|
|
55
|
+
];
|
|
56
|
+
const MATRIX_XYZ_TO_LMS = [
|
|
57
|
+
[0.819022437996703, 0.3619062600528904, -0.1288737815209879],
|
|
58
|
+
[0.0329836539323885, 0.9292868615863434, 0.0361446663506424],
|
|
59
|
+
[0.0481771893596242, 0.2642395317527308, 0.6335478284694309]
|
|
60
|
+
];
|
|
61
|
+
const MATRIX_LMS_TO_XYZ = [
|
|
62
|
+
[1.2268798758459243, -0.5578149944602171, 0.2813910456659647],
|
|
63
|
+
[-0.0405757452148008, 1.112286803280317, -0.0717110580655164],
|
|
64
|
+
[-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]
|
|
65
|
+
];
|
|
66
|
+
const MATRIX_OKLAB_TO_LMS = [
|
|
67
|
+
[1, 0.3963377773761749, 0.2158037573099136],
|
|
68
|
+
[1, -0.1055613458156586, -0.0638541728258133],
|
|
69
|
+
[1, -0.0894841775298119, -1.2914855480194092]
|
|
70
|
+
];
|
|
71
|
+
const MATRIX_LMS_TO_OKLAB = [
|
|
72
|
+
[0.210454268309314, 0.7936177747023054, -0.0040720430116193],
|
|
73
|
+
[1.9779985324311684, -2.42859224204858, 0.450593709617411],
|
|
74
|
+
[0.0259040424655478, 0.7827717124575296, -0.8086757549230774]
|
|
75
|
+
];
|
|
76
|
+
const MATRIX_P3_TO_XYZ = [
|
|
77
|
+
[608311 / 1250200, 189793 / 714400, 198249 / 1000160],
|
|
78
|
+
[35783 / 156275, 247089 / 357200, 198249 / 2500400],
|
|
79
|
+
[0 / 1, 32229 / 714400, 5220557 / 5000800]
|
|
80
|
+
];
|
|
81
|
+
const MATRIX_REC2020_TO_XYZ = [
|
|
82
|
+
[63426534 / 99577255, 20160776 / 139408157, 47086771 / 278816314],
|
|
83
|
+
[26158966 / 99577255, 472592308 / 697040785, 8267143 / 139408157],
|
|
84
|
+
[0 / 1, 19567812 / 697040785, 295819943 / 278816314]
|
|
85
|
+
];
|
|
86
|
+
const MATRIX_A98_TO_XYZ = [
|
|
87
|
+
[573536 / 994567, 263643 / 1420810, 187206 / 994567],
|
|
88
|
+
[591459 / 1989134, 6239551 / 9945670, 374412 / 4972835],
|
|
89
|
+
[53769 / 1989134, 351524 / 4972835, 4929758 / 4972835]
|
|
90
|
+
];
|
|
91
|
+
const MATRIX_PROPHOTO_TO_XYZ_D50 = [
|
|
92
|
+
[0.7977666449006423, 0.13518129740053308, 0.0313477341283922],
|
|
93
|
+
[0.2880748288194013, 0.711835234241873, 8993693872564e-17],
|
|
94
|
+
[0, 0, 0.8251046025104602]
|
|
95
|
+
];
|
|
96
|
+
const REG_COLOR = new RegExp(`^(?:${SYN_COLOR_TYPE})$`);
|
|
97
|
+
const REG_CS_HUE = new RegExp(`^${CS_HUE_CAPT}$`);
|
|
98
|
+
const REG_CS_XYZ = /^xyz(?:-d(?:50|65))?$/;
|
|
99
|
+
const REG_CURRENT = /^currentColor$/i;
|
|
100
|
+
const REG_FN_COLOR = new RegExp(`^color\\(\\s*(${SYN_FN_COLOR})\\s*\\)$`);
|
|
101
|
+
const REG_HSL = new RegExp(`^hsla?\\(\\s*(${SYN_HSL}|${SYN_HSL_LV3})\\s*\\)$`);
|
|
102
|
+
const REG_HWB = new RegExp(`^hwb\\(\\s*(${SYN_HSL})\\s*\\)$`);
|
|
103
|
+
const REG_LAB = new RegExp(`^lab\\(\\s*(${SYN_MOD})\\s*\\)$`);
|
|
104
|
+
const REG_LCH = new RegExp(`^lch\\(\\s*(${SYN_LCH})\\s*\\)$`);
|
|
105
|
+
const REG_MIX = new RegExp(`^${SYN_MIX}$`);
|
|
106
|
+
const REG_MIX_CAPT = new RegExp(`^${SYN_MIX_CAPT}$`);
|
|
107
|
+
const REG_MIX_NEST = new RegExp(`${SYN_MIX}`, "g");
|
|
108
|
+
const REG_OKLAB = new RegExp(`^oklab\\(\\s*(${SYN_MOD})\\s*\\)$`);
|
|
109
|
+
const REG_OKLCH = new RegExp(`^oklch\\(\\s*(${SYN_LCH})\\s*\\)$`);
|
|
110
|
+
const REG_SPEC = /^(?:specifi|comput)edValue$/;
|
|
111
|
+
const NAMED_COLORS = {
|
|
112
|
+
aliceblue: [240, 248, 255],
|
|
113
|
+
antiquewhite: [250, 235, 215],
|
|
114
|
+
aqua: [0, 255, 255],
|
|
115
|
+
aquamarine: [127, 255, 212],
|
|
116
|
+
azure: [240, 255, 255],
|
|
117
|
+
beige: [245, 245, 220],
|
|
118
|
+
bisque: [255, 228, 196],
|
|
119
|
+
black: [0, 0, 0],
|
|
120
|
+
blanchedalmond: [255, 235, 205],
|
|
121
|
+
blue: [0, 0, 255],
|
|
122
|
+
blueviolet: [138, 43, 226],
|
|
123
|
+
brown: [165, 42, 42],
|
|
124
|
+
burlywood: [222, 184, 135],
|
|
125
|
+
cadetblue: [95, 158, 160],
|
|
126
|
+
chartreuse: [127, 255, 0],
|
|
127
|
+
chocolate: [210, 105, 30],
|
|
128
|
+
coral: [255, 127, 80],
|
|
129
|
+
cornflowerblue: [100, 149, 237],
|
|
130
|
+
cornsilk: [255, 248, 220],
|
|
131
|
+
crimson: [220, 20, 60],
|
|
132
|
+
cyan: [0, 255, 255],
|
|
133
|
+
darkblue: [0, 0, 139],
|
|
134
|
+
darkcyan: [0, 139, 139],
|
|
135
|
+
darkgoldenrod: [184, 134, 11],
|
|
136
|
+
darkgray: [169, 169, 169],
|
|
137
|
+
darkgreen: [0, 100, 0],
|
|
138
|
+
darkgrey: [169, 169, 169],
|
|
139
|
+
darkkhaki: [189, 183, 107],
|
|
140
|
+
darkmagenta: [139, 0, 139],
|
|
141
|
+
darkolivegreen: [85, 107, 47],
|
|
142
|
+
darkorange: [255, 140, 0],
|
|
143
|
+
darkorchid: [153, 50, 204],
|
|
144
|
+
darkred: [139, 0, 0],
|
|
145
|
+
darksalmon: [233, 150, 122],
|
|
146
|
+
darkseagreen: [143, 188, 143],
|
|
147
|
+
darkslateblue: [72, 61, 139],
|
|
148
|
+
darkslategray: [47, 79, 79],
|
|
149
|
+
darkslategrey: [47, 79, 79],
|
|
150
|
+
darkturquoise: [0, 206, 209],
|
|
151
|
+
darkviolet: [148, 0, 211],
|
|
152
|
+
deeppink: [255, 20, 147],
|
|
153
|
+
deepskyblue: [0, 191, 255],
|
|
154
|
+
dimgray: [105, 105, 105],
|
|
155
|
+
dimgrey: [105, 105, 105],
|
|
156
|
+
dodgerblue: [30, 144, 255],
|
|
157
|
+
firebrick: [178, 34, 34],
|
|
158
|
+
floralwhite: [255, 250, 240],
|
|
159
|
+
forestgreen: [34, 139, 34],
|
|
160
|
+
fuchsia: [255, 0, 255],
|
|
161
|
+
gainsboro: [220, 220, 220],
|
|
162
|
+
ghostwhite: [248, 248, 255],
|
|
163
|
+
gold: [255, 215, 0],
|
|
164
|
+
goldenrod: [218, 165, 32],
|
|
165
|
+
gray: [128, 128, 128],
|
|
166
|
+
green: [0, 128, 0],
|
|
167
|
+
greenyellow: [173, 255, 47],
|
|
168
|
+
grey: [128, 128, 128],
|
|
169
|
+
honeydew: [240, 255, 240],
|
|
170
|
+
hotpink: [255, 105, 180],
|
|
171
|
+
indianred: [205, 92, 92],
|
|
172
|
+
indigo: [75, 0, 130],
|
|
173
|
+
ivory: [255, 255, 240],
|
|
174
|
+
khaki: [240, 230, 140],
|
|
175
|
+
lavender: [230, 230, 250],
|
|
176
|
+
lavenderblush: [255, 240, 245],
|
|
177
|
+
lawngreen: [124, 252, 0],
|
|
178
|
+
lemonchiffon: [255, 250, 205],
|
|
179
|
+
lightblue: [173, 216, 230],
|
|
180
|
+
lightcoral: [240, 128, 128],
|
|
181
|
+
lightcyan: [224, 255, 255],
|
|
182
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
183
|
+
lightgray: [211, 211, 211],
|
|
184
|
+
lightgreen: [144, 238, 144],
|
|
185
|
+
lightgrey: [211, 211, 211],
|
|
186
|
+
lightpink: [255, 182, 193],
|
|
187
|
+
lightsalmon: [255, 160, 122],
|
|
188
|
+
lightseagreen: [32, 178, 170],
|
|
189
|
+
lightskyblue: [135, 206, 250],
|
|
190
|
+
lightslategray: [119, 136, 153],
|
|
191
|
+
lightslategrey: [119, 136, 153],
|
|
192
|
+
lightsteelblue: [176, 196, 222],
|
|
193
|
+
lightyellow: [255, 255, 224],
|
|
194
|
+
lime: [0, 255, 0],
|
|
195
|
+
limegreen: [50, 205, 50],
|
|
196
|
+
linen: [250, 240, 230],
|
|
197
|
+
magenta: [255, 0, 255],
|
|
198
|
+
maroon: [128, 0, 0],
|
|
199
|
+
mediumaquamarine: [102, 205, 170],
|
|
200
|
+
mediumblue: [0, 0, 205],
|
|
201
|
+
mediumorchid: [186, 85, 211],
|
|
202
|
+
mediumpurple: [147, 112, 219],
|
|
203
|
+
mediumseagreen: [60, 179, 113],
|
|
204
|
+
mediumslateblue: [123, 104, 238],
|
|
205
|
+
mediumspringgreen: [0, 250, 154],
|
|
206
|
+
mediumturquoise: [72, 209, 204],
|
|
207
|
+
mediumvioletred: [199, 21, 133],
|
|
208
|
+
midnightblue: [25, 25, 112],
|
|
209
|
+
mintcream: [245, 255, 250],
|
|
210
|
+
mistyrose: [255, 228, 225],
|
|
211
|
+
moccasin: [255, 228, 181],
|
|
212
|
+
navajowhite: [255, 222, 173],
|
|
213
|
+
navy: [0, 0, 128],
|
|
214
|
+
oldlace: [253, 245, 230],
|
|
215
|
+
olive: [128, 128, 0],
|
|
216
|
+
olivedrab: [107, 142, 35],
|
|
217
|
+
orange: [255, 165, 0],
|
|
218
|
+
orangered: [255, 69, 0],
|
|
219
|
+
orchid: [218, 112, 214],
|
|
220
|
+
palegoldenrod: [238, 232, 170],
|
|
221
|
+
palegreen: [152, 251, 152],
|
|
222
|
+
paleturquoise: [175, 238, 238],
|
|
223
|
+
palevioletred: [219, 112, 147],
|
|
224
|
+
papayawhip: [255, 239, 213],
|
|
225
|
+
peachpuff: [255, 218, 185],
|
|
226
|
+
peru: [205, 133, 63],
|
|
227
|
+
pink: [255, 192, 203],
|
|
228
|
+
plum: [221, 160, 221],
|
|
229
|
+
powderblue: [176, 224, 230],
|
|
230
|
+
purple: [128, 0, 128],
|
|
231
|
+
rebeccapurple: [102, 51, 153],
|
|
232
|
+
red: [255, 0, 0],
|
|
233
|
+
rosybrown: [188, 143, 143],
|
|
234
|
+
royalblue: [65, 105, 225],
|
|
235
|
+
saddlebrown: [139, 69, 19],
|
|
236
|
+
salmon: [250, 128, 114],
|
|
237
|
+
sandybrown: [244, 164, 96],
|
|
238
|
+
seagreen: [46, 139, 87],
|
|
239
|
+
seashell: [255, 245, 238],
|
|
240
|
+
sienna: [160, 82, 45],
|
|
241
|
+
silver: [192, 192, 192],
|
|
242
|
+
skyblue: [135, 206, 235],
|
|
243
|
+
slateblue: [106, 90, 205],
|
|
244
|
+
slategray: [112, 128, 144],
|
|
245
|
+
slategrey: [112, 128, 144],
|
|
246
|
+
snow: [255, 250, 250],
|
|
247
|
+
springgreen: [0, 255, 127],
|
|
248
|
+
steelblue: [70, 130, 180],
|
|
249
|
+
tan: [210, 180, 140],
|
|
250
|
+
teal: [0, 128, 128],
|
|
251
|
+
thistle: [216, 191, 216],
|
|
252
|
+
tomato: [255, 99, 71],
|
|
253
|
+
turquoise: [64, 224, 208],
|
|
254
|
+
violet: [238, 130, 238],
|
|
255
|
+
wheat: [245, 222, 179],
|
|
256
|
+
white: [255, 255, 255],
|
|
257
|
+
whitesmoke: [245, 245, 245],
|
|
258
|
+
yellow: [255, 255, 0],
|
|
259
|
+
yellowgreen: [154, 205, 50]
|
|
260
|
+
};
|
|
261
|
+
const cacheInvalidColorValue = (cacheKey, format, nullable = false) => {
|
|
262
|
+
if (format === VAL_SPEC) {
|
|
263
|
+
const res2 = "";
|
|
264
|
+
setCache(cacheKey, res2);
|
|
265
|
+
return res2;
|
|
266
|
+
}
|
|
267
|
+
if (nullable) {
|
|
268
|
+
setCache(cacheKey, null);
|
|
269
|
+
return new NullObject();
|
|
270
|
+
}
|
|
271
|
+
const res = ["rgb", 0, 0, 0, 0];
|
|
272
|
+
setCache(cacheKey, res);
|
|
273
|
+
return res;
|
|
274
|
+
};
|
|
275
|
+
const resolveInvalidColorValue = (format, nullable = false) => {
|
|
276
|
+
switch (format) {
|
|
277
|
+
case "hsl":
|
|
278
|
+
case "hwb":
|
|
279
|
+
case VAL_MIX: {
|
|
280
|
+
return new NullObject();
|
|
281
|
+
}
|
|
282
|
+
case VAL_SPEC: {
|
|
283
|
+
return "";
|
|
284
|
+
}
|
|
285
|
+
default: {
|
|
286
|
+
if (nullable) {
|
|
287
|
+
return new NullObject();
|
|
288
|
+
}
|
|
289
|
+
return ["rgb", 0, 0, 0, 0];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const validateColorComponents = (arr, opt = {}) => {
|
|
294
|
+
if (!Array.isArray(arr)) {
|
|
295
|
+
throw new TypeError(`${arr} is not an array.`);
|
|
296
|
+
}
|
|
297
|
+
const {
|
|
298
|
+
alpha = false,
|
|
299
|
+
minLength = TRIA,
|
|
300
|
+
maxLength = QUAD,
|
|
301
|
+
minRange = 0,
|
|
302
|
+
maxRange = 1,
|
|
303
|
+
validateRange = true
|
|
304
|
+
} = opt;
|
|
305
|
+
if (!Number.isFinite(minLength)) {
|
|
306
|
+
throw new TypeError(`${minLength} is not a number.`);
|
|
307
|
+
}
|
|
308
|
+
if (!Number.isFinite(maxLength)) {
|
|
309
|
+
throw new TypeError(`${maxLength} is not a number.`);
|
|
310
|
+
}
|
|
311
|
+
if (!Number.isFinite(minRange)) {
|
|
312
|
+
throw new TypeError(`${minRange} is not a number.`);
|
|
313
|
+
}
|
|
314
|
+
if (!Number.isFinite(maxRange)) {
|
|
315
|
+
throw new TypeError(`${maxRange} is not a number.`);
|
|
316
|
+
}
|
|
317
|
+
const l = arr.length;
|
|
318
|
+
if (l < minLength || l > maxLength) {
|
|
319
|
+
throw new Error(`Unexpected array length ${l}.`);
|
|
320
|
+
}
|
|
321
|
+
let i = 0;
|
|
322
|
+
while (i < l) {
|
|
323
|
+
const v = arr[i];
|
|
324
|
+
if (!Number.isFinite(v)) {
|
|
325
|
+
throw new TypeError(`${v} is not a number.`);
|
|
326
|
+
} else if (i < TRIA && validateRange && (v < minRange || v > maxRange)) {
|
|
327
|
+
throw new RangeError(`${v} is not between ${minRange} and ${maxRange}.`);
|
|
328
|
+
} else if (i === TRIA && (v < 0 || v > 1)) {
|
|
329
|
+
throw new RangeError(`${v} is not between 0 and 1.`);
|
|
330
|
+
}
|
|
331
|
+
i++;
|
|
332
|
+
}
|
|
333
|
+
if (alpha && l === TRIA) {
|
|
334
|
+
arr.push(1);
|
|
335
|
+
}
|
|
336
|
+
return arr;
|
|
337
|
+
};
|
|
338
|
+
const transformMatrix = (mtx, vct, skip = false) => {
|
|
339
|
+
if (!Array.isArray(mtx)) {
|
|
340
|
+
throw new TypeError(`${mtx} is not an array.`);
|
|
341
|
+
} else if (mtx.length !== TRIA) {
|
|
342
|
+
throw new Error(`Unexpected array length ${mtx.length}.`);
|
|
343
|
+
} else if (!skip) {
|
|
344
|
+
for (let i of mtx) {
|
|
345
|
+
i = validateColorComponents(i, {
|
|
346
|
+
maxLength: TRIA,
|
|
347
|
+
validateRange: false
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const [[r1c1, r1c2, r1c3], [r2c1, r2c2, r2c3], [r3c1, r3c2, r3c3]] = mtx;
|
|
352
|
+
let v1, v2, v3;
|
|
353
|
+
if (skip) {
|
|
354
|
+
[v1, v2, v3] = vct;
|
|
355
|
+
} else {
|
|
356
|
+
[v1, v2, v3] = validateColorComponents(vct, {
|
|
357
|
+
maxLength: TRIA,
|
|
358
|
+
validateRange: false
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
const p1 = r1c1 * v1 + r1c2 * v2 + r1c3 * v3;
|
|
362
|
+
const p2 = r2c1 * v1 + r2c2 * v2 + r2c3 * v3;
|
|
363
|
+
const p3 = r3c1 * v1 + r3c2 * v2 + r3c3 * v3;
|
|
364
|
+
return [p1, p2, p3];
|
|
365
|
+
};
|
|
366
|
+
const normalizeColorComponents = (colorA, colorB, skip = false) => {
|
|
367
|
+
if (!Array.isArray(colorA)) {
|
|
368
|
+
throw new TypeError(`${colorA} is not an array.`);
|
|
369
|
+
} else if (colorA.length !== QUAD) {
|
|
370
|
+
throw new Error(`Unexpected array length ${colorA.length}.`);
|
|
371
|
+
}
|
|
372
|
+
if (!Array.isArray(colorB)) {
|
|
373
|
+
throw new TypeError(`${colorB} is not an array.`);
|
|
374
|
+
} else if (colorB.length !== QUAD) {
|
|
375
|
+
throw new Error(`Unexpected array length ${colorB.length}.`);
|
|
376
|
+
}
|
|
377
|
+
let i = 0;
|
|
378
|
+
while (i < QUAD) {
|
|
379
|
+
if (colorA[i] === NONE && colorB[i] === NONE) {
|
|
380
|
+
colorA[i] = 0;
|
|
381
|
+
colorB[i] = 0;
|
|
382
|
+
} else if (colorA[i] === NONE) {
|
|
383
|
+
colorA[i] = colorB[i];
|
|
384
|
+
} else if (colorB[i] === NONE) {
|
|
385
|
+
colorB[i] = colorA[i];
|
|
386
|
+
}
|
|
387
|
+
i++;
|
|
388
|
+
}
|
|
389
|
+
if (skip) {
|
|
390
|
+
return [colorA, colorB];
|
|
391
|
+
}
|
|
392
|
+
const validatedColorA = validateColorComponents(colorA, {
|
|
393
|
+
minLength: QUAD,
|
|
394
|
+
validateRange: false
|
|
395
|
+
});
|
|
396
|
+
const validatedColorB = validateColorComponents(colorB, {
|
|
397
|
+
minLength: QUAD,
|
|
398
|
+
validateRange: false
|
|
399
|
+
});
|
|
400
|
+
return [validatedColorA, validatedColorB];
|
|
401
|
+
};
|
|
402
|
+
const numberToHexString = (value) => {
|
|
403
|
+
if (!Number.isFinite(value)) {
|
|
404
|
+
throw new TypeError(`${value} is not a number.`);
|
|
405
|
+
} else {
|
|
406
|
+
value = Math.round(value);
|
|
407
|
+
if (value < 0 || value > MAX_RGB) {
|
|
408
|
+
throw new RangeError(`${value} is not between 0 and ${MAX_RGB}.`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
let hex = value.toString(HEX);
|
|
412
|
+
if (hex.length === 1) {
|
|
413
|
+
hex = `0${hex}`;
|
|
414
|
+
}
|
|
415
|
+
return hex;
|
|
416
|
+
};
|
|
417
|
+
const angleToDeg = (angle) => {
|
|
418
|
+
if (isString(angle)) {
|
|
419
|
+
angle = angle.trim();
|
|
420
|
+
} else {
|
|
421
|
+
throw new TypeError(`${angle} is not a string.`);
|
|
422
|
+
}
|
|
423
|
+
const GRAD = DEG / 400;
|
|
424
|
+
const RAD = DEG / (Math.PI * DUO);
|
|
425
|
+
const reg = new RegExp(`^(${NUM})(${ANGLE})?$`);
|
|
426
|
+
if (!reg.test(angle)) {
|
|
427
|
+
throw new SyntaxError(`Invalid property value: ${angle}`);
|
|
428
|
+
}
|
|
429
|
+
const [, value, unit] = angle.match(reg);
|
|
430
|
+
let deg;
|
|
431
|
+
switch (unit) {
|
|
432
|
+
case "grad":
|
|
433
|
+
deg = parseFloat(value) * GRAD;
|
|
434
|
+
break;
|
|
435
|
+
case "rad":
|
|
436
|
+
deg = parseFloat(value) * RAD;
|
|
437
|
+
break;
|
|
438
|
+
case "turn":
|
|
439
|
+
deg = parseFloat(value) * DEG;
|
|
440
|
+
break;
|
|
441
|
+
default:
|
|
442
|
+
deg = parseFloat(value);
|
|
443
|
+
}
|
|
444
|
+
deg %= DEG;
|
|
445
|
+
if (deg < 0) {
|
|
446
|
+
deg += DEG;
|
|
447
|
+
} else if (Object.is(deg, -0)) {
|
|
448
|
+
deg = 0;
|
|
449
|
+
}
|
|
450
|
+
return deg;
|
|
451
|
+
};
|
|
452
|
+
const parseAlpha = (alpha = "") => {
|
|
453
|
+
if (isString(alpha)) {
|
|
454
|
+
alpha = alpha.trim();
|
|
455
|
+
if (!alpha) {
|
|
456
|
+
alpha = "1";
|
|
457
|
+
} else if (alpha === NONE) {
|
|
458
|
+
alpha = "0";
|
|
459
|
+
} else {
|
|
460
|
+
let a;
|
|
461
|
+
if (alpha.endsWith("%")) {
|
|
462
|
+
a = parseFloat(alpha) / MAX_PCT;
|
|
463
|
+
} else {
|
|
464
|
+
a = parseFloat(alpha);
|
|
465
|
+
}
|
|
466
|
+
if (!Number.isFinite(a)) {
|
|
467
|
+
throw new TypeError(`${a} is not a finite number.`);
|
|
468
|
+
}
|
|
469
|
+
if (a < PPTH) {
|
|
470
|
+
alpha = "0";
|
|
471
|
+
} else if (a > 1) {
|
|
472
|
+
alpha = "1";
|
|
473
|
+
} else {
|
|
474
|
+
alpha = a.toFixed(TRIA);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
} else {
|
|
478
|
+
alpha = "1";
|
|
479
|
+
}
|
|
480
|
+
return parseFloat(alpha);
|
|
481
|
+
};
|
|
482
|
+
const parseHexAlpha = (value) => {
|
|
483
|
+
if (isString(value)) {
|
|
484
|
+
if (value === "") {
|
|
485
|
+
throw new SyntaxError("Invalid property value: (empty string)");
|
|
486
|
+
}
|
|
487
|
+
value = value.trim();
|
|
488
|
+
} else {
|
|
489
|
+
throw new TypeError(`${value} is not a string.`);
|
|
490
|
+
}
|
|
491
|
+
let alpha = parseInt(value, HEX);
|
|
492
|
+
if (alpha <= 0) {
|
|
493
|
+
return 0;
|
|
494
|
+
}
|
|
495
|
+
if (alpha >= MAX_RGB) {
|
|
496
|
+
return 1;
|
|
497
|
+
}
|
|
498
|
+
const alphaMap = /* @__PURE__ */ new Map();
|
|
499
|
+
for (let i = 1; i < MAX_PCT; i++) {
|
|
500
|
+
alphaMap.set(Math.round(i * MAX_RGB / MAX_PCT), i);
|
|
501
|
+
}
|
|
502
|
+
if (alphaMap.has(alpha)) {
|
|
503
|
+
alpha = alphaMap.get(alpha) / MAX_PCT;
|
|
504
|
+
} else {
|
|
505
|
+
alpha = Math.round(alpha / MAX_RGB / PPTH) * PPTH;
|
|
506
|
+
}
|
|
507
|
+
return parseFloat(alpha.toFixed(TRIA));
|
|
508
|
+
};
|
|
509
|
+
const transformRgbToLinearRgb = (rgb, skip = false) => {
|
|
510
|
+
let rr, gg, bb;
|
|
511
|
+
if (skip) {
|
|
512
|
+
[rr, gg, bb] = rgb;
|
|
513
|
+
} else {
|
|
514
|
+
[rr, gg, bb] = validateColorComponents(rgb, {
|
|
515
|
+
maxLength: TRIA,
|
|
516
|
+
maxRange: MAX_RGB
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
let r = rr / MAX_RGB;
|
|
520
|
+
let g = gg / MAX_RGB;
|
|
521
|
+
let b = bb / MAX_RGB;
|
|
522
|
+
const COND_POW = 0.04045;
|
|
523
|
+
if (r > COND_POW) {
|
|
524
|
+
r = Math.pow((r + LINEAR_OFFSET) / (1 + LINEAR_OFFSET), POW_LINEAR);
|
|
525
|
+
} else {
|
|
526
|
+
r /= LINEAR_COEF;
|
|
527
|
+
}
|
|
528
|
+
if (g > COND_POW) {
|
|
529
|
+
g = Math.pow((g + LINEAR_OFFSET) / (1 + LINEAR_OFFSET), POW_LINEAR);
|
|
530
|
+
} else {
|
|
531
|
+
g /= LINEAR_COEF;
|
|
532
|
+
}
|
|
533
|
+
if (b > COND_POW) {
|
|
534
|
+
b = Math.pow((b + LINEAR_OFFSET) / (1 + LINEAR_OFFSET), POW_LINEAR);
|
|
535
|
+
} else {
|
|
536
|
+
b /= LINEAR_COEF;
|
|
537
|
+
}
|
|
538
|
+
return [r, g, b];
|
|
539
|
+
};
|
|
540
|
+
const transformRgbToXyz = (rgb, skip = false) => {
|
|
541
|
+
if (!skip) {
|
|
542
|
+
rgb = validateColorComponents(rgb, {
|
|
543
|
+
maxLength: TRIA,
|
|
544
|
+
maxRange: MAX_RGB
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
rgb = transformRgbToLinearRgb(rgb, true);
|
|
548
|
+
const xyz = transformMatrix(MATRIX_L_RGB_TO_XYZ, rgb, true);
|
|
549
|
+
return xyz;
|
|
550
|
+
};
|
|
551
|
+
const transformLinearRgbToRgb = (rgb, round = false) => {
|
|
552
|
+
let [r, g, b] = validateColorComponents(rgb, {
|
|
553
|
+
maxLength: TRIA
|
|
554
|
+
});
|
|
555
|
+
const COND_POW = 809 / 258400;
|
|
556
|
+
if (r > COND_POW) {
|
|
557
|
+
r = Math.pow(r, 1 / POW_LINEAR) * (1 + LINEAR_OFFSET) - LINEAR_OFFSET;
|
|
558
|
+
} else {
|
|
559
|
+
r *= LINEAR_COEF;
|
|
560
|
+
}
|
|
561
|
+
r *= MAX_RGB;
|
|
562
|
+
if (g > COND_POW) {
|
|
563
|
+
g = Math.pow(g, 1 / POW_LINEAR) * (1 + LINEAR_OFFSET) - LINEAR_OFFSET;
|
|
564
|
+
} else {
|
|
565
|
+
g *= LINEAR_COEF;
|
|
566
|
+
}
|
|
567
|
+
g *= MAX_RGB;
|
|
568
|
+
if (b > COND_POW) {
|
|
569
|
+
b = Math.pow(b, 1 / POW_LINEAR) * (1 + LINEAR_OFFSET) - LINEAR_OFFSET;
|
|
570
|
+
} else {
|
|
571
|
+
b *= LINEAR_COEF;
|
|
572
|
+
}
|
|
573
|
+
b *= MAX_RGB;
|
|
574
|
+
return [
|
|
575
|
+
round ? Math.round(r) : r,
|
|
576
|
+
round ? Math.round(g) : g,
|
|
577
|
+
round ? Math.round(b) : b
|
|
578
|
+
];
|
|
579
|
+
};
|
|
580
|
+
const transformXyzToRgb = (xyz, skip = false) => {
|
|
581
|
+
if (!skip) {
|
|
582
|
+
xyz = validateColorComponents(xyz, {
|
|
583
|
+
maxLength: TRIA,
|
|
584
|
+
validateRange: false
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
let [r, g, b] = transformMatrix(MATRIX_XYZ_TO_L_RGB, xyz, true);
|
|
588
|
+
[r, g, b] = transformLinearRgbToRgb(
|
|
589
|
+
[
|
|
590
|
+
Math.min(Math.max(r, 0), 1),
|
|
591
|
+
Math.min(Math.max(g, 0), 1),
|
|
592
|
+
Math.min(Math.max(b, 0), 1)
|
|
593
|
+
],
|
|
594
|
+
true
|
|
595
|
+
);
|
|
596
|
+
return [r, g, b];
|
|
597
|
+
};
|
|
598
|
+
const transformXyzToHsl = (xyz, skip = false) => {
|
|
599
|
+
const [rr, gg, bb] = transformXyzToRgb(xyz, skip);
|
|
600
|
+
const r = rr / MAX_RGB;
|
|
601
|
+
const g = gg / MAX_RGB;
|
|
602
|
+
const b = bb / MAX_RGB;
|
|
603
|
+
const max = Math.max(r, g, b);
|
|
604
|
+
const min = Math.min(r, g, b);
|
|
605
|
+
const d = max - min;
|
|
606
|
+
const l = (max + min) * HALF * MAX_PCT;
|
|
607
|
+
let h, s;
|
|
608
|
+
if (Math.round(l) === 0 || Math.round(l) === MAX_PCT) {
|
|
609
|
+
h = 0;
|
|
610
|
+
s = 0;
|
|
611
|
+
} else {
|
|
612
|
+
s = d / (1 - Math.abs(max + min - 1)) * MAX_PCT;
|
|
613
|
+
if (s === 0) {
|
|
614
|
+
h = 0;
|
|
615
|
+
} else {
|
|
616
|
+
switch (max) {
|
|
617
|
+
case r:
|
|
618
|
+
h = (g - b) / d;
|
|
619
|
+
break;
|
|
620
|
+
case g:
|
|
621
|
+
h = (b - r) / d + DUO;
|
|
622
|
+
break;
|
|
623
|
+
case b:
|
|
624
|
+
default:
|
|
625
|
+
h = (r - g) / d + QUAD;
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
h = h * SEXA % DEG;
|
|
629
|
+
if (h < 0) {
|
|
630
|
+
h += DEG;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return [h, s, l];
|
|
635
|
+
};
|
|
636
|
+
const transformXyzToHwb = (xyz, skip = false) => {
|
|
637
|
+
const [r, g, b] = transformXyzToRgb(xyz, skip);
|
|
638
|
+
const wh = Math.min(r, g, b) / MAX_RGB;
|
|
639
|
+
const bk = 1 - Math.max(r, g, b) / MAX_RGB;
|
|
640
|
+
let h;
|
|
641
|
+
if (wh + bk === 1) {
|
|
642
|
+
h = 0;
|
|
643
|
+
} else {
|
|
644
|
+
[h] = transformXyzToHsl(xyz);
|
|
645
|
+
}
|
|
646
|
+
return [h, wh * MAX_PCT, bk * MAX_PCT];
|
|
647
|
+
};
|
|
648
|
+
const transformXyzToOklab = (xyz, skip = false) => {
|
|
649
|
+
if (!skip) {
|
|
650
|
+
xyz = validateColorComponents(xyz, {
|
|
651
|
+
maxLength: TRIA,
|
|
652
|
+
validateRange: false
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
const lms = transformMatrix(MATRIX_XYZ_TO_LMS, xyz, true);
|
|
656
|
+
const xyzLms = lms.map((c) => Math.cbrt(c));
|
|
657
|
+
let [l, a, b] = transformMatrix(MATRIX_LMS_TO_OKLAB, xyzLms, true);
|
|
658
|
+
l = Math.min(Math.max(l, 0), 1);
|
|
659
|
+
const lPct = Math.round(parseFloat(l.toFixed(QUAD)) * MAX_PCT);
|
|
660
|
+
if (lPct === 0 || lPct === MAX_PCT) {
|
|
661
|
+
a = 0;
|
|
662
|
+
b = 0;
|
|
663
|
+
}
|
|
664
|
+
return [l, a, b];
|
|
665
|
+
};
|
|
666
|
+
const transformXyzToOklch = (xyz, skip = false) => {
|
|
667
|
+
const [l, a, b] = transformXyzToOklab(xyz, skip);
|
|
668
|
+
let c, h;
|
|
669
|
+
const lPct = Math.round(parseFloat(l.toFixed(QUAD)) * MAX_PCT);
|
|
670
|
+
if (lPct === 0 || lPct === MAX_PCT) {
|
|
671
|
+
c = 0;
|
|
672
|
+
h = 0;
|
|
673
|
+
} else {
|
|
674
|
+
c = Math.max(Math.sqrt(Math.pow(a, POW_SQR) + Math.pow(b, POW_SQR)), 0);
|
|
675
|
+
if (parseFloat(c.toFixed(QUAD)) === 0) {
|
|
676
|
+
h = 0;
|
|
677
|
+
} else {
|
|
678
|
+
h = Math.atan2(b, a) * DEG_HALF / Math.PI;
|
|
679
|
+
if (h < 0) {
|
|
680
|
+
h += DEG;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
return [l, c, h];
|
|
685
|
+
};
|
|
686
|
+
const transformXyzD50ToRgb = (xyz, skip = false) => {
|
|
687
|
+
if (!skip) {
|
|
688
|
+
xyz = validateColorComponents(xyz, {
|
|
689
|
+
maxLength: TRIA,
|
|
690
|
+
validateRange: false
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
const xyzD65 = transformMatrix(MATRIX_D50_TO_D65, xyz, true);
|
|
694
|
+
const rgb = transformXyzToRgb(xyzD65, true);
|
|
695
|
+
return rgb;
|
|
696
|
+
};
|
|
697
|
+
const transformXyzD50ToLab = (xyz, skip = false) => {
|
|
698
|
+
if (!skip) {
|
|
699
|
+
xyz = validateColorComponents(xyz, {
|
|
700
|
+
maxLength: TRIA,
|
|
701
|
+
validateRange: false
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
const xyzD50 = xyz.map((val, i) => val / D50[i]);
|
|
705
|
+
const [f0, f1, f2] = xyzD50.map(
|
|
706
|
+
(val) => val > LAB_EPSILON ? Math.cbrt(val) : (val * LAB_KAPPA + HEX) / LAB_L
|
|
707
|
+
);
|
|
708
|
+
const l = Math.min(Math.max(LAB_L * f1 - HEX, 0), MAX_PCT);
|
|
709
|
+
let a, b;
|
|
710
|
+
if (l === 0 || l === MAX_PCT) {
|
|
711
|
+
a = 0;
|
|
712
|
+
b = 0;
|
|
713
|
+
} else {
|
|
714
|
+
a = (f0 - f1) * LAB_A;
|
|
715
|
+
b = (f1 - f2) * LAB_B;
|
|
716
|
+
}
|
|
717
|
+
return [l, a, b];
|
|
718
|
+
};
|
|
719
|
+
const transformXyzD50ToLch = (xyz, skip = false) => {
|
|
720
|
+
const [l, a, b] = transformXyzD50ToLab(xyz, skip);
|
|
721
|
+
let c, h;
|
|
722
|
+
if (l === 0 || l === MAX_PCT) {
|
|
723
|
+
c = 0;
|
|
724
|
+
h = 0;
|
|
725
|
+
} else {
|
|
726
|
+
c = Math.max(Math.sqrt(Math.pow(a, POW_SQR) + Math.pow(b, POW_SQR)), 0);
|
|
727
|
+
h = Math.atan2(b, a) * DEG_HALF / Math.PI;
|
|
728
|
+
if (h < 0) {
|
|
729
|
+
h += DEG;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return [l, c, h];
|
|
733
|
+
};
|
|
734
|
+
const convertRgbToHex = (rgb) => {
|
|
735
|
+
const [r, g, b, alpha] = validateColorComponents(rgb, {
|
|
736
|
+
alpha: true,
|
|
737
|
+
maxRange: MAX_RGB
|
|
738
|
+
});
|
|
739
|
+
const rr = numberToHexString(r);
|
|
740
|
+
const gg = numberToHexString(g);
|
|
741
|
+
const bb = numberToHexString(b);
|
|
742
|
+
const aa = numberToHexString(alpha * MAX_RGB);
|
|
743
|
+
let hex;
|
|
744
|
+
if (aa === "ff") {
|
|
745
|
+
hex = `#${rr}${gg}${bb}`;
|
|
746
|
+
} else {
|
|
747
|
+
hex = `#${rr}${gg}${bb}${aa}`;
|
|
748
|
+
}
|
|
749
|
+
return hex;
|
|
750
|
+
};
|
|
751
|
+
const convertHexToRgb = (value) => {
|
|
752
|
+
if (isString(value)) {
|
|
753
|
+
value = value.toLowerCase().trim();
|
|
754
|
+
} else {
|
|
755
|
+
throw new TypeError(`${value} is not a string.`);
|
|
756
|
+
}
|
|
757
|
+
if (!(/^#[\da-f]{6}$/.test(value) || /^#[\da-f]{3}$/.test(value) || /^#[\da-f]{8}$/.test(value) || /^#[\da-f]{4}$/.test(value))) {
|
|
758
|
+
throw new SyntaxError(`Invalid property value: ${value}`);
|
|
759
|
+
}
|
|
760
|
+
const arr = [];
|
|
761
|
+
if (/^#[\da-f]{3}$/.test(value)) {
|
|
762
|
+
const [, r, g, b] = value.match(
|
|
763
|
+
/^#([\da-f])([\da-f])([\da-f])$/
|
|
764
|
+
);
|
|
765
|
+
arr.push(
|
|
766
|
+
parseInt(`${r}${r}`, HEX),
|
|
767
|
+
parseInt(`${g}${g}`, HEX),
|
|
768
|
+
parseInt(`${b}${b}`, HEX),
|
|
769
|
+
1
|
|
770
|
+
);
|
|
771
|
+
} else if (/^#[\da-f]{4}$/.test(value)) {
|
|
772
|
+
const [, r, g, b, alpha] = value.match(
|
|
773
|
+
/^#([\da-f])([\da-f])([\da-f])([\da-f])$/
|
|
774
|
+
);
|
|
775
|
+
arr.push(
|
|
776
|
+
parseInt(`${r}${r}`, HEX),
|
|
777
|
+
parseInt(`${g}${g}`, HEX),
|
|
778
|
+
parseInt(`${b}${b}`, HEX),
|
|
779
|
+
parseHexAlpha(`${alpha}${alpha}`)
|
|
780
|
+
);
|
|
781
|
+
} else if (/^#[\da-f]{8}$/.test(value)) {
|
|
782
|
+
const [, r, g, b, alpha] = value.match(
|
|
783
|
+
/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})$/
|
|
784
|
+
);
|
|
785
|
+
arr.push(
|
|
786
|
+
parseInt(r, HEX),
|
|
787
|
+
parseInt(g, HEX),
|
|
788
|
+
parseInt(b, HEX),
|
|
789
|
+
parseHexAlpha(alpha)
|
|
790
|
+
);
|
|
791
|
+
} else {
|
|
792
|
+
const [, r, g, b] = value.match(
|
|
793
|
+
/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/
|
|
794
|
+
);
|
|
795
|
+
arr.push(parseInt(r, HEX), parseInt(g, HEX), parseInt(b, HEX), 1);
|
|
796
|
+
}
|
|
797
|
+
return arr;
|
|
798
|
+
};
|
|
799
|
+
const convertHexToLinearRgb = (value) => {
|
|
800
|
+
const [rr, gg, bb, alpha] = convertHexToRgb(value);
|
|
801
|
+
const [r, g, b] = transformRgbToLinearRgb([rr, gg, bb], true);
|
|
802
|
+
return [r, g, b, alpha];
|
|
803
|
+
};
|
|
804
|
+
const convertHexToXyz = (value) => {
|
|
805
|
+
const [r, g, b, alpha] = convertHexToLinearRgb(value);
|
|
806
|
+
const [x, y, z] = transformMatrix(MATRIX_L_RGB_TO_XYZ, [r, g, b], true);
|
|
807
|
+
return [x, y, z, alpha];
|
|
808
|
+
};
|
|
809
|
+
const parseRgb = (value, opt = {}) => {
|
|
810
|
+
if (isString(value)) {
|
|
811
|
+
value = value.toLowerCase().trim();
|
|
812
|
+
} else {
|
|
813
|
+
throw new TypeError(`${value} is not a string.`);
|
|
814
|
+
}
|
|
815
|
+
const { format = "", nullable = false } = opt;
|
|
816
|
+
const reg = new RegExp(`^rgba?\\(\\s*(${SYN_MOD}|${SYN_RGB_LV3})\\s*\\)$`);
|
|
817
|
+
if (!reg.test(value)) {
|
|
818
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
819
|
+
if (res instanceof NullObject) {
|
|
820
|
+
return res;
|
|
821
|
+
}
|
|
822
|
+
if (isString(res)) {
|
|
823
|
+
return res;
|
|
824
|
+
}
|
|
825
|
+
return res;
|
|
826
|
+
}
|
|
827
|
+
const [, val] = value.match(reg);
|
|
828
|
+
const [v1, v2, v3, v4 = ""] = val.replace(/[,/]/g, " ").split(/\s+/);
|
|
829
|
+
let r, g, b;
|
|
830
|
+
if (v1 === NONE) {
|
|
831
|
+
r = 0;
|
|
832
|
+
} else {
|
|
833
|
+
if (v1.endsWith("%")) {
|
|
834
|
+
r = parseFloat(v1) * MAX_RGB / MAX_PCT;
|
|
835
|
+
} else {
|
|
836
|
+
r = parseFloat(v1);
|
|
837
|
+
}
|
|
838
|
+
r = Math.min(Math.max(roundToPrecision(r, OCT), 0), MAX_RGB);
|
|
839
|
+
}
|
|
840
|
+
if (v2 === NONE) {
|
|
841
|
+
g = 0;
|
|
842
|
+
} else {
|
|
843
|
+
if (v2.endsWith("%")) {
|
|
844
|
+
g = parseFloat(v2) * MAX_RGB / MAX_PCT;
|
|
845
|
+
} else {
|
|
846
|
+
g = parseFloat(v2);
|
|
847
|
+
}
|
|
848
|
+
g = Math.min(Math.max(roundToPrecision(g, OCT), 0), MAX_RGB);
|
|
849
|
+
}
|
|
850
|
+
if (v3 === NONE) {
|
|
851
|
+
b = 0;
|
|
852
|
+
} else {
|
|
853
|
+
if (v3.endsWith("%")) {
|
|
854
|
+
b = parseFloat(v3) * MAX_RGB / MAX_PCT;
|
|
855
|
+
} else {
|
|
856
|
+
b = parseFloat(v3);
|
|
857
|
+
}
|
|
858
|
+
b = Math.min(Math.max(roundToPrecision(b, OCT), 0), MAX_RGB);
|
|
859
|
+
}
|
|
860
|
+
const alpha = parseAlpha(v4);
|
|
861
|
+
return ["rgb", r, g, b, format === VAL_MIX && v4 === NONE ? NONE : alpha];
|
|
862
|
+
};
|
|
863
|
+
const parseHsl = (value, opt = {}) => {
|
|
864
|
+
if (isString(value)) {
|
|
865
|
+
value = value.trim();
|
|
866
|
+
} else {
|
|
867
|
+
throw new TypeError(`${value} is not a string.`);
|
|
868
|
+
}
|
|
869
|
+
const { format = "", nullable = false } = opt;
|
|
870
|
+
if (!REG_HSL.test(value)) {
|
|
871
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
872
|
+
if (res instanceof NullObject) {
|
|
873
|
+
return res;
|
|
874
|
+
}
|
|
875
|
+
if (isString(res)) {
|
|
876
|
+
return res;
|
|
877
|
+
}
|
|
878
|
+
return res;
|
|
879
|
+
}
|
|
880
|
+
const [, val] = value.match(REG_HSL);
|
|
881
|
+
const [v1, v2, v3, v4 = ""] = val.replace(/[,/]/g, " ").split(/\s+/);
|
|
882
|
+
let h, s, l;
|
|
883
|
+
if (v1 === NONE) {
|
|
884
|
+
h = 0;
|
|
885
|
+
} else {
|
|
886
|
+
h = angleToDeg(v1);
|
|
887
|
+
}
|
|
888
|
+
if (v2 === NONE) {
|
|
889
|
+
s = 0;
|
|
890
|
+
} else {
|
|
891
|
+
s = Math.min(Math.max(parseFloat(v2), 0), MAX_PCT);
|
|
892
|
+
}
|
|
893
|
+
if (v3 === NONE) {
|
|
894
|
+
l = 0;
|
|
895
|
+
} else {
|
|
896
|
+
l = Math.min(Math.max(parseFloat(v3), 0), MAX_PCT);
|
|
897
|
+
}
|
|
898
|
+
const alpha = parseAlpha(v4);
|
|
899
|
+
if (format === "hsl") {
|
|
900
|
+
return [
|
|
901
|
+
format,
|
|
902
|
+
v1 === NONE ? v1 : h,
|
|
903
|
+
v2 === NONE ? v2 : s,
|
|
904
|
+
v3 === NONE ? v3 : l,
|
|
905
|
+
v4 === NONE ? v4 : alpha
|
|
906
|
+
];
|
|
907
|
+
}
|
|
908
|
+
h = h / DEG * DOZ;
|
|
909
|
+
l /= MAX_PCT;
|
|
910
|
+
const sa = s / MAX_PCT * Math.min(l, 1 - l);
|
|
911
|
+
const rk = h % DOZ;
|
|
912
|
+
const gk = (8 + h) % DOZ;
|
|
913
|
+
const bk = (4 + h) % DOZ;
|
|
914
|
+
const r = l - sa * Math.max(-1, Math.min(rk - TRIA, TRIA ** POW_SQR - rk, 1));
|
|
915
|
+
const g = l - sa * Math.max(-1, Math.min(gk - TRIA, TRIA ** POW_SQR - gk, 1));
|
|
916
|
+
const b = l - sa * Math.max(-1, Math.min(bk - TRIA, TRIA ** POW_SQR - bk, 1));
|
|
917
|
+
return [
|
|
918
|
+
"rgb",
|
|
919
|
+
Math.min(Math.max(roundToPrecision(r * MAX_RGB, OCT), 0), MAX_RGB),
|
|
920
|
+
Math.min(Math.max(roundToPrecision(g * MAX_RGB, OCT), 0), MAX_RGB),
|
|
921
|
+
Math.min(Math.max(roundToPrecision(b * MAX_RGB, OCT), 0), MAX_RGB),
|
|
922
|
+
alpha
|
|
923
|
+
];
|
|
924
|
+
};
|
|
925
|
+
const parseHwb = (value, opt = {}) => {
|
|
926
|
+
if (isString(value)) {
|
|
927
|
+
value = value.trim();
|
|
928
|
+
} else {
|
|
929
|
+
throw new TypeError(`${value} is not a string.`);
|
|
930
|
+
}
|
|
931
|
+
const { format = "", nullable = false } = opt;
|
|
932
|
+
if (!REG_HWB.test(value)) {
|
|
933
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
934
|
+
if (res instanceof NullObject) {
|
|
935
|
+
return res;
|
|
936
|
+
}
|
|
937
|
+
if (isString(res)) {
|
|
938
|
+
return res;
|
|
939
|
+
}
|
|
940
|
+
return res;
|
|
941
|
+
}
|
|
942
|
+
const [, val] = value.match(REG_HWB);
|
|
943
|
+
const [v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
944
|
+
let h, wh, bk;
|
|
945
|
+
if (v1 === NONE) {
|
|
946
|
+
h = 0;
|
|
947
|
+
} else {
|
|
948
|
+
h = angleToDeg(v1);
|
|
949
|
+
}
|
|
950
|
+
if (v2 === NONE) {
|
|
951
|
+
wh = 0;
|
|
952
|
+
} else {
|
|
953
|
+
wh = Math.min(Math.max(parseFloat(v2), 0), MAX_PCT) / MAX_PCT;
|
|
954
|
+
}
|
|
955
|
+
if (v3 === NONE) {
|
|
956
|
+
bk = 0;
|
|
957
|
+
} else {
|
|
958
|
+
bk = Math.min(Math.max(parseFloat(v3), 0), MAX_PCT) / MAX_PCT;
|
|
959
|
+
}
|
|
960
|
+
const alpha = parseAlpha(v4);
|
|
961
|
+
if (format === "hwb") {
|
|
962
|
+
return [
|
|
963
|
+
format,
|
|
964
|
+
v1 === NONE ? v1 : h,
|
|
965
|
+
v2 === NONE ? v2 : wh * MAX_PCT,
|
|
966
|
+
v3 === NONE ? v3 : bk * MAX_PCT,
|
|
967
|
+
v4 === NONE ? v4 : alpha
|
|
968
|
+
];
|
|
969
|
+
}
|
|
970
|
+
if (wh + bk >= 1) {
|
|
971
|
+
const v = roundToPrecision(wh / (wh + bk) * MAX_RGB, OCT);
|
|
972
|
+
return ["rgb", v, v, v, alpha];
|
|
973
|
+
}
|
|
974
|
+
const factor = (1 - wh - bk) / MAX_RGB;
|
|
975
|
+
let [, r, g, b] = parseHsl(`hsl(${h} 100 50)`);
|
|
976
|
+
r = roundToPrecision((r * factor + wh) * MAX_RGB, OCT);
|
|
977
|
+
g = roundToPrecision((g * factor + wh) * MAX_RGB, OCT);
|
|
978
|
+
b = roundToPrecision((b * factor + wh) * MAX_RGB, OCT);
|
|
979
|
+
return [
|
|
980
|
+
"rgb",
|
|
981
|
+
Math.min(Math.max(r, 0), MAX_RGB),
|
|
982
|
+
Math.min(Math.max(g, 0), MAX_RGB),
|
|
983
|
+
Math.min(Math.max(b, 0), MAX_RGB),
|
|
984
|
+
alpha
|
|
985
|
+
];
|
|
986
|
+
};
|
|
987
|
+
const parseLab = (value, opt = {}) => {
|
|
988
|
+
if (isString(value)) {
|
|
989
|
+
value = value.trim();
|
|
990
|
+
} else {
|
|
991
|
+
throw new TypeError(`${value} is not a string.`);
|
|
992
|
+
}
|
|
993
|
+
const { format = "", nullable = false } = opt;
|
|
994
|
+
if (!REG_LAB.test(value)) {
|
|
995
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
996
|
+
if (res instanceof NullObject) {
|
|
997
|
+
return res;
|
|
998
|
+
}
|
|
999
|
+
if (isString(res)) {
|
|
1000
|
+
return res;
|
|
1001
|
+
}
|
|
1002
|
+
return res;
|
|
1003
|
+
}
|
|
1004
|
+
const COEF_PCT = 1.25;
|
|
1005
|
+
const COND_POW = 8;
|
|
1006
|
+
const [, val] = value.match(REG_LAB);
|
|
1007
|
+
const [v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
1008
|
+
let l, a, b;
|
|
1009
|
+
if (v1 === NONE) {
|
|
1010
|
+
l = 0;
|
|
1011
|
+
} else {
|
|
1012
|
+
if (v1.endsWith("%")) {
|
|
1013
|
+
l = parseFloat(v1);
|
|
1014
|
+
if (l > MAX_PCT) {
|
|
1015
|
+
l = MAX_PCT;
|
|
1016
|
+
}
|
|
1017
|
+
} else {
|
|
1018
|
+
l = parseFloat(v1);
|
|
1019
|
+
}
|
|
1020
|
+
if (l < 0) {
|
|
1021
|
+
l = 0;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
if (v2 === NONE) {
|
|
1025
|
+
a = 0;
|
|
1026
|
+
} else {
|
|
1027
|
+
a = v2.endsWith("%") ? parseFloat(v2) * COEF_PCT : parseFloat(v2);
|
|
1028
|
+
}
|
|
1029
|
+
if (v3 === NONE) {
|
|
1030
|
+
b = 0;
|
|
1031
|
+
} else {
|
|
1032
|
+
b = v3.endsWith("%") ? parseFloat(v3) * COEF_PCT : parseFloat(v3);
|
|
1033
|
+
}
|
|
1034
|
+
const alpha = parseAlpha(v4);
|
|
1035
|
+
if (REG_SPEC.test(format)) {
|
|
1036
|
+
return [
|
|
1037
|
+
"lab",
|
|
1038
|
+
v1 === NONE ? v1 : roundToPrecision(l, HEX),
|
|
1039
|
+
v2 === NONE ? v2 : roundToPrecision(a, HEX),
|
|
1040
|
+
v3 === NONE ? v3 : roundToPrecision(b, HEX),
|
|
1041
|
+
v4 === NONE ? v4 : alpha
|
|
1042
|
+
];
|
|
1043
|
+
}
|
|
1044
|
+
const fl = (l + HEX) / LAB_L;
|
|
1045
|
+
const fa = a / LAB_A + fl;
|
|
1046
|
+
const fb = fl - b / LAB_B;
|
|
1047
|
+
const powFl = Math.pow(fl, POW_CUBE);
|
|
1048
|
+
const powFa = Math.pow(fa, POW_CUBE);
|
|
1049
|
+
const powFb = Math.pow(fb, POW_CUBE);
|
|
1050
|
+
const xyz = [
|
|
1051
|
+
powFa > LAB_EPSILON ? powFa : (fa * LAB_L - HEX) / LAB_KAPPA,
|
|
1052
|
+
l > COND_POW ? powFl : l / LAB_KAPPA,
|
|
1053
|
+
powFb > LAB_EPSILON ? powFb : (fb * LAB_L - HEX) / LAB_KAPPA
|
|
1054
|
+
];
|
|
1055
|
+
const [x, y, z] = xyz.map(
|
|
1056
|
+
(val2, i) => val2 * D50[i]
|
|
1057
|
+
);
|
|
1058
|
+
return [
|
|
1059
|
+
"xyz-d50",
|
|
1060
|
+
roundToPrecision(x, HEX),
|
|
1061
|
+
roundToPrecision(y, HEX),
|
|
1062
|
+
roundToPrecision(z, HEX),
|
|
1063
|
+
alpha
|
|
1064
|
+
];
|
|
1065
|
+
};
|
|
1066
|
+
const parseLch = (value, opt = {}) => {
|
|
1067
|
+
if (isString(value)) {
|
|
1068
|
+
value = value.trim();
|
|
1069
|
+
} else {
|
|
1070
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1071
|
+
}
|
|
1072
|
+
const { format = "", nullable = false } = opt;
|
|
1073
|
+
if (!REG_LCH.test(value)) {
|
|
1074
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
1075
|
+
if (res instanceof NullObject) {
|
|
1076
|
+
return res;
|
|
1077
|
+
}
|
|
1078
|
+
if (isString(res)) {
|
|
1079
|
+
return res;
|
|
1080
|
+
}
|
|
1081
|
+
return res;
|
|
1082
|
+
}
|
|
1083
|
+
const COEF_PCT = 1.5;
|
|
1084
|
+
const [, val] = value.match(REG_LCH);
|
|
1085
|
+
const [v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
1086
|
+
let l, c, h;
|
|
1087
|
+
if (v1 === NONE) {
|
|
1088
|
+
l = 0;
|
|
1089
|
+
} else {
|
|
1090
|
+
l = parseFloat(v1);
|
|
1091
|
+
if (l < 0) {
|
|
1092
|
+
l = 0;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (v2 === NONE) {
|
|
1096
|
+
c = 0;
|
|
1097
|
+
} else {
|
|
1098
|
+
c = v2.endsWith("%") ? parseFloat(v2) * COEF_PCT : parseFloat(v2);
|
|
1099
|
+
}
|
|
1100
|
+
if (v3 === NONE) {
|
|
1101
|
+
h = 0;
|
|
1102
|
+
} else {
|
|
1103
|
+
h = angleToDeg(v3);
|
|
1104
|
+
}
|
|
1105
|
+
const alpha = parseAlpha(v4);
|
|
1106
|
+
if (REG_SPEC.test(format)) {
|
|
1107
|
+
return [
|
|
1108
|
+
"lch",
|
|
1109
|
+
v1 === NONE ? v1 : roundToPrecision(l, HEX),
|
|
1110
|
+
v2 === NONE ? v2 : roundToPrecision(c, HEX),
|
|
1111
|
+
v3 === NONE ? v3 : roundToPrecision(h, HEX),
|
|
1112
|
+
v4 === NONE ? v4 : alpha
|
|
1113
|
+
];
|
|
1114
|
+
}
|
|
1115
|
+
const a = c * Math.cos(h * Math.PI / DEG_HALF);
|
|
1116
|
+
const b = c * Math.sin(h * Math.PI / DEG_HALF);
|
|
1117
|
+
const [, x, y, z] = parseLab(`lab(${l} ${a} ${b})`);
|
|
1118
|
+
return [
|
|
1119
|
+
"xyz-d50",
|
|
1120
|
+
roundToPrecision(x, HEX),
|
|
1121
|
+
roundToPrecision(y, HEX),
|
|
1122
|
+
roundToPrecision(z, HEX),
|
|
1123
|
+
alpha
|
|
1124
|
+
];
|
|
1125
|
+
};
|
|
1126
|
+
const parseOklab = (value, opt = {}) => {
|
|
1127
|
+
if (isString(value)) {
|
|
1128
|
+
value = value.trim();
|
|
1129
|
+
} else {
|
|
1130
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1131
|
+
}
|
|
1132
|
+
const { format = "", nullable = false } = opt;
|
|
1133
|
+
if (!REG_OKLAB.test(value)) {
|
|
1134
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
1135
|
+
if (res instanceof NullObject) {
|
|
1136
|
+
return res;
|
|
1137
|
+
}
|
|
1138
|
+
if (isString(res)) {
|
|
1139
|
+
return res;
|
|
1140
|
+
}
|
|
1141
|
+
return res;
|
|
1142
|
+
}
|
|
1143
|
+
const COEF_PCT = 0.4;
|
|
1144
|
+
const [, val] = value.match(REG_OKLAB);
|
|
1145
|
+
const [v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
1146
|
+
let l, a, b;
|
|
1147
|
+
if (v1 === NONE) {
|
|
1148
|
+
l = 0;
|
|
1149
|
+
} else {
|
|
1150
|
+
l = v1.endsWith("%") ? parseFloat(v1) / MAX_PCT : parseFloat(v1);
|
|
1151
|
+
if (l < 0) {
|
|
1152
|
+
l = 0;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
if (v2 === NONE) {
|
|
1156
|
+
a = 0;
|
|
1157
|
+
} else if (v2.endsWith("%")) {
|
|
1158
|
+
a = parseFloat(v2) * COEF_PCT / MAX_PCT;
|
|
1159
|
+
} else {
|
|
1160
|
+
a = parseFloat(v2);
|
|
1161
|
+
}
|
|
1162
|
+
if (v3 === NONE) {
|
|
1163
|
+
b = 0;
|
|
1164
|
+
} else if (v3.endsWith("%")) {
|
|
1165
|
+
b = parseFloat(v3) * COEF_PCT / MAX_PCT;
|
|
1166
|
+
} else {
|
|
1167
|
+
b = parseFloat(v3);
|
|
1168
|
+
}
|
|
1169
|
+
const alpha = parseAlpha(v4);
|
|
1170
|
+
if (REG_SPEC.test(format)) {
|
|
1171
|
+
return [
|
|
1172
|
+
"oklab",
|
|
1173
|
+
v1 === NONE ? v1 : roundToPrecision(l, HEX),
|
|
1174
|
+
v2 === NONE ? v2 : roundToPrecision(a, HEX),
|
|
1175
|
+
v3 === NONE ? v3 : roundToPrecision(b, HEX),
|
|
1176
|
+
v4 === NONE ? v4 : alpha
|
|
1177
|
+
];
|
|
1178
|
+
}
|
|
1179
|
+
const lms = transformMatrix(MATRIX_OKLAB_TO_LMS, [l, a, b]);
|
|
1180
|
+
const xyzLms = lms.map((c) => Math.pow(c, POW_CUBE));
|
|
1181
|
+
const [x, y, z] = transformMatrix(MATRIX_LMS_TO_XYZ, xyzLms, true);
|
|
1182
|
+
return [
|
|
1183
|
+
"xyz-d65",
|
|
1184
|
+
roundToPrecision(x, HEX),
|
|
1185
|
+
roundToPrecision(y, HEX),
|
|
1186
|
+
roundToPrecision(z, HEX),
|
|
1187
|
+
alpha
|
|
1188
|
+
];
|
|
1189
|
+
};
|
|
1190
|
+
const parseOklch = (value, opt = {}) => {
|
|
1191
|
+
if (isString(value)) {
|
|
1192
|
+
value = value.trim();
|
|
1193
|
+
} else {
|
|
1194
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1195
|
+
}
|
|
1196
|
+
const { format = "", nullable = false } = opt;
|
|
1197
|
+
if (!REG_OKLCH.test(value)) {
|
|
1198
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
1199
|
+
if (res instanceof NullObject) {
|
|
1200
|
+
return res;
|
|
1201
|
+
}
|
|
1202
|
+
if (isString(res)) {
|
|
1203
|
+
return res;
|
|
1204
|
+
}
|
|
1205
|
+
return res;
|
|
1206
|
+
}
|
|
1207
|
+
const COEF_PCT = 0.4;
|
|
1208
|
+
const [, val] = value.match(REG_OKLCH);
|
|
1209
|
+
const [v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
1210
|
+
let l, c, h;
|
|
1211
|
+
if (v1 === NONE) {
|
|
1212
|
+
l = 0;
|
|
1213
|
+
} else {
|
|
1214
|
+
l = v1.endsWith("%") ? parseFloat(v1) / MAX_PCT : parseFloat(v1);
|
|
1215
|
+
if (l < 0) {
|
|
1216
|
+
l = 0;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
if (v2 === NONE) {
|
|
1220
|
+
c = 0;
|
|
1221
|
+
} else {
|
|
1222
|
+
if (v2.endsWith("%")) {
|
|
1223
|
+
c = parseFloat(v2) * COEF_PCT / MAX_PCT;
|
|
1224
|
+
} else {
|
|
1225
|
+
c = parseFloat(v2);
|
|
1226
|
+
}
|
|
1227
|
+
if (c < 0) {
|
|
1228
|
+
c = 0;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
if (v3 === NONE) {
|
|
1232
|
+
h = 0;
|
|
1233
|
+
} else {
|
|
1234
|
+
h = angleToDeg(v3);
|
|
1235
|
+
}
|
|
1236
|
+
const alpha = parseAlpha(v4);
|
|
1237
|
+
if (REG_SPEC.test(format)) {
|
|
1238
|
+
return [
|
|
1239
|
+
"oklch",
|
|
1240
|
+
v1 === NONE ? v1 : roundToPrecision(l, HEX),
|
|
1241
|
+
v2 === NONE ? v2 : roundToPrecision(c, HEX),
|
|
1242
|
+
v3 === NONE ? v3 : roundToPrecision(h, HEX),
|
|
1243
|
+
v4 === NONE ? v4 : alpha
|
|
1244
|
+
];
|
|
1245
|
+
}
|
|
1246
|
+
const a = c * Math.cos(h * Math.PI / DEG_HALF);
|
|
1247
|
+
const b = c * Math.sin(h * Math.PI / DEG_HALF);
|
|
1248
|
+
const lms = transformMatrix(MATRIX_OKLAB_TO_LMS, [l, a, b]);
|
|
1249
|
+
const xyzLms = lms.map((cc) => Math.pow(cc, POW_CUBE));
|
|
1250
|
+
const [x, y, z] = transformMatrix(MATRIX_LMS_TO_XYZ, xyzLms, true);
|
|
1251
|
+
return [
|
|
1252
|
+
"xyz-d65",
|
|
1253
|
+
roundToPrecision(x, HEX),
|
|
1254
|
+
roundToPrecision(y, HEX),
|
|
1255
|
+
roundToPrecision(z, HEX),
|
|
1256
|
+
alpha
|
|
1257
|
+
];
|
|
1258
|
+
};
|
|
1259
|
+
const parseColorFunc = (value, opt = {}) => {
|
|
1260
|
+
if (isString(value)) {
|
|
1261
|
+
value = value.trim();
|
|
1262
|
+
} else {
|
|
1263
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1264
|
+
}
|
|
1265
|
+
const { colorSpace = "", d50 = false, format = "", nullable = false } = opt;
|
|
1266
|
+
if (!REG_FN_COLOR.test(value)) {
|
|
1267
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
1268
|
+
if (res instanceof NullObject) {
|
|
1269
|
+
return res;
|
|
1270
|
+
}
|
|
1271
|
+
if (isString(res)) {
|
|
1272
|
+
return res;
|
|
1273
|
+
}
|
|
1274
|
+
return res;
|
|
1275
|
+
}
|
|
1276
|
+
const [, val] = value.match(REG_FN_COLOR);
|
|
1277
|
+
let [cs, v1, v2, v3, v4 = ""] = val.replace("/", " ").split(/\s+/);
|
|
1278
|
+
let r, g, b;
|
|
1279
|
+
if (cs === "xyz") {
|
|
1280
|
+
cs = "xyz-d65";
|
|
1281
|
+
}
|
|
1282
|
+
if (v1 === NONE) {
|
|
1283
|
+
r = 0;
|
|
1284
|
+
} else {
|
|
1285
|
+
r = v1.endsWith("%") ? parseFloat(v1) / MAX_PCT : parseFloat(v1);
|
|
1286
|
+
}
|
|
1287
|
+
if (v2 === NONE) {
|
|
1288
|
+
g = 0;
|
|
1289
|
+
} else {
|
|
1290
|
+
g = v2.endsWith("%") ? parseFloat(v2) / MAX_PCT : parseFloat(v2);
|
|
1291
|
+
}
|
|
1292
|
+
if (v3 === NONE) {
|
|
1293
|
+
b = 0;
|
|
1294
|
+
} else {
|
|
1295
|
+
b = v3.endsWith("%") ? parseFloat(v3) / MAX_PCT : parseFloat(v3);
|
|
1296
|
+
}
|
|
1297
|
+
const alpha = parseAlpha(v4);
|
|
1298
|
+
if (REG_SPEC.test(format) || format === VAL_MIX && cs === colorSpace) {
|
|
1299
|
+
return [
|
|
1300
|
+
cs,
|
|
1301
|
+
v1 === NONE ? v1 : roundToPrecision(r, DEC),
|
|
1302
|
+
v2 === NONE ? v2 : roundToPrecision(g, DEC),
|
|
1303
|
+
v3 === NONE ? v3 : roundToPrecision(b, DEC),
|
|
1304
|
+
v4 === NONE ? v4 : alpha
|
|
1305
|
+
];
|
|
1306
|
+
}
|
|
1307
|
+
let x = 0;
|
|
1308
|
+
let y = 0;
|
|
1309
|
+
let z = 0;
|
|
1310
|
+
if (cs === "srgb-linear") {
|
|
1311
|
+
[x, y, z] = transformMatrix(MATRIX_L_RGB_TO_XYZ, [r, g, b]);
|
|
1312
|
+
if (d50) {
|
|
1313
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1314
|
+
}
|
|
1315
|
+
} else if (cs === "display-p3") {
|
|
1316
|
+
const linearRgb = transformRgbToLinearRgb([
|
|
1317
|
+
r * MAX_RGB,
|
|
1318
|
+
g * MAX_RGB,
|
|
1319
|
+
b * MAX_RGB
|
|
1320
|
+
]);
|
|
1321
|
+
[x, y, z] = transformMatrix(MATRIX_P3_TO_XYZ, linearRgb);
|
|
1322
|
+
if (d50) {
|
|
1323
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1324
|
+
}
|
|
1325
|
+
} else if (cs === "rec2020") {
|
|
1326
|
+
const ALPHA = 1.09929682680944;
|
|
1327
|
+
const BETA = 0.018053968510807;
|
|
1328
|
+
const REC_COEF = 0.45;
|
|
1329
|
+
const rgb = [r, g, b].map((c) => {
|
|
1330
|
+
let cl;
|
|
1331
|
+
if (c < BETA * REC_COEF * DEC) {
|
|
1332
|
+
cl = c / (REC_COEF * DEC);
|
|
1333
|
+
} else {
|
|
1334
|
+
cl = Math.pow((c + ALPHA - 1) / ALPHA, 1 / REC_COEF);
|
|
1335
|
+
}
|
|
1336
|
+
return cl;
|
|
1337
|
+
});
|
|
1338
|
+
[x, y, z] = transformMatrix(MATRIX_REC2020_TO_XYZ, rgb);
|
|
1339
|
+
if (d50) {
|
|
1340
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1341
|
+
}
|
|
1342
|
+
} else if (cs === "a98-rgb") {
|
|
1343
|
+
const POW_A98 = 563 / 256;
|
|
1344
|
+
const rgb = [r, g, b].map((c) => {
|
|
1345
|
+
const cl = Math.pow(c, POW_A98);
|
|
1346
|
+
return cl;
|
|
1347
|
+
});
|
|
1348
|
+
[x, y, z] = transformMatrix(MATRIX_A98_TO_XYZ, rgb);
|
|
1349
|
+
if (d50) {
|
|
1350
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1351
|
+
}
|
|
1352
|
+
} else if (cs === "prophoto-rgb") {
|
|
1353
|
+
const POW_PROPHOTO = 1.8;
|
|
1354
|
+
const rgb = [r, g, b].map((c) => {
|
|
1355
|
+
let cl;
|
|
1356
|
+
if (c > 1 / (HEX * DUO)) {
|
|
1357
|
+
cl = Math.pow(c, POW_PROPHOTO);
|
|
1358
|
+
} else {
|
|
1359
|
+
cl = c / HEX;
|
|
1360
|
+
}
|
|
1361
|
+
return cl;
|
|
1362
|
+
});
|
|
1363
|
+
[x, y, z] = transformMatrix(MATRIX_PROPHOTO_TO_XYZ_D50, rgb);
|
|
1364
|
+
if (!d50) {
|
|
1365
|
+
[x, y, z] = transformMatrix(MATRIX_D50_TO_D65, [x, y, z], true);
|
|
1366
|
+
}
|
|
1367
|
+
} else if (/^xyz(?:-d(?:50|65))?$/.test(cs)) {
|
|
1368
|
+
[x, y, z] = [r, g, b];
|
|
1369
|
+
if (cs === "xyz-d50") {
|
|
1370
|
+
if (!d50) {
|
|
1371
|
+
[x, y, z] = transformMatrix(MATRIX_D50_TO_D65, [x, y, z]);
|
|
1372
|
+
}
|
|
1373
|
+
} else if (d50) {
|
|
1374
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1375
|
+
}
|
|
1376
|
+
} else {
|
|
1377
|
+
[x, y, z] = transformRgbToXyz([r * MAX_RGB, g * MAX_RGB, b * MAX_RGB]);
|
|
1378
|
+
if (d50) {
|
|
1379
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
return [
|
|
1383
|
+
d50 ? "xyz-d50" : "xyz-d65",
|
|
1384
|
+
roundToPrecision(x, HEX),
|
|
1385
|
+
roundToPrecision(y, HEX),
|
|
1386
|
+
roundToPrecision(z, HEX),
|
|
1387
|
+
format === VAL_MIX && v4 === NONE ? v4 : alpha
|
|
1388
|
+
];
|
|
1389
|
+
};
|
|
1390
|
+
const parseColorValue = (value, opt = {}) => {
|
|
1391
|
+
if (isString(value)) {
|
|
1392
|
+
value = value.toLowerCase().trim();
|
|
1393
|
+
} else {
|
|
1394
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1395
|
+
}
|
|
1396
|
+
const { d50 = false, format = "", nullable = false } = opt;
|
|
1397
|
+
if (!REG_COLOR.test(value)) {
|
|
1398
|
+
const res = resolveInvalidColorValue(format, nullable);
|
|
1399
|
+
if (res instanceof NullObject) {
|
|
1400
|
+
return res;
|
|
1401
|
+
}
|
|
1402
|
+
if (isString(res)) {
|
|
1403
|
+
return res;
|
|
1404
|
+
}
|
|
1405
|
+
return res;
|
|
1406
|
+
}
|
|
1407
|
+
let x = 0;
|
|
1408
|
+
let y = 0;
|
|
1409
|
+
let z = 0;
|
|
1410
|
+
let alpha = 0;
|
|
1411
|
+
if (REG_CURRENT.test(value)) {
|
|
1412
|
+
if (format === VAL_COMP) {
|
|
1413
|
+
return ["rgb", 0, 0, 0, 0];
|
|
1414
|
+
}
|
|
1415
|
+
if (format === VAL_SPEC) {
|
|
1416
|
+
return value;
|
|
1417
|
+
}
|
|
1418
|
+
} else if (/^[a-z]+$/.test(value)) {
|
|
1419
|
+
if (Object.hasOwn(NAMED_COLORS, value)) {
|
|
1420
|
+
if (format === VAL_SPEC) {
|
|
1421
|
+
return value;
|
|
1422
|
+
}
|
|
1423
|
+
const [r, g, b] = NAMED_COLORS[value];
|
|
1424
|
+
alpha = 1;
|
|
1425
|
+
if (format === VAL_COMP) {
|
|
1426
|
+
return ["rgb", r, g, b, alpha];
|
|
1427
|
+
}
|
|
1428
|
+
[x, y, z] = transformRgbToXyz([r, g, b], true);
|
|
1429
|
+
if (d50) {
|
|
1430
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1431
|
+
}
|
|
1432
|
+
} else {
|
|
1433
|
+
switch (format) {
|
|
1434
|
+
case VAL_COMP: {
|
|
1435
|
+
if (nullable && value !== "transparent") {
|
|
1436
|
+
return new NullObject();
|
|
1437
|
+
}
|
|
1438
|
+
return ["rgb", 0, 0, 0, 0];
|
|
1439
|
+
}
|
|
1440
|
+
case VAL_SPEC: {
|
|
1441
|
+
if (value === "transparent") {
|
|
1442
|
+
return value;
|
|
1443
|
+
}
|
|
1444
|
+
return "";
|
|
1445
|
+
}
|
|
1446
|
+
case VAL_MIX: {
|
|
1447
|
+
if (value === "transparent") {
|
|
1448
|
+
return ["rgb", 0, 0, 0, 0];
|
|
1449
|
+
}
|
|
1450
|
+
return new NullObject();
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
} else if (value[0] === "#") {
|
|
1455
|
+
if (REG_SPEC.test(format)) {
|
|
1456
|
+
const rgb = convertHexToRgb(value);
|
|
1457
|
+
return ["rgb", ...rgb];
|
|
1458
|
+
}
|
|
1459
|
+
[x, y, z, alpha] = convertHexToXyz(value);
|
|
1460
|
+
if (d50) {
|
|
1461
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1462
|
+
}
|
|
1463
|
+
} else if (value.startsWith("lab")) {
|
|
1464
|
+
if (REG_SPEC.test(format)) {
|
|
1465
|
+
return parseLab(value, opt);
|
|
1466
|
+
}
|
|
1467
|
+
[, x, y, z, alpha] = parseLab(value);
|
|
1468
|
+
if (!d50) {
|
|
1469
|
+
[x, y, z] = transformMatrix(MATRIX_D50_TO_D65, [x, y, z], true);
|
|
1470
|
+
}
|
|
1471
|
+
} else if (value.startsWith("lch")) {
|
|
1472
|
+
if (REG_SPEC.test(format)) {
|
|
1473
|
+
return parseLch(value, opt);
|
|
1474
|
+
}
|
|
1475
|
+
[, x, y, z, alpha] = parseLch(value);
|
|
1476
|
+
if (!d50) {
|
|
1477
|
+
[x, y, z] = transformMatrix(MATRIX_D50_TO_D65, [x, y, z], true);
|
|
1478
|
+
}
|
|
1479
|
+
} else if (value.startsWith("oklab")) {
|
|
1480
|
+
if (REG_SPEC.test(format)) {
|
|
1481
|
+
return parseOklab(value, opt);
|
|
1482
|
+
}
|
|
1483
|
+
[, x, y, z, alpha] = parseOklab(value);
|
|
1484
|
+
if (d50) {
|
|
1485
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1486
|
+
}
|
|
1487
|
+
} else if (value.startsWith("oklch")) {
|
|
1488
|
+
if (REG_SPEC.test(format)) {
|
|
1489
|
+
return parseOklch(value, opt);
|
|
1490
|
+
}
|
|
1491
|
+
[, x, y, z, alpha] = parseOklch(value);
|
|
1492
|
+
if (d50) {
|
|
1493
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1494
|
+
}
|
|
1495
|
+
} else {
|
|
1496
|
+
let r, g, b;
|
|
1497
|
+
if (value.startsWith("hsl")) {
|
|
1498
|
+
[, r, g, b, alpha] = parseHsl(value);
|
|
1499
|
+
} else if (value.startsWith("hwb")) {
|
|
1500
|
+
[, r, g, b, alpha] = parseHwb(value);
|
|
1501
|
+
} else {
|
|
1502
|
+
[, r, g, b, alpha] = parseRgb(value, opt);
|
|
1503
|
+
}
|
|
1504
|
+
if (REG_SPEC.test(format)) {
|
|
1505
|
+
return ["rgb", Math.round(r), Math.round(g), Math.round(b), alpha];
|
|
1506
|
+
}
|
|
1507
|
+
[x, y, z] = transformRgbToXyz([r, g, b]);
|
|
1508
|
+
if (d50) {
|
|
1509
|
+
[x, y, z] = transformMatrix(MATRIX_D65_TO_D50, [x, y, z], true);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
return [
|
|
1513
|
+
d50 ? "xyz-d50" : "xyz-d65",
|
|
1514
|
+
roundToPrecision(x, HEX),
|
|
1515
|
+
roundToPrecision(y, HEX),
|
|
1516
|
+
roundToPrecision(z, HEX),
|
|
1517
|
+
alpha
|
|
1518
|
+
];
|
|
1519
|
+
};
|
|
1520
|
+
const resolveColorValue = (value, opt = {}) => {
|
|
1521
|
+
if (isString(value)) {
|
|
1522
|
+
value = value.toLowerCase().trim();
|
|
1523
|
+
} else {
|
|
1524
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1525
|
+
}
|
|
1526
|
+
const { colorSpace = "", format = "", nullable = false } = opt;
|
|
1527
|
+
const cacheKey = createCacheKey(
|
|
1528
|
+
{
|
|
1529
|
+
namespace: NAMESPACE,
|
|
1530
|
+
name: "resolveColorValue",
|
|
1531
|
+
value
|
|
1532
|
+
},
|
|
1533
|
+
opt
|
|
1534
|
+
);
|
|
1535
|
+
const cachedResult = getCache(cacheKey);
|
|
1536
|
+
if (cachedResult instanceof CacheItem) {
|
|
1537
|
+
if (cachedResult.isNull) {
|
|
1538
|
+
return cachedResult;
|
|
1539
|
+
}
|
|
1540
|
+
const cachedItem = cachedResult.item;
|
|
1541
|
+
if (isString(cachedItem)) {
|
|
1542
|
+
return cachedItem;
|
|
1543
|
+
}
|
|
1544
|
+
return cachedItem;
|
|
1545
|
+
}
|
|
1546
|
+
if (!REG_COLOR.test(value)) {
|
|
1547
|
+
const res2 = resolveInvalidColorValue(format, nullable);
|
|
1548
|
+
if (res2 instanceof NullObject) {
|
|
1549
|
+
setCache(cacheKey, null);
|
|
1550
|
+
return res2;
|
|
1551
|
+
}
|
|
1552
|
+
setCache(cacheKey, res2);
|
|
1553
|
+
if (isString(res2)) {
|
|
1554
|
+
return res2;
|
|
1555
|
+
}
|
|
1556
|
+
return res2;
|
|
1557
|
+
}
|
|
1558
|
+
let cs = "";
|
|
1559
|
+
let r = 0;
|
|
1560
|
+
let g = 0;
|
|
1561
|
+
let b = 0;
|
|
1562
|
+
let alpha = 0;
|
|
1563
|
+
if (REG_CURRENT.test(value)) {
|
|
1564
|
+
if (format === VAL_SPEC) {
|
|
1565
|
+
setCache(cacheKey, value);
|
|
1566
|
+
return value;
|
|
1567
|
+
}
|
|
1568
|
+
} else if (/^[a-z]+$/.test(value)) {
|
|
1569
|
+
if (Object.hasOwn(NAMED_COLORS, value)) {
|
|
1570
|
+
if (format === VAL_SPEC) {
|
|
1571
|
+
setCache(cacheKey, value);
|
|
1572
|
+
return value;
|
|
1573
|
+
}
|
|
1574
|
+
[r, g, b] = NAMED_COLORS[value];
|
|
1575
|
+
alpha = 1;
|
|
1576
|
+
} else {
|
|
1577
|
+
switch (format) {
|
|
1578
|
+
case VAL_SPEC: {
|
|
1579
|
+
if (value === "transparent") {
|
|
1580
|
+
setCache(cacheKey, value);
|
|
1581
|
+
return value;
|
|
1582
|
+
}
|
|
1583
|
+
const res2 = "";
|
|
1584
|
+
setCache(cacheKey, res2);
|
|
1585
|
+
return res2;
|
|
1586
|
+
}
|
|
1587
|
+
case VAL_MIX: {
|
|
1588
|
+
if (value === "transparent") {
|
|
1589
|
+
const res2 = ["rgb", 0, 0, 0, 0];
|
|
1590
|
+
setCache(cacheKey, res2);
|
|
1591
|
+
return res2;
|
|
1592
|
+
}
|
|
1593
|
+
setCache(cacheKey, null);
|
|
1594
|
+
return new NullObject();
|
|
1595
|
+
}
|
|
1596
|
+
case VAL_COMP:
|
|
1597
|
+
default: {
|
|
1598
|
+
if (nullable && value !== "transparent") {
|
|
1599
|
+
setCache(cacheKey, null);
|
|
1600
|
+
return new NullObject();
|
|
1601
|
+
}
|
|
1602
|
+
const res2 = ["rgb", 0, 0, 0, 0];
|
|
1603
|
+
setCache(cacheKey, res2);
|
|
1604
|
+
return res2;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
} else if (value[0] === "#") {
|
|
1609
|
+
[r, g, b, alpha] = convertHexToRgb(value);
|
|
1610
|
+
} else if (value.startsWith("hsl")) {
|
|
1611
|
+
[, r, g, b, alpha] = parseHsl(value, opt);
|
|
1612
|
+
} else if (value.startsWith("hwb")) {
|
|
1613
|
+
[, r, g, b, alpha] = parseHwb(value, opt);
|
|
1614
|
+
} else if (/^l(?:ab|ch)/.test(value)) {
|
|
1615
|
+
let x, y, z;
|
|
1616
|
+
if (value.startsWith("lab")) {
|
|
1617
|
+
[cs, x, y, z, alpha] = parseLab(value, opt);
|
|
1618
|
+
} else {
|
|
1619
|
+
[cs, x, y, z, alpha] = parseLch(value, opt);
|
|
1620
|
+
}
|
|
1621
|
+
if (REG_SPEC.test(format)) {
|
|
1622
|
+
const res2 = [cs, x, y, z, alpha];
|
|
1623
|
+
setCache(cacheKey, res2);
|
|
1624
|
+
return res2;
|
|
1625
|
+
}
|
|
1626
|
+
[r, g, b] = transformXyzD50ToRgb([x, y, z]);
|
|
1627
|
+
} else if (/^okl(?:ab|ch)/.test(value)) {
|
|
1628
|
+
let x, y, z;
|
|
1629
|
+
if (value.startsWith("oklab")) {
|
|
1630
|
+
[cs, x, y, z, alpha] = parseOklab(value, opt);
|
|
1631
|
+
} else {
|
|
1632
|
+
[cs, x, y, z, alpha] = parseOklch(value, opt);
|
|
1633
|
+
}
|
|
1634
|
+
if (REG_SPEC.test(format)) {
|
|
1635
|
+
const res2 = [cs, x, y, z, alpha];
|
|
1636
|
+
setCache(cacheKey, res2);
|
|
1637
|
+
return res2;
|
|
1638
|
+
}
|
|
1639
|
+
[r, g, b] = transformXyzToRgb([x, y, z]);
|
|
1640
|
+
} else {
|
|
1641
|
+
[, r, g, b, alpha] = parseRgb(value, opt);
|
|
1642
|
+
}
|
|
1643
|
+
if (format === VAL_MIX && colorSpace === "srgb") {
|
|
1644
|
+
const res2 = [
|
|
1645
|
+
"srgb",
|
|
1646
|
+
r / MAX_RGB,
|
|
1647
|
+
g / MAX_RGB,
|
|
1648
|
+
b / MAX_RGB,
|
|
1649
|
+
alpha
|
|
1650
|
+
];
|
|
1651
|
+
setCache(cacheKey, res2);
|
|
1652
|
+
return res2;
|
|
1653
|
+
}
|
|
1654
|
+
const res = [
|
|
1655
|
+
"rgb",
|
|
1656
|
+
Math.round(r),
|
|
1657
|
+
Math.round(g),
|
|
1658
|
+
Math.round(b),
|
|
1659
|
+
alpha
|
|
1660
|
+
];
|
|
1661
|
+
setCache(cacheKey, res);
|
|
1662
|
+
return res;
|
|
1663
|
+
};
|
|
1664
|
+
const resolveColorFunc = (value, opt = {}) => {
|
|
1665
|
+
if (isString(value)) {
|
|
1666
|
+
value = value.toLowerCase().trim();
|
|
1667
|
+
} else {
|
|
1668
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1669
|
+
}
|
|
1670
|
+
const { colorSpace = "", format = "", nullable = false } = opt;
|
|
1671
|
+
const cacheKey = createCacheKey(
|
|
1672
|
+
{
|
|
1673
|
+
namespace: NAMESPACE,
|
|
1674
|
+
name: "resolveColorFunc",
|
|
1675
|
+
value
|
|
1676
|
+
},
|
|
1677
|
+
opt
|
|
1678
|
+
);
|
|
1679
|
+
const cachedResult = getCache(cacheKey);
|
|
1680
|
+
if (cachedResult instanceof CacheItem) {
|
|
1681
|
+
if (cachedResult.isNull) {
|
|
1682
|
+
return cachedResult;
|
|
1683
|
+
}
|
|
1684
|
+
const cachedItem = cachedResult.item;
|
|
1685
|
+
if (isString(cachedItem)) {
|
|
1686
|
+
return cachedItem;
|
|
1687
|
+
}
|
|
1688
|
+
return cachedItem;
|
|
1689
|
+
}
|
|
1690
|
+
if (!REG_FN_COLOR.test(value)) {
|
|
1691
|
+
const res2 = resolveInvalidColorValue(format, nullable);
|
|
1692
|
+
if (res2 instanceof NullObject) {
|
|
1693
|
+
setCache(cacheKey, null);
|
|
1694
|
+
return res2;
|
|
1695
|
+
}
|
|
1696
|
+
setCache(cacheKey, res2);
|
|
1697
|
+
if (isString(res2)) {
|
|
1698
|
+
return res2;
|
|
1699
|
+
}
|
|
1700
|
+
return res2;
|
|
1701
|
+
}
|
|
1702
|
+
const [cs, v1, v2, v3, v4] = parseColorFunc(
|
|
1703
|
+
value,
|
|
1704
|
+
opt
|
|
1705
|
+
);
|
|
1706
|
+
if (REG_SPEC.test(format) || format === VAL_MIX && cs === colorSpace) {
|
|
1707
|
+
const res2 = [cs, v1, v2, v3, v4];
|
|
1708
|
+
setCache(cacheKey, res2);
|
|
1709
|
+
return res2;
|
|
1710
|
+
}
|
|
1711
|
+
const x = parseFloat(`${v1}`);
|
|
1712
|
+
const y = parseFloat(`${v2}`);
|
|
1713
|
+
const z = parseFloat(`${v3}`);
|
|
1714
|
+
const alpha = parseAlpha(`${v4}`);
|
|
1715
|
+
const [r, g, b] = transformXyzToRgb([x, y, z], true);
|
|
1716
|
+
const res = ["rgb", r, g, b, alpha];
|
|
1717
|
+
setCache(cacheKey, res);
|
|
1718
|
+
return res;
|
|
1719
|
+
};
|
|
1720
|
+
const convertColorToLinearRgb = (value, opt = {}) => {
|
|
1721
|
+
if (isString(value)) {
|
|
1722
|
+
value = value.trim();
|
|
1723
|
+
} else {
|
|
1724
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1725
|
+
}
|
|
1726
|
+
const { colorSpace = "", format = "" } = opt;
|
|
1727
|
+
let cs = "";
|
|
1728
|
+
let r, g, b, alpha, x, y, z;
|
|
1729
|
+
if (format === VAL_MIX) {
|
|
1730
|
+
let xyz;
|
|
1731
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1732
|
+
xyz = parseColorFunc(value, opt);
|
|
1733
|
+
} else {
|
|
1734
|
+
xyz = parseColorValue(value, opt);
|
|
1735
|
+
}
|
|
1736
|
+
if (xyz instanceof NullObject) {
|
|
1737
|
+
return xyz;
|
|
1738
|
+
}
|
|
1739
|
+
[cs, x, y, z, alpha] = xyz;
|
|
1740
|
+
if (cs === colorSpace) {
|
|
1741
|
+
return [x, y, z, alpha];
|
|
1742
|
+
}
|
|
1743
|
+
[r, g, b] = transformMatrix(MATRIX_XYZ_TO_L_RGB, [x, y, z], true);
|
|
1744
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1745
|
+
const [, val] = value.match(REG_FN_COLOR);
|
|
1746
|
+
const [cs2] = val.replace("/", " ").split(/\s+/);
|
|
1747
|
+
if (cs2 === "srgb-linear") {
|
|
1748
|
+
[, r, g, b, alpha] = resolveColorFunc(value, {
|
|
1749
|
+
format: VAL_COMP
|
|
1750
|
+
});
|
|
1751
|
+
} else {
|
|
1752
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
1753
|
+
[r, g, b] = transformMatrix(MATRIX_XYZ_TO_L_RGB, [x, y, z], true);
|
|
1754
|
+
}
|
|
1755
|
+
} else {
|
|
1756
|
+
[, x, y, z, alpha] = parseColorValue(value);
|
|
1757
|
+
[r, g, b] = transformMatrix(MATRIX_XYZ_TO_L_RGB, [x, y, z], true);
|
|
1758
|
+
}
|
|
1759
|
+
return [
|
|
1760
|
+
Math.min(Math.max(r, 0), 1),
|
|
1761
|
+
Math.min(Math.max(g, 0), 1),
|
|
1762
|
+
Math.min(Math.max(b, 0), 1),
|
|
1763
|
+
alpha
|
|
1764
|
+
];
|
|
1765
|
+
};
|
|
1766
|
+
const convertColorToRgb = (value, opt = {}) => {
|
|
1767
|
+
if (isString(value)) {
|
|
1768
|
+
value = value.trim();
|
|
1769
|
+
} else {
|
|
1770
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1771
|
+
}
|
|
1772
|
+
const { format = "" } = opt;
|
|
1773
|
+
let r, g, b, alpha;
|
|
1774
|
+
if (format === VAL_MIX) {
|
|
1775
|
+
let rgb;
|
|
1776
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1777
|
+
rgb = resolveColorFunc(value, opt);
|
|
1778
|
+
} else {
|
|
1779
|
+
rgb = resolveColorValue(value, opt);
|
|
1780
|
+
}
|
|
1781
|
+
if (rgb instanceof NullObject) {
|
|
1782
|
+
return rgb;
|
|
1783
|
+
}
|
|
1784
|
+
[, r, g, b, alpha] = rgb;
|
|
1785
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1786
|
+
const [, val] = value.match(REG_FN_COLOR);
|
|
1787
|
+
const [cs] = val.replace("/", " ").split(/\s+/);
|
|
1788
|
+
if (cs === "srgb") {
|
|
1789
|
+
[, r, g, b, alpha] = resolveColorFunc(value, {
|
|
1790
|
+
format: VAL_COMP
|
|
1791
|
+
});
|
|
1792
|
+
r *= MAX_RGB;
|
|
1793
|
+
g *= MAX_RGB;
|
|
1794
|
+
b *= MAX_RGB;
|
|
1795
|
+
} else {
|
|
1796
|
+
[, r, g, b, alpha] = resolveColorFunc(value);
|
|
1797
|
+
}
|
|
1798
|
+
} else if (/^(?:ok)?l(?:ab|ch)/.test(value)) {
|
|
1799
|
+
[r, g, b, alpha] = convertColorToLinearRgb(value);
|
|
1800
|
+
[r, g, b] = transformLinearRgbToRgb([r, g, b]);
|
|
1801
|
+
} else {
|
|
1802
|
+
[, r, g, b, alpha] = resolveColorValue(value, {
|
|
1803
|
+
format: VAL_COMP
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
return [r, g, b, alpha];
|
|
1807
|
+
};
|
|
1808
|
+
const convertColorToXyz = (value, opt = {}) => {
|
|
1809
|
+
if (isString(value)) {
|
|
1810
|
+
value = value.trim();
|
|
1811
|
+
} else {
|
|
1812
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1813
|
+
}
|
|
1814
|
+
const { d50 = false, format = "" } = opt;
|
|
1815
|
+
let x, y, z, alpha;
|
|
1816
|
+
if (format === VAL_MIX) {
|
|
1817
|
+
let xyz;
|
|
1818
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1819
|
+
xyz = parseColorFunc(value, opt);
|
|
1820
|
+
} else {
|
|
1821
|
+
xyz = parseColorValue(value, opt);
|
|
1822
|
+
}
|
|
1823
|
+
if (xyz instanceof NullObject) {
|
|
1824
|
+
return xyz;
|
|
1825
|
+
}
|
|
1826
|
+
[, x, y, z, alpha] = xyz;
|
|
1827
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1828
|
+
const [, val] = value.match(REG_FN_COLOR);
|
|
1829
|
+
const [cs] = val.replace("/", " ").split(/\s+/);
|
|
1830
|
+
if (d50) {
|
|
1831
|
+
if (cs === "xyz-d50") {
|
|
1832
|
+
[, x, y, z, alpha] = resolveColorFunc(value, {
|
|
1833
|
+
format: VAL_COMP
|
|
1834
|
+
});
|
|
1835
|
+
} else {
|
|
1836
|
+
[, x, y, z, alpha] = parseColorFunc(
|
|
1837
|
+
value,
|
|
1838
|
+
opt
|
|
1839
|
+
);
|
|
1840
|
+
}
|
|
1841
|
+
} else if (/^xyz(?:-d65)?$/.test(cs)) {
|
|
1842
|
+
[, x, y, z, alpha] = resolveColorFunc(value, {
|
|
1843
|
+
format: VAL_COMP
|
|
1844
|
+
});
|
|
1845
|
+
} else {
|
|
1846
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
1847
|
+
}
|
|
1848
|
+
} else {
|
|
1849
|
+
[, x, y, z, alpha] = parseColorValue(value, opt);
|
|
1850
|
+
}
|
|
1851
|
+
return [x, y, z, alpha];
|
|
1852
|
+
};
|
|
1853
|
+
const convertColorToHsl = (value, opt = {}) => {
|
|
1854
|
+
if (isString(value)) {
|
|
1855
|
+
value = value.trim();
|
|
1856
|
+
} else {
|
|
1857
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1858
|
+
}
|
|
1859
|
+
const { format = "" } = opt;
|
|
1860
|
+
let h, s, l, alpha;
|
|
1861
|
+
if (REG_HSL.test(value)) {
|
|
1862
|
+
[, h, s, l, alpha] = parseHsl(value, {
|
|
1863
|
+
format: "hsl"
|
|
1864
|
+
});
|
|
1865
|
+
if (format === "hsl") {
|
|
1866
|
+
return [Math.round(h), Math.round(s), Math.round(l), alpha];
|
|
1867
|
+
}
|
|
1868
|
+
return [h, s, l, alpha];
|
|
1869
|
+
}
|
|
1870
|
+
let x, y, z;
|
|
1871
|
+
if (format === VAL_MIX) {
|
|
1872
|
+
let xyz;
|
|
1873
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1874
|
+
xyz = parseColorFunc(value, opt);
|
|
1875
|
+
} else {
|
|
1876
|
+
xyz = parseColorValue(value, opt);
|
|
1877
|
+
}
|
|
1878
|
+
if (xyz instanceof NullObject) {
|
|
1879
|
+
return xyz;
|
|
1880
|
+
}
|
|
1881
|
+
[, x, y, z, alpha] = xyz;
|
|
1882
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1883
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
1884
|
+
} else {
|
|
1885
|
+
[, x, y, z, alpha] = parseColorValue(value);
|
|
1886
|
+
}
|
|
1887
|
+
[h, s, l] = transformXyzToHsl([x, y, z], true);
|
|
1888
|
+
if (format === "hsl") {
|
|
1889
|
+
return [Math.round(h), Math.round(s), Math.round(l), alpha];
|
|
1890
|
+
}
|
|
1891
|
+
return [format === VAL_MIX && s === 0 ? NONE : h, s, l, alpha];
|
|
1892
|
+
};
|
|
1893
|
+
const convertColorToHwb = (value, opt = {}) => {
|
|
1894
|
+
if (isString(value)) {
|
|
1895
|
+
value = value.trim();
|
|
1896
|
+
} else {
|
|
1897
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1898
|
+
}
|
|
1899
|
+
const { format = "" } = opt;
|
|
1900
|
+
let h, w, b, alpha;
|
|
1901
|
+
if (REG_HWB.test(value)) {
|
|
1902
|
+
[, h, w, b, alpha] = parseHwb(value, {
|
|
1903
|
+
format: "hwb"
|
|
1904
|
+
});
|
|
1905
|
+
if (format === "hwb") {
|
|
1906
|
+
return [Math.round(h), Math.round(w), Math.round(b), alpha];
|
|
1907
|
+
}
|
|
1908
|
+
return [h, w, b, alpha];
|
|
1909
|
+
}
|
|
1910
|
+
let x, y, z;
|
|
1911
|
+
if (format === VAL_MIX) {
|
|
1912
|
+
let xyz;
|
|
1913
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1914
|
+
xyz = parseColorFunc(value, opt);
|
|
1915
|
+
} else {
|
|
1916
|
+
xyz = parseColorValue(value, opt);
|
|
1917
|
+
}
|
|
1918
|
+
if (xyz instanceof NullObject) {
|
|
1919
|
+
return xyz;
|
|
1920
|
+
}
|
|
1921
|
+
[, x, y, z, alpha] = xyz;
|
|
1922
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1923
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
1924
|
+
} else {
|
|
1925
|
+
[, x, y, z, alpha] = parseColorValue(value);
|
|
1926
|
+
}
|
|
1927
|
+
[h, w, b] = transformXyzToHwb([x, y, z], true);
|
|
1928
|
+
if (format === "hwb") {
|
|
1929
|
+
return [Math.round(h), Math.round(w), Math.round(b), alpha];
|
|
1930
|
+
}
|
|
1931
|
+
return [format === VAL_MIX && w + b >= 100 ? NONE : h, w, b, alpha];
|
|
1932
|
+
};
|
|
1933
|
+
const convertColorToLab = (value, opt = {}) => {
|
|
1934
|
+
if (isString(value)) {
|
|
1935
|
+
value = value.trim();
|
|
1936
|
+
} else {
|
|
1937
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1938
|
+
}
|
|
1939
|
+
const { format = "" } = opt;
|
|
1940
|
+
let l, a, b, alpha;
|
|
1941
|
+
if (REG_LAB.test(value)) {
|
|
1942
|
+
[, l, a, b, alpha] = parseLab(value, {
|
|
1943
|
+
format: VAL_COMP
|
|
1944
|
+
});
|
|
1945
|
+
return [l, a, b, alpha];
|
|
1946
|
+
}
|
|
1947
|
+
let x, y, z;
|
|
1948
|
+
if (format === VAL_MIX) {
|
|
1949
|
+
let xyz;
|
|
1950
|
+
opt.d50 = true;
|
|
1951
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1952
|
+
xyz = parseColorFunc(value, opt);
|
|
1953
|
+
} else {
|
|
1954
|
+
xyz = parseColorValue(value, opt);
|
|
1955
|
+
}
|
|
1956
|
+
if (xyz instanceof NullObject) {
|
|
1957
|
+
return xyz;
|
|
1958
|
+
}
|
|
1959
|
+
[, x, y, z, alpha] = xyz;
|
|
1960
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
1961
|
+
[, x, y, z, alpha] = parseColorFunc(value, {
|
|
1962
|
+
d50: true
|
|
1963
|
+
});
|
|
1964
|
+
} else {
|
|
1965
|
+
[, x, y, z, alpha] = parseColorValue(value, {
|
|
1966
|
+
d50: true
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
[l, a, b] = transformXyzD50ToLab([x, y, z], true);
|
|
1970
|
+
return [l, a, b, alpha];
|
|
1971
|
+
};
|
|
1972
|
+
const convertColorToLch = (value, opt = {}) => {
|
|
1973
|
+
if (isString(value)) {
|
|
1974
|
+
value = value.trim();
|
|
1975
|
+
} else {
|
|
1976
|
+
throw new TypeError(`${value} is not a string.`);
|
|
1977
|
+
}
|
|
1978
|
+
const { format = "" } = opt;
|
|
1979
|
+
let l, c, h, alpha;
|
|
1980
|
+
if (REG_LCH.test(value)) {
|
|
1981
|
+
[, l, c, h, alpha] = parseLch(value, {
|
|
1982
|
+
format: VAL_COMP
|
|
1983
|
+
});
|
|
1984
|
+
return [l, c, h, alpha];
|
|
1985
|
+
}
|
|
1986
|
+
let x, y, z;
|
|
1987
|
+
if (format === VAL_MIX) {
|
|
1988
|
+
let xyz;
|
|
1989
|
+
opt.d50 = true;
|
|
1990
|
+
if (value.startsWith(FN_COLOR)) {
|
|
1991
|
+
xyz = parseColorFunc(value, opt);
|
|
1992
|
+
} else {
|
|
1993
|
+
xyz = parseColorValue(value, opt);
|
|
1994
|
+
}
|
|
1995
|
+
if (xyz instanceof NullObject) {
|
|
1996
|
+
return xyz;
|
|
1997
|
+
}
|
|
1998
|
+
[, x, y, z, alpha] = xyz;
|
|
1999
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
2000
|
+
[, x, y, z, alpha] = parseColorFunc(value, {
|
|
2001
|
+
d50: true
|
|
2002
|
+
});
|
|
2003
|
+
} else {
|
|
2004
|
+
[, x, y, z, alpha] = parseColorValue(value, {
|
|
2005
|
+
d50: true
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
[l, c, h] = transformXyzD50ToLch([x, y, z], true);
|
|
2009
|
+
return [l, c, format === VAL_MIX && c === 0 ? NONE : h, alpha];
|
|
2010
|
+
};
|
|
2011
|
+
const convertColorToOklab = (value, opt = {}) => {
|
|
2012
|
+
if (isString(value)) {
|
|
2013
|
+
value = value.trim();
|
|
2014
|
+
} else {
|
|
2015
|
+
throw new TypeError(`${value} is not a string.`);
|
|
2016
|
+
}
|
|
2017
|
+
const { format = "" } = opt;
|
|
2018
|
+
let l, a, b, alpha;
|
|
2019
|
+
if (REG_OKLAB.test(value)) {
|
|
2020
|
+
[, l, a, b, alpha] = parseOklab(value, {
|
|
2021
|
+
format: VAL_COMP
|
|
2022
|
+
});
|
|
2023
|
+
return [l, a, b, alpha];
|
|
2024
|
+
}
|
|
2025
|
+
let x, y, z;
|
|
2026
|
+
if (format === VAL_MIX) {
|
|
2027
|
+
let xyz;
|
|
2028
|
+
if (value.startsWith(FN_COLOR)) {
|
|
2029
|
+
xyz = parseColorFunc(value, opt);
|
|
2030
|
+
} else {
|
|
2031
|
+
xyz = parseColorValue(value, opt);
|
|
2032
|
+
}
|
|
2033
|
+
if (xyz instanceof NullObject) {
|
|
2034
|
+
return xyz;
|
|
2035
|
+
}
|
|
2036
|
+
[, x, y, z, alpha] = xyz;
|
|
2037
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
2038
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
2039
|
+
} else {
|
|
2040
|
+
[, x, y, z, alpha] = parseColorValue(value);
|
|
2041
|
+
}
|
|
2042
|
+
[l, a, b] = transformXyzToOklab([x, y, z], true);
|
|
2043
|
+
return [l, a, b, alpha];
|
|
2044
|
+
};
|
|
2045
|
+
const convertColorToOklch = (value, opt = {}) => {
|
|
2046
|
+
if (isString(value)) {
|
|
2047
|
+
value = value.trim();
|
|
2048
|
+
} else {
|
|
2049
|
+
throw new TypeError(`${value} is not a string.`);
|
|
2050
|
+
}
|
|
2051
|
+
const { format = "" } = opt;
|
|
2052
|
+
let l, c, h, alpha;
|
|
2053
|
+
if (REG_OKLCH.test(value)) {
|
|
2054
|
+
[, l, c, h, alpha] = parseOklch(value, {
|
|
2055
|
+
format: VAL_COMP
|
|
2056
|
+
});
|
|
2057
|
+
return [l, c, h, alpha];
|
|
2058
|
+
}
|
|
2059
|
+
let x, y, z;
|
|
2060
|
+
if (format === VAL_MIX) {
|
|
2061
|
+
let xyz;
|
|
2062
|
+
if (value.startsWith(FN_COLOR)) {
|
|
2063
|
+
xyz = parseColorFunc(value, opt);
|
|
2064
|
+
} else {
|
|
2065
|
+
xyz = parseColorValue(value, opt);
|
|
2066
|
+
}
|
|
2067
|
+
if (xyz instanceof NullObject) {
|
|
2068
|
+
return xyz;
|
|
2069
|
+
}
|
|
2070
|
+
[, x, y, z, alpha] = xyz;
|
|
2071
|
+
} else if (value.startsWith(FN_COLOR)) {
|
|
2072
|
+
[, x, y, z, alpha] = parseColorFunc(value);
|
|
2073
|
+
} else {
|
|
2074
|
+
[, x, y, z, alpha] = parseColorValue(value);
|
|
2075
|
+
}
|
|
2076
|
+
[l, c, h] = transformXyzToOklch([x, y, z], true);
|
|
2077
|
+
return [l, c, format === VAL_MIX && c === 0 ? NONE : h, alpha];
|
|
2078
|
+
};
|
|
2079
|
+
const resolveColorMix = (value, opt = {}) => {
|
|
2080
|
+
if (isString(value)) {
|
|
2081
|
+
value = value.toLowerCase().trim();
|
|
2082
|
+
} else {
|
|
2083
|
+
throw new TypeError(`${value} is not a string.`);
|
|
2084
|
+
}
|
|
2085
|
+
const { format = "", nullable = false } = opt;
|
|
2086
|
+
const cacheKey = createCacheKey(
|
|
2087
|
+
{
|
|
2088
|
+
namespace: NAMESPACE,
|
|
2089
|
+
name: "resolveColorMix",
|
|
2090
|
+
value
|
|
2091
|
+
},
|
|
2092
|
+
opt
|
|
2093
|
+
);
|
|
2094
|
+
const cachedResult = getCache(cacheKey);
|
|
2095
|
+
if (cachedResult instanceof CacheItem) {
|
|
2096
|
+
if (cachedResult.isNull) {
|
|
2097
|
+
return cachedResult;
|
|
2098
|
+
}
|
|
2099
|
+
const cachedItem = cachedResult.item;
|
|
2100
|
+
if (isString(cachedItem)) {
|
|
2101
|
+
return cachedItem;
|
|
2102
|
+
}
|
|
2103
|
+
return cachedItem;
|
|
2104
|
+
}
|
|
2105
|
+
const nestedItems = [];
|
|
2106
|
+
let colorSpace = "";
|
|
2107
|
+
let hueArc = "";
|
|
2108
|
+
let colorA = "";
|
|
2109
|
+
let pctA = "";
|
|
2110
|
+
let colorB = "";
|
|
2111
|
+
let pctB = "";
|
|
2112
|
+
let parsed = false;
|
|
2113
|
+
if (!REG_MIX.test(value)) {
|
|
2114
|
+
if (value.startsWith(FN_MIX) && REG_MIX_NEST.test(value)) {
|
|
2115
|
+
const regColorSpace = new RegExp(`^(?:${CS_RGB}|${CS_XYZ})$`);
|
|
2116
|
+
const items = value.match(REG_MIX_NEST);
|
|
2117
|
+
for (const item of items) {
|
|
2118
|
+
if (item) {
|
|
2119
|
+
let val = resolveColorMix(item, {
|
|
2120
|
+
format: format === VAL_SPEC ? format : VAL_COMP
|
|
2121
|
+
});
|
|
2122
|
+
if (Array.isArray(val)) {
|
|
2123
|
+
const [cs, v1, v2, v3, v4] = val;
|
|
2124
|
+
if (v1 === 0 && v2 === 0 && v3 === 0 && v4 === 0) {
|
|
2125
|
+
value = "";
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
if (regColorSpace.test(cs)) {
|
|
2129
|
+
if (v4 === 1) {
|
|
2130
|
+
val = `color(${cs} ${v1} ${v2} ${v3})`;
|
|
2131
|
+
} else {
|
|
2132
|
+
val = `color(${cs} ${v1} ${v2} ${v3} / ${v4})`;
|
|
2133
|
+
}
|
|
2134
|
+
} else if (v4 === 1) {
|
|
2135
|
+
val = `${cs}(${v1} ${v2} ${v3})`;
|
|
2136
|
+
} else {
|
|
2137
|
+
val = `${cs}(${v1} ${v2} ${v3} / ${v4})`;
|
|
2138
|
+
}
|
|
2139
|
+
} else if (!REG_MIX.test(val)) {
|
|
2140
|
+
value = "";
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
nestedItems.push(val);
|
|
2144
|
+
value = value.replace(item, val);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
if (!value) {
|
|
2148
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2149
|
+
return res2;
|
|
2150
|
+
}
|
|
2151
|
+
} else if (value.startsWith(FN_MIX) && value.endsWith(")") && value.includes(FN_LIGHT_DARK)) {
|
|
2152
|
+
const regColorSpace = new RegExp(`in\\s+(${CS_MIX})`);
|
|
2153
|
+
const colorParts = value.replace(FN_MIX, "").replace(/\)$/, "");
|
|
2154
|
+
const [csPart = "", partA = "", partB = ""] = splitValue(colorParts, {
|
|
2155
|
+
delimiter: ","
|
|
2156
|
+
});
|
|
2157
|
+
const [colorPartA = "", pctPartA = ""] = splitValue(partA);
|
|
2158
|
+
const [colorPartB = "", pctPartB = ""] = splitValue(partB);
|
|
2159
|
+
const specifiedColorA = resolveColor(colorPartA, {
|
|
2160
|
+
format: VAL_SPEC
|
|
2161
|
+
});
|
|
2162
|
+
const specifiedColorB = resolveColor(colorPartB, {
|
|
2163
|
+
format: VAL_SPEC
|
|
2164
|
+
});
|
|
2165
|
+
if (regColorSpace.test(csPart) && specifiedColorA && specifiedColorB) {
|
|
2166
|
+
if (format === VAL_SPEC) {
|
|
2167
|
+
const [, cs] = csPart.match(regColorSpace);
|
|
2168
|
+
if (REG_CS_HUE.test(cs)) {
|
|
2169
|
+
[, colorSpace, hueArc] = cs.match(REG_CS_HUE);
|
|
2170
|
+
} else {
|
|
2171
|
+
colorSpace = cs;
|
|
2172
|
+
}
|
|
2173
|
+
colorA = specifiedColorA;
|
|
2174
|
+
if (pctPartA) {
|
|
2175
|
+
pctA = pctPartA;
|
|
2176
|
+
}
|
|
2177
|
+
colorB = specifiedColorB;
|
|
2178
|
+
if (pctPartB) {
|
|
2179
|
+
pctB = pctPartB;
|
|
2180
|
+
}
|
|
2181
|
+
value = value.replace(colorPartA, specifiedColorA).replace(colorPartB, specifiedColorB);
|
|
2182
|
+
parsed = true;
|
|
2183
|
+
} else {
|
|
2184
|
+
const resolvedColorA = resolveColor(colorPartA, opt);
|
|
2185
|
+
const resolvedColorB = resolveColor(colorPartB, opt);
|
|
2186
|
+
if (isString(resolvedColorA) && isString(resolvedColorB)) {
|
|
2187
|
+
value = value.replace(colorPartA, resolvedColorA).replace(colorPartB, resolvedColorB);
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
} else {
|
|
2191
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2192
|
+
return res2;
|
|
2193
|
+
}
|
|
2194
|
+
} else {
|
|
2195
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2196
|
+
return res2;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
if (nestedItems.length && format === VAL_SPEC) {
|
|
2200
|
+
const regColorSpace = new RegExp(`^color-mix\\(\\s*in\\s+(${CS_MIX})\\s*,`);
|
|
2201
|
+
const [, cs] = value.match(regColorSpace);
|
|
2202
|
+
if (REG_CS_HUE.test(cs)) {
|
|
2203
|
+
[, colorSpace, hueArc] = cs.match(REG_CS_HUE);
|
|
2204
|
+
} else {
|
|
2205
|
+
colorSpace = cs;
|
|
2206
|
+
}
|
|
2207
|
+
if (nestedItems.length === 2) {
|
|
2208
|
+
let [itemA, itemB] = nestedItems;
|
|
2209
|
+
itemA = itemA.replace(/(?=[()])/g, "\\");
|
|
2210
|
+
itemB = itemB.replace(/(?=[()])/g, "\\");
|
|
2211
|
+
const regA = new RegExp(`(${itemA})(?:\\s+(${PCT}))?`);
|
|
2212
|
+
const regB = new RegExp(`(${itemB})(?:\\s+(${PCT}))?`);
|
|
2213
|
+
[, colorA, pctA] = value.match(regA);
|
|
2214
|
+
[, colorB, pctB] = value.match(regB);
|
|
2215
|
+
} else {
|
|
2216
|
+
let [item] = nestedItems;
|
|
2217
|
+
item = item.replace(/(?=[()])/g, "\\");
|
|
2218
|
+
const itemPart = `${item}(?:\\s+${PCT})?`;
|
|
2219
|
+
const itemPartCapt = `(${item})(?:\\s+(${PCT}))?`;
|
|
2220
|
+
const regItemPart = new RegExp(`^${itemPartCapt}$`);
|
|
2221
|
+
const regLastItem = new RegExp(`${itemPartCapt}\\s*\\)$`);
|
|
2222
|
+
const regColorPart = new RegExp(`^(${SYN_COLOR_TYPE})(?:\\s+(${PCT}))?$`);
|
|
2223
|
+
if (regLastItem.test(value)) {
|
|
2224
|
+
const reg = new RegExp(
|
|
2225
|
+
`(${SYN_MIX_PART})\\s*,\\s*(${itemPart})\\s*\\)$`
|
|
2226
|
+
);
|
|
2227
|
+
const [, colorPartA, colorPartB] = value.match(reg);
|
|
2228
|
+
[, colorA, pctA] = colorPartA.match(regColorPart);
|
|
2229
|
+
[, colorB, pctB] = colorPartB.match(regItemPart);
|
|
2230
|
+
} else {
|
|
2231
|
+
const reg = new RegExp(
|
|
2232
|
+
`(${itemPart})\\s*,\\s*(${SYN_MIX_PART})\\s*\\)$`
|
|
2233
|
+
);
|
|
2234
|
+
const [, colorPartA, colorPartB] = value.match(reg);
|
|
2235
|
+
[, colorA, pctA] = colorPartA.match(regItemPart);
|
|
2236
|
+
[, colorB, pctB] = colorPartB.match(regColorPart);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
} else if (!parsed) {
|
|
2240
|
+
const [, cs, colorPartA, colorPartB] = value.match(
|
|
2241
|
+
REG_MIX_CAPT
|
|
2242
|
+
);
|
|
2243
|
+
const reg = new RegExp(`^(${SYN_COLOR_TYPE})(?:\\s+(${PCT}))?$`);
|
|
2244
|
+
[, colorA, pctA] = colorPartA.match(reg);
|
|
2245
|
+
[, colorB, pctB] = colorPartB.match(reg);
|
|
2246
|
+
if (REG_CS_HUE.test(cs)) {
|
|
2247
|
+
[, colorSpace, hueArc] = cs.match(REG_CS_HUE);
|
|
2248
|
+
} else {
|
|
2249
|
+
colorSpace = cs;
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
let pA, pB, m;
|
|
2253
|
+
if (pctA && pctB) {
|
|
2254
|
+
const p1 = parseFloat(pctA) / MAX_PCT;
|
|
2255
|
+
const p2 = parseFloat(pctB) / MAX_PCT;
|
|
2256
|
+
if (p1 < 0 || p1 > 1 || p2 < 0 || p2 > 1 || p1 === 0 && p2 === 0) {
|
|
2257
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2258
|
+
return res2;
|
|
2259
|
+
}
|
|
2260
|
+
const factor = p1 + p2;
|
|
2261
|
+
pA = p1 / factor;
|
|
2262
|
+
pB = p2 / factor;
|
|
2263
|
+
m = factor < 1 ? factor : 1;
|
|
2264
|
+
} else {
|
|
2265
|
+
if (pctA) {
|
|
2266
|
+
pA = parseFloat(pctA) / MAX_PCT;
|
|
2267
|
+
if (pA < 0 || pA > 1) {
|
|
2268
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2269
|
+
return res2;
|
|
2270
|
+
}
|
|
2271
|
+
pB = 1 - pA;
|
|
2272
|
+
} else if (pctB) {
|
|
2273
|
+
pB = parseFloat(pctB) / MAX_PCT;
|
|
2274
|
+
if (pB < 0 || pB > 1) {
|
|
2275
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2276
|
+
return res2;
|
|
2277
|
+
}
|
|
2278
|
+
pA = 1 - pB;
|
|
2279
|
+
} else {
|
|
2280
|
+
pA = HALF;
|
|
2281
|
+
pB = HALF;
|
|
2282
|
+
}
|
|
2283
|
+
m = 1;
|
|
2284
|
+
}
|
|
2285
|
+
if (colorSpace === "xyz") {
|
|
2286
|
+
colorSpace = "xyz-d65";
|
|
2287
|
+
}
|
|
2288
|
+
if (format === VAL_SPEC) {
|
|
2289
|
+
let valueA = "";
|
|
2290
|
+
let valueB = "";
|
|
2291
|
+
if (colorA.startsWith(FN_MIX) || colorA.startsWith(FN_LIGHT_DARK)) {
|
|
2292
|
+
valueA = colorA;
|
|
2293
|
+
} else if (colorA.startsWith(FN_COLOR)) {
|
|
2294
|
+
const [cs, v1, v2, v3, v4] = parseColorFunc(
|
|
2295
|
+
colorA,
|
|
2296
|
+
opt
|
|
2297
|
+
);
|
|
2298
|
+
if (v4 === 1) {
|
|
2299
|
+
valueA = `color(${cs} ${v1} ${v2} ${v3})`;
|
|
2300
|
+
} else {
|
|
2301
|
+
valueA = `color(${cs} ${v1} ${v2} ${v3} / ${v4})`;
|
|
2302
|
+
}
|
|
2303
|
+
} else {
|
|
2304
|
+
const val = parseColorValue(colorA, opt);
|
|
2305
|
+
if (Array.isArray(val)) {
|
|
2306
|
+
const [cs, v1, v2, v3, v4] = val;
|
|
2307
|
+
if (v4 === 1) {
|
|
2308
|
+
if (cs === "rgb") {
|
|
2309
|
+
valueA = `${cs}(${v1}, ${v2}, ${v3})`;
|
|
2310
|
+
} else {
|
|
2311
|
+
valueA = `${cs}(${v1} ${v2} ${v3})`;
|
|
2312
|
+
}
|
|
2313
|
+
} else if (cs === "rgb") {
|
|
2314
|
+
valueA = `${cs}a(${v1}, ${v2}, ${v3}, ${v4})`;
|
|
2315
|
+
} else {
|
|
2316
|
+
valueA = `${cs}(${v1} ${v2} ${v3} / ${v4})`;
|
|
2317
|
+
}
|
|
2318
|
+
} else {
|
|
2319
|
+
if (!isString(val) || !val) {
|
|
2320
|
+
setCache(cacheKey, "");
|
|
2321
|
+
return "";
|
|
2322
|
+
}
|
|
2323
|
+
valueA = val;
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
if (colorB.startsWith(FN_MIX) || colorB.startsWith(FN_LIGHT_DARK)) {
|
|
2327
|
+
valueB = colorB;
|
|
2328
|
+
} else if (colorB.startsWith(FN_COLOR)) {
|
|
2329
|
+
const [cs, v1, v2, v3, v4] = parseColorFunc(
|
|
2330
|
+
colorB,
|
|
2331
|
+
opt
|
|
2332
|
+
);
|
|
2333
|
+
if (v4 === 1) {
|
|
2334
|
+
valueB = `color(${cs} ${v1} ${v2} ${v3})`;
|
|
2335
|
+
} else {
|
|
2336
|
+
valueB = `color(${cs} ${v1} ${v2} ${v3} / ${v4})`;
|
|
2337
|
+
}
|
|
2338
|
+
} else {
|
|
2339
|
+
const val = parseColorValue(colorB, opt);
|
|
2340
|
+
if (Array.isArray(val)) {
|
|
2341
|
+
const [cs, v1, v2, v3, v4] = val;
|
|
2342
|
+
if (v4 === 1) {
|
|
2343
|
+
if (cs === "rgb") {
|
|
2344
|
+
valueB = `${cs}(${v1}, ${v2}, ${v3})`;
|
|
2345
|
+
} else {
|
|
2346
|
+
valueB = `${cs}(${v1} ${v2} ${v3})`;
|
|
2347
|
+
}
|
|
2348
|
+
} else if (cs === "rgb") {
|
|
2349
|
+
valueB = `${cs}a(${v1}, ${v2}, ${v3}, ${v4})`;
|
|
2350
|
+
} else {
|
|
2351
|
+
valueB = `${cs}(${v1} ${v2} ${v3} / ${v4})`;
|
|
2352
|
+
}
|
|
2353
|
+
} else {
|
|
2354
|
+
if (!isString(val) || !val) {
|
|
2355
|
+
setCache(cacheKey, "");
|
|
2356
|
+
return "";
|
|
2357
|
+
}
|
|
2358
|
+
valueB = val;
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
if (pctA && pctB) {
|
|
2362
|
+
valueA += ` ${parseFloat(pctA)}%`;
|
|
2363
|
+
valueB += ` ${parseFloat(pctB)}%`;
|
|
2364
|
+
} else if (pctA) {
|
|
2365
|
+
const pA2 = parseFloat(pctA);
|
|
2366
|
+
if (pA2 !== MAX_PCT * HALF) {
|
|
2367
|
+
valueA += ` ${pA2}%`;
|
|
2368
|
+
}
|
|
2369
|
+
} else if (pctB) {
|
|
2370
|
+
const pA2 = MAX_PCT - parseFloat(pctB);
|
|
2371
|
+
if (pA2 !== MAX_PCT * HALF) {
|
|
2372
|
+
valueA += ` ${pA2}%`;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
if (hueArc) {
|
|
2376
|
+
const res2 = `color-mix(in ${colorSpace} ${hueArc} hue, ${valueA}, ${valueB})`;
|
|
2377
|
+
setCache(cacheKey, res2);
|
|
2378
|
+
return res2;
|
|
2379
|
+
} else {
|
|
2380
|
+
const res2 = `color-mix(in ${colorSpace}, ${valueA}, ${valueB})`;
|
|
2381
|
+
setCache(cacheKey, res2);
|
|
2382
|
+
return res2;
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
let r = 0;
|
|
2386
|
+
let g = 0;
|
|
2387
|
+
let b = 0;
|
|
2388
|
+
let alpha = 0;
|
|
2389
|
+
if (/^srgb(?:-linear)?$/.test(colorSpace)) {
|
|
2390
|
+
let rgbA, rgbB;
|
|
2391
|
+
if (colorSpace === "srgb") {
|
|
2392
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2393
|
+
rgbA = [NONE, NONE, NONE, NONE];
|
|
2394
|
+
} else {
|
|
2395
|
+
rgbA = convertColorToRgb(colorA, {
|
|
2396
|
+
colorSpace,
|
|
2397
|
+
format: VAL_MIX
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2401
|
+
rgbB = [NONE, NONE, NONE, NONE];
|
|
2402
|
+
} else {
|
|
2403
|
+
rgbB = convertColorToRgb(colorB, {
|
|
2404
|
+
colorSpace,
|
|
2405
|
+
format: VAL_MIX
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
} else {
|
|
2409
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2410
|
+
rgbA = [NONE, NONE, NONE, NONE];
|
|
2411
|
+
} else {
|
|
2412
|
+
rgbA = convertColorToLinearRgb(colorA, {
|
|
2413
|
+
colorSpace,
|
|
2414
|
+
format: VAL_MIX
|
|
2415
|
+
});
|
|
2416
|
+
}
|
|
2417
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2418
|
+
rgbB = [NONE, NONE, NONE, NONE];
|
|
2419
|
+
} else {
|
|
2420
|
+
rgbB = convertColorToLinearRgb(colorB, {
|
|
2421
|
+
colorSpace,
|
|
2422
|
+
format: VAL_MIX
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
if (rgbA instanceof NullObject || rgbB instanceof NullObject) {
|
|
2427
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2428
|
+
return res2;
|
|
2429
|
+
}
|
|
2430
|
+
const [rrA, ggA, bbA, aaA] = rgbA;
|
|
2431
|
+
const [rrB, ggB, bbB, aaB] = rgbB;
|
|
2432
|
+
const rNone = rrA === NONE && rrB === NONE;
|
|
2433
|
+
const gNone = ggA === NONE && ggB === NONE;
|
|
2434
|
+
const bNone = bbA === NONE && bbB === NONE;
|
|
2435
|
+
const alphaNone = aaA === NONE && aaB === NONE;
|
|
2436
|
+
const [[rA, gA, bA, alphaA], [rB, gB, bB, alphaB]] = normalizeColorComponents(
|
|
2437
|
+
[rrA, ggA, bbA, aaA],
|
|
2438
|
+
[rrB, ggB, bbB, aaB],
|
|
2439
|
+
true
|
|
2440
|
+
);
|
|
2441
|
+
const factorA = alphaA * pA;
|
|
2442
|
+
const factorB = alphaB * pB;
|
|
2443
|
+
alpha = factorA + factorB;
|
|
2444
|
+
if (alpha === 0) {
|
|
2445
|
+
r = rA * pA + rB * pB;
|
|
2446
|
+
g = gA * pA + gB * pB;
|
|
2447
|
+
b = bA * pA + bB * pB;
|
|
2448
|
+
} else {
|
|
2449
|
+
r = (rA * factorA + rB * factorB) / alpha;
|
|
2450
|
+
g = (gA * factorA + gB * factorB) / alpha;
|
|
2451
|
+
b = (bA * factorA + bB * factorB) / alpha;
|
|
2452
|
+
alpha = parseFloat(alpha.toFixed(3));
|
|
2453
|
+
}
|
|
2454
|
+
if (format === VAL_COMP) {
|
|
2455
|
+
const res2 = [
|
|
2456
|
+
colorSpace,
|
|
2457
|
+
rNone ? NONE : roundToPrecision(r, HEX),
|
|
2458
|
+
gNone ? NONE : roundToPrecision(g, HEX),
|
|
2459
|
+
bNone ? NONE : roundToPrecision(b, HEX),
|
|
2460
|
+
alphaNone ? NONE : alpha * m
|
|
2461
|
+
];
|
|
2462
|
+
setCache(cacheKey, res2);
|
|
2463
|
+
return res2;
|
|
2464
|
+
}
|
|
2465
|
+
r *= MAX_RGB;
|
|
2466
|
+
g *= MAX_RGB;
|
|
2467
|
+
b *= MAX_RGB;
|
|
2468
|
+
} else if (REG_CS_XYZ.test(colorSpace)) {
|
|
2469
|
+
let xyzA, xyzB;
|
|
2470
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2471
|
+
xyzA = [NONE, NONE, NONE, NONE];
|
|
2472
|
+
} else {
|
|
2473
|
+
xyzA = convertColorToXyz(colorA, {
|
|
2474
|
+
colorSpace,
|
|
2475
|
+
d50: colorSpace === "xyz-d50",
|
|
2476
|
+
format: VAL_MIX
|
|
2477
|
+
});
|
|
2478
|
+
}
|
|
2479
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2480
|
+
xyzB = [NONE, NONE, NONE, NONE];
|
|
2481
|
+
} else {
|
|
2482
|
+
xyzB = convertColorToXyz(colorB, {
|
|
2483
|
+
colorSpace,
|
|
2484
|
+
d50: colorSpace === "xyz-d50",
|
|
2485
|
+
format: VAL_MIX
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
if (xyzA instanceof NullObject || xyzB instanceof NullObject) {
|
|
2489
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2490
|
+
return res2;
|
|
2491
|
+
}
|
|
2492
|
+
const [xxA, yyA, zzA, aaA] = xyzA;
|
|
2493
|
+
const [xxB, yyB, zzB, aaB] = xyzB;
|
|
2494
|
+
const xNone = xxA === NONE && xxB === NONE;
|
|
2495
|
+
const yNone = yyA === NONE && yyB === NONE;
|
|
2496
|
+
const zNone = zzA === NONE && zzB === NONE;
|
|
2497
|
+
const alphaNone = aaA === NONE && aaB === NONE;
|
|
2498
|
+
const [[xA, yA, zA, alphaA], [xB, yB, zB, alphaB]] = normalizeColorComponents(
|
|
2499
|
+
[xxA, yyA, zzA, aaA],
|
|
2500
|
+
[xxB, yyB, zzB, aaB],
|
|
2501
|
+
true
|
|
2502
|
+
);
|
|
2503
|
+
const factorA = alphaA * pA;
|
|
2504
|
+
const factorB = alphaB * pB;
|
|
2505
|
+
alpha = factorA + factorB;
|
|
2506
|
+
let x, y, z;
|
|
2507
|
+
if (alpha === 0) {
|
|
2508
|
+
x = xA * pA + xB * pB;
|
|
2509
|
+
y = yA * pA + yB * pB;
|
|
2510
|
+
z = zA * pA + zB * pB;
|
|
2511
|
+
} else {
|
|
2512
|
+
x = (xA * factorA + xB * factorB) / alpha;
|
|
2513
|
+
y = (yA * factorA + yB * factorB) / alpha;
|
|
2514
|
+
z = (zA * factorA + zB * factorB) / alpha;
|
|
2515
|
+
alpha = parseFloat(alpha.toFixed(3));
|
|
2516
|
+
}
|
|
2517
|
+
if (format === VAL_COMP) {
|
|
2518
|
+
const res2 = [
|
|
2519
|
+
colorSpace,
|
|
2520
|
+
xNone ? NONE : roundToPrecision(x, HEX),
|
|
2521
|
+
yNone ? NONE : roundToPrecision(y, HEX),
|
|
2522
|
+
zNone ? NONE : roundToPrecision(z, HEX),
|
|
2523
|
+
alphaNone ? NONE : alpha * m
|
|
2524
|
+
];
|
|
2525
|
+
setCache(cacheKey, res2);
|
|
2526
|
+
return res2;
|
|
2527
|
+
}
|
|
2528
|
+
if (colorSpace === "xyz-d50") {
|
|
2529
|
+
[r, g, b] = transformXyzD50ToRgb([x, y, z], true);
|
|
2530
|
+
} else {
|
|
2531
|
+
[r, g, b] = transformXyzToRgb([x, y, z], true);
|
|
2532
|
+
}
|
|
2533
|
+
} else if (/^h(?:sl|wb)$/.test(colorSpace)) {
|
|
2534
|
+
let hslA, hslB;
|
|
2535
|
+
if (colorSpace === "hsl") {
|
|
2536
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2537
|
+
hslA = [NONE, NONE, NONE, NONE];
|
|
2538
|
+
} else {
|
|
2539
|
+
hslA = convertColorToHsl(colorA, {
|
|
2540
|
+
colorSpace,
|
|
2541
|
+
format: VAL_MIX
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2545
|
+
hslB = [NONE, NONE, NONE, NONE];
|
|
2546
|
+
} else {
|
|
2547
|
+
hslB = convertColorToHsl(colorB, {
|
|
2548
|
+
colorSpace,
|
|
2549
|
+
format: VAL_MIX
|
|
2550
|
+
});
|
|
2551
|
+
}
|
|
2552
|
+
} else {
|
|
2553
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2554
|
+
hslA = [NONE, NONE, NONE, NONE];
|
|
2555
|
+
} else {
|
|
2556
|
+
hslA = convertColorToHwb(colorA, {
|
|
2557
|
+
colorSpace,
|
|
2558
|
+
format: VAL_MIX
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2562
|
+
hslB = [NONE, NONE, NONE, NONE];
|
|
2563
|
+
} else {
|
|
2564
|
+
hslB = convertColorToHwb(colorB, {
|
|
2565
|
+
colorSpace,
|
|
2566
|
+
format: VAL_MIX
|
|
2567
|
+
});
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
if (hslA instanceof NullObject || hslB instanceof NullObject) {
|
|
2571
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2572
|
+
return res2;
|
|
2573
|
+
}
|
|
2574
|
+
const [hhA, ssA, llA, aaA] = hslA;
|
|
2575
|
+
const [hhB, ssB, llB, aaB] = hslB;
|
|
2576
|
+
const alphaNone = aaA === NONE && aaB === NONE;
|
|
2577
|
+
let [[hA, sA, lA, alphaA], [hB, sB, lB, alphaB]] = normalizeColorComponents(
|
|
2578
|
+
[hhA, ssA, llA, aaA],
|
|
2579
|
+
[hhB, ssB, llB, aaB],
|
|
2580
|
+
true
|
|
2581
|
+
);
|
|
2582
|
+
if (hueArc) {
|
|
2583
|
+
[hA, hB] = interpolateHue(hA, hB, hueArc);
|
|
2584
|
+
}
|
|
2585
|
+
const factorA = alphaA * pA;
|
|
2586
|
+
const factorB = alphaB * pB;
|
|
2587
|
+
alpha = factorA + factorB;
|
|
2588
|
+
const h = (hA * pA + hB * pB) % DEG;
|
|
2589
|
+
let s, l;
|
|
2590
|
+
if (alpha === 0) {
|
|
2591
|
+
s = sA * pA + sB * pB;
|
|
2592
|
+
l = lA * pA + lB * pB;
|
|
2593
|
+
} else {
|
|
2594
|
+
s = (sA * factorA + sB * factorB) / alpha;
|
|
2595
|
+
l = (lA * factorA + lB * factorB) / alpha;
|
|
2596
|
+
alpha = parseFloat(alpha.toFixed(3));
|
|
2597
|
+
}
|
|
2598
|
+
[r, g, b] = convertColorToRgb(
|
|
2599
|
+
`${colorSpace}(${h} ${s} ${l})`
|
|
2600
|
+
);
|
|
2601
|
+
if (format === VAL_COMP) {
|
|
2602
|
+
const res2 = [
|
|
2603
|
+
"srgb",
|
|
2604
|
+
roundToPrecision(r / MAX_RGB, HEX),
|
|
2605
|
+
roundToPrecision(g / MAX_RGB, HEX),
|
|
2606
|
+
roundToPrecision(b / MAX_RGB, HEX),
|
|
2607
|
+
alphaNone ? NONE : alpha * m
|
|
2608
|
+
];
|
|
2609
|
+
setCache(cacheKey, res2);
|
|
2610
|
+
return res2;
|
|
2611
|
+
}
|
|
2612
|
+
} else if (/^(?:ok)?lch$/.test(colorSpace)) {
|
|
2613
|
+
let lchA, lchB;
|
|
2614
|
+
if (colorSpace === "lch") {
|
|
2615
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2616
|
+
lchA = [NONE, NONE, NONE, NONE];
|
|
2617
|
+
} else {
|
|
2618
|
+
lchA = convertColorToLch(colorA, {
|
|
2619
|
+
colorSpace,
|
|
2620
|
+
format: VAL_MIX
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2623
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2624
|
+
lchB = [NONE, NONE, NONE, NONE];
|
|
2625
|
+
} else {
|
|
2626
|
+
lchB = convertColorToLch(colorB, {
|
|
2627
|
+
colorSpace,
|
|
2628
|
+
format: VAL_MIX
|
|
2629
|
+
});
|
|
2630
|
+
}
|
|
2631
|
+
} else {
|
|
2632
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2633
|
+
lchA = [NONE, NONE, NONE, NONE];
|
|
2634
|
+
} else {
|
|
2635
|
+
lchA = convertColorToOklch(colorA, {
|
|
2636
|
+
colorSpace,
|
|
2637
|
+
format: VAL_MIX
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2641
|
+
lchB = [NONE, NONE, NONE, NONE];
|
|
2642
|
+
} else {
|
|
2643
|
+
lchB = convertColorToOklch(colorB, {
|
|
2644
|
+
colorSpace,
|
|
2645
|
+
format: VAL_MIX
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
if (lchA instanceof NullObject || lchB instanceof NullObject) {
|
|
2650
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2651
|
+
return res2;
|
|
2652
|
+
}
|
|
2653
|
+
const [llA, ccA, hhA, aaA] = lchA;
|
|
2654
|
+
const [llB, ccB, hhB, aaB] = lchB;
|
|
2655
|
+
const lNone = llA === NONE && llB === NONE;
|
|
2656
|
+
const cNone = ccA === NONE && ccB === NONE;
|
|
2657
|
+
const hNone = hhA === NONE && hhB === NONE;
|
|
2658
|
+
const alphaNone = aaA === NONE && aaB === NONE;
|
|
2659
|
+
let [[lA, cA, hA, alphaA], [lB, cB, hB, alphaB]] = normalizeColorComponents(
|
|
2660
|
+
[llA, ccA, hhA, aaA],
|
|
2661
|
+
[llB, ccB, hhB, aaB],
|
|
2662
|
+
true
|
|
2663
|
+
);
|
|
2664
|
+
if (hueArc) {
|
|
2665
|
+
[hA, hB] = interpolateHue(hA, hB, hueArc);
|
|
2666
|
+
}
|
|
2667
|
+
const factorA = alphaA * pA;
|
|
2668
|
+
const factorB = alphaB * pB;
|
|
2669
|
+
alpha = factorA + factorB;
|
|
2670
|
+
const h = (hA * pA + hB * pB) % DEG;
|
|
2671
|
+
let l, c;
|
|
2672
|
+
if (alpha === 0) {
|
|
2673
|
+
l = lA * pA + lB * pB;
|
|
2674
|
+
c = cA * pA + cB * pB;
|
|
2675
|
+
} else {
|
|
2676
|
+
l = (lA * factorA + lB * factorB) / alpha;
|
|
2677
|
+
c = (cA * factorA + cB * factorB) / alpha;
|
|
2678
|
+
alpha = parseFloat(alpha.toFixed(3));
|
|
2679
|
+
}
|
|
2680
|
+
if (format === VAL_COMP) {
|
|
2681
|
+
const res2 = [
|
|
2682
|
+
colorSpace,
|
|
2683
|
+
lNone ? NONE : roundToPrecision(l, HEX),
|
|
2684
|
+
cNone ? NONE : roundToPrecision(c, HEX),
|
|
2685
|
+
hNone ? NONE : roundToPrecision(h, HEX),
|
|
2686
|
+
alphaNone ? NONE : alpha * m
|
|
2687
|
+
];
|
|
2688
|
+
setCache(cacheKey, res2);
|
|
2689
|
+
return res2;
|
|
2690
|
+
}
|
|
2691
|
+
[, r, g, b] = resolveColorValue(
|
|
2692
|
+
`${colorSpace}(${l} ${c} ${h})`
|
|
2693
|
+
);
|
|
2694
|
+
} else {
|
|
2695
|
+
let labA, labB;
|
|
2696
|
+
if (colorSpace === "lab") {
|
|
2697
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2698
|
+
labA = [NONE, NONE, NONE, NONE];
|
|
2699
|
+
} else {
|
|
2700
|
+
labA = convertColorToLab(colorA, {
|
|
2701
|
+
colorSpace,
|
|
2702
|
+
format: VAL_MIX
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2706
|
+
labB = [NONE, NONE, NONE, NONE];
|
|
2707
|
+
} else {
|
|
2708
|
+
labB = convertColorToLab(colorB, {
|
|
2709
|
+
colorSpace,
|
|
2710
|
+
format: VAL_MIX
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
} else {
|
|
2714
|
+
if (REG_CURRENT.test(colorA)) {
|
|
2715
|
+
labA = [NONE, NONE, NONE, NONE];
|
|
2716
|
+
} else {
|
|
2717
|
+
labA = convertColorToOklab(colorA, {
|
|
2718
|
+
colorSpace,
|
|
2719
|
+
format: VAL_MIX
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
if (REG_CURRENT.test(colorB)) {
|
|
2723
|
+
labB = [NONE, NONE, NONE, NONE];
|
|
2724
|
+
} else {
|
|
2725
|
+
labB = convertColorToOklab(colorB, {
|
|
2726
|
+
colorSpace,
|
|
2727
|
+
format: VAL_MIX
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
if (labA instanceof NullObject || labB instanceof NullObject) {
|
|
2732
|
+
const res2 = cacheInvalidColorValue(cacheKey, format, nullable);
|
|
2733
|
+
return res2;
|
|
2734
|
+
}
|
|
2735
|
+
const [llA, aaA, bbA, alA] = labA;
|
|
2736
|
+
const [llB, aaB, bbB, alB] = labB;
|
|
2737
|
+
const lNone = llA === NONE && llB === NONE;
|
|
2738
|
+
const aNone = aaA === NONE && aaB === NONE;
|
|
2739
|
+
const bNone = bbA === NONE && bbB === NONE;
|
|
2740
|
+
const alphaNone = alA === NONE && alB === NONE;
|
|
2741
|
+
const [[lA, aA, bA, alphaA], [lB, aB, bB, alphaB]] = normalizeColorComponents(
|
|
2742
|
+
[llA, aaA, bbA, alA],
|
|
2743
|
+
[llB, aaB, bbB, alB],
|
|
2744
|
+
true
|
|
2745
|
+
);
|
|
2746
|
+
const factorA = alphaA * pA;
|
|
2747
|
+
const factorB = alphaB * pB;
|
|
2748
|
+
alpha = factorA + factorB;
|
|
2749
|
+
let l, aO, bO;
|
|
2750
|
+
if (alpha === 0) {
|
|
2751
|
+
l = lA * pA + lB * pB;
|
|
2752
|
+
aO = aA * pA + aB * pB;
|
|
2753
|
+
bO = bA * pA + bB * pB;
|
|
2754
|
+
} else {
|
|
2755
|
+
l = (lA * factorA + lB * factorB) / alpha;
|
|
2756
|
+
aO = (aA * factorA + aB * factorB) / alpha;
|
|
2757
|
+
bO = (bA * factorA + bB * factorB) / alpha;
|
|
2758
|
+
alpha = parseFloat(alpha.toFixed(3));
|
|
2759
|
+
}
|
|
2760
|
+
if (format === VAL_COMP) {
|
|
2761
|
+
const res2 = [
|
|
2762
|
+
colorSpace,
|
|
2763
|
+
lNone ? NONE : roundToPrecision(l, HEX),
|
|
2764
|
+
aNone ? NONE : roundToPrecision(aO, HEX),
|
|
2765
|
+
bNone ? NONE : roundToPrecision(bO, HEX),
|
|
2766
|
+
alphaNone ? NONE : alpha * m
|
|
2767
|
+
];
|
|
2768
|
+
setCache(cacheKey, res2);
|
|
2769
|
+
return res2;
|
|
2770
|
+
}
|
|
2771
|
+
[, r, g, b] = resolveColorValue(
|
|
2772
|
+
`${colorSpace}(${l} ${aO} ${bO})`
|
|
2773
|
+
);
|
|
2774
|
+
}
|
|
2775
|
+
const res = [
|
|
2776
|
+
"rgb",
|
|
2777
|
+
Math.round(r),
|
|
2778
|
+
Math.round(g),
|
|
2779
|
+
Math.round(b),
|
|
2780
|
+
parseFloat((alpha * m).toFixed(3))
|
|
2781
|
+
];
|
|
2782
|
+
setCache(cacheKey, res);
|
|
2783
|
+
return res;
|
|
2784
|
+
};
|
|
2785
|
+
export {
|
|
2786
|
+
NAMED_COLORS,
|
|
2787
|
+
angleToDeg,
|
|
2788
|
+
cacheInvalidColorValue,
|
|
2789
|
+
convertColorToHsl,
|
|
2790
|
+
convertColorToHwb,
|
|
2791
|
+
convertColorToLab,
|
|
2792
|
+
convertColorToLch,
|
|
2793
|
+
convertColorToLinearRgb,
|
|
2794
|
+
convertColorToOklab,
|
|
2795
|
+
convertColorToOklch,
|
|
2796
|
+
convertColorToRgb,
|
|
2797
|
+
convertColorToXyz,
|
|
2798
|
+
convertHexToLinearRgb,
|
|
2799
|
+
convertHexToRgb,
|
|
2800
|
+
convertHexToXyz,
|
|
2801
|
+
convertRgbToHex,
|
|
2802
|
+
normalizeColorComponents,
|
|
2803
|
+
numberToHexString,
|
|
2804
|
+
parseAlpha,
|
|
2805
|
+
parseColorFunc,
|
|
2806
|
+
parseColorValue,
|
|
2807
|
+
parseHexAlpha,
|
|
2808
|
+
parseHsl,
|
|
2809
|
+
parseHwb,
|
|
2810
|
+
parseLab,
|
|
2811
|
+
parseLch,
|
|
2812
|
+
parseOklab,
|
|
2813
|
+
parseOklch,
|
|
2814
|
+
parseRgb,
|
|
2815
|
+
resolveColorFunc,
|
|
2816
|
+
resolveColorMix,
|
|
2817
|
+
resolveColorValue,
|
|
2818
|
+
resolveInvalidColorValue,
|
|
2819
|
+
transformLinearRgbToRgb,
|
|
2820
|
+
transformMatrix,
|
|
2821
|
+
transformRgbToLinearRgb,
|
|
2822
|
+
transformRgbToXyz,
|
|
2823
|
+
transformXyzD50ToLab,
|
|
2824
|
+
transformXyzD50ToLch,
|
|
2825
|
+
transformXyzD50ToRgb,
|
|
2826
|
+
transformXyzToHsl,
|
|
2827
|
+
transformXyzToHwb,
|
|
2828
|
+
transformXyzToOklab,
|
|
2829
|
+
transformXyzToOklch,
|
|
2830
|
+
transformXyzToRgb,
|
|
2831
|
+
validateColorComponents
|
|
2832
|
+
};
|
|
2833
|
+
//# sourceMappingURL=color.js.map
|